Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing a Web Service

I have a web service application in C#. When I run the Debug in Visual Studio, it starts the service at http://localhost:###### and shows the Default.htm page with links to test the different calls that can be made to the web service.

Is there a way to call this locally running version to test it from another computer? I tried making a call that the links on the test page make, but replaced localhost with the IP address of the machine running it, but it said that it could not connect to the server.

like image 280
John Avatar asked Jan 21 '23 15:01

John


1 Answers

The embedded Visual Studio web server (Cassini) is only accessible from the local machine. If you want to use the web service from a different computer, you will need to deploy the service to IIS and then you'll be able to get to it at http://xxx.xxx.xxx.xxx/MyWebService/MyWebService.asmx (replace xxx with your IP Address and MyWebService with the appropriate IIS web site path).

Then to create a test application, you can create either an ASP.NET website or WinForms/Console application and import a Web Service reference in Visual Studio. That will build the proxy classes for you automatically and make calling the service very easy.

like image 92
rswafford Avatar answered Jan 30 '23 11:01

rswafford