ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carroll" <...@microbrightfield.com>
Subject RE: Can we use XML RPC Client within an Applet
Date Wed, 18 May 2005 13:11:52 GMT
 

Hi Sumeet, 

 

The applet can be an XML-RPC client, and it can make requests to other machines, the trick

is that the applet make the request back to the originating machine (the one with the web
page

and the applet...)   but make the request to something that will proxy the request to the
other

machine, receive the result, and then return that result to your applet.  You can use a Directory

directive in apache.conf with mod_proxy to do the proxying...  (but be careful you don't let
it

proxy any request from anywhere to anywhere, hackers will use this to anonymize their traffic.)

There are other ways of having something on your originating server return the results from


another machine too...  a java servlet would look something like:

 

                    URL url = new URL(ourRequest);

                    URLConnection connection = url.openConnection();

 

                    BufferedInputStream bis = new BufferedInputStream(connection.getInputStream());

                    OutputStream binout = null;

 

                    byte[] storage = new byte[storageLength];

                    binout = response.getOutputStream();

                    // relay whatever content type is returned from our request

                    response.setContentType(connection.getContentType());

 

                    while (true)

                    {

                        int bytesRead = bis.read(storage, 0, storageLength);

 

                        if (bytesRead == -1)

                        {

                            break;

                        }

 

                        binout.write(storage, 0, bytesRead);

                   ....

 

(not a working example.)

 

-Jim

 

________________________________

From: sumeet.s@netsol.co.in [mailto:sumeet.s@netsol.co.in] 
Sent: Wednesday, May 18, 2005 12:44 AM
To: xmlrpc-user@ws.apache.org
Subject: RE: Can we use XML RPC Client within an Applet

 

Hi andreas, 
  Is the server the applet tries to connect to the same one it (the applet) originated from
? 
A: No. It is a different machine. 
  

Rgds, 
Sumeet 
-----Original Message----- 
From: "Schölver, Andreas" [mailto:Andreas.Schoelver@ebootis.de] 
Sent: Tuesday, May 17, 2005 4:56 PM 
To: 'xmlrpc-user@ws.apache.org' 
Subject: RE: Can we use XML RPC Client within an Applet 

Is the server the applet tries to connect to the same one it (the applet) originated from
? 
  
Andreas 
-----Original Message----- 
From: sumeet.s@netsol.co.in [mailto:sumeet.s@netsol.co.in] 
Sent: Sunday, May 15, 2005 7:33 AM 
To: xmlrpc-user@ws.apache.org 
Subject: Can we use XML RPC Client within an Applet 
Hi all, 
   I am using XML RPC Version 1.2 b1 and it is giving such an error when I access xml rpc
requests from an applet.  It works fine until I have been running as a standalone client,
but when I wrap it up as an applet it gives the following error message. Could anyone tell
me what am I doing wrong.  

java.security.AccessControlException: access denied (java.util.PropertyPermission org.apache.xmlrpc.TypeFactory
read) 
            at java.security.AccessControlContext.checkPermission(Unknown Source) 
            at java.security.AccessController.checkPermission(Unknown Source) 
            at java.lang.SecurityManager.checkPermission(Unknown Source) 
            at java.lang.SecurityManager.checkPropertyAccess(Unknown Source) 
            at java.lang.System.getProperty(Unknown Source) 
            at org.apache.xmlrpc.XmlRpc.<init>(XmlRpc.java:200) 
            at org.apache.xmlrpc.XmlRpcClient$Worker.<init>(XmlRpcClient.java:325) 
            at org.apache.xmlrpc.XmlRpcClient.getWorker(XmlRpcClient.java:234) 
            at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:160) 
            at MyApplet$20.actionPerformed(MyApplet.java:2236) 
            at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) 
            at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) 
            at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) 
            at javax.swing.DefaultButtonModel.setPressed(Unknown Source) 
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) 
            at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) 
            at java.awt.Component.processMouseEvent(Unknown Source) 
            at javax.swing.JComponent.processMouseEvent(Unknown Source) 
            at java.awt.Component.processEvent(Unknown Source) 
            at java.awt.Container.processEvent(Unknown Source) 
            at java.awt.Component.dispatchEventImpl(Unknown Source) 
            at java.awt.Container.dispatchEventImpl(Unknown Source) 
            at java.awt.Component.dispatchEvent(Unknown Source) 
            at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) 
            at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) 
            at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) 
            at java.awt.Container.dispatchEventImpl(Unknown Source) 
            at java.awt.Component.dispatchEvent(Unknown Source) 
            at java.awt.EventQueue.dispatchEvent(Unknown Source) 
            at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source) 
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) 
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
            at java.awt.EventDispatchThread.run(Unknown Source) 
Thanks, 
Sumeet 


Mime
View raw message