试图引用在Visual Studio 2010中的Web服务使用JAX-WS /地铁/ GlassFish的堆栈用Java实现,包含添加到Web服务时收到错误一个UsernameToken策略。下面是从WSDL的摘录:Visual Studio中不能使用Web服务包含的UsernameToken政策
<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中不能导入断言?
P.S.我能够使用SoapUI工具导入和测试Web服务。
谢谢拉迪斯拉夫。由于我可以控制服务器,因此可以将其更改为我想要的任何内容。什么是Silverlight客户端支持的最简单的基于WS-I的身份验证机制?我在Java方面的唯一要求是验证主叫用户并确定他们的用户名。如果你也可以参考我的链接来解释如何在Silverlight端进行设置,那将是非常好的。谢谢。 – Naresh 2011-02-06 14:14:22