WebService session persistence

J

jb

How? :)

InfoPath talks to WebService. WS requires initial logon, then persists
stuff in session state [WebMethod(EnableSession=true)]. I have many forms
for different tasks, would expect user to logon once then be able to use IP
forms as long as session lasts.

From reading (see below), my understanding is that I need to retrieve an
HTTP cookie from initial Web service connection and then pass this back in
future requests. I guess I'll find some means to save it/pass it between IP
forms. But all I know about in IP is QueryAdapter.Query() etc. Do I have
any access to the "proxy class before calling the XML Web service method"?
(Am scripting in MSE.)

Am I along the right lines, or barking up the wrong tree?




<WebMethodAttribute.EnableSession Property>
An XML Web service client is uniquely identified by an HTTP cookie returned
by an XML Web service. In order for an XML Web service to maintain session
state for a client, the client must persist the cookie. Clients can receive
the HTTP cookie by creating a new instance of CookieContainer and assigning
that to the CookieContainer property of the proxy class before calling the
XML Web service method. If you need to maintain session state beyond when the
proxy class instance goes out of scope, the client must persist the HTTP
cookie between calls to the XML Web service.
</WebMethodAttribute.EnableSession Property>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top