tags:

views:

114

answers:

1

Hi, I have problem with call WCf service over SSL from console app. WCF service is on Windows Server 2003. It's simple math service. The WCF service and client are on the same computer. It's test, I call service on localhost.

web.confing

<?xml version="1.0"?>
<configuration>
    <system.serviceModel>
        <services>
            <service name="Service.CalculatorService" behaviorConfiguration="CalculatorServiceBehavior">
                <endpoint address="https://machineName/https/calculatorservice.svc" name="myEndpoint" binding="basicHttpBinding" 
                  bindingConfiguration="Binding1" contract="Service.ICalculator"/>
            </service>
        </services>
        <bindings>
            <basicHttpBinding>
                <binding name="Binding1">
                    <security mode="Transport">
                        <transport clientCredentialType="None"/>
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <behaviors>
   <serviceBehaviors>
    <behavior name="CalculatorServiceBehavior">
      <serviceMetadata httpsGetEnabled="true"
        httpsGetUrl="https://machineName/https/calculatorservice.svc" />
     <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
   </serviceBehaviors>
  </behaviors>
    </system.serviceModel>
    <system.web>
        <compilation debug="true"/></system.web></configuration>

If I call service from Visual Studio examaple : http://localhost:2039/CalculatorService.svc I get error : The protocol 'https' is not supported. I think it s ok.

But if I call service from browser I get error :

A registration already exists for URI 'https://machineName/https/CalculatorService.svc'.

What is bad? Can anybody help me, thank you.

+1  A: 

Remove the "address" attribute from the endpoint element- when you're hosting in IIS, it automatically supplies this.

nitzmahone