我在Windows应用程序中使用了Web服务,当传递请求以获取响应时出现错误。
我已使用WSE 2.0传递凭据。
public string GetResponse(string sPersonnelAreaCode, string sCompanyCode)
{
try
{
WebReference.RIL_STAR_HCM_QueryEmployeeDetails_serviceagent objService1 = new WebReference.RIL_STAR_HCM_QueryEmployeeDetails_serviceagent();
WebReference.fetchEmployeeListRequestEmployeeList[] objReqs = new WebReference.fetchEmployeeListRequestEmployeeList[1];
WebReference.fetchEmployeeListRequestEmployeeList objReq1 = new WebReference.fetchEmployeeListRequestEmployeeList();
WebReference.fetchEmployeeListResponseEmployeeList[] objResponse = new WebReference.fetchEmployeeListResponseEmployeeList[0];
DataSet dsresult = new DataSet();
objReq1.PersonnelAreaCode = sPersonnelAreaCode;
objReq1.CompanyCode = sCompanyCode.ToString();
UsernameToken token = new UsernameToken("***", "***", PasswordOption.SendPlainText);
objService1.RequestSoapContext.Security.Tokens.Add(token);
objReqs[0] = objReq1;
//In the below line getting that error
objResponse = objService1.fetchEmployeeList(objReqs);
}
}
有人可以帮助我吗?
答案 0 :(得分:2)
答案 1 :(得分:1)
当报表服务器路径不正确时,通常会出现此类错误。仔细检查ReportServerUrl