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

QName usage for SOAP message  RSS feed

 
Rajarajan raj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying add a SOAP header in a WebServiceMessageCallback object , so that the SOAP header wil be sent in the SOAP web service request to the service.



I am setting the "endpoint" as the "url".
Is this correct method of setting SOAP Header.
 
g tsuji
Ranch Hand
Posts: 697
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this correct method of setting SOAP Header.

The general look may be about that. But in a closer look, it is very approximative and not really correct.

I am trying add a SOAP header in a WebServiceMessageCallback object , [...]

Not sure what is your calling WebServiceMessageCallback object, may be something essentially the same as SOAPMessageContext, and that's what I would take...


Disregard all the uncertainties associated with header, of its come about etc, the use the QName there is already incorrect. You set up the QName with a namespace-uri (your "url") as the first argument, the second argument "headerName" would be its local name. If you want to use the constructor with three arguments, the third would be related to the prefix you want to have. It is not "value of header" from what it means to suggest being the "value" (text content) of the SOAPHeaderElement. No.

Here is how it would appear to achieve in that direction.

I am setting the "endpoint" as the "url"

The endpoint's url is actually not necessarily the namespace-uri appeared as the first argument of the QName() setup. "Not necessarily" is conceptually meaning "not at all". Be careful. You have to determine the namespace-uri independently of the endpoint's url: from the wsdl or the java code in the code-first approach.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!