0
如何在Android設備中調用Navision Web服務中的過濾器以及如何獲取數據? 我已經使用WSDL & ksoap2調用了帶有NTML認證的Web服務,併成功獲取數據,但過濾器在應用時不起作用。在android中用於navision web服務的過濾
如何在Android設備中調用Navision Web服務中的過濾器以及如何獲取數據? 我已經使用WSDL & ksoap2調用了帶有NTML認證的Web服務,併成功獲取數據,但過濾器在應用時不起作用。在android中用於navision web服務的過濾
添加此TO THE其中方法被調用
VectorApp_Setup_Filter vfilter = new VectorApp_Setup_Filter();
App_Setup_Filter appsetupFilter1 = new App_Setup_Filter();
appsetupFilter1.field = App_Setup_Fields.Salesperson_Code;
Log.e("SALES CODE PASSING IN FILTER ", editStrOfflineUserId);
appsetupFilter1.criteria = editStrOfflineUserId;
App_Setup_Filter appsetupFilter2 = new App_Setup_Filter();
appsetupFilter2.field = App_Setup_Fields.Status;
appsetupFilter2.criteria = "Intrasit";
vfilter.add(appsetupFilter2);
vfilter.add(appsetupFilter1);
appsetup.ReadMultipleAsync(vfilter, null, 0);
READMULTIPLE異步方法
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
soapEnvelope.implicitTypes = true;
soapEnvelope.dotNet = true;
SoapObject soapReq = new SoapObject(
"urn:microsoft-dynamics-schemas/page/app_setup", "ReadMultiple");
for (int i = 0; i < filter.size(); i++) {
soapReq.addProperty("filter", getSOAPVectorAppsetup(filter, i));
}
soapReq.addProperty("bookmarkKey", bookmarkKey);
soapReq.addProperty("setSize", setSize);
soapEnvelope.setOutputSoapObject(soapReq);
方法的細節: - getSOAPVectorAppsetup();
private SoapObject getSOAPVectorAppsetup(VectorApp_Setup_Filter filter,
int position) {
SoapObject appsetup = new SoapObject(
"urn:microsoft-dynamics-schemas/page/app_setup", "anyType");
// for (int i = 0; i < filter.size(); i++) {
Log.e("Field", 0 + "" + filter.get(position).getProperty(0));
Log.e("Criteria", 0 + " " + filter.get(position).getProperty(1));
appsetup.addPropertyIfValue("Field", filter.get(position)
.getProperty(0));
appsetup.addPropertyIfValue("Criteria", filter.get(position)
.getProperty(1));
// }
return appsetup;
}
該解決方案適用於ME。
描述[這裏用xml示例](http://stackoverflow.com/questions/16542364/date-filter-in-microsoft-dynamics-nav-webservice)和[這裏](http://stackoverflow.com/問題/ 3423017 /動態 - 導航 - Navision的Web網頁,readmultiple最新的過濾器)。 –
我以前經歷過這些鏈接,問題出在Vector Object和soapObject之間。無論如何,我解決了這個問題。謝謝。 – OAEI
爲什麼不發佈解決方案呢? –