Web服务调用失败404 [英] Webservice call failed 404
本文介绍了Web服务调用失败404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有使用WCF服务的项目。我通过ajax和处理程序调用服务。本地它工作正常,当我在IIS8中托管它时,我收到Webservice调用失败404错误。
有人可以帮我这个...
这是webconfig中使用的绑定
< system.serviceModel >
< ; 行为 >
< endpointBehaviors >
< 行为 名称 = ServiceAspNetAjaxBehavior >
< enableWebScript / >
< span class =code-keyword>< / behavior >
< 行为 name = AjaxCallAspNetAjaxBehavior >
< enableWebScript / >
< / behavior >
< 行为 name = AJAXCallsAspNetAjaxBehavior >
< enableWebScript / >
< / behavior >
< / endpointBehaviors >
< / behavior >
< serviceHostingEnvironment aspNetCompatibilityEnabled = true multipleSiteBindingsEnabled = true / > ;
< 服务 >
< service 名称 = 服务 >
< endpoint 地址 = behaviorConfiguration = ServiceAspNetAjaxBehavior bindingConfiguration = webBinding binding = < span class =code-keyword> webHttpBinding contract = 服务 / >
< / service >
< service 名称 = AjaxCall >
< endpoint 地址 = behaviorConfiguration = AjaxCallAspNetAjaxBehavior bindingConfiguration = webBinding binding = webHttpBinding 合同跨度> = AjaxCall / >
< / service >
< service name = AJAXCalls >
< endpoint address = behaviorConfiguration = AJAXCallsAs pNetAjaxBehavior bindingConfiguration = webBinding binding = webHttpBinding 合同 = AJAXCalls / >
< / service >
< / services >
< bindings >
< webHttpBinding >
< binding name = webBinding < span class =code-keyword>>
< security mode = 无 / >
< / binding >
< / webHttpBindi ng >
< / bindings >
< / system.serviceModel >
解决方案
404 - 未找到的意思。 HTTP 404 [ ^ ]。你应该检查你正在调用的URL,我怀疑URL包含端口号。请更正您的网址,然后重试
我已在Windows功能下为 WCF服务启用了 Http Activation ,这对我有用。
参考: http ://stackoverflow.com/questions/7083533/http-error-404-17-not-found [ ^ ]
感谢您的帮助...
I have project using WCF service. I am calling the service through ajax and handlers. Locally it is working fine, when I host it in IIS8 I am getting Webservice call failed 404 error.
Can anybody please help me on this...
Here is the binding used in webconfig
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="ServiceAspNetAjaxBehavior">
<enableWebScript/>
</behavior>
<behavior name="AjaxCallAspNetAjaxBehavior">
<enableWebScript/>
</behavior>
<behavior name="AJAXCallsAspNetAjaxBehavior">
<enableWebScript/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
<services>
<service name="Service">
<endpoint address="" behaviorConfiguration="ServiceAspNetAjaxBehavior" bindingConfiguration="webBinding" binding="webHttpBinding" contract="Service"/>
</service>
<service name="AjaxCall">
<endpoint address="" behaviorConfiguration="AjaxCallAspNetAjaxBehavior" bindingConfiguration="webBinding" binding="webHttpBinding" contract="AjaxCall"/>
</service>
<service name="AJAXCalls">
<endpoint address="" behaviorConfiguration="AJAXCallsAspNetAjaxBehavior" bindingConfiguration="webBinding" binding="webHttpBinding" contract="AJAXCalls"/>
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="webBinding">
<security mode="None"/>
</binding>
</webHttpBinding>
</bindings>
</system.serviceModel>
解决方案
404 - means not found. HTTP 404[^]. You should check the URL you are invoking, I suspecting the URL contains port number. Please correct your URL and try again
I have enabled the Http Activation for WCF service under Windows feature, and it worked for me.
Refer: http://stackoverflow.com/questions/7083533/http-error-404-17-not-found[^]
Thanks for the Help...
这篇关于Web服务调用失败404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文