If you ever run into a scenario where you need to run a PHP SOAP webservice in an IIS environement, you might encounter the following problem. When generating a client proxy in .NET/WCF this exception is thrown;

The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF

The problem, as it turns out, is that ASP.NET appends the HTTP X-Powered-By header. This header seems to confuse the proxy generation code. To fix the issue you need to remove this IIS header. Head to your IIS Manager > You website > The folder your PHP webservice is located > Click HTTP Response header. Then remove the X-Powered-By header. Now enjoy generating proxies!

Some evil internet voices claim that you should set useUnsafeHeaderParsing to false in your clients’ application configuration to make .NET ignore the inconsistency in your webservice WSDL output. This however is a workaround, not a solution. So if you run the webservice apply the header fix as described above.

Remove IIS headers

Link object popup failing in XAF after deployment

Last week I deployed an XAF Web application to one of our production servers running IIS 7. All seemed well until I noticed that all Object Link windows (the popup that allows you to make associations between existing objects) missed the grid control and the image. The button where there but without the grid the popup isn’t very useful is it…

Turned out that the web.config (which was generated at project creation trough a New Project -> XAF template) contained this line;

The problem being here this handler will not used unless “runtimeVersionv2.0″, which in my production IIS 7 server was not the case. Removing the runtimeVersionv2.0 precondition fixed things…