views:

22

answers:

1

I have a WCF app that normally runs in IIS (for my Testing and Production Environments). But when I run it from my debugger it is setup to run self hosted (ie a console window pops up and IIS is NOT used).

I also have a client application that I connect to the WCF app. Normally when I am testing my Client app (that runs on Windows Mobile) it is setup to connect to one of my testing environments (I have a "Dev" environment for me to test in).

The problem I am having now is that there seems to be a disconnect between what the client is sending and what the WCF app is getting. I need to debug my WCF app.

I can run my WCF app and then change the URL of my Client to point the the debugger version, but my Services run with SSL and have a certificate that the client is hardcoded to expect.

I would rather not disable that part of my code (on the client). Is there a way to install the certificate on my self hosted WCF app?

A: 

Yes, you have to have a base or endpoint address of HTTPS and you also have to specify the service certificate via a behavior

<behaviors>
<behavior configurationName="BasicSecurityProfileMutualCertificateBehavior"
    returnUnknownExceptionsAsFaults="true">
    <serviceCredentials>
    <serviceCertificate findValue="Bob"
    storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
    </serviceCredentials>
</behavior>
</behaviors>
Mogounus