Ksoapパーサーを使用して石鹸解析中にサーバーからの応答が得られました。オブジェクト属性から特定の値を取得したい。私はmagentoのメソッドcatalogCategoryInfoを使用していますが、現在はchildrenプロパティを個別に取得したいと考えています。サーバーから来ているsoapobjectから値を取得する方法
ここで私はcatalogCategoryInfoを取得しています:
request = new SoapObject(NAMESPACE, "catalogCategoryInfo");
request.addProperty("sessionId",sessionId);
request.addProperty("categoryId","2");
env.setOutputSoapObject(request);
androidHttpTransport.call("", env);
result = (JSONObject)env.getResponse();
System.out.println("%%%%%%%%%%%%%%"+result);
と出力されています。今、私は唯一のchildren=400,402,404,405,406,512,527;
プロパティを取得したい
catalogCategoryInfo{category_id=2; is_active=1; position=1; level=1; parent_id=1; all_children=2,400,407,408,410,402,411,420,421,422,424,425,426,428,430,431,432,433,474,475,526,404,429,444,445,446,447,448,449,450,451,453,454,455,456,457,458,459,460,461,405,465,466,467,468,406,476,478,479,480,481,512,513,514,516,517,518,519,520,521,522,523,524,525,527,528,533,535,537,539,540,544; children=400,402,404,405,406,512,527; created_at=2016-02-04 05:39:36; updated_at=2016-02-06 07:28:28; name=Default Category; url_key=default-category; path=1/2; url_path=/default-category; children_count=71; display_mode=PRODUCTS; is_anchor=0; available_sort_by=ArrayOfString{}; default_sort_by=position; }
。
私はJSONObjectに親オブジェクトを取得するコードを求めていますので、あなたは私にコードを送信してくださいすることができます。..ここ –