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.
Setting
EmitConformanceClaimssimply means that when the WSDL of the service is requested, the claims set byConformsToare emitted.The conformance claims (
ConformsTo) is declaring what specification your binding adheres to.So setting
ConformsTosets your specification level, andEmitConformanceClaimsallows you to output (or not) the level in your service description. Obviously if you set ConformsTo to None, there is nothing to emit, soEmitConformanceClaimshas no effect.