Description
Today, we have a lot of idea about a web service. Many of us are already using web services for various purposes. I am not going to discuss the usage of web services. In this article I will show you how to connect a web service from another. There are many occasions when a developer need to connect to one web service from another.
In my previous submission, I showed how to create and deploy a complete Visual Shop web service. In that application, a customer can buy books. In a customer has to pay for the books, I called another service Bank web service. So basically the Bank web service is different than the Virtual shop. The point here I am trying to make is how to we call methods of one service from another. That's what we are going to see in this article in a moment.
We can invoke webmethod by using three method:
- using RSA Encryption as the security layer between the three different web
- Access then as if its a separate web service (using proxy client)
- Use libraries (.dll) and let each web services use the service of the dll.
Here we already have an idea about proxy client. By using proxy client we can invoke webservice the way we want. I am interested in showing you today is how we can build a dll for each webservice and use it in another webservice. By using VS.NET we can do it very easily.
Lets build two simple web services in visual Studio .NET 7.0. I think you already know how to make a web service in VS 7.0. Build a web service using VS.NET and name it calculator, which have two webmethod ADD and Mul. Add these two methods. The methods looks like the following:
[WebMethod]
public int ADD(int a,int b)
{
return a+b;
}
[WebMethod ]
public int Mul(int a,int b)
{
return a*b;
}


Subramanyam RompicherlaPosted Jun 29, 2012, 11:38 AM
Hi Is it possible for consuming the sharepoint Lists.asmx in to a web method? thanks Mani
prabha kalaiPosted Jan 23, 2011, 11:39 AM
thank you so much sir