Error Adding WebService

L

LFN

Hi all,

I have a simple web service in my web application.
The web application is using FormsAuthentication.

The service.vb file is stored in the App_Code folder of the web application.
the service.asmx file is in the root of the web application.

I am now trying to add a web refernce from a seperate windows application
(within the same solution but seperate app)...

The service is being found without a problem (using the visual studio tools)
and I can see its methods etc and even invoke it and get the xml output.

But I cannot add the web reference.

Visual Studio Web Reference tool is saying:

There was an error downloading 'http://localhost/abc/services/headlines.asmx'.
The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a
href="/abc/services/headlines.asmx?AspxAutoDetectCookieSupport=1">here</a>.</h2>
</body></html>

I'm guessing that FormsAuthentication is jumping in and breaking my request
for the webService?

Is there any way around this?

When this application goes live (and is moved into the real world) do i have
to host my web services in a seperate application to prevent them from being
sabotaged by the FormsAuthentication?

All and any help would be very greatfully received....
I mean... I cant buy you chocolate or anything but I'll be really really
happy and the karma gods will smile upon you i'm sure :)

Thanks people.
 
J

John Saunders

LFN said:
Hi all,

I have a simple web service in my web application.
The web application is using FormsAuthentication.

The service.vb file is stored in the App_Code folder of the web
application.
the service.asmx file is in the root of the web application.

I am now trying to add a web refernce from a seperate windows application
(within the same solution but seperate app)...

The service is being found without a problem (using the visual studio
tools)
and I can see its methods etc and even invoke it and get the xml output.

But I cannot add the web reference.

Visual Studio Web Reference tool is saying:

There was an error downloading
'http://localhost/abc/services/headlines.asmx'.
The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a
href="/abc/services/headlines.asmx?AspxAutoDetectCookieSupport=1">here</a>.</h2>
</body></html>

I'm guessing that FormsAuthentication is jumping in and breaking my
request
for the webService?

Is there any way around this?

When this application goes live (and is moved into the real world) do i
have
to host my web services in a seperate application to prevent them from
being
sabotaged by the FormsAuthentication?

You can use a <location> element in web.config to turn off forms
authentication for the directory containing your web service.

John
 
L

LFN

John,

Thank you for your reply - it certainly sounds like a good plan -
unfortunately I haven't been able to implement it.

I have even tried putting a web.config file in the web-servioce directory
with authentication set to none.

That just generate an error as follows:

"It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level."

This is the same error that I was receiving while trying to turn off
formsAuthentication using a <location> tag.

I have checked and the application definately exists in iis.
(I'm using the local built in iis web server - with a virtual directory that
has an application set up)

I tried the following two lcoation tags:

<location path="services">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>

and

<location path="services">
<system.web>
<authentication mode="none" />
</system.web>
</location>

Neither worked.

Can you shed any more light on this for me?

I really appreciate any help I can get.

Thanks

LFN
 
J

John Saunders

LFN said:
John,

Thank you for your reply - it certainly sounds like a good plan -
unfortunately I haven't been able to implement it.
....
Can you shed any more light on this for me?

I really appreciate any help I can get.

I'm afraid that my suggestion was only a guess. I've never actually needed
to try this.

Good Luck,
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top