Web Service Procedure

I have been extensively researching web services but I still can not find out how to return a set of data like there is in this example.. the most i can get it to return is one field of data by just returning a variable http://www.oracle.com/technology/obe/obe_as_10g/portal/bld_portlet_decl/portlet_decl.html#webService
would anyone be able to show me some sample code about returning multiple values, the only way i can think of is declaring a type and then returning a ref cursor but web services dont let you use ref cursors!!!!
The only thing i wanted to see on that example is the code for that method but they don't show it! I am at my wit's end, any help would be greatly appreciated (sorry in advance if this has been posted before but I couldn't find anything about it)

Ah.. now it seems to make sense. Unfortunately this may seem quite technical, but this deals with APEX/XML/web processes on their most basic technically level.
Whatever does the graphing (e.g. like an AnyChart or Fusion swf program), expects XML as input.
This XML contains the data required to determine the type of chart, legends, titles, colours and so on - including the serie and data points to plot.
It obviously cannot handle a ref cursor, just as it cannot handle anything else, but XML data in the very specific format that it expects. I.e. you cannot pass just any old XML to it.
In Oracle terms, a web-enabled PL/SQL procedure must return a XML MIME stream to the web browser via the web server's mod_plsql module.
In APEX terms, if the standard APEX Anychart XML generator does not do the trick, you need to write your own and define that as an APEX process so that it is called within the APEX context (allowing you access to APEX state variables applicable to the caller).

Similar Messages

  • Trouble calling htp in a web service procedure

    I have a procedure that I was calling directly within an APEX application that allowed the user to download XML files, as follows:
    PROCEDURE download_my_file (
    p_resid IN VARCHAR2
    , p_filename VARCHAR2
    , p_filter_str IN VARCHAR2 DEFAULT NULL
    AS
    v_mime VARCHAR2 (48) := NULL;
    v_length NUMBER;
    v_file_name VARCHAR2 (2000);
    v_clob CLOB;
    v_buf VARCHAR2 (32000);
    v_amt NUMBER := 4000;
    v_pos NUMBER := 1;
    BEGIN
    IF p_filter_str IS NULL
    THEN
    SELECT EXTRACT (VALUE (r), '/*').getclobval ()
    , DBMS_LOB.getlength (EXTRACT (VALUE (r), '/*').getclobval ())
    INTO v_clob
    , v_length
    FROM TABLE (XMLSEQUENCE ((SELECT xdburitype (any_path).getxml ()
    FROM resource_view
    WHERE resid = p_resid))) r;
    ELSE
    v_clob:= repos_datasets.dyn_dset_licensed_location_xml(p_filter_str=>p_filter_str);
    v_length:=DBMS_LOB.getlength (v_clob);
    END IF;
    -- set up HTTP header
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Content-length: ' || v_length);
    HTP.p ('Content-Disposition: attachment; filename="' || NVL(p_filename,'user_query.xml') || '"');
    OWA_UTIL.http_header_close;
    BEGIN
    v_pos := 1;
    LOOP
    DBMS_LOB.READ (v_clob
    , v_amt
    , v_pos
    , v_buf
    v_pos := v_pos + v_amt;
    HTP.prn (v_buf);
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    END;
    END download_my_file;
    The procedure works perfectly when a process calls the procedure directly from the database, however, I now have a requirement whereby this download facility needs to be accessed through a web-service: merely creating a web-service for the procedure and running it through a page process returns a 'ORA-06502: PL/SQL: numeric or value error' message. I assumed as APEX is a web environment that the htp package functions would use the session that APEX had started but obviously they are not.
    How would I go about manually creating a session (I presume that's what's required) that would support the htp calls and allow the user to download the files exactly as they could with a direct call to the database procedure? I know it involves some initialization using the OWA package but this is alien territory for me, can anyone help at all?

    Has anyone come across a similar scenario? There are plenty examples of calling web-enabled procedures directly from APEX but I must call such a procedure through a web-service reference. Failing anyone having a similar problem, could someone explain to me how the Common Gateway interface variables are set when an APEX application calls a web enabled procedure?
    I've included the code for the procedure I'm trying to run which I have altered to include CGI environment parameters: I'm getting these parameters by calling owa_util.get_cgi_env in the calling APEX application and passing the individual values to the procedure through the web service reference. I chose those variables I thought would tell the procedure where to return the HTML to but I'm just getting a blank page.
    Anyone any suggestions? (code below)
    PROCEDURE download_my_file (
    p_resid IN VARCHAR2
    , p_filename VARCHAR2
    , p_filter_str IN VARCHAR2 DEFAULT 'sepa_region = ''North'''
    ,p_SERVER_PORT VARCHAR2
    ,p_SERVER_NAME VARCHAR2
    ,p_QUERY_STRING VARCHAR2
    ,p_HTTP_USER_AGENT VARCHAR2
    ,p_HTTP_HOST VARCHAR2
    ,p_HTTP_REFERER VARCHAR2
    ,p_DAD_NAME VARCHAR2
    ,p_REQUEST_CHARSET VARCHAR2
    ,p_HTTP_COOKIE VARCHAR2
    AS
    v_mime VARCHAR2 (48) := NULL;
    v_length NUMBER;
    v_file_name VARCHAR2 (2000);
    v_clob CLOB;
    v_buf VARCHAR2 (32000);
    v_amt NUMBER := 4000;
    v_pos NUMBER := 1;
    namelist OWA.vc_arr;
    valuelist OWA.vc_arr;
    htpbuffer HTP.htbuf_arr;
    bufrows INTEGER := 99999999;
    rc INTEGER;
    BEGIN
    IF p_filter_str IS NULL
    THEN
    SELECT EXTRACT (VALUE (r), '/*').getclobval ()
    , DBMS_LOB.getlength (EXTRACT (VALUE (r), '/*').getclobval ())
    INTO v_clob
    , v_length
    FROM TABLE (XMLSEQUENCE ((SELECT xdburitype (any_path).getxml ()
    FROM resource_view
    WHERE resid = p_resid))) r;
    ELSE
    v_clob:= repos_datasets.dyn_dset_licensed_location_xml(p_filter_str=>p_filter_str);
    v_length:=DBMS_LOB.getlength (v_clob);
    END IF;
    namelist (1) := 'SERVER_PORT';
    namelist (2) := 'SERVER_NAME';
    namelist (3) := 'QUERY_STRING';
    namelist (4) := 'HTTP_USER_AGENT';
    namelist (5) := 'HTTP_HOST';
    namelist (6) := 'HTTP_REFERER';
    namelist (7) := 'DAD_NAME';
    namelist (8) := 'REQUEST_CHARSET';
    namelist (9) := 'HTTP_COOKIE';
    valuelist (1) := p_SERVER_PORT;
    valuelist (2) := p_SERVER_NAME;
    valuelist (3) := p_QUERY_STRING;
    valuelist (4) := p_HTTP_USER_AGENT;
    valuelist (5) := p_HTTP_HOST;
    valuelist (6) := p_HTTP_REFERER;
    valuelist (7) := p_DAD_NAME;
    valuelist (8) := p_REQUEST_CHARSET;
    valuelist (9) := p_HTTP_COOKIE;
    -- initiliase OWA and configure a basic CGI environment
    DBMS_SESSION.reset_package; reset PL/SQL PGA maintaining package state
    rc := OWA.initialize;
    OWA.init_cgi_env (9
    , namelist
    , valuelist
    htp.showpage ();
    -- set up HTTP header
    -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Content-length: ' || v_length);
    HTP.p ('Content-Disposition: attachment; filename="' || NVL(p_filename,'user_query.xml') || '"');
    OWA_UTIL.http_header_close;
    owa_util.print_cgi_env;
    --wpg_docload.download_file( v_clob );
    BEGIN
    v_pos := 1;
    LOOP
    DBMS_LOB.READ (v_clob
    , v_amt
    , v_pos
    , v_buf
    v_pos := v_pos + v_amt;
    HTP.prn (v_buf);
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    END;
    Message was edited by:
    user592383

  • Web service that streams a clob to the calling application

    I need to produce a web service that streams a clob to a calling application: what I have currently is a web service that contains calls to htp, thinking this would serve as a way for a user to download a clob from the procedure that the web service is based on (see Trouble calling htp in a web service procedure
    I can't get that approach to work at all, so rather than repeatedly bang my head against the wall I'll raise the following question: is there a standard approach whereby a clob can be streamed to the application consuming the web service? Note that I have limited myself in that I'm consuming the WS using APEX - APEX would like to store a returned value from a FUNCTION web service in a page item or a collection, but I will need to be returning very large CLOBs at times, so this is not an option.
    I'm sure there must be examples of web services being used to return large streams of data returned by stored procedures but I can't seem to find them Could anyone point me in the right direction?

    Ok, I've had to change tack. I've now recreated the web service and have handled the large CLOB as a streaming attachment: this performs well when running the test in Enterprise Manager as it returns a big CLOB very quickly. My problem is consuming this big SOAP message. I have tried calling this web service from a PLSQL procedure shown below but I get the following error:
    ORA-29541: class XMLDBMASTER.oracle/jpub/runtime/dbws/DbwsProxy could not be resolved
    When testing the WS there is obviously a automatically generated stub that will handle the returned SOAP message and it's streaming attachment. How is calling this from a DB procedure different, must I supply a proxy to the procedure manually?
    Please, if anyone has any clue could they give me a shout? (Procedure below)
    PROCEDURE run_ws (p_resid IN VARCHAR2,p_filename VARCHAR2, p_filter_str IN VARCHAR2)
    AS
    l_service UTL_DBWS.service;
    l_call UTL_DBWS.call;
    l_result ANYDATA;
    l_wsdl_url VARCHAR2(1024);
    l_service_name VARCHAR2(200);
    l_operation_name VARCHAR2(200);
    l_input_params UTL_DBWS.anydata_list;
    v_mime VARCHAR2 (48) := NULL;
    v_length NUMBER;
    v_clob CLOB;
    v_file_name VARCHAR2 (2000);
    v_buf VARCHAR2 (32000);
    v_amt NUMBER := 4000;
    v_pos NUMBER := 1;
    BEGIN
    l_wsdl_url := 'http://ltp003357.sepanet.sepa.org.uk:8888/getXMLclob/getXMLclob';
    l_service_name := 'getXMLclob';
    l_operation_name := 'getClob';
    l_service := UTL_DBWS.create_service (
    wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
    service_name => l_service_name);
    l_call := UTL_DBWS.create_call (
    service_handle => l_service,
    port_name => NULL,
    operation_name => l_operation_name);
    l_input_params(1) := ANYDATA.ConvertVarchar2(p_resid);
    l_input_params(2) := ANYDATA.ConvertVarchar2(p_filename);
    l_input_params(3) := ANYDATA.ConvertVarchar2(p_filter_str);
    l_result := UTL_DBWS.invoke (
    call_handle => l_call,
    input_params => l_input_params);
    UTL_DBWS.release_call (call_handle => l_call);
    UTL_DBWS.release_service (service_handle => l_service);
    v_clob:=ANYDATA.AccessClob(l_result);
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Content-length: ' || v_length);
    HTP.p ('Content-Disposition: attachment; filename="' || NVL('user_test','user_query.xml') || '"');
    OWA_UTIL.http_header_close;
    BEGIN
    v_pos := 1;
    LOOP
    DBMS_LOB.READ (v_clob
    , v_amt
    , v_pos
    , v_buf
    v_pos := v_pos + v_amt;
    HTP.prn (v_buf);
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    END;
    END run_ws;

  • SOAP Fault when returning null from a Native Web Service Stored Procedure

    I have a stored procedure which I can successfully invoke via soapUI
    However, if one of the Stored Procedure's OUT arguments is set to null the native web service returns the following fault :
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <soap:Fault>
    <faultcode>soap:Client</faultcode>
    <faultstring>Error processing input</faultstring>
    <detail>
    <OracleErrors xmlns="http://xmlns.oracle.com/orawsv/faults">
    <OracleError>
    <ErrorNumber>ORA-19202</ErrorNumber>
    <Message>Error occurred in XML processing</Message>
    </OracleError>
    <OracleError>
    <ErrorNumber>ORA-01405</ErrorNumber>
    <Message>fetched column value is NULL</Message>
    </OracleError>
    </OracleErrors>
    </detail>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>I can see how to control the processing of null values when invoking orawsv (using the null_handling element).
    Is there an equivalent for Stored Procedures ?
    Thanks,
    PD
    versions as follows :
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    "CORE     11.2.0.1.0     Production"
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    Without going into any technical discussion about the code, my first question is what JDK version was used to create this which was imported into the form? Understand that Forms 10 runs on JDK 1.4.2, so if you used any newer JDK version, likely there will be problems.

  • Stored Procedure For Web Service in Visual Composer 7.1

    Hello,
    I want to use stored procedure for Webservice in Visual Composer 7.1
    I can find this Web service but not supported. ( ex) prcreleased_test - Not supported )
    Log.
    Message: Error in connection - Can' t execute Web service.
    Date: 2008-07-01
    Time: 16:41:43:906
    Category: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent
    Location: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.processExecution: 
    Application: sap.com/test~kmshim_wf_impl
    Thread: HTTP Worker [1]
    Data Source: j2ee\cluster\server0\log\defaultTrace_00.trc
    Correlator ID: 240496500000034715
    Argument Objects: 
    Arguments: 
    DSR Component: n.a.
    DSR Transaction: cb4b3560473711dd9fb4001e4f3b8fcb
    Log2
    Message: Stopped further execution since the interpreter is unusable
    Date: 2008-07-01
    Time: 16:41:43:906
    Category: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent
    Location: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.XGLInterpreter
    Application: sap.com/test~kmshim_wf_impl
    Thread: HTTP Worker [1]
    Data Source: j2ee\cluster\server0\log\defaultTrace_00.trc
    Correlator ID: 240496500000034715
    Argument Objects: 
    Arguments: 
    DSR Component: n.a.
    DSR Transaction: cb4b3560473711dd9fb4001e4f3b8fcb '
    Help me^^ plz..

    Hi Tanna.
    Thanks for your reply^^
    I create webservice that access my stored procedure.
    But not supported.
    http://dmp.humaxdigital.com/HumaxCmdwService/Service1.asmx?wsdl
    There are two service. (Hello World - Test, prcrelease_test - Stored Procedure )
    'Hello World' is supported but prcrelease_test is not supported. I can't drag to storyboard.
    Our company's DB is MSSQL2005.
    please help me^^

  • Web Service receives no data from Stored Procedure call.

    Issue: When calling a Stored Procedure from a Web Service no data is returned.
    Lead up: I can call the SP 100 times a day for 3-4 days then for some reason the Web Service no longer get the data from SQL. I have ran a trace and I can see the SP running though all of its steps and returning the data, but the Web Service
    is not getting it.
    Fix: None yet.
    Work around: Before the Web Service calls the SP, I am sending an SP_Recompile to the SP in question. For now this seems to have resolved the issue.
    Detail: 
    1. SP is querying data from another DB on the same server.
    2. SP is storing query data in Temp Tables.

    Hello,
    Does your Stored Procedure have parameters? If so, the issue may be cause by parameter sniffing. Please refer to the following blog about Paraemeter Sniffing:
    http://www.sommarskog.se/query-plan-mysteries.html
    The recommended fix for most situations is to not use parameters directly in queries, but rather store them into local variables and then use those variables in the queries.
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here.
    Fanny Liu
    TechNet Community Support

  • How to enable MSDOS program to be called from Oracle PL/SQL procedure ( Web Service )?

    Hello,
    Dealing with the time demanding procedure where power user is interactively execute sequence
    of steps of procedure:
    1. pl/sql procedure for preparing data in some table
    2. java program that read data from the table and creating input txt file for MSDOS program
    3. MSDOS program is autonomous component that reads input txt file and make
        output txtfile.
        MSDOS program is closed component, can not be modified
    4. java program that insert txtfile into Oracle table.
    5. Steps 1 to 4 are executed in interations driven with select on some table.
    Trying to prepare re-design the procedure  and not sure about which technologies to use ?
    The goal is that whole procedure would be implemented in pl/sql procedure and this way could be executed
    so as from power user from command line as from controlled application on any type of the client.
    So if that MSDOS program would be transformed as Web Service offered on  some MSWin server in the intranet.
    Then PL/SQL procedure would communicate ( call this web service ) and do all the job and at the end
    send status of completion and report through e-mail to the issuer of the procedure?
    Not sure what technologies should I use on Oracle RDBMS server on Linux to communicate with MSWin Web service which is running MSDOS program ?

    > Hi TOM,
    This is not asktom.oracle.com.
    > Can Possible to do in Oacle Pl/Sql...?
    Yes it can be done. Simply consult the applicable manuals that contains all of the details on how to do it. The manuals are:
    - Oracle® Database Application Developer's Guide - Large Objects (refer to Chapter 6 section on Using PL/SQL (DBMS_LOB Package) to Work with LOBs)
    - Oracle® Database PL/SQL Packages and Types Reference (refer to the chapter on DBMS_LOB)

  • Getting SOAException while calling SOA web service via pl/sql procedure

    Hi All,
    I created a 'Helloworld' BPEL process and successfuly deployed it. I tested it in the WLS and it is working. Now I wrote a pl/sql procedure which calls this 'HelloWorld' bpel process. When ran this procedure it throw me an error
    GetPayload: resp3 IS NULL
    <HTML><HEAD><TITLE>Web Service</TITLE></HEAD><BODY><H1>Bad Request</H1><PRE>javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected character &#39;&#60;&#39; &#40;code 60&#41; excepted space, or &
    #62;&#39; or &#34;/&#62;&#34;
    at [row,col {unknown&#45;source}]: [1,120]</PRE></BODY></HTML>
    null response
    GetPayload: resp3 IS NULL
    <HTML><HEAD><TITLE>Web Service</TITLE></HEAD><BODY><H1>Bad Request</H1><PRE>javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected character &#39;&#60;&#39; &#40;code 60&#41; excepted space, or &
    #62;&#39; or &#34;/&#62;&#34;
    at [row,col {unknown&#45;source}]: [1,120]</PRE></BODY></HTML>
    null response
    Please suggest.
    WSDL - http://herbalife-mwdv4-new.hrbl.net:21000/soa-infra/services/SAI/HTTP_BPEL/bpelprocesshttp_client_ep?WSDL
    procedure code is as below:
    Create or Replace FUNCTION GetPayload(
    p_Payload IN VARCHAR2)
    RETURN VARCHAR2 IS
    soap_request VARCHAR2(30000);
    soap_respond VARCHAR2(30000);
    http_req UTL_HTTP.REQ;
    http_resp UTL_HTTP.RESP;
    resp XMLTYPE;
    response VARCHAR2(30000) := '';
    l_detail VARCHAR2(30000);
    i INTEGER;
    l_xsl_nonamespace VARCHAR2(640) := '<?xml version="1.0" encoding="UTF-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="comment()|processing-instruction()|/"> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="*"> <xsl:element name="{local-name()}"> <xsl:apply-templates select="@*|node()"/> </xsl:element> </xsl:template> <xsl:template match="@*"> <xsl:choose> <xsl:when test="name() != ''xmlns''"> <xsl:attribute name="{local-name()}"> <xsl:value-of select="."/> </xsl:attribute> </xsl:when> </xsl:choose> </xsl:template></xsl:stylesheet>';
    namespace VARCHAR2(128) := 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP';
    endpoint VARCHAR2(128) := 'http://herbalife-mwdv4-new.hrbl.net:21000/soa-infra/services/SAI/HTTP_BPEL/bpelprocesshttp_client_ep';
    BEGIN
    soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>'||'<SOAP-ENV:Envelope '||'xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"'||'<SOAP-ENV:Body>'||'<'||namespace||'>'||'<ProcessRequest>'||'<input'||namespace||'>'||p_Payload||'</input>'||'</ProcessRequest>'||'</SOAP-ENV:Body>'||'</SOAP-ENV:Envelope>';
    http_req := utl_http.begin_request( endpoint, 'POST', 'HTTP/1.1');
    utl_http.set_header(http_req , 'Content-Type' , 'text/xml');
    -- dealing with plain text in XML documents
    utl_http.set_header(http_req , 'Content-Length' , lengthb(soap_request));
    utl_http.set_header(http_req , 'SOAPAction' , 'process'); -- required to specify a SOAP communication
    utl_http.write_text(http_req, soap_request);
    http_resp := utl_http.get_response(http_req);
    utl_http.read_text(http_resp, soap_respond);
    utl_http.end_response(http_resp);
    resp:= XMLType.createXML(soap_respond);
    IF (instr(resp.getStringVal(), 'ERROR:') > 0)THEN
    raise_application_error ( -20999, 'GetHelloWorldPayload: Failed! '||p_Payload);
    END IF;
    resp := resp.extract('/soap:Envelope/soap:Body/child::node()' , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' );
    -- Remove namespaces
    SELECT XMLTransform(resp, xmlType(l_xsl_nonamespace)) INTO resp FROM dual;
    -- resp := resp.extract('/ProcessResponse/child::node()', 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP');
    IF (resp IS NULL)THEN
    dbms_output.put_line('GetPayload: resp3 IS NULL');
    ELSE
    dbms_output.put_line('GetPayload: resp3 ' ||resp.getStringVal());
    END IF;
    i:=0;
    LOOP
    dbms_output.put_line(SUBSTR(soap_respond,1+ i*255,250));
    i := i+1;
    IF i*250> LENGTH(soap_respond) THEN
    EXIT;
    END IF;
    END LOOP;
    IF (resp IS NULL)THEN
    response := 'null response';
    ELSE
    response := REPLACE( REPLACE( REPLACE( resp.getStringVal(), '<', '<') , '>', '>') , '"', '"');
    END IF;
    RETURN response;
    END GetPayload;
    /

    vladodias thanks for the reply. I went through the link before also but i am not comfortable with the utl_dbws that's why i am following utl_http.
    I also changed my procedure now i am not getting any error but it is not printing the output as well. New procedure is as below.
    I tried 'set serveroutput on size 1000000;' also but still not working.
    Create or Replace FUNCTION GetPayload(
    p_Payload IN VARCHAR2)
    RETURN VARCHAR2 IS
    soap_request VARCHAR2(30000);
    soap_respond VARCHAR2(30000);
    http_req UTL_HTTP.REQ;
    http_resp UTL_HTTP.RESP;
    resp XMLTYPE;
    response VARCHAR2(30000) := '';
    l_detail VARCHAR2(30000);
    i INTEGER;
    l_xsl_nonamespace VARCHAR2(3000) := '<?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="comment()|processing-instruction()|/">
    <xsl:copy>
    <xsl:apply-templates/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="*">
    <xsl:element name="{local-name()}">
    <xsl:apply-templates select="@*|node()"/>
    </xsl:element>
    </xsl:template>
    <xsl:template match="@*">
    <xsl:choose>
    <xsl:when test="name() != ''xmlns''">
    <xsl:attribute name="{local-name()}">
    <xsl:value-of select="."/>
    </xsl:attribute>
    </xsl:when>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>';
    namespace VARCHAR2(128) := 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP';
    endpoint VARCHAR2(128) := 'http://herbalife-mwdv4-new.hrbl.net:21000/soa-infra/services/SAI/HTTP_BPEL/bpelprocesshttp_client_ep';
    BEGIN
    soap_request:= '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bpel="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP">
    <soapenv:Header/>
    <soapenv:Body>
    <bpel:process>
    <bpel:input>test</bpel:input>
    </bpel:process>
    </soapenv:Body>
    </soapenv:Envelope>';
    http_req := utl_http.begin_request( endpoint, 'POST', 'HTTP/1.1');
    utl_http.set_header(http_req , 'Content-Type' , 'text/xml');
    -- dealing with plain text in XML documents
    utl_http.set_header(http_req , 'Content-Length' , lengthb(soap_request));
    utl_http.set_header(http_req , 'SOAPAction' , 'process'); -- required to specify a SOAP communication
    utl_http.write_text(http_req, soap_request);
    http_resp := utl_http.get_response(http_req);
    utl_http.read_text(http_resp, soap_respond);
    utl_http.end_response(http_resp);
    resp:= XMLType.createXML(soap_respond);
    IF (instr(resp.getStringVal(), 'ERROR:') > 0)THEN
    raise_application_error ( -20999, 'GetHelloWorldPayload: Failed! '||p_Payload);
    END IF;
    resp := resp.extract('/soap:Envelope/soap:Body/child::node()' , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' );
    -- Remove namespaces
    SELECT XMLTransform(resp, xmlType(l_xsl_nonamespace)) INTO resp FROM dual;
    -- resp := resp.extract('/ProcessResponse/child::node()', 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP');
    IF (resp IS NULL)THEN
    dbms_output.put_line('GetPayload: resp3 IS NULL');
    ELSE
    dbms_output.put_line('GetPayload: resp3 ' ||resp.getStringVal());
    END IF;
    i:=0;
    LOOP
    dbms_output.put_line(SUBSTR(soap_respond,1+ i*255,250));
    i := i+1;
    IF i*250> LENGTH(soap_respond) THEN
    EXIT;
    END IF;
    END LOOP;
    IF (resp IS NULL)THEN
    response := 'null response';
    ELSE
    response := REPLACE( REPLACE( REPLACE( resp.getStringVal(), '<', '<') , '>', '>') , '"', '"');
    END IF;
    RETURN response;
    END GetPayload;
    /

  • Creating web service from pl/sql procedure

    Hello.
    I need to create a web service from pl/sql procedure and i chose JDeveloper for this implementation. I have wsdl, but I never created web services. So, I created web service with document/literal message format.
    But I have several troubles:
    1. All element names have lower case letters.
    2. The SOAP envelope must begin from words soapenv:Envelope but i have soap:Envelope.
    3. And operation name has tail like "Element".
    I know bad way for implement 1 and 3 points. It's a modification of java_wsdl_mapping.xml and wsdl files. But if I want to add new method to my service all changes will be cleaned. It's not critical but inconvenient to support.
    But for point 3 i have no ideas.
    This task is very important for me. Can somebody help me?
    JDeveloper 10.1.3.3
    Regards,
    Aleksey

    http://www.oracle.com/technology/obe/obe1013jdev/10131/wsfromplsqlpackage/devwsfrom%20plsql.htm
    Frank

  • Web Service calling a Stored Procedure thru a DB Link

    hi guys,
    I'm getting this error ORA-02064: distributed operation not supported when I invoke my Web service. My scenario is more like the #3 below. How can I simplify update when what I'm invoking is just inserting a record in a table.
    - USER A calls, a procedure owned by USER B (w/c inserts to table X)
    - USER A have insert, update rights to TABLE X owned by USER B
    - USER A have execute rights to the procedure owned by USER B
    - USER A does the calling by Callable statement
    e.g. begin B.runme@dblink(?,?); end;
    - USER B is an Oracle ERP SCHEMA user, USER A is just another oracle schema but not of any Oracle apps
    - USER B runme Procedure have a COMMIT statement inside and an OUT parameter.
    I have no problems in making this code run when procedure being called is not thru dblink.
    I'm really have no other idea how to fix this. except for using a different user maybe B or C that logs to the same DB without using any other DB link.
    I'm guessng, maybe Web Service does not allow such call which uses a DB link.
    Help anyone?
    below is the ORA explanation.
    ORA-02064: distributed operation not supported
    Cause: One of the following unsupported operations was attempted:
    1. array execute of a remote update with a subquery that references a dblink, or
    2. an update of a long column with bind variable and an update of a second column with a subquery that both references a dblink and a bind variable, or
    3. a commit is issued in a coordinated session from an RPC procedure call with OUT parameters or function call.
    Action: simplify remote update statement

    You can check this example.

  • Generating Web Service from PL/SLQL procedures using ODSI

    1) Is there a way for us to generate REST based web services from PL/SQL procedures using Oracle data services Integrator? If Yes, Can you please point me to any available documentation
    2) I am trying to create a phyiscal data source based on PL/SQL procedures in the hope of turning these data sources into web services. I created a JDBC connection in web logic server console and am trying to view the packages under APPS but ODSI always crashes after selecting APPS. Is there a way to resolve this?
    Thanks
    Bhanu

    Hi..
    We came accross this problem a while back (I think it was us that the patch was created for). The patch was released under CR369707.
    Additionally it took us a while to figure out how to use it correctly.. Here's the info for it from a mail i receievd from our support contact..
    Here is more information from engineering on the patch:
    This is patch for filtering Stored Procedures in the New Physical Data Service Wizard. It is a partial fix to the problem. It just does filtering - it still retrieves all the jdbc metadata for everything that matches the filter. Ideally, the wizard would let you explore the stored procedures - retrieving the name only - and once you selected a stored procedure, it would retrieve the argument types (which is the expensive part).
    Copy these two files to a safe place
    <bea_home>\<aldsp_home>\eclipse-plugins\dsp\eclipse\plugins\com.bea.dsp.ide.external_10.3.0\dsp-ide-ldshredder.jar
    <bea_home>\<aldsp_home>\eclipse-plugins\dsp\eclipse\plugins\com.bea.dsp.ide.import_metadata_10.3.0.jar
    Replace the files with the ones provided in the patch (which I sent you be eMail recently).
    Creating Relational Database Physical Data Services -> Stored Procedures will be affected as follows :
    The Search field used to represent a pattern for the stored procedures only, and this patterns were applied against every schema visible to ALDSP. The patch allows you to also specify a list of catalogue patterns (useful only when applicable), a list of schema patterns and a list of procedure name patterns. These lists are separated by the pipe symbol, and the lists themselves are command-separated. The catalogue and schema patterns are regular expressions, the procedure pattern is for a database 'like' clause. For, Oracle, the catalogue patterns are not applicable.
    Example:
    |ODM1,ODM2|B% // look in schemas containing the strings ODM1 or ODM2 for procedures that start with B
    // possible results would be MY_ODM1.BUILDER, ODM2.BOTTOM
    |^ODM$|B%D // look in the ODM schema for procedures that start with B and end with D.
    Also - if there is a search string in the Search box, that search string will be applied to the schema when you click on the + to expand it in the Tree.
    Note that once a schema has been 'explored' - either by a search, or by expanding it in the tree, further searches will not update it's children. You would need to quit the wizard and restart.
    Once you get the patch if you have issues let me know..

  • Have Error invoking SSL web service using pl sql procedure

    Hi All,
    Please any one can tell where i am going wrong,in calling ssl soa web service from plsql procedure.
    Below steps i followed ssl configure in soa server
    1- For configuring ssl in soa 11g, i am going to weblogic console->environment-> servers-> soa_server1-> check ssl box of port 8002.
    2- restart the server.
    3- One process i devloped, deployed in em console, while trying to acces the service with 8002 port, i need to use https://servicepath.
    Is there is any problem in the above approch for configuring ssl in soa server.
    Now coming to the procedure part, in below i given the deatails
    DECLARE
    HTTP_REQ UTL_HTTP.REQ;
    HTTP_RESP UTL_HTTP.RESP;
    URL_TEXT VARCHAR2(32767);
    lv_process_xml_body varchar2(4000);
    BEGIN
    DBMS_OUTPUT.ENABLE(1000000);
    lv_process_xml_body:='<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
         <soap:Body xmlns:ns1="http://xmlns.oracle.com/SOA_RND_jws/Sample/DemoBPELProcess">
              <ns1:process>
                   <ns1:input></ns1:input>
    </ns1:process>
    </soap:Body>
    </soap:Envelope>';
    UTL_HTTP.SET_WALLET('file:/db/oracle/app/oradb/product/11.2.0/dbhome_1/bin/client', 'abcd123');
    HTTP_REQ := UTL_HTTP.BEGIN_REQUEST('https://172.28.40.20:8002/soa-infra/services/Client/Sample/demobpelprocess_client_ep', 'POST' , 'HTTP/1.0');
    UTL_HTTP.set_header(http_req, 'Content-Type', 'text/xml');
    UTL_HTTP.set_header(http_req, 'Content-Length', LENGTH(lv_process_xml_body));
    UTL_HTTP.SET_HEADER(HTTP_REQ, 'SOAPAction', 'process');
    UTL_HTTP.write_text(http_req, lv_process_xml_body);
    HTTP_RESP := UTL_HTTP.GET_RESPONSE(HTTP_REQ);
    UTL_HTTP.END_RESPONSE(HTTP_RESP);
    dbms_output.put_line('success');
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    END;
    But i am getting the error, unable to open the file
    Regarding certificate i have taken from the browser while running the above soa service in browser with 8002 port.
    Please let me know where i am doing wrong...
    Please if some one knows about steps ...... to do it to work
    Its urgent please help me out on this
    Thanks
    Dillip
    Edited by: 903915 on Dec 21, 2011 9:51 PM
    Edited by: 903915 on Dec 21, 2011 10:11 PM

    Oracle is hosted by HOST A - this is where the pl/sql program resides.
    The Web Service being accessed by pl/sql program is hosted by HOST B and there are 4 firewalls in between.
    Oracle was not even able to establish connection to web services host.
    Escalated the issue with networking folks and they resolved the connectivity problem.
    Hope that helps.

  • UCCX 9 web services / Stored Procedure

    I'll appreciate if you guys can help me on this...   Our application group already created automated bill payment web site.  I would like to do similar things by using UCCX 9.  When customers call, they enter Customer ID, credit card/check number and amount of bill they want to pay...etc...   Our Application guy asked me to find out if UCCX can call web services or if UCCX can pass values to Stored procedure.   The question is what steps/functions do I need to accomplish this task?   Please advise...
    Thank you,
    Nana

    Hi Nana
    Web Services: You can create custom Java code to connect to the web services, or use other methods. Here's some examples:
    https://supportforums.cisco.com/thread/270279
    https://supportforums.cisco.com/thread/2143901
    Stored Procs: Looks like this is also possible though I've not done it myself :
    https://supportforums.cisco.com/thread/2079597
    Regards
    Aaron

  • Creating Web service for PL/SQL Procedure with Complex Data Types

    I need to created web service for PL/SQL Procedure with Complex Data types like table of records as parameters, how do we map the pl/sql table type parameters with web service, how to go about these?

    Hello,
    When you are creating a service from a Stored Procedure, the OracleAS WS tools will create necessary Java and PL wrapper code to handle the complex types (table of record) properly and make them compatible with XML format for SOAP messages.
    So what you should do is to use JDeveloper or WSA command line, to create a service from your store procedure and you will see that most of the work will be done for you.
    You can find more information in the:
    - Developing Web Services that Expose Database Resources
    chapter of the Web Service Developer's guide.
    Regards
    Tugdual Grall

  • Publish PL/SQL procedures as web services?

    I am investigating JDeveloper for possible use in a project we are starting. We already have existing PL/SQL Procedures that we want to use and I have done a prototype using XSQL and OWA in JDeveloper 9i Candidate version. I am trying to figure out what the changes and improvements are in the most recent version of JDeveloper. On this page http://technet.oracle.com/products/jdev/htdocs/jdev903_fo.html#web_services it says there is broader support for Publishing PL/SQL procedures as web services. Is there any more information out there on this? What exactly has been improved and what are the current limitations. I did find some documentation in the Oracle9i Application Server Developers Guide on the limitations (release 2 (9.0.2) http://download-west.oracle.com/docs/cd/A97329_01/web.902/a95453/plsqlservices.htm#1030066 Do I assume this is the same limitations for JDeveloper since the Oracle9iAS included with it? I am getting confused by all this documentation.
    Thanks for any help
    Natalie

    Natalie,
    Please take a look at the tutorials on
    http://otn.oracle.com/tech/webservices/database.html
    Also, read the Web Service discussion forum where you will find some useful hints. Using 9.2.x DB, OC4J 9.0.4 and JDev9.0.3.1 it is really funny to start publishing PL/SQL as Web Service.
    Flemming

Maybe you are looking for

  • How to Get the required List Item values by using Where Clause

    I have two tables named "TAX_RULES","BILL" 1. " Tax_Rules" (Sub_Head_Code,Tax_ID,Tax_Percentage) { While "Sub_Head_Code" field is unique, Tax_ID describes that there are two kinds of Tax_IDs based on Tax_percentage which is 6% for some Sub_Head_Codes

  • How can I stop iTunes from repeatedly attempting to download old podcasts?

    Old podcasts keep coming back in my downloads. delete them and they keep coming back. even some I listened to and then removed come back later. Not the 24 hour wait problem, some of these are months old since i listened to them.

  • ITunes doesn't open after upgrade

    No error messages and I have loaded the most recent version of 7.x. I do receive the licensing agreement, but the software won't open visibly, it is running in task manager. Assistance would be GREATLY appreciated. I've uninstalled an reinstalled and

  • I get a message that says ipod is full

    I have the 4gb ipod nano and I only have 3.7 gb of music on there, and when I try to update it with 1 or 2 new songs I get a message that says "cannot update. ipod is full" Anyone have an idea to fix this or know what it means?

  • E2E Workload Analysis for BI

    Hi All, Currently we are searching for BI - IP workload analysis tools. I come to know that SolMan Diagnostic tool E2E Workload Analysis for BI useful somewhat to measure the work load. Kindly anybody can tell me 1. Is this tool works for JAVA enviro