WSDoAllReceiver:传入消息不包含必需的安全标头

时间:2010-10-13 09:18:39

标签: c# java web-services

我有通过https进行通信的java服务。我想从C#连接到这个服务。

我得到了这个例外:

  

System.ServiceModel.FaultException:   WSDoAllReceiver:传入消息   不包含必需的安全标题。

有人知道出了什么问题吗?

C#代码:

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();

1 个答案:

答案 0 :(得分:1)

查看这篇文章,了解如何在WCF调用中包含安全标头(该示例针对的是Java托管的Web服务):http://isyourcode.blogspot.com/2010/05/using-oasis-username-token-profile-in.html