Question

Background:

I have a WCF service deployed on my local machine that in turns connects to the SQL Server 2005 database.

To consume the service, I have a client application that dynamically creates the service client to consume the methods exposed in wcf service.

Configuration:

OS: Windows XP
IIS : 5.1

Problem

When I run client FIRST TIME on the local machine ( where service is deployed) it fails to connect with the service.

While debugging I notice when I call any method (exposed in the service) the following error occurred (I have pasted the exception at the bottom).

Now When I go into explorer and type the address to open in the browser like:

https:\\localhost\\TestService\\TestService.svc.

it opens successfully in browser..

Now I again go the client app and try consuming the web service, it connects successfully..

Strange enough, when I re-start IIS, the problem again occurs... To run the client app for the first time, I have to browse it in Internet Explorer.

Note: I have implemented SSL through a certificate..

Exception occured:

The content type text/html of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 163 bytes of the response were: 'ErrorEither a required impersonation level was not provided, or the provided impersonation level is invalid.

The same thing works fine in Windows 2003 server and IIS 6.0

Was it helpful?

Solution

Seem to have good explanation of your problem here.

You should try his workaround by enabling anonymous access on IIS.

Hope this helps...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top