我对 SOAP 很陌生,所以请放轻松。我正在尝试设置一个接受以下标头格式的 SOAP 服务:
<soap:Header>
<wsse:Security>
<wsse:UsernameToken wsu:Id='SecurityToken-securityToken'>
<wsse:Username>Username</wsse:Username>
<wsse:Password>Password</wsse:Password>
<wsu:Created>Timestamp</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
我将此服务合并到的应用程序是一个 ASP.NET 3.5 Web 应用程序,我已经使用 WCF 设置了一个 SOAP 端点。我已经设置了一项基本服务,以确保 WCF 正常工作并且工作正常(忽略标题)。听说上面的格式遵循WS-Security所以我在web.config中添加了WSHttpBinding:
<service name="Nexternal.Service.XMLTools.VNService"
behaviorConfiguration="VNServiceBehavior">
<!--The first endpoint would be picked up from the confirg
this shows how the config can be overriden with the service host-->
<endpoint address=""
binding="wsHttpBinding"
contract="Nexternal.Service.XMLTools.IVNService"/>
</service>
我下载了一个测试工具(soapUI)并粘贴了带有上述标题的测试消息,它返回了 400 Bad Request 错误。
...对于它的价值,我正在使用 IIS7 运行 Visual Studio 2008。
我觉得我在绕圈子,所以任何帮助都会很棒。提前致谢。