Get binary data by using apex_web_service.make_rest_request ()?
Hello world.
Is it possible to get binary data (Content-Type: application/octet-stream) using APEX_WEB_SERVICE. Function MAKE_REST_REQUEST()?
That is to say: How to convert the return value of CLOB BLOB? The length of the CLOB responese receipt is right.
I'm try convert response CLOB BLOB as a result of track (APEX 4.2.3.00.08, Oracle-XE 11 g):
1)
DBMS_LOB.converttoblob (l_blob, l_response, DBMS_LOB. LOBMAXSIZE, l_offsetd, l_offset, 0, l_context, l_warning);
where:
number of l_offset: = 1;
number of l_offsetd: = 1;
l_context number: = 0;
number of l_warning;
2)
Function clob2blob (p_clob CLOB) returns the BLOB
as
l_blob BLOB;
l_str varchar2 (32767).
l_amount pls_integer: = 256;
l_offset pls_integer: = 1;
Start
DBMS_LOB.CREATETEMPORARY (l_blob, true);
DBMS_LOB. Read(p_clob,l_amount,1,l_str);
l_offset: = l_amount + 1;
l_blob: = to_blob (utl_raw.cast_to_raw (l_str));
loop
DBMS_LOB. Read (p_clob, l_amount, l_offset, l_str);
DBMS_LOB. Append (l_blob, utl_raw.cast_to_raw (l_str));
l_offset: = l_offset + l_amount;
end loop;
Return l_blob;
exception when no_data_found then
Return l_blob;
end;
Nothing works...
Where is my mistake?
Best regards, Mikle.
Your mistake is that you try to use a clob for binary data. Who is never going to work.
Try this
declare
l_response_content blob.
Start
l_response_content: =. getblob() httpuritype ('http://www.oracleimg.com/us/assets/u01-u06-f01-bg-sprite.png');
dbms_output.put_line (dbms_lob.getlength (l_response_content));
end;
Tags: Database
Similar Questions
-
Hi all
APEX Version: 4.0.2.00.07
DB: Oracle 11G R2
Web server: EPG
Portfolio info has been set up at the level of the APEX body, so APEX can access active SSL sites.
When I run the code in the following process page, to make the SOAP request to our intranet JIRA instance, works just fine.
However if I call a webserivce RESTful API using "apex_web_service" then I've always done with following error message.DECLARE l_envelope CLOB; l_xml XMLTYPE; lv_faultcode VARCHAR2(4000); lv_faultstring VARCHAR2(4000); BEGIN l_envelope := '<?xml version="1.0" encoding="UTF-8"?>' ||'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:m0="http://beans.soap.rpc.jira.atlassian.com">' ||'<SOAP-ENV:Body>' ||' <m:getIssuesFromFilterWithLimit xmlns:m="http://soap.rpc.jira.atlassian.com" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' ||' <in0>'||:F_JIRA_TOKEN||'</in0>' ||' <in1>'||HTF.escape_sc(:P4_IN1)||'</in1>' ||' <in2>'||HTF.escape_sc(:P4_IN2)||'</in2>' ||' <in3>'||HTF.escape_sc(:P4_IN3)||'</in3>' ||' </m:getIssuesFromFilterWithLimit>' ||' </SOAP-ENV:Body>' ||'</SOAP-ENV:Envelope>'; l_xml := APEX_WEB_SERVICE.MAKE_REQUEST( p_url => 'https://jira.xyz.com/tracker/rpc/soap/jirasoapservice-v2', p_action => 'https://jira.xyz.com/tracker/rpc/soap/jirasoapservice-v2/getIssuesFromFilterWithLimit', p_envelope => l_envelope ); END;
Code (call RESTful)The webservice was unreachable because either the URL you supplied was invalid, your environment requires a valid proxy server address for HTTP requests, or a wallet needs to be configured for HTTPS requests.
As you can see, the two requests are made to the same server. However during the SOAP request I get no errors, but in a restful query I get the error message. Can someone tell me what could be the problem?DECLARE lc_response CLOB; BEGIN apex_web_service.g_request_headers(1).name := 'Authorization'; apex_web_service.g_request_headers(1).value := 'Basic '||:F_JIRA_TOKEN_REST; lc_response:= APEX_WEB_SERVICE.MAKE_REST_REQUEST( p_url => 'https://jira.xyz.com/tracker/rest/api/2.0.alpha1/search?jql=assignee=John&startAt=1&maxResults=5', p_http_method => 'GET' ); END;
Best regards
HariHi Hari,
It's bug 16212066 - apex_web_service make_rest_request uses a wallet of the instance if it is not specified
which will be corrected in the APEX 4.2.2.To work around the problem, you can specify the parameter p_wallet_path and p_wallet_pwd when you call apex_web_service.make_rest_request.
Concerning
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
Download of CSV using Browse point (don't get no data found error)
Hello
I use procedure below to download CSV in my table.
CSV is to have null values in some places ex: 1,.
2,0.999
3,
4,0.696
below the procedure works fine when I am downloading as CSV: 1.0
2,0.999
3.0
4,0.696.
My table is seen as two columns, and I get no data found error when downloading a CSV of null values.
I went through import data in Excel to the database table but no use...
Please help me on this.
Procedure
===========
concerningDECLARE v_blob_data BLOB; v_blob_len NUMBER; v_position NUMBER; v_raw_chunk RAW(10000); v_char CHAR(1); c_chunk_len number := 1; v_line VARCHAR2 (32767) := NULL; v_data_array wwv_flow_global.vc_arr2; BEGIN -- Read data from wwv_flow_files select blob_content into v_blob_data from wwv_flow_files where UPDATED_BY = (select max(UPDATED_BY) from wwv_flow_files where UPDATED_BY = :APP_USER) AND id = (select max(id) from wwv_flow_files where updated_by = :APP_USER); v_blob_len := dbms_lob.getlength(v_blob_data); v_position := 1; -- Read and convert binary to char WHILE ( v_position <= v_blob_len ) LOOP v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position); v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk))); v_line := v_line || v_char; v_position := v_position + c_chunk_len; -- When a whole line is retrieved IF v_char = CHR(10) THEN -- Convert comma to : to use wwv_flow_utilities v_line := substr(v_line, 1, length(v_line)-2); v_line := REPLACE (v_line, ',', ':'); -- Convert each column separated by : into array of data v_data_array := wwv_flow_utilities.STRING_to_table (v_line); -- Insert data into target table EXECUTE IMMEDIATE 'insert into table_name@Schema1 (col1,col2) values (:1,:2)' USING v_data_array(1), v_data_array(2); -- Clear out v_line := NULL; END IF; END LOOP; END;
Chauvet
Published by: Chaumont on 26 September 2012 10:52
Published by: Chaumont Sep 26, 2012 22:25
Published by: Chaumont on 27 September 2012 01:58Chambers,
You can use wwv_flow_utilities.array_element to avoid any no_data_found. The function does not raise any errors. For example, for the line which only have a value of table when you wait 2, it can be useful.
EXECUTE IMMEDIATE 'insert into table_name@Schema1 (col1,col2) values (:1,:2)' USING wwv_flow_utilities.array_element(v_data_array,1), wwv_flow_utilities.array_element(v_data_array,2);
Kind regards
Christina -
This should be an easy solution, because all the other browsers and Firefox used to do this. Firefox is restarted the pages do not charge they just historical display. I have to hit the button reload current page to get new data. This has been driving me crazy for a few weeks. I thought I had fixed a couple of times but only a few pages loaded and now it's the whole story again.
Joe
Oh, you use the Session Manager. What happens if you check the box in the Session Manager options, to the title of the backup & restore, "Reload All restored Windows"?
-
Hello
I lost the password I gave to a drive using Bitlocker in Windows 7, how can I return it or I can get the data in the back of the player? Data are very important because by my studies are concerned. Help, please. Thank you!Hello
I lost the password I gave to a drive using Bitlocker in Windows 7, how can I return it or I can get the data in the back of the player? Data are very important because by my studies are concerned. Help, please. Thank you!People like you that encryption data with bitlocker do it because they want their data accessible only by those who have the certificate. The sad news for you is that you have made a good choice with BitLocker: unless you have the certificate, your data remains inaccessible. There is no backdoor. If he had then BitLocker would be useless. -
Is there a way to get the data for submission of form of eloqua using the REST API?
I was wondering if there is a way to get the data for submission of form of eloqua using the REST API?
Thank you
On the page that egan related, there is a 'RawData' field for FormSubmit activities. In this area, the raw sending the form query string is returned.
Whatever it is, you can get this info from the activities of the API block, or the endpoints data Rest API.
-
How to get the data center moref moref VM in c# using
Hi all
Could someone tell how to get managedobjectreference of data center using the VM moref? or any other easy way is? If anyone has examples of code in c# please share with me?
Thank you
Vijaya
You can get the data center in which the virtual machine resides by the following search:
VM Moref-> Parent (vmFolder)
Moref folder VM-> Parent (data center)
Parent of the virtual computer object will always be the vmFolder and the vmFolder object will always be a data center.
For more details on the model of article inventory of vSphere, take a look at this blog post - http://www.doublecloud.org/2010/03/vsphere-inventory-structure-deep-dive/
-
Code to get the data in the child table in composite SOA using the IOM APIs
Hi all
I am a new bie to IOM. I have a query related to obtaining data in the child table using the API of the IOM in the task of embeded java SOA composite.
I've created a workflow that has a form of child of providing service of slef. I created a composite SOA custom also approval. In the composite approval I have embedded java code and I want to get the values entered in the child form using the API IOM inot the java code embeded in composite SOA.
I tried gettting the child form data by using getChildAttributes(), but I'm getting the following exception.
The local Exception stack:
Exception [EclipseLink-7242] (Eclipse - 2.1.3.v20110304 persistence Services - r9073): org.eclipse.persistence.exceptions.ValidationException
Description of the exception: an attempt was made to navigate a relationship using indirection that had a null Session. This often happens when an entity has a relationship of LAZY not instantiated is serialized and this lazy relationship is crossed after serialization. To avoid this problem, instantiate the LAZY relationship before serialization.
at org.eclipse.persistence.exceptions.ValidationException.instantiatingValueholderWithNullSession(ValidationException.java:994)
at org.eclipse.persistence.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:218)
at org.eclipse.persistence.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:83)
at oracle.iam.request.vo.RequestBeneficiaryEntityAttribute.getChildAttributes(RequestBeneficiaryEntityAttribute.java:100)
to com. CASApproval.main (CASApproval.java:137)
Please suggest me if I'm following the correct procedure of the child form data or if we can use another approach.
Can we get the data using formInstanceOperationsIntf.getProcessFormChildData ().
Thanks in advance for the help.
Thank you
PTWhen you're in approvals, there is no form of process data. Process form data would come only when approvals are completed. If you want to read data from the child form of the DataSet (i.e. the form object as in OIM9.x) you can use the RequestService on the id of the request and read the data. Or another approach would be to the child the dataset data value in the payload of the request and read the XML payload in the composite.
Let me know if you need more information about the second approach. As for the first approach, search through the forums here and you should find my previous posting on how to reach child dataset values using the ask service API.-Marie
Found these for you:
OIM11G: Way to get values from dataset of the application for approval
Re: How to get the value of the AD details of payload of SOA user group -
B &; K Portable Signal Analyzer binary data files
I am currently using a portable Signal B & K 2144/7651 Analyzer. I would like to start a project to display binary data files created by the parser in Labview. I technical documentation that specifies the formatting of the binaries and they have the code example written for Pascal but I do not know how to translate this to Labview. If anyone has experience with these data files or could give me a hint on how to interpret the files of Labile, I'd appreciate it.
I can post the technique will have to but I need to scan him.
Thank you
Eric
Hi arvin.
I just wanted to share the work to date - it is not quite finished, but I have to get some sleep.
Will probably end tomorrow/today (later)
See you soon!
-
Don't know if I'm missing something, but should this API show the content type (application/x-www-url-formencoded) when there are values for the p_parm_name and p_parm_value parameters.
The example in the docs is a Yahoo API. I'm not sure that an individual (see: http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_web_service.htm#BABEDJHJ), and I think that it requires an appid (yahoo account), so I went with the example here:
http://developer.Yahoo.com/YQL/guide/YQL-code-examples.html#yql_php
If I run the following from a file html on my desktop, it works:
In other words, it returns a JSON result.<form method="POST" action="http://query.yahooapis.com/v1/public/yql"> <input type="hidden" name="q" value="select * from upcoming.events where location='San Francisco' and search_text='dance'"></input> <input type="hidden" name="format" value="json"></input> <input type="submit"></input> </form>
The raw data of HTTP are as follows:
POST http://query.yahooapis.com/v1/public/yql HTTP/1.1
Host: query.yahooapis.com
Connection: keep-alive
Content-Length: 110
Cache-Control: max - age = 0
Origin: null
User-Agent: Mozilla/5.0 (X 11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Ubuntu/12.04 Chromium/20.0.1132.47 Chrome/20.0.1132.47 Safari/536.11
Content-Type: application/x-www-formulaires-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-, FR; q = 0.8, fr; q = 0.6
Accept-Charset: ISO-8859-1, utf-8; q = 0.7, *; q = 0.3
q = select +upcoming.events+where+location%3D%27San+Francisco%27+and+search_text%3D%27dance%27 & format = json >
However, running the following returns nothing: (nothing, nothing of which depends on the parameters passed in)
Raw data from HTTP:set serveroutput on declare l_c CLOB; begin l_c := apex_web_service.make_rest_request( p_url => 'http://query.yahooapis.com/v1/public/yql', p_http_method => 'POST', p_parm_name => apex_util.string_to_table('q:format'), p_parm_value => apex_util.string_to_table('select * from upcoming.events where location=''San Francisco'' and search_text=''dance'':json'), p_proxy_override => 'http://192.168.1.3:8888'); dbms_output.put_line(substr(l_c, 1, 4000)); end;
POST http://query.yahooapis.com/v1/public/yql HTTP/1.1
Host: query.yahooapis.com
Connection: Keep-Alive
Content-Length: 106
Connection: close
q = 2 Select + % + of + coming % 2Eevents + where + % 3D 'San + Francisco' + and + % 3D search_text 'dance' & format = json >
I note that one key difference is that content type is not defined in the web service API.
It was just to test a public service. I note that the foregoing has slighty different encoding request (percentage of tanks). However, I experienced the same behavior on a procedure that I wrote (I can also give this example of test cases if you wish), which is where I first noticed the issue.
Using utl_http and affecting the type of application/x-www-url-formencoded content, does not solve the problem. However, just thought I'd see the possibility of using the service API Web that is made available.
The example is in the valid docs, or am I missing something obvious?
It's Dev days on ApEx 4.1 on the virtual machine in the RTO.
Thoughts?I had a similar problem:
apex_web_service.make_rest_request packaging missing header parmsI endedup an SR for Oracle to open. I discovered that the headers (content-type) are defined in global variables before calling apex_web_service.make_rest_request.
See http://docs.oracle.com/cd/E17556_01/doc/apirefs.40/e15519/apex_web_service.htm#autoId4 for a description of headers and cookies.
I endedup have to add the following to my code before apex_web_service.make_rest_request:
apex_web_service.g_request_headers (1) .name: = "Content-Type";
apex_web_service.g_request_headers (1) .value: = ' application/xml ';Once I did, my service works. Odd. Not sure why they did it this way because their internal packages use parameters of the header, but the wrappers do this way, I guess.
I hope this works for you!
Jennifer
-
EntryProcessor get outdated data
Hi all
We have an EP quite complex where we have many requests for appeals against the same entry. This is normal and consistency would lock each entry of confidence we didn't assume any problems in this area.
However, under a heavy load (with several requests in queue), we see the EP get out of date data, i.e. it is the entry because it was at a previous time, but not as his last stored on the previous EP run on this entry. Basically, we can always to each test see the following events:
1 deserialize the entrance, the sequence number = 1
2. given EP entry with sequence number = 1
3. serialize the entry, the sequence number = 2 (of the EP to the point 2)
4 deserialize the entrance, the sequence number = 2
5 deserialize the entrance, the sequence number = 2
6 EP given entry with sequence number = 2 (So far, so good)
7 serialize the entry, the sequence number = 3 (of the EP to the point 6)
8 EP given entry with sequence number 2 = (* this is false and just point 5! *)
9 serialize the entry, the sequence number = 3 (from EP to point 8, which took place on stale data)
And so on... So it's all on one key, but the reading and writing to/from binary entry happens out of order, which makes the EP get outdated data.
I work on a simple test case that I would be able to share and allow us to eliminate all surrounding logic. But I would just ask if someone has seen something similar? We manage this on 3.7.1.4, and testing is all in Java on a single node.
EDIT: Guess it's worth adding that it is with 10 threads to service. If we run with just the wire of single service, the service seems to crash a lot, but I'll need to come back with more details on this...
Edit2: The exceptions we have obtained with only one thread was basically just the guardian being too strict and we have been able to pass the test with a single thread. Therefore, it seems that this question is there when we have multiple threads available service.
Published by: cfelde on June 22, 2012 08:03
Published by: cfelde on June 22, 2012 08:38Hello
I took a deeper look at your test case - thank you for the effort in the creation. It seems that you use a HashMap to your key with the value of the card being an OtherHolder which itself has a HashMap with 1000 points. When determining the partition entry belongs to use us the hash of the binary key and the serialization of a HashMap browse us every input serialization key / value. Iteration order is not guaranteed with a HashMap deserialize it serialize-> serialize can result in two different binary producing different hash codes so different entries in the cache.
Applied to your test case I noticed that you have to 'revive' within your DataHolderEP logic that calls cache.invoke using the deserialized from the input that you do not currently have (discount to a separate thread). This deserialize and serialize an invoke on a new key that triggers your CacheLoader calling and causes a new DataHolder of object returned. You have now two DataHolder objects, so your incremental version check fails. You could modify your implementation of the map to a LinkedHashMap at two construction in OtherHolder #readExternal or do not use a key card. You can run into problems when using large keys with features like caches close.
In addition, you can consider changing your test so that it works against the remote processes such as logic such as serialization and deserialization of the EntryProcessor is never called.
Thank you
Harvey -
Arbitrary large amounts of binary data in a clip of loading
It is easy to download external data in XML format to a clip. However, what I need must load really large volumes of data binary readonly. In my case, the text representation is not an option. Is it possible to download an arbitrary array of bytes in memory, then get this table to read the individual bytes?
I don't think that the forth tables like this
var data: Array = [1,2,3,...];
could be solution for my problem either. The reason is that the VM so much additional information associated with each Member of the group.
The only solution that I came here is to pack binary data as strings,
var data: String = "\u0000\u1234\uabcd";
two bytes per character. Avoid any overhead storage, and searching for a member of individual data is trivial.
But I doubt there is a better solution?
I don't think that there is another option other than to load it into a string and then encoded the decode internally to as2. So if you have \u0000 as in the example above, you will find that it does not work.
var data: String = "\u0000\u1234\uabcd";
(Data.Length) evidence //traces 0 (zero) as the first character is a string terminatorI think you need a method of encoding as base64 in the source string and an equivalent class of decoder to decode to binary flash inside. I'm no expert on this stuff... others may learn more, or it could be a starting point for your search.
In the past, I used the classes meychi.com for this sort of thing. Could not see them online now... but there is something else here that may be useful:
http://www.svendens.be/blog/archives/8With as3 - if I understand correctly - it is not a problem because you can load binary data.
-
I get a message: to use the 'java' command line tool, you must install a JDK. I tried 10 times to install without success. Help, please.
You probably have some of the older than the needs/desires software legacy Java installed.
Please see these sons of community message:
Just found this last Java does not work with El Capitan
This is the Apple link to the legacy version of Java 6.
Download Java for OS X 2015-001
First of all, I would like to try to identify what application generated the next message and update (delete) this request as the case may be. If you need to run Java then, as the Apple Support page says it's certainly preferable that your installation of Java entirely up-to-date with the Oracle's Java course. If you can get without Java, you should install it not - like the Flash, it should not be installed unless you have no choice.
-
binary data from GPS VI-example RF recording / reading with NI USRP
Hello
In the demo video (http://www.ni.com/white-paper/13881/en) a ublox was used to record the GPS signal while driving. How is it possible to record with you - Center in a binary data format which is usable within LabView for the reading of the GPS signal? Ublox uses the *.ubx data format, is there a converter?
Hello YYYs,
The file was generated not by uBlox but by recording and playback VI. An active GPS antenna, fueled by some amplifiers and mini-circuits was related to the USRP and the program created LabVIEW file (USRP being used as a receiver)
Later the USRP is reading the file (generation) and the Ublox GPS receiver is to be fooled into thinking that its location is currently somewhere else.
-
How can I get the data view to display the same amount of time I save?
I use the Sound and Vibration Measurement Suite. In the data view, I display a graph of time, the power spectrum, the Color Map and the waterfall. I am also showing strength in numbers group for several bands and doing cutting-edge research. I record 100 ms of the transient wave. In the data view, why the temporal plots show several seconds of data? What determines how much time will appear in the data view? More important, the power spectrum reflects the power for the entire of several seconds of data displayed? Same question for power in the values of band and cutting-edge research. I want to just this data displayed for 100 ms of the wave that I record. So, how can I get the data displayed (waveforms) and power numbers come only 100 ms of the recorded wave?
Finally, what is the best way to make account concisely the recorded data? By slide numbers on the Documentation tab is not concise, because it comes with graphics, etc.. I tried save as ASCII/LVM, but I get a bunch of stuff intermiated I don't care. Help?
Hi TimRsandiego,
SignalExpress is programmed to display graphs with default scales based on the type of action, it's reading. These scales and settings can be changed by right-clicking on the graph, and then select Properties.
If you are interested to learn more about how to use SignalExpress, I would recommend checking out some demonstrations/tutorials on NI.com. You can find some of these demos at the following location:
Let me know if you have any other questions.
Kind regards
Maybe you are looking for
-
If I'm browsing or selecting an item, a message appears telling me to open the tab in firefox. I don't want to always have to push the open tab. It's boring
-
How can I remove a Top Site?
I have best sites that I would like to delete, but I don't know if this is possible.
-
iPod Classic stopped display work. Work displayed in iTunes. Updated iTunes to 12.4 but did not help. I can see how to check and uncheck "Display work" in iTunes but not how on the iPod as others have suggested. Need to perhaps restore and rechar
-
Lenovo Y50 only using Intel graphics when connected to the TV with HDMI output
I recently bought a Lenovo
-
Photosmart HP 7520 - Format scanning
I tried to download the documents I scanned using the HO Photosmart 7520 today and have not been able to get my web portal provider to recognize the format of PDF files that I created. They have since said that there should be no problem with parsing