Подтвердить что ты не робот

WCF + SSL не найдено конечной точки

Теперь я выясняю, что это проблема.

У меня есть служба wcf, которую я размещаю на II7, все работает нормально, когда я использую обычный протокол http.

Я добавил возможности SSL, и с тех пор я не могу получить к нему доступ из кода. Я могу создать клиента, но не могу выполнить какие-либо его методы.

вот что я

 <system.serviceModel>
    <bindings>
        <wsHttpBinding>
            <binding name="WSHttp0">
                <security mode="Transport">
                    <transport realm ="" clientCredentialType="None" />
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
    <client>
        <endpoint address="https://serverName.domname.local/WCFTest/MyWebServicec.svc"
            binding="wsHttpBinding" bindingConfiguration="WSHttp0" contract="SSLWebService.IMyWebService"
            name="WSEP">
            <identity>
                <dns value="serverName.domname.local" />
            </identity>
        </endpoint>
    </client>
</system.serviceModel>

Я добавил ссылку на мой проект

и я использую его таким образом

Dim client As MyWebServiceClient = New MyWebServiceClient()
Try
    client.GetDocumentByDocID(5)
Catch ex As Exception
    MessageBox.Show(ex.Message)
End Try

и вот что я получаю

Оконечная точка не слушала https://serverName.domname.local/WCFTest/MyWebService.svc, которая могла принять сообщение. Это часто вызвано неправильным адресом или действием SOAP. См. InnerException, если присутствует, для более подробной информации.

Может ли кто-нибудь помочь мне в этом? Я действительно не понимаю, что происходит...

note: я могу получить доступ к веб-сервису правильно с помощью Internet Explorer (так что я думаю, что мой сертификат в порядке)

4b9b3361

Ответ 1

Вы были правы в этом,

Неправильно на стороне сервера.

вот как я сделал работу

<system.serviceModel>
    <bindings>
        <wsHttpBinding>
            <binding name="wsHttpEndpointBinding">
                <security mode="Transport">
                    <transport clientCredentialType ="None"/>
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
    <services>
        <service behaviorConfiguration="App_WcfWebService.AppWebServiceBehavior" name="App_WcfWebService.AppWebService">
            <endpoint address="" binding="wsHttpBinding" bindingConfiguration ="wsHttpEndpointBinding" contract="App_WcfWebService.IAppWebService">

            </endpoint>
            <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="App_WcfWebService.AppWebServiceBehavior">
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                <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"/>
                <serviceThrottling maxConcurrentSessions="90" />                    
            </behavior>
        </serviceBehaviors>
    </behaviors>
</system.serviceModel>

Ответ 2

Я думаю, что сервер web.config может быть неисправным здесь. У меня WCF через SSL работает со следующим app.config на стороне клиента.

<configuration>
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IService" >
          <security mode="Transport">
            <transport realm ="" clientCredentialType="Windows" />
          </security>
        </binding>

      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="https://mycomputer/Service/Service.svc"
          binding="wsHttpBinding"
          bindingConfiguration="WSHttpBinding_IService"
          contract="ServiceProxy.IService" name="WSHttpBinding_IService">
        <identity>
          <dns value="mycomputer" />
        </identity>
      </endpoint>
    </client>
  </system.serviceModel>
</configuration>

Единственное видимое отличие - это ClientCredentialType, который я установил для Windows, поскольку я хочу использовать встроенную проверку подлинности Windows. Сервер web.config включает следующие строки для настройки службы, которую клиент может использовать.

  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WindowsBinding">
          <security mode="Transport">
            <transport proxyCredentialType="Windows" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="Service.Service1Behavior"
               name="Service.Service">
        <endpoint address="" binding="wsHttpBinding"
                  bindingConfiguration="WindowsBinding"
                  contract="ServiceInterface.IService">
          <identity>
            <dns value="mycomputer" />
          </identity>
        </endpoint>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Service.Service1Behavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

Не могли бы вы сравнить это с вашим web.config на стороне сервера и посмотреть, что отличается? Или добавьте свой вопрос в web.config.