This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
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.
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
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: HTTP status code from Soap message
 
It's not a secret anymore!