Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF Service calling another WCF service fails with web error 400 Bad Request

Tags:

wcf

We have a web service that is called when user clicks save button on web form. The 'save' web service then makes a call into another web service (different machine). The call always fails and as far as I can tell does not even attempt to cross the network because the Fiddler traffic is empty. This problem only occurs when we call the second web service from the first web service. If we call the second web service straight from the client or on page load, it works. We are using WebHTTPBinding with REST type services.

I used the WCF trace to come up with the error 'Envelope Version 'EnvelopeNone (http://schemas.microsoft.com/ws/2005/05/envelope/none)' does not support adding Message Headers.', but I don't know how to resolve it.

Any suggestions?

like image 953
John Avatar asked Nov 14 '22 08:11

John


1 Answers

Possible fixes:

  1. Check @ServiceHost directive( in . svc file) is set to "WebServiceHostFactory" source
  2. WebHttpBeahvior element is added in the endpoint behavior source
  3. Put ORDER information in the XML schema Class source
  4. Check that your Data Transfer objects are serrializable source
  5. Check if Skype installed and make sure it doesn't overtake the port source
  6. Remove SOAP message header (it is not supported for REST WCF) source
like image 195
oleksii Avatar answered Dec 14 '22 23:12

oleksii