Oracle 11.2.0.3
Windows server 2008r2
Apache tomcat 7.0
Oracle APEX 4.2.1
Oracle APEX Listener 2.0
I would like to insert a XML document into the database through an APEX restful web service. The POST into the web service in done with PERL. The following code will insert an null record in a table with column of XMLType type, also it will do the same on a varchar2 column. Perl Code
use strict; use warnings; use LWP::UserAgent; use HTTP:Headers; my $headers = HTTP::Headers->new(); my $url = "http://host:port:apex/<application_workspace>/<restfull ser +vice module>/<uri template>/ my $sendthis = ('<?xml version="1.0" enconding="utf-8"?> <students> <row> <name>Mark</name> <age>30</age> </row> </students>';) $headers -> header('Content-Type' => 'text/xml; charset=utf-8'); my $request = HTTP:Request->new('POST', $url, $headers, $sendthis); $request-> protocol('HTTP/1.1'); my $browser = LWP::UserAgent->new(); my $response = $browser->request($request); my $gotthis= $response->content(); my $the_file_data = $response->content();
APEX restful service
Method: POST Source type: PL/SQL MIME Types allowed: blank require secure access: none source: {declare doc varchar2(32000); begin insert into table <column name> values(doc); commit; end;
Table code
{ create table <tablename> (column name XMLType>);
The above code will insert an null column into the table. Any ideas why?
In reply to Http Post to Oracle Apex restful web service inserts null into oracle database table with XMLType and varchar2 columns by guyenko
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |