Anyone know how to view the XML sent from a web service client?

L

laredotornado

Hi,

I'm generating a web service client (using Maven 1.1) like so ...

<project xmlns:j="jelly:core" xmlns:ant="jelly:ant">
<preGoal name="java:compile">
<ant:property name="downloadedWSDL" value="target/
MatchingService.wsdl" />
<ant:get src="http://localhost:8080//apps/dor/dmv/myapp/myfn//
services/MatchingService?wsdl"
dest="${downloadedWSDL}"
username="username"
password="password" />
<ant:mkdir dir="${maven.build.dir}/src" />
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true"
classpathref="maven.dependency.classpath">
<arg line="-uri ${downloadedWSDL}" />
<arg line="-or" />
<arg line="-d adb" />
<arg line="-o target/" />
</java>
<ant:javac
debug="true"
debuglevel="vars,lines,source"
destdir="${maven.build.dest}"
excludes="**/package.html"
srcdir="${basedir}/target/src" >
<ant:classpath>
<ant:path refid="maven.dependency.classpath" />
</ant:classpath>
</ant:javac>
</preGoal>
</project>


and then I submit a request to the web service using something similar
to this ...

MatchingServiceStub stub = createClientStub();
VerifyAge verifyAge = new VerifyAge();
...
verifyAge.setAgeVerificationRequest(ageVerificationRequest);
VerifyAgeResponse response = stub.verifyAge(verifyAge);

My question is I want to view the XML request sent to the web service
for purposes of testing that XML in SOAP UI, but I don't know how to
get it. Any ideas? - Dave
 
I

Ian Shef

Hi,

I'm generating a web service client (using Maven 1.1) like so ...
and then I submit a request to the web service using something similar
to this ...
My question is I want to view the XML request sent to the web service
for purposes of testing that XML in SOAP UI, but I don't know how to
get it. Any ideas? - Dave

WebScarab is useful for this, but you have to be able to work through a
proxy.

See

http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project
 
M

Mike Schilling

laredotornado said:
My question is I want to view the XML request sent to the web
service
for purposes of testing that XML in SOAP UI, but I don't know how to
get it. Any ideas? - Dave

TCPMON will show you both request and response, though you'll have to
change your request URL to point to TCPMON's port rather than the
service.
 
I

Ian Shef

Hi,

I'm generating a web service client (using Maven 1.1) like so ...
My question is I want to view the XML request sent to the web service
for purposes of testing that XML in SOAP UI, but I don't know how to
get it. Any ideas? - Dave

I am confused. You are using soapUI. One of its features is supposed to be:

"HTTP wire log shows actual requests sent and received "

[from
http://www.soapui.org/features.html#Web_Service_Inspection_and_Invocation ]

Maybe you are looking for help with this feature? The soapUI web site has a
forum. Maybe it is worth checking there?

Good luck!
 
M

Mike Schilling

Ian said:
(e-mail address removed):
Hi,

I'm generating a web service client (using Maven 1.1) like so ...
My question is I want to view the XML request sent to the web
service
for purposes of testing that XML in SOAP UI, but I don't know how
to
get it. Any ideas? - Dave

I am confused. You are using soapUI. One of its features is
supposed to be:

"HTTP wire log shows actual requests sent and received "

[from
http://www.soapui.org/features.html#Web_Service_Inspection_and_Invocation
]

Maybe you are looking for help with this feature? The soapUI web
site has a forum. Maybe it is worth checking there?

soapUI shows the HTTP traffic it generates itself. The OP wants to
see the HTTP traffic generated by his Java progam.
 
A

Arne Vajhøj

Mike said:
TCPMON will show you both request and response, though you'll have to
change your request URL to point to TCPMON's port rather than the
service.

I also use TCPMON when I need to do this. Easy to use.

Arne
 
R

Real Gagnon

My question is I want to view the XML request sent to the web service
for purposes of testing that XML in SOAP UI, but I don't know how to
get it. Any ideas? - Dave

Axis uses Log4J for the logging. You can turn it on with these properties :

log4j.category.org.apache.client.Call=DEBUG
log4j.category.org.apache.axis.transport.http.HTTPSender=DEBUG

Bye.
 
R

RedGrittyBrick

laredotornado said:
My question is I want to view the XML request sent to the web service
for purposes of testing that XML in SOAP UI, but I don't know how to
get it. Any ideas? - Dave

Wireshark, "Analyze" menu, "Follow TCP Stream".
 
R

RedGrittyBrick

RedGrittyBrick said:
Wireshark, "Analyze" menu, "Follow TCP Stream".

Oops, you are using a localhost service, which defeats Wireshark as the
packets don't appear at any network interface. For this situation I run
a loopback proxy on a nearby linux server (or anything where socat can run).

#!/bin/ksh
#
# Create a forwarder to my PC
# This allows me to view SOAP requests sent by Java clients
#
socat -v TCP4-LISTEN:8080,fork TCP4:mypc.mydomain.com:8080

Obviously you then have to tell your Java client to talk to the loopback
server not to localhost.

Socat is nifty!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top