title: Visual Studio cannot consume Web Service containing UsernameToken policy
body: <p>I am getting errors when trying to add a reference to a Web Service in Visual Studio 2010. The Web Service is implemented in Java using the JAX-WS/Metro/GlassFish stack and contains a UsernameToken policy. Here's an excerpt from the WSDL:</p>
  
  <pre><code>&lt;wsp:Policy
          xmlns:wsp="http://www.w3.org/ns/ws-policy"
          xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
          wsu:Id="UsernameToken"&gt;
      &lt;sp:SupportingTokens&gt;
          &lt;wsp:Policy&gt;
              &lt;sp:UsernameToken sp:IncludeToken=".../IncludeToken/AlwaysToRecipient" /&gt;
          &lt;/wsp:Policy&gt;
      &lt;/sp:SupportingTokens&gt;
  &lt;/wsp:Policy&gt;
  </code></pre>
  
  <p>When I try to add a service reference to this web service in Visual Studio, I get the following warnings:</p>
  
  <pre><code>Custom tool warning:
    The following Policy Assertions were not Imported:
    XPath://wsdl:definitions[@targetNamespace='http://archfirst.org/bfoms/tradingservice.wsdl']/wsdl:binding[@name='TradingWebServicePortBinding']
    Assertions:
      &lt;sp:SupportingTokens xmlns:sp='http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702'&gt;..&lt;/sp:SupportingTokens&gt;
  
  Custom tool warning:
    Endpoint 'TradingWebServicePort' at address 'http://localhost:8080/bfoms-javaee/TradingService'
    is not compatible with Silverlight 4. Skipping...
  
  Custom tool warning:
    No endpoints compatible with Silverlight 4 were found. The generated client
    class will not be usable unless endpoint information is provided via the
    constructor.
  </code></pre>
  
  <p>Why is Visual Studio not able to import the assertion?</p>
  
  <p>P.S. I was able to import and test the web service using the SoapUI tool.</p>