0

Need help in sending a request which is for WCF service. The service has Custom Binding ( The request is Binary encoded).

Initially i was getting the HTTP/1.1 415 Cannot process the message because the content type 'application/soap+xml;charset=UTF-8;action="Phase"' was not the expected type 'application/soap+msbin1+gzip'.

So I manually added a header Content-Type = 'application/soap+msbin1+gzip'. Now the previous error was gone. but now I am getting the following error: "The remote server returned an error: (400) Bad Request"

I am using HttpWebRequest. Below images for the reference

Code image

Error line Where i got 400

Gaurav
  • 1
  • 1
  • 400 Bad Request errors can have multiple causes,you can try [enabling trace](https://learn.microsoft.com/en-us/dotnet/framework/wcf/diagnostics/tracing/configuring-tracing?redirectedfrom=MSDN) debugging on the server side.[This post](https://stackoverflow.com/questions/42483665/content-type-application-soapmsbin1-in-soap-ui-soap-ui-pro) has a similar problem to yours, you can check it out,and [an article](https://airbrake.io/blog/http-errors/400-bad-request) on fixing the 400 problem – Lan Huang Jan 07 '22 at 08:04
  • Please post relevant parts of the code as text rather than as an image. Image link eventually go stale and code as image is generally difficult for others to quickly reference. – vasilyrud Jan 17 '22 at 00:24

0 Answers0