2

G'day guys,

How do I go about enabling service discovering when using WCF's file-less service activation? With this approach it doesn't seem possible to specify explicit endpoint types or a behaviorConfiguration?

My current attempt is as follows but service discovery still is not working:

<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>
Dan Turner
  • 2,233
  • 18
  • 19

2 Answers2

0

Try adding this to the web.config.

<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="False"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
Nathan G
  • 63
  • 2
  • 5
  • 1
    Ha! No, I'm pretty sure giving my service behavior the name empty string isn't going to fix my problem... – Dan Turner Dec 24 '10 at 05:24
0

This question is a year old but for the sake of others who may have this question here's the answer:

Dispite the fact that you are using WCF fileless activation, you still need a services node in your system.serviceModel configuration section because you are required to explicitly add the discovery endpoint to each service you wish to make discoverable.

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

The above configuration snippet will add a discovery endpoint to your RegistrationService (I'm assuming you have an explicit service contract named IRegistrationService).

Note also, with the addition of a service configuration node for the RegistrationService you will need to add any data endpoints explicitly.

Xacron
  • 341
  • 4
  • 11