Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding header - Webservice client - JDK 1.4  RSS feed

kalpana Kumar
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Need help with the below.
I am trying to add header(authentication token) to a webservice client call as part of the header. This is done by a single line of code in JDK 5 and higher versions as below. But how to accomplish the below equivalent in JDK 1.4 and Axis 1.4.

headers.add( authenticationElement) );
( (WSBindingProvider) wsClientEndpoint).setOutboundHeaders( headers );

The Soapmessage is as below.

<env:Envelope xmlns:env="" xmlns:xsi=""
xmlns:soapenc="" xmlns:xsd="">
</env:Envelope> - This is given as part of JDK 6.0. But I cannot use JDK 6.0 and should do the above in JDK 1.4.

Since I could not find the above equivalent in JDK 1.4, I tried creating a SOAPMessage and tried posting the same using SOAPConnection - javax.xml.soap.SOAPConnection to the destination.

as below
SOAPMessage reply =,destination);

But the reply gives SOAPMessageImpl[SOAPPartImpl[null]] as output.

Not sure what is happening. I am trying to achieve the same in both the cases, posting a message to the destination. Please suggest.

Thanks in Advance.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!