2

皆さん、こんにちは。

WCF のファイルレス サービス アクティベーションを使用する場合、サービス ディスカバリを有効にするにはどうすればよいですか? このアプローチでは、明示的なエンドポイント タイプまたは動作構成を指定することはできないようです。

私の現在の試みは次のとおりですが、サービス検出はまだ機能していません:

<bindings>
  <wsHttpBinding>
    <binding name="Default" transactionFlow="true">
      <security mode="Transport">
        <transport clientCredentialType="None">
        </transport>
      </security>
    </binding>
  </wsHttpBinding>
</bindings>

<protocolMapping>
  <clear/>
  <add scheme="https" binding="wsHttpBinding" bindingConfiguration="Default" />
</protocolMapping>

<behaviors>
  <serviceBehaviors>
    <behavior>
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="true"/>
      <serviceDiscovery/>
    </behavior>
  </serviceBehaviors>

  <endpointBehaviors>
    <behavior>
      <endpointDiscovery enabled="true">
        <scopes>
          <add scope="http://XPS/MvcApplication/Service/"/>
        </scopes>
      </endpointDiscovery>
    </behavior>
  </endpointBehaviors>
</behaviors>

<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
  <serviceActivations>
    <add service="RegistrationService" factory="Core.ServiceModel.Activation.ServiceHostFactory" relativeAddress="RegistrationService.svc" />
    <add service="EventService" factory="Core.ServiceModel.Activation.ServiceHostFactory" relativeAddress="EventService.svc" />
    <add service="ShoppingService" factory="Core.ServiceModel.Activation.ServiceHostFactory" relativeAddress="ShoppingService.svc" />
  </serviceActivations>
</serviceHostingEnvironment>
4

2 に答える 2

0

この質問は 1 年前のものですが、この質問を持っている可能性のある他の人のために、ここに答えを示します。

WCF ファイルレス アクティベーションを使用しているにもかかわらず、検出可能にする各サービスに検出エンドポイントを明示的に追加する必要があるためservices、構成セクションにノードが必要です。system.serviceModel

<services>
  <service name="RegistrationService">
    <endpoint binding="wsHttpBinding" contract="IRegistrationService"/>
    <endpoint kind="udpDiscoveryEndpoint"/>
  </service>
</services>

上記の構成スニペットは、RegistrationService に検出エンドポイントを追加します (IRegistrationService という名前の明示的なサービス コントラクトがあると想定しています)。

また、RegistrationService のサービス構成ノードを追加すると、データ エンドポイントを明示的に追加する必要があることに注意してください。

于 2012-01-16T15:55:53.570 に答える
0

これを web.config に追加してみてください。

<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="False"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
于 2010-12-23T05:04:57.847 に答える