1
votes

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;
}
1
What's the InnerException on the FaultException?MrMDavidson
An unhandled exception of type 'System.ServiceModel.FaultException' occurred in System.ServiceModel.dll Additional information: Server was unable to process request. ---> Object reference not set to an instance of an object.Boudi Maatouk
What is the FetchStream method expecting for the args parameter? (I was not aware you could actually serialize a zero length array, does passing null instead of _args work?).Gone Coding

1 Answers

4
votes

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.