locked
Deploying a Web Service to intranat RRS feed

  • Question

  • User1467896699 posted

    I have built a web service that is intended for a third part to notify me of events which I react to as necessary. We have setup a hardware vpn connection between their server and ours. Our local lan IP address is for eg: 192.168.1.10.

    I built a web service application that works perfectly using localhost:1234 (where 1234 if the specific port I am using). When my web service application is running I can invoke all the functions using localhost:1234/MyWebService.asmx.

    For the life in me I cannot figure out how to publish this service so the third party who are permanently connected via the hardware vpn can call the functions using 192.168.1.10:1234/MyWebService.asmx.

    Help would be appreciated.

    1)      How to I deploy the web service so it can be accessed using the IP address 192.168.1.10 instead of localhost?

    2)      Do I need the port 1234 opened in the hardware firewall even though the third party is effectively connected to the lan?

     

    Thanks in advance.

    I currently have IIS 7.0 running on the server where I need to deploy the web service. I have already tried many of the methods which turned up from google search ie; publish to file and point a virtual directory to the published file. Copy the published directory to wwwroot and convert to application etc.

    Tuesday, October 29, 2013 6:15 AM

Answers

  • User-760709272 posted

    Copy your project folder onto the server (or do a publish in Visual Studio to a local folder so that you get a "clean" folder that contains only the files you actually need, and copy that folder on).  In IIS create a new site by right-clicking "Sites" and "Add new site".  In the sitename, call it what you want, in "Physical path" select the folder you copied on that has your files.  In the "Port" box of the "Binding" section enter "1234".

    In terms of firewall, the browser on the client machine will need to be able to access port 1234 on the server so if you have any firewalls in the way there, then 1234 will need to be open.  You will also need to make sure nothing else is already using 1234 on that server, but IIS will probably throw an error if there is.  If you leave the port as the standard 80 then you can access the webservice simply by the ip, you won't need to add the ":" thing.  This might restrict what other sites can run on that server though.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 29, 2013 6:29 AM

All replies

  • User1508394307 posted

    Jake,

    As you mentioned correctly, 192.168.x.x is a local lan ip address. Does the third party has the access to that ip? They should get a default site on your IIS when requesting this url in the browser. Also depends on authentication it might be that the web site will ask for their credentials. If ip and authentication is not the issue, then you can check if there is no any special setup for the port required. When you develop locally and use 1234 it is because of default IIS Express behavior. When you setup your service in production you might not need 1234 and use 80 instead. 80 usually is opened in firewall/proxy but in case of 1234 it might need an additional setup.

    Tuesday, October 29, 2013 6:29 AM
  • User-760709272 posted

    Copy your project folder onto the server (or do a publish in Visual Studio to a local folder so that you get a "clean" folder that contains only the files you actually need, and copy that folder on).  In IIS create a new site by right-clicking "Sites" and "Add new site".  In the sitename, call it what you want, in "Physical path" select the folder you copied on that has your files.  In the "Port" box of the "Binding" section enter "1234".

    In terms of firewall, the browser on the client machine will need to be able to access port 1234 on the server so if you have any firewalls in the way there, then 1234 will need to be open.  You will also need to make sure nothing else is already using 1234 on that server, but IIS will probably throw an error if there is.  If you leave the port as the standard 80 then you can access the webservice simply by the ip, you won't need to add the ":" thing.  This might restrict what other sites can run on that server though.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 29, 2013 6:29 AM
  • User1467896699 posted

    Thanks for your help guys, you got me moving in the right direcdtion. In case anyone stumbles across this thread, here are the steps I took.

    1) Publish the web service to a new folder (right click the prject > Publish > (select or create a profile to publish to a new directory).

    2) Followed AidyF's instructions for adding a website.

    3) I ran into several ASP.NET specific issues that were resolved one by one; ie 404.17, 404.2. These were easy to fix even for me so there should be no real problems.

    Viola, the web service can now be accessed fropm the IP address exactly as required.

    Tuesday, October 29, 2013 7:44 AM