*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... 5 8268
> *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
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...
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...
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...
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... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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
|
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>
|
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:
|
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:...
|
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...
| |
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;
|
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:
|
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,...
|
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
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |