views:

8

answers:

0

I basically follow the instructions in MSDN: http://msdn.microsoft.com/en-us/library/ms730299(VS.85).aspx

But when I try to invoke the web service, I get the error"

{"The content type text/xml of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 364 bytes of the response were: 'Client.AuthenticationFaultUnable to authenticate user theuser against LDAP Server.'."}

How do I modify the bindings provided in the tutorial to avoid this error? Is there a tutorial that explains how to implement custom encoders for this, if that's what I need to do?

This is the code I'm using:

WseHttpBinding binding = new WseHttpBinding();
binding.EstablishSecurityContext = false;
binding.RequireDerivedKeys = true;
binding.SecurityAssertion = WseSecurityAssertion.UsernameOverTransport;
binding.MessageProtectionOrder = MessageProtectionOrder.SignBeforeEncrypt;
EndpointAddress address = new EndpointAddress(new Uri(theUrl));
GAGServiceAgent proxy = new GAGServiceAgent(binding, address);
proxy.Operation() ;