2009-05-14 8 views
4

私は、ユーザーがイベントに参加して通知を受け取れるサービスを作成しています。私はnetTcpBindingでこれをやろうとしていますが、ローカルマシン上で実行していてもエラーが発生し続けます。net tcpを使用したWCFデュプレックスサービス: "ストリームセキュリティが必要です..."

私は通知を送信しようと、私は、タイムアウトこのエラーを取得しています:テスト用

Stream Security is required at http://www.w3.org/2005/08/addressing/anonymous , but no security context was negotiated. This is likely caused by the remote endpoint missing a StreamSecurityBindingElement from its binding.

私はコンソールでサービスをホストしています、そしてそれは私のために開いていると私は見ることができますWSDLを実行し、その上でsvcutilを実行します。クライアントを実行して通知を送信しようとすると、上記のエラーが表示されます。

ホストのApp.config:ここ

<system.serviceModel> 
<services> 
    <service name="CompanyName.WebServices.InterventionService.RegistrationService" 
      behaviorConfiguration="RegistrationServiceBehavior"> 
    <endpoint address="http://localhost:8000/CompanyName/Registration" 
       binding="wsDualHttpBinding" 
       contract="CompanyName.WebServices.InterventionService.Interfaces.IRegistrationService"/> 
    <endpoint address="net.tcp://localhost:8001/CompanyName/Registration" 
       binding="netTcpBinding" 
       contract="CompanyName.WebServices.InterventionService.Interfaces.IRegistrationService"/> 
    </service> 
    <service name="CompanyName.WebServices.InterventionService.NotificationService" 
      behaviorConfiguration="NotificationServiceBehavior"> 
    <endpoint address="http://localhost:8010/CompanyName/Notification" 
       binding="wsDualHttpBinding" 
       contract="CompanyName.WebServices.InterventionService.Interfaces.INotificationService"/> 
    <endpoint address="net.tcp://localhost:8011/CompanyName/Notification" 
       binding="netTcpBinding" 
       contract="CompanyName.WebServices.InterventionService.Interfaces.INotificationService"/> 
    </service> 
</services> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="RegistrationServiceBehavior"> 
     <serviceMetadata httpGetEnabled="true" 
         httpGetUrl="http://localhost:8000/CompanyName/Registration"/> 
    </behavior> 
    <behavior name="NotificationServiceBehavior"> 
     <serviceMetadata httpGetEnabled="true" 
         httpGetUrl="http://localhost:8010/CompanyName/Notification"/> 
    </behavior> 
    <behavior name="netTcpRegistrationServiceBehavior"> 
     <serviceMetadata httpGetEnabled="true" 
         httpGetUrl="net.tcp://localhost:8001/CompanyName/Registration"/> 
    </behavior> 
    <behavior name="netTcpNotificationServiceBehavior"> 
     <serviceMetadata httpGetEnabled="true" 
         httpGetUrl="net.tcp://localhost:8011/CompanyName/Notification"/> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 

クライアントはApp.configファイルです:

<system.serviceModel> 
<bindings> 
    <netTcpBinding> 
    <binding name="NetTcpBinding_IRegistrationService"> 
     <security mode="None"> 
     <message clientCredentialType="None"/> 
     <transport clientCredentialType="None"/> 
     </security> 
    </binding> 
    <binding name="NetTcpBinding_INotificationService"> 
     <security mode="None"> 
     <message clientCredentialType="None"/> 
     <transport clientCredentialType="None"/> 
     </security> 
    </binding> 
    </netTcpBinding> 
    <wsDualHttpBinding> 
    <binding name="WSDualHttpBinding_IRegistrationService"> 
     <reliableSession ordered="true"/> 
     <security mode="None"> 
     <message clientCredentialType="None" negotiateServiceCredential="false"/> 
     </security> 
    </binding> 
    <binding name="WSDualHttpBinding_INotificationService"> 
     <reliableSession ordered="true"/> 
     <security mode="None"> 
     <message clientCredentialType="None" negotiateServiceCredential="false"/> 
     </security> 
    </binding> 
    </wsDualHttpBinding> 
</bindings> 
<client> 
    <endpoint address="http://localhost:8000/GPS/Registration" 
      binding="wsDualHttpBinding" 
      bindingConfiguration="WSDualHttpBinding_IRegistrationService" 
      contract="IRegistrationService" 
      name="WSDualHttpBinding_IRegistrationService"> 
    </endpoint> 
    <endpoint address="net.tcp://localhost:8001/GPS/Registration" 
      binding="netTcpBinding" 
      bindingConfiguration="NetTcpBinding_IRegistrationService" 
      contract="IRegistrationService" 
      name="NetTcpBinding_IRegistrationService"> 
    </endpoint> 
    <endpoint address="http://localhost:8010/GPS/Notification" 
      binding="wsDualHttpBinding" 
      bindingConfiguration="WSDualHttpBinding_INotificationService" 
      contract="INotificationService" 
      name="WSDualHttpBinding_INotificationService"> 
    </endpoint> 
    <endpoint address="net.tcp://localhost:8011/GPS/Notification" 
      binding="netTcpBinding" 
      bindingConfiguration="NetTcpBinding_INotificationService" 
      contract="INotificationService" 
      name="NetTcpBinding_INotificationService"> 
    </endpoint> 
</client> 

私は以来、登録コードの多くを省略しました私はただちに通知を受けようとしています。

これは、顧客のドメインに属していない2003サーバーのWindowsサービス(セットアップ)でホストする予定であり、クライアントコンピュータは顧客のドメインになります。

編集:私は、ホストのApp.configファイルにバインディングを追加した

:同じスチームセキュリティが強化された

​​

これはまだエラーは、必要とされるエラーメッセージ。このソリューションの小さなサブセットを新しいソリューションで試してみましょう。

答えて

9

さて、あなたの問題は、このように表示されます。サーバー側で

  • 、あなたはNETTCPは、パラメータなしで結合デフォルトを使用 - あなたはそれには何も変更しないでください。クライアント上のWindows資格情報

  • とセキュリティレベルの輸送するNETTCPデフォルトでは、しかし、あなたは明示的に両者が一致しないと同意していない

を結合NETTCP上の任意のセキュリティをオフ何をすべきか。

両方のセキュリティを両方のサーバー(サーバーとクライアント)でオフにするか、セキュリティで保護された既定値(Windows資格情報)を使用するだけで済みます。

マルク・

+0

素晴らしい!私はVSの発見がこれを正しかったと思ったが、それでも設定を編集しなければならなかった。ありがとう! – rozon

3

私は、これは、多くの異なる方向にあなたを導き、それらの恐ろしいエラーメッセージのいずれかで判明と思います。上記の答えは、この場合には正しいです。私のケースは違っていました。私のセキュリティ設定はクライアントとサーブで同じでした。

私の場合、このリンクは私の特定の欠陥を指摘しました:http://www.netframeworkdevs.com/windows-communication-foundation-wcf/error-invoking-service-with-a-net-tcp-binding-123918.shtml

エンドポイントのサービス側のapp.configには、bindingConfigurationではなく、バインディング設定に名前を付ける属性としてbindingNameがありました。私は、にというバインディング名という名前の属性があるとは思わない。

だから私の持ち去りは、このエラーは「サービスコンフィグレーションの設定におそらく絞り込まれたWCF設定エラーがある」ということです。ああ。

+0

+1確かに 'bindingName'属性がありますが、ありがたいことです。欠落している' bindingConfiguration'が私の問題でした。 – ildjarn

関連する問題