Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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:
C#
BasicHttpBinding binding = new BasicHttpBinding();

EndpointAddress address = new EndpointAddress("http://localhost:8731/WcfServicio/MiServicio");

MiServicioClient svc = new MiServicioClient(binding, address);
object ob = svc.PaisesObtener();

At the last line when I do svc.PaisesObtener(), 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 23-Nov-11 17:39pm
v2
Comments
Wael Al Wirr 5-Apr-12 1:39am    
Please can you post the web.config content

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