views:

25

answers:

1

I have a WCF Werbservice and i want to reach him via HTTP and HTTPS.

This is my actual try. But i can't reach the Service anymore not with http and not with https. :( Pls help

<system.serviceModel>
  <bindings>
   <basicHttpBinding>
    <binding name="DefaultBinding" closeTimeout="10:01:00" openTimeout="10:01:00" receiveTimeout="10:10:00" sendTimeout="10:01:00"
        transferMode="Streamed"
        maxBufferSize="104857600" maxBufferPoolSize="524288000" maxReceivedMessageSize="104857600">
     <readerQuotas
        maxDepth="2147483647" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647"
        maxNameTableCharCount="2147483647" />
     <security mode="None">
     </security>
    </binding>
    <binding name="SSLBinding">
     <security mode="TransportWithMessageCredential">
      <transport clientCredentialType="None"/>
     </security>
    </binding>
   </basicHttpBinding>
  </bindings>
  <services>
   <service behaviorConfiguration="DnsService.DNSSerivceBehavior" name="DnsService.DNSSerivce">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="DefaultBinding"  contract="DnsService.IDNSService">
     <identity>
      <dns value="localhost"/>
     </identity>
    </endpoint>
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="SSLBinding"  contract="DnsService.IDNSService">
     <identity>
      <dns value="localhost"/>
     </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
   </service>
  </services>
  <behaviors>
   <serviceBehaviors>
    <behavior name="DnsService.DNSSerivceBehavior">
     <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
     <serviceMetadata httpGetEnabled="true"/>
     <serviceMetadata httpsGetEnabled="true"/>
     <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
     <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
   </serviceBehaviors>
  </behaviors>
 </system.serviceModel>
+1  A: 

First you have two endpoints with blank address and two endpoints with mex address but these endpoints don't have same binding. You have to define different addresses for those endpoints. For your security binding specify only Transport mode unless you want to authenticate user. For service metadata replace two occurences of serviceMetadata with single element containing both attributes.

Why do you use 10 hours timeouts?

Ladislav Mrnka
okay thanks so far. But how do you mean that the mex and other endpoints dont have the same binding? Should it be like that? <endpoint bindingConfiguration="SSLBinding" address="mex" binding="mexHttpdBinding" contract="IMetadataExchange"/> <endpoint bindingConfiguration="SSLBinding" address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
Markus
No, you need to make unique address for each endpoint. Do not change binding types.
Ladislav Mrnka