TransWikia.com

Postman - Caracteres escape respuesta XML

Stack Overflow en español Asked by susacapuntas on December 25, 2021

Acabo de empezar a hacer pruebas de API con Postman, por lo que tampoco tengo mucha experiencia, y me está pasando algo que me está volviendo loca y no sé cómo solucionar.

Estoy intentando hacer una request de tipo POST con un XML de entrada.
La request se envía, y se recibe correctamente la respuesta, sin embargo esta respuesta me devuelve caracteres de escape que no sé cómo omitir.
Esta respuesta se visualiza así tanto en Pretty format como en Raw. He probado toqueteando los headers para que incluyesen utf-8, sin ningún éxito.

La request es la siguiente:

<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sisnet.framework.webservices.jaxws">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:execute>
         <!--Optional:-->
         <arg0>LOGIN</arg0>
         <!--Optional:-->
         <arg1>
            <![CDATA[
               <ROOT>
                  <COMANDO>
                     <CODIGO>LOGIN</CODIGO>
                     <VERSION>1</VERSION>
                     <TIPODUSO>VOID</TIPODUSO>
                  </COMANDO>
                  <ENTRADA>
                     <USUARIO>{{user}}</USUARIO>
                     <CONTRASEÑA>{{pass}}</CONTRASEÑA>
                     <CODIMEDI>{{codMediator}}</CODIMEDI>
                     <PROVACCE>{{accessProv}}</PROVACCE>
                  </ENTRADA>
               </ROOT>
            ]]>
         </arg1>
      </urn:execute>
   </soapenv:Body>
</soapenv:Envelope>

Añadir que también he probado sacando el CDATA e incluyendo los caracteres de escape correspondientes (no tiene mucho sentido porque es lo mismo, pero lo he probado). Mismo resultado.

La respuesta que obtengo es la siguiente:

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header/>
    <S:Body>
        <ns2:executeResponse xmlns:ns2="urn:sisnet.framework.webservices.jaxws">
            <return>&lt;?xml version="1.0" encoding="UTF-8" ?>
&lt;ROOT>
&lt;RETORNO>
&lt;CODIGO>0&lt;/CODIGO>
&lt;DESCRIPCION>Comando invocado correctamente.&lt;/DESCRIPCION>
&lt;EXCEPCION>&lt;/EXCEPCION>
&lt;COMENTARIO>&lt;/COMENTARIO>
&lt;AVISOS>
&lt;/AVISOS>

&lt;/RETORNO>
&lt;RESPUESTA>
&lt;IDSESION>IDSESIONIDSESIONIDSESIONIDSESIONIDSESION&lt;/IDSESION>

&lt;/RESPUESTA>
&lt;/ROOT></return>
        </ns2:executeResponse>
    </S:Body>
</S:Envelope>

Edito para añadir el endpoint y el contenido del WSDL:

<definitions
    xmlns:tns="urn:sisnet.framework.webservices.jaxws"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:sisnet.framework.webservices.jaxws" name="WSSISNetService">
    <types>
        <xsd:schema>
            <xsd:import namespace="urn:sisnet.framework.webservices.jaxws" schemaLocation="http://lalalallaalalalala/SisnetINT/WSSISNet?xsd=1"/>
        </xsd:schema>
    </types>
    <message name="execute">
        <part name="parameters" element="tns:execute"/>
    </message>
    <message name="executeResponse">
        <part name="parameters" element="tns:executeResponse"/>
    </message>
    <portType name="WSSISNet">
        <operation name="execute">
            <input message="tns:execute"/>
            <output message="tns:executeResponse"/>
        </operation>
    </portType>
    <binding name="WSSISNetPortBinding" type="tns:WSSISNet">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <operation name="execute">
            <soap:operation soapAction=""/>
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>
    <service name="WSSISNetService">
        <port name="WSSISNetPort" binding="tns:WSSISNetPortBinding">
            <soap:address location="http://lalallalallalala/SisnetINT/WSSISNet"/>
        </port>
    </service>
</definitions>

Cabe destacar que esta misma request exactamente sí que devuelve el resultado esperado si la ejecuto en SoapUI.

Muchas gracias a todos.

One Answer

Encontré respuesta a la pregunta, me ayudaron en la comunidad de Postman para lo que buscaba. Dejo el enlace por si a alguien más le sirve: Solución

Answered by susacapuntas on December 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP