Wcf服务给予恐怖 [英] Wcf Service Giving eror
问题描述
System.ServiceModel.FaultException< system.servicemodel.exceptiondetail>被抓了
HResult = -2146233087
消息=对象引用未设置为对象的实例。
来源= mscorlib
StackTrace:
服务器堆栈跟踪:
在System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(消息回复,MessageFault错误,字符串操作,MessageVersion版本,FaultConverter faultConverter)
在System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime操作,ProxyRpc& rpc)
在System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway,ProxyOperationRuntime操作,Object [] ins,Object []出局,TimeSpan超时)
在System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall,ProxyOperationRuntime操作)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
在[0]处重新抛出异常:
在System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)
在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,Int32类型)
在ClientForCustomerService.ServiceReference1.ICustomerService.UserLogin(LoginDetail loginDetail)
at ClientForCustomerService.ServiceReference1.CustomerServiceClient.UserLogin(LoginDetail loginDetail)
{对象引用未设置为对象的实例。}
System.ServiceModel.FaultException<system.servicemodel.exceptiondetail> was caught
HResult=-2146233087
Message=Object reference not set to an instance of an object.
Source=mscorlib
StackTrace:
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at ClientForCustomerService.ServiceReference1.ICustomerService.UserLogin(LoginDetail loginDetail)
at ClientForCustomerService.ServiceReference1.CustomerServiceClient.UserLogin(LoginDetail loginDetail) in
{"Object reference not set to an instance of an object."}
推荐答案
如果没有看到您的代码,我们无法告诉您任何事情。当您尝试访问null
的对象属性时,通常会出现此错误。
检查这些更多细节与示例
为什么我会收到错误对象引用没有设置为对象的实例? [ ^ ]
对象引用未设置为对象实例是什么意思? [ ^ ]
对于FaultException,请查看本文
了解WCF中的异常处理,FaultExceptions和FaultContracts的初学者教程 [ ^ ]
We can't tell you anything without seeing your code. Usually you get this error when you're trying to access the property of object which isnull
.
Check these for more details with example(s)
Why do I get the error "Object reference not set to an instance of an object"?[^]
What does "Object reference not set to an instance of an object" mean?[^]
And for FaultException, check this article
A Beginner's Tutorial for Understanding Exception Handling, FaultExceptions and FaultContracts in WCF[^]
这篇关于Wcf服务给予恐怖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!