简体   繁体   English

找不到PollingDuplexHttpBinding端点-内容不匹配

[英]PollingDuplexHttpBinding Endpoint NotFound - Content Mismatch

I've created a WCF Hosted service that runs in a console to be accessed by silverlight. 我创建了一个WCF托管服务,该服务在控制台中运行,以供silverlight访问。 My PolicyHost works great, my service loads up fine. 我的PolicyHost运作良好,服务加载正常。 I can go to my silverlight client and do an "Add Service Reference" and have VS2010 download my service reference with the appropriate wsdl and generate a proxy. 我可以转到Silverlight客户端并执行“添加服务参考”,并让VS2010使用适当的wsdl下载我的服务参考并生成代理。

However, when I go to call the first method I get back the following message each time. 但是,当我去调用第一个方法时,每次都会返回以下消息。

The remote server returned an error: NotFound. 远程服务器返回错误:NotFound。

Digging into this a little more via the Wcf TraceLog Viewer I see the following; 通过Wcf TraceLog Viewer进一步了解这一点,我看到以下内容;

Content Type application/mspd1 was sent to a service expecting application/soap+msbin1. 内容类型application / mspd1已发送到需要application / soap + msbin1的服务。 The client and service bindings may be mismatched. 客户端和服务绑定可能不匹配。 Cannot process the message because the content type 'application/mspd1' was not the expected type 'application/soap+msbin1' 由于内容类型“ application / mspd1”不是预期的类型“ application / soap + msbin1”,因此无法处理该消息

Now, if I drop the callbacks, drop the DuplexPolling and put it back to WsHttpBinding - my method calls seem to work fine. 现在,如果我删除回调,请删除DuplexPolling并将其放回WsHttpBinding-我的方法调用似乎可以正常工作。

Is there something I am missing in trying to configure Duplex Polling to work correctly? 在尝试配置双工轮询以正常工作时我缺少什么吗?

Greg 格雷格

May be covered but I'll ask anyways. 可能会覆盖,但我还是会问。 Are you using the client assembly for duplex polling? 您是否正在使用客户端程序集进行双工轮询? It needs to be included in your references. 它需要包含在您的参考中。 And you need to use the server assembly on your wcf service. 并且您需要在wcf服务上使用服务器程序集。 When you get the sdk, both assemblies are included. 当您得到SDK时,两个程序集都包括在内。 Also make sure you are using the correct version. 还要确保您使用的是正确的版本。

If you've got all that, how did you have visual studio generate your proxy? 如果已掌握所有内容,那么Visual Studio是如何生成代理的? Did you include contracts option? 您是否包含合同选项? Or are you using a shared assembly that can be compiled with full framework CLR or silverlight CLR. 或者您是否正在使用可以用完整框架CLR或silverlight CLR编译的共享程序集。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM