Click here to Skip to main content
15,887,816 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I Have a problem with a wcf service.

I have a console aplication and I need to consume the service without using app.config, so I had to set the endoint, etc by code.

I do have a service reference to the svc, but I cant use the app.config.

Here's my code:
BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
EndpointAddress endpoint =
new EndpointAddress("http://localhost:XXXX/_vti_bin/Testingapp.svc/mex");
string internetList = "Interaktor - Henvendelser";
string internetSite = "http://localhost:20311  ";
string ggt = ww.DoWork();



At the last line when I do ww.DoWork(), I get the error:
Content Type text/xml; charset=utf-8 was not supported by service http://localhost:8731/WcfServicio/MiServicio. The client and service bindings may be mismatched.

Any suggestions??
Posted
Updated 12-Apr-13 4:14am
v2

1 solution

I think this is due to Binding mismatch between client and service configuration. Generally wsHttpBinding Supports SOAP 1.2 and basicHttpBinding suppors SOAP 1.1 . So if there is a mismatch between them that can cause such issue. Please check your service configuration.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900