WCF: Das bereitgestellte URI-Schema "https" ist ungültig; erwartet, dass 'http'. Parameter name: via, wenn ich rufe IInternal proxy = factory.CreateChannel(); Client auf

Server-App.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.web>
    <compilation debug="true"/>
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="NewBehaviour">
          <serviceMetadata httpsGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="True"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <wsHttpBinding>
        <binding name="Binding">
          <security mode="Transport">
            <transport clientCredentialType="None"></transport>
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>

    <services>
      <service name="Server.InternalClass" behaviorConfiguration="NewBehaviour">
        <endpoint address="IInternal" binding="wsHttpBinding" bindingConfiguration="Binding" contract="Common.IInternal">
          <identity>
            <dns value="MyMachine"/>
          </identity>
        </endpoint>
       <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/> 
        <host>
          <baseAddresses>
            <add baseAddress="https://MyMachine:8733/"/>
          </baseAddresses>
        </host>
      </service>
    </services>
  </system.serviceModel>


</configuration>

Client

static ChannelFactory<IInternal> factory = new ChannelFactory<IInternal>(new WSHttpBinding(), new EndpointAddress("https://MyMachine:8733/IInternal"));

Wenn ich die Methode aufrufen, die Fabrik.CreateChannel(), bekomme ich Fehler

Konfigurieren Sie die Zertifikat

WCF: Das bereitgestellte URI-Schema

  • Unterstützt der Dienst korrekt startet? Welche Konfiguration hast du für den client in der app.in der config von dem client?
  • Dienst korrekt startet. Ich habe keine config-Datei für den client.
InformationsquelleAutor user3661837 | 2016-01-31
Schreibe einen Kommentar