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 HTTP status code from Soap message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "HTTP status code from Soap message" Watch "HTTP status code from Soap message" New topic
Author

HTTP status code from Soap message

kaliappan durairaj
Greenhorn

Joined: Nov 24, 2008
Posts: 9
Can any one tell me how to get the HTTP status code from soap message in Webservice.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
That depends on the SOAP stack you use. But why do you need that code? You shouldn't tie the service to a particular transport; if you need an error/status code you can make it part of the SOAP response.


Ping & DNS - my free Android networking tools app
kaliappan durairaj
Greenhorn

Joined: Nov 24, 2008
Posts: 9
Actually in Webservices am having an handler at the client side, below the sample code

public boolean handleResponse(MessageContext arg0) {
Logger.info("Entering into the handleResponse method.............", this.getClass());
SOAPMessageContext ctx = (SOAPMessageContext) arg0;
}

How can we get the HTTP status code from the javax.xml.rpc.handler.MessageContext argument?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
https://jax-ws.dev.java.net/articles/MessageContext.html explains how to do that. It's really not good design to rely on HTTP features, though.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP status code from Soap message