• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

QName usage for SOAP message

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Attractive, successful people love this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic