WCF Service returns 400 Bad Request

后端 未结 3 911
感动是毒
感动是毒 2021-01-19 20:25

I\'ve got this application that works locally and when deployed and using a .mdf SQL Express database file (which I usually use for testing purposes). However, when I change

3条回答
  •  后悔当初
    2021-01-19 21:23

    You're probably not setting HTTP headers exactly as the service is expecting them, or in the order it's expecting them.

    Here's how I'd debug it:

    1. Create a quick test client using SvcUtil.exe.
    2. Install Fiddler, turn it on.
    3. Use the thin client to make a call to the service operation.
    4. Use your web application to make a call to the same service operation
    5. Look at the full HTTP request in Fiddler for each request. Compare them. Figure out where your AJAX call is different, and resolve the differences so it matches what the generated client uses.

提交回复
热议问题