I am writing a web method in the web service where i am passing an arrayList as an input parameter. While consuming that web service in client application it is giving error.
WEB SERVICE:----------
[WebMethod(MessageName = "SetPatientRegistration", Description = "Insert PatientRegistration")]
public string SetPatientRegistrationInformation(ArrayList PatientInformaListObj)
{
string strReturn = string.Empty;
try
{
ICollection icolRegData = PatientInformaListObj;
RegistrationDataModel patRegDataModel = new RegistrationDataModel();
patRegDataModel = (RegistrationDataModel)icolRegData;
strReturn = PatRegObj.SetPatientRegistration(patRegDataModel);
}
catch (Exception ex)
{
log.Source = "Patientregistration:exception";
log.WriteEntry(ex.ToString());
}
return strReturn;
}
CLIENT APPLICATION : --------------------
protected void imgBtnRecord_Click(object sender, ImageClickEventArgs e)
{
string strMRNo;
RegistrationDataModel registration = null;
PatientRegistrationFacadeWcf patientRegistration = null;
try
{
registration = new RegistrationDataModel();
ArrayList regArryListObj = new ArrayList();
regArryListObj.Add(registration);
strMRNo = twoFieldObj.SetPatientRegistrationInformation(regArryListObj);
if ((Session["MRNO"].ToString() == "") && (txtMrNo.Text == "" ))
{
txtMrNo.Text = strMRNo.Trim();
lblMsg.Text = "Patient Registration Successful";
lblMsg.Text += "<br/> Patient Account No is " + strMRNo.Trim();
}
else
{
lblMsg.Text = "Patient Registration Successful";
}
}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "SuccessScript", "<script language='javascript'>alert('Update insurance details.');</script>");
}
}
catch (Exception ex)
{
log.Source = "Submit";
log.WriteEntry(ex.ToString());
lblMsg.Text = "Patient Registration Unsuccessful";
}
}
I will be thankful and appriciate any immediate help on this.