Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Code to get SOAP request

 
ashok ballu
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I am doing a Sample Calculator Webservice Application using JAX-WS .

I making a request to Webservice from servlet, It is working

demo.CalAddService service = new demo.CalAddService();
demo.CalAdd port = service.getCalAddPort();
int result = port.add(a, b);
out.println("Result = "+result);
--------------------------------------------------------------------------
My WebService Code :

@WebService()
public class CalAdd {

@WebMethod(operationName = "add")
public int add(@WebParam(name = "a")
int a, @WebParam(name = "b")
int b) {
return a+b;
}

}


But I would like to catch the SOAP request, can we get ? , if, could you please tell the code to catch the SOAP XML request
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "catch a SOAP request"? If you mean watching it in transit, you can use a tool like tcpmon (on dev.java.net) or SoapUI (on SourceForge).
 
ashok ballu
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your reply.

like ,I want SOAP XML response, actually, I am going to give a seminar on Webservices, so it is better to give seminar with live examples......., that's why I am trying to read the SOAP request/response..... through the code

for WSDL we can shown,
But ,for SOAP XML request/response ?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use one of the tools I mentioned; they can show SOAP requests and responses.
 
ashok ballu
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, I downloaded SoapUI tool, Now Iam able to view the Soap messages, can we also see http request wich conssists of SOAP reuest message
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking at the SOAPUI GUI, I see the HTTP request headers displayed in the lower left. The HTTP request is nothing more than the HTTP headers plus the HTTP body (which consists of nothing but the SOAP request). So all the information is right there; what else are you looking for?

The docs also mention tcpmon integration, if you prefer that kind of view. But it wouldn't show anything that SOAPUI doesn't show as well.
 
ashok ballu
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much, I also found http request/response + SOAP message in SOAPUI tool through raw option

May i know something about yourself?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic