我在我的应用程序中使用 SOAP。在那我收到错误。
以下是我的请求的结构。
<Search xmlns="URL">
<authentication>
<LoginID>string</LoginID>
<Password>string</Password>
</authentication>
<ID>int</ID>
<iD>int</iD>
<dojStr>string</dojStr>
<Data>
<Keys>
<KPOfStringString>
<V>string</V>
<K>string</K>
</KPOfStringString>
<KPOfStringString>
<V>string</V>
<K>string</K>
</KPOfStringString>
</Keys>
<SortKeys>
<KPOfStringString>
<V>string</V>
<K>string</K>
</KPOfStringString>
<KPOfStringString>
<V>string</V>
<K>string</K>
</KPOfStringString>
</SortKeys>
<No>int</No>
<Size>int</Size>
</Data>
</Search>
</soap:Body>
以下是我为此设置输入的方式。这是正确的方式吗,因为我收到了一些错误。
PropertyInfo usrid =new PropertyInfo();
usrid.setName("LoginID");
usrid.setValue(userid);
usrid.setType(String.class);
request.addProperty(usrid);
PropertyInfo pass =new PropertyInfo();
pass.setName("Password");
pass.setValue(password);
pass.setType(String.class);
request.addProperty(pass);
PropertyInfo Id =new PropertyInfo();
sourceid.setName("ID");
sourceid.setValue(string value);
sourceid.setType(int.class);
request.addProperty(Id);
PropertyInfo id =new PropertyInfo();
destid.setName("id");
destid.setValue(string value);
destid.setType(int.class);
request.addProperty(id);
PropertyInfo dte =new PropertyInfo();
dte.setName("dojStr");
dte.setValue(date);
dte.setType(String.class);
request.addProperty(dte);
PropertyInfo page =new PropertyInfo();
page.setName("V");
page.setName("K");
page.setValue(null);
page.setType(String.class);
request.addProperty(page);
PropertyInfo no =new PropertyInfo();
pageno.setName("no");
pageno.setValue(1);
pageno.setType(int.class);
request.addProperty(no);
PropertyInfo size =new PropertyInfo();
pagesize.setName("size");
pagesize.setValue(10);
pagesize.setType(int.class);
request.addProperty(size);
它显示以下错误:
05-10 12:39:30.027: W/System.err(469): SoapFault - faultcode: 'soap:Server' faultstring: 'System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentNullException: Value cannot be null.
05-10 12:39:30.027: W/System.err(469): at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
05-10 12:39:30.027: W/System.err(469): at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)
05-10 12:39:30.027: W/System.err(469): at System.Int64.Parse(String s)
05-10 12:39:30.037: W/System.err(469):