locked
web service return complextype class RRS feed

  • Question

  • User-1273761860 posted

    hi, i have the web service that return a class Dto

    the name of the service is GetDto

    and the element of the class that return are Id and name.

    someone can help me to learn how to manage a return class from web service?

    thanks

    Tuesday, June 26, 2012 6:55 AM

Answers

  • User370135452 posted

    You have to define the same class with same definiton and members in your project where you invoke web service. So that you can read the return data into an object of the above class.

    In place of web method invokation mention the return data type as the above class.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 26, 2012 8:17 AM
  • User-1273761860 posted

    hi hanks i have resolved

     

    Dim consumeWebService As it.domain.subdomain.ServiceGate
     consumeWebService = New it.domain.subdomain.ServiceGate
     Dim b As it.domain.subdomain.Dto
     b = consumeWebService.getdati(Id)

    but now i have anothe problem...

    if i have an array of classes how can i write the code?

    i don't know how to manage an array of classes.. can i manage an array of classes with dataset?

    Thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 26, 2012 1:04 PM
  • User370135452 posted

    I really dont know how you do it in vb.net. But find the c# code below to read array of objects

    it.domain.subdomain.Dto[] arrayOfObjects = consumerWebService.GeData();


    Please mark as answer if helpful

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 26, 2012 1:35 PM
  • User-1273761860 posted

    and then if i want to populate a gridview with this date? thanks

    p.s

    i have found the code

    Dim consumeWebService As it.domain.subdomain.ServicePaymentGateway
                consumeWebService = New it.domain.subdomain.ServiceGate
                Dim az() As it.domain.subdomain.Dto
                
                az = consumeWebService.getDate(Id)
                'Label13.Text = az(0).field_id

    but know the problem remain.. how can i populate a gridview or i don't know.. i must to create a table with the date...

    thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 26, 2012 1:40 PM
  • User-1273761860 posted

    I have resolved my problem.

    write:

    GridViewFatture.DataSource = az
    GridViewFatture.DataBind()

    and all function

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 26, 2012 3:16 PM

All replies

  • User370135452 posted

    You have to define the same class with same definiton and members in your project where you invoke web service. So that you can read the return data into an object of the above class.

    In place of web method invokation mention the return data type as the above class.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 26, 2012 8:17 AM
  • User-1273761860 posted

    hi hanks i have resolved

     

    Dim consumeWebService As it.domain.subdomain.ServiceGate
     consumeWebService = New it.domain.subdomain.ServiceGate
     Dim b As it.domain.subdomain.Dto
     b = consumeWebService.getdati(Id)

    but now i have anothe problem...

    if i have an array of classes how can i write the code?

    i don't know how to manage an array of classes.. can i manage an array of classes with dataset?

    Thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 26, 2012 1:04 PM
  • User370135452 posted

    I really dont know how you do it in vb.net. But find the c# code below to read array of objects

    it.domain.subdomain.Dto[] arrayOfObjects = consumerWebService.GeData();


    Please mark as answer if helpful

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 26, 2012 1:35 PM
  • User-1273761860 posted

    and then if i want to populate a gridview with this date? thanks

    p.s

    i have found the code

    Dim consumeWebService As it.domain.subdomain.ServicePaymentGateway
                consumeWebService = New it.domain.subdomain.ServiceGate
                Dim az() As it.domain.subdomain.Dto
                
                az = consumeWebService.getDate(Id)
                'Label13.Text = az(0).field_id

    but know the problem remain.. how can i populate a gridview or i don't know.. i must to create a table with the date...

    thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 26, 2012 1:40 PM
  • User-1273761860 posted

    I have resolved my problem.

    write:

    GridViewFatture.DataSource = az
    GridViewFatture.DataBind()

    and all function

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 26, 2012 3:16 PM