473,589 Members | 2,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebService session sessionstate SOAP

jb
*Please* help --- I'm tearing my hair out.

I want to use sessionstate in a webservice, accessed from a client, written
in script (JScript, InfoPath).

I have written my webservice (C# .NET). I have marked the method(s) with
EnableSession=t rue. I have read everything there is to read! I am told that
to reuse session, my client needs to receive a cookie in the header from the
webservice and then pass this back in all future calls. This can all be
found in HttpWebClientPr otocol.CookieCo ntainer. I am told to "Assign the
CookieContainer to the proxy class" in the web client.

But my client isn't a C# .NET app! It's JScript in InfoPath.

I have written code there to invoke the webmethod via SOAP/XMLHTTP, so I'm
in charge of stuff. The call works fine, minus session stuff. But I cannot
see where what I need for preserving the session is kept/accessed? As I
understand it, I'm just looking to preserve a cookie for "sessionid" that
will be in the "header" (SOAP header? HTTP header?) sent to me from the
webservice?

I'm lost & frustrated...
Nov 21 '05 #1
5 8235
> *Please* help --- I'm tearing my hair out.

I want to use sessionstate in a webservice, accessed from a client,
written in script (JScript, InfoPath).

I have written my webservice (C# .NET). I have marked the method(s)
with EnableSession=t rue. I have read everything there is to read! I
am told that to reuse session, my client needs to receive a cookie in
the header from the webservice and then pass this back in all future
calls. This can all be found in
HttpWebClientPr otocol.CookieCo ntainer. I am told to "Assign the
CookieContainer to the proxy class" in the web client.

But my client isn't a C# .NET app! It's JScript in InfoPath.

I have written code there to invoke the webmethod via SOAP/XMLHTTP, so
I'm in charge of stuff. The call works fine, minus session stuff.
But I cannot see where what I need for preserving the session is
kept/accessed? As I understand it, I'm just looking to preserve a
cookie for "sessionid" that will be in the "header" (SOAP header? HTTP
header?) sent to me from the webservice?

I'm lost & frustrated...


You need to use the getResponseHead er and setRequestHeade r methods to manage
cookies manually. There's no nice automagic manager like CookieContainer
for XmlHttp.

HTH,
Dre

Nov 21 '05 #2
InfoPath as a client doesn't respect the session cookie. You'll have to
receive the web service through script and store the header information into
the DOM somewhere, and handle the cookie get/send yourself. Sorry I don't
have any more information on how to do this, but at least you can stop
looking for something automatic within InfoPath.

Brian

"jb" <jb@discussions .microsoft.com> wrote in message
news:D5******** *************** ***********@mic rosoft.com...
*Please* help --- I'm tearing my hair out.

I want to use sessionstate in a webservice, accessed from a client,
written
in script (JScript, InfoPath).

I have written my webservice (C# .NET). I have marked the method(s) with
EnableSession=t rue. I have read everything there is to read! I am told
that
to reuse session, my client needs to receive a cookie in the header from
the
webservice and then pass this back in all future calls. This can all be
found in HttpWebClientPr otocol.CookieCo ntainer. I am told to "Assign the
CookieContainer to the proxy class" in the web client.

But my client isn't a C# .NET app! It's JScript in InfoPath.

I have written code there to invoke the webmethod via SOAP/XMLHTTP, so I'm
in charge of stuff. The call works fine, minus session stuff. But I
cannot
see where what I need for preserving the session is kept/accessed? As I
understand it, I'm just looking to preserve a cookie for "sessionid" that
will be in the "header" (SOAP header? HTTP header?) sent to me from the
webservice?

I'm lost & frustrated...

Nov 21 '05 #3
jb
Brian,

Thanks for the reply.

Is it possible you're wrong, or I'm *totally* misunderstandin g what's going
on? 'Coz now I'm even *more* mystified!

First, forget about SOAP. I think I understand I'm talking about HTTP
headers.

I'm finding, empirically, that my session & state *are* being preserved,
even though I've done nought in InfoPath! Yet you say:
InfoPath as a client doesn't respect the session cookie. Debugging at the webservice side, I see a session being created for the
first IP request. Then no new session for subsequent requests, and my WS
sees its Session[] variables as it set them up last request. Session times
out as usual after inactivity for a while, as per web.config.

I switch on debugging in IIS to include showing "cookies". For all requests
(after the first) coming in from IP I see at the end of the trace info all
the "cookies", *including* "ASP.NET_Sessio nId=......." at the end.

This is being passed from IP, right? And the fact it's there is causing the
WS to reuse existing session, right? What am I failing to understand? I
find *all* IP sessions on my machine (no matter what IP form), to the same WS
at least, use the same WS session; any IP sessions from another machine use a
different session.

Maybe I'm not very clear about what I'm wanting/trying to understand. There
are really 2 different things, I don't quite understand how they are related:

1. My WS must see the same session for subsequent requests from the same IP
client (machine will probably do), as indicated by when Session_Start() in
Global.asax.cs gets called. I find this is true. This is vital.

2. My WS sees the same variables/contents in its Session[] bucket for
subsequent requests from the same IP client (machine will probably do). I
find this is true. This is *not* so vital, so long as I know what the case
will be --- I can code as necessary.

I should be *so* grateful if you/whoever would explain.

"Brian Teutsch [MSFT]" wrote:
InfoPath as a client doesn't respect the session cookie. You'll have to
receive the web service through script and store the header information into
the DOM somewhere, and handle the cookie get/send yourself. Sorry I don't
have any more information on how to do this, but at least you can stop
looking for something automatic within InfoPath.

Brian

"jb" <jb@discussions .microsoft.com> wrote in message
news:D5******** *************** ***********@mic rosoft.com...
*Please* help --- I'm tearing my hair out.

I want to use sessionstate in a webservice, accessed from a client,
written
in script (JScript, InfoPath).

I have written my webservice (C# .NET). I have marked the method(s) with
EnableSession=t rue. I have read everything there is to read! I am told
that
to reuse session, my client needs to receive a cookie in the header from
the
webservice and then pass this back in all future calls. This can all be
found in HttpWebClientPr otocol.CookieCo ntainer. I am told to "Assign the
CookieContainer to the proxy class" in the web client.

But my client isn't a C# .NET app! It's JScript in InfoPath.

I have written code there to invoke the webmethod via SOAP/XMLHTTP, so I'm
in charge of stuff. The call works fine, minus session stuff. But I
cannot
see where what I need for preserving the session is kept/accessed? As I
understand it, I'm just looking to preserve a cookie for "sessionid" that
will be in the "header" (SOAP header? HTTP header?) sent to me from the
webservice?

I'm lost & frustrated...


Nov 21 '05 #4
I expect you'll have to add the session as a paremeter in the web service
methods. InfoPath is probably relying on something underneath which assumes
that HTTP is stateless, and any shared info can safely be shared across all
calls on the machine--possibly including IE and multiple InfoPath forms.

I have no idea what InfoPath does internally, but this might be a feature
request for future versions. But the inherent statelessness of HTTP means
that relying on sessions may not be such a good idea. Since cookies are not
really part of SOAP (I don't think, I may be wrong), a client can choose to
implement cookie handling any way it wants and still be a perfectly valid
Web Service client.

--Matthew Blain
http://tips.serriform.com/
http://www.developingsolutionswithinfopath.com
"jb" <jb@discussions .microsoft.com> wrote in message
news:2B******** *************** ***********@mic rosoft.com...
Brian,

Thanks for the reply.

Is it possible you're wrong, or I'm *totally* misunderstandin g what's going on? 'Coz now I'm even *more* mystified!

First, forget about SOAP. I think I understand I'm talking about HTTP
headers.

I'm finding, empirically, that my session & state *are* being preserved,
even though I've done nought in InfoPath! Yet you say:
InfoPath as a client doesn't respect the session cookie. Debugging at the webservice side, I see a session being created for the
first IP request. Then no new session for subsequent requests, and my WS
sees its Session[] variables as it set them up last request. Session

times out as usual after inactivity for a while, as per web.config.

I switch on debugging in IIS to include showing "cookies". For all requests (after the first) coming in from IP I see at the end of the trace info all
the "cookies", *including* "ASP.NET_Sessio nId=......." at the end.

This is being passed from IP, right? And the fact it's there is causing the WS to reuse existing session, right? What am I failing to understand? I
find *all* IP sessions on my machine (no matter what IP form), to the same WS at least, use the same WS session; any IP sessions from another machine use a different session.

Maybe I'm not very clear about what I'm wanting/trying to understand. There are really 2 different things, I don't quite understand how they are related:
1. My WS must see the same session for subsequent requests from the same IP client (machine will probably do), as indicated by when Session_Start() in
Global.asax.cs gets called. I find this is true. This is vital.

2. My WS sees the same variables/contents in its Session[] bucket for
subsequent requests from the same IP client (machine will probably do). I
find this is true. This is *not* so vital, so long as I know what the case will be --- I can code as necessary.

I should be *so* grateful if you/whoever would explain.

"Brian Teutsch [MSFT]" wrote:
InfoPath as a client doesn't respect the session cookie. You'll have to
receive the web service through script and store the header information into the DOM somewhere, and handle the cookie get/send yourself. Sorry I don't have any more information on how to do this, but at least you can stop
looking for something automatic within InfoPath.

Brian

"jb" <jb@discussions .microsoft.com> wrote in message
news:D5******** *************** ***********@mic rosoft.com...
*Please* help --- I'm tearing my hair out.

I want to use sessionstate in a webservice, accessed from a client,
written
in script (JScript, InfoPath).

I have written my webservice (C# .NET). I have marked the method(s) with EnableSession=t rue. I have read everything there is to read! I am told that
to reuse session, my client needs to receive a cookie in the header from the
webservice and then pass this back in all future calls. This can all be found in HttpWebClientPr otocol.CookieCo ntainer. I am told to "Assign the CookieContainer to the proxy class" in the web client.

But my client isn't a C# .NET app! It's JScript in InfoPath.

I have written code there to invoke the webmethod via SOAP/XMLHTTP, so I'm in charge of stuff. The call works fine, minus session stuff. But I
cannot
see where what I need for preserving the session is kept/accessed? As I understand it, I'm just looking to preserve a cookie for "sessionid" that will be in the "header" (SOAP header? HTTP header?) sent to me from the webservice?

I'm lost & frustrated...


Nov 21 '05 #5
jb
Matthew,

If you're interested, see my response to Brian above. Thanks for your help.

"Matthew Blain (Serriform)" wrote:
I expect you'll have to add the session as a paremeter in the web service
methods. InfoPath is probably relying on something underneath which assumes
that HTTP is stateless, and any shared info can safely be shared across all
calls on the machine--possibly including IE and multiple InfoPath forms.

I have no idea what InfoPath does internally, but this might be a feature
request for future versions. But the inherent statelessness of HTTP means
that relying on sessions may not be such a good idea. Since cookies are not
really part of SOAP (I don't think, I may be wrong), a client can choose to
implement cookie handling any way it wants and still be a perfectly valid
Web Service client.

--Matthew Blain
http://tips.serriform.com/
http://www.developingsolutionswithinfopath.com
"jb" <jb@discussions .microsoft.com> wrote in message
news:2B******** *************** ***********@mic rosoft.com...
Brian,

Thanks for the reply.

Is it possible you're wrong, or I'm *totally* misunderstandin g what's

going
on? 'Coz now I'm even *more* mystified!

First, forget about SOAP. I think I understand I'm talking about HTTP
headers.

I'm finding, empirically, that my session & state *are* being preserved,
even though I've done nought in InfoPath! Yet you say:
InfoPath as a client doesn't respect the session cookie.

Debugging at the webservice side, I see a session being created for the
first IP request. Then no new session for subsequent requests, and my WS
sees its Session[] variables as it set them up last request. Session

times
out as usual after inactivity for a while, as per web.config.

I switch on debugging in IIS to include showing "cookies". For all

requests
(after the first) coming in from IP I see at the end of the trace info all
the "cookies", *including* "ASP.NET_Sessio nId=......." at the end.

This is being passed from IP, right? And the fact it's there is causing

the
WS to reuse existing session, right? What am I failing to understand? I
find *all* IP sessions on my machine (no matter what IP form), to the same

WS
at least, use the same WS session; any IP sessions from another machine

use a
different session.

Maybe I'm not very clear about what I'm wanting/trying to understand.

There
are really 2 different things, I don't quite understand how they are

related:

1. My WS must see the same session for subsequent requests from the same

IP
client (machine will probably do), as indicated by when Session_Start() in
Global.asax.cs gets called. I find this is true. This is vital.

2. My WS sees the same variables/contents in its Session[] bucket for
subsequent requests from the same IP client (machine will probably do). I
find this is true. This is *not* so vital, so long as I know what the

case
will be --- I can code as necessary.

I should be *so* grateful if you/whoever would explain.

"Brian Teutsch [MSFT]" wrote:
InfoPath as a client doesn't respect the session cookie. You'll have to
receive the web service through script and store the header information into the DOM somewhere, and handle the cookie get/send yourself. Sorry I don't have any more information on how to do this, but at least you can stop
looking for something automatic within InfoPath.

Brian

"jb" <jb@discussions .microsoft.com> wrote in message
news:D5******** *************** ***********@mic rosoft.com...
> *Please* help --- I'm tearing my hair out.
>
> I want to use sessionstate in a webservice, accessed from a client,
> written
> in script (JScript, InfoPath).
>
> I have written my webservice (C# .NET). I have marked the method(s) with > EnableSession=t rue. I have read everything there is to read! I am told > that
> to reuse session, my client needs to receive a cookie in the header from > the
> webservice and then pass this back in all future calls. This can all be > found in HttpWebClientPr otocol.CookieCo ntainer. I am told to "Assign the > CookieContainer to the proxy class" in the web client.
>
> But my client isn't a C# .NET app! It's JScript in InfoPath.
>
> I have written code there to invoke the webmethod via SOAP/XMLHTTP, so I'm > in charge of stuff. The call works fine, minus session stuff. But I
> cannot
> see where what I need for preserving the session is kept/accessed? As I > understand it, I'm just looking to preserve a cookie for "sessionid" that > will be in the "header" (SOAP header? HTTP header?) sent to me from the > webservice?
>
> I'm lost & frustrated...


Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1037
by: Juan Irigoyen | last post by:
De: "Juan Irigoyen" <juan_irigoyen@hotmail.com> Asunto: Session in WebService with ASP.NET - Please Help Fecha: miércoles, 01 de septiembre de 2004 13:34 I have a page asp that call the webmethod, this make the variable of session but when the webmethod return the values stored in webmethod lost. In the web.config have the next code
2
2549
by: Juan Irigoyen | last post by:
I have a page asp that call the webmethod, this make the variable of session but when the webmethod return the values stored in webmethod lost. In the web.config have the next code <sessionState mode="InProc" cookieless="false" timeout="20"></sessionState>
7
5387
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i don´t want to filter the return value of the method, i have to pass a new instance of the filter-object without setting any properties. but the value type-properties can´t be null and the filter is set to 0 (int) or false (bool). therefore i did implement the propertySpecified-pattern like this:
7
4970
by: Christian Wilhelm | last post by:
Hi! I'm trying to call a Java WebService out of a .net Client. There are two Methods, one Method requires one Parameter of type Parameter, the other Method requires one Parameter of type Parameter. I can call the first Method without Problems, the Parameter can be deserialized by the WebService. But if I want to call the second Method and give it an Array of Parameters, then the following exception is thrown by the WebService:...
1
4194
by: Monster | last post by:
is it possible to manually create and destroy a session object in a webservice? My original client and server were done with SOAP in c++ (isapi dll and mfc/atl). I managed to write an intermediate webservice in c# that forwarded calls from the client to the server, but I'm now trying to port the ISAPI soap dll to a true c# webservice, however the client does not support cookies so I can't use the session object. The original soap dll...
7
2007
by: Alessandro Benedetti | last post by:
Hi. I'm calling two methods of a .NET Webservice (A) from another Webservice (B). The A Webservice is made like this: public class WSA: System.Web.Services.WebService { private int X = 0;
4
3250
by: =?Utf-8?B?TmFkYXYgUG9wcGxld2VsbA==?= | last post by:
Hi everybody, I've got two questions about using the EnableSession property with an ASP.NET WebService: First Question: I'm trying to create a web service with EnableSession=true. I can't get it to work with VS2005 ( It works with vs2003!). Here is my testcase:
0
2367
by: TraceyAnnison | last post by:
I wonder if you can help me - I'm new to this, and working in a project that has already been configured to work with Axis. We have a Java project built with the Spring framework, in order to provide webservices for access via SOAP. As I understand it (ie not very well!) Axis works to accept these SOAP messages from the client and transform them into calls on our Java methods, and do the reverse with the responses - cool! Which is excellent,...
5
2745
by: VictorG | last post by:
Hello, I am trying to secure a webservice using WSE 3.0 and the turnkey usernameForCertificateSecurity profile. I am passing a valid username token, and on the server I have overridden the Authenticate token call and it is being called. My ASP.NET service has a Login() method and it is being called during client application startup. Both the client and service have matching policy config files. Once authentication
0
7865
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8360
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5731
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5399
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3849
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2374
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1461
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.