大家好,我从 web 服务解析 Soaobject xml,然后 xml 标签不为空,一切正常,但它们是空的示例“ <barcode></barcode>
”它生成字符串-anyType{}。并将其显示在我的列表中!:( 我应该怎么做才能从列表中删除这个词“anyType{}”并且它什么也没显示或我写的东西?信封.implicitTypes = false; --->这不起作用....仍然得到anyType{} ...这是我的代码:
String[] xmlElements={"Id","name","Unit","Cost","description","barcode"};
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
androidHttpTransport.call(SOAP_ACTION, envelope);
ArrayList<HashMap<String, String>> Tags = new ArrayList<HashMap<String, String>>();
if ( xmlelements==null&& KEY_RAKTINIS==null){
Object soapObj = (SoapObject)envelope.getResponse();
soapObj = ((SoapObject) soapObj).getProperty(KEY_PATVIRTINIMAS);
Toast.makeText(getActivity().getBaseContext(), soapObj.toString(), Toast.LENGTH_SHORT).show();
}else {
SoapObject soapObj = (SoapObject)envelope.getResponse();
soapObj = (SoapObject) soapObj.getProperty(KEY_RAKTINIS);// su situo ieinu i butent customers punkta
for (int j = 0; j < soapObj.getPropertyCount(); j++) {
SoapObject soapObjMenu = (SoapObject) soapObj.getProperty(j);
for (int i = 0; i <1; i++) {
HashMap<String, String> map = new HashMap<String, String>();
for( i=0; i < xmlelements.length;i++){
if (soapObjMenu.getProperty(xmlelements[i])!="") {
map.put(xmlelements[i], (soapObjMenu.getProperty(xmlelements[i]).toString()));
Log.v(xmlelements[i], "sitas");}
}
Tags.add(map);
}}
<Items>
<Item>
<Id>1000</Id>
<name>LCD Television HD Black 42 inches</name>
<Unit>ea</Unit>
<Cost>2000.00</Cost>
<description>Simple SKU</description>
<barcode></barcode>
</Item>
<Item>
<Id>1001</Id>
<name>LCD Television Model 01</name>
<Unit>ea</Unit>
<Cost>4015.00</Cost>
<description></description>
<barcode></barcode>
</Item>
<Item>
<Id>1003</Id>
<name>Plasma Television Model 01</name>
<Unit>ea</Unit>
<Cost>4020.00</Cost>
<description></description>
<barcode></barcode>
</Item>
`