4
votes

I am unable to capture local HTTP traffic when my Java client makes a SOAP request to my local Tomcat instance.

My current configuration is

  • Tomcat instance - run on localhost:8080
  • Local Java client - run from Windows cmd line
  • Fiddler - run on localhost:8888

I used Axis2 wsdl2java to create my client SOAP stub, and used my machines IP address when specifying the WSDL (hosted on Tomcat)

wsdl2java -uri http://192.168.0.5:8080/axis2/services/Version?wsdl -p sample.axisversion -d adb -s

So, the generated code has lines like this throughout:

  public VersionStub(org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault {
    this(configurationContext,"http://192.168.0.5:8080/axis2/services/Version.VersionHttpSoap12Endpoint/" );
}

My client app uses the generated stub and I set the Java proxy to Fiddler using the following code (which gets called before the SOAP stub is actually used):

System.getProperties().put("proxySet", "true");
System.getProperties().put("proxyHost", "localhost");
System.getProperties().put("proxyPort", "8888");

...but still I don't see any request or response traffic in Fiddler. What's missing?

1
How does your code reference the service? Does it use 192.168.0.5 or does it use 127.0.0.1? Does Fiddler capture it if you use a remote hostname or IP? You might try the steps here: fiddler2.com/fiddler/help/hookup.asp#Q-JavaTraffic - EricLaw
Since the wsdl2java tool is provided with the parameter 192.168.0.5, it uses this address in the client stubs that are generated. - Jack

1 Answers

0
votes

Instead of localhost, try to use ipv4.fiddler, which makes sure your localhost traffic goes through fiddler. See also: http://www.fiddler2.com/Fiddler/Help/hookup.asp#Q-LocalTraffic