Error Adding WebService

Discussion in 'ASP .Net Web Services' started by LFN, Feb 23, 2007.

  1. LFN

    LFN Guest

    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.
    LFN, Feb 23, 2007
    #1
    1. Advertising

  2. "LFN" <> wrote in message
    news:...
    > 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
    John Saunders, Feb 23, 2007
    #2
    1. Advertising

  3. LFN

    Manish Bafna Guest

    Hi,
    you will find following link on "Using Forms Authentication with Web
    Services" useful:
    http://www.dotnetbips.com/articles/displayarticledetails.aspx?articleid=166

    Thanks and regards,
    Manish Bafna
    MCP and MCTS.

    "LFN" wrote:

    > 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.
    >
    >
    Manish Bafna, Feb 25, 2007
    #3
  4. LFN

    LFN Guest

    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

    -----


    "John Saunders" wrote:

    > "LFN" <> wrote in message
    > news:...
    > > 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
    >
    >
    >
    LFN, Feb 26, 2007
    #4
  5. "LFN" <> wrote in message
    news:...
    >
    > 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
    John Saunders, Feb 26, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. batista
    Replies:
    1
    Views:
    912
    Laurent Bugnion
    Jan 26, 2006
  2. Peter Nordström

    Webservice calling a webservice.....Error

    Peter Nordström, Oct 21, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    165
    Peter Nordström
    Oct 21, 2003
  3. harbi
    Replies:
    2
    Views:
    182
    Chris Muench
    Nov 7, 2003
  4. Martin Lee

    Error when adding a reference to a WebService

    Martin Lee, Jun 13, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    102
    Martin Lee
    Jun 13, 2005
  5. Roberto Giorgetti

    Error connection using webservice locally (3 webservice in balanci

    Roberto Giorgetti, Jun 13, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    197
    Roberto Giorgetti
    Jun 13, 2006
Loading...

Share This Page