Author: chatra
Date: Fri May 25 02:36:44 2007
New Revision: 541599
URL: http://svn.apache.org/viewvc?view=rev&rev=541599
Log:
corrected issues in https://issues.apache.org/jira/browse/AXIS2-2440
Modified:
webservices/axis2/site/1_2/rest-ws.html
Modified: webservices/axis2/site/1_2/rest-ws.html
URL:
http://svn.apache.org/viewvc/webservices/axis2/site/1_2/rest-ws.html?view=diff&rev=541599&r1=541598&r2=541599
==============================================================================
--- webservices/axis2/site/1_2/rest-ws.html (original)
+++ webservices/axis2/site/1_2/rest-ws.html Fri May 25 02:36:44 2007
@@ -1,34 +1,156 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Axis2/Java
- RESTful Web Services Support</title><style type="text/css" media="all">
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <title>Axis2/Java - RESTful Web Services Support</title>
+ <style type="text/css" media="all">
@import url("../style/maven-base.css");
- @import
url("../style/maven-theme.css");</style><link rel="stylesheet"
href="../style/print.css" type="text/css" media="print"></link><meta
http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"></meta></head><body class="composite"><div id="banner"><a
href="http://www.apache.org/" id="organizationLogo"><img alt="Apache Software
Foundation" src="http://www.apache.org/images/asf-logo.gif"></img></a><a
href="http://ws.apache.org/axis2/" id="projectLogo"><img alt="Apache Axis2"
src="http://ws.apache.org/axis2/images/axis.jpg"></img></a><div
class="clear"><hr></hr></div></div><div id="breadcrumbs"><div class="xleft">
- Last published: 04 May 2007
- | Doc for 1.2</div><div class="xright">
-
- <a href="../index.html">Axis2/Java</a>
-
-
-
- <span class="separator">|</span>
-
-
- <a href="http://ws.apache.org/axis2/c" class="externalLink"
title="External Link">Axis2/C</a>
-
-
-
- <span class="separator">|</span>
-
-
- <a href="http://ws.apache.org" class="externalLink" title="External
Link">Apache WS</a>
-
-
-
- <span class="separator">|</span>
-
-
- <a href="http://www.apache.org" class="externalLink" title="External
Link">Apache </a>
- </div><div class="clear"><hr></hr></div></div><div id="leftColumn"><div
id="navcolumn"><div id="menuAxis2_Java"><h5>Axis2/Java</h5><ul><li
class="none"><a href="../index.html">Home</a></li></ul></div><div
id="menuDownloads"><h5>Downloads</h5><ul><li class="none"><a
href="../download.cgi">Releases</a></li><li class="none"><a
href="../modules/index.html">Modules</a></li><li class="none"><a
href="../tools/index.html">Tools</a></li></ul></div><div
id="menuDocumentation"><h5>Documentation</h5><ul><li class="expanded"><a
href="../1_2/contents.html">Version 1.2</a><ul><li class="none"><a
href="../1_2/toc.html">Table of Contents</a></li><li class="none"><a
href="../1_2/installationguide.html">Installation Guide</a></li><li
class="none"><a href="../1_2/quickstartguide.html">QuickStart Guide</a></li><li
class="none"><a href="../1_2/userguide.html">User Guide</a></li><li
class="none"><a href="../1_2/pojoguide.html">POJO Guide</a></li><li
class="none"><a href="../1_2/spring.html">
Spring Guide</a></li><li class="none"><a href="../1_2/webadminguide.html">Web
Administrator's Guide</a></li><li class="none"><a
href="../1_2/migration.html">Migration Guide (from Axis1)</a></li></ul></li><li
class="none"><a href="../1_1_1/contents.html">Version 1.1.1</a></li><li
class="none"><a href="../1_1/contents.html">Version 1.1</a></li><li
class="none"><a href="../1_0/index.html">Version 1.0</a></li><li
class="none"><a href="../0_95/index.html">Version 0.95</a></li><li
class="none"><a href="../0_94/index.html">Version 0.94</a></li><li
class="none"><a href="../0_93/index.html">Version 0.93</a></li></ul></div><div
id="menuResources"><h5>Resources</h5><ul><li class="none"><a
href="../faq.html">FAQ</a></li><li class="none"><a
href="../articles.html">Articles</a></li><li class="none"><a
href="http://wiki.apache.org/ws/FrontPage/Axis2/" class="externalLink"
title="External Link">Wiki</a></li><li class="none"><a
href="../refLib.html">Reference Library</a></li><li class="none"
><a href="http://ws.apache.org/axis2/1_2/api/index.html" class="externalLink"
>title="External Link">Online Java Docs</a></li></ul></div><div
>id="menuGet_Involved"><h5>Get Involved</h5><ul><li class="none"><a
>href="../overview.html">Overview</a></li><li class="none"><a
>href="../svn.html">Checkout the Source</a></li><li class="none"><a
>href="../mail-lists.html">Mailing Lists</a></li><li class="none"><a
>href="../guidelines.html">Developer Guidelines</a></li><li class="none"><a
>href="../siteHowTo.html">Build the Site</a></li></ul></div><div
>id="menuProject_Information"><h5>Project Information</h5><ul><li
>class="none"><a href="../team-list.html">Project Team</a></li><li
>class="none"><a href="../issue-tracking.html">Issue Tracking</a></li><li
>class="none"><a
>href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/?root=Apache-SVN"
> class="externalLink" title="External Link">Source Code</a></li><li
>class="none"><a href="../thanks.html">Acknowledgements</a></li><li class="non
e"><a href="http://www.apache.org/licenses/LICENSE-2.0.html"
class="externalLink" title="External Link">License</a></li></ul></div><a
href="http://maven.apache.org/" title="Built by Maven" id="poweredBy"><img
alt="Built by Maven"
src="../images/logos/maven-button-1.png"></img></a></div></div><div
id="bodyColumn"><div class="contentBox"><div class="section"><a
name="RESTful_Web_Services_Support"></a><h2>RESTful Web Services
Support</h2><p>This document presents an introduction on REST and REST with
HTTP POST and
-GET.</p><div class="subsection"><a name="Content"></a><h3>Content</h3><ul>
+ @import url("../style/maven-theme.css");</style>
+ <link rel="stylesheet" href="../style/print.css" type="text/css"
+ media="print" />
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+</head>
+
+<body class="composite">
+
+<div id="banner">
+<a href="http://www.apache.org/" id="organizationLogo"><img
+alt="Apache Software Foundation"
+src="http://www.apache.org/images/asf-logo.gif" /></a><a
+href="http://ws.apache.org/axis2/" id="projectLogo"><img alt="Apache Axis2"
+src="http://ws.apache.org/axis2/images/axis.jpg" /></a>
+
+<div class="clear">
+<hr />
+</div>
+</div>
+
+<div id="breadcrumbs">
+
+<div class="xleft">
+Last published: 04 May 2007 | Doc for 1.2</div>
+
+<div class="xright">
+<a href="../index.html">Axis2/Java</a> <span class="separator">|</span> <a
+href="http://ws.apache.org/axis2/c" class="externalLink"
+title="External Link">Axis2/C</a> <span class="separator">|</span> <a
+href="http://ws.apache.org" class="externalLink" title="External Link">Apache
+WS</a> <span class="separator">|</span> <a href="http://www.apache.org"
+class="externalLink" title="External Link">Apache</a></div>
+
+<div class="clear">
+<hr />
+</div>
+</div>
+
+<div id="leftColumn">
+
+<div id="navcolumn">
+
+<div id="menuAxis2_Java">
+<h5>Axis2/Java</h5>
+<ul>
+ <li class="none"><a href="../index.html">Home</a></li>
+</ul>
+</div>
+
+<div id="menuDownloads">
+<h5>Downloads</h5>
+<ul>
+ <li class="none"><a href="../download.cgi">Releases</a></li>
+ <li class="none"><a href="../modules/index.html">Modules</a></li>
+ <li class="none"><a href="../tools/index.html">Tools</a></li>
+</ul>
+</div>
+
+<div id="menuDocumentation">
+<h5>Documentation</h5>
+<ul>
+ <li class="expanded"><a href="../1_2/contents.html">Version 1.2</a>
+ <ul>
+ <li class="none"><a href="../1_2/toc.html">Table of Contents</a></li>
+ <li class="none"><a href="../1_2/installationguide.html">Installation
+ Guide</a></li>
+ <li class="none"><a href="../1_2/quickstartguide.html">QuickStart
+ Guide</a></li>
+ <li class="none"><a href="../1_2/userguide.html">User Guide</a></li>
+ <li class="none"><a href="../1_2/pojoguide.html">POJO Guide</a></li>
+ <li class="none"><a href="../1_2/spring.html">Spring Guide</a></li>
+ <li class="none"><a href="../1_2/webadminguide.html">Web
+ Administrator's Guide</a></li>
+ <li class="none"><a href="../1_2/migration.html">Migration Guide (from
+ Axis1)</a></li>
+ </ul>
+ </li>
+ <li class="none"><a href="../1_1_1/contents.html">Version 1.1.1</a></li>
+ <li class="none"><a href="../1_1/contents.html">Version 1.1</a></li>
+ <li class="none"><a href="../1_0/index.html">Version 1.0</a></li>
+ <li class="none"><a href="../0_95/index.html">Version 0.95</a></li>
+ <li class="none"><a href="../0_94/index.html">Version 0.94</a></li>
+ <li class="none"><a href="../0_93/index.html">Version 0.93</a></li>
+</ul>
+</div>
+
+<div id="menuResources">
+<h5>Resources</h5>
+<ul>
+ <li class="none"><a href="../faq.html">FAQ</a></li>
+ <li class="none"><a href="../articles.html">Articles</a></li>
+ <li class="none"><a href="http://wiki.apache.org/ws/FrontPage/Axis2/"
+ class="externalLink" title="External Link">Wiki</a></li>
+ <li class="none"><a href="../refLib.html">Reference Library</a></li>
+ <li class="none"><a href="http://ws.apache.org/axis2/1_2/api/index.html"
+ class="externalLink" title="External Link">Online Java Docs</a></li>
+</ul>
+</div>
+
+<div id="menuGet_Involved">
+<h5>Get Involved</h5>
+<ul>
+ <li class="none"><a href="../overview.html">Overview</a></li>
+ <li class="none"><a href="../svn.html">Checkout the Source</a></li>
+ <li class="none"><a href="../mail-lists.html">Mailing Lists</a></li>
+ <li class="none"><a href="../guidelines.html">Developer Guidelines</a></li>
+ <li class="none"><a href="../siteHowTo.html">Build the Site</a></li>
+</ul>
+</div>
+
+<div id="menuProject_Information">
+<h5>Project Information</h5>
+<ul>
+ <li class="none"><a href="../team-list.html">Project Team</a></li>
+ <li class="none"><a href="../issue-tracking.html">Issue Tracking</a></li>
+ <li class="none"><a
+
href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/?root=Apache-SVN"
+ class="externalLink" title="External Link">Source Code</a></li>
+ <li class="none"><a href="../thanks.html">Acknowledgements</a></li>
+ <li class="none"><a href="http://www.apache.org/licenses/LICENSE-2.0.html"
+ class="externalLink" title="External Link">License</a></li>
+</ul>
+</div>
+<a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy"><img
+alt="Built by Maven" src="../images/logos/maven-button-1.png" /></a></div>
+</div>
+
+<div id="bodyColumn">
+
+<div class="contentBox">
+
+<div class="section">
+<a name="RESTful_Web_Services_Support"></a>
+
+<h2>RESTful Web Services Support</h2>
+
+<p>This document presents an introduction on REST and REST with HTTP POST and
+GET.</p>
+
+<div class="subsection">
+<a name="Content"></a>
+
+<h3>Content</h3>
+<ul>
<li><a href="#intro">Introduction</a></li>
<li><a href="#rest_with_post">Doing REST Web Services with HTTP POST</a>
<ul>
@@ -36,42 +158,87 @@
</ul>
</li>
<li><a href="#rest_with_get">Access a REST Web Service via HTTP GET</a></li>
-</ul><p><a name="intro"></a></p></div><div class="subsection"><a
name="Introduction"></a><h3>Introduction</h3><p>WSDL 2.0 HTTP Binding defines a
way to implement REST (Representational
+</ul>
+
+<p><a name="intro"></a></p>
+</div>
+
+<div class="subsection">
+<a name="Introduction"></a>
+
+<h3>Introduction</h3>
+
+<p>WSDL 2.0 HTTP Binding defines a way to implement REST (Representational
State Transfer) with Web services. Axis2 implements the most defined HTTP
binding specification. REST Web services are a reduced subset of the usual
-Web service stack.</p><p>The Axis2 REST implementation assumes the following
properties:</p><ol>
+Web service stack.</p>
+
+<p>The Axis2 REST implementation assumes the following properties:</p>
+<ol>
<li>REST Web services are Synchronous and Request Response in nature.</li>
<li>When REST Web services are accessed via GET, the service and the
operations are identified based on the URL. The parameters are assumed as
parameters of the Web service. In this case, the GET based REST Web
services support only simple types as arguments and it should adhere to
- the <a
href="http://www.w3.org/TR/2006/CR-wsdl20-adjuncts-20060327/#_operation_iri_style"
class="externalLink" title="External Link">IRI
- style</a>.</li>
+ the <a
+
href="http://www.w3.org/TR/2006/CR-wsdl20-adjuncts-20060327/#_operation_iri_style"
+ class="externalLink" title="External Link">IRI style</a>.</li>
<li>POST based Web services do not need a SOAP Envelope or a SOAP Body.
REST Web Services do not have Headers and the payload is sent
directly.</li>
-</ol><p>Axis2 can be configured as a REST Container and can be used to send and
+</ol>
+
+<p>Axis2 can be configured as a REST Container and can be used to send and
receive RESTful Web service requests and responses. REST Web services can be
-accessed using HTTP GET and POST.</p><p><a
name="rest_with_post"></a></p></div><div class="subsection"><a
name="REST_Web_Services_with_HTTP_POST"></a><h3>REST Web Services with HTTP
POST</h3><p>If REST is enabled, the Axis2 server will act as both a REST
endpoint and
+accessed using HTTP GET and POST.</p>
+
+<p><a name="rest_with_post"></a></p>
+</div>
+
+<div class="subsection">
+<a name="REST_Web_Services_with_HTTP_POST"></a>
+
+<h3>REST Web Services with HTTP POST</h3>
+
+<p>If REST is enabled, the Axis2 server will act as both a REST endpoint and
a SOAP endpoint. When a message is received, if the content type is text/xml
and if the SOAPAction Header is missing, then the message is treated as a
-RESTful Message, if not it is treated as a usual SOAP Message.</p><p>On
sending a message, whether the message is RESTful or not, can be
-decided from the client API.<br></br>
-Set a property in the client API.<br></br>
+RESTful Message, if not it is treated as a usual SOAP Message.</p>
+
+<p>On sending a message, whether the message is RESTful or not, can be
+decided from the client API.<br />
+Set a property in the client API.<br />
</p>
- <div class="source"><pre>...
+
+<div class="source">
+<pre>...
Options options = new Options();
options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
-...
-</pre></div>
- <p><a name="sample"></a></p></div><div class="subsection"><a
name="Sample_REST_-_HTTP_POST_Client"></a><h3>Sample REST - HTTP POST
Client</h3><p>There is an example named, userguide.clients.RESTClient.java
found in
+...</pre>
+</div>
+
+<p><a name="sample"></a></p>
+</div>
+
+<div class="subsection">
+<a name="Sample_REST_-_HTTP_POST_Client"></a>
+
+<h3>Sample REST - HTTP POST Client</h3>
+
+<p>There is an example named, userguide.clients.RESTClient.java found in
AXIS2_HOME/samples/userguide/src/userguide/clients which demonstrates the
usage of the above. It uses the "echo" operation of the
-<code>userguide.example1.MyService </code>of the
-AXIS2_HOME/samples/userguide/src/userguide/example1. </p><p>The class source
will be as follows:
- <div class="source"><pre></pre></div>
- </p>
- <div class="source"><pre>public class RESTClient {
+<code>userguide.example1.MyService</code>of the
+AXIS2_HOME/samples/userguide/src/userguide/example1.</p>
+
+<p>The class source will be as follows:
+<div class="source">
+<pre></pre>
+</div>
+</p>
+
+<div class="source">
+<pre>public class RESTClient {
private static String toEpr =
"http://localhost:8080/axis2/services/MyService";
@@ -109,27 +276,86 @@
return method;
}
-}
-</pre></div>
- <p><a name="rest_with_get"></a></p></div><div class="subsection"><a
name="Access_a_REST_Web_Service_via_HTTP_GET"></a><h3>Access a REST Web Service
via HTTP GET</h3><p>Axis2 allows users to access Web services that have simple
type parameters
+}</pre>
+</div>
+
+<p><a name="rest_with_get"></a></p>
+</div>
+
+<div class="subsection">
+<a name="Access_a_REST_Web_Service_via_HTTP_GET"></a>
+
+<h3>Access a REST Web Service via HTTP GET</h3>
+
+<p>Axis2 allows users to access Web services that have simple type parameters
via HTTP GET. For example, the following URL requests the Version Service via
HTTP GET. However, the Web service arriving via GET assumes REST. Other
parameters are converted into XML and put into the SOAP body.</p>
- <div
class="source"><pre><pre>http://127.0.0.1:8080/axis2/rest/Version/getVersion</pre>
-</pre></div>
- <p>The result can be shown in the browser as follows:</p><img
src="/images/userguide/http-get-ws.jpg" alt=""></img><p>For example, the
following request,</p>
- <div
class="source"><pre><pre>http://127.0.0.1:8080/axis2/rest/Version/getVersion</pre>
-</pre></div>
- <p>will be converted into the following SOAP message for processing by
-Axis2.
- <div class="source"><pre>
-<pre>
+
+<div class="source">
+<pre><pre>http://127.0.0.1:8080/axis2/services/Version/getVersion</pre>
+</pre>
+</div>
+
+<p>The result can be shown in the browser as follows:</p>
+<img src="/images/userguide/http-get-ws.jpg" alt="" />
+
+<p>For example, the following request,</p>
+
+<div class="source">
+<pre><pre>http://127.0.0.1:8080/axis2/services/Version/getVersion</pre>
+</pre>
+</div>
+
+<p>will be converted into the following SOAP message for processing by Axis2.
+<div class="source">
+<pre><pre>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<axis2:getVersion
xmlns:axis2="http://ws.apache.org/goGetWithREST" />
</soapenv:Body>
</soapenv:Envelope>
</pre>
-</pre></div>
- </p></div><div class="subsection"><a
name="Resources"></a><h3>Resources</h3><p>How I Explained REST to My Wife, By
Ryan Tomayko- <a href="http://naeblis.cx/articles/2004/12/12/rest-to-my-wife"
class="externalLink" title="External
Link">http://naeblis.cx/articles/2004/12/12/rest-to-my-wife</a></p><p>Building
Web Services the REST Way, By Roger L. Costello- <a
href="http://www.xfront.com/REST-Web-Services.html" class="externalLink"
title="External Link">
-http://www.xfront.com/REST-Web-Services.html</a></p><p>Resource-oriented vs.
activity-oriented Web services, By James Snell- <a
href="http://www-128.ibm.com/developerworks/webservices/library/ws-restvsoap/"
class="externalLink" title="External
Link">http://www-128.ibm.com/developerworks/webservices/library/ws-restvsoap/</a></p></div></div></div></div><div
class="clear"><hr></hr></div><div id="footer"><div class="xright">© 2004-2007,
Apache Software Foundation</div><div
class="clear"><hr></hr></div></div></body></html>
\ No newline at end of file
+</pre>
+</div>
+</p>
+</div>
+
+<div class="subsection">
+<a name="Resources"></a>
+
+<h3>Resources</h3>
+
+<p>How I Explained REST to My Wife, By Ryan Tomayko- <a
+href="http://naeblis.cx/articles/2004/12/12/rest-to-my-wife"
+class="externalLink"
+title="External
Link">http://naeblis.cx/articles/2004/12/12/rest-to-my-wife</a></p>
+
+<p>Building Web Services the REST Way, By Roger L. Costello- <a
+href="http://www.xfront.com/REST-Web-Services.html" class="externalLink"
+title="External Link">http://www.xfront.com/REST-Web-Services.html</a></p>
+
+<p>Resource-oriented vs. activity-oriented Web services, By James Snell- <a
+href="http://www-128.ibm.com/developerworks/webservices/library/ws-restvsoap/"
+class="externalLink"
+title="External
Link">http://www-128.ibm.com/developerworks/webservices/library/ws-restvsoap/</a></p>
+</div>
+</div>
+</div>
+</div>
+
+<div class="clear">
+<hr />
+</div>
+
+<div id="footer">
+
+<div class="xright">
+© 2004-2007, Apache Software Foundation</div>
+
+<div class="clear">
+<hr />
+</div>
+</div>
+</body>
+</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]