WCF REST服务在WCFTestClient中不可见
我已成功为我的原型服务配置了3个端点。端点是basicHttpBinding、wsHttpBinding和webHttpBinding。目前我唯一的问题是WCFTestClient。当我将它指向我的服务时,它列出了前两个,但没有列出webHttpBinding。我可以通过我的浏览器测试REST端点,它工作得很好。这是我的配置:WCF REST服务在WCFTestClient中不可见,wcf,wcf-rest,webhttpbinding,wcftestclient,Wcf,Wcf Rest,Webhttpbinding,Wcftestclient,我已成功为我的原型服务配置了3个端点。端点是basicHttpBinding、wsHttpBinding和webHttpBinding。目前我唯一的问题是WCFTestClient。当我将它指向我的服务时,它列出了前两个,但没有列出webHttpBinding。我可以通过我的浏览器测试REST端点,它工作得很好。这是我的配置: <system.serviceModel> <services> <service behaviorConfigura
<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>
是否有任何原因导致我无法在WCFTestClient工具中看到webHttpEndpoint
干杯,
Dany.这是因为web端点(与SOAP端点不同)不公开元数据,所以测试客户端在下载服务的WSDL时不知道元数据。与SOAP不同,SOAP具有用于公开元数据的定义良好的格式(WSDL、MEX),web(又称REST)端点没有
这就是短篇故事。如果您想了解更多详细信息,我在上写了一篇关于它的博客文章,尝试添加公开元数据的“mexHttpBinding”端点以下是WCF测试客户端不支持的功能列表: •类型:流、消息、XmlElement、XmlAttribute、XmlNode、实现 IXmlSerializableinterface,包括相关的XmlSchemaProviderAttribute属性、XDocument和XElement类型以及ADO.NET数据表类型 •双重合同 •交易 •安全性:CardSpace、证书和用户名/密码 •绑定:WSFederationbinding、任何上下文绑定和Https绑定、WebHttpbinding(Json响应消息支持)
来源:这是我最初的想法。。。然后我发现了这个——这个家伙不知怎么地在他的wcftestclient上列出了端点实际上不能用JSON(或普通的旧XML)调用:它没有
行为。我也尝试了与他完全相同的场景,当我浏览WSDL页面时,我只能看到两个
元素(一个用于basic,一个用于ws),没有一个用于webHttpBinding
端点。是的-他没有webHttp行为,这是我的东西,因为我需要它来与jQuery.Ajax()交互调用。这将不起作用-webHttpBinding端点未在服务元数据中公开。WCF测试客户端用于基于SOAP的服务-除了webHttpBinding
。。。。