Answered by:
Urgent, What is this msg from consuming Web Service

Question
-
I consume a web service from Dynamics Navision and I got below error msg :
An exception of type 'System.AggregateException' occurred in mscorlib.dll but was not handled in user code
Additional information: One or more errors occurred.
If there is a handler for this exception, the program may be safely continued.
Monday, September 23, 2013 6:08 AM
Answers
-
1) Start your app under the debugger
2) When the exception occurs, break into the app
3) Put a watch on the exception so you can look into it and see all of the exceptions
You are getting multiple exceptions returned from the WebService, and you need to inspect them so you can fix the request and get a proper response.
Matt Small - Microsoft Escalation Engineer - Forum Moderator
If my reply answers your question, please mark this post as answered.
NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.- Marked as answer by Jamles HezModerator Friday, September 27, 2013 6:55 AM
Wednesday, September 25, 2013 3:04 PMModerator
All replies
-
'System.AggregateException is a wrapper that contains one or more exceptions in it. You will need to look in that for the ral exception that occured.
Microsoft Certified Solutions Developer - Windows Store Apps Using C#
Monday, September 23, 2013 7:49 AM -
I am consume a Web service from Dynamics Navision:
1. Class1 Contains all the code which has no compilation error.
2. This WinRT App contains the required services reference.
I just wanted to test to get a record from Dynamics Navision with below code :
private async void btnImportCustomer_Click(object sender, RoutedEventArgs e)
{Task<wsCustomerList.Customer_List> _asyncCustomer = Class1.Customer.Listing.GetAsyncRecords("Y007");
--- error encountered here :
string g_strmsg = _asyncCustomer.Result.No + " " +_asyncCustomer.Result.Name;}
is handling Task <wsCustomerList.Customer_List> correct ?
is this handling ok ? : string g_strmsg = _asyncCustomer.Result.No + " " +_asyncCustomer.Result.Name;
Thanks
Monday, September 23, 2013 8:33 AM -
private async void btnImportCustomer_Click(object sender, RoutedEventArgs e) { try { wsCustomerList.Customer_List _asyncCustomer = await Class1.Customer.Listing.GetAsyncRecords("Y007"); --- error encountered here : string g_strmsg = _asyncCustomer.No + " " +_asyncCustomer.Name; } (Exception e) { // exception } }
try this, i think there will be still an exception but will give you better idea from the exception
Microsoft Certified Solutions Developer - Windows Store Apps Using C#
Monday, September 23, 2013 1:22 PM -
I used the try-catch but the error message is not much of help; the msg is: one or more errors occur.
I wanted to know how to get content out from task<> as follows:
is handling Task <wsCustomerList.Customer_List> correct ?
is this handling ok ? : string g_strmsg = _asyncCustomer.Result.No + " " +_asyncCustomer.Result.Name;
Thanks
Tuesday, September 24, 2013 3:34 AM -
1) Start your app under the debugger
2) When the exception occurs, break into the app
3) Put a watch on the exception so you can look into it and see all of the exceptions
You are getting multiple exceptions returned from the WebService, and you need to inspect them so you can fix the request and get a proper response.
Matt Small - Microsoft Escalation Engineer - Forum Moderator
If my reply answers your question, please mark this post as answered.
NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.- Marked as answer by Jamles HezModerator Friday, September 27, 2013 6:55 AM
Wednesday, September 25, 2013 3:04 PMModerator