Ajax call to WCF service returns 12031 ERROR_INTERNET_CONNECTION_RESET on new endpoint

Posted by cyrix86 on Stack Overflow See other posts from Stack Overflow or by cyrix86
Published on 2010-04-07T21:11:55Z Indexed on 2010/04/08 14:43 UTC
Read the original article Hit count: 505

Filed under:
|
|

I have extended a WCF service with new functionality in the form of a second service contract. The service.cs now implements both contracts. I have added another endpoint to expose the new contract operations. Here is my web.config relating to the service

<system.serviceModel>
    <bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding" />
  </basicHttpBinding>
        <webHttpBinding>
            <binding name="XmlHttpBinding"/>
        </webHttpBinding>
    </bindings>
    <services>
        <service name="MyNamespace.MyService" 
           behaviorConfiguration="MyServiceBehavior">
            <!-- Service Endpoints -->
            <endpoint address="xmlHttp1" 
              behaviorConfiguration="XmlHttpBehavior" 
              binding="webHttpBinding" 
              bindingConfiguration="XmlHttpBinding" 
              contract="MyNamespace.IContract1" />
    <endpoint address="xmlHttp2"
              binding="webHttpBinding"
              behaviorConfiguration="XmlHttpBehavior"
              bindingConfiguration="XmlHttpBinding"
              contract="MyNamespace.IContract2" />
    <endpoint address=""
              binding="basicHttpBinding"
              bindingConfiguration="BasicHttpBinding"
              contract="MyNamespace.IContract1" />
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="MyServiceBehavior">
                <!-- 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 information -->
                <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
        </serviceBehaviors>
        <endpointBehaviors>
            <behavior name="XmlHttpBehavior">
                <webHttp/>
            </behavior>
        </endpointBehaviors>
    </behaviors>
</system.serviceModel>

From Javascript, calling 'http://server/wcfServiceApp/MyService.svc/xmlHttp1/Method1' still works fine.

Calling 'http://server/wcfServiceApp/MyService.svc/xmlHttp2/Method2' returns the 12031 error.

There must be something simple I'm not doing, any help is appreciated.

© Stack Overflow or respective owner

Related posts about wcf

Related posts about AJAX