.Net Consume Web Service

Consume Web Service with .Net

During the past 8 months, I have been playing with web services quite a bit – both calling and developing web services for my employer.  However, I had some trouble along the way finding information on the different standards of web services (such as JAX-WS and JAX-RPC ), implementing those web services on the server (Jboss) , and testing the services by writing a web service client (VB.Net) .

So I thought documenting the information I have collected would be useful for others attempting the same thing.  The next series of posts will show you how to write, deploy, and consume web services using a combination of .Net and Java.

Consume a Web Service in .NET

Calling a web service in Microsoft .Net framework is super easy.  Simply open a new or existing project, click Project > Add Web Reference , then enter the URL to the web service’s WSDL .

A WSDL is an XML document that is used to define a web service , such as Method Names and Parameters for those Methods.  Don’t worry, you usually don’t have to write this document by hand.  Yes, the programming gods have smiled upon us.  Most IDE editors will do this for you including Visual Studio and NetBeans .

After entering the URL as suggested above, just follow the wizard steps and .Net will take care of the rest for you.

Once complete, you should see Web References in the Solution Explorer pane in Visual Studio.  You can edit the Reference Name and URL in the Properties pane by clicking on the web service reference (whatever you named it) under Web References .

Now you can reference the web service object that you just created by typing "WhateverYouNamedIt. "

Go ahead and give it a shot!

Related Stuff

Eliot is a software developer by trade and a entrepreneur by spirit. He has built web software for the likes of YMCA, UPS, FedEx, Ford and Harcourt, and helped launch mobile apps like Coupon Policy, TourWrist, and Pocket Legal.

Join him as he learns and shares his experiences of marketing his own products online.

Subscribe via RSS

Comments are closed.