java - How to consume a SOAP WS from BPM with ArrayOfNameValuePair? -
everytime im getting empty response port.op()
don´t know how read items of arrayofnamevaluepair
my java function
private static arrayofnamevaluepair op() { pocodm.obtenerprovincia.obtenerprovincia service = new pocodm.obtenerprovincia.obtenerprovincia(); pocodm.obtenerprovincia.obtenerprovinciaporttype port = service.getobtenerprovinciasoap(); return port.op(); }
envelop
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:obt="http://pocodm/obtenerprovincia.tws"> <soapenv:header/> <soapenv:body> <obt:op/> </soapenv:body> </soapenv:envelope>
response
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:body> <opresponse xmlns="http://pocodm/obtenerprovincia.tws"> <results> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">azuay</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">01</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">bolivar</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">02</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">carchi</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">04</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">caÑar</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">03</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">chimborazo</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">06</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">cotopaxi</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">05</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">el oro</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">07</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">esmeraldas</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">08</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">galapagos</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">20</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">guayas</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">09</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">imbabura</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">10</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">loja</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">11</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">los rios</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">12</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">manabi</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">13</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">morona santiago</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">14</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">napo</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">15</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">orellana</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">22</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">pastaza</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">16</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">pichincha</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">17</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">santa elena</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">24</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">santo domingo de los tsachilas</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">23</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">sucumbios</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">21</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">tungurahua</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">18</ns0:value> </item> <item> <ns0:name xmlns:ns0="http://ectest556ws1:9081/schema/">zamora chinchipe</ns0:name> <ns0:value xmlns:ns0="http://ectest556ws1:9081/schema/">19</ns0:value> </item> </results> </opresponse> </soapenv:body> </soapenv:envelope>
definition
<?xml version="1.0" encoding="utf-8"?> <wsdl:definitions targetnamespace="http://pocodm/obtenerciudad.tws" xmlns:impl="http://pocodm/obtenerciudad.tws" xmlns:impl1="http://ectest556ws1:9081/schema/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:intf="http://pocodm/obtenerciudad.tws" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"> <wsdl:types> <schema attributeformdefault="unqualified" elementformdefault="qualified" targetnamespace="http://pocodm/obtenerciudad.tws" xmlns="http://www.w3.org/2001/xmlschema"> <import namespace="http://ectest556ws1:9081/schema/"/> <element name="op"> <complextype> <sequence> <element name="text" type="xsd:string"/> </sequence> </complextype> </element> <element name="opresponse"> <complextype> <sequence> <element name="results" type="impl1:arrayof_namevaluepair"/> </sequence> </complextype> </element> </schema> <schema attributeformdefault="unqualified" elementformdefault="qualified" targetnamespace="http://ectest556ws1:9081/schema/" xmlns="http://www.w3.org/2001/xmlschema" xmlns:impl="http://pocodm/obtenerciudad.tws" xmlns:impl1="http://ectest556ws1:9081/schema/" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <import namespace="http://pocodm/obtenerciudad.tws"> <!--add uri of schema document imported namespace using 'schemalocation' attribute.--> </import> <complextype name="namevaluepair"> <sequence> <element maxoccurs="1" minoccurs="0" name="name" nillable="false" type="xsd:string"/> <element maxoccurs="1" minoccurs="0" name="value" nillable="false" type="xsd:string"/> </sequence> </complextype> <complextype name="arrayof_namevaluepair"> <sequence> <element maxoccurs="unbounded" minoccurs="0" name="item" nillable="true" type="impl1:namevaluepair"/> </sequence> </complextype> <complextype name="arrayof_string"> <sequence> <element maxoccurs="unbounded" minoccurs="0" name="item" nillable="true" type="xsd:string"/> </sequence> </complextype> </schema> </wsdl:types> <wsdl:message name="opresponse"> <wsdl:part name="parameters" element="impl:opresponse"> </wsdl:part> </wsdl:message> <wsdl:message name="oprequest"> <wsdl:part name="parameters" element="impl:op"> </wsdl:part> </wsdl:message> <wsdl:porttype name="obtenerciudadporttype"> <wsdl:operation name="op"> <wsdl:input name="oprequest" message="impl:oprequest"> </wsdl:input> <wsdl:output name="opresponse" message="impl:opresponse"> </wsdl:output> </wsdl:operation> </wsdl:porttype> <wsdl:binding name="obtenerciudadsoapsoapbinding" type="impl:obtenerciudadporttype"> <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="op"> <wsdlsoap:operation soapaction="http://pocodm/obtenerciudad.tws/op"/> <wsdl:input name="oprequest"> <wsdlsoap:body use="literal"/> </wsdl:input> <wsdl:output name="opresponse"> <wsdlsoap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="obtenerciudad"> <wsdl:port name="obtenerciudadsoap" binding="impl:obtenerciudadsoapsoapbinding"> <wsdlsoap:address location="http://ectest556ws1:9081/teamworks/webservices/pocodm/obtenerciudad.tws"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
what if serialize
jsonserializer serializer = new jsonserializer(); out.println( serializer.serialize( port.op() )); ectest556ws1._9081.schema.arrayofnamevaluepair@6d3f8e {"class":"ectest556ws1._9081.schema.arrayofnamevaluepair"}
the solution manage response xhtmlreques, parsing incoming xml read values.
Comments
Post a Comment