Passing messages to WCF service. Permissive messages Hello, Hello, Probe.

I am implementing WCF discovery for my application. Everything is working fine except for false traffic on our network.
Using Wireshark, I found that the service sends "Hello", "Probe" and "Resolve" messages to 239.255.255.250:3702. According to the WCF Discovery specification, the client must send a "Hello", "Probe" message to find a service, and the service must send a "Hello" message when using guided discovery.
As far as I understand, there is no reason for a broadcast message service when there is no search. The client should simply send a Hello / Probe message and the service should respond with a ResolveMatches / ProbeMatches message once.
Is there a way to disable this service behavior?

My config file:

<system.serviceModel>
<behaviors>
  <endpointBehaviors>
    <behavior name="Base">
      <endpointDiscovery>
        <extensions>
          <interfaces>192.168.36.16</interfaces>
        </extensions>
      </endpointDiscovery>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="RadioServer">
      <serviceDiscovery />
    </behavior>
  </serviceBehaviors>
</behaviors>
<bindings>
  <netTcpBinding>
    <binding name="Base" receiveTimeout="Infinite">
      <reliableSession inactivityTimeout="00:00:15" enabled="true" />
      <security mode="None">
        <transport clientCredentialType="Windows" protectionLevel="Sign" />
      </security>
    </binding>
  </netTcpBinding>
</bindings>
<services>
  <service behaviorConfiguration="RadioServer" name="Server.RadioServer">
    <endpoint address="RS" behaviorConfiguration="Base" binding="netTcpBinding"
      bindingConfiguration="Base" contract="Common.IRadioService" />
    <endpoint name="udpDiscovery" kind="udpDiscoveryEndpoint" />
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://0.0.0.0:8888/" />
      </baseAddresses>
    </host>
  </service>
</services>

      

Examples of messages "Hello", "Probe", "Resolve" from the service:

 <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsd="http://schemas.xmlsoap.org/ws/2005/04/discovery">
 <soap:Header>
 <wsa:To>urn:schemas-xmlsoap-org:ws:2005:04:discovery</wsa:To>
 <wsa:Action>http://schemas.xmlsoap.org/ws/2005/04/discovery/Resolve</wsa:Action>
 <wsa:MessageID>urn:uuid:95bc52ec-e466-41b4-971a-3ae6dfe6f864</wsa:MessageID>
 </soap:Header>
 <soap:Body>
 <wsd:Resolve>
 <wsa:EndpointReference>
 <wsa:Address>urn:uuid:9525082d-d921-40f6-b81e-5c953bec55c1</wsa:Address>
 </wsa:EndpointReference>
 </wsd:Resolve>
 </soap:Body>
</soap:Envelope>

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsdp="http://schemas.xmlsoap.org/ws/2006/02/devprof" xmlns:pub="http://schemas.microsoft.com/windows/pub/2005/07">
 <soap:Header>
 <wsa:To>urn:schemas-xmlsoap-org:ws:2005:04:discovery</wsa:To>
 <wsa:Action>http://schemas.xmlsoap.org/ws/2005/04/discovery/Hello</wsa:Action>
 <wsa:MessageID>urn:uuid:d950c11f-46a5-408b-8e54-d530f225af89</wsa:MessageID>
 <wsd:AppSequence InstanceId="6" SequenceId="urn:uuid:330912d7-9365-4029-8fbc-f93749e46089" MessageNumber="487489"></wsd:AppSequence>
 </soap:Header>
 <soap:Body>
 <wsd:Hello>
 <wsa:EndpointReference>
 <wsa:Address>urn:uuid:9525082d-d921-40f6-b81e-5c953bec55c1</wsa:Address>
 </wsa:EndpointReference>
 <wsd:Types>wsdp:Device pub:Computer</wsd:Types>
 <wsd:MetadataVersion>950</wsd:MetadataVersion>
 </wsd:Hello>
 </soap:Body>
</soap:Envelope>

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsdp="http://schemas.xmlsoap.org/ws/2006/02/devprof">
 <soap:Header>
 <wsa:To>urn:schemas-xmlsoap-org:ws:2005:04:discovery</wsa:To>
 <wsa:Action>http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe</wsa:Action>
 <wsa:MessageID>urn:uuid:3785aebe-d04b-48fc-8010-5403a56777fd</wsa:MessageID>
 </soap:Header>
 <soap:Body>
 <wsd:Probe>
 <wsd:Types>wsdp:Device</wsd:Types>
 </wsd:Probe>
 </soap:Body>
</soap:Envelope>

      

+3


source to share





All Articles