aspose file tools*
The moose likes Web Services and the fly likes How to get the request / response details in xml format for a web service call that i make Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to get the request / response details in xml format for a web service call that i make" Watch "How to get the request / response details in xml format for a web service call that i make" New topic
Author

How to get the request / response details in xml format for a web service call that i make

Joshua Emerson
Greenhorn

Joined: Apr 21, 2008
Posts: 19
How to get the request / response details in xml format for a web service call that i make.

For now the request is being sent as Request Object and response is received as Response Object. The output is received after executing the execute method whose return type is response object. Is there a way to get the full xml trace of request and response. Need to get it through the code implementation or enable logging details and not through any tool like SoapUI. Any help please..

Thanks,
Josh.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
What is an "xml trace of request and response" - can you give an example? It sounds kind of convoluted, though; mabe the best things is to take a step back and tell us what is is that you're trying to accomplish on a higher level.
Joshua Emerson
Greenhorn

Joined: Apr 21, 2008
Posts: 19
Need to get like this from logs.

Sample Request :
--------------------
<soapenv:body>
<sch:findCompanyByKeyword>
<sch:maxRecords>20</sch:maxRecords>
</sch:findCompanyByKeyword>
</soapenvbody>

Sample Response:
---------------------
<sch:companyresults>
<sch:companyId>1002030</sch:companyId>
<sch:companyName>xperia</sch:companyName>
</sch:companyresults>

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
My question was more: *Why* do you need this? What do you intend to do with it?
Joshua Emerson
Greenhorn

Joined: Apr 21, 2008
Posts: 19
One of the search api call is not getting the correct result. Need to capture the data and need to work with different team. The team expects the actual formatted xml that is getting generated.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
Why would you need to generated XML for that? You have the request data (it's your code making the WS call, after all), and the response data is made available through API calls in your generated code. What good does the actual XML do? Or do you suspect a bug in the WS implementation that generates and parses the SOAP?
Joshua Emerson
Greenhorn

Joined: Apr 21, 2008
Posts: 19
Some thing is wrong in the code or in data. I was not in the dev phase. It's in prod. Facing an issue in one of the api call. That is why actual xml data is needed.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Usually people use a tool such as TCPMON or SOAPui to capture the actual text of SOAP request and response messages.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to get the request / response details in xml format for a web service call that i make