简体   繁体   中英

Consume a stateful .net web service from java

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM