我为我的 WCF 服务创建了 2 个端点。
它可以正常工作,basicHttpBinding
但会导致webHttpBinding
.
错误 = 未找到端点。
运营合约定义
[OperationContract]
[WebInvoke(Method = "POST",
BodyStyle = WebMessageBodyStyle.WrappedRequest,
ResponseFormat = WebMessageFormat.Json)]
VINDescription CallADSWebMethod(string vin, string styleID);
web.config
:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="Description7aBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://services.chromedata.com:80/Description/7a"
binding="basicHttpBinding"
bindingConfiguration="Description7aBinding"
contract="description7a.Description7aPortType"
name="Description7aPort"/>
</client>
<services>
<service behaviorConfiguration="asmx" name="ADSChromeVINDecoder.Service">
<endpoint name="httpEndPoint"
address=""
binding="basicHttpBinding"
contract="ADSChromeVINDecoder.IService"/>
<endpoint name="webEndPoint"
address="json"
behaviorConfiguration="web"
binding="webHttpBinding"
contract="ADSChromeVINDecoder.IService"/>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp/>
<enableWebScript/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="asmx">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
请建议我如何解决这个问题?