不知道我是否做错了什么......但我试图实现可以从WCF调用的WCF服务。我实现了客户端上的异步模式,这里的电话是什么样子:从Silverlight挂起的WCF呼叫挂起
BasicHttpBinding basicHttpBinding = new BasicHttpBinding();
EndpointAddress endpointAddress = new EndpointAddress(AccountServiceURL);
var personService = new ChannelFactory<IAccountService>(basicHttpBinding, endpointAddress).CreateChannel();
var result = personService.BeginRegister(username, password, email, null, null);
personService.EndRegister(result); // <-- failing here
它挂在“EndRegister”呼......它只是坐在那里,什么都不做。而firefox.exe变得没有响应。由于我在方法调用中有一个断点,因此服务器似乎不会接收到调用。也许有人可以看到我做错了什么?
合同看起来像这样在客户端上:
[ServiceContract]
public interface IAccountService
{
[OperationContract(AsyncPattern = true)]
IAsyncResult BeginRegister(string username, string password, string email, AsyncCallback callback, Object state);
void EndRegister(IAsyncResult result);
}
像这样在服务器上:
[ServiceContract]
public interface IAccountService
{
[OperationContract]
void Register(string username, string password, string email);
}
就是这样!谢谢杰森 – 2009-12-15 00:55:36