Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Invalid Content-Type 'text/html'

205 views
Skip to first unread message

Nate Woolls

unread,
Oct 8, 2002, 1:37:50 AM10/8/02
to
I can see this has been discussed several times, but I cannot find a
solution for it and am now faced with the same problem.

My project is a VERY simple ISAPI dll with a web service. If the virtual
folder I am using to host the ISAPI dll is protected by Low Application
Protection, everything works fine. However, if I set the application
protection of the virtual folder to Medium or High, I very frequently get
the following error when making calls to my web service:

Received content of invalid Content-Type setting: text/html - SOAP expects
"text/xml"

By doing some debugging, I have found that what is usually being returned is
the line '<html>-2147417842 (0x8001010e)</body></html>'. This line is
returned very frequently (although not every time) when I call my web
service, and with the sample EchoServ web service. The error code
reported, -2147417842, means "The application called an interface that was
marshalled for a different thread." By searching Google for this number, I
have found many posts of people having trouble with this code being returned
from IIS 5, including PHP developers. I also found links to reports from
Borland saying that this bug was fixed in Delphi 6.02, and that the problem
was in CoInitFlags not getting set to COINIT_MULTITHREADED before
Application.Initialize. However, I am using Delphi 7, and can verify that
CoInitFlags is getting set properly.

Here are some links I've found in researching:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=content+of+inv
alid+Content-Type+group%3Aborland.public.delphi.webservices.soap
http://www.google.com/search?q=2147417842&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=
0&sa=N
http://community.borland.com/article/0,1410,27949,00.html#When%20running%20y
our%20WebSnap%20app%20you%20sometimes%20get:
http://www.borland.co.jp/delphi/D602FIXES.html
http://www.remobjects.com/index.asp

Speaking of RemObjects, I downloaded their trial package and modified my
test web service client to use RemObjects. This problem does not occur with
RemObjects. However, everything so far points to this being invalid
handling of data returned from the server, so mayhaps RemObjects simply
doesn't choak on the error message, but is encountering it anyways (no
source to RemObjects so I can't check).

Any feedback is very much appreciated. I was shocked that I couldn't find a
QC record for this, so I may create one myself if I find there is not a
solution that I have simply overlooked.


Grahame Grieve

unread,
Oct 8, 2002, 3:02:01 AM10/8/02
to
hi

><html>-2147417842 (0x8001010e)</body></html>

It seems to me that the following is true

* the HTML error message is appended to the response
by IIS to report an error that occurs after the extension
processing is complete

* the error is related to some COM threading issue which
is caused by MSXML somehow

* because it is appended to the response (and sent across
the network) the HTTP Client library will pick the error
up as the next response if both client and server are doing
keep-alive (very shoddy work by Microsoft)

* if both client and server are doing keep-alive, the buffer
will keep filling up with duplicate responses, and the client
will be matching the response to the wrong request, until
the connection is dropped (there is no unique identifier
to allow an HTTP library to match request and response
packets, the server just has to get it right)

* if you can change the COM marshalling rules, then the
problem doesn't happen (i.e. running in process)

* if you can suppress keep-alive then you can suppress the
problem

* if the client is not HTTP/1.1 compliant, and not doing
keep-alives, you won't see the problem. This is probably
the situation with the REMObjects library

* <plug> you can solve it by using IndySoap on the server
side, cause we don't use COM

* otherwise, Microsoft will need to solve it - they created
the COM mess in the first place

Grahame
IndySoap
http://www.nevrona.com/indy/soap


DaleWolver

unread,
Oct 9, 2002, 9:25:44 AM10/9/02
to
I too have had this annoying behaviour. I made a simpleecho service and
client to hit it with and set the rio URL property to point to the dll with
http://localhost/passoap/simpleecho.dll. This gave me the "text/xml" error
all the time. I also used the WSDLLocation property and have had success
with it.
wsdlLocation = http://localhost/passoap/simpleecho.dll/wsdl/isimpleEcho I am
able to get this to work.

My system is Delphi7 pro, Win2k service pack 3, IIS 5 ??
I have my default web site properties set to Low IIS Protection and the
Virtual folder set to High Protection.
IIS Authentication Method for Anonymous user has been edited to use current
user
IIS is set to Cache ISAPI applications.
I also found that the IIS was misbehaving after installing service pack 3. I
could not reliably start and stop the web server. Uninstalling and
reinstalling the IIS cleared this problem up.


"Nate Woolls" <nwo...@maine.rr.com> wrote in message
news:3da26f38$1...@newsgroups.borland.com...


Nate Woolls

unread,
Oct 9, 2002, 12:44:28 PM10/9/02
to
I have added this report to QC under report #2537. Go vote if you are
effected by this problem!

"Nate Woolls" <nwo...@maine.rr.com> wrote in message
news:3da26f38$1...@newsgroups.borland.com...

Cd

unread,
Oct 11, 2002, 2:55:10 PM10/11/02
to
We have the same problem here.
When we run the dll under W2k, II5 and protection of the virtual folder to
Medium or High, we get the -2147417842 (0x8001010e) message....
Nate, are you sure you added the report under #2537 ? It seems another
problem....

So, we are trying to run under Apache 2.x too...

"Nate Woolls" <nwo...@maine.rr.com> escreveu na mensagem
news:3da45ceb$1...@newsgroups.borland.com...

Nate Woolls

unread,
Oct 11, 2002, 7:07:32 PM10/11/02
to
Sorry, that should have been #2614

"Nate Woolls" <nwo...@maine.rr.com> wrote in message

news:3da45ceb$1...@newsgroups.borland.com...

Cd

unread,
Oct 14, 2002, 11:32:07 AM10/14/02
to
We tried under Apache 1.3 and it is OK.
It can be an alternative while we don´t have a real solution.
Anyway, in the future we´ll have to run under IIS, because most of my
customers run under IIS.


"Nate Woolls" <nwo...@maine.rr.com> escreveu na mensagem

news:3da759b7$1...@newsgroups.borland.com...

0 new messages