ASP.NET - Webservice Bring output - Asked By Jahir on 04-May-12 04:01 AM

See This is my .aspx full page code:

using System.Xml.Linq;

using System.ServiceModel;

using System.Data.SqlClient;

using ServiceReference1;

using System.Collections.Generic;

public partial class _Default : System.Web.UI.Page


protected void Button1_Click(object sender, EventArgs e)


using (ServiceReference1.TGTravelServiceClient client = new ServiceReference1.TGTravelServiceClient())


Station station = client.getStationList("", "samerafi");

StationDTO dto = new StationDTO();

dto.stationId = "1";

dto.stationName = "Name";

station.stationList = new StationDTO[] { dto };

GridView1.DataSource = new List<StationDTO> { station.stationList[0] };




i have add service reference like this... right click solution explorer and select add service reference and put this url  in that and give ok, addreference name is: Servicereference1, and i put namespace is using ServiceReference1;

in default.aspx design page i put 3textbox fromplace toplace and date and 1gridview... in search button i write code like this...

but the output is displaying Staion name name and station id 1 in gridview ? but i want fetch from this website and retrieve data to my gridview...

Sreekumar P replied to Jahir on 06-May-12 12:57 PM

I don't think you can do something like that.

A  webservice is same like a Webpage, that is it can be accessed using a fixed URL.

in ur case the Vendor is hosted webservice only in this URL.

not in

so u can't do that.

please mark helpful if it seems to be that
Sreekumar P