Android Question How to Call WebService

junaidahmed

Well-Known Member
Licensed User
Longtime User
I have created below webservice in .asmx format.but when i execute this service using "HttpJob",it returns as "Internal Server Error".Please check below code and advise how to do that...

WebService:-

[WebMethod(Description = "EmpDet")]
public DataSet GetEmpDetails(string StrEmpCode)
{
DataSet dataset = new DataSet();
dataset = Db.SetCommand("Select M.EmpName,D.deptname Department from Arind.Dbo.HrEmpMas M Join Arind.Dbo.Department D On D.DeptCode = M.deptcode Where (M.EmpCode = '" + StrEmpCode + "') And (M.OnRolls = 'Y') ").ExecuteDataSet();
Db.Close();
Db.Dispose();
return dataset;
}

Basic4Android:-

Dim job1 As HttpJob
job1.Initialize("Job1", Me)
job1.PostString("http://103.76.188.138:85/StageEntry/StageEntry.asmx/GetEmpDetails","StrEmpCode=4550")

Sub JobDone (Job As HttpJob)

Log("JobName = " & Job.JobName & ", Success = " & Job.Success)

If Job.Success = True Then

Msgbox(Job.GetString,"")
Log(Job.GetString)

Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
 

DonManfred

Expert
Licensed User
Longtime User
It is a SOAP request, right?
Yes

See http://103.76.188.138:85/StageEntry/StageEntry.asmx for more info about the endpoint.
 
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
In windows CE (Smart Device application), we can add web reference to call Web Service...

Is there any option for such kind in "Basic4Android" ???
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…