permaculture playing cards
The moose likes Web Services and the fly likes Create SOAP headers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Create SOAP headers" Watch "Create SOAP headers" New topic

Create SOAP headers

dale con
Ranch Hand

Joined: Apr 15, 2005
Posts: 93
Can someone please show me how to do this ?

Is it along the lines of

SOAPEnvelope envelope = message.getSOAPEnvelope();
SOAPHeaderElement element = envelope.addHeader("myHeaderNAme");

But I don't know how to put stuff into it and take stuff out

Thanks for any help
milan doshi
Ranch Hand

Joined: Nov 03, 2000
Posts: 43

I think this will depend upon the tool that you are using.

Assuming that you are using Axis (most commonly used ), when we do wsdl2java of the wsdl, the client stub is ALSO generated (org.apache.axis.client.Stub).

This stub has methods like:


Similarly , there are methods like getHeader(..) etc.

Refer Axis API.

Milan Doshi
dale con
Ranch Hand

Joined: Apr 15, 2005
Posts: 93
Hello, I thinmkl i'm missing soemthing - well i must be think cos i'm not understanding this

i think i'm barking up the wrong tree - surely it can't be this hard !!!

Most of the code i'm writing at the moment is server-side, so i haven't done any of the wsdlxml etc.. files yet

If my client creates a header and goes off to my server-side to do validation stuff, how do i return a string from my server-side to the client header ???

And then when the clinet has a vlaue in the header how to i then take that value and return it to the server-side so it cancheck the value??

what is the best way for my client to talk to my server-side code and visa versa ???

Thanks for any help
I agree. Here's the link:
subject: Create SOAP headers
It's not a secret anymore!