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

Web services 将用户名和密码令牌添加到WSSecurity web服务调用(.net客户端),web-services,credentials,soapheader,Web Services,Credentials,Soapheader,嘿,这里有代码战士和堆栈交换器 我一直试图为web服务设置凭据,但没有成功。我在Websphere(JavaEE)中编写了webservice,它需要在头中输入用户名和密码才能调用任何服务。我可以在SOAPUI中很好地运行它,但我需要能够从.NETWeb客户机上运行它 到目前为止,我已尝试设置凭据,如下所示 dlc.ClientCredentials.UserName.UserName = "idiotCreds"; dlc.ClientCredentials.UserName.Password

嘿,这里有代码战士和堆栈交换器

我一直试图为web服务设置凭据,但没有成功。我在Websphere(JavaEE)中编写了webservice,它需要在头中输入用户名和密码才能调用任何服务。我可以在SOAPUI中很好地运行它,但我需要能够从.NETWeb客户机上运行它

到目前为止,我已尝试设置凭据,如下所示

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头吗?我以为应该由客户机对象来处理?伙计们,有什么想法吗?谢谢

本帖中的问答将为寻求答案的人提供他们需要的解决方案。

看起来WCF已经不能这么做了?这真令人失望。