.net 调用启用 WS-Security 的 Web 服务(用 java 创建)
如何使用 ws security 调用 Web 服务(用 java 创建),他们提供了证书文件、用户名和密码。密码,我尝试使用 Web 服务增强 (WSE) 3.0,从 Microsoft.Web.Services3.WebServicesClientProtocol 继承服务代理,使用用户名密码令牌时
UsernameToken tocken = new UsernameToken("uname", "pwd");
Service.RequestSoapContext.Security.Tokens.Add(tocken);
出现错误“底层连接已关闭:无法为 SSL/TLS 安全通道建立信任关系”。
是因为客户端证书吗?我也尝试过
X509Certificate xCert = new X509Certificate();
xCert = X509Certificate.CreateFromCertFile("certificate_path.cer");
Service.ClientCertificates.Add(xCert);
How to call a webservice (created in java) with ws security, they provided a certificate file , username & password, i tried using Web Services Enhancements (WSE) 3.0, Inherited the service proxy from Microsoft.Web.Services3.WebServicesClientProtocol used username password tocken
UsernameToken tocken = new UsernameToken("uname", "pwd");
Service.RequestSoapContext.Security.Tokens.Add(tocken);
got error "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."
Is it because of the client certificate ? I aslo tried
X509Certificate xCert = new X509Certificate();
xCert = X509Certificate.CreateFromCertFile("certificate_path.cer");
Service.ClientCertificates.Add(xCert);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决了这个问题,因为 ssl 证书验证问题,使用
I solved the issue its becuase of ssl certificate validation problem, used