Breadcrumbs

Return Format

Web Service Responses

The return structure of all calls to Web Services returns a string containing the data in JSON format.

View the example:

<?xml version="1.0" encoding="UTF-8"?>
<string xmlns="http://ws-ndd.uri/">{ "object1": 1, "object2": "teste" }</string>

As you can view above, the response consists solely of a string in JSON format.

Reading the return content

Reading the response is quite flexible because its structure is in JSON format.

As a suggestion, here is an example of how to convert this data to a DataTable object in C# language:

C#
    static class Program
    {
        static void Main()
        {
            Service.ServiceSoapClient webservice = new Service.ServiceSoapClient();
            
            try
            {
                string result = webservice.MethodName("param1", "param2", "param3", ...);
                DataTable dt = Newtonsoft.Json.JsonConvert.DeserializeObject<DataTable>(result);
            }
            catch (Exception ex)
            {
                string error = ex.Message;
            }
        }
    }