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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.