我们正在尝试开发一个客户端来使用 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 安全自定义标头?
感谢您的时间