0

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!

jdb1a1
  • 1,045
  • 1
  • 13
  • 32

2 Answers2

0

Here is a thought

http://geekswithblogs.net/michelotti/archive/2011/05/28/resolve-404-in-iis-express-for-put-and-delete-verbs.aspx

suing
  • 2,808
  • 2
  • 16
  • 18
  • thanks for the idea, it is much appreciated. POST is in fact enabled on this server. I have other web services that run on this server (although I haven't checked them recently), they WERE accepting POST requests just fine. I've added an SSL certificate in the past 6 months, but that's the only change on the server. – jdb1a1 Apr 20 '12 at 18:42
  • Any other hardware in front of the server. Proxy, LoadBalancers ect? Could those be changing the request? Can you post the exact http request including headers? Is there anything in the IIS logs that looks out of the ordinary? Try thinking of the path your request makes from fiddler on your PC and the server and check each point. Can you make this request on the server directly to the Server? Have you verified this is deployed correct? Our IIS requests were getting duplicated due use of Forefront/UAG. We actually saw dup requests in the IIS logs. – suing Apr 21 '12 at 11:08
  • thanks for the help; I think I figured it out. It was an integrated security issue with the connection string. – jdb1a1 Apr 21 '12 at 18:32
0

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.

jdb1a1
  • 1,045
  • 1
  • 13
  • 32