将用户名和密码令牌添加到WSSecurity Web服务调用(.net客户端)

时间:2012-08-23 13:15:19

标签: web-services credentials soapheader

嘿有代码战士和堆栈交换器。

我一直在努力为Web服务设置凭据。我在Websphere(java ee)中编写了webservice,它要求在头文件中使用用户名和密码来调用任何服务。我可以在SOAP UI中运行它,但我需要能够从.net Web客户端访问它。

到目前为止,我已尝试设置凭据,因此......

dlc.ClientCredentials.UserName.UserName = "idiotCreds";
dlc.ClientCredentials.UserName.Password = "someWhackyPWD";

到目前为止,我刚收到这个例外

security.wssecurity.WSSContextImpl.s02: com.ibm.websphere.security.WSSecurityException: Exception  org.apache.axis2.AxisFault: CWWSS6500E: There is no caller identity candidate that can be used to login. ocurred while running action: com.ibm.ws.wssecurity.handler.WSSecurityConsumerHandler$1@42304230

我猜的是告诉我没有设置凭证...
即使我设置了客户端凭据。我是否需要在此手动创建和添加soap标头?我以为应该由该客户端对象处理?有什么想法吗?感谢

1 个答案:

答案 0 :(得分:0)

这个SO线程中的问题和答案将为那些寻求答案的人提供所需的解决方案。 https://stackoverflow.com/a/12159837/729820

相关问题