[英]System.ServiceModel.FaultException in System.dll
I am trying to consume a remote ASP.NET WebMethod using the Windows Phone SDK 7.1 I have the following C# Code: 我正在尝试使用Windows Phone SDK 7.1使用远程ASP.NET WebMethod我有以下C#代码:
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
. 根据您提供的InnerException
详细信息,服务器正在抛出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. 要确认它是服务 - 而不是WP7的服务客户端 - 尝试创建一个简单的控制台应用程序,传入相同的值,并查看它是否生成相同的错误。
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. 通过创建一个简单的控制台应用程序,您将有希望消除它作为WP7特定问题以及在服务中修复的更普遍的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.