2006-03-18
| Table of Contents: |
| Rate This Article: | Add This Article To: |
( Page 2 of 4 )
Basic Profile, or "BP", Conformance
The Basic Profile is defined by WS-I, the Web Services Interoperability Organization.
It is a guideline for building consistent web services that can be consumed across technology platforms. WCF conforms to Basic Profile 1.1.
Therefore, by ensuring that your web services also conform to the Basic Profile 1.1 guidelines, you can be confident that WCF clients will be able to communicate with them.
In Visual Studio 2005, the Web Service template makes services BP 1.1 compliant by default using the WebServiceBinding attribute to decorate the service.
<WebService(Namespace:="http://services.thedatafarm.com") > _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ Public Class MyService End Class
This attribute's purpose is to help ensure that the service you are writing conforms to whichever profile you tell it. Since there are a lot of rules to remember, the test for conformance is done by .NET for you.
So if you break one of the rules, the web service will return a big fat, yet very informative, error when you try to call it. For example, you could overload your web method; it's something .NET allows you to do (using the MessageName parameter) but is a big no-no for proper web services.
Here is an example:
<WebService(Namespace:="http://services.thedatafarm.com/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
Public Class Service
Inherits System.Web.Services.WebService
<WebMethod(MessageName:="PlainMessage")> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
<WebMethod(MessageName:="MessagewithName")> _
Public Function HelloWorld(ByVal myname As String) As String
Return "Hello World"
End Function
End Class
Here is the error which very explicitly explains that the web service does not follow BP 1.1 conformance and why.
Even if you do not know all of the rules of BasicProfile 1.1 — and there are a lot of them! — using the binding attribute protects you from accidentally breaking that rule.
There is an additional binding parameter that you can use, though it is not required: EmitConformanceClaims. It looks like this in your web service's binding attribute:
<WebService(Namespace:="http://services.thedatafarm.com/")> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1, EmitConformanceClaims:=True)>
This puts a flag into the WSDL for your service that says, "Hey! This message conforms to [whichever standard you are conforming to]". This is an additional help to clients of your web service. To see this, browse to your web service, then type ?wsdl at the end of the url (e.g. http://localhost/testWebService/Service.asmx?wsdl).
Here you see the description of your web service. If you search for the section wsdl: binding name = ServiceSoap", you see the claim that was inserted just below.
![]() |
|


