Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help please , apex_web_service.make_request

2919158Sep 29 2014

Hi i need your help , i try invoque web service using apex_web_service.make_request , (if i use another client whit the same message , works).

I have:

URL    http://www2.soriana.com/integracion/farmacia/wsInvocaOperacion.asmx

INPUT MESSAGE :    <?xml version="1.0" encoding="utf-8"?> <Invoca operacion="ObtenCatalogoImpuestos" proveedor="5117" version="1.0" />

CODE :

------------

PROCEDURE ConsultaLaboratorio(pId OUT INTEGER, pOk OUT BOOLEAN) IS

    l_envelope                CLOB;

    l_xml_respuesta        XMLType;

    l_xml_consulta          XMLTYPE; 

    v_id                         INTEGER;

    v_msg                     VARCHAR2(2000);

    v_fecha_ini              VARCHAR2(20);

    v_fecha_fin              VARCHAR2(20);

    l_trep                      CLOB;

BEGIN

pOk := FALSE;

  l_envelope := '<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<SOAP-ENV:Body>

<tns:Invoca xmlns:tns="http://tempuri.org/">

<tns:operacion>

<?xml version="1.0" encoding="utf-8"?>

<Invoca operacion="ObtenCatalogoImpuestos" proveedor="5117" version="1.0"/>

</tns:operacion>

</tns:Invoca>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>';

--Se  convierte peticion a XML

l_xml_consulta := XMLTYPE(L_envelope);

-- Se consume secuencia

SELECT SORIANA.IDX_CONS_WEB_SERVICE.NEXTVAL INTO v_id  FROM DUAL;

IF v_id  IS NOT NULL THEN    -- Se valida que se cree ID

  v_msg := 'Inicializa registro de consulta al web service';

  INSERT INTO SORIANA.CONSULTA_WEB_SERVICE(ID,XML_PETICION,FECHA_INICIO,STATUS,MENSAJE) VALUES(v_id,l_xml_consulta,SYSDATE,0,v_msg );

  COMMIT;

 

 

    l_xml_respuesta :=  apex_web_service.make_request(

    p_url              => 'http://www2.soriana.com/integracion/farmacia/wsInvocaOperacion.asmx',

    p_action         => '"http://tempuri.org/Invoca"',

    p_version       => '1.0',

    p_envelope     => l_envelope

    );

    

    v_msg := 'Se consuto web service';

    UPDATE  SORIANA.CONSULTA_WEB_SERVICE SET MENSAJE =  v_msg  ,   RESP=  l_trep  , XML_RESPUESTA =  l_xml_respuesta , FECHA_FIN = SYSDATE ,  STATUS = 1 WHERE ID = v_id;

    COMMIT;

     pOk := TRUE;

   

    ELSE

    pOk := FALSE;

  END IF; 

   

EXCEPTION

   WHEN OTHERS THEN

    pOk := FALSE;

    IF v_id  IS NOT NULL THEN 

       v_msg := SQLERRM;

        UPDATE  SORIANA.CONSULTA_WEB_SERVICE SET MENSAJE =  v_msg WHERE ID = v_id;

        COMMIT;

    END IF;

END;

-----------------

REPONSE STORE IN XML_RESPUESTA  FIELD IN TABLE SORIANA.CONSULTA_WEB_SERVICE.

<?xml version='1.0' encoding='UTF-8'?><err><sqlerrm>ORA-31011: XML parsing failed

ORA-19202: Error occurred in XML processing

LPX-00229: input source is empty

Error at line 0</sqlerrm><response><![CDATA[]]></response></err>

Please help.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2014
Added on Sep 29 2014
0 comments
891 views