开发者

WSDoAllReceiver: Incoming message does not contain required Security header

开发者 https://www.devze.com 2023-01-19 23:35 出处:网络
I have java service which communicates over https. I want to connect to this service from C#. I am getting this exception:

I have java service which communicates over https. I want to connect to this service from C#.

I am getting this exception:

System.ServiceModel.FaultException: WSDoAllReceiver: Incoming message does not contain required Security header.

Someone knows what is wrong?

C# Code:

EndpointAddress address = new EndpointAddress(
          开发者_开发百科          new Uri("https://JavaStore:8443/JavaStore/services/B2BService"),
                        EndpointIdentity.CreateDnsIdentity("JavaStore"),
                        new AddressHeaderCollection()
                );

BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.Transport;

var client = new ReharB2BService.B2BServicePortTypeClient(binding, address);;

client.Open();
client.getAllItems();


Check this post on how to include security headers in WCF calls (the example is against a java hosted web service): http://isyourcode.blogspot.com/2010/05/using-oasis-username-token-profile-in.html

0

精彩评论

暂无评论...
验证码 换一张
取 消