473,386 Members | 1,924 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,386 software developers and data experts.

Windows Application, Web Services & Session cookieless="AutoDetect

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
mi**********@eds.com
Apr 26 '07 #1
3 6490
"mgoppert" <mi**********@integrasys.fiserv.comwrote in message
news:91**********************************@microsof t.com...
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
mi**********@eds.com
You should consider moving the web service to its own project. That's how
most people do it.
--

John Saunders [MVP]
Apr 26 '07 #2
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:
"mgoppert" <mi**********@integrasys.fiserv.comwrote in message
news:91**********************************@microsof t.com...
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
mi**********@eds.com

You should consider moving the web service to its own project. That's how
most people do it.
--

John Saunders [MVP]
Apr 26 '07 #3
"mgoppert" <mi**********@integrasys.fiserv.comwrote in message
news:E9**********************************@microsof t.com...
>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]
Apr 26 '07 #4

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

Similar topics

6
by: Patrick.Simons | last post by:
I try to connect a FTPWebRequest through Proxy and VPN to a remote FTP- server. Sometimes it works sometimes not. When my VB.Net-App (2005) returns the error on the GetResponse-Method, I'll try to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
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,...

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.