wcf wcf-rest webhttpbinding wcftestclient

WCF REST Service no es visible en WCFTestClient



wcf-rest webhttpbinding (3)

He configurado con éxito 3 puntos finales para mi servicio de prototipo. Los puntos finales son basicHttpBinding, wsHttpBinding y webHttpBinding. El único problema que tengo en este momento está en el WCFTestClient. Cuando lo dirijo a mi servicio, enumera los dos primeros, pero no el enlace webHttpBinding. Puedo probar el punto final REST a través de mi navegador y funciona bien. Aquí está mi configuración:

<system.serviceModel> <services> <service behaviorConfiguration="serviceBehaviour" name="VMDServices.VMDService"> <endpoint binding="webHttpBinding" address="rest" behaviorConfiguration="webBehaviour" contract="VMDServices.IService1"> <identity> <dns value="localhost"/> </identity> </endpoint> <endpoint binding="basicHttpBinding" address="basic" bindingConfiguration="basicBinding" contract="VMDServices.IService1"> </endpoint> <endpoint binding="wsHttpBinding" address="ws" bindingConfiguration="wsBinding" contract="VMDServices.IService1"> <identity> <dns value="localhost"/> </identity> </endpoint> </service> </services> <bindings> <basicHttpBinding> <binding name="basicBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <security mode="None"></security> <readerQuotas maxStringContentLength="2147483647"/> </binding> </basicHttpBinding> <wsHttpBinding> <binding name="wsBinding" transactionFlow="true"> <security mode="None"></security> <reliableSession enabled="true" ordered="true" /> </binding> </wsHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="webBehaviour"> <webHttp /> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name="serviceBehaviour"> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true"> </serviceHostingEnvironment> </system.serviceModel>

¿Hay alguna razón por la que no pueda ver webHttpEndpoint en la herramienta WCFTestClient?

Saludos, Dany.


Esto se debe a que los puntos finales web (a diferencia de los SOAP) no exponen los metadatos, por lo que el cliente de prueba no lo conoce cuando descarga el WSDL para el servicio. A diferencia de SOAP, que tiene formatos bien definidos para exponer metadatos (WSDL, MEX), los puntos finales web (aka REST) ​​no lo hacen.

Esa es la historia corta. Si desea conocer más detalles, escribí una publicación de blog al respecto en http://blogs.msdn.com/b/carlosfigueira/archive/2012/03/26/mixing-add-service-reference-and-wcf-web-http-a-k-a-rest-endpoint-does-not-work.aspx


La siguiente es una lista de características no compatibles con el cliente de prueba de WCF:

• Tipos: Stream, Message, XmlElement, XmlAttribute, XmlNode, tipos que implementan la interfaz IXmlSerializable, incluido el atributo XmlSchemaProviderAttribute relacionado, y los tipos XDocument y XElement y el tipo ADO.NET DataTable.

• Contrato dúplex.

• Transacción.

• Seguridad: CardSpace, certificado y nombre de usuario / contraseña.

• Enlaces: WSFederationbinding, cualquier enlace de contexto y enlace Https, WebHttpbinding (soporte de mensajes de respuesta Json).

Fuente: http://msdn.microsoft.com/en-us/library/bb552364.aspx


intente agregar el punto final "mexHttpBinding" que expone los metadatos