Dynamic parameters RESTful Service by POST method.

Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production

Currently the RESTful in post method Service have 2 static parameters such as P1 and P2.

for example

BEGIN

INSERT INTO INSERT_TABLE (LOG_DESC, LOG_ID)

VALUES(:P1,:P2);

COMMIT;

END;

How to pass several parameters in the HTTP call when the parameter is unknown? Dynamic parameter is possible?

Thank you

MINDMAP thanks for your quick response. I must have misunderstood you. Please go through my description of the issue update. I created another question thread link is https://community.oracle.com/message/12612734#12612734

Thank you

Tags: Database

Similar Questions

  • Dynamic parameters for a CFHTTP POST request

    I need to call a service CFHTTP (Post), but the parameters passed to the function are dynamic, so there is no way to create a static list of tags CFHTTPPARAM. In fact, there are a few static parameters, but there will always be dynamic parameters that are included in the query based on the values set for the static settings.

    My question is how to pass form data in a POST CFHTTP query when the parameters that should be passed are not known in advance? I see that there is a type attribute of the CFHTTPPARAM of 'head' and 'body' tag, so I thought that it would be possible to manually build the data that are passed, but what is the right way to pass parameters to form if I build the 'head' and 'body' data myself?

    What is the problem with the dynamic tags. That's why they exist.







  • How to pass the parameters in the http post method?

    Hello

    I want to download the mp3 file on server and I need to pass two parameters with the post method.

    Here is my code for this.

                          String userid="id_user=8379";
                  String filename="trackName=sample.mp3";
                  String params=userid+"&"+filename;            
    
                            httpcon=(HttpConnection)Connector.open("http://api.upload.com/gStorage/uploadSong?output=json",Connector.READ_WRITE);
                httpcon.setRequestMethod(HttpConnection.POST);
                httpcon.setRequestProperty("Content-type","application/x-www-form-urlencoded");
                httpcon.setRequestProperty("Content-type","audio/mpeg3");
                os=httpcon.openOutputStream();
                os.write(params.getBytes("UTF-8"));
                fc=(FileConnection)Connector.open("file:///E:/sample.mp3",Connector.READ_WRITE);
                fileis=fc.openInputStream();
                bos=new ByteArrayOutputStream();
                byte[] data=new byte[50000];
                int ch;
                while ((ch=fileis.read(data,0,data.length))!=-1) {
                    bos.write(data,0,ch);
                }
                os.write(bos.toByteArray());
                os.close();
                System.out.println("Response code From server"+httpcon.getResponseCode());
                if(httpcon.getResponseCode()!=HttpConnection.HTTP_OK)
                {
                    System.out.println("Failed to upload bytes");
                }
                else
                {
                    //is=httpcon.openInputStream();
                    DataInputStream dis=httpcon.openDataInputStream();
                    int ch1;
                    StringBuffer buffer1=new StringBuffer();
                    while ((ch1=dis.read())!=-1) {
                        buffer1.append((char)ch1);
                    }
                    System.out.println("Response From Server"+buffer1.toString());
                }
            } i am getting response code ok but fail to upload file.
    

    may I passing the parameter in the wrong way?

    thankx.

    Hello

    Nitin I currently do a midlet project.

    So I used multipart post method.

    I just read this article. http://MindTouch.firmstep.com/AchieveForms/Design_Guide/Integration_Actions/types/HTTP_POST#top

    package com.http.main;
    
    import java.io.ByteArrayOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Enumeration;
    import java.util.Hashtable;
    
    import javax.microedition.io.Connector;
    import javax.microedition.io.HttpConnection;
    
    import com.sun.midp.io.BufferedConnectionAdapter;
    
    public class HttpMultipartRequest
    {
        static final String BOUNDARY = "----------V2ymHFg03ehbqgZCaKO6jy";
    
        byte[] postBytes = null;
        String url = null;
    
        public HttpMultipartRequest(String url, Hashtable params, String fileField, String fileName, String fileType, byte[] fileBytes) throws Exception
        {
            this.url = url;
    
            String boundary = getBoundaryString();
    
            String boundaryMessage = getBoundaryMessage(boundary, params, fileField, fileName, fileType);
    
            String endBoundary = "\r\n--" + boundary + "--\r\n";
    
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
    
            bos.write(boundaryMessage.getBytes());
    
            bos.write(fileBytes);
    
            bos.write(endBoundary.getBytes());
    
            this.postBytes = bos.toByteArray();
    
            bos.close();
        }
    
        String getBoundaryString()
        {
            return BOUNDARY;
        }
    
        String getBoundaryMessage(String boundary, Hashtable params, String fileField, String fileName, String fileType)
        {
            StringBuffer res = new StringBuffer("--").append(boundary).append("\r\n");
    
            Enumeration keys = params.keys();
    
            while(keys.hasMoreElements())
            {
                String key = (String)keys.nextElement();
                String value = (String)params.get(key);
    
                res.append("Content-Disposition: form-data; name=\"").append(key).append("\"\r\n")
                    .append("\r\n").append(value).append("\r\n")
                    .append("--").append(boundary).append("\r\n");
                System.out.println("****In while Loop:-****"+res);
            }
            res.append("Content-Disposition: form-data; name=\"").append(fileField).append("\"; filename=\"").append(fileName).append("\"\r\n")
                .append("Content-Type: ").append(fileType).append("\r\n\r\n");
            return res.toString();
        }
    
        public byte[] send() throws Exception
        {
            HttpConnection hc = null;
    
            InputStream is = null;
    
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
    
            byte[] res = null;
    
            try
            {
                hc = (HttpConnection) Connector.open(url);
    
                hc.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + getBoundaryString());
                hc.setRequestProperty("Content-Length",postBytes+"");
    
                hc.setRequestMethod(HttpConnection.POST);
    
                OutputStream dout = hc.openOutputStream();
    
                dout.write(postBytes);
                dout.close();
    
                int ch;
    
                is = hc.openInputStream();
                StringBuffer buffer=new StringBuffer();
    
                while ((ch = is.read()) != -1)
                {
                    bos.write(ch);
                    buffer.append((char)ch);
                }
                res = bos.toByteArray();
                System.out.println(buffer.toString());
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }
            finally
            {
                try
                {
                    if(bos != null)
                        bos.close();
    
                    if(is != null)
                        is.close();
    
                    if(hc != null)
                        hc.close();
                }
                catch(Exception e2)
                {
                    e2.printStackTrace();
                }
            }
            return res;
        }
    }
    

    and use it in this way

    public void getBytes()
        {
            ByteArrayOutputStream bos=null;
            try
            {
                bos=new ByteArrayOutputStream();
                InputStream fis=getClass().getResourceAsStream("/super.mp3");
                int ch;
                byte[] data=new byte[120];
                while((ch=fis.read(data,0,data.length))!=-1)
                {
                    bos.write(data,0,data.length);
                }
                Hashtable params=new Hashtable();
                //params.put("id_user","8474");
                params.put("id_user","8379");
                params.put("file1","audio.mp3");
                HttpMultipartRequest httpreq=new HttpMultipartRequest("http://api.upload.com/gStorage/uploadSong?", params,"file1","xpressMusic.mp3","audio/mpeg",bos.toByteArray());
                httpreq.send();
                bos.close();
                fis.close();
            }
            catch (Exception e) {
                System.out.println("Exception"+e);
            }
    

    Here, the key is contenttype, contentLength.you can get the info on it from the link above.

    thankx.

  • Service web apex with POST method

    Hello Apex experts, I am trying to run the web service with the POST method, but not able to make it work (apex 4.2 on apex.oraclecorp.com). Does anyone have example on using the POST method?

    Best

    Renato

    Hello

    Please check the thread below:

    RESRful POST method

    Hope this helps!

    (Note: If you think it answers your question, please mark it as correct answer.) This will help other users in the community)

    Thank you
    Benhamdia

  • Problem with RESTful services and several optional parameters

    Hello

    Apex 4.2.5 I created following RESTful services:

    / test/multiplepar / {p1}

    / test/multiplepar / {p1} / {p2}

    / test/multiplepar / {p1} / {p2} / {p3}

    Practitioners will make has that {p2} and {p3} are supposed to be optional parameters, in a way 'cascading '.

    The underlying queries are respectively:

    Select: p1 double p1

    Select: p1 p1: p2 p2 double

    Select: p1 p1: p2 p2,: p3 p3 of the double

    However when I run:

    http://Server/Apex/WS/rest/test/multiplepar/1/2/3

    I get the result below...

    {

    "items":]

    {

    P1: "1/2/3"

    }

    ]

    }

    He takes everything as {p1} instead of divide among the 3 parameters.

    I'm sure that it is valid and I saw him work before... (in this same environment)

    Any ideas?

    Thank you

    Luis

    Nevermind, I found out that the 'priority' field must be set accordingly in the resource model.

  • RESTful Service search parameters

    Hello

    I use APEX 4.2.2... with earphone 2.0.3

    I want to expose data in the EMP table as a RESTful Service with parameters:

    The source is:

    Source type: SQL query.Format: JSON
    
    select * from emp where 
    (:job IS NULL OR job = :job)
     and
    (:ename is null or ename = :ename)
    
    
    
    Model of the URI:employeesfeed / {job} / {ename}

    If I use this URL, it works very well...

    http://oraclesrv/real_estate/property/HR/employeesfeed/Manager/Blake

    and this gives:

    {"next":{"$ref":"http://oraclesrv/real_estate/property/hr/employeesfeed/MANAGER/BLAKE?page=1"},"items":[{"empno":7698,"ename":"BLAKE","job":"MANAGER","mgr":7839,"hiredate":"1981-04-30T20:00:00Z","sal":2850,"deptno":30}]}
    

    But, as you will notice may be in the logic of the Source, the "end user" should be able to retrieve all MANAGERS using this link.

    http://oraclesrv/real_estate/property/HR/employeesfeed/Manager/null

    But, this gives:

    {"items": []}

    So, how can I retrieve all managers? (using this Source).

    Kind regards

    The four letters (n, u, l, and l) at the end of your URL are a string of length 4.

    Basically, you make this comparison:

    'null' is null (which is false)

    If you want to keep this syntax, add

    or upper(:job) = 'NULL '.

    MK

  • This allows a procedure or a pl sql func as a rest service

    Hello

    I have a simple sql pl under hr schema named full_name function which takes two parameters firstName and lastName, fullname returns

    function full_name (varchar2, varchar2 lname fname)

    return varchar2

    is

    l_fullname varchar2 (30);

    Start

    return fname | » '|| lname;

    end full_name;

    The question is how this function is enable? I find no doc on this subject. When I click right function on sqldeveloper I don't see "Enable rest" option.

    In sql developer, the development menu remains, how code block must be implemented and how to set the settings to make my function remains enabled and how can I pass these params to rest service?

    This same issue applies to enablement rest of the proc.

    Hi User595758-OC,

    User595758-OC says:

    Kiran thank you for your interest. I followed the first blog which addresses my needs specifically.

    In the case of a parameter ' /: id "notation is used in the uri path, but in my case I need to put two params fname and lname in the service definition.

    Is it possible to create a path uri as "ADR/HR/fullname? fname =: first name & lname =: lname. If so, how the definition should be?

    According to the URI scheme "departments /: id" given in the example above, blog post

    for your RESTful Web Service with two parameters, the URI scheme can be "fullname /: fname /: lname.

    Kind regards

    Kiran

  • Web - REST service reference

    I have a REST GET service that supports p1 and p2 as a parameter and returns a base line. I am trying to build the web service reference. {I select REST as the webreference and then give it a meaningful name and attachment of the URL with the URI suffixed (2 settings) for example http:xx.xx.xx./xyz/customer_number/{customer}/salesrep_number/{salesrep_number}, no proxy and I select the name of the GET, JSON, no output basic authentication method. Now I have 2 parameters - salesrep_number and customer to define and try to run a test and he complains not FOUND, are not just URI syntax since it is what has been set in the RESTFUL Web service and it works from the workshop/Restful SQL service but fails under References webservice under shared components. Any help is appreciated.

    Hi P.T.

    You mentioned 'he doesn't like the character '.' at the end.' -What exactly do you mean by "it"?   Just to be clear, you don't need to modify the RESTful Service module that you defined under SQL Workshop > Services RESTful - which must remain in its URI template using {client}.  The & nom_element. I already mentioned the syntax is specifically designed for the URL you set in shared components > a Web Service reference.

    Lets try this - take a look at the example of Service default RESTful, oracle.example.hr, installed in your workspace under SQL Workshop > RESTful Services.  In this module, you will see a empsec / {empname} example.

    1. If you test this example with the button 'Set Bind Variables' and provide a valid employee of the KING name in the value field, click on test to make sure that you managed to get the JSON result.  Take note of the URL generated for this test.
    2. Now access your application and create a web service reference based on this particular example, through shared components > Web Service References > Create.
    3. When executing step by step through the wizard, set the URL to the empsec / {empname} example, but replace {empname} with & EMPNAME. for example http://hostname/services/hr/empsec/&EMPNAME.
    4. Now, run the Wizard Page, and then select form > form report on Service Web-> step through the wizard, selecting the web reference service that you created in step 4 and click Next until you reach the last step of the wizard, where you will then click on create to complete.
    5. Change the page created, and then run the wizard to create a new item and create a new item of type page text field, with the name EMPNAME - to correspond with the binding reference variable in your URI.
    6. Run this page, enter KING in the text field and click on submit.  The region of results on the page should then be filled with the JSON result returned by the web service.

    If you can get this example to work, you will be able to compare the empsec / {empname} example with your own, which should hopefully help identify all differences that may ask questions.

    Kind regards

    Hilary

  • Is it possible to use a Type of personalized content for the REST service operation messages?

    I try to POST to the third party, documentum of EMC, REST service using service broker in 8.53 peopletools integration operations. Unfortunately, the third party only accepts a content type of 'application/vnd.emc.documentum+json', which I could not send PeopleSoft and use a message definition at the same time.

    In my service operation, if I do NOT fill the request message I can POST to the URI with the such custom content type defined in the property page of the connector in the routing. I have not found a way to do it and also present JSON content on demand, since there is no message associated with the operation. Is it possible to include in this type of message content without using a request message?

    If I DO not fill the request message I can't POST successfully because the message content-type of "application/json" gets passed as the content-type instead of the value in the property page of the connector from the routing. Is it possible to change the content type during the use of a message definition?

    Thank you

    Paul

    Hi Paul - you can turn on tracing by using the on demand connection as follows:

    1. on the routing set detail header and detail "journal".

    2. Main Menu > PeopleTools > Integration Broker > Service Operations Monitor > Administration > control installation Options

    -Enable logging of the bridge

    -On the registration of demand = 5 (to enable detailed logging)

    Note: On request connection only works for the outgoing synchronous Services. In this case, we should be fine. You will find the by transaction log file on your gateway web server... / applications/peoplesoft/PSIGW.war/WEB-INF/.

    I did it for one of the REST service operations my test (I'm on 8.52.22). I have my content type of message the value application/json to the operation of the service page. On the routing page, I added a connector property content-type=application/vnd.emc.documentum+json.

    Here are the results on the integration gateway logs:

    Message-ID:<-.................@nowhere>

    MIME-Version: 1.0

    Content-Type: multipart/related; Boundary = "Integration_Server_MIME_Boundary."

    Content-ID: PeopleSoft-internal-Mime-Message

    PeopleSoft-ToolsRelease: 8.52

    -Integration_Server_MIME_Boundary

    Content-Type: text/plain; Charset = UTF-8

    Content-Transfer-Encoding: 8 bit

    Content-ID: IBInfo

    Content-Disposition: inline

    Sync There ... * deleted for security purposes *... ContentSection0text/plainN

    CREATE5000000000000

    -Integration_Server_MIME_Boundary

    Content-Type: text/json

    Content-Transfer-Encoding: 8 bit

    Content-ID: ContentSection0

    Content-Disposition: inline

    username = * collected for security purposes * & password = * deleted for security purposes *.

    -Integration_Server_MIME_Boundary-

    The Content-Type of the delivery is sent as HTTP Connector of the target and the content of the message (text/json) Type property is always persistent (see the text in bold above). You can compare logs between your two scenarios (with and without the message in the POST) and see if you find something interesting.

    I even tried the following code to see if that helps, but I get the same results.

    & MSG. IBInfo.LoadRESTHeaders ();

    / * Adds additional headers not defined on the route * /.

    REM & MSG. IBInfo.ConnectorOverride = True;

    bRet = & MSG. IBInfo.IBConnectorInfo.AddConnectorProperties ("Content-Type", "application/vnd.emc.documentum+json", % Httpentete);

    & RESP = IntBroker.SyncRequest % (&MSG);)

    I'm working on a similar project at this moment where I'm integrating perceptual Nolij Web RESTful API (Document Management System). I had to resort to using a http client base (common of apache) java instead of broker of integration because of the similar frustrations with REST (cookies are lost, unable to deal with raw binary data in a response message, etc.).

    Benefits: Java provides total flexibility.

    Cons: As we are bypassing framework Integration Broker, we need everything (error handlng, logging, etc.) do it ourselves.

  • RESTful service cannot insert data using PL/SQL.

    Hi all
    Spin: stand-alone 2.01 AL on OEL 4.8 in box a. VM
    Database Oracle 10.2.0.4 with Apex 4.2.0.00.27 on OEL4.8 in the VM B box.

    Measure of oracle.example.hr performed without problem Restful services.

    Cannot insert data using AL 2.0.1 but works on 1.1.4 AL.
    who uses the following table (under scheme: scott):
     
    create table json_demo ( title varchar2(20), description varchar2(1000) ); 
    grant all on json_demo to apex_public_user; 
    and procedure (scott diagram) below:
    CREATE OR REPLACE
    PROCEDURE post(
        p_url     IN VARCHAR2,
        p_message IN VARCHAR2,
        p_response OUT VARCHAR2)
    IS
      l_end_loop BOOLEAN := false;
      l_http_req utl_http.req;
      l_http_resp utl_http.resp;
      l_buffer CLOB;
      l_data       VARCHAR2(20000);  
      C_USER_AGENT CONSTANT VARCHAR2(4000) := 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)';
    BEGIN
      -- source: http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/
      -- Ask UTL_HTTP not to raise an exception for 4xx and 5xx status codes,
      -- rather than just returning the text of the error page.
      utl_http.set_response_error_check(false);
      -- Begin the post request
      l_http_req := utl_http.begin_request (p_url, 'POST', utl_http.HTTP_VERSION_1_1);
      -- Set the HTTP request headers
      utl_http.set_header(l_http_req, 'User-Agent', C_USER_AGENT);
      utl_http.set_header(l_http_req, 'content-type', 'application/json;charset=UTF-8');
      utl_http.set_header(l_http_req, 'content-length', LENGTH(p_message));
      -- Write the data to the body of the HTTP request
      utl_http.write_text(l_http_req, p_message);
      -- Process the request and get the response.
      l_http_resp := utl_http.get_response (l_http_req);
      dbms_output.put_line ('status code: ' || l_http_resp.status_code);
      dbms_output.put_line ('reason phrase: ' || l_http_resp.reason_phrase);
      LOOP
        EXIT
      WHEN l_end_loop;
        BEGIN
          utl_http.read_line(l_http_resp, l_buffer, true);
          IF(l_buffer IS NOT NULL AND (LENGTH(l_buffer)>0)) THEN
            l_data    := l_data||l_buffer;
          END IF;
        EXCEPTION
        WHEN utl_http.end_of_body THEN
          l_end_loop := true;
        END;
      END LOOP;
      dbms_output.put_line(l_data);
      p_response:= l_data;
      -- Look for client-side error and report it.
      IF (l_http_resp.status_code >= 400) AND (l_http_resp.status_code <= 499) THEN
        dbms_output.put_line('Check the URL.');
        utl_http.end_response(l_http_resp);
        -- Look for server-side error and report it.
      elsif (l_http_resp.status_code >= 500) AND (l_http_resp.status_code <= 599) THEN
        dbms_output.put_line('Check if the Web site is up.');
        utl_http.end_response(l_http_resp);
        RETURN;
      END IF;
      utl_http.end_response (l_http_resp);
    EXCEPTION
    WHEN OTHERS THEN
      dbms_output.put_line (sqlerrm);
      raise;
    END;
    and execution in sqldeveloper 3.2.20.09 when it connects directly to box B as scott:
     
    SET serveroutput ON
    DECLARE
      l_url      VARCHAR2(200)   :='http://MY_IP:8585/apex/demo';
      l_json     VARCHAR2(20000) := '{"title":"thetitle","description":"thedescription"}';
      l_response VARCHAR2(30000);
    BEGIN
      post( p_url => l_url, p_message =>l_json, p_response => l_response);
    END;
    leading to:
     
    anonymous block completed 
    status code: 200
    reason phrase: OK 
    with data inserted. 
    Installation using 2.0.1
       Workspace : wsdemo
     RESTful Service Module:  demo/
              URI Template:      test
                    Method:  POST
               Source Type:  PL/SQL
    and execution in sqldeveloper 3.2.20.09 when it connects directly to box B as scott:
     
    SET serveroutput ON
    DECLARE
      l_url      VARCHAR2(200)   :='http://MY_IP:8585//apex/wsdemo/demo/test';
      l_json     VARCHAR2(20000) := '{"title":"thetitle","description":"thedescription"}';
      l_response VARCHAR2(30000);
    BEGIN
      post( p_url => l_url, p_message =>l_json, p_response => l_response);
    END;
    leading to:
     
    status code: 500 
    reason phrase: Internal Server Error 
    
    Listener's log: 
    Request Path passes syntax validation
    Mapping request to database pool: PoolMap [_poolName=apex, _regex=null, _workspaceIdentifier=WSDEMO, _failed=false, _lastUpdate=1364313600000, _template=/wsdemo/, _type=BASE_PATH]
    Applied database connection info
    Attempting to process with PL/SQL Gateway
    Not processed as PL/SQL Gateway request
    Attempting to process as a RESTful Service
    demo/test matches: demo/test score: 0
    Choosing: oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as current candidate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=2648625079503782|2797815111031405, uriTemplate=demo/test], score=0, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=LogonConfig [logonForm=null, logonFailed=null]], originsAllowed=[], corsEnabled=true]
    Determining if request can be dispatched as a Tenanted RESTful Service
    Request path has one path segment, continuing processing
    Tenant Principal already established, cannot dispatch
    Chose oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as the final candidate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=2648625079503782|2797815111031405, uriTemplate=demo/test], score=0, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=LogonConfig [logonForm=null, logonFailed=null]], originsAllowed=[], corsEnabled=true] for: POST demo/test
    demo/test is a public resource
    Using generator: oracle.dbtools.rt.plsql.AnonymousBlockGenerator
    Performing JDBC request as: SCOTT
    Mar 28, 2013 1:29:28 PM oracle.dbtools.common.jdbc.JDBCCallImpl execute
    INFO: Error occurred during execution of: [CALL, begin
     insert into scott.json_demo values(/*in:title*/?,/*in:description*/?);
    end;, [title, in, class oracle.dbtools.common.stmt.UnknownParameterType], [description, in, class oracle.dbtools.common.stmt.UnknownParameterType]]with values: [thetitle, thedescription]
    Mar 28, 2013 1:29:28 PM oracle.dbtools.common.jdbc.JDBCCallImpl execute
    INFO: ORA-06550: line 1, column 6:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
       begin case declare exit for goto if loop mod null pragma
       raise return select update while with <an identifier>
       <a double-quoted delimited-identifier> <a bind variable> <<
       close current delete fetch lock insert open rollback
       savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 74:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
       begin case declare end exception exit for goto if loop mod
       null pragma raise return select update while with
       <an identifier> <a double-quoted delimited-id
    
    java.sql.SQLException: ORA-06550: line 1, column 6:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
       begin case declare exit for goto if loop mod null pragma
       raise return select update while with <an identifier>
       <a double-quoted delimited-identifier> <a bind variable> <<
       close current delete fetch lock insert open rollback
       savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 74:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
       begin case declare end exception exit for goto if loop mod
       null pragma raise return select update while with
       <an identifier> <a double-quoted delimited-id
    
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
            at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
            at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
            at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:505)
            at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:223)
            at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
            at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:205)
            at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1043)
            at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1336)
            at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3612)
            at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3713)
            at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4755)
            at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1378)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at oracle.ucp.jdbc.proxy.StatementProxyFactory.invoke(StatementProxyFactory.java:242)
            at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:124)
            at oracle.ucp.jdbc.proxy.CallableStatementProxyFactory.invoke(CallableStatementProxyFactory.java:101)
            at $Proxy46.execute(Unknown Source)
            at oracle.dbtools.common.jdbc.JDBCCallImpl.execute(JDBCCallImpl.java:44)
            at oracle.dbtools.rt.plsql.AnonymousBlockGenerator.generate(AnonymousBlockGenerator.java:176)
            at oracle.dbtools.rt.resource.templates.v2.ResourceTemplatesDispatcher$HttpResourceGenerator.response(ResourceTemplatesDispatcher.java:309)
            at oracle.dbtools.rt.web.RequestDispatchers.dispatch(RequestDispatchers.java:88)
            at oracle.dbtools.rt.web.HttpEndpointBase.restfulServices(HttpEndpointBase.java:412)
            at oracle.dbtools.rt.web.HttpEndpointBase.service(HttpEndpointBase.java:162)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
            at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.doFilter(ServletAdapter.java:1059)
            at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.invokeFilterChain(ServletAdapter.java:999)
            at com.sun.grizzly.http.servlet.ServletAdapter.doService(ServletAdapter.java:434)
            at oracle.dbtools.standalone.SecureServletAdapter.doService(SecureServletAdapter.java:65)
            at com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:379)
            at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
            at com.sun.grizzly.tcp.http11.GrizzlyAdapterChain.service(GrizzlyAdapterChain.java:196)
            at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
            at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
            at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
            at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
            at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
            at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
            at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
            at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
            at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
            at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
            at java.lang.Thread.run(Thread.java:662)
    Error during evaluation of resource template: ORA-06550: line 1, column 6:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
       begin case declare exit for goto if loop mod null pragma
       raise return select update while with <an identifier>
       <a double-quoted delimited-identifier> <a bind variable> <<
       close current delete fetch lock insert open rollback
       savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 74:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
       begin case declare end exception exit for goto if loop mod
       null pragma raise return select update while with
       <an identifier> <a double-quoted delimited-id
    Please notify.
    Concerning
    Zack

    Zack.L wrote:
    Hi Andy,.

    Sorry, I forgot to post the Source that is used by the AL1.1.4 and the AL2.0.1.

    Source

    begin
    insert into scott.json_demo values(:title,:description);
    end;
    

    It is a failure during insertion?
    Yes, he failed in the insert using AL2.0.1.

    If the above statement produces the following error message:

    The symbol "" was ignored.
    ORA-06550: line 2, column 74:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
     
    

    That gives me to think that a character is not printable (notice how there is anything between the quotation marks - "") worked his way in your PL/SQL Manager. Note how the error is reported to correspond to a column 74 on line 2, line 2 of the block above has 58 characters, so a pure assumption somehow, there is extra space on line 2, which confuses the PL/SQL compiler, I suggest retype PL/SQL Manager manually and see if that solves the problem.

  • Access Web Service via POST - missing parameter

    I'm trying to access web services using the Http Post method, but I'm System.InvalidOperationExeption: missing parameter: ID

    error.

    I can access the Web service using HTTP GET, which shows that there is nothing wrong with the Web Service itself successfully.

    Here is the code I am trying

    String retVal = "";      try       {
    
              String data = "id='25'"; // parameter of the method           URLEncodedPostData encodedData = new URLEncodedPostData(null,false);          encodedData.append("content", data);
    
              byte[] postData = encodedData.getBytes();
    
              HttpConnection connection = (HttpConnection)Connector.open("http://localhost/Service1.asmx/TestService1");            connection.setRequestMethod("POST");          connection.setRequestProperty("Content-type", "application/x-www-form-urlencoded");           connection.setRequestProperty("Content-Length", Integer.toString(postData.length));
    
              OutputStream requestOutput = connection.openOutputStream();           requestOutput.write(postData);            requestOutput.close();
    
              int responseCode = connection.getResponseCode();
    
              String contentType = connection.getHeaderField("Connect-type");           ByteArrayOutputStream baos = new ByteArrayOutputStream();                     InputStream responseData = connection.openInputStream();          byte[] buffer = new byte[1000];           int bytesRead = responseData.read(buffer);                     while(bytesRead >0)            {             baos.write(buffer,0,bytesRead);               bytesRead = responseData.read(buffer);            }         baos.close();         connection.close();           return baos.toString();
    
          }     catch (IOException e)         {         return "ERROR: " + e.getMessage();        }
    

    The line in the "BOLD" throws an exception. HTTP response code I get from server is 500

    Any help would be much appreciated.

    Nitin

    Now, I found the solution.

    The problem was the URLEncodedPostData. If I use just string.getbyte (), it works.

  • With regard to the ADF Restful Services in 12.2.1

    I went through restful ADF services article in the guide of the developer and some examples, but its only contours:

    (1) how to expose methods standard and custom Vo as a restful service. There is no mention of how to expose the custom method AM restful service, is it possible from now with automated wizard provided by ADF 12.2.1 for restful service?

    (2) a typical use case is to write a function which is given to couple view of your and do some massaging until it can be written in a custom am method all your available, but how expose it as a restful service, the only option I see to this effect in 12.2.1 is to use SOAP service if I use automated restful services Wizard and do not write service JAX - RS scratch code creating an instance module root of service application, but our architecture warrants to use rest AND JASON architecture style.

    If anyone has idea about this or has any comments/blogs about it in 12.2.1, please let us know!

    Concerning

    Mukul

    In the 12.2.1 version we still have no support for the exhibition AM level method REMAINS the use of assistants to REST.

    (You could build a Java class that access the AM and then expose this class REMAINS).

    If it is the important scenarios for you please contact the Oracle Support and add your request to the emergency that follows this feature - 16851420.

  • [MAF - AMPA] Strange behavior of the MAF with REST service

    Hi MAF Experts.

    I just noticed that there is a strange behavior in my application of the MAF. The first loading of the page, amx:page does not make its contents (of REST). However if I kill the app and relaunch the app, content appears.

    Pattern:

    1. Start of the CRG App
    2. Opening of session
    3. Dashboard (the content is rendered)
    4. Go to any other aspect (lets say a list of products)
    5. Open product list (content do not get returned)
    6. Kill the MAF application
    7. Start of the CRG App
    8. Dashboard (the content is rendered)
    9. Go to the product list
    10. List of products (content gets rendered)

    I put a few breakpoints on EntityCRUDService and RestPersistenceManager.

    So far it return the list of entities and display the correct data (from watches in debug mode)

    Last thing I noticed is the red color below. She defined the EntityList with the new value of REST (This displays a correct value).

    TaskExecutor.getInstance (.execute (isDoRemoteReadInBackground ())

    , () -> {

    Auto Sync all actions pending first, pass false for inBackground because

    We want to process actions pending before the reading distance

    getDataSynchManager (.synchronize (false));

    The list of entities < E > = executeRemoteFindAll();

    If (entities! = null)

    {

    When an error occurs (for example server is not available, the method returns the value zero)

    setEntityList (entities);

    }

    });

    Any suggestion?

    All the rest service are configured with AutoQuery = true in the persistence - mapping.xml

    See you soon,.

    Hendry

    Hendry,

    Thanks your testcase, I was able to understand the problem.

    It turns out that MAF 2.1 has problems dealing with the advanced way in which AMPA running background tasks with the help of a thread in all of features.

    We have slightly modified the implementation in AMPA to use one thread per function and now the update issue is resolved. I sent you a link to new construction.

    We will publish the new generation soon on GitHub so that others can benefit in the same solution.

    Steven Davelaar,

    Oracle Mobile A-team.

  • Stream error when you call a REST Service

    I am doing a customer REMAINS with AS3, I followed this tutorial: http://help.Adobe.com/en_US/AS3/dev/WSb2ba3b1aad8a27b061afd5d7127074bbf44-8000.html

    My code is as follows:

    import flash.events.Event;

    import flash.events.ErrorEvent;

    import flash.events.IOErrorEvent;

    import flash.events.SecurityErrorEvent;

    import flash.net.URLLoader;

    import flash.net.URLRequest;

    import flash.net.URLRequestMethod;

    import flash.net.URLVariables; 


    var url:String = "https://localhost:8443/restcomponent/tesimalex"; 


    var requestor:URLLoader = new URLLoader(); 


    function restServiceCall():void

    {

      trace("Calling REST Service...");

      //Create the HTTP request object

      var request:URLRequest = new URLRequest( url );

      request.method = URLRequestMethod.GET;

      //Initiate the transaction

      requestor = new URLLoader();

      requestor.addEventListener( Event.COMPLETE, httpRequestComplete );

      requestor.addEventListener( IOErrorEvent.IO_ERROR, httpRequestError );

      requestor.addEventListener( SecurityErrorEvent.SECURITY_ERROR, httpRequestError );


      requestor.load( request );

    }


    function httpRequestComplete( event:Event ):void

    {

      trace( event.target.data );

    }


    function httpRequestError( error:ErrorEvent ):void

    {

      trace( "An error occured: " + error.toString() );

    }

    The only difference between my code and that in the tutorial's URL variables, that I commented on, and the url used.

    My REST service is a simple GET, if I type the url in the browser, it shows me that the returned JSON.

    But in my AS3 when I call the method restServiceCall() returns the following error message:

    Error opening URL "https://localhost:8443/restcomponent/tesimalex? An error: [IOErrorEvent type = "ioError" bubbles = false cancelable = false eventPhase = 2 text = "Error #2032: stream error."] URL: https://localhost:8443/restcomponent/tesimalex? »]

    Anyone know whats wrong?

    I really don't know about this link, but in my opinion it's a security issue, because it opens in the browser, also for security reasons! as I see that you have disabled the safe browsing that of why it works in your browser, but not in flash. In any case try to download the file on the server because the good security situation be different then check if it will work there, use a text field to display the data.

  • Help! Weird question CF 9.02 when "in many" form fields are displayed in the 'post' method

    So we just installed cf9.02 64-bit on windows 2003 server machines brand new and migrated all code on and we have encountered in the wierdest (and very dead on the water) deliver, any display of a templae to FC with a "large" amount of fields using the method = "post" vomits, works well with the method = 'get' or with a small amount of fields.  Here are some examples of 'base' I pulled out of our application:

    https://dev1.mystudentsprogress.com/testposting/smallform.html -> it is method = 'post' and works well with a small number of fields, click on save and he called a CF model that simply says "index.cfm here."

    https://dev1.mystudentsprogress.com/testposting/formget.html -> it is method = 'get' and also works very well, click on save and then he calls a CF model that simply says "index.cfm here."

    https://dev1.mystudentsprogress.com/testposting/FormPost.html -> This is the method = 'post' and it barfs, click on save and you get a 500 error page

    And once this is the case that the 'next' call to even pages succesfull returns a blank page or go here:

    https://dev1.mystudentsprogress.com/testposting/smallform.html and click on save

    Go here again, and then click Save:

    https://dev1.mystudentsprogress.com/testposting/smallform.html


    .. There is nothing in any of the newspapers CF indicating any kind of errors, it's just flat barfs on forms with the post method and a large amount of fields, clearly a MAJOR issue because our app has a lot ot screens with a lot of fields!

    You could investigate the postParametersLimit and postSizeLimit values in file neo - runtime.xml of your server.  I suspect you'll need to increase the values of these two parameters.  Remember to save this file before making any changes. You will need to restart the CF server to apply the changes to the settings in this file.

    See FC 9.0.2 release notes for more information: http://helpx.adobe.com/coldfusion/release-note/coldfusion-9-0-update-2.html

Maybe you are looking for