I am having difficulty connecting to a third-party web service WSE 3.0 from a WCF client. I implemented my own binding class, as indicated in this article in KB:
http://msdn.microsoft.com/en-us/library/ms734745.aspx
The problem seems to be related to the security statement used by the web service - UsernameOverTransport.
When I try to call a method, I get the following exception:
System.InvalidOperationException: 'WseHttpBinding'. '[Names] required for' MyWebServiceSoap '. The '[Names] contract is configured with an authentication mode that requires transport layer integrity and confidentiality. However, vehicles cannot provide integrity and confidentiality.
Expected username, password and CN number. In the sample code provided by the supplier, these credentials are supplied to Microsoft.Web.Services3.Security.Tokens.UsernameToken. Here is an example of a provider:
MyWebServiceWse proxy = new MyWebServiceWse(); UsernameToken token = new UsernameToken("Username", "password", PasswordOption.SendPlainText); token.Id = "<supplied CN Number>"; proxy.SetClientCredential(token); proxy.SetPolicy(new Policy(new UsernameOverTransportAssertion(), new RequireActionHeaderAssertion())); MyObject mo = proxy.MyMethod();
This works great with the 2.0 w / WSE 3.0 application. Here is the code snippet of my WCF client:
EndpointAddress address = new EndpointAddress(new Uri("<web service uri here>")); WseHttpBinding binding = new WseHttpBinding();
I searched the internet looking for the answer to this question. Some sources close me (for example, in the article MS KB), but I can not cope with the hump. Can someone help me?
web-services wcf wse
Dave
source share