By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,635 Members | 2,085 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,635 IT Pros & Developers. It's quick & easy.

Client found response content type of 'text/html; charset=Windows-

P: n/a
Hi
Our company has a .Net web service that, when called via asp.net web pages
across our network works 100%! The problem is that when we try and call the
web service from a remote machine, one outside of our domain, we get the
error.. ** Client found response content type of 'text/html;
charset=Windows-1252', but expected 'text/xml' **. We can discover the web
service by typing in the url of the asmx so we know the server can 'see' it
ok. We have trawlled all over the net looking for a solution and we cannot
find out what is causing this. PLEASE HELP!!
Mar 7 '07 #1
Share this Question
Share on Google+
13 Replies


P: n/a
"Kestfield" <Ke*******@discussions.microsoft.comwrote in message
news:14**********************************@microsof t.com...
Hi
Our company has a .Net web service that, when called via asp.net web pages
across our network works 100%! The problem is that when we try and call
the
web service from a remote machine, one outside of our domain, we get the
error.. ** Client found response content type of 'text/html;
charset=Windows-1252', but expected 'text/xml' **. We can discover the
web
service by typing in the url of the asmx so we know the server can 'see'
it
ok. We have trawlled all over the net looking for a solution and we
cannot
find out what is causing this. PLEASE HELP!!
When you receive HTML from a web service, it is usually an error page. You
need to look at the HTML to see what error it's trying to tell you about!

Alternatively, check the Application event log - it may tell you something.

John
Mar 7 '07 #2

P: n/a
Hi John - thanks for your time and comments. The Full HTML I get back is as
follows. I have no idea how to determine what is the cause of the error.
Any help in determining this would be much appreciated.
....

Client found response content type of 'text/html; charset=Windows-1252', but
expected 'text/xml'. The request failed with the error message: -- <html>
<head<title>Runtime Error</title<stylebody
{font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p
{font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b
{font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 {
font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 {
font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre
{font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold;
color: black;text-decoration: none;} .version {color: gray;} .error
{margin-bottom: 10px;} .expandable { text-decoration:underline;
font-weight:bold; color:navy; cursor:hand; } </style</head<body
bgcolor="white"<span><H1>Server Error in '/MosaicQe' Application.<hr
width=100% size=1 color=silver></H1<h2<i>Runtime Error</i</h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "<b>
Description: </b>An application error occurred on the server. The current
custom error settings for this application prevent the details of the
application error from being viewed remotely (for security reasons). It
could, however, be viewed by browsers running on the local server machine.
<br><br<b>Details:</bTo enable the details of this specific error message
to be viewable on remote machines, please create a <customErrorstag within
a "web.config" configuration file located in the root directory of the
current web application. This <customErrorstag should then have its "mode"
attribute set to "Off".<br><br<table width=100% bgcolor="#ffffcc"<tr>
<td<code><pre<!-- Web.Config Configuration File --<configuration>
<system.web<customErrors mode="Off"/</system.web>
</configuration></pre></code</td</tr</table<br<b>Notes:</bThe
current error page you are seeing can be replaced by a custom error page by
modifying the "defaultRedirect" attribute of the application's <customErrors>
configuration tag to point to a custom error page URL.<br><br<table
width=100% bgcolor="#ffffcc"<tr<td<code><pre<!-- Web.Config
Configuration File --<configuration<system.web<customErrors
mode="RemoteOnly" defaultRedirect="mycustompage.htm"/</system.web>
</configuration></pre></code</td</tr</table<br</body</html--.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Client found response
content type of 'text/html; charset=Windows-1252', but expected 'text/xml'.
The request failed with the error message: -- <html<head<title>Runtime
Error</title<stylebody
{font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p
{font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b
{font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 {
font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 {
font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre
{font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold;
color: black;text-decoration: none;} .version {color: gray;} .error
{margin-bottom: 10px;} .expandable { text-decoration:underline;
font-weight:bold; color:navy; cursor:hand; } </style</head<body
bgcolor="white"<span><H1>Server Error in '/MosaicQe' Application.<hr
width=100% size=1 color=silver></H1<h2<i>Runtime Error</i</h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "<b>
Description: </b>An application error occurred on the server. The current
custom error settings for this application prevent the details of the
application error from being viewed remotely (for security reasons). It
could, however, be viewed by browsers running on the local server machine.
<br><br<b>Details:</bTo enable the details of this specific error message
to be viewable on remote machines, please create a <customErrorstag within
a "web.config" configuration file located in the root directory of the
current web application. This <customErrorstag should then have its "mode"
attribute set to "Off".<br><br<table width=100% bgcolor="#ffffcc"<tr>
<td<code><pre<!-- Web.Config Configuration File --<configuration>
<system.web<customErrors mode="Off"/</system.web>
</configuration></pre></code</td</tr</table<br<b>Notes:</bThe
current error page you are seeing can be replaced by a custom error page by
modifying the "defaultRedirect" attribute of the application's <customErrors>
configuration tag to point to a custom error page URL.<br><br<table
width=100% bgcolor="#ffffcc"<tr<td<code><pre<!-- Web.Config
Configuration File --<configuration<system.web<customErrors
mode="RemoteOnly" defaultRedirect="mycustompage.htm"/</system.web>
</configuration></pre></code</td</tr</table<br</body</html--.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:
[InvalidOperationException: Client found response content type of
'text/html; charset=Windows-1252', but expected 'text/xml'.
The request failed with the error message:
--
<html>
<head>
<title>Runtime Error</title>
<style>
body {font-family:"Verdana";font-weight:normal;font-size:
..7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top:
-5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top:
-5px}
H1 {
font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 {
font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold;
color:navy; cursor:hand; }
</style>
</head>

<body bgcolor="white">

<span><H1>Server Error in '/MosaicQe' Application.<hr width=100%
size=1 color=silver></H1>

<h2<i>Runtime Error</i</h2></span>

<font face="Arial, Helvetica, Geneva, SunSans-Regular,
sans-serif ">

<bDescription: </b>An application error occurred on the
server. The current custom error settings for this application prevent the
details of the application error from being viewed remotely (for security
reasons). It could, however, be viewed by browsers running on the local
server machine.
<br><br>

<b>Details:</bTo enable the details of this specific error
message to be viewable on remote machines, please create a <customErrorstag
within a "web.config" configuration file located in the root directory of the
current web application. This <customErrorstag should then have its "mode"
attribute set to "Off".<br><br>

<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration></pre></code>

</td>
</tr>
</table>

<br>

<b>Notes:</bThe current error page you are seeing can be
replaced by a custom error page by modifying the "defaultRedirect" attribute
of the application's <customErrorsconfiguration tag to point to a custom
error page URL.<br><br>

<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration></pre></code>

</td>
</tr>
</table>

<br>

</body>
</html>

--.]

System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall) +1495
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters) +218

MosaicPages.MosaicQuoteManager.MosaicQuoteManager. ValidateCustomer(MosaicCustomer
typCustomer) in C:\Inetpub\wwwroot\Mosaic\Web
References\MosaicQuoteManager\Reference.vb:173
MosaicPages.QECustomer.Submit1_ServerClick(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\Mosaic\QECustomer.aspx.vb:136
System.Web.UI.HtmlControls.HtmlInputButton.OnServe rClick(EventArgs e) +108

System.Web.UI.HtmlControls.HtmlInputButton.System. Web.UI.IPostBackEventHandler.RaisePostBackEvent(St ring eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292


"John Saunders" wrote:
"Kestfield" <Ke*******@discussions.microsoft.comwrote in message
news:14**********************************@microsof t.com...
Hi
Our company has a .Net web service that, when called via asp.net web pages
across our network works 100%! The problem is that when we try and call
the
web service from a remote machine, one outside of our domain, we get the
error.. ** Client found response content type of 'text/html;
charset=Windows-1252', but expected 'text/xml' **. We can discover the
web
service by typing in the url of the asmx so we know the server can 'see'
it
ok. We have trawlled all over the net looking for a solution and we
cannot
find out what is causing this. PLEASE HELP!!

When you receive HTML from a web service, it is usually an error page. You
need to look at the HTML to see what error it's trying to tell you about!

Alternatively, check the Application event log - it may tell you something.

John
Mar 7 '07 #3

P: n/a
"Kestfield" <Ke*******@discussions.microsoft.comwrote in message
news:01**********************************@microsof t.com...
Hi John - thanks for your time and comments. The Full HTML I get back is
as
follows. I have no idea how to determine what is the cause of the error.
Any help in determining this would be much appreciated.
This is just telling you that an error occurred, but it can't tell you the
details because you said not to show the details.

Look in the event log to see if maybe the details are there. If not, then
you need to get back to basics, like writing your own "I got here" messages
to the event log to see if your web service is even being executed.

John
Mar 7 '07 #4

P: n/a
Hi John

There is nothing in the event logs.

I do need to go back to basics you're right. I stopped the web service
running and I still get exactly the same error so it's not even getting any
where near it to start with! I still think that it is strange that I can
browse the .asmx and see the list of available functions. I just (for some
unknown reason) can't call the web service from a asp.net app?? Any ideas on
possibly tracing the soap request?

"John Saunders" wrote:
"Kestfield" <Ke*******@discussions.microsoft.comwrote in message
news:01**********************************@microsof t.com...
Hi John - thanks for your time and comments. The Full HTML I get back is
as
follows. I have no idea how to determine what is the cause of the error.
Any help in determining this would be much appreciated.

This is just telling you that an error occurred, but it can't tell you the
details because you said not to show the details.

Look in the event log to see if maybe the details are there. If not, then
you need to get back to basics, like writing your own "I got here" messages
to the event log to see if your web service is even being executed.

John
Mar 7 '07 #5

P: n/a
"Kestfield" <Ke*******@discussions.microsoft.comwrote in message
news:7E**********************************@microsof t.com...
Hi John

There is nothing in the event logs.

I do need to go back to basics you're right. I stopped the web service
running and I still get exactly the same error so it's not even getting
any
where near it to start with! I still think that it is strange that I can
browse the .asmx and see the list of available functions. I just (for
some
unknown reason) can't call the web service from a asp.net app?? Any ideas
on
possibly tracing the soap request?
Simple is probably best, so take a look at http://www.pocketsoap.com/. In
addition to their namesake, they have some tracing tools.

John
Mar 7 '07 #6

P: n/a
Hi,
This error message one gets when there is time out.You can try increase
time-out value in following three places.
[1]Increase the Timeout property of the Web service proxy.
MyWebServ obj = new MyWebServ();
obj.Timeout = 15000; // in milliseconds
[2] Increase timeout value in http-runtime tag in web-config of ASP.NET
project.
[3] Increase timeout value in http-runtime tag in web-config of Web Services
project.

If my answer has helped you,then please do press Yes below.

Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Kestfield" wrote:
Hi
Our company has a .Net web service that, when called via asp.net web pages
across our network works 100%! The problem is that when we try and call the
web service from a remote machine, one outside of our domain, we get the
error.. ** Client found response content type of 'text/html;
charset=Windows-1252', but expected 'text/xml' **. We can discover the web
service by typing in the url of the asmx so we know the server can 'see' it
ok. We have trawlled all over the net looking for a solution and we cannot
find out what is causing this. PLEASE HELP!!
Mar 8 '07 #7

P: n/a
Hi,

To know exact error set mode="Off" in custom error tag in web-config of
ASP.NET project.
You will find following Link also useful :
http://www.topxml.com/ASPNET-Webserv...text/html.aspx

Also let me know that if suggesstion provided in above url has solved your
probelm

If my answer helped you,then please do press Yes below.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Kestfield" wrote:
Hi
Our company has a .Net web service that, when called via asp.net web pages
across our network works 100%! The problem is that when we try and call the
web service from a remote machine, one outside of our domain, we get the
error.. ** Client found response content type of 'text/html;
charset=Windows-1252', but expected 'text/xml' **. We can discover the web
service by typing in the url of the asmx so we know the server can 'see' it
ok. We have trawlled all over the net looking for a solution and we cannot
find out what is causing this. PLEASE HELP!!
Mar 8 '07 #8

P: n/a
Hi Manish

Thanks for your input.

I have tried to turn OFF custom errors and my web.config contains this XML..

<customErrors mode="Off"/>

And it still only shows me the horrible HTML page!

As regards to timeout - the error returns immediately, but I tried what you
recommended all the same and unfortunately to no avail. Any other
recommendations would be much appreciated!!!

"Manish Bafna" wrote:
Hi,

To know exact error set mode="Off" in custom error tag in web-config of
ASP.NET project.
You will find following Link also useful :
http://www.topxml.com/ASPNET-Webserv...text/html.aspx

Also let me know that if suggesstion provided in above url has solved your
probelm

If my answer helped you,then please do press Yes below.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Kestfield" wrote:
Hi
Our company has a .Net web service that, when called via asp.net web pages
across our network works 100%! The problem is that when we try and call the
web service from a remote machine, one outside of our domain, we get the
error.. ** Client found response content type of 'text/html;
charset=Windows-1252', but expected 'text/xml' **. We can discover the web
service by typing in the url of the asmx so we know the server can 'see' it
ok. We have trawlled all over the net looking for a solution and we cannot
find out what is causing this. PLEASE HELP!!
Mar 8 '07 #9

P: n/a
Hi,
As given in the link have you set value of Debug to false.Also if your web
service is calling stored procedure then have you tried increasing command
timeout value.
--
If my answer helped you,then please do press Yes below.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Kestfield" wrote:
Hi Manish

Thanks for your input.

I have tried to turn OFF custom errors and my web.config contains this XML..

<customErrors mode="Off"/>

And it still only shows me the horrible HTML page!

As regards to timeout - the error returns immediately, but I tried what you
recommended all the same and unfortunately to no avail. Any other
recommendations would be much appreciated!!!

"Manish Bafna" wrote:
Hi,

To know exact error set mode="Off" in custom error tag in web-config of
ASP.NET project.
You will find following Link also useful :
http://www.topxml.com/ASPNET-Webserv...text/html.aspx

Also let me know that if suggesstion provided in above url has solved your
probelm

If my answer helped you,then please do press Yes below.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Kestfield" wrote:
Hi
Our company has a .Net web service that, when called via asp.net web pages
across our network works 100%! The problem is that when we try and call the
web service from a remote machine, one outside of our domain, we get the
error.. ** Client found response content type of 'text/html;
charset=Windows-1252', but expected 'text/xml' **. We can discover the web
service by typing in the url of the asmx so we know the server can 'see' it
ok. We have trawlled all over the net looking for a solution and we cannot
find out what is causing this. PLEASE HELP!!
Mar 8 '07 #10

P: n/a
Read your HTML error details clearly.It is clearly written that you need to
set mode=Off in customerrors tag.Also web config is case sensitive.So if you
write mode=off in proper case in web config then you will get exact error
details
--
If my answer helped you,then please do press Yes below.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Kestfield" wrote:
Hi
Our company has a .Net web service that, when called via asp.net web pages
across our network works 100%! The problem is that when we try and call the
web service from a remote machine, one outside of our domain, we get the
error.. ** Client found response content type of 'text/html;
charset=Windows-1252', but expected 'text/xml' **. We can discover the web
service by typing in the url of the asmx so we know the server can 'see' it
ok. We have trawlled all over the net looking for a solution and we cannot
find out what is causing this. PLEASE HELP!!
Mar 8 '07 #11

P: n/a
Hi Manish

I have done exactly what the page suggests and this XML is directly from my
web.config file. Note the upper case 'O' in the word 'Off'..

<customErrors mode="Off"/>

But I still get this HTML page telling me that the error is hidden (for
security reasons) and if I set the mode="Off" then I can see the error.

Maybe if I can crack this I can finally get to the bottom of what the REAL
error is that is causing the web app not to see the web service, even though
I can discover it by pointing the browser directly at the asmx file.

PAGE I GET WHEN I TRY AND CALL A METHOD WITHIN THE WEB SERVICE:
Runtime Error
Description: An application error occurred on the server. The current custom
error settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could, however,
be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable
on remote machines, please create a <customErrorstag within a "web.config"
configuration file located in the root directory of the current web
application. This <customErrorstag should then have its "mode" attribute
set to "Off".
"Manish Bafna" wrote:
Read your HTML error details clearly.It is clearly written that you need to
set mode=Off in customerrors tag.Also web config is case sensitive.So if you
write mode=off in proper case in web config then you will get exact error
details
--
If my answer helped you,then please do press Yes below.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Kestfield" wrote:
Hi
Our company has a .Net web service that, when called via asp.net web pages
across our network works 100%! The problem is that when we try and call the
web service from a remote machine, one outside of our domain, we get the
error.. ** Client found response content type of 'text/html;
charset=Windows-1252', but expected 'text/xml' **. We can discover the web
service by typing in the url of the asmx so we know the server can 'see' it
ok. We have trawlled all over the net looking for a solution and we cannot
find out what is causing this. PLEASE HELP!!
Mar 8 '07 #12

P: n/a
"Kestfield" <Ke*******@discussions.microsoft.comwrote in message
news:D3**********************************@microsof t.com...
Hi Manish

I have done exactly what the page suggests and this XML is directly from
my
web.config file. Note the upper case 'O' in the word 'Off'..

<customErrors mode="Off"/>
I'm sorry, but I forget which version of .NET you're running. If you're
running ASP.NET 2.0 or higher, then there should be an entry in the event
log.

John
Mar 8 '07 #13

P: n/a
PROBLEM SOLVED!!

In the end it was simple setting the web.config!! To get through our isa
proxy I added the following XML into the web.config file. BUT I omitted the
attribute bypassonlocal="true"!! With this attribute in place everything
worked perfectly. Thank you for everybody's help.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.net>
<defaultProxy>
<proxy usesystemdefault="false" proxyaddress="http://x.x.x.x:port"
bypassonlocal="true" />
</defaultProxy>
</system.net>

<system.web>

....REST OF WEB>CONFIG HERE...
"Kestfield" wrote:
Hi Manish

I have done exactly what the page suggests and this XML is directly from my
web.config file. Note the upper case 'O' in the word 'Off'..

<customErrors mode="Off"/>

But I still get this HTML page telling me that the error is hidden (for
security reasons) and if I set the mode="Off" then I can see the error.

Maybe if I can crack this I can finally get to the bottom of what the REAL
error is that is causing the web app not to see the web service, even though
I can discover it by pointing the browser directly at the asmx file.

PAGE I GET WHEN I TRY AND CALL A METHOD WITHIN THE WEB SERVICE:
Runtime Error
Description: An application error occurred on the server. The current custom
error settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could, however,
be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable
on remote machines, please create a <customErrorstag within a "web.config"
configuration file located in the root directory of the current web
application. This <customErrorstag should then have its "mode" attribute
set to "Off".
"Manish Bafna" wrote:
Read your HTML error details clearly.It is clearly written that you need to
set mode=Off in customerrors tag.Also web config is case sensitive.So if you
write mode=off in proper case in web config then you will get exact error
details
--
If my answer helped you,then please do press Yes below.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Kestfield" wrote:
Hi
Our company has a .Net web service that, when called via asp.net web pages
across our network works 100%! The problem is that when we try and call the
web service from a remote machine, one outside of our domain, we get the
error.. ** Client found response content type of 'text/html;
charset=Windows-1252', but expected 'text/xml' **. We can discover the web
service by typing in the url of the asmx so we know the server can 'see' it
ok. We have trawlled all over the net looking for a solution and we cannot
find out what is causing this. PLEASE HELP!!
Mar 8 '07 #14

This discussion thread is closed

Replies have been disabled for this discussion.