After looking at this more closely, it seems that there are two ways to do this without having to create a BindingProvider, manually messing with SOAP elements, etc, like I mentioned in my previous post. But neither one results the namespace being defined in the header of the Envelope like in Dan's 03/29/2011 11:02:32 AM example above. Instead the namespace is defined within the individual elements. Also, neither one results in a MessageID element being created - just "To" and "Action."
a) On your server-side implementation class, use this annotation:
@com.sun.xml.ws.developer.MemberSubmissionAddressing(enabled=true, required=true)
and in your client code, pass an instance of
com.sun.xml.ws.developer.MemberSubmissionAddressingFeature(true, true)
into your getXXXXXport() method.
b) On your server-side implementation class, use this annotation:
@javax.xml.ws.soap.Addressing(enabled=true, required=true)
and in your client code, pass an instance of
javax.xml.ws.soap.AddressingFeature(true, true)
into your getXXXXXport() method.
One difference between a) and b) is that in order to compile the classes in option a) you need to add to your classpath a jar from either your jaxws-ri or glassfish apps whereas in option b) you do not (if you are on JDK 6).
The other big difference is that in option a), your "To" and "Action" elements in your SOAP header are using the
http://schemas.xmlsoap.org/ws/2004/08/addressing namespace where as in
option b), they are using the
http://www.w3.org/2005/08/addressing namespace which seems to be more recent.
I am not sure which option a) or b) above is considered more "WS-Addressing Compliant," but I suspect that I am still missing something and I would appreciate advice as to how to get the MessageId element in along with the other two, and get my namespace defined once up in the header of the Envelope and still not have to create a BindingProvider, etc, like I mentioned in my previous post. One further note is that I did not tweak my WSDL, in either option, and it has no WS-Addressing-related items in it.
Thanks.