• 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

WS-Address working example

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am not clear how we can use ws-address? I searched on line and gone through number of books but couldn't find a single example that shows how to create a soap message with ws-address and the server response back to the replyTo address.
Can any one give a complete example on this?
Thanks in advance
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Web Services Addressing (WS-Addressing) shows examples. One is -



 
hangman
Posts: 220
Angular Framework Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, that is great, Dan!

Can you show us the related WSDL? Or at least the portType and binding sections of it?
 
Bob Nedwor
hangman
Posts: 220
Angular Framework Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was able to get it to work, but it was more than a couple tweaks to the WSDL. To get my request side SOAP message (inbound to the service) to look like this, I needed to hack up my client quite a bit, including casting my service to a BindingProvider, create a SOAPHandler and mess around with the SOAPHeader, SOAPEnvelope, etc. Is there a faster way to build WS-Addressing into your client side that you know of off hand? Thanks for your advice.

 
Bob Nedwor
hangman
Posts: 220
Angular Framework Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In this we see only message addressing roper ties. Where is the other contruct of ws-addressing specification called "EndPointReference". Can you please explain how and where is this used ?
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check here.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic