Ask the Expert

Accessing SOAP header details from within a Web service

I need to gain access to and extract the SOAP header details from within my Web service. How do I go about writing my WSDL to expose the underlying SOAP header data?

    Requires Free Membership to View

Typically, you don't specify headers in a WSDL document, and the headers are not available to the Web service application agent. Headers are usually processed by handlers (e.g., JAX-RPC handlers or HTTP pipeline modules) during the SOAP message processing pipeline. All headers must be processed (and stripped out of the message) before the request is passed to the application. Any information that needs to be sent to the application agent should be passed in the body rather than in the header.

If you do need to get this header information, then you will need to implement a handler that captures the header information and puts it someplace accessible by the application. Typically there's a context object that you should be able to use.

This was first published in June 2005

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: