小编use*_*483的帖子

内容类型text/xml; 服务不支持charset = utf-8

我有一个WCF服务的问题.我有一个控制台应用程序,我需要在不使用app.config的情况下使用该服务,因此我必须通过代码设置端点等.我有svc的服务引用,但我不能使用app.config.这是我的代码:

BasicHttpBinding binding = new BasicHttpBinding();

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

MiServicioClient svc = new MiServicioClient(binding, address);
object ob = svc.PaisesObtener();
Run Code Online (Sandbox Code Playgroud)

在我的最后一行,svc.PaisesObtener()我得到错误:

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.
Run Code Online (Sandbox Code Playgroud)

wcf endpoint

72
推荐指数
3
解决办法
13万
查看次数

标签 统计

endpoint ×1

wcf ×1