ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r154659 - in webservices/axis/trunk/java/xdocs: OMTutorial.html docs.html images/OM001.gif images/OM002.jpg images/OM003.jpg images/OM004.jpg images/OM005.gif images/OM006.gif images/OM007.gif images/OM008.gif userguide.html
Date Mon, 21 Feb 2005 09:31:58 GMT
Author: chinthaka
Date: Mon Feb 21 01:31:55 2005
New Revision: 154659

URL: http://svn.apache.org/viewcvs?view=rev&rev=154659
Log:
Adding OM images plus some changes to docs

Added:
    webservices/axis/trunk/java/xdocs/images/OM001.gif   (with props)
    webservices/axis/trunk/java/xdocs/images/OM002.jpg   (with props)
    webservices/axis/trunk/java/xdocs/images/OM003.jpg   (with props)
    webservices/axis/trunk/java/xdocs/images/OM004.jpg   (with props)
    webservices/axis/trunk/java/xdocs/images/OM005.gif   (with props)
    webservices/axis/trunk/java/xdocs/images/OM006.gif   (with props)
    webservices/axis/trunk/java/xdocs/images/OM007.gif   (with props)
    webservices/axis/trunk/java/xdocs/images/OM008.gif   (with props)
Modified:
    webservices/axis/trunk/java/xdocs/OMTutorial.html
    webservices/axis/trunk/java/xdocs/docs.html
    webservices/axis/trunk/java/xdocs/userguide.html

Modified: webservices/axis/trunk/java/xdocs/OMTutorial.html
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/OMTutorial.html?view=diff&r1=154658&r2=154659
==============================================================================
--- webservices/axis/trunk/java/xdocs/OMTutorial.html (original)
+++ webservices/axis/trunk/java/xdocs/OMTutorial.html Mon Feb 21 01:31:55 2005
@@ -39,7 +39,7 @@
 <p class="special">
 <table width="100%">
 			 <tr>
-			 		 <td><img src="images/image005.gif" alt="Rememeber this"/></td>
+			 		 <td><img src="images/OM005.gif" alt="Rememeber this"/></td>
 					 <td class="special-td">OM is tightly bound to StAX API. To work with OM a StAX
compliant parser and the API must be present in the classpath. <td>
 			 </tr>
 </table>
@@ -94,9 +94,7 @@
 SOAPEnvelope envelope = (SOAPEnvelope)builder.getDocumentElement();
 
 </pre>
-<center><b>Code listing 2.1</b></center>
-
-
+<div align="left"><b>Code listing 2.1</b></div>
 <p>As the example shows, creating an OM from an input stream is pretty straightforward.
However elements and nodes can be created programmatically to modify the structure as well.
 The recommended way to create OM objects programmatically is to use the factory. OMFactory.newInstance()
will return the proper factory and the creator methods for each type should be called. Currently
OM has two builders, namely the OM builder and the SOAP model builder. These builders provide
the necessary information to the XML info set model to build itself.  </p>
 <!-- Image -->
@@ -118,8 +116,7 @@
 OMElement elt11 = factory.createOMElement("foo1",ns1);
 OMElement elt12 = factory.createOMElement("foo2",ns1);
 </pre>
-<center><b>Code listing 2.2</b></center>
-
+<div align="left"><b>Code listing 2.2</b></div>
 <p>The reason to have a set of factory.createXXX methods is to cater for different
implementations but keep the programmers code intact. Its highly recommend to use the factory
for creating OM objects as this will ease the switching of different OM implementations.
 Several differences exist between a programmatically created OMNode and a conventionally
built OMNode. The most important difference is that the former will have no builder object
enclosed where as the latter always carries a reference to its builder. As stated earlier
in this tutorial, since the object model is built as and when required, each and every OMNode
should have a reference to its builder. If this information is not available, it is due to
the Object being created without a builder.  In other words programmatically built OMNodes
do not have a reference to a builder. This difference becomes evident when the user tries
to get a non caching pull parser from the OMElement. This will be discussed in more detail
in the advanced operations section.
 In order to understand the requirement of the builder reference in each and every OMNode,
consider the following scenario. Assume that the parent element is built but the children
elements are not. If the parent is asked to iterate through its children, this information
is not readily available to the parent element and it should build its children first before
attempting to iterate them. In order to provide a reference of the builder, each and every
node of an OM structure should carry the reference to its builder. Each and every OmNode carries
a flag that states its build status.
@@ -134,7 +131,7 @@
 public void addChild(OMNode omNode);
 public void insertAttribute(OMAttribute attr);
 </pre>
-<center><b>Code listing 2.3</b></center>
+<div align="left"><b>Code listing 2.3</b></div>
 <p>This code segment shows how the addition takes place. Note that it is related to
the code segment shown in the creation section.</p>
 <pre class="code" >
 //set the children
@@ -143,7 +140,7 @@
 root.addChild(elt11);
 root.addChild(elt12);
 </pre>
-<center><b>Code listing 2.4</b></center>
+<div align="left"><b>Code listing 2.4</b></div>
 <p>Note that AddChild method will always add the child as the first child of the parent.
 Removal of Nodes
 A given node can be removed from the tree by calling the detach() method.
@@ -159,8 +156,7 @@
 public OMNamespace findInScopeNamespace(String uri, String prefix) throws OMException;
 public OMNamespace findDeclaredNamespace(String uri, String prefix) throws OMException;
 </pre>
-<center><b>Code listing 2.5</b></center>
-
+<div align="left"><b>Code listing 2.5</b></div>
 <p>The declareNamespacexx methods are fairly straightforward. They add a namespace
to namespace declarations section. Note that a namespace declaration that has already being
added will not be added twice. These namespace declarations will serialize into “xmlns:prefix=”uri””
type string inside an element.
 FindInscopeNamespaces is a very handy method to locate a namespace object higher up the object
tree. It searches for a matching namespace in its own declarations section and jumps to the
parent if it’s not found. The search progresses up the tree until a matching
namespace is found or the root has been reached.</p>
 
@@ -168,7 +164,7 @@
 <p class="special">
 <table width="100%">
 			 <tr>
-			 		 <td><img src="images/image005.gif" alt="Rememeber this"/></td>
+			 		 <td><img src="images/OM005.gif" alt="Rememeber this"/></td>
 					 <td class="special-td">FindInscopeNamespaces method can be computationally expensive,
if the search commenced from a deep branch of the tree and hence should be used with caution.<td>
 			 </tr>
 </table>
@@ -190,7 +186,7 @@
 elt1.addChild(elt2);
 root.addChild(elt1);
 </pre>
-<center><b>Code listing 2.6</b></center>
+<div align="left"><b>Code listing 2.6</b></div>
 <p>Serilization of the root element produces the following XML </p>
 <pre class="xml">
 &lt;x:root xmlns:x="bar" xmlns:y="bar1"&gt;
@@ -208,14 +204,14 @@
 	OMNode node = (OMNode)children.next();
 }
 </pre>
-<center><b>Code listing 2.7</b></center>
+<div align="left"><b>Code listing 2.7</b></div>
 <p>Apart from this every OMNode has links to its siblings. If more thorough navigation
is needed the nextSibling() and PreviousSibling() methods can be used.
 A more selective set can be chosen by using the getChildrenWithName(QName) methods. The getChildWithName(Qname)
method returns the first child that matches the given QName and getChildrenWithName(QName)
returns a collection containing all the matching children. The advantage of these iterators
is that they won't build the whole object structure at once, until its required.</p>
 <!-- Special section -->
 <p class="special">
 <table width="100%">
 			 <tr>
-			 		 <td><img src="images/image005.gif" alt="Rememeber this"/></td>
+			 		 <td><img src="images/OM005.gif" alt="Rememeber this"/></td>
 					 <td class="special-td">
 					 All iterator implementations internally stay one step ahead of their apparent location
to provide the correct value for the hasNext() method. This hidden advancement can build elements
that are not intended to be built at all. Hence these iterators are recommended only when
caching is not a concern. <td>
 			 </tr>
@@ -242,8 +238,7 @@
 //dump the output to console with caching
 envelope.serialize(writer,true);
 </pre>
-<center><b>Code listing 2.8</b></center>
-
+<div align="left"><b>Code listing 2.8</b></div>
 <p>The above mentioned features of the serializer forces a correct serialization even
if only a part of the OM tree is serialized. The following serializations show how the serialization
mechanism takes the trouble to accurately figure out the namespaces.
 The example is from code listing 2.6 which creates a small OM programmatically.
 Serialization of the root element produces</p>
