Silverlight应用程序运行时部署Silverlight应用程序异常,但,当它调用服务,我得到:调用WCF服务
在操作过程中出现的异常,使结果无效。检查异常详情的InnerException。 在System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() 在SalesSimplicityPO_SL.POSvc.GetPurchaseOrdersCompletedEventArgs.get_Result() 在SalesSimplicityPO_SL.About.mySvc_GetPurchaseOrdersCompleted(对象发件人,GetPurchaseOrdersCompletedEventArgs E) 在SalesSimplicityPO_SL.POSvc.POSvcClient.OnGetPurchaseOrdersCompleted(对象状态)
我加载并调用我的web服务如..
BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new EndpointAddress(new Uri("http://localhost/POSystem/POSvc.svc"));
POSvc.POSvcClient mySvc = new POSvc.POSvcClient(binding, address);
mySvc.InsertPOCompleted += new EventHandler<SalesSimplicityPO_SL.POSvc.InsertPOCompletedEventArgs>(mySvc_InsertPOCompleted);
mySvc.InsertPOAsync(InitialsTextBox.Text.ToString(), DescTextBox.Text.ToString(), ClientTextBox.Text.ToString());
工程在调试伟大....
我做错了什么,得到这个错误?
更新:
我真的不明白为什么它固定,但这个固定..也许有人可以提供一些信息...
我改变
EndpointAddress address = new EndpointAddress(new Uri("http://localhost/POSystem/POSvc.svc"));
TO
EndpointAddress address = new EndpointAddress(new Uri(Application.Current.Host.Source, "../POSvc.svc"));
您是否检查异常详情的InnerException? – SLaks 2010-03-25 22:31:40
哈哈,除非是一个白痴(这是可能的...),这是内部的异常是在那里..它开始于System.ComponentModel.AsyncCompletedEventArgs .... – Rico 2010-03-25 22:42:35
这是外部异常,这是在'错误' EventArgs的属性。检查'e.Error.InnerException'。 – SLaks 2010-03-25 23:51:08