You are on page 1of 2

/*CreateatabletoloadtheXMLData(SOAPResponse)*/

createtableXML_DATA_CLOBS(
XML_DATA
xmltype,
XML_CLOB
clob);
CallingBPELProcessfromPL/SQL

DECLARE
urlvarchar2(2000);
envclob;
http_requtl_http.req;
http_resputl_http.resp;
respxmltype;
BEGIN
MentiontheendpointURLoftheBPELprocesstobeexecuted
url:='http://soatcs.xrxodc.com:8070/orabpel/demos/HelloWorld/1.0';
AssigntheSOAPmessagewhilerunningandpassinginputtotheBPEL
processasbelow
env:='<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'||
'<soap:Bodyxmlns:ns1="http://xmlns.oracle.com/HelloWorld">'||
'<ns1:HelloWorldProcessRequest>'||
'<ns1:input>'||:input||'</ns1:input>'||
'</ns1:HelloWorldProcessRequest>'||
'</soap:Body>'||
'</soap:Envelope>';
similartoopeningafileusingUTLFfile
http_req:=utl_http.begin_request(url,'POST','HTTP/1.0');
CheckwhetherthecontenttypeoftheInputmessagetotheBPELis
inTextorXMLformatasexpected
utl_http.set_header(http_req,'ContentType','text/xml');
http_req=FileIDcheckingthelengthoftheinputmessage
utl_http.set_header(http_req,'ContentLength',LENGTH(env));
performingtheaction
utl_http.set_header(http_req,'SOAPAction','process');
WritetheresponseusingtheFileIDiehttp_req
utl_http.write_text(http_req,env);
http_resp:=utl_http.get_response(http_req);
utl_http.read_text(http_resp,env);
ClosingtheFile
utl_http.end_response(http_resp);
resp:=xmltype.createxml(env);

INSERT
INTOXML_DATA_CLOBS
VALUES(resp,env);

COMMIT;
END;

select*
fromXML_DATA_CLOBS

You might also like