@@ -281,8 +276,7 @@
 //dump the out put to console with caching
 envelope.serialize(writer,true);
 </pre>
-<center><b>Code listing 2.9</b></center>
-
+<div align="left"><b>Code listing 2.9</b></div>
 <h2>Section 3 - Advanced Operations with OM</h2>
 <h3>Use of the OMNavigator for Traversal</h3>
 <p>OM provides a utility class to navigate the OM structure. The navigator provides
an in-order traversal of the OM tree up to the last-built node. 
@@ -298,7 +292,7 @@
      node = navigator.next();
 }
 </pre>
-<center><b>Code listing 3.1</b></center>
+<div align="left"><b>Code listing 3.1</b></div>
 <h3>Accessing the Pull Parser </h3>
 <p>OM is tightly integrated with StAX and the getPullParser(Boolean cache) method in
the OMElement provides a XMLStreamReader object. 
 This XMLStreamReader instance has a special capability of switching between the underlying
stream and the OM object tree if the cache setting is off. However this functionality is completely
transparent to the user. This is further explained in the following paragraphs.
@@ -310,7 +304,7 @@
 <p class="special">
 <table width="100%">
 			 <tr>
-			 		 <td><img src="images/image005.gif" alt="Rememeber this"/></td>
+			 		 <td><img src="images/OM005.gif" alt="Rememeber this"/></td>
 					 <td class="special-td">
 					 For consistency reasons once the cache is switched off it cannot be switched on again.
<td>
 			 </tr>
@@ -334,7 +328,7 @@
 OutObject outObject = // get the third party object here
 new ObjectToOMBuilder(element,outObject).next();
 </pre>
