我们正在尝试开发一个使用Axis2服务的客户端。
这是我们尝试使用以下方法获取数据的方法:
var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
EndpointAddress address = new EndpointAddress("https://example.com/Axis2/xxxService");
WindowsFormsApplication1.XSVC.xxxServicePortTypeClient soap_xxx = new WindowsFormsApplication1.XSVC.xxxServicePortTypeClient(binding, address);
soap_xxx.ClientCredentials.UserName.UserName = "USERNAME";
soap_xxx.ClientCredentials.UserName.Password = "PASSWORD";
WindowsFormsApplication1.XSVC.xxxDataRequest insReq = new WindowsFormsApplication1.XSVC.xxxDataRequest();
insReq.clientIP = "1";
insReq.barcodeData = this.INPUT.Text;
WindowsFormsApplication1.XSVC.xxxDataResponse insRes = new WindowsFormsApplication1.XSVC.xxxDataResponse();
// soap_xxx.Open();
insRes = soap_xxx.checkXXXData(insReq);
目前我们收到此错误:
WSDoAllReceiver:传入消息不包含必需的安全性 头
.Net框架版本是4.0,在VS 2012上开发
我们无法为它实现自定义标头,是否有其他解决方法或良好的文档来实现WSSE安全自定义标头?
感谢您的时间