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