Showing posts with label Bad request. Show all posts
Showing posts with label Bad request. Show all posts

Monday, January 19, 2009

Bad request = Validation error

Continuation from previous post.

Solving permission problem I still had "Bad Request", but now the inner exception (and the Event Log) got me a validation error.

My WCF DataContract had a Required=True on a property that did not exist on the incoming message from BizTalk.

HTTP Bad Request can certainly mean a lot of things. Be sure to look in every log.

I recommend to config BizTalk, and the WCF service, to trace WCF-traffic. Use the WCF Config tool and the WCF Trace tool. They are located under "C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin" and called "SvcConfigEditor.exe" and "SvcTraceViewer.exe"

Friday, January 16, 2009

Bad request = Access denied

Consuming services can get you "Bad request" error. The problem can be permissions on the service.

I made a WCF service to be consumed by Biztalk. The service is hosted by IIS and there was no problem running the BizTalk WCF Service Consuming Wizard to create schemas, port types and bindings.

The error came when trying to access the service by posting a request to it. Then I got "400 Bad request".

The problem was related to permissions. I forgot to switch application pool on my web application. After selecting the proper pool, running by correct user, I restarted IIS and everything worked fine.