How to set connectivity mode (from autodetect to http) in web.config, when wcf service is hosted locally in IIS

Answered How to set connectivity mode (from autodetect to http) in web.config, when wcf service is hosted locally in IIS

  • Thursday, January 19, 2012 8:42 PM
     
     

    This came up in the course of troubleshooting a messaging issue. Sometimes the payload of the message is not properly passed to a web service method implementation (nulls for all arguments are passed instead). In fact, the identical message can be sent, sometimes it works, sometimes it doesn't but usually it works.

    The issue can be recreated on demand, as it turns out, by restarting the Application Pool in IIS and then sending a message immediately after this. Shortly thereafter (after a failure) the message will start working reliably and then fail every so often after that, just not very often at all. The message headers always make it through intact and show the content length > 0 on failures and successes, and the correct function is called. This using Relayed Messaging and the webHttpRelayBinding.

    Whether it fails or succeeds, the correct web service method is reliably called and the response is received by the client (for failures the response is an error this web service sends back indicating arguments are null which is not valid).

     

    Anyway, to the question at hand. We'd like to use Fiddler to capture the message and view it. We've already done this using WCF Tracing, but don't get the body as it is treated as a stream.

     

    We think if the Connectivity Mode is set to use HTTP that Fiddler will be able to show the message.

     

    So, how can the ConnectivityMode.Http be set in web.config, for a web service with endpoint listener directly on the Relayed service bus? And which uses the webHttpRelayBinding (this binding is needed since the client is a java client using REST APIs).

All Replies