Subhash Sharma

Subhash Sharma
Subhash Sharma

This is Subhash Sharma(Software Engineer) Blog

Welcome to this blog and find every solution.............

Search This Blog

Software Engineer(Subhash Sharma)

Software Engineer(Subhash Sharma)
Software Engineer

Thursday, January 20, 2011

Method Overloading in WebServices

When u overload a method than replace
//[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

[WebServiceBinding(ConformsTo = WsiProfiles.None)]


[WebMethod]
public int Add(int i, int j)
{
return i + j;
}
[WebMethod(MessageName = "Add2")]
public int Add(int i, int j, int k)
{
return i + j + k;
}

when u overload a method u hve to give the Mesaage name that would be unique from ur method name...

aspx.cs page

localhost.WebService1 proxy = new WebApplication1.localhost.WebService1();
proxy.Add(5,4,8);

No comments:

Post a Comment