gpt4 book ai didi

ajax - "Baseaddress not found"- 在 GoDaddy 上部署 WCF 服务时出错

转载 作者:太空宇宙 更新时间:2023-11-03 13:08:39 27 4
gpt4 key购买 nike

我正在尝试部署一个 WCF 服务,但我很难让最后的部分发挥作用。我不是部署大师,所以请多多包涵。

我正在使用 WebHttpBinding 对使用 JSON 的服务进行 Ajax 调用,但我收到错误:“找不到与具有绑定(bind) 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>

我进行了如此多的更改并尝试了如此多的选项,以致于老实说,我已经忘记了我在做什么。我希望您能找到让一切正常运行的微小错误。

谢谢。

最佳答案

您的站点是否直接运行在http://mysite.com下,还是在该站点下的 application/vdir 下运行?如果是这样,请在您的 <baseAddressPrefixFilter> 中添加该应用程序元素:

  <baseAddressPrefixFilters>
<add prefix="http://mysite.com/MyApplication" />
</baseAddressPrefixFilters>

我认为您不需要结尾的 /要么 - 但我不认为这是导致问题的原因。

希望这对您有所帮助!让他们知道,我会相应地更新我的答案。

关于ajax - "Baseaddress not found"- 在 GoDaddy 上部署 WCF 服务时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3591932/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com