Not sure if I'm doing something wrong ... but I'm trying to implement a WCF service that can be called from WCF. I implemented the async pattern on the client, and here's what the call looks like:
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
It hangs on the "EndRegister" call ... it just sits there and does nothing. And firefox.exe becomes unresponsive. The server never seems to receive the call as I have a breakpoint on the method call. Perhaps someone can eyeball something I'm doing wrong?
The contract looks like this on the client:
[ServiceContract]
public interface IAccountService
{
[OperationContract(AsyncPattern = true)]
IAsyncResult BeginRegister(string username, string password, string email, AsyncCallback callback, Object state);
void EndRegister(IAsyncResult result);
}
and like this on the server:
[ServiceContract]
public interface IAccountService
{
[OperationContract]
void Register(string username, string password, string email);
}