1

Web サービスに問題があります。私たちは Web サービスを作成していないので、実際に何が起こっているのかはわかりません。最初はサーバーで機能しますが、時々機能しないため、サーバーを再起動する必要があります。次に、エラーメッセージが表示されます:

リモート エンドポイントとのセキュリティ ネゴシエーションが失敗したため、セキュリティで保護されたチャネルを開くことができません。これは、チャネルの作成に使用された EndpointAddress に EndpointIdentity が存在しないか、正しく指定されていないことが原因である可能性があります。EndpointAddress によって指定または暗示された EndpointIdentity がリモート エンドポイントを正しく識別していることを確認してください。

しかし、私たちの Web サービスは安全ではありません! 私たちのウェブ構成は次のとおりです。

<configuration>
  <connectionStrings>
    <add name="DefaultConnection" connectionString="Server=;Database=;User ID=;Password=;Trusted_Connection=False;" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime executionTimeout="3600000" maxRequestLength="102400" />
  </system.web>
  <appSettings>
    <add key="baseAddress" value="http://localhost:20088" />
    <add key="timeout" value="120"/>
    <add key="provider" value="System.Data.SqlClient" />
  </appSettings>
  <system.serviceModel>
    <services>
      <service name="H2WcfService.DataAccess" behaviorConfiguration="H2WcfServiceBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:20088"/>
          </baseAddresses>
        </host>
        <endpoint address="" binding="wsHttpBinding" contract="H2WcfService.IDataAccess" bindingConfiguration="DataAccess">
          <identity>
            <dns value="localhost:20088"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
      <service name="H2WcfService.LoginService" behaviorConfiguration="H2WcfServiceBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:20088"/>
          </baseAddresses>
        </host>
        <endpoint address="" binding="wsHttpBinding" contract="H2WcfService.ILoginService" bindingConfiguration="Authentic">
          <identity>
            <dns value="localhost:20088"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
      <service name="H2WcfService.LMSService" behaviorConfiguration="H2WcfServiceBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:20088"/>
          </baseAddresses>
        </host>
        <endpoint address="" binding="wsHttpBinding" contract="H2WcfService.ILMSService" bindingConfiguration="LMSService">
          <identity>
            <dns value="localhost:20088"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="H2WcfServiceBehavior" >
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
        <behavior name="">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <bindings>
      <wsHttpBinding>
        <binding name="DataAccess" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
          <security mode="None">
            <transport clientCredentialType="None" />
            <message establishSecurityContext="false" />
          </security>
        </binding>
        <binding name="Authentic">
          <security mode="None">
            <transport clientCredentialType="None" />
            <message establishSecurityContext="false" />
         </security>
      </binding>
      <binding name="LMSService">
        <security mode="None">
          <transport clientCredentialType="None" />
          <message establishSecurityContext="false" />
        </security>
      </binding>
    </wsHttpBinding>
  </bindings>
</system.serviceModel>
<system.webServer>
  <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
4

3 に答える 3

2

ついに答えが見つかりました!基本的に、私のasp.netアプリケーションweb.configのSystem.Servicemodelのバインディングの下に、次を追加する必要がありました。

<security mode="None"/>

Webサービス認証のコードをいじっていたので削除しました。複数のバックアップがあることを神に感謝します! みんなありがとう!2日後に回答があったので更新します。

于 2014-12-12T05:30:46.507 に答える
1

修正しました

古いコード

<security mode="TransportWithMessageCredential">
    <transport clientCredentialType="None" />
    <message establishSecurityContext="false" />
</security>
   

新しいコード

<security mode="TransportWithMessageCredential">
    <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
    <message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="false" />
</security>  
于 2016-06-23T07:03:25.867 に答える
0

セキュリティタグの下で、これを試してください

<security mode="None">  

<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />  

<message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="true" />  

</security>
于 2014-12-12T04:40:34.210 に答える