Connecting Tech Pros Worldwide Forums | Help | Site Map

Windows Application, Web Services & Session cookieless="AutoDetect

=?Utf-8?B?bWdvcHBlcnQ=?=
Guest
 
Posts: n/a
#1: Apr 26 '07
I'm having an issue with using web services in a web application marked with
session cookieless attribuet set to "AutoDetect". My real life scenario is
too complex to lay out but here's my situation boiled down to the nuts and
bolts...

1. Create a simple web application (not a web site) in VS 2005

2. Add a web.config and then set the Session to InProc and
cookieless="Autodetect"
<sessionState mode="InProc" cookieless="AutoDetect" timeout="15" />

3. Add a simple web service (WebService.asmx)
/// <summary>
/// Summary description for WebService1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class WebService1 : System.Web.Services.WebService
{

[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}

4. Compile and publish to your localhost.

5. Create a simple Winforms application and try to add a web reference to
the project. When you enter the Url of the .asmx file on your localhost, it
finds the service, but in the right side of the "Add A Web Reference" dialog
you'll get the following error and can't add the web reference...

There was an error downloading
'http://localhost/webmethodcookielesstest/webservice1.asmx'.

The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a
href="/webmethodcookielesstest/webservice1.asmx?AspxAutoDetectCookieSupport=1">he re</a>.</h2>
</body></html>

--.

If I go back and mark the session cookieless attribute in the web config to
"True" or "false", it works fine. Am I the only one this is happening to?

Any help would be greatly appreciated.

Mike Goppert
mike.goppert@eds.com

John Saunders [MVP]
Guest
 
Posts: n/a
#2: Apr 26 '07

re: Windows Application, Web Services & Session cookieless="AutoDetect


"mgoppert" <mike.goppert@integrasys.fiserv.comwrote in message
news:91DD05CA-1B1F-44C9-B3D6-175E1FAF211F@microsoft.com...
Quote:
I'm having an issue with using web services in a web application marked
with
session cookieless attribuet set to "AutoDetect". My real life scenario
is
too complex to lay out but here's my situation boiled down to the nuts and
bolts...
>
1. Create a simple web application (not a web site) in VS 2005
>
2. Add a web.config and then set the Session to InProc and
cookieless="Autodetect"
<sessionState mode="InProc" cookieless="AutoDetect" timeout="15" />
>
3. Add a simple web service (WebService.asmx)
/// <summary>
/// Summary description for WebService1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class WebService1 : System.Web.Services.WebService
{
>
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
>
4. Compile and publish to your localhost.
>
5. Create a simple Winforms application and try to add a web reference to
the project. When you enter the Url of the .asmx file on your localhost,
it
finds the service, but in the right side of the "Add A Web Reference"
dialog
you'll get the following error and can't add the web reference...
>
There was an error downloading
'http://localhost/webmethodcookielesstest/webservice1.asmx'.
>
The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a
href="/webmethodcookielesstest/webservice1.asmx?AspxAutoDetectCookieSupport=1">he re</a>.</h2>
</body></html>
>
--.
>
If I go back and mark the session cookieless attribute in the web config
to
"True" or "false", it works fine. Am I the only one this is happening to?
>
Any help would be greatly appreciated.
>
Mike Goppert
mike.goppert@eds.com
You should consider moving the web service to its own project. That's how
most people do it.
--

John Saunders [MVP]


=?Utf-8?B?bWdvcHBlcnQ=?=
Guest
 
Posts: n/a
#3: Apr 26 '07

re: Windows Application, Web Services & Session cookieless="AutoDetect


I can't unfortunately. We're using a CMS system (Sitecore) that loads itself
in the same application space as our primary web. My web service needs to
access the Sitecore meta data via its API. The web service must reside in
the same application.

"John Saunders [MVP]" wrote:
Quote:
"mgoppert" <mike.goppert@integrasys.fiserv.comwrote in message
news:91DD05CA-1B1F-44C9-B3D6-175E1FAF211F@microsoft.com...
Quote:
I'm having an issue with using web services in a web application marked
with
session cookieless attribuet set to "AutoDetect". My real life scenario
is
too complex to lay out but here's my situation boiled down to the nuts and
bolts...

1. Create a simple web application (not a web site) in VS 2005

2. Add a web.config and then set the Session to InProc and
cookieless="Autodetect"
<sessionState mode="InProc" cookieless="AutoDetect" timeout="15" />

3. Add a simple web service (WebService.asmx)
/// <summary>
/// Summary description for WebService1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class WebService1 : System.Web.Services.WebService
{

[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}

4. Compile and publish to your localhost.

5. Create a simple Winforms application and try to add a web reference to
the project. When you enter the Url of the .asmx file on your localhost,
it
finds the service, but in the right side of the "Add A Web Reference"
dialog
you'll get the following error and can't add the web reference...

There was an error downloading
'http://localhost/webmethodcookielesstest/webservice1.asmx'.

The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a
href="/webmethodcookielesstest/webservice1.asmx?AspxAutoDetectCookieSupport=1">he re</a>.</h2>
</body></html>

--.

If I go back and mark the session cookieless attribute in the web config
to
"True" or "false", it works fine. Am I the only one this is happening to?

Any help would be greatly appreciated.

Mike Goppert
mike.goppert@eds.com
>
You should consider moving the web service to its own project. That's how
most people do it.
--
>
John Saunders [MVP]
>
>
>
John Saunders [MVP]
Guest
 
Posts: n/a
#4: Apr 26 '07

re: Windows Application, Web Services & Session cookieless="AutoDetect


"mgoppert" <mike.goppert@integrasys.fiserv.comwrote in message
news:E94971B6-3EA8-4EF7-9C70-72E18D97F483@microsoft.com...
Quote:
>I can't unfortunately. We're using a CMS system (Sitecore) that loads
>itself
in the same application space as our primary web. My web service needs to
access the Sitecore meta data via its API. The web service must reside in
the same application.
The API can't be accessed from a different application? That sounds strange.
--

John Saunders [MVP]


Closed Thread