I am trying to consume a remote ASP.NET WebMethod using the Windows Phone SDK 7.1 I have the following C# Code:
public static PublicServices.RegisteredServicesSoapClient taarafClient;
App.taarafClient.FetchStreamCompleted +=
new EventHandler<PublicServices.FetchStreamCompletedEventArgs>(
taarafClient_FetchStreamCompleted);
When running this code I am getting the exception in the title.
I am using a Service Reference: The exception is here:
public Taaraf.PublicServices.FetchStreamResponse EndFetchStream(
System.IAsyncResult result)
{
object[] _args = new object[0];
Taaraf.PublicServices.FetchStreamResponse _result =
(Taaraf.PublicServices.FetchStreamResponse)
base.EndInvoke("FetchStream", _args, result);
return _result;
}
Based on the InnerException
details you've provided the server is throwing an NullReferenceException
. Is this a service you control? To confirm that it's the service - and not WP7's service client - try creating a simple console application, passing in the same values, and seeing if it generates the same error.
But to me it definitely looks like the error is on the server side. By creating a simple console application you'll hopefully eliminate it being a WP7 specific issue and a more general issue to be fixed in the service.