Hi,
I am exchanging document using HTTP adapter. So I consumed this services in visual studio and wrote below code:
static void Main(string[] args)
{// Create the sales order objects
// Service client
ServiceReference1.SalesOrderServiceClient cl = new ServiceReference1.SalesOrderServiceClient();
// Sales order object to receive response
Test.ServiceReference1.AxdEntity_SalesTable[] resp;
// Create the entity key list for the request
ServiceReference1.EntityKey[] readRespKeys = new ServiceReference1.EntityKey[1];
readRespKeys[0] = new ServiceReference1.EntityKey();
readRespKeys[0].KeyData = new ServiceReference1.KeyField[1];
readRespKeys[0].KeyData[0] = new ServiceReference1.KeyField();
readRespKeys[0].KeyData[0].Field = "SalesId";
// Ask the user for a sales order ID
Console.WriteLine("Enter the sales order ID:");
// Add the result to the entity key value
readRespKeys[0].KeyData[0].Value = Console.ReadLine();
try
{
// Try to read the sales order
resp = cl.read(null, readRespKeys);
// Display the information from the first sales table
Console.WriteLine("For sales order: " + resp[0]);
Console.ReadKey();
// Console.WriteLine("Customer Account is: " + resp.SalesTable[0].CustAccount);
}
catch (Exception e)
{
Console.WriteLine("Exception: " + e.Message);
cl.Abort();
}
cl.Close();
But this is working as excepted so i used debugger to see whats happening and it throw an exception , please see below:
\
please suggest me the solution.
*This post is locked for comments
I have the same question (0)