namespace Test { using System; using System.Web.Configuration; using System.Web.Services; using System.Web.Services.Configuration; using System.Web.Services.Description; public sealed class TestClass { [WebMethod(Description="WebMethod with custom MessageName", MessageName="TestMessage")] public string TestMethod() { return "It works!"; } public static void Main(string[] Args) { ServiceDescriptionReflector sdr = new ServiceDescriptionReflector(); sdr.Reflect(typeof(TestClass), "urn:foo"); BasicProfileViolationCollection ProfileViolations = new BasicProfileViolationCollection(); foreach (WsiProfilesElement claims in ((WebServicesSection) WebConfigurationManager.GetSection("system.web/webServices")).ConformanceWarnings) { if (claims.Name != WsiProfiles.None) { WebServicesInteroperability.CheckConformance (claims.Name, sdr.ServiceDescriptions, ProfileViolations); } } Console.WriteLine("{0} violations found.", ProfileViolations.Count); } } }