[英]Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it
my project is silverlight and use Ria service. 我的项目是Silverlight,并使用Ria服务。 I want to create a WCF Service, this is my code
我想创建一个WCF服务,这是我的代码
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
public class MessageDuplex : IServiceSide
{
public void Attach(string s)
{
}
}
[ServiceContract]
interface IClientSide
{
[OperationContract(IsOneWay = true)]
void SendMessage(string s);
}
[ServiceContract(CallbackContract = typeof(IClientSide))]
interface IServiceSide
{
[OperationContract(IsOneWay = true)]
void Attach(string s);
}
When i defined IServiceSide without CallbackContract this is add to silverlight project correctly, but when i use CallbackContract this error raise when add Service Referense : "Contract requires Duplex, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it." 当我定义不带CallbackContract的IServiceSide时,将其正确添加到silverlight项目中,但是当我使用CallbackContract时,添加服务Referense时将引发该错误:它。”
BasicHttpBinding
doesn't support duplex services. BasicHttpBinding
不支持双工服务。 You must use PollingDuplexHttpBinding . 您必须使用PollingDuplexHttpBinding 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.