问题描述
这是原始请求:
我需要在设置请求对象的值之后调用方法InitSessionRq
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:fimi="http://schemas.compassplus.com/two/1.0/fimi.xsd" xmlns:fimi1="http://schemas.compassplus.com/two/1.0/fimi_types.xsd">
<soap:Header/>
<soap:Body>
<fimi:InitSessionRq>
<fimi:Request Ver="xx.xx" Product="FIMI" Clerk="xxxxx" >
<!--You may enter the following 4 items in any order-->
<!--Optional:-->
<fimi1:NeedDicts>0</fimi1:NeedDicts>
</fimi:Request>
</fimi:InitSessionRq>
</soap:Body>
</soap:Envelope>
当我序列化调用Request方法时使用的对象时,即使我们使用c#代码发送该对象,我也看到该对象没有NeedDicts属性:
<?xml version="1.0" encoding="utf-16"?>
<InitSessionRq1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Request Ver="16.00" Product="FIMI" Comment="Test" Clerk="ALXBV" xmlns="http://schemas.compassplus.com/two/1.0/fimi.xsd" />
</InitSessionRq1>
我的C#代码:通过wsdl调用NiService添加Webrefrence之后,我们从InitSessionRq类型创建对象并将值设置为此对象属性,然后将对象从InitSessionRp1类型分配给另一个对象,然后调用方法名称InitSessionRq为什么有些属性没有发送,即使我们已设置
NiService.fimi fimiobj = new NiService.fimi();
NiService.InitSessionRq Req_prepare = new NiService.InitSessionRq();
NiService.InitSessionRq1 Req = new NiService.InitSessionRq1();
NiService.InitSessionRp1 Res = new NiService.InitSessionRp1();
Decimal Ver = Convert.ToDecimal(System.Configuration.ConfigurationManager.AppSettings["Ver"]);
string Clerk = System.Configuration.ConfigurationManager.AppSettings["Clerk"];
Req_prepare.Ver = Ver;
Req_prepare.Product = "FIMI";
Req_prepare.Clerk = Clerk;
Req_prepare.Comment = "Test";
Req_prepare.NeedDicts = 0;
Req.Request = Req_prepare;
Serializer ser = new Serializer();
LogUtil.Debug("InitSessionReq1 req Object||" +
ser.Serialize(Req));
Res = fimiobj.InitSessionRq(Req);
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)