java - Use methods in XML response in Android -
i had connected android webservice using volley. when connect url, return me xml file. returned xml, contain function, need execute.
ok, volley don't have xml parser, use 'simple' xml serializator.
all fine, i'm connectet webservice, parsed xml, , have pojo file this. now, how can execute returned function in xml? can volley? need pass value function , receive result.
the xml code:
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:microsoft-dynamics-schemas/codeunit/servicioprueba" targetnamespace="urn:microsoft-dynamics-schemas/codeunit/servicioprueba"> <types> <schema xmlns="http://www.w3.org/2001/xmlschema" elementformdefault="qualified" targetnamespace="urn:microsoft-dynamics-schemas/codeunit/servicioprueba"> <element name="pruebaaaaaa"> <complextype> <sequence> <element minoccurs="1" maxoccurs="1" name="inputstring" type="string"/> </sequence> </complextype> </element> <element name="pruebaaaaaa_result"> <complextype> <sequence> <element minoccurs="1" maxoccurs="1" name="return_value" type="string"/> </sequence> </complextype> </element> </schema> </types> <message name="pruebaaaaaa"> <part name="parameters" element="tns:pruebaaaaaa"/> </message> <message name="pruebaaaaaa_result"> <part name="parameters" element="tns:pruebaaaaaa_result"/> </message> <porttype name="servicioprueba_port"> <operation name="pruebaaaaaa"> <input name="pruebaaaaaa" message="tns:pruebaaaaaa"/> <output name="pruebaaaaaa_result" message="tns:pruebaaaaaa_result"/> </operation> </porttype> <binding name="servicioprueba_binding" type="tns:servicioprueba_port"> <binding xmlns="http://schemas.xmlsoap.org/wsdl/soap/" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="pruebaaaaaa"> <operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/" soapaction="urn:microsoft-dynamics-schemas/codeunit/servicioprueba:pruebaaaaaa" style="document"/> <input name="pruebaaaaaa"> <body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/> </input> <output name="pruebaaaaaa_result"> <body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/> </output> </operation> </binding> <service name="servicioprueba"> <port name="servicioprueba_port" binding="tns:servicioprueba_binding"> <address xmlns="http://schemas.xmlsoap.org/wsdl/soap/" location="https://portatil-gjm.olivia.olivia-sistemas.com:7047/dynamicsnav100/ws/cronus%20espa%c3%b1a%20s.a./codeunit/servicioprueba"/> </port> </service> </definitions>
the part of connection in volley:
string url = "http://xxxxxxxxx"; simplexmlrequest<definitions> simplerequest = new simplexmlrequest<definitions>(request.method.get, url, definitions.class, new response.listener<definitions>() { @override public void onresponse(definitions response) { // response object log.d("works", "onresponse: "+response.gettypes().getschema()); } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { // error object } } ){ @override public map<string, string> getheaders() { map<string, string> params = new hashmap<string, string>(); params.put( "authorization", string.format("basic %s", base64.encodetostring( string.format("%s:%s", "xxxxx", "xxxx").getbytes(), base64.no_wrap))); return params; }}; queue.add(simplerequest);
Comments
Post a Comment