12,162
社区成员
发帖
与我相关
我的任务
分享
//获取webservies数据
public DataSet GetBudgetApplicationForm()
{
LogManager.GetCurrentClassLogger().Info("进入Webservies001:");
ControllerQueryPlanServiceImplClient cqpsic = new ControllerQueryPlanServiceImplClient();
LogManager.GetCurrentClassLogger().Info("进入Webservies002:" + cqpsic);
soapHeader header = new soapHeader();
header.password = "httest";
header.username = "httest";
header.appcode = "CONTROLLER_1";
header.type = 1;
string rs = cqpsic.queryPlanData(header, "FJJLTZYSSQ", string.Empty);
//int fIndex = rs.IndexOf("[{");
//int eIndex = rs.IndexOf("}]");
//rs = rs.Substring(fIndex, eIndex - fIndex + 2);
//DataTable dt = JsonHelper.ToDataTable(rs);
//DataSet ds = new DataSet();
//ds.Tables.Add(dt);
LogManager.GetCurrentClassLogger().Info("获取数据库总数:" + rs);
return null;
}
[code=csharp]
//调用方法
DataOperate dal = new DataOperate();
dal.GetBudgetApplicationForm();
//配置文件
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="qpPortBinding" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://10.201.20.72:7006/IntelCubeController/service/conQueryPlanService"
binding="basicHttpBinding" bindingConfiguration="qpPortBinding"
contract="QueryPlanData.ControllerQueryPlanServiceImpl" name="qpPort" />
</client>
</system.serviceModel>
</configuration>
//错误信息
DataOperate.GetBudgetApplicationForm => LoggerImpl.Write|进入Webservies212323:
2016-09-13 11:52:09|Info|BusinessDataManager.ExceValiDate => BeforeSaveValation_303.ExecuteValidate =>
LoggerImpl.Write|在 ServiceModel 客户端配置部分中,找不到引用协定“QueryPlanData.ControllerQueryPlanServiceImpl”的
默认终结点元素。这可能是因为未找到应用程序的配置文件,或者是因为客户端元素中找不到与此协定匹配的终结点元素。