Friday, June 17, 2011

Deploy Web Services

How To deploy web service?

There is nothing special in deploying web service. We can do the same way as we deploy any website. Just copy the Web Service folder inside inetpub and make it virtual directory. Now you can access this web service from any where. If you don't want to give source code you can publish it as well as we do for Website.

We can call this web service using http://ip address/WebSite1/Service.asmx

How to Access web service?
Right click on solution explorer


Click on Add Web Reference a window will open as below



Paste the URL(sample : http://ip address/Website1/Service.asmx) in URL box.Afterwords click on Go button.


After this next window will open click on Add Reference button. And you have finished. Your web service success fully added in your project now you can use it.

like:
private void button1_Click(object sender, EventArgs e)
{
localhost.Service objWebSrv = new localhost.Service();
MessageBox.Show(objWebSrv.HelloWorld());
}

No comments:

Followers

Link