You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ch...@apache.org on 2006/04/19 10:04:06 UTC

svn commit: r395161 - in /webservices/axis2/trunk/java: modules/adb/test/org/apache/axis2/databinding/ modules/core/src/org/apache/axis2/client/ modules/core/test/org/apache/axis2/engine/ xdocs/latest/

Author: chinthaka
Date: Wed Apr 19 01:04:03 2006
New Revision: 395161

URL: http://svn.apache.org/viewcvs?rev=395161&view=rev
Log:
- more improvements to OMTutorial
- removing System.outs
- removing wrong test case

Modified:
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java
    webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/MessageContextTest.java
    webservices/axis2/trunk/java/xdocs/latest/OMTutorial.html

Modified: webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java?rev=395161&r1=395160&r2=395161&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java (original)
+++ webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/ADBSOAPModelBuilderTest.java Wed Apr 19 01:04:03 2006
@@ -24,7 +24,6 @@
 import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
 import org.apache.axis2.databinding.utils.PrintEvents;
 import org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl;
-import org.apache.axis2.util.StreamWrapper;
 import org.custommonkey.xmlunit.XMLTestCase;
 import org.w3c.dom.Document;
 import org.xml.sax.SAXException;
@@ -107,8 +106,6 @@
         XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(s2));
         PrintEvents.print(r);
 
-        System.out.println("s2 = " + s2);
-        System.out.println("xml = " + xml);
         assertXMLEqual(s2,xml);
     }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java?rev=395161&r1=395160&r2=395161&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/Options.java Wed Apr 19 01:04:03 2006
@@ -4,9 +4,9 @@
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.addressing.RelatesTo;
-import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.description.TransportInDescription;
 import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.engine.AxisConfiguration;
@@ -15,10 +15,10 @@
 
 import javax.xml.namespace.QName;
 import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /*
  * Copyright 2001-2004 The Apache Software Foundation.
@@ -222,7 +222,7 @@
             return parent.getRelationships();
         }
         if(relationships == null) {
-            return null;
+            return null;                                 
         }
         return (RelatesTo[]) relationships.toArray(new RelatesTo[relationships.size()]);
     }

Modified: webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/MessageContextTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/MessageContextTest.java?rev=395161&r1=395160&r2=395161&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/MessageContextTest.java (original)
+++ webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/engine/MessageContextTest.java Wed Apr 19 01:04:03 2006
@@ -21,7 +21,6 @@
 import org.apache.axiom.soap.SOAPProcessingException;
 import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.AxisService;
@@ -53,9 +52,6 @@
 
         msgctx.setFrom(null);
         assertNull(msgctx.getFrom());
-
-        msgctx.setRelatesTo(null);
-        assertNull(msgctx.getRelatesTo());
 
         msgctx.setReplyTo(null);
         assertNull(msgctx.getReplyTo());

Modified: webservices/axis2/trunk/java/xdocs/latest/OMTutorial.html
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/xdocs/latest/OMTutorial.html?rev=395161&r1=395160&r2=395161&view=diff
==============================================================================
--- webservices/axis2/trunk/java/xdocs/latest/OMTutorial.html (original)
+++ webservices/axis2/trunk/java/xdocs/latest/OMTutorial.html Wed Apr 19 01:04:03 2006
@@ -191,15 +191,11 @@
 builder to create objects. The factory helps to keep the code at the
 interface level and the implementations separately (Figure 2). Since OM is
 tightly bound to StAX, a StAX compliant reader should be created first with
-the desired input stream. Then the reader should be fed into the
-OMXMLBuilderFactory to instantiate a suitable builder. The interface provided
-by the builder is identical, though the internal implementations vary.
-However, the types of the returned objects depend on the implementation of
-the builder. For example the SOAPModelBuilder returns SOAP specific objects
+the desired input stream. Then one can select one of the different builders available. 
+StAXOMBuilder will build pure XML infoset compliant object model whilst the SOAPModelBuilder returns SOAP specific objects
 (such as the SOAPEnvelope, which are sub classes of the OMElement) through
-its builder methods. The following piece of code shows the correct method of
-creating an OM document from an input stream. Note that the SOAP builder is
-used in this example.</p>
+its builder methods and . The following piece of code shows the correct method of
+creating an OM document from an input stream. </p>
 
 <div align="left">
 <p><b>Code Listing 1</b></p>
@@ -217,8 +213,8 @@
 to modify the structure as well. The recommended way to create OM objects
 programmatically is to use the factory. OMAbstractFactory.getOMFactory() 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
+called. Currently OM has two builders, namely the OM builder (StAXOMBuilder) and the SOAP
+model builder (StAXSOAPModelBuilder). These builders provide the necessary information to the XML
 info set model to build itself.</p>
 <!-- Image -->
 
@@ -252,7 +248,7 @@
 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
+this information is not available, it is due to the object being created
 without 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.</p>
@@ -269,10 +265,10 @@
 mixing up programmatically made OMNode objects with OMNode objects built from
 builders.</p>
 
-<p>The SOAP Object hierarchy is made in the most natural way for a
+<p>The SOAP object hierarchy is made in the most natural way for a
 programmer. An inspection of the API will show that it is quite close to the
 SAAJ API but with no bindings to DOM or any other model. The SOAP classes
-extend basic OM classes (such as the element) hence one can access a SOAP
+extend basic OM classes (such as the OMElement) hence one can access a SOAP
 document either with the abstraction of SOAP or drill down to the underlying
 XML Object model with a simple casting.</p>
 <!--  The following illustration of the actual class diagram will be helpful in understanding this.
@@ -301,7 +297,7 @@
 root.addChild(elt11);
 root.addChild(elt12);</pre>
 <ul>
-  <li>AddChild method will always add the child as the first child of the
+  <li>AddChild method will always add the child as the last child of the
     parent.</li>
   <li><p>A given node can be removed from the tree by calling the detach()
     method. A node can also be removed from the tree by calling the remove
@@ -329,7 +325,7 @@
 <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.
-FindNamespace is a very handy method to locate a namespace object higher up
+findNamespace 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>
@@ -351,7 +347,7 @@
 OMNamespace ns2 = root.declareNamespace("bar1","y");
 OMElement elt1 = factory.createOMElement("foo",ns1);
 OMElement elt2 = factory.createOMElement("yuck",ns2);
-OMText txt1 = factory.createText(elt2,"blah");
+OMText txt1 = factory.createOMText(elt2,"blah");
 elt2.addChild(txt1);
 elt1.addChild(elt2);
 root.addChild(elt1);</pre>