Visual Studio 2010でWebサービスへの参照を追加しようとするとエラーが発生します。Webサービスは、JAX-WS / Metro / GlassFishスタックを使用してJavaで実装され、UsernameTokenポリシーが含まれています。これがWSDLからの抜粋です。
<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">
<sp:SupportingTokens>
<wsp:Policy>
<sp:UsernameToken sp:IncludeToken=".../IncludeToken/AlwaysToRecipient" />
</wsp:Policy>
</sp:SupportingTokens>
</wsp:Policy>
Visual StudioでこのWebサービスにサービス参照を追加しようとすると、次の警告が表示されます。
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:
<sp:SupportingTokens xmlns:sp='http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702'>..</sp:SupportingTokens>
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.
Visual Studioがアサーションをインポートできないのはなぜですか?
PS SoapUIツールを使用して、Webサービスをインポートしてテストすることができました。