Consequences of removing [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

F

Felix_WafyTech

Hi,

I have a web service with the attribute specified below:

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

In the web service, I have two functions with the same name but with
different parameters (overloaded). Like the example provided below:

[WebMethod(MessageName = "GetAllRecords", Description = "Retrieves all
records.")]
public List<Record> GetAllRecords()
{
return bl.GetAllRecords();
}

[WebMethod(MessageName = "GetAllRecordsSorted", Description = "Retrieves
records sorted by the specified parameter.")]
public List<Record> GetAllRecords(string sortExpression)
{
return bl.GetAllRecords(sortExpression);
}

The problem is: I'm unable to open the web service in a browser as it
generates the error message specified below. However, when I remove the
attribute "[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]" it
works as expected.

Service 'WebService' 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:eek:perations
within a given wsdl:portType. A wsdl:portType may have wsdl:eek:perations with
names that are the same as those found in other wsdl:portTypes. - Operation
'GetAllRecords' on portType 'WebServiceSoap' from namespace
'http://tempuri.org/'. To make service conformant please make sure that all
web methods belonging to the same binding have unique names.

My question is:
1. What does the "[WebServiceBinding(ConformsTo =
WsiProfiles.BasicProfile1_1)]" attribute specify and why is it needed?
2. What are the consequences of removing it from the web service?

Any help is very much appreciated.

Thanks,
Felix.J
 
J

Josh Twist

Hi Felix,

In short, the consequences are potential interoperability. The Basic
Profile 1.1 is an industry standard, it maybe that web service clients
written in other languages (maybe java for example) couldn't
communicate with your web service because it is non standard.

I personally try and stick with the basic profile after all you only
have to change the method name.

Josh
http://www.thejoyofcode.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top