473,320 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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=true. 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 HttpWebClientProtocol.CookieContainer. 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 8206
> *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=true. 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
HttpWebClientProtocol.CookieContainer. 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 getResponseHeader and setRequestHeader 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**********************************@microsof t.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=true. 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 HttpWebClientProtocol.CookieContainer. 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* misunderstanding 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_SessionId=......." 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**********************************@microsof t.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=true. 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 HttpWebClientProtocol.CookieContainer. 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**********************************@microsof t.com...
Brian,

Thanks for the reply.

Is it possible you're wrong, or I'm *totally* misunderstanding 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_SessionId=......." 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**********************************@microsof t.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=true. 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 HttpWebClientProtocol.CookieContainer. 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**********************************@microsof t.com...
Brian,

Thanks for the reply.

Is it possible you're wrong, or I'm *totally* misunderstanding 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_SessionId=......." 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**********************************@microsof t.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=true. 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 HttpWebClientProtocol.CookieContainer. 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
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...
2
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 ...
7
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...
7
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...
1
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...
7
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
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...
0
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...
5
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.