jQuery in Action, 2nd edition*
The moose likes Web Services and the fly likes SOAP request from Client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "SOAP request from Client" Watch "SOAP request from Client" New topic
Author

SOAP request from Client

Kiran Kumar
Ranch Hand

Joined: Jan 06, 2003
Posts: 91
Dear All,
Can anyone please tell me if there is a way to capture the SOAP request that the client sends to the server?
I don't find any help with the class "Call" when I looked at the SOAP API at Apache.
Thanks,
Kiran
Kansas State University


------------<br />SCJP
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Apache Axis comes with a SOAP monitoring tool, which logs all coming/going SOAP messages into a GUI.
Check out Axis documentation for details. (I haven't used the tool myself)


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Kiran Kumar
Ranch Hand

Joined: Jan 06, 2003
Posts: 91
Hi Lasse,
Thanks for the reply. I have already few tools which are gonna capture the Client's request in a GUI. But I want to capture the Client's request in a string using basic Java or using SOAP libraries. So, a more clear question is, does SOAP provide any class for capturing the Client's request.
Thanks,
Kiran
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
So you want to get the whole SOAP request, that is the SOAP envelope and headers, right?
The only way I know of is to hack into the SOAP receiver (e.g. Apache Axis) source code. But I would also appreciate if someone knows another solution.
Kiran Kumar
Ranch Hand

Joined: Jan 06, 2003
Posts: 91
Lasse,
The current Apache SOAP code has this capability. You explicitly
create an instance of SOAPHTTPConnection and call the setRequestCopy
method to register a StringBuffer that will receive a copy of the
request. You call the setSOAPTransport method on your Call instance
to tell it to use the connection you have created. After calling
invoke, a copy of the request will be in your StringBuffer.
You can get a nightly build at
http://cvs.apache.org/dist/soap/nightly/.
But, please look at the latest posting by me regarding its working.
Thanks,
Kiran
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Ah. Thanks for the tip.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12789
    
    5
For my SOAP book I wrote a utility to do capture, saving and resending of the full content. Seemy page for the SOAP book. At the bottom of the page is a download for UtilSnoop with source code.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SOAP request from Client