Convert SOAP multiref to java Object -
may please me transform following soap request data java collection, have tried not getting expected result. may see reference below in second part have transformed java soap request.
<multiref id="id1" soapenc:root="0" soapenv:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:map" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <item> <key xsi:type="soapenc:string">orderincrementid</key> <value xsi:type="soapenc:string">ord-4426</value> </item> <multiref href="#id3"/> </multiref> <multiref id="id3" soapenc:root="0" soapenv:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:map" xmlns:ns3="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <item> <key xsi:type="soapenc:string">order_item_id</key> <value xsi:type="soapenc:string">1229</value> </item> <item> <key xsi:type="soapenc:string">qty</key> <value xsi:type="soapenc:string">1</value> </item> </multiref>
the following xml generated java stated below.
map<string, string> header = new hashmap<string, string>(); header.put("orderincrementid", "ord-4426"); map<string, string> detail_1= new hashmap<string, string>(); details.put("order_item_id", "1229"); details.put("qty", "1"); list<map<string,string>> details = new arraylist<map<string,string>>(); details.add(detail_1); list<object> finallist = new arraylist<objec>(); finallist.add(header); finallist.add(details); <multiref id="id0" soapenc:root="0" soapenv:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" soapenc:arraytype="xsd:anytype[2]" xsi:type="soapenc:array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <multiref href="#id1"/> <multiref href="#id2"/> </multiref> <multiref id="id2" soapenc:root="0" soapenv:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" soapenc:arraytype="xsd:anytype[1]" xsi:type="soapenc:array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <multiref href="#id3"/> </multiref> <multiref id="id1" soapenc:root="0" soapenv:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:map" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <item> <key xsi:type="soapenc:string">orderincrementid</key> <value xsi:type="soapenc:string">ord-4426</value> </item> </multiref> <multiref id="id3" soapenc:root="0" soapenv:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:map" xmlns:ns3="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <item> <key xsi:type="soapenc:string">order_item_id</key> <value xsi:type="soapenc:string">1229</value> </item> <item> <key xsi:type="soapenc:string">qty</key> <value xsi:type="soapenc:string">1</value> </item> </multiref>
i don't think straight answers available issue.
can try jaxb (since multi ref xml). should able convert java objects , there can extract objects whichever required.
Comments
Post a Comment