Search code examples
xmlwcfrestposthttp-status-code-400

WCF REST 4 template POST request works on localhost, but error code 400 on server


I have a WCF REST service that I customized from the VS2010 online template. I specifically customized the POST method to a minimal amount of XML. Everything works exactly like I want when running on localhost. When I deploy it to the server, however, Fiddler gives me the 400. Running the GET request through Fiddler works fine; the only thing that doesn't work is POST.

Here is the xml of the request, which I ripped right out of the WCF service help page:

<UserData xmlns="http://schemas.datacontract.org/2004/07/SRAccountService.SRObjects">
  <key>12345</key>
  <favorite>chocolate</favorite>
</UserData>

I am setting the Content-Type:text/xml on the HTTP header. I also know that there are about 1000 stackoverflow questions regarding WCF, POST and 400 status codes, but I think I read through most of them and none (that I've see) do what I need.

Does anybody have any thoughts? I would be most grateful!

EDIT: I am working under a deadline, so I reconfigured the service to take the parameters as part of the URL and return the data through a GET request. The same thing is happening--working fine on localhost, 400 on the server. This is crazy!


Solution

  • The problem was that I am using ado.net entity model to connect to a backend database...the connection string was using integrated security (as opposed to SQL Server logins), so when I started running it on the server, the integrated part broke.