File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Code to get  SOAP request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Code to get  SOAP request " Watch "Code to get  SOAP request " New topic
Author

Code to get SOAP request

ashok ballu
Ranch Hand

Joined: Sep 17, 2007
Posts: 30
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


ASHOK BALLU SCJP1.5 SCWCD1.5
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41631
    
  55
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).


Ping & DNS - my free Android networking tools app
ashok ballu
Ranch Hand

Joined: Sep 17, 2007
Posts: 30
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
Marshal

Joined: Mar 22, 2005
Posts: 41631
    
  55
Use one of the tools I mentioned; they can show SOAP requests and responses.
ashok ballu
Ranch Hand

Joined: Sep 17, 2007
Posts: 30
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
Marshal

Joined: Mar 22, 2005
Posts: 41631
    
  55
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

Joined: Sep 17, 2007
Posts: 30
Thank you so much, I also found http request/response + SOAP message in SOAPUI tool through raw option

May i know something about yourself?
 
Consider Paul's rocket mass heater.
 
subject: Code to get SOAP request