axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r156406 - in webservices/axis/trunk/java/modules: core/src/java/org/apache/axis/addressing/ core/src/java/org/apache/axis/addressing/om/ om/src/java/org/apache/axis/om/ om/src/java/org/apache/axis/om/impl/llom/ om/src/java/org/apache/axis/om/impl/llom/builder/ om/src/test/org/apache/axis/om/impl/serializer/
Date Mon, 07 Mar 2005 08:27:04 GMT
Author: chinthaka
Date: Mon Mar  7 00:26:59 2005
New Revision: 156406

URL: http://svn.apache.org/viewcvs?view=rev&rev=156406
Log:
Fixed the OM serialization bug with some changes to addressing

Modified:
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/addressing/AddressingConstants.java
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/addressing/om/MessageInformationHeadersCollection.java
    webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/OMElement.java
    webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/OMElementImpl.java
    webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java
    webservices/axis/trunk/java/modules/om/src/test/org/apache/axis/om/impl/serializer/NoNamespaceSerializerTest.java

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/addressing/AddressingConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/addressing/AddressingConstants.java?view=diff&r1=156405&r2=156406
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/addressing/AddressingConstants.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/addressing/AddressingConstants.java
Mon Mar  7 00:26:59 2005
@@ -62,4 +62,10 @@
      * Field WSA_FAULT_TO
      */
     public static final String WSA_FAULT_TO = "FaultTo";
+
+    public static final String EPR_ADDRESS = "Address";
+    public static final String EPR_REFERENCE_PROPERTIES = "ReferenceProperties";
+    public static final String EPR_REFERENCE_PARAMETERS = "ReferenceParameters";
+    public static final String EPR_PORT_TYPE = "PortType";
+    public static final String EPR_SERVICE_NAME = "ServiceName";
 }

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/addressing/om/MessageInformationHeadersCollection.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/addressing/om/MessageInformationHeadersCollection.java?view=diff&r1=156405&r2=156406
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/addressing/om/MessageInformationHeadersCollection.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/addressing/om/MessageInformationHeadersCollection.java
Mon Mar  7 00:26:59 2005
@@ -15,6 +15,7 @@
  */
 package org.apache.axis.addressing.om;
 
+import org.apache.axis.addressing.AddressingConstants;
 import org.apache.axis.addressing.EndpointReference;
 import org.apache.axis.addressing.miheaders.RelatesTo;
 import org.apache.axis.om.SOAPHeader;
@@ -45,7 +46,7 @@
     private EndpointReference replyTo;
 
     /**
-     *  identifies the intended receiver for faults related to the message
+     * identifies the intended receiver for faults related to the message
      */
     private EndpointReference faultTo;
 
@@ -60,7 +61,6 @@
     private String messageId;
 
 
-
     /**
      * Addressing Header MUST have a to and an action
      *
@@ -91,6 +91,9 @@
      * @return
      */
     public EndpointReference getTo() {
+        if (to == null) {
+            to = new EndpointReference(AddressingConstants.WSA_TO, "");
+        }
         return to;
     }
 
@@ -109,6 +112,9 @@
      * @return
      */
     public EndpointReference getFrom() {
+        if (from == null) {
+            from = new EndpointReference(AddressingConstants.WSA_FROM, "");
+        }
         return from;
     }
 
@@ -127,6 +133,9 @@
      * @return
      */
     public EndpointReference getReplyTo() {
+        if (replyTo == null) {
+            replyTo = new EndpointReference(AddressingConstants.WSA_REPLY_TO, "");
+        }
         return replyTo;
     }
 
@@ -145,6 +154,9 @@
      * @return
      */
     public EndpointReference getFaultTo() {
+        if (faultTo == null) {
+            faultTo = new EndpointReference(AddressingConstants.WSA_FAULT_TO, "");
+        }
         return faultTo;
     }
 
@@ -199,6 +211,9 @@
      * @return
      */
     public RelatesTo getRelatesTo() {
+        if (relatesTo == null) {
+            relatesTo = new RelatesTo("");
+        }
         return relatesTo;
     }
 
@@ -208,6 +223,7 @@
      * @param relatesTo
      */
     public void setRelatesTo(RelatesTo relatesTo) {
+
         this.relatesTo = relatesTo;
     }
 

Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/OMElement.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/OMElement.java?view=diff&r1=156405&r2=156406
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/OMElement.java (original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/OMElement.java Mon
Mar  7 00:26:59 2005
@@ -34,7 +34,10 @@
     /**
      * This will search for children with a given QName and will return an iterator to traverse
through
      * the OMNodes.
-     * This QName can contain any combination of prefix, localname and URI
+     * This will match localName and namespaceURI only. localName only or namespaceURI only
can also be given. But
+     * the other parameter should be set to null
+     * Example : If you want to get all the addressing headers, header.getChildrenWithName(new
QName(AddressingNamespace, null))
+     * will do.
      *
      * @param elementQName
      * @return
@@ -197,4 +200,10 @@
      * @return
      */
     public XMLStreamReader getPullParser(boolean cacheOff);
+
+    /**
+     * This will return the non-empty text children as a String
+     * @return
+     */
+    public String getText();
 }

Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/OMElementImpl.java?view=diff&r1=156405&r2=156406
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/OMElementImpl.java
(original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/OMElementImpl.java
Mon Mar  7 00:26:59 2005
@@ -556,6 +556,21 @@
         return new OMStAXWrapper(builder, this, cacheOff);
     }
 
+    public String getText() {
+        String childText = "";
+        OMNode child = this.getFirstChild();
+        while(child != null){
+            String value = child.getValue();
+            System.out.println("value.length() = " + value.length());
+            if(child.getType() == OMNode.TEXT_NODE && value != null && !"".equals(value.trim())){
+               childText += value.trim();
+            }
+            child = child.getNextSibling();
+        }
+
+        return childText;
+    }
+
     /**
      * Method serialize
      *

Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java?view=diff&r1=156405&r2=156406
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java
(original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java
Mon Mar  7 00:26:59 2005
@@ -201,7 +201,7 @@
         } else {
 
             // this is neither of above. Just create an element
-            element = ombuilderFactory.createOMElement(elementName, null,
+            element = ombuilderFactory.createOMElement(elementName, parent.getNamespace(),
                     parent, this);
             processNamespaceData(element, false);
         }
@@ -282,21 +282,24 @@
         }
 
         // set the own namespace
+        String namespaceURI = parser.getNamespaceURI();
+        if(namespaceURI != ""){
         OMNamespace namespace =
                 node.findInScopeNamespace(parser.getNamespaceURI(),
                 parser.getPrefix());
-
+            node.setNamespace(namespace);
+        }
         // TODO we got to have this to make sure OM reject mesagess that are not sname space
qualified
         // But got to comment this to interop with Axis.1.x
         // if (namespace == null) {
         // throw new OMException("All elements must be namespace qualified!");
         // }
         if (isSOAPElement) {
-            if (!namespace.getName().equals(
+            if (!node.getNamespace().getName().equals(
                     OMConstants.SOAP_ENVELOPE_NAMESPACE_URI)) {
                 throw new OMBuilderException("invalid SOAP namespace URI");
             }
         }
-        node.setNamespace(namespace);
+
     }
 }

Modified: webservices/axis/trunk/java/modules/om/src/test/org/apache/axis/om/impl/serializer/NoNamespaceSerializerTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/test/org/apache/axis/om/impl/serializer/NoNamespaceSerializerTest.java?view=diff&r1=156405&r2=156406
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/test/org/apache/axis/om/impl/serializer/NoNamespaceSerializerTest.java
(original)
+++ webservices/axis/trunk/java/modules/om/src/test/org/apache/axis/om/impl/serializer/NoNamespaceSerializerTest.java
Mon Mar  7 00:26:59 2005
@@ -58,10 +58,20 @@
         builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(OMFactory.newInstance(),
reader);
     }
 
-    public void testSerilization() throws Exception{
+    public void testSerilizationWithCacheOff() throws Exception{
        SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
        env.serialize(writer,false);
        writer.flush();
+
+
+    }
+
+    public void testSerilizationWithCacheOn() throws Exception{
+       SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
+       env.serialize(writer,true);
+       writer.flush();
+
+
     }
 
 



Mime
View raw message