Reputation: 275
I'm a new in c# and very beginner,need to call this web service in c# windows application:
http://192.168.200.102:8086/ws_bills.asmx
for that purpose i right click on the solution explorer and add web service with behzadService
name and try write code for call that:
behzadService.WS_Bills beh = new behzadService.WS_Bills();
But i want call this url with that code:
How can i write c# code for send UserName,Password,TelNo,Cycle
?
And my other question that web service return me this:
How can i parse TelNo,CurrBill,TotalBill
with that call?
Please write code.
that web service result is this:
Upvotes: 2
Views: 1951
Reputation: 440
I wrote web service return table
behzadService.WS_Bills beh = new behzadService.WS_Bills();
DataSet dsResult = beh.GetBills("Username", "Password", "12565855555", "A");
DataTable dtResult = dsResult.Tables[0];
foreach (DataRow row in dtResult.Rows)
{
long telNo = Convert.ToInt64(row["Telno"]);
decimal curBill = Convert.ToDecimal(row["CurBill"]);
decimal totalBill = Convert.ToDecimal(row["TotalBill"]);
}
Upvotes: 1
Reputation: 440
I wrote parse result.
behzadService.WS_Bills beh = new behzadService.WS_Bills();
var result = beh.GetBills("Username","Password","0012565855555","A");
long telNo = Convert.ToInt64(result.Telno,0);
decimal curBill = Convert.ToDecimal(result.CurBill,0);
decimal totalBill= Convert.ToDecimal(result.TotalBill,0);
Upvotes: 0
Reputation: 1607
you can call webservice by calling GetBills
function
behzadService.WS_Bills beh = new behzadService.WS_Bills();
var result = beh.GetBills("Shahzad","1233","021344444444","any value");
after that check what result will come in result. and let me know
Upvotes: 0