none
An error occurred while receiving the HTTP response to http://. This could be due to the service endpoint binding not using the HTTP protocol RRS feed

  • Question

  • Hi,

    I am getting the below error while consume the wcf service. Just i am using SharePoint Server Object Model in wcf service. I could consume the service successfullyy but getting this error while execute the service method .

    An error occurred while receiving the HTTP response to http://server.test.com:9843/_vti_bin/Testwcf/TestSPwcf.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.

    Please See My Web config:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="Test.Service1ServiceBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service behaviorConfiguration="Test.Service1ServiceBehavior"
              name="Test.Service1">
            <endpoint address="" binding="basicHttpBinding" contract="TestWcfService.IService1">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
          </service>
        </services>
      </system.serviceModel>
    </configuration>

    Thanks & Regards

    Poomani Sankaran

    Saturday, May 31, 2014 5:02 AM

Answers

  • Hi,

    I see that your service name is Test.Service1 and your service contract name is TestWcfService.IService1. Then if I do not misunderstand you, then the namespace of the service and service contract are mismatch. Please try to check it.

    Also please try to set the following to get more error information.

    <serviceDebug includeExceptionDetailInFaults="true" />


    Besides, enabling the wcf trace can also help you to find the root cause.
    The following configuration taken from MSDN can be applied to enable tracing on your WCF service.

    <configuration>
      <system.diagnostics>
        <sources>
          <source name="System.ServiceModel"
                  switchValue="Information, ActivityTracing"
                  propagateActivity="true" >
            <listeners>
                 <add name="xml"/>
            </listeners>
          </source>
          <source name="System.ServiceModel.MessageLogging">
            <listeners>
                <add name="xml"/>
            </listeners>
          </source>
          <source name="myUserTraceSource"
                  switchValue="Information, ActivityTracing">
            <listeners>
                <add name="xml"/>
            </listeners>
          </source>
        </sources>
        <sharedListeners>
            <add name="xml"
                 type="System.Diagnostics.XmlWriterTraceListener"
                 initializeData="Error.svclog" />
        </sharedListeners>
      </system.diagnostics>
    </configuration>


    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, June 2, 2014 2:51 AM
    Moderator