Consume web service returning list

Arti

I have a web service with webmethod like this:

Webservice:

   [WebMethod]
    public List<ProcessQueue> GetTasks(int ShopId)
    {
        List<ProcessQueue> p = new List<ProcessQueue>();
        p.Add(new ProcessQueue {shopId="shop1", process="process1"});
        p.Add(new ProcessQueue {shopId="shop2", process="process2"});   
        return p;
    }


    public class ProcessQueue
    {
        public string shopId { get; set; }
        public string process { get; set; }
    }

I also have a windows form application which is consuming the web service:

I followed the steps described in Consume a web service

Windows form:

using (var svc = new Service1SoapClient())
{
    var result = svc.GetTasks(7);
    MessageBox.Show(result.ToString());
}

Right now I am able to consume the web service but only problem I am facing is I cannot get the result as a string in my windows form application.

How would I do that. Any help?

Arti

I managed to get the desired result by doing this in winform application:

using (var svc = new Service1SoapClient())
{
   var result = svc.GetTasks(7);
   List<ProcessQueue> Processqueue=result.ToList<ProcessQueue>();
   foreach (ProcessQueue process in Processqueue)
   {
      MessageBox.Show(process.shopId);
   }
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

web service not returning a serialized list

From Dev

Unable to consume web service

From Dev

Trying to consume Web Service class

From Dev

consume rest web service in TextBlocks

From Dev

Creating ABL Client to Consume a REST Web Service

From Dev

Consume .NET web service in Codename One

From Dev

Consume a simple web service using mule

From Dev

Consume SOAP based web service with https

From Dev

How to consume a JSON web service in Java

From Dev

Consume multiple resources in a RESTful Web Service

From Dev

AngularJS: consume web service from Wikipedia API

From Dev

How to consume Rest Web service in c#

From Dev

To consume a web service with multiple input arguments in mule

From Dev

How to consume a rest web service in phonegap for android?

From Dev

consume SOAP local web service in android

From Dev

how to consume the json web service in objective c?

From Dev

How to consume a web service with headers C #?

From Dev

How to Consume an RPC-Style Web Service with a WCF Service Reference?

From Dev

Create and consume web service on local machine by using WAMP

From Dev

Bypass SSL when I'm using SUDS for consume web service

From Dev

How to consume third party https wsdl web service in c#

From Dev

Trying to consume a C# web service in VB.NET

From Dev

how to consume a Restful Web Service (Restful API) in Java

From Dev

c# - Consume soap web service with Xamarin.droid

From Dev

How to consume wsdl web service by using a certificate in Windows Phone 8?

From Dev

How do I consume this xml web service in c#?

From Dev

how to consume web service from desktop c# app?

From Dev

How to consume a .net web service from a remote server with javascript

From Dev

Spring consume rest json web-service error

Related Related

  1. 1

    web service not returning a serialized list

  2. 2

    Unable to consume web service

  3. 3

    Trying to consume Web Service class

  4. 4

    consume rest web service in TextBlocks

  5. 5

    Creating ABL Client to Consume a REST Web Service

  6. 6

    Consume .NET web service in Codename One

  7. 7

    Consume a simple web service using mule

  8. 8

    Consume SOAP based web service with https

  9. 9

    How to consume a JSON web service in Java

  10. 10

    Consume multiple resources in a RESTful Web Service

  11. 11

    AngularJS: consume web service from Wikipedia API

  12. 12

    How to consume Rest Web service in c#

  13. 13

    To consume a web service with multiple input arguments in mule

  14. 14

    How to consume a rest web service in phonegap for android?

  15. 15

    consume SOAP local web service in android

  16. 16

    how to consume the json web service in objective c?

  17. 17

    How to consume a web service with headers C #?

  18. 18

    How to Consume an RPC-Style Web Service with a WCF Service Reference?

  19. 19

    Create and consume web service on local machine by using WAMP

  20. 20

    Bypass SSL when I'm using SUDS for consume web service

  21. 21

    How to consume third party https wsdl web service in c#

  22. 22

    Trying to consume a C# web service in VB.NET

  23. 23

    how to consume a Restful Web Service (Restful API) in Java

  24. 24

    c# - Consume soap web service with Xamarin.droid

  25. 25

    How to consume wsdl web service by using a certificate in Windows Phone 8?

  26. 26

    How do I consume this xml web service in c#?

  27. 27

    how to consume web service from desktop c# app?

  28. 28

    How to consume a .net web service from a remote server with javascript

  29. 29

    Spring consume rest json web-service error

HotTag

Archive