Question with Serverhost

Last post 06-26-2008 4:27 PM by Ganeshyb. 5 replies.

Sort Posts:

  • Question with Serverhost

    06-25-2008, 4:14 PM

    I have multiple websites which running under Default Web Site on IIS under development server.

    Eg. http://127.0.0.1/website1/... , http://127.0.0.1/website2/... and so on.

    Now in my web pages, I used this http://127.0.0.1/website1/somewebservice.asmx to call webservice on dev.

     Say if I move all files to LIVE server ... which is http://www.abc.com/website1/ ... when it hit the web page where I called http://127.0.0.1/website1/somewebservice.asmx file ... will that prompt error? Do we need to change it to http://www.abc.com/website1/somewebservice.asmx?

    My guess is we have to change the localhost to servername ...

    I don't have permission to test that, so any answer will be appreciated.

  • Re: Question with Serverhost

    06-25-2008, 7:32 PM
    • Participant
      1,122 point Participant
    • Ganeshyb
    • Member since 11-02-2007, 12:07 AM
    • Posts 203

    The best way is have the url in Web.config so that in future if you plan to move your webservice to different web server you just need to update the config file.

    Other wise you can use /Website1/Somewebserive.asmx">http://localhost:<port>/Website1/Somewebserive.asmx.

    Hope this helps

    Thanks
    Ganesh


    If you find my reply help you Mark it Answered.
  • Re: Question with Serverhost

    06-26-2008, 8:11 AM
    • All-Star
      77,879 point All-Star
    • jeff@zina.com
    • Member since 09-26-2003, 10:43 AM
    • Naples, FL, USA
    • Posts 10,591
    • Moderator
      TrustedFriends-MVPs

    hbcontract2002:
    I have multiple websites which running under Default Web Site on IIS under development server.

    No, you have multiple applications running under the default web site.

    hbcontract2002:
    My guess is we have to change the localhost to servername ...

    Your guess is correct.  But it's in the code, not in the server, so you just need to find all the occurrences of "127.0.0.1" and change them to www.abc.com in your code.  Next time you develop, take a look at relative links instead of absolute links.

    Jeff

    Blatant Self Promotion: ASP.NET 3.5 CMS Development
  • Re: Question with Serverhost

    06-26-2008, 9:36 AM

    Thanks for your reply. So if I didn't change 127.0.0.1 to www.abc.com on live server, user will get error, correct? Coz' it wouldn't find the webservice file from localhost ...? Please confirm. Thanks.

  • Re: Question with Serverhost

    06-26-2008, 4:06 PM
    Answer
    • All-Star
      77,879 point All-Star
    • jeff@zina.com
    • Member since 09-26-2003, 10:43 AM
    • Naples, FL, USA
    • Posts 10,591
    • Moderator
      TrustedFriends-MVPs

    It would looak at 127.0.0.1, which is always the physical system the browser is on.  In essence, it would look on the user's system for the web service, so unless you want to install the web service on every potential user's system around the globe, you would want to change the URL to point to where you did install it.

    Jeff

    Blatant Self Promotion: ASP.NET 3.5 CMS Development
  • Re: Question with Serverhost

    06-26-2008, 4:27 PM
    • Participant
      1,122 point Participant
    • Ganeshyb
    • Member since 11-02-2007, 12:07 AM
    • Posts 203

    jeff@zina.com:
    It would looak at 127.0.0.1, which is always the physical system the browser is on

     

    Since the code run on the server it would the physical system of the server unless your using in your javascript

    Thanks
    Ganesh


    If you find my reply help you Mark it Answered.
Page 1 of 1 (6 items)