Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WS Addressing and State..

 
C Shinde
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really dont understand the WS Addressing spec.I know it is a feature that can be set when connecting to an endpoint service, and if it is set to true, it sends some information in the address.Can someone tell me what this Spec is all about in brief?

As for maintaining State of a user across calls to a WebService, do I need to only set a property 'BindingProvider.SESSION_MAINTAIN_PROPERTY' to true? So that the WS can maintain state across multiple calls for the same client.Can anyone tell me what does this BindingProvider mean and do?

Regards,
Chetan


 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
C Shinde wrote:I really dont understand the WS Addressing spec.I know it is a feature that can be set when connecting to an endpoint service, and if it is set to true, it sends some information in the address.Can someone tell me what this Spec is all about in brief?

WS-Addressing allows you to, regardless of which kind of transport used (HTTP, JMS, etc etc) for transporting requests and responses between client(s) and server, specify where, for instance, a reply is to be sent to.
If you are using HTTP, you will use URLs, but URLs cannot be used if you use JMS or some other transport. WS-Addressing allows you to specify, for instance, the address of a web service accepting requests via JMS.


As for maintaining State of a user across calls to a WebService, do I need to only set a property 'BindingProvider.SESSION_MAINTAIN_PROPERTY' to true? So that the WS can maintain state across multiple calls for the same client.

Yes, for JAX-WS, this is true. Like this:

Can anyone tell me what does this BindingProvider mean and do?

It is an abstraction that provides access to protocoll binding parameters and default context objects for request and response messages.
If you look at the API, it is an interface that in turn is extended by the Dispatch<T> interface. If you look in the JAX-WS specification, you will also find that web service proxies also implement this interface.
If I want some value to be included in the context that is passed to the web service each time I make a request from a client, I can retrieve the request context and set a property in it. This is exactly what is done in the code example above. Hope this makes things more clear!
Best wishes!
 
C Shinde
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ivan, just another question, well this is all good for JAX-WS, what was done in JAX-RPC time? How was the session maintained?
 
C Shinde
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone with an answer for this question? How is Session maintained with JAX-RPC?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic