my dog learned polymorphism*
The moose likes Web Services and the fly likes can a servlet have both soap request and simple request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "can a servlet have both soap request and simple request" Watch "can a servlet have both soap request and simple request" New topic
Author

can a servlet have both soap request and simple request

Raj Kumar Bindal
Ranch Hand

Joined: Apr 15, 2006
Posts: 418
I have to make a servlet which will take a request and then it has to check, whether the request has come in the form of soap message or a simple request and then do something accordingly.Please tell me how we can do this.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12760
    
    5
Perhaps you could look at the request headers and forward the request to either a SOAP handling servlet or a simple request handling servlet. Do you have some particular SOAP toolkit in use already? What will be generating the client side request?

Bill
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
In the servlet's doPost method check the content type (ServletRequest.getContentType()). For a SOAP message this will be "text/xml", "application/xml" or "application/soap+xml". If it is one of those types use ServletRequestgetInputStream() or ServletRequest.getParameter("DATA") to access the request body. Then check whether it contains a SOAP envelope. Using XPath is probably the easiest way of accomplishing this.
Raj Kumar Bindal
Ranch Hand

Joined: Apr 15, 2006
Posts: 418
thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can a servlet have both soap request and simple request
 
Similar Threads
Invoking JAX-WS method from browser
RPC SOAP Client in Javascript
Sending calls from SOAP files
Problems reading the request.inputStream()
XML and SOAP ?