We are using the Azure Service Bus Relay for connecting our on-premise WCF services to our Azure-hosted Web Role. When we upgrade our on-premise WCF services, we always get a 502 Bad Gateway response from our first few requests through the Azure Service Bus, after the service bus host has re-established itself with the relay (we don't get the "No service is hosted at the specified address." since the service is hosted properly).
After a given timeout period - it seems the error disappears and WCF requests are handled properly through the relay. We are using basicHttpRelayBinding
with HTTP Keep-Alives disabled (to prevent CommunicationExceptions
).
Here is the error message we capture during the WCF requests to the relay from the web role:
System.ServiceModel.ProtocolException: The content type application/soap+xml; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. T he first 550 bytes of the response were...
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://schemas.microsoft.com/netservices/2009/05/servicebus/relay/FaultAction</a:Action>
</s:Header>
<s:Body>
<s:Fault>
<s:Code>
<s:Value>s:Receiver</s:Value>
<s:Subcode>
<s:Value>s:Receiver</s:Value>
</s:Subcode>
</s:Code>
<s:Reason>
<s:Text xml:lang="en-US">50200: Bad Gateway.TrackingId:8bd21714-ae0f-41b5-b810-851b59a345fb_28,TimeStamp:5/29/2012 8:27:14 PM</s:Text>
</s:Reason>
</s:Fault>
</s:Body>
</s:Envelope>
We are currently trying disabling the default web proxy in the WCF Bindings (via useDefaultWebProxy=false
), but are wondering if others have seen this same HTTP 502 behavior with the Azure Service Bus and how to fix it.