Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8762183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:27:53+00:00 2026-06-13T15:27:53+00:00

I built a web service in C# web application. I’m returning list of objects

  • 0

I built a web service in C# web application. I’m returning list of objects as a web service result. I need to know how to read that list of items one by one in a loop.

<?xml version="1.0" encoding="utf-8"?>  
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">  
  <soap:Body>  
    <checkAvailabilityResponse xmlns="http://tempuri.org/">  
      <checkAvailabilityResult>  
        <Shedule>  
          <Sid>int</Sid>  
          <Fid>int</Fid>  
          <FromLocation>string</FromLocation>  
          <FromTime>dateTime</FromTime>  
          <ToLocation>string</ToLocation>  
          <ToTime>dateTime</ToTime>  
          <PriceSeatA>double</PriceSeatA>  
          <PriceSeatB>double</PriceSeatB>  
          <PriceSeatC>double</PriceSeatC>  
        </Shedule>  
        <Shedule>  
          <Sid>int</Sid>  
          <Fid>int</Fid>  
          <FromLocation>string</FromLocation>  
          <FromTime>dateTime</FromTime>  
          <ToLocation>string</ToLocation>  
          <ToTime>dateTime</ToTime>  
          <PriceSeatA>double</PriceSeatA>  
          <PriceSeatB>double</PriceSeatB>  
          <PriceSeatC>double</PriceSeatC>  
        </Shedule>  
      </checkAvailabilityResult>  
    </checkAvailabilityResponse>  
  </soap:Body>  
</soap:Envelope>

This is the way I tried:

SriLankanWebService.Service1SoapClient air1 = new AgentPortal.SriLankanWebService.Service1SoapClient();  
                List<Shedule> air1Response = (List<Shedule>)air1.checkAvailability(drpFrom.SelectedValue.ToString(), drpTo.SelectedValue.ToString(), DateTime.Parse(txtDepartOn.Text));

When I tried it says:

Error   1   Cannot implicitly convert type 'AgentPortal.SriLankanWebService.Shedule[]' to 'System.Collections.Generic.List<AgentPortal.Shedule>'    D:\DCBSD\AgentPortal\AgentPortal\Home.aspx.cs   32  46  AgentPortal

I need to use it in a loop.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T15:27:54+00:00Added an answer on June 13, 2026 at 3:27 pm

    Please update your code in last line from above code from:

     List<Shedule> air1Response = (List<Shedule>)air1.checkAvailability(drpFrom.SelectedValue.ToString(), drpTo.SelectedValue.ToString(), DateTime.Parse(txtDepartOn.Text));

    to

    AgentPortal.SriLankanWebService.Shedule[] = air1.checkAvailability(drpFrom.SelectedValue.ToString(), drpTo.SelectedValue.ToString(), DateTime.Parse(txtDepartOn.Text));

    That will fix the issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application built that hits a third party company's web service in
I have a custom built web service that is built to simply add items
I have a web service built for SharePoint 2007 that I am trying to
I'm trying to add SAML assertions to a SOAP web service that is built
Currently we have web-services built up so that everyone (with valid service account) can
I have a web service application built using NodeJS. I am using mongodb as
I have a web service (built using jaxb/jaxws) that invokes a stateless EJB to
I have built a WCF REST web service (WCF Service Application) and when I
I have built a C# .net web service that takes a complex type as
I have a web-service application that exposes lot of web-methods ( internally calling internal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.