www.oradev.com   for Oracle developers
  Pl/sql articles   Oracle articles   Performance   scripts   Books   Documentation   Links   XML
  Articles
Number format
Sequence
Use XML in the database
Using XML functions
Oracle training
Oracle certification
Create statistics
dbms_profiler explained
How to use hints
Rename tables, columns
Scheduling in 10g
How to WAP in pl/sql
How to redirect a page
How to secure your webserver
How to use utl_http
How to Trace sessions




  How to WAP with the OAS/ PL/SQL Toolkit
To create a WAP-site with pl/sql you need to specify the MIME-type of your site.
This type has to be present in your webserver-configuration.

To do this you edit the Mime section of your webserver (f.i. HTTP listener configuration) and add the following:
WML source text/vnd.wap.wml wml
Wireless bitmaps image/vnd.wap.wbmp wbmp
Compiled WML application/vnd.wap.wmlc wmlc
WMLScript source text/vnd.wap.wmlscript wmls
Compiled WMLScript application/vnd.wap.wmlscriptc wmlsc
Example:

CREATE OR REPLACE PROCEDURE
start_wml IS
BEGIN
  owa_util.mime_header(ccontent_type => 'text/vnd.wap.wml');
  owa_util.http_header_close;
  htp.p('<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
  <wml>
  <card id="card1" title="Title"> <p>
  Welcome to the wonderful world of WAP. You are: ');
  htp.p(owa_util.get_cgi_env('REMOTE_HOST'));
  htp.p('</p></card>
  </wml>');
END start_wml;