ipkiss
ipkiss

Reputation: 13661

What are the differences between WebServiceBinding.EmitConformanceClaims and WebServiceBinding.ConformanceClaims?

I have a xml web service like:

[WebService(Description = "The Calculator Web Service",

                            Name = "CalculatorWebService")]

[WebServiceBinding(ConformsTo = WsiProfiles.None, EmitConformanceClaims = false)]

public class Service : System.Web.Services.WebService

{ 

    [WebMethod(Description = "Subtracts two integers.")]

    public int Subtract(int x, int y) { return x - y; }



    [WebMethod(Description = "Adds two float.", MessageName = "AddFloats")]

    public float Add(float x, float y) { return x + y; }



    [WebMethod(Description = "Adds two integers.", MessageName = "AddInts")]

    public int Add(int x, int y) { return x + y; }

}

I have read some articles regarding WebServiceBinding.EmitConformanceClaims and WebServiceBinding.ConformanceClaims. However, I could not find the differences between them. I got that confused because if ConformsTo = WsiProfiles.None then no matter EmitConformanceClaims = false or true, the above web service can be invoked successfully by clients. So, why do we need EmitConformanceClaims?

Thanks.

Upvotes: 2

Views: 9508

Answers (1)

Philip Rieck
Philip Rieck

Reputation: 32568

  • Setting EmitConformanceClaims simply means that when the WSDL of the service is requested, the claims set by ConformsTo are emitted.

  • The conformance claims (ConformsTo) is declaring what specification your binding adheres to.

So setting ConformsTo sets your specification level, and EmitConformanceClaims allows you to output (or not) the level in your service description. Obviously if you set ConformsTo to None, there is nothing to emit, so EmitConformanceClaims has no effect.

Upvotes: 2

Related Questions