This discussion is archived
1 Reply Latest reply: May 15, 2012 10:27 PM by 651375 RSS

How to use Oracle xml gateway Inbound/outbound message

651375 Newbie
Currently Being Moderated
Hi,
I have deployed an inbound message on e-business suite 12.1.1 and tested by http://<host>:<port>/webservices/ECXOTAInbound.
It is working properly but I do not know how to call/use it.

I desperately need you to give some information on this to me.

Kind regards,
Arash
  • 1. Re: How to use Oracle xml gateway Inbound/outbound message
    651375 Newbie
    Currently Being Moderated
    I found its solution receiving help from Oracle support.


    Declare
    l_http_req utl_http.req;
    l_http_resp utl_http.resp;
    l_url varchar2(4000):=
    '*http://<Host IP address>:8000/webservices/TransportAgentServer*';
    l_value varchar2(4000);
    output varchar2(255);
    xml VARCHAR2(32000);
    envelope varchar2(32000);

    name VARCHAR2(4000); -- Response header name
    value VARCHAR2(4000); -- Response header value
    line VARCHAR2(4000); -- Response body
    reply_data VARCHAR2(4000);

    Begin
    utl_http.set_persistent_conn_support(TRUE);

    envelope:='TRANSPORT_PROTOCOL=OXTA&TRANSPORT_PROTOCOL_VERSION=1.0& ... USERNAME=operations&PASSWORD=welcome';


    l_http_req := utl_http.begin_request(l_url, 'POST', 'HTTP/1.0');
    utl_http.set_header(l_http_req, 'Content-Type','application/x-www-form-urlencoded');
    -- utl_http.set_header(l_http_req, 'Content-Length',length(envelope||'&PAYLOAD='||xml));
    utl_http.set_header(l_http_req, 'Content-Length',length(envelope));
    utl_http.set_header(l_http_req, 'Host', '<IP addres>');
    utl_http.set_header(l_http_req, 'Port', '8000');

    -- utl_http.write_text(l_http_req, envelope||'&PAYLOAD='||xml);
    utl_http.write_text(l_http_req, envelope);
    l_http_resp := utl_http.get_response(l_http_req);

    dbms_output.put_line('HTTP response status code: ' || l_http_resp.status_code);
    dbms_output.put_line('HTTP response reason phrase: ' || l_http_resp.reason_phrase);
    dbms_output.put_line('Headers');
    dbms_output.put_line('Header Count :'||utl_http.get_header_count(l_http_resp));
    For i In 1..utl_http.get_header_count(l_http_resp) Loop
    utl_http.get_header(l_http_resp, i, name, value);
    dbms_output.put_line(name || ': ' || value);
    reply_data := reply_data||name||': '||value;
    End Loop;

    Begin
    While 1=1 Loop
    utl_http.read_line( l_http_resp, line, true );
    dbms_output.put_line( line );
    reply_data:=reply_data||line;
    End Loop;
    Exception
    When utl_http.end_of_body then
    dbms_output.put_line( 'End of body' );
    End;

    utl_http.end_response(l_http_resp);
    Exception
    When others then
    dbms_output.put_line (sqlerrm);
    End;
    /

    You can also use ieHTTPHearders to know headers you need to send.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points