views:

70

answers:

1

In C# I have methods that use

   [WebMethod(EnableSession = true)]

I consume them in C# .net by using a cookiecontainer to maintain state.

How do I do the same thing in java? I want to call a .net webservice with [WebMethod(EnableSession = true)] and have it maintain state between calls.

A: 

It depends on which SOAP framework you are using. For JAX-WS, you can enable client-side session support by setting BindingProvider.SESSION_MAINTAIN_PROPERTY to true in your request context. You can find an example here.

jarnbjo