You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by pv...@SonicWALL.com on 2007/11/07 20:42:58 UTC

Examining XML RPC request packets

Hi,

 

I am using Apache XML RPC library. How do I see the XML RPC
request/response packet capture?

 

My XML RPC request goes through a Java Servlet. 

 

I have tried Ethreal and Wireshark , they don't help.

 

Any help is appreciated.

 

Thanks,

-Preeti Vishwakarma


RE: Examining XML RPC request packets

Posted by pv...@SonicWALL.com.
Here is the packet capture from tcpdump raw file:

POST /xmlrpc HTTP/1.1..Content-Type: text/xml..User-Agent: Apache XML
RPC 3.0 (Jakarta Commons httpclient Transport)..Host:
10.0.89.76:8035..Content-Length: 114....<?xml version="1.0"
encoding="iso-8859-1"?><methodCall><methodName>get_hostname</methodName>
<params/></methodCall>..3G

What is "..3G" at the end of the POST request?

Thanks,
-Preeti

-----Original Message-----
From: Jochen Wiedmann [mailto:jochen.wiedmann@gmail.com] 
Sent: Thursday, November 08, 2007 11:25 PM
To: xmlrpc-dev@ws.apache.org
Subject: Re: Examining XML RPC request packets

On Nov 9, 2007 12:42 AM,  <pv...@sonicwall.com> wrote:
>
> I am using tcpdump for windows to examine the XML RPC request/response
> packets. Why do I see some special characters are the end of xml
> request/response?

How should we know without seeing anything? :-)



-- 
Look, that's why there's rules, understand? So that you think before
you break 'em.

    -- (Terry Pratchett, Thief of Time)

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


Re: Examining XML RPC request packets

Posted by Jochen Wiedmann <jo...@gmail.com>.
On Nov 9, 2007 12:42 AM,  <pv...@sonicwall.com> wrote:
>
> I am using tcpdump for windows to examine the XML RPC request/response
> packets. Why do I see some special characters are the end of xml
> request/response?

How should we know without seeing anything? :-)



-- 
Look, that's why there's rules, understand? So that you think before
you break 'em.

    -- (Terry Pratchett, Thief of Time)

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


RE: Examining XML RPC request packets

Posted by pv...@SonicWALL.com.
I am using tcpdump for windows to examine the XML RPC request/response
packets. Why do I see some special characters are the end of xml
request/response?

Wireshark didn't show me those.

Any help is appreciated.

Thanks,
-Preeti 

-----Original Message-----
From: pvishwakarma@SonicWALL.com [mailto:pvishwakarma@SonicWALL.com] 
Sent: Wednesday, November 07, 2007 2:00 PM
To: xmlrpc-dev@ws.apache.org
Subject: RE: Examining XML RPC request packets


Yup, it worked. I cud see the XML RPC packet capture with Wireshark.

Thanks,
Preeti

-----Original Message-----
From: Jochen Wiedmann [mailto:jochen.wiedmann@gmail.com] 
Sent: Wednesday, November 07, 2007 1:21 PM
To: xmlrpc-dev@ws.apache.org
Subject: Re: Examining XML RPC request packets

On 11/7/07, pvishwakarma@sonicwall.com <pv...@sonicwall.com>
wrote:

> I try with Wireshark and I don't see ant HTTP packet capture. But it
is
> all working fine, I just want to investigate what the XML RPC
> request/response looks like. Because in real system my Server is not
> Java based but C based so I want to see what XML RPC request packet my
> Java Client will send to it.

Start tcpmon on port 8080 and redirect it to 10.0.56.76, port 8032.
Then change your clients URL to http://127.0.0.1:8080/xmlrpc.

Jochen

-- 
Look, that's why there's rules, understand? So that you think before
you break 'em.

    -- (Terry Pratchett, Thief of Time)

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


RE: Examining XML RPC request packets

Posted by pv...@SonicWALL.com.
Yup, it worked. I cud see the XML RPC packet capture with Wireshark.

Thanks,
Preeti

-----Original Message-----
From: Jochen Wiedmann [mailto:jochen.wiedmann@gmail.com] 
Sent: Wednesday, November 07, 2007 1:21 PM
To: xmlrpc-dev@ws.apache.org
Subject: Re: Examining XML RPC request packets

On 11/7/07, pvishwakarma@sonicwall.com <pv...@sonicwall.com>
wrote:

> I try with Wireshark and I don't see ant HTTP packet capture. But it
is
> all working fine, I just want to investigate what the XML RPC
> request/response looks like. Because in real system my Server is not
> Java based but C based so I want to see what XML RPC request packet my
> Java Client will send to it.

Start tcpmon on port 8080 and redirect it to 10.0.56.76, port 8032.
Then change your clients URL to http://127.0.0.1:8080/xmlrpc.

Jochen

-- 
Look, that's why there's rules, understand? So that you think before
you break 'em.

    -- (Terry Pratchett, Thief of Time)

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


Re: Examining XML RPC request packets

Posted by Jochen Wiedmann <jo...@gmail.com>.
On 11/7/07, pvishwakarma@sonicwall.com <pv...@sonicwall.com> wrote:

> I try with Wireshark and I don't see ant HTTP packet capture. But it is
> all working fine, I just want to investigate what the XML RPC
> request/response looks like. Because in real system my Server is not
> Java based but C based so I want to see what XML RPC request packet my
> Java Client will send to it.

Start tcpmon on port 8080 and redirect it to 10.0.56.76, port 8032.
Then change your clients URL to http://127.0.0.1:8080/xmlrpc.

Jochen

-- 
Look, that's why there's rules, understand? So that you think before
you break 'em.

    -- (Terry Pratchett, Thief of Time)

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


RE: Examining XML RPC request packets

Posted by pv...@SonicWALL.com.
Hi Jochen,

Here is my XML RPC Client code:

import java.io.IOException;
import java.net.URL;




import java.util.*;
import java.util.concurrent.*;

import org.apache.xmlrpc.client.*;
import org.apache.xmlrpc.*;



public class testRpc{
	
    public static void main (String[] args) throws Throwable 
	{
        
	 
        
        try
        {
         XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
	   config.setServerURL(new
URL("http://10.0.56.76:8032/xmlrpc"));
         
  	   config.setEncoding("iso-8859-1");

	
         XmlRpcClient xmlRpcClient = new XmlRpcClient();
         xmlRpcClient.setTransportFactory(new
XmlRpcCommonsTransportFactory(xmlRpcClient));
	   xmlRpcClient.setConfig(config);

          HashMap data = new HashMap();
	    data.put("1",new Integer(3));
	    data.put("2",new Integer(5));
		
         Object[] params1 = new Object[]{data};
	     
	     
         // Call the server, and get our result.
         HashMap result = (HashMap)
xmlRpcClient.execute("Calculator.sumAndDifference",params1);
         int sum = ((Integer) result.get("sum")).intValue();
         int difference = ((Integer)
result.get("difference")).intValue();

         // Print out our result.
         System.out.println("Sum: " + Integer.toString(sum) +
                           ", Difference: " +
                           Integer.toString(difference));
         System.out.println(result);
        }
        catch ( IOException ex ) {
            System.out.println( "Network error: The server may not
exist." );
            return;
        }
        catch ( XmlRpcException e)
        {
        	System.out.println(e.getMessage());
        	e.printStackTrace();
        }
	}
}

***********************************************************
Here is my Server code:

import java.util.Hashtable;
import org.apache.xmlrpc.server.*;
import org.apache.xmlrpc.webserver.*;

import org.apache.xmlrpc.server.PropertyHandlerMapping;
import org.apache.xmlrpc.server.XmlRpcServer;
import org.apache.xmlrpc.server.XmlRpcServerConfigImpl;
import org.apache.xmlrpc.webserver.*;


 
public class RpcServer {
    private int port;
    
    public RpcServer( int port ) {
        this.port = port;
    }
    
    

    
    public static void main( String args[] ) throws Exception {
    	  
             WebServer webServer = new WebServer(8032);
           
             XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer();
           
             PropertyHandlerMapping phm = new PropertyHandlerMapping();
             /* Load handler definitions from a property file.
              * The property file might look like:
              *   Calculator=org.apache.xmlrpc.demo.Calculator
              *
org.apache.xmlrpc.demo.proxy.Adder=org.apache.xmlrpc.demo.proxy.AdderImp
l
              */
 
phm.load(Thread.currentThread().getContextClassLoader(),"MyHandlers.prop
erties");
                          
             xmlRpcServer.setHandlerMapping(phm);
           
             XmlRpcServerConfigImpl serverConfig =
                 (XmlRpcServerConfigImpl) xmlRpcServer.getConfig();
             serverConfig.setEnabledForExtensions(true);
             serverConfig.setContentLengthOptional(false);

             webServer.start();
             System.out.println("XML-RPC Server started OK");
         

        
    }
}

****************************************************************
Here is Calculator Class:

import java.util.HashMap;

public class Calculator {
	
	public HashMap sumAndDifference (HashMap data) {
        System.out.println("sumAndDifference called");
        int x = ((Integer)data.get("1")).intValue();
        int y = ((Integer)data.get("2")).intValue();
        
        System.out.println("1:"+ x + "***2:"+y);
    	HashMap result = new HashMap();
        result.put("sum", new Integer(x + y));
        result.put("difference", new Integer(x - y));
        return result;
    }
	
}


Can you tell me what is wrong in this code?

I try with Wireshark and I don't see ant HTTP packet capture. But it is
all working fine, I just want to investigate what the XML RPC
request/response looks like. Because in real system my Server is not
Java based but C based so I want to see what XML RPC request packet my
Java Client will send to it.



Any help is appreciated.

Thanks,
Preeti
 




Preeti Vishwakarma
Software Engineer
T: +1 408.962.6137
pvishwakarma@sonicwall.com
www.sonicwall.com

-----Original Message-----
From: Jochen Wiedmann [mailto:jochen.wiedmann@gmail.com] 
Sent: Wednesday, November 07, 2007 11:58 AM
To: xmlrpc-dev@ws.apache.org
Subject: Re: Examining XML RPC request packets

On 11/7/07, pvishwakarma@sonicwall.com <pv...@sonicwall.com>
wrote:

> I have tried Ethreal and Wireshark , they don't help.

Then you did something wrong. They do help. An alternative tool is
tcpmon, btw.


-- 
Look, that's why there's rules, understand? So that you think before
you break 'em.

    -- (Terry Pratchett, Thief of Time)

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


Re: Examining XML RPC request packets

Posted by Jochen Wiedmann <jo...@gmail.com>.
On 11/7/07, pvishwakarma@sonicwall.com <pv...@sonicwall.com> wrote:

> I have tried Ethreal and Wireshark , they don't help.

Then you did something wrong. They do help. An alternative tool is tcpmon, btw.


-- 
Look, that's why there's rules, understand? So that you think before
you break 'em.

    -- (Terry Pratchett, Thief of Time)

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org