- public class SumWebService: System.Web.Services.WebService
- {
- //1st Method
- ----------------------------------[WebMethod]
- public int Sum(int number1, int number2)
- {
- return number1 + number2;
- }
- //2nd Method
- ------------------------------[WebMethod]
- public int Sum(int number1, int number2, int number3)
- {
- return number1 + number2 + number3;
- }
- }
- Two Overcome this error we will use MessageName Propery of Webmethod to uniquely Identify the Method.
- {
- //1st Method
- ----------------------------------[WebMethod(MessageName = "Sum2Numbers")]
- public int Sum(int number1, int number2)
- {
- return number1 + number2;
- }
- //2nd Method
- ------------------------------[WebMethod]
- public int Sum(int number1, int number2, int number3)
- {
- return number1 + number2 + number3;
- }
- }
Service 'WebServicesDemo.SumWebService' does not conform to WS-I Basic Profile v1.1. Please examine each of the normative statement violations below. To turn off conformance check set the ConformanceClaims property on corresponding WebServiceBinding attribute to WsiClaims.None.
R2304: Operation name overloading in a wsdl:portType is disallowed by the Profile. A wsdl:portType in a DESCRIPTION MUST have operations with distinct values for their name attributes. Note that this requirement applies only to the wsdl:operations within a given wsdl:portType. A wsdl:portType may have wsdl:operations with names that are the same as those found in other wsdl:portTypes.
Operation 'Sum' on portType 'CalculatorWebServiceSoap' from namespace 'http://www.xyz.com/webservices'.
To make service conformant please make sure that all web methods belonging to the same binding have unique names.
FROM - [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
TO - [WebServiceBinding(ConformsTo = WsiProfiles.None)]

Santhakumar MunuswamyPosted May 30, 2015, 1:02 PM
Nice