Friday, June 04, 2004

The SOAP Insanity: "expecting text/xml, received text/html"

Welcome to my new blog! Here's where I'll write about my experiences with Programming.

First, the most often asked question about Delphi SOAP: What's the "expecting text/xml, received text/html" error?

The Delphi Web Service wizard, when generating the code for an ISAPI application, generates this code in the .dpr file:

uses
ActiveX,
ComObj,
WebBroker,
ISAPIThreadPool,
ISAPIApp,
Unit1 in 'Unit1.pas' {WebModule1: TWebModule};

You need to Interchange the positions of ISAPIThreadPool and ISAPIApp in the .dpr file. The reason is that the initialization section of the ISAPIThreadPool unit needs to run after the ISAPIApp unit's initialization section, so the thread pool is initialized properly.

You don't need to do anything for CGI, Apache DSO or Web App Debugger executables. This fix is specific to Delphi 7 generated ISAPI SOAP applications.

Note: The Delphi 6 Thread Pool unit does nothing. Throw it away.

1 Comments:

Anonymous Anonymous said...

A client of mine recently had the same error with a different cause. He was pointing to the wrong URL. The specified URL returned legitimate text/html. I post this just in case a few of those who make it here have this problem.

8:18 AM  

Post a Comment

<< Home