Consuming Web Service from SAP using SOAP

csampaio01csampaio01 PTMember ✭✭✭
edited April 2017 in Xamarin.Forms

Hi, im trying to get data from a WebService from SAP.

It give me the error: NameResolutionFailure. Can you help me, please?

`public class SoapService : ISoapService
{
srv.Listar todoService;

    public List<Material> Items { get; private set; }

    public SoapService()
    {

        todoService = new srv.listar { PC= "P1" };
    }

    srv.PC ToASMXServiceTodoItem(Material item)
    {
        return new srv.PC
        {
            Matnr = item.material
        };
    }

    static Material FromASMXServiceTodoItem(srv.PC item)
    {
        return new Material
        {
            material = item.Matnr
        };
    }

    public List<Material> Lista()
    {
        Items = new List<Material>();

        try
        {
            var todoItems = srv.ListPCS;

            foreach (var item in todoItems)
            {
                Items.Add(FromASMXServiceTodoItem(item));
            }
        }
        catch (Exception ex)
        {
            Debug.WriteLine(@"              ERROR {0}", ex.Message);
        }

        return Items;
    }


}`
Sign In or Register to comment.