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

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

问题描述

大家好,



我正在从我的WCF服务中获取异常,返回类型为object []的方法。



异常



收到http:// gcotdvm3722126的HTTP响应时出错/CAT.NextGenService/NextGenService.svc。这可能是由于服务端点绑定不使用HTTP协议。这也可能是由于服务器中止HTTP请求上下文(可能是由于服务关闭)。有关详细信息,请参阅服务器日志。




参考点。

1.我已托管我在IIS中的WCF服务并从WPF应用程序调用它。

2.我可以调试并从返回类型为string和int的所有方法中获取结果,除非使用object []作为返回的方法类型。



对象[] MyMethod(字符串foo1,字符串foo2)

3.我也可以调试上面的方法,点击服务并从我的数据访问层获取结果,但是在之后的上述异常中它会中断。



服务器配置文件

Hi All,

I am getting following exception from the my WCF service one for the method with return type object[].

Exception

An error occurred while receiving the HTTP response to http://gcotdvm3722126/CAT.NextGenService/NextGenService.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.


Reference Points.
1. I have hosted my WCF service in IIS and calling it from a WPF application.
2. I could debug and get result from all the methods with return type string and int except with the method with object[] as the return type.

object [] MyMethod(string foo1, string foo2)
3. I could also debug the above method, hit the service and get results from my data access layer but it breaks after that with the aforementioned exception.

Server config file

<?xml version="1.0"?>
<configuration>
  <appSettings>
    <add key="CATDbEnv" value="CATDB_CLOUD2"/>
  </appSettings>
  <connectionStrings>
    <add name="LEGACYCATDB_CLOUD2" connectionString="user id=legacycat;password=legacycat;data source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = vm-738e-a017.nam.nsroot.net)(PORT = 1522)))(CONNECT_DATA = (SID = CAT)))" providerName="System.Data.OracleClient"/>
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime maxRequestLength ="262144" executionTimeout="103600"/>
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception informaton -->
    <dataContractSerializer maxItemsInObjectGraph="2147483647" />
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>





客户配置文件





Client Config File

<?xml version="1.0"?>
<configuration>
  
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_INextGenService" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
                  <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>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://gcotdvm3722126/CAT.NextGenService/NextGenService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_INextGenService" 

                      behaviorConfiguration="endpointBehavior" contract="INextGenService" name="BasicHttpBinding_INextGenService"/>
        </client>
      <behaviors>
        <endpointBehaviors>
          <behavior name="endpointBehavior">
            <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
          </behavior>
        </endpointBehaviors>
      </behaviors>
    </system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>







提前致谢!!



谢谢,小吃

快乐编码

推荐答案

您是否在Google上搜索了该错误消息?检查这些

服务端点绑定不使用HTTP协议 [ ^ ]

来自wcf服务的CommunicationException [ ^ ]

收到错误时发生错误对此的HTTP响应可能是由于服务端点绑定不使用HTTP协议。这也可能是由于服务器中止HTTP请求上下文(可能是由于服务关闭)。有关详细信息,请参阅服务器日志 [ ^ ]



你可以在网上找到更多。
Did you search Google for that error message? Check these
Service endpoint binding not using the HTTP protocol[^]
CommunicationException from wcf service[^]
An error occurred while receiving the HTTP response to 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[^]

You could find more in web.


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

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