我正在尝试部署 WCF 服务,但我很难让最后的部分工作。无论如何,我都不是部署专家,所以请多多包涵。
我正在使用 WebHttpBinding 使用 JSON 对服务进行 Ajax 调用,但我收到错误消息:“找不到与绑定 WebHttpBinding 的端点的方案 http 匹配的基地址。注册的基地址方案是 []。”。
这是我的 web.config 的片段:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
<baseAddressPrefixFilters>
<add prefix="http://mysite.com/" />
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<bindings>
<webHttpBinding>
<binding name="webHttp">
<security mode="None">
<transport clientCredentialType="None"
proxyCredentialType="None"
realm="string" />
</security>
</binding>
</webHttpBinding>
</bindings>
<services>
<service name="LicenseManager.LicenseService" behaviorConfiguration="ServiceAspNetAjaxBehavior">
<endpoint address="" behaviorConfiguration="AjaxBehavior"
binding="webHttpBinding" contract="LicenseManager.ILicenseService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://mysite.com/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="AjaxBehavior">
<enableWebScript/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ServiceAspNetAjaxBehavior">
<serviceMetadata httpGetEnabled="true" httpGetUrl="" />
<serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
我做了很多改变并尝试了很多选择,以至于我真的失去了对我正在做的事情的概述。我希望你能找到让这一切正常工作的那个小错误。
谢谢你。