axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r562029 - in /webservices/axis2/branches/java/1_3/modules: codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl kernel/src/org/apache/axis2/client/Stub.java
Date Thu, 02 Aug 2007 07:02:41 GMT
Author: amilas
Date: Thu Aug  2 00:02:40 2007
New Revision: 562029

URL: http://svn.apache.org/viewvc?view=rev&rev=562029
Log:
set the omElement children correctly in soap header

Modified:
    webservices/axis2/branches/java/1_3/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
    webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/client/Stub.java

Modified: webservices/axis2/branches/java/1_3/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?view=diff&rev=562029&r1=562028&r2=562029
==============================================================================
--- webservices/axis2/branches/java/1_3/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
(original)
+++ webservices/axis2/branches/java/1_3/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
Thu Aug  2 00:02:40 2007
@@ -385,14 +385,11 @@
                                             <xsl:choose>
                                                 <xsl:when test="@mustUnderstand = 'true'">
                                                     org.apache.axiom.om.OMElement omElement<xsl:value-of
select="@name"/> = toOM(<xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of
select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
-                                                    org.apache.axiom.soap.SOAPHeaderBlock
soapHeaderBlock<xsl:value-of select="@name"/> = env.getHeader().addHeaderBlock(omElement<xsl:value-of
select="@name"/>.getLocalName(),omElement<xsl:value-of select="@name"/>.getNamespace());
-                                                    soapHeaderBlock<xsl:value-of select="@name"/>.setMustUnderstand(true);
-                                                    soapHeaderBlock<xsl:value-of select="@name"/>.addChild(omElement<xsl:value-of
select="@name"/>.getFirstElement());
+                                                    addHeader(omElement<xsl:value-of select="@name"/>,env,true);
                                                 </xsl:when>
                                                 <xsl:otherwise>
                                                     org.apache.axiom.om.OMElement omElement<xsl:value-of
select="@name"/> = toOM(<xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of
select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
-                                                    org.apache.axiom.soap.SOAPHeaderBlock
soapHeaderBlock<xsl:value-of select="@name"/> = env.getHeader().addHeaderBlock(omElement<xsl:value-of
select="@name"/>.getLocalName(),omElement<xsl:value-of select="@name"/>.getNamespace());
-                                                    soapHeaderBlock<xsl:value-of select="@name"/>.addChild(omElement<xsl:value-of
select="@name"/>.getFirstElement());
+                                                    addHeader(omElement<xsl:value-of select="@name"/>,env);
                                                 </xsl:otherwise>
                                             </xsl:choose>
                                         }
@@ -666,14 +663,11 @@
                                            <xsl:choose>
                                                 <xsl:when test="@mustUnderstand = 'true'">
                                                     org.apache.axiom.om.OMElement omElement<xsl:value-of
select="@name"/> = toOM(<xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of
select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
-                                                    org.apache.axiom.soap.SOAPHeaderBlock
soapHeaderBlock<xsl:value-of select="@name"/> = env.getHeader().addHeaderBlock(omElement<xsl:value-of
select="@name"/>.getLocalName(),omElement<xsl:value-of select="@name"/>.getNamespace());
-                                                    soapHeaderBlock<xsl:value-of select="@name"/>.setMustUnderstand(true);
-                                                    soapHeaderBlock<xsl:value-of select="@name"/>.addChild(omElement<xsl:value-of
select="@name"/>.getFirstElement());
+                                                    addHeader(omElement<xsl:value-of select="@name"/>,env,true);
                                                 </xsl:when>
                                                 <xsl:otherwise>
                                                     org.apache.axiom.om.OMElement omElement<xsl:value-of
select="@name"/> = toOM(<xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of
select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
-                                                    org.apache.axiom.soap.SOAPHeaderBlock
soapHeaderBlock<xsl:value-of select="@name"/> = env.getHeader().addHeaderBlock(omElement<xsl:value-of
select="@name"/>.getLocalName(),omElement<xsl:value-of select="@name"/>.getNamespace());
-                                                    soapHeaderBlock<xsl:value-of select="@name"/>.addChild(omElement<xsl:value-of
select="@name"/>.getFirstElement());
+                                                    addHeader(omElement<xsl:value-of select="@name"/>,env);
                                                 </xsl:otherwise>
                                             </xsl:choose>
                                         }
@@ -975,14 +969,11 @@
                                                             <xsl:choose>
                                                                 <xsl:when test="@mustUnderstand
= 'true'">
                                                                     org.apache.axiom.om.OMElement
omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of select="@name"/>,
optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>",
"<xsl:value-of select="$method-name"/>")));
-                                                                    org.apache.axiom.soap.SOAPHeaderBlock
soapHeaderBlock<xsl:value-of select="@name"/> = env.getHeader().addHeaderBlock(omElement<xsl:value-of
select="@name"/>.getLocalName(),omElement<xsl:value-of select="@name"/>.getNamespace());
-                                                                    soapHeaderBlock<xsl:value-of
select="@name"/>.setMustUnderstand(true);
-                                                                    soapHeaderBlock<xsl:value-of
select="@name"/>.addChild(omElement<xsl:value-of select="@name"/>.getFirstElement());
+                                                                    addHeader(omElement<xsl:value-of
select="@name"/>,env,true);
                                                                 </xsl:when>
                                                                 <xsl:otherwise>
                                                                     org.apache.axiom.om.OMElement
omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of select="@name"/>,
optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>",
"<xsl:value-of select="$method-name"/>")));
-                                                                    org.apache.axiom.soap.SOAPHeaderBlock
soapHeaderBlock<xsl:value-of select="@name"/> = env.getHeader().addHeaderBlock(omElement<xsl:value-of
select="@name"/>.getLocalName(),omElement<xsl:value-of select="@name"/>.getNamespace());
-                                                                    soapHeaderBlock<xsl:value-of
select="@name"/>.addChild(omElement<xsl:value-of select="@name"/>.getFirstElement());
+                                                                    addHeader(omElement<xsl:value-of
select="@name"/>,env);
                                                                 </xsl:otherwise>
                                                             </xsl:choose>
                                                         }

Modified: webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/client/Stub.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/client/Stub.java?view=diff&rev=562029&r1=562028&r2=562029
==============================================================================
--- webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/client/Stub.java
(original)
+++ webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/client/Stub.java
Thu Aug  2 00:02:40 2007
@@ -20,16 +20,8 @@
 
 package org.apache.axis2.client;
 
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.soap.SOAP11Constants;
-import org.apache.axiom.soap.SOAP12Constants;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.axiom.soap.SOAPProcessingException;
+import org.apache.axiom.om.*;
+import org.apache.axiom.soap.*;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.wsdl.WSDLConstants;
@@ -42,6 +34,7 @@
 import org.apache.commons.httpclient.Header;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 
 /**
  * Base class for generated client stubs. This defines several client API
@@ -195,6 +188,25 @@
                 omFactory.createOMAttribute(SOAP12Constants.ATTR_MUSTUNDERSTAND, omNamespace,
                                             "true");
         headerElement.addAttribute(mustUnderstandAttribute);
+    }
+
+    protected void addHeader(OMElement omElementToadd,
+                             SOAPEnvelope envelop,
+                             boolean mustUnderstand){
+        SOAPHeaderBlock soapHeaderBlock =
+                envelop.getHeader().addHeaderBlock(omElementToadd.getLocalName(),omElementToadd.getNamespace());
+        soapHeaderBlock.setMustUnderstand(mustUnderstand);
+        OMNode omNode = null;
+        for (Iterator iter = omElementToadd.getChildren(); iter.hasNext();){
+             omNode = (OMNode) iter.next();
+             soapHeaderBlock.addChild(omNode);
+        }
+
+    }
+
+    protected void addHeader(OMElement omElementToadd,
+                             SOAPEnvelope envelop){
+        addHeader(omElementToadd,envelop,false);
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message