title: Adding scopes to the announcement endpoint
body: <p>I'm currently implementing a service that uses <a href="http://msdn.microsoft.com/en-us/library/dd456782.aspx" rel="nofollow">WCF discovery</a> and provides Discovery Endpoint and Announcement Endpoint. I also need to use scopes in order to filter announced/discovered endpoints on my client.</p>
  
  <p>Adding scopes to the Discovery Endpoint works great, but I can't figure out the right configuration for Announcement Endpoint. Here's what I came up with:</p>
  
  <pre><code>&lt;serviceBehaviors&gt;
      &lt;behavior name="MyServiceBehavior"&gt;
          &lt;serviceMetadata httpGetEnabled="True"/&gt;
          &lt;serviceDiscovery&gt;
              &lt;announcementEndpoints&gt;
                  &lt;endpoint kind="udpAnnouncementEndpoint"      
                            behaviorConfiguration="DiscoveryBehavior" /&gt;                          
              &lt;/announcementEndpoints&gt;
          &lt;/serviceDiscovery&gt;
      &lt;/behavior&gt;
  &lt;/serviceBehaviors&gt;
  &lt;endpointBehaviors&gt;
      &lt;behavior name="DiscoveryBehavior"&gt;
          &lt;endpointDiscovery&gt;
              &lt;scopes&gt;
                  &lt;add scope="http://My/Scope"/&gt;
              &lt;/scopes&gt;
          &lt;/endpointDiscovery&gt;
      &lt;/behavior&gt;
  &lt;/endpointBehaviors&gt;
  </code></pre>
  
  <p>I suppose it's not correct because I reuse the endpoint behavior that I created for my Discovery Endpoint. But that's the only way I found to describe my scopes.</p>
  
  <p>I think that using scopes for announcements should be possible because:  </p>
  
  <ul>
  <li>There is no other way to filter received announcements</li>
  <li>The <code>EndpointDiscoveryMetadata</code> class (the instance of which I get when announcements get received) contains a property <a href="http://msdn.microsoft.com/ru-ru/library/system.servicemodel.discovery.endpointdiscoverymetadata.scopes.aspx" rel="nofollow">Scopes</a>.</li>
  </ul>
  
  <p>But with my configuration the <code>Scopes</code> collection on client side is empty for all endpoints except the mex one (it has two tempuri scopes in it).</p>
  
  <p>So, any ideas how to correctly declare scopes for the announcement endpoints? 
  Any help will be appreciated, many thanks in advance.</p>