Consuming SOAP with jquery

0

Greetings Community I am trying to consume a SOAP service with jquery.soap but I do not know much about the SOAP topic and I am a little confused because it throws me the status well but it does not print anything.

$(document).ready(function () 
{
    var xml = '<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.dgie.banxico.org.mx"><soapenv:Header/><soapenv:Body><ws:udisBanxico soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></soapenv:Body></soapenv:Envelope>';

    $.soap({
        url: 'http://www.banxico.org.mx/DgieWSWeb/DgieWS?WSDL',
        method: 'udisBanxico',
        appendMethodToURL: false,
        data: xml,
        success: function (soapResponse) {
            console.log(soapResponse.toXML());

        },
        error: function (SOAPResponse) {
            // show error
            alert('Error '+SOAPResponse);
        }
    });
});

If it's any good testing, this is the request

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.dgie.banxico.org.mx">
   <soapenv:Header/>
   <soapenv:Body>
      <ws:udisBanxico soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
   </soapenv:Body>
</soapenv:Envelope>

and the response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header>
      <X-OPNET-Transaction-Trace:X-OPNET-Transaction-Trace soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="soapenc:string" xmlns:X-OPNET-Transaction-Trace="http://opnet.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">pid=3280,requestid=c1c0ed3f-24d0-4040-8580-3a782bc611b5</X-OPNET-Transaction-Trace:X-OPNET-Transaction-Trace>
   </soapenv:Header>
   <soapenv:Body>
      <ns1:udisBanxicoResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://ws.dgie.banxico.org.mx">
         <result xsi:type="xsd:string"><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?>
<CompactData xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/message"
xmlns:bm="http://www.banxico.org.mx/structure/key_families/dgie/sie/series/compact"
xmlns:compact="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/compact"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/message SDMXMessage.xsd
http://www.banxico.org.mx/structure/key_families/dgie/sie/series/compact BANXICO_DGIE_SIE_Compact.xsd
http://www.SDMX.org/resources/SDMXML/schemas/v1_0/compact SDMXCompactData.xsd" >
    <Header>
        <ID>UDIS</ID>
        <Test>false</Test>
        <Truncated>false</Truncated>
        <Name xml:lang="sp">UDIS</Name>
        <Prepared>2017-09-01 00:00:02.303</Prepared>
        <Sender id="BANXICO">
            <Name xml:lang="sp">Banco de México</Name>
            <Contact>
            <Name xml:lang="sp">Subgerencia de Desarrollo de Sistemas</Name>
            <Telephone>(01 55)52372678</Telephone>
            </Contact>
        </Sender>
        <DataSetAction>Update</DataSetAction>
        <Extracted>2017-09-01 00:00:02.303</Extracted>
    </Header>
    <bm:DataSet>
        <bm:SiblingGroup BANXICO_FREQ="Dia" TIME_FORMAT="P1D"/>
        <bm:Series TITULO="Valor de UDIS" IDSERIE="SP68257" BANXICO_FREQ="Dia" BANXICO_FIGURE_TYPE="TipoCambio" BANXICO_UNIT_TYPE="Udi">
            <bm:Obs TIME_PERIOD="2017-09-01" OBS_VALUE="5.795087"/>
        </bm:Series>
    </bm:DataSet>
</CompactData>]]></result>
      </ns1:udisBanxicoResponse>
   </soapenv:Body>
</soapenv:Envelope>

Thank you for your attention

    
asked by Esteban Flores 01.09.2017 в 20:38
source

0 answers