Click here to Skip to main content
15,301,414 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

i am using Web services in that webservices i have 2 overload methods
[Webmethod]
Ex:Public void Add()
{

}
[Webmethod]
public void Add(string a)
{
}
if i compile that time i got Error "Use the MessageName property of the WebMethod custom attribute to specify unique message names for the methods."

can you help Me..
Posted

Google before you post

Web service needs to identify each method uniquely hence we need to give alias to the methods by setting the MessageName property.
e.g.
C#
[WebMethod(MessageName = "SinInt")]
[WebMethod(MessageName = "CosInt")]
[WebMethod(MessageName = "TanInt")]
   
Comments
[no name] 4-Dec-13 10:12am
   
My 5!
Solution 1 :

Step 1: update Web Service Binding

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] to

[WebServiceBinding(ConformsTo = WsiProfiles.None)]

Setp 2 : As suggested above use different message name like suggested above

[WebMethod(MessageName = "SinInt")]
[WebMethod(MessageName = "CosInt")]



Solution 2 : If possibe try to use different Method name.


Happy Coading....
   
Comments
[no name] 4-Dec-13 10:12am
   
My 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900