Как отобразить страницу справки веб-службы WCF HTTP, например asmx в .net framework 3.5
(я буквально перефразирую эти ссылки)
Добавьте атрибут описания к методу и, возможно, WebGet а также, как:
WebGet
[OperationContract] [WebGet(UriTemplate="/template1", BodyStyle = WebMessageBodyStyle.Bare)] [Description("Description for GET /template1")] SyndicationFeedFormatter GetTemplate1();
Выставить конечную точку с помощью web.config ...
web.config
<endpointBehaviors> <behavior name="RESTEndpointBehavior"> <webHttp enableHelp="true"/> </behavior> </endpointBehaviors> <!-- ... --> <services> <service behaviorConfiguration="RESTWebServiceBehavior" name="RESTWebService"> <endpoint address="" kind="webHttpEndpoint" behaviorConfiguration="RESTEndpointBehavior" contract="IHello" /> <!-- ... --> </service> </services>
... илив коде
using (WebServiceHost host = new WebServiceHost(typeof(Service), new Uri("http://localhost:8000/Customers"))) { host.AddServiceEndpoint(typeof(ICustomerCollection), new WebHttpBinding(), ""); host.Description.Endpoints[0].Behaviors.Add(new WebHttpBehavior { EnableHelp = true }); // ... }
Точная страница недоступна, но вы можете использовать полный набор WCF, доступный в Visual Studio 2010.
Использовать WCFTestClient.
Надеждаэта помощь.