这可能是由于服务端点绑定不使用HTTP协议 [英] This could be due to the service endpoint binding not using the HTTP protocol

查看:333
本文介绍了这可能是由于服务端点绑定不使用HTTP协议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的本地机器上有一个WCF服务运行正常。我把它放在服务器上,我收到以下错误:


收到
HTTP响应时发生错误
http://xx.xx.x.xx:8200 / Services /WCFClient.svc 的。
这可能是由于服务
端点绑定不使用HTTP
协议。这也可能是由于
HTTP请求上下文被
中断服务器(可能由于
服务关闭)。请参阅服务器
日志了解更多详细信息。]


我已经访问了url中的服务,它正常工作。所有我正在做的功能是将字符串返回到图像名称,因此传递的数据不是很多。我已经跟踪了日志,它给了我相同的信息。这是我的客户端配置:

 < binding name =basicHttpBinding_IWCFClientcloseTimeout =00:01:00
openTimeout =00:01:00receiveTimeout =00:10:00sendTimeout =00:01:00
bypassProxyOnLocal =falsehostNameComparisonMode =StrongWildcard
maxBufferPoolSize =2147483647 maxReceivedMessageSize =2147483647
messageEncoding =TexttextEncoding =utf-8useDefaultWebProxy =true
allowCookies =false>
< readerQuotas maxDepth =2147483647maxStringContentLength =2147483647
maxArrayLength =2147483647maxBytesPerRead =2147483647
maxNameTableCharCount =2147483647/>
< security mode =无>
< transport clientCredentialType =NoneproxyCredentialType =Nonerealm =/>
< message clientCredentialType =UserNamealgorithmSuite =Default/>
< / security>
< / binding>
< endpoint name =basicHttpBinding_IWCFClient
address =http:// localhost:4295 / Services / WCFClient.svc
binding =basicHttpBinding
bindingConfiguration =basicHttpBinding_IWCFClient
behaviorConfiguration =WCFGraphicManagementTool.Services.ClientBehavior
contract =WCFClient.IWCFClient/>

这是我的服务器配置:

 < service behaviorConfiguration =WCFGraphicManagementTool.Services.WCFClientBehavior
name =WCFGraphicManagementTool.Services.WCFClient>
< endpoint name =basicHttpBinding_IWCFClient
address =
binding =basicHttpBinding
contract =WCFGraphicManagementTool.Contracts.IWCFClient/>
< endpoint
address =mex
binding =mexHttpBinding
contract =IMetadataExchange/>
< / service>
<行为名称=WCFGraphicManagementTool.Services.WCFClientBehavior>
< dataContractSerializer maxItemsInObjectGraph =2147483647/>
< serviceThrottling maxConcurrentCalls =120maxConcurrentSessions =120
maxConcurrentInstances =120/>
< serviceMetadata httpGetEnabled =true/>
< serviceDebug includeExceptionDetailInFaults =true/>
< / behavior>

它是在服务器上的一个设置,因为它在我的本地机器上工作?

解决方案

我想出了这个问题。它最终成为我的配置文件的一个路径是错误的。有时WCF的错误非常有用。


I have a WCF Service running fine on my local machine. I put it on the servers, and I am receiving the following error:

An error occurred while receiving the HTTP response to http://xx.xx.x.xx:8200/Services/WCFClient.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.]

I have gone to the service in the url and it is working correctly. All I am doing for the function is returning a string to an image name, so the data being passed isn't a lot. I have traced the log and it gives me the same information. Here is my client config:

<binding name="basicHttpBinding_IWCFClient" closeTimeout="00:01:00"
         openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
         bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
         maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
         messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
         allowCookies="false">
    <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" 
                  maxArrayLength="2147483647" maxBytesPerRead="2147483647" 
                  maxNameTableCharCount="2147483647" />
    <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
    </security>
</binding>
<endpoint name="basicHttpBinding_IWCFClient" 
    address="http://localhost:4295/Services/WCFClient.svc"
    binding="basicHttpBinding" 
    bindingConfiguration="basicHttpBinding_IWCFClient" 
    behaviorConfiguration="WCFGraphicManagementTool.Services.ClientBehavior"
    contract="WCFClient.IWCFClient" />

Here is my server config:

<service behaviorConfiguration="WCFGraphicManagementTool.Services.WCFClientBehavior"
    name="WCFGraphicManagementTool.Services.WCFClient">
   <endpoint name="basicHttpBinding_IWCFClient"
       address="" 
       binding="basicHttpBinding" 
       contract="WCFGraphicManagementTool.Contracts.IWCFClient" />
   <endpoint 
       address="mex" 
       binding="mexHttpBinding" 
       contract="IMetadataExchange" />
</service>
<behavior name="WCFGraphicManagementTool.Services.WCFClientBehavior">
   <dataContractSerializer maxItemsInObjectGraph="2147483647" />
   <serviceThrottling maxConcurrentCalls="120" maxConcurrentSessions="120"
                      maxConcurrentInstances="120" />
   <serviceMetadata httpGetEnabled="true" />
   <serviceDebug includeExceptionDetailInFaults="true" />
</behavior>

Would it be a setting on the server since it works on my local machine?

解决方案

I figured out the problem. It ended up being a path to my config file was wrong. The errors for WCF are so helpful sometimes.

这篇关于这可能是由于服务端点绑定不使用HTTP协议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