-<center><b>Code listing 3.2</b></center>
+<div align="left"><b>Code listing 3.2</b></div>
 <h2>Section 4 - Known Limitations of OM</h2>
 <h3>Incomplete XML Info set support</h3>
 <p>The OM deliberately dropped the support for XML info set items such as DTDs and
 Processing Instructions (PI's). Hence the OM cannot be called a complete info set representation.
The initial reason for this was because the design goal of the OM was not to be "yet-another-object-model"
but to be a SOAP specific Object model. Since DTD's and PI's are not supposed to be present
in SOAP messages.</p>
@@ -356,7 +350,7 @@
 <b>elt1.addChild(elt3);</b>
 root.addChild(elt1);
 </pre>
-<center><b>Code listing 4.1</b></center>
+<div align="left"><b>Code listing 4.1</b></div>
 <p>Serialization of the root element provides the following XML</p>
 
 <pre class="xml">
@@ -432,7 +426,7 @@
 <table width="100%">
  <tr>
    <td align="center">All rights reserved by Apache Software Foundation</td>
-   </tr>
+  </tr>
 </table>
 <!-- End of footer -->
 </body>

Modified: webservices/axis/trunk/java/xdocs/docs.html
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/docs.html?view=diff&r1=154658&r2=154659
==============================================================================
--- webservices/axis/trunk/java/xdocs/docs.html (original)
+++ webservices/axis/trunk/java/xdocs/docs.html Mon Feb 21 01:31:55 2005
@@ -13,11 +13,11 @@
 		<h4>Documentation for Axis Users</h4>
 	</div>
 	<ul>
-		<li><a href="http://ws.apache.org/axis/java/userguide.html">User's 
+		<li><a href="userguide.html">User's 
 		Guide</a> </li>
-		<li><a href="http://ws.apache.org/axis/java/clientAPI.html">
+		<li><a href="clientAPI.html">
 		Client API</a> </li>
-		<li><a href="http://ws.apache.org/axis/java/refLib.html">Reference 
+		<li><a href="refLib.html">Reference 
 		Material</a> </li>
 	</ul>
 	<div class="h4">

Added: webservices/axis/trunk/java/xdocs/images/OM001.gif
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/images/OM001.gif?view=auto&rev=154659
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis/trunk/java/xdocs/images/OM001.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: webservices/axis/trunk/java/xdocs/images/OM002.jpg
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/images/OM002.jpg?view=auto&rev=154659
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis/trunk/java/xdocs/images/OM002.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: webservices/axis/trunk/java/xdocs/images/OM003.jpg
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/images/OM003.jpg?view=auto&rev=154659
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis/trunk/java/xdocs/images/OM003.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: webservices/axis/trunk/java/xdocs/images/OM004.jpg
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/images/OM004.jpg?view=auto&rev=154659
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis/trunk/java/xdocs/images/OM004.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: webservices/axis/trunk/java/xdocs/images/OM005.gif
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/images/OM005.gif?view=auto&rev=154659
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis/trunk/java/xdocs/images/OM005.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: webservices/axis/trunk/java/xdocs/images/OM006.gif
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/images/OM006.gif?view=auto&rev=154659
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis/trunk/java/xdocs/images/OM006.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: webservices/axis/trunk/java/xdocs/images/OM007.gif
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/images/OM007.gif?view=auto&rev=154659
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis/trunk/java/xdocs/images/OM007.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: webservices/axis/trunk/java/xdocs/images/OM008.gif
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/images/OM008.gif?view=auto&rev=154659
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis/trunk/java/xdocs/images/OM008.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: webservices/axis/trunk/java/xdocs/userguide.html
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/userguide.html?view=diff&r1=154658&r2=154659
==============================================================================
--- webservices/axis/trunk/java/xdocs/userguide.html (original)
+++ webservices/axis/trunk/java/xdocs/userguide.html Mon Feb 21 01:31:55 2005
@@ -5,6 +5,18 @@
 <title>Axis 2.0 User's Guide</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 
+<style type="text/css">
+<!--
+.style1 {font-family: "Courier New", Courier, mono}
+.style2 {font-size: 14px}
+.style3 {color: #990000}
+.style4 {
+	font-family: "Courier New", Courier, mono;
+	font-size: 14px;
+	color: #990000;
+}
+-->
+</style>
 </head>
 
 <body>
@@ -262,7 +274,7 @@
 <h2><a name="_Toc96698092"></a><a name="_Toc96697867">Sample2 : Echo
Synchronous call with a phased handler. </a></h2>
 <p>This example will go one step forward from the example above and will deploy a web
service with a Logging handler. The client application will not change, of course with an
exception; the Endpoint Reference will be changed to refer the new service <strong>“Sample1WithHandler”
</strong>. </p>
 <p>There is a Handler (LoggingHandler.java) that is introduced in this case and it
will basically log the fact that it got called. The code can be found in LoggingHandler.java.
</p>
-<p class="style1 style2">public void invoke(MessageContext msgContext) throws AxisFault
{
+<p class="style1 style2 style3">public void invoke(MessageContext msgContext) throws
AxisFault {
 <br>&nbsp;&nbsp;log.info(&quot;Incoming message From &quot;+msgContext.getTo().getAddress());

 
 <br><br>public void revoke(MessageContext msgContext){ 
@@ -272,7 +284,7 @@
 <p>Building the sample once will build all required classes and jars for all three
cases. The ant task would be ant Compile. Please refer the building of the <strong>“Echo
Synchronous call” </strong> above. </p>
 <h3><strong>Deploying the sample </strong></h3>
 <p>The implementation of the web service will be EchoXML, operation will be echo and
the provider will be org.apache.axis.providers.RawXMLProvider, which are similar to that of
the <strong>“Echo Synchronous call” </strong>. The difference is that there
will be a handler that will be added in the server side. For further discussion refer the
following service.xml which will be used in deploying the service. </p>
-<p class="style1 style2">&lt;service provider=&quot;org.apache.axis.providers.RawXMLProvider&quot;&gt;
<br>
+<p class="style1 style2 style3">&lt;service provider=&quot;org.apache.axis.providers.RawXMLProvider&quot;&gt;
<br>
 &nbsp;&lt;java:implementation class=&quot;EchoXML&quot; xmlns:java=&quot;http://ws.apache.org/axis2/deployment/java&quot;/&gt;

 &nbsp;&nbsp;&lt;inflow&gt; 
 <br>
@@ -297,43 +309,55 @@
 </ol>
 <p>These refer to the flows of the Axis2 server and further information of each could
be found in the Architecture Guide. Using these elements the deployer can specify what handlers
should go into which each flow. It can be further explained by referring to the entries in
the above service.xml. In the above descriptor for the inflow and the faultfow there is a
handler element that is added. At the deployment time, Axis2 will incorporate that handler
to both the inflow and the fault flow. Since there is no such entry for the outflow no handler
will be associated with the outflow. </p>
 <p>Handler should specify the implementation class and the phase that it belongs to.
In this case the handler belong to the <strong>Logging </strong> phase and this
phase name should be one of that is defined in the <strong>server.xml </strong>(not
service.xml). So this <strong>Logging </strong> phase should be defined there
in the server.xml which is located in AXIS_HOME/ axis2/WEB-INF. The following is the default
server.xml that is shipped with axis2.war. </p>
-<p class="style1 style9"><strong>&lt;server name=&quot;AxisJava2.0&quot;&gt;
-<br>&nbsp;&nbsp;&lt;parameter name=&quot;hotdeployment&quot; locked=&quot;xsd:false&quot;&gt;true&lt;/parameter&gt;

-<br>&nbsp;&nbsp;&lt;parameter name=&quot;hotupdate&quot; locked=&quot;xsd:false&quot;&gt;true&lt;/parameter&gt;

-<br>&nbsp;&nbsp;&lt;transports&gt; 
-<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;transport name=&quot;http&quot;/&gt;

-<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;transport name=&quot;smtp&quot;/&gt;

-<br>&nbsp;&nbsp;&lt;/transports&gt; 
-<br>&nbsp;&nbsp;&lt;phaseOrder&gt; 
-<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;phase name=&quot;global&quot;/&gt;

-<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;phase name=&quot;transport&quot;/&gt;

-<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;phase name=&quot;Logging&quot;/&gt;

-<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;phase name=&quot;module&quot;/&gt;

-<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;phase name=&quot;service&quot;/&gt;

-<br>&nbsp;&nbsp;&lt;/phaseOrder&gt; 
-<br>&lt;/server&gt;  </strong></p>
+<p class="style1 style9  style2 style3">&lt;server name=&quot;AxisJava2.0&quot;&gt;
+  <br>
+  &nbsp;&nbsp;&lt;parameter name=&quot;hotdeployment&quot; locked=&quot;xsd:false&quot;&gt;true&lt;/parameter&gt;

+  <br>
+  &nbsp;&nbsp;&lt;parameter name=&quot;hotupdate&quot; locked=&quot;xsd:false&quot;&gt;true&lt;/parameter&gt;

+  <br>
+  &nbsp;&nbsp;&lt;transports&gt; 
+  <br>
+  &nbsp;&nbsp;&nbsp;&nbsp;&lt;transport name=&quot;http&quot;/&gt;

+  <br>
+  &nbsp;&nbsp;&nbsp;&nbsp;&lt;transport name=&quot;smtp&quot;/&gt;

+  <br>
+  &nbsp;&nbsp;&lt;/transports&gt; 
+  <br>
+  &nbsp;&nbsp;&lt;phaseOrder&gt; 
+  <br>
+  &nbsp;&nbsp;&nbsp;&nbsp;&lt;phase name=&quot;global&quot;/&gt;

+  <br>
+  &nbsp;&nbsp;&nbsp;&nbsp;&lt;phase name=&quot;transport&quot;/&gt;

+  <br>
+  &nbsp;&nbsp;&nbsp;&nbsp;&lt;phase name=&quot;Logging&quot;/&gt;

+  <br>
+  &nbsp;&nbsp;&nbsp;&nbsp;&lt;phase name=&quot;module&quot;/&gt;

+  <br>
+  &nbsp;&nbsp;&nbsp;&nbsp;&lt;phase name=&quot;service&quot;/&gt;

+  <br>
+  &nbsp;&nbsp;&lt;/phaseOrder&gt; 
+  <br>
+&lt;/server&gt;  </p>
 <p>Since the Logging phase is there in the default server.xml the user who runs these
samples need not edit the server.xml at all. </p>
 <p>Nevertheless deploying the sample is very easy and it can be done in any of the
three methods described in the <strong>“Echo Synchronous call” </strong> case.
Infact had the use typed </p>
 <p>&gt;ant deploy </p>
 <p>and deployed the service in the <strong>“Echo Synchronous call” </strong>
case then this service too will be deployed. The relevant jar file is <strong>sample1WithHandler.jar
</strong> and will be packed to \build\services directory if the user wants to deploy
it manually or upload using the web application. </p>
 <h3><strong>Running the sample </strong></h3>
 <p>In this case the client side is similar to that of <strong>“Echo Synchronous
call” </strong>. The changes are happening in the server side in this case. The same
SynchronousClient.java can be used to invoke the service by changing the command line arguments.
Refer the ant target for details </p>
-<p>&lt;target name= &quot;echo&quot; depends= &quot;compile&quot;
&gt; </p>
-<p><span class="style11" body="bold">&lt;java classname= &quot;SynchronousClient&quot;&gt;
-  </span>
-</p>
-<p class="style10">&lt;classpath refid= &quot;classpath.runtimelibraries&quot;
/&gt; </p>
-<p class="style10">&lt;arg value= &quot;8080&quot; /&gt; </p>
-<p class="style10">&lt;arg value= &quot;/axis2/services/sample1&quot; /&gt;
</p>
-<p class="style10">&lt;/java&gt; </p>
-<p class="style10">&lt;/target&gt; </p>
-<p class="style10">&lt;target name= &quot;echoWithHandler&quot; &gt;
</p>
-<p class="style10">&lt;java classname= &quot;SynchronousClient&quot; &gt;
</p>
-<p class="style10">&lt;classpath refid= &quot;classpath.runtimelibraries&quot;
/&gt; </p>
-<p class="style10">&lt;arg value= &quot;8080&quot; /&gt; </p>
-<p class="style10">&lt;arg value= &quot;/axis2/services/sample1WithHandler&quot;
/&gt; </p>
-<p class="style10">&lt;/java&gt; </p>
-<p class="style10">&lt;/target&gt; </p>
+<p class="style4">&lt;target name= &quot;echo&quot; depends= &quot;compile&quot;
&gt; 
+<br>&nbsp;&nbsp;&lt;java classname= &quot;SynchronousClient&quot;&gt;
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;classpath refid= &quot;classpath.runtimelibraries&quot;
/&gt; 
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;arg value= &quot;8080&quot;
/&gt; 
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;arg value= &quot;/axis2/services/sample1&quot;
/&gt; 
+<br>&nbsp;&nbsp;&lt;/java&gt; 
+<br>&lt;/target&gt; 
+<br><br>&lt;target name= &quot;echoWithHandler&quot; &gt; 
+<br>&nbsp;&nbsp;&lt;java classname= &quot;SynchronousClient&quot;
&gt; 
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;classpath refid= &quot;classpath.runtimelibraries&quot;
/&gt; 
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;arg value= &quot;8080&quot;
/&gt; 
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;arg value= &quot;/axis2/services/sample1WithHandler&quot;
/&gt; 
+<br>&nbsp;&nbsp;&lt;/java&gt; 
+<br>&lt;/target&gt; </p>
 <p>To run the sample first the user must start the servlet container and run the client
by simply typing </p>
 <p>&gt;ant echoWithHandler </p>
 <p>in the command prompt. If all goes well the user will get the following output where
the program will print the request SOAP message and the response SOAP message, which will
be same as the request message. </p>
@@ -363,19 +387,21 @@
 <p><strong>&#149;&nbsp; Writing a new Web Service implementation class
</strong></p>
 <p>Axis2 M1 does not support data binding and supports only the XML level messaging.
The default provider (do not worry about this if you do not know what it is) only supports
the java methods having the return type as OMElement and only parameter as an OMElement. </p>
 <p>The OMElement is a Streaming representation of XML Message Element Information Item
(Even though the user sees the OMElement as a tree based DOM/JDOM like node, it reads the
information from the stream only when its absolutely required.). For more information refer
the <a href="OMTutorial.html">OM Tutorial </a>. </p>
-<p>public class &lt;class-name&gt;{ </p>
-<p>public OMElelemnt &lt;method-name&gt;(OMEllemnt){ </p>
-<p>&lt;business logic&gt; </p>
-<p>} </p>
-<p>..... </p>
-<p>} </p>
+<p class="style4">public class &lt;class-name&gt;{ 
+<br>&nbsp;&nbsp;public OMElelemnt &lt;method-name&gt;(OMEllemnt){ 
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;business logic&gt; 
+<br>&nbsp;&nbsp;} 
+<br>&nbsp;&nbsp;..... 
+<br>} </p>
 <p><strong>&#149;&nbsp; Write the service.xml file </strong></p>
 <p>the following XML snippet is a very simple service.xml file. </p>
-<p>&lt;service provider=&quot;org.apache.axis.providers.RawXMLProvider&quot;
&gt; </p>
-<p>&lt;java:implementation class=&quot;&lt;implementation-classname&gt;&quot;
</p>
-<p>xmlns:java=&quot;http://ws.apache.org/axis2/deployment/java&quot;/&gt;
</p>
-<p>&lt;operation name=&quot;&lt;method-name&gt;&quot; qname=&quot;&lt;method-name&gt;&quot;/&gt;...
</p>
-<p>&lt;/service&gt; </p>
+<p class="style4">&lt;service provider=&quot;org.apache.axis.providers.RawXMLProvider&quot;
&gt; 
+<br>&nbsp;&nbsp;&lt;java:implementation class=&quot;&lt;implementation-classname&gt;&quot;

+xmlns:java=&quot;http://ws.apache.org/axis2/deployment/java&quot;/&gt; 
+<br>
+ &nbsp;&nbsp;&lt;operation name=&quot;&lt;method-name&gt;&quot;
qname=&quot;&lt;method-name&gt;&quot;/&gt; ... 
+<br>
+&lt;/service&gt; </p>
 <p>Here the org.apache.axis.providers.RawXMLProvider is the default provider for the
Apache Axis2 M1, the provider can be changed by specifying the relevant parameter. Note that
&lt;method-name&gt; should be replaced by the relevant method name. </p>
 <p><strong>&#149;&nbsp; Create an archive with the service.xml file and
with class files </strong></p>
 <p>Compile the the Web Service implementation class and any other supporting class.
Archive them in to a jar file. Place the service.xml file in the META-INF directory. </p>
@@ -388,56 +414,55 @@
 <p>&#149;&nbsp; Non blocking invocation of type in-out (Without a separate
Listener) </p>
 <p>for more information about the interaction patterns, visit the <a href="ClientAPI.html">Client
API Tutorial </a>. </p>
 <p>To invoke the web service, user needs to build the the SOAPEnvelope himself. The
SOAPEnvelope can be built by the following code. </p>
-<p>OMFactory fac = OMFactory.newInstance(); </p>
-<p>SOAPEnvelope envelope = fac.getDefaultEnvelope(); </p>
-<p>OMElement omElement = ..... </p>
-<p>envelope.getBody().addChild(omElement); </p>
-<p>&nbsp; </p>
+<p class="style4">OMFactory fac = OMFactory.newInstance(); 
+<br>SOAPEnvelope envelope = fac.getDefaultEnvelope(); 
+<br>OMElement omElement = ..... 
+<br>envelope.getBody().addChild(omElement); </p>
 <p>OMElement can be build using one of the following methods; </p>
 <ol>
-  <li>Create a OM by building the OM tree </li>
+  <li>Create a OM by building the OM tree <br>
+  <span class="style4">fac.createOMElement(method, ns);</span></li>
 </ol>
-<p class="style1">	fac.createOMElement(method, ns); </p>
+
 <ol>
-  <li>Create a OM Element from a XML file </li>
+  <li>Create a OM Element from a XML file 
+ <br>
+ <span class="style4">XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new
FileReader(file)); <br>
+  OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(OMFactory.newInstance(),
parser); <br>
+builder.getDocumentElement();
+ </span></li>
 </ol>
-<p class="style1">XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new
FileReader(file)); <br>
-  OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(OMFactory.newInstance(),
parser); </p>
-<p class="style1">builder.getDocumentElement(); </p>
-<p class="style1">for more information in handling the OM objects please read the <a
href="OMTutorial.html">OM Tutorial </a>. </p>
+<p>for more information in handling the OM objects please read the <a href="OMTutorial.html">OM
Tutorial </a>. </p>
 <h3><a name="_Toc96698097"></a><a name="_Toc96697872">Synchronous
Client </a></h3>
 <p>Invoking the synchronous web service call can be done with the following code. </p>
-<p class="style1">EndpointReference targetEPR = <strong>new </strong>EndpointReference(AddressingConstants.WSA_TO,
&quot;http://127.0.0.1:&quot; + (EngineUtils.TESTING_PORT) + &quot;/axis/services/echo&quot;
); </p>
-<p class="style1">Call call = <strong>new </strong>Call(); </p>
-<p class="style1">call.setTo(targetEPR); </p>
-<p class="style1">SOAPEnvelope responseEnv = call.sendReceive(envelope); </p>
-<p class="style1">&nbsp; </p>
-<p>&#149;&nbsp; The Endpoint Reference (EPR) is the To location of the web
service. </p>
+<p class="style4">EndpointReference targetEPR = <strong>new </strong>EndpointReference(AddressingConstants.WSA_TO,
&quot;http://127.0.0.1:&quot; + (EngineUtils.TESTING_PORT) + &quot;/axis/services/echo&quot;
); 
+<br>Call call = <strong>new </strong>Call(); 
+<br>call.setTo(targetEPR); 
+<br>SOAPEnvelope responseEnv = call.sendReceive(envelope); </p> 
+<p><p class="style1">&#149;&nbsp; The Endpoint Reference (EPR) is the
To location of the web service. </p>
 <p>&#149;&nbsp; call.setTo() method registers the created EPR with the call
object. </p>
 <p>&#149;&nbsp; call.sendRecieve() method invokes the web service at the location
specified by the EPR using the given SOAP Message. </p>
 <h3><a name="_Toc96698098"></a><a name="_Toc96697873">Asynchronous
Client </a></h3>
 <p>Invoking the asynchronous web service call can be done with the following code.
</p>
-<p class="style1">EndpointReference targetEPR = <strong>new </strong>EndpointReference(AddressingConstants.WSA_TO,
&quot;http://127.0.0.1:&quot; + (EngineUtils.TESTING_PORT) </p>
-<p class="style1">+ &quot;/axis/services/echo&quot; ); </p>
-<p class="style1">Call call = <strong>new </strong>Call(); </p>
-<p class="style1">call.setTo(targetEPR); </p>
-<p class="style1">call.setListenerTransport(Constants.TRANSPORT_HTTP, <strong>true
</strong>); </p>
-<p class="style1">SOAPEnvelope responseEnv = call.sendReceiveAsync(envelope,callback);
</p>
-<p>&nbsp; </p>
+<p class="style4">EndpointReference targetEPR = <strong>new </strong>EndpointReference(AddressingConstants.WSA_TO,
&quot;http://127.0.0.1:&quot; + (EngineUtils.TESTING_PORT)+ &quot;/axis/services/echo&quot;
); 
+<br>Call call = <strong>new </strong>Call(); 
+<br>call.setTo(targetEPR); 
+<br>call.setListenerTransport(Constants.TRANSPORT_HTTP, <strong>true </strong>);

+<br>SOAPEnvelope responseEnv = call.sendReceiveAsync(envelope,callback); </p>
 <p>&#149;&nbsp; The Endpoint Reference (EPR) is the To location of the web
service. </p>
 <p>&#149;&nbsp; call.setTo() method registers the created EPR with the call
object. </p>
 <p>&#149;&nbsp; call.sendRecieveAsync() method invokes the web service at the
location specified by the EPR using the given SOAP Message. </p>
 <p>&#149;&nbsp; The LitenerTransport is type of the trasport to be used. Axis2-M1
only supports the http and the second parameter express the should the seperate listener is
to be started or not. Axis-M1 suppoerts only the true for this. </p>
 <p>&#149;&nbsp; callback it the Callback to handle the response e.g. </p>
-<p class="style1">Callback callback = <strong>new </strong> Callback()
{ </p>
-<p class="style1"><strong>public void </strong>onComplete(AsyncResult result)
{ </p>
-<p class="style1">//process the result </p>
-<p class="style1">} </p>
-<p class="style1">&nbsp; </p>
-<p class="style1"><strong>public void </strong>reportError(Exception e)
{ </p>
-<p class="style1">//handler error </p>
-<p class="style1">} </p>
-<p class="style1">}; </p>
+<p class="style1 style2 style3">Callback callback = <strong>new </strong>
Callback() { 
+<br><strong>&nbsp;&nbsp;public void </strong>onComplete(AsyncResult
result) { 
+<br>&nbsp;&nbsp;&nbsp;&nbsp;//process the result 
+<br>&nbsp;&nbsp;} 
+<br>&nbsp; 
+<br><strong>&nbsp;&nbsp;public void </strong>reportError(Exception
e) { 
+<br>&nbsp;&nbsp;&nbsp;&nbsp;//handler error 
+<br>&nbsp;&nbsp;} 
+<br>}</p>
 <p>&nbsp; </p>
 <p>&nbsp; </p>
 </body>



Mime
View raw message