Getting repeated timeout when calling stream-based web service

75 views Asked by At

Calling a stream-based web service but keep getting a timeout exception (System.Web.Net.Exception).

All the advice I've been able to find on the net asks me to set the timeouts. Here is my configuration:

    <binding name="BasicHttpBinding_IEntity"  maxBufferSize="65536"
             maxReceivedMessageSize="2147483647"
             transferMode="StreamedRequest" receiveTimeout="00:10:00" sendTimeout="00:10:00"  openTimeout="00:10:00" closeTimeout="00:10:00" >
      <readerQuotas  maxArrayLength="2147483647"  maxStringContentLength="2147483647" />
    </binding>

I am still getting timeouts and it is getting frustrating. Another web service (for logins) on the same server at a similar URL works fine. This second web service is not stream-based.

Is there something wrong with the way I am submitting to the web service? I've verified that the parameters I am submitting are correct.

1

There are 1 answers

0
Derek W On

The problem is that BasicHttpBinding is for communicating with SOAP web services (SOAP 1.1 to be precise). The client code you linked to is consuming the web service as if it were a RESTful service.

It is possible to use the WebClient class to consume a WCF SOAP web service, but I wouldn't recommend it. If this service is a SOAP web service, then I advise generating a proxy via the WSDL and using that to communicate with the service. If the service is actually a WCF RESTful service, then you must you the WebHttpBinding and add the WebHttpBehavior to the service endpoint.