I can't add a Web Reference

Discussion in 'ASP .Net Web Services' started by Alexander Walker, Feb 2, 2006.

  1. Hello

    I am developing a website that has a Web Service that I want to expose to
    Windows Forms based SmartClients when I try to add the web reference to the
    smart client I get the following message in the "Web services found at this
    URL:" box of the "Add Web Reference" dialog

    There was an error downloading
    'http://localhost/WebSite1/Folder1/WebService1.asmx'.

    The request failed with the error message:
    --
    <html><head><title>Object moved</title></head><body>
    <h2>Object moved to <a
    href="/WebSite1/Folder1/WebService1.asmx?AspxAutoDetectCookieSupport=1">here</a>.</h2>
    </body></html>

    --.

    What can I do to stop this from happening and/or enable myself to add a
    reference to the Web Service

    Thanks

    Alex
     
    Alexander Walker, Feb 2, 2006
    #1
    1. Advertising

  2. Hi Alexander,

    Welcome to the MSDN newsgroup.

    As for the adding web reference problem you mentioend, based on my
    experience, there're serveral things which could cause such behavior:

    1. The serverside webservice code has some incorrect code or setting which
    prevent the webservice from being correctly compiled.

    2. There're some networking issue between the clientside and the webservice
    server.

    To check these, you can first check the webservice code to ensuire no
    compile/build time error and try adding webservice refrence on the server
    locally to see whether it works.
    Then, at cilentside, try using IE browser to visit the webservice's asmx
    file first to see whether it can display well. Also, in addition to the VS
    IDE's add webreference, we can also use the wsdl.exe tool in .net framework
    sdk to create webservice proxy classes....

    Hope this helps.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Steven Cheng[MSFT], Feb 3, 2006
    #2
    1. Advertising

  3. Alexander Walker

    Brock Allen Guest

    Are you sure you shouldn't be getting the WSDL from this instead (note ?wsdl
    query string):

    http://localhost/WebSite1/Folder1/WebService1.asmx?wsdl

    If not, then the redirect tells me you've got authentication setup for that
    URL, thus you need to have logged in to access the URL. I don't know if you
    want that or not?

    -Brock
    http://staff.develop.com/ballen


    > Hello
    >
    > I am developing a website that has a Web Service that I want to expose
    > to Windows Forms based SmartClients when I try to add the web
    > reference to the smart client I get the following message in the "Web
    > services found at this URL:" box of the "Add Web Reference" dialog
    >
    > There was an error downloading
    > 'http://localhost/WebSite1/Folder1/WebService1.asmx'.
    >
    > The request failed with the error message:
    > --
    > <html><head><title>Object moved</title></head><body>
    > <h2>Object moved to <a
    > href="/WebSite1/Folder1/WebService1.asmx?AspxAutoDetectCookieSupport=1
    > ">here</a>.</h2>
    > </body></html>
    > --.
    >
    > What can I do to stop this from happening and/or enable myself to add
    > a reference to the Web Service
    >
    > Thanks
    >
    > Alex
    >
     
    Brock Allen, Feb 3, 2006
    #3
  4. Hi Steven

    The web service compiles properly. I am able to invoke the web service using
    internet explorer. I have resorted to using wsdl.exe. Perhaps there's some kind
    of configuration on my website that causes the redirect.

    What is AspxAutoDetectCookieSupport? I can't find it anywhere in the MSDN
    documentation

    Thanks

    Alex
     
    Alexander Walker, Feb 3, 2006
    #4
  5. Hi Brock

    I have not intentionally applied any authentication to my web service, how might
    I check to see if authentication has been applied to it? I created it in the
    same way I would in VS 2003 and tried to add a reference to it in the same way
    as I would have in VS 2003, the website itself uses the role and membership
    features of asp.net 2.0 might they be cause?

    Alex
     
    Alexander Walker, Feb 3, 2006
    #5
  6. The web method call fails in the same way that the add web reference procedure did

    Hello Steven

    I get the same error message from my smart client when I call the web service as
    I do from the visual studio IDE when I try to add a reference to the web
    service, here is the complete error information

    ************** Exception Text **************
    System.Net.WebException: The request failed with the error message:
    --
    <html><head><title>Object moved</title></head><body>
    <h2>Object moved to <a
    href="/WebSite1/Folder1/WebService1.asmx?AspxAutoDetectCookieSupport=1">here</a>.</h2>
    </body></html>

    --.
    at
    System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
    message, WebResponse response, Stream responseStream, Boolean asyncCall)
    at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
    methodName, Object[] parameters)
    at AlexanderWalker.SmartClient.WebService1.WebMethod1(Int32 id) in
    D:\MyFiles\MyCode\SmartClient\WebService1.cs:line 47
    at AlexanderWalker.SmartClient.SmartForm.BuildTree(Int32 id, TreeNode node)
    in D:\MyFiles\MyCode\SmartClient\SmartForm.cs:line 55
    at AlexanderWalker.SmartClient.SmartForm.SmartForm_Load(Object sender,
    EventArgs e) in D:\MyFiles\MyCode\SmartClient\SmartForm.cs:line 40
    at System.Windows.Forms.Form.OnLoad(EventArgs e)
    at System.Windows.Forms.Form.OnCreateControl()
    at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
    at System.Windows.Forms.Control.CreateControl()
    at System.Windows.Forms.Control.WmShowWindow(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    at System.Windows.Forms.ContainerControl.WndProc(Message& m)
    at System.Windows.Forms.Form.WmShowWindow(Message& m)
    at System.Windows.Forms.Form.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr
    wparam, IntPtr lparam)


    ************** Loaded Assemblies **************
    mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    SmartClient
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/MyFiles/MyCode/SmartClient/bin/Debug/SmartClient.exe
    ----------------------------------------
    System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase:
    file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase:
    file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase:
    file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase:
    file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase:
    file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Web.Services
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase:
    file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
    ----------------------------------------
    n9n0nbpr
    Assembly Version: 1.0.0.0
    Win32 Version: 2.0.50727.42 (RTM.050727-4200)
    CodeBase:
    file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------

    Thanks

    Alex
     
    Alexander Walker, Feb 3, 2006
    #6
  7. Hi Alex,

    I also brock's suggestion is somewhat noticeable. The
    "AspxAutoDetectCookieSupport" querystring is usually used when form
    authentication configured to detect clientside cookie setting. Is your
    webservice in an web application mixed with some other web pages or just a
    single web service application? Also, we can check the IIS log on the
    server to see what requests are generated and the response status for those
    webservice calls.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Steven Cheng[MSFT], Feb 6, 2006
    #7
    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. babu dhayal via .NET 247

    How to add shared assembly in the add reference

    babu dhayal via .NET 247, Aug 5, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    6,302
    Nelson Xu
    Aug 17, 2004
  2. Alexander Walker

    I can't add a Web Reference

    Alexander Walker, Feb 2, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    3,344
    tremmorkeep
    Dec 15, 2007
  3. Annie
    Replies:
    1
    Views:
    567
    Jan Tielens
    Feb 4, 2004
  4. xjbsky

    why i can't add web reference

    xjbsky, Aug 28, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    129
    xjbsky
    Aug 28, 2004
  5. Deep Mehta via .NET 247
    Replies:
    2
    Views:
    475
    Dave A
    May 31, 2005
Loading...

Share This Page