Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
<?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
<?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>



Thanks in advance !!

Thanks, Tapas
"Happy Coding"
Posted
Updated 7-May-17 21:36pm

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900