WSE 2 SP3 error: Client found response content type of '', but expected 'text/xml'.




I've been using WSE 2 SP3 to build a website that has a web service back
end, and front end. Up till this point I haven't had any problem
deploying, but on one of my client's sites I'm getting this sort of error:

Client found response content type of '', but expected 'text/xml'.
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 '', but expected 'text/xml'.

The stack trace just points to the call of the web service, i.e.

This error is triggered on calling a web service - even a simple one that
just returns a string. I've put trace.Write() in to make sure the web
service code was performing correctly which it is. The error is happening
somewhere between the end of the web method code and the result getting
returned to the calling webpage. I can call the web service from the html
interface and it works correctly. I've tested calling the webservice from a app instead of project and it has the same error.

From the web searches I've done it seems that this is a generic error that
is really a front for some other error - i.e. an error message is getting
returned instead of the expected data in xml format. However, I can't debug
because I've only got limited vpn access and the client site is overseas.

The only way I can get everything working correctly is to remove all
references to WSE 2 SP3 - then it all works happily. I'm using impersonate
with integrated security but have tested the correct user credentials with
appropriate permissions is being used - and when WSE was removed the site
worked correctly with the impersonate stuff all being unchanged.

Does anyone have suggestions on what could fix this? Is it a bug with WSE?


I have WSE set up to use a policy document - just so it expects a standard

<?xml version="1.0" encoding="utf-8" ?>
<policyDocument xmlns="">
<mappings xmlns:wse="">
<request policy="" />
<response policy="" />
<fault policy="" />
<wsp:policy wsu:Id="signed-body-username">
<wssp:Integrity wsp:Usage="wsp:Required">
<wssp:MessageParts xmlns:rp=""
wse:Timestamp() wse:Addressing()</wssp:MessageParts>


Here is my code for calling the web service ...

Public Shared Function GetDataWebservice() As WSProxy.DataWebServiceWse
Dim Result As New WSProxy.DataWebServiceWse

Dim httpContext As HttpContext = httpContext.Current
Dim config As Sage.Web.Config =
CType(httpContext.Items.Item("Config"), Sage.Web.Config)

'specifically state what the web service url will be on
'this is because it's "hardcoded" to be on "localhost" when in
'and it provides flexibility to run in various deployment situations
(such as developing from home)
'if this is done...
Dim sRootPath As String =
Result.Url = "http://" + httpContext.Request.Url.Host + sRootPath +

'extend the webservice timeout so it can cope with longer things
like when community dir item added (which re-indexes full text catalogue on
insert new item)
Result.Timeout = 5 * (60 * 1000) '5 minutes

'get soap context
Dim soapContext As SoapContext = Result.RequestSoapContext
'create token for user login details
Dim iUserID As Integer
'is a connection available to use?
Dim p As BasePage
p = CType(httpContext.Handler, BasePage)
If Not IsNothing(p.Conn) Then
iUserID = config.SessionManager.UserID
iUserID = 0
End If
Catch ex As Exception
iUserID = 0
End Try
Dim t As New UsernameToken(iUserID.ToString(), iUserID.ToString(),

Result.PreAuthenticate = True
Result.Credentials = System.Net.CredentialCache.DefaultCredentials

Return Result
End Function



Kenny M.

Wow, My app is located in a hosting company, It have been working very well
for a year and today it is not working any more showing me the same message:

"Client found response content type of... " but My app does not use even the
WSE, so I think this is something that the hosting company made, when I know
anything I'll tell you

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question