Web Service Problem

Discussion in 'ASP .Net Web Services' started by Sunil Sabir, Dec 16, 2004.

  1. Sunil Sabir

    Sunil Sabir Guest

    Dear All,

    I have written a Web Service which is called from ASPX file(Web Form). It
    works fine on the local machine. On the local machine I am using the
    following command

    wsdl.exe /l:cs http://localhost/ReturnEvents/Service1.asmx?wsdl

    Now I want to use the same service on the Remote Server. What I think is
    that the
    above path should be changed as it is localhost. So I try to do something
    like this

    wsdl.exe /l:cs http://www.hop.man.ac.uk/ReturnEvents/Service1.asmx?wsdl

    where www.hop.man.ac.uk is the server where I am trying to host my web service

    But it does not compile and throws the following error:

    There was an error downloading:

    http://www.hop.man.ac.uk/ReturnEvents/Service1.asmx?wsdl

    The request failed with HTTP status 404: Not Found

    I dont know whether I going in a right direction. It works fine on the
    client machine
    But on the server when I change the path to my server name it throws this
    error.I mean we cant use localhost in the wsdl when using Web service on the
    REMOTE server. Dont know what to do. Any help would be greatly appreciated.

    Cheers,

    Sunil Sabir
     
    Sunil Sabir, Dec 16, 2004
    #1
    1. Advertising

  2. Sunil Sabir

    AndyMalakov Guest

    AndyMalakov, Dec 16, 2004
    #2
    1. Advertising

  3. Sunil Sabir

    Dan Rogers Guest

    Hi Sunil,

    You shouldn't be using WSDL.exe to move a service to a different server.
    Instead, after you get the server ready to run the applicaiton (e.g.
    install IIS, install the .NET Framework server components), you should
    publish your service implementation to the server.

    The service itself is unaware of it's address. It's just code, running on
    a server.

    To publish, open your project in Visual Studio, and after it is loaded, use
    the Publish option on the File menu to publish the right files to the
    server.

    Once the service is moved, the code that calls the client side proxy should
    use a configuration setting to change the server/service address. If you
    change the proxy property to "dynamic", you can then change the URL setting.

    I hope this helps

    Dan Rogers
    Microsoft Corporation
    --------------------
    >Thread-Topic: Web Service Problem
    >thread-index: AcTjlHZM9BRyGSjVTCOpn5WmnWgLPw==
    >X-WBNR-Posting-Host: 130.88.76.91
    >From: "=?Utf-8?B?U3VuaWwgU2FiaXI=?=" <>
    >Subject: Web Service Problem
    >Date: Thu, 16 Dec 2004 09:27:05 -0800
    >Lines: 36
    >Message-ID: <>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > charset="Utf-8"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >Content-Class: urn:content-classes:message
    >Importance: normal
    >Priority: normal
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
    >Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
    >Xref: cpmsftngxa10.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webservices:27238
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >
    >Dear All,
    >
    >I have written a Web Service which is called from ASPX file(Web Form). It
    >works fine on the local machine. On the local machine I am using the
    >following command
    >
    >wsdl.exe /l:cs http://localhost/ReturnEvents/Service1.asmx?wsdl
    >
    >Now I want to use the same service on the Remote Server. What I think is
    >that the
    >above path should be changed as it is localhost. So I try to do something
    >like this
    >
    >wsdl.exe /l:cs http://www.hop.man.ac.uk/ReturnEvents/Service1.asmx?wsdl
    >
    >where www.hop.man.ac.uk is the server where I am trying to host my web

    service
    >
    >But it does not compile and throws the following error:
    >
    >There was an error downloading:
    >
    >http://www.hop.man.ac.uk/ReturnEvents/Service1.asmx?wsdl
    >
    >The request failed with HTTP status 404: Not Found
    >
    >I dont know whether I going in a right direction. It works fine on the
    >client machine
    >But on the server when I change the path to my server name it throws

    this
    >error.I mean we cant use localhost in the wsdl when using Web service on

    the
    >REMOTE server. Dont know what to do. Any help would be greatly appreciated.
    >
    >Cheers,
    >
    >Sunil Sabir
    >
    >
    >
     
    Dan Rogers, Dec 16, 2004
    #3
  4. Sunil Sabir

    erymuzuan Guest

    if you look at the proxy again there's a property called URL, it's the
    web service endpoint, now every time you move the service address all
    you should do just change this property either directly in the proxy
    file all the calling code

    Mywebservice svc = new myWebService();
    svc.Url = ConfigurationSetting.AppSettings["MyWebSerice.Url"];

    The reason why you're getting error 404 , my guess would be the
    "ReturnEvents" virtual directory is not configured at all or incorrectly
    pointing to wrong folder

    actually you can place the service1.asmx in wwwroot directory and the
    dll in wwwroor\bin and all you have to is change the proxy Url to
    http://www.hop.man.ac.uk/Service1.asmx

    Regards
    Erymuzuan Mustapa


    Sunil Sabir wrote:
    > Dear All,
    >
    > I have written a Web Service which is called from ASPX file(Web Form). It
    > works fine on the local machine. On the local machine I am using the
    > following command
    >
    > wsdl.exe /l:cs http://localhost/ReturnEvents/Service1.asmx?wsdl
    >
    > Now I want to use the same service on the Remote Server. What I think is
    > that the
    > above path should be changed as it is localhost. So I try to do something
    > like this
    >
    > wsdl.exe /l:cs http://www.hop.man.ac.uk/ReturnEvents/Service1.asmx?wsdl
    >
    > where www.hop.man.ac.uk is the server where I am trying to host my web service
    >
    > But it does not compile and throws the following error:
    >
    > There was an error downloading:
    >
    > http://www.hop.man.ac.uk/ReturnEvents/Service1.asmx?wsdl
    >
    > The request failed with HTTP status 404: Not Found
    >
    > I dont know whether I going in a right direction. It works fine on the
    > client machine
    > But on the server when I change the path to my server name it throws this
    > error.I mean we cant use localhost in the wsdl when using Web service on the
    > REMOTE server. Dont know what to do. Any help would be greatly appreciated.
    >
    > Cheers,
    >
    > Sunil Sabir
    >
    >
     
    erymuzuan, Dec 16, 2004
    #4
    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. hocho888
    Replies:
    1
    Views:
    650
  2. dgleeson422111

    Consuming local web service - ok, remote web service -problem?

    dgleeson422111, Jan 26, 2010, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    907
    dgleeson422111
    Jan 26, 2010
  3. Scott Baierl
    Replies:
    1
    Views:
    283
    Scott Baierl
    Jul 29, 2006
  4. Leo Violette
    Replies:
    0
    Views:
    1,056
    Leo Violette
    Apr 17, 2009
  5. Redhot
    Replies:
    0
    Views:
    771
    Redhot
    Jul 18, 2009
Loading...

Share This Page