You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pr...@apache.org on 2007/09/17 13:40:02 UTC

svn commit: r576381 [1/3] - in /webservices/axis2/branches/java/jaxws21/modules: adb-codegen/ adb-codegen/src/org/apache/axis2/schema/ adb-codegen/src/org/apache/axis2/schema/template/ adb-codegen/src/org/apache/axis2/schema/writer/ adb-codegen/test-re...

Author: pradine
Date: Mon Sep 17 04:39:52 2007
New Revision: 576381

URL: http://svn.apache.org/viewvc?rev=576381&view=rev
Log:
Sync with trunk to revision 576270.

Added:
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/innerParticleExtension.xsd
      - copied unchanged from r576270, webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/innerParticleExtension.xsd
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/union2.xsd
      - copied unchanged from r576270, webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/union2.xsd
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/innerparticleextension/
      - copied from r576270, webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/innerparticleextension/
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/innerparticleextension/TestInnerParticleExtension.java
      - copied unchanged from r576270, webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/innerparticleextension/TestInnerParticleExtension.java
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/union2/
      - copied from r576270, webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/union2/
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/union2/Union2Test.java
      - copied unchanged from r576270, webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/union2/Union2Test.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/util/XMLStreamWriterWithOS.java
      - copied unchanged from r576270, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/util/XMLStreamWriterWithOS.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointCallback.java
      - copied unchanged from r576270, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointCallback.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointInvocationContext.java
      - copied unchanged from r576270, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointInvocationContext.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointInvocationContextImpl.java
      - copied unchanged from r576270, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointInvocationContextImpl.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/factory/EndpointDispatcherFactoryImpl.java
      - copied unchanged from r576270, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/factory/EndpointDispatcherFactoryImpl.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/Utils.java
      - copied unchanged from r576270, webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/Utils.java
Modified:
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateHeader.xsl
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/sub-build.xml
    webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/particalmaxoccurs/ParticalMaxOccursTest.java
    webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl
    webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl
    webservices/axis2/branches/java/jaxws21/modules/documentation/xdocs/@axis2_version_dir@/installationguide.xml
    webservices/axis2/branches/java/jaxws21/modules/documentation/xdocs/@axis2_version_dir@/quickstartguide.xml
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/CallbackFuture.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/InvocationContextFactory.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/Protocol.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageImpl.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/EndpointDispatcher.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaDispatcher.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/factory/EndpointDispatcherFactory.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/SOAP12Dispatch.java
    webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/wsdl/WSDL11DefaultActionPatternHelper.java
    webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
    webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/OperationContext.java
    webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/RequestResponseTransport.java
    webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
    webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/HTTPWorker.java
    webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/SOAPMessageFormatter.java
    webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java
    webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/http/util/SOAPUtil.java
    webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/transport/nhttp/HttpCoreRequestResponseTransport.java
    webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
    webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
    webservices/axis2/branches/java/jaxws21/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java Mon Sep 17 04:39:52 2007
@@ -61,6 +61,8 @@
     protected String minInclusiveFacet = null;
 
     protected Map memberTypes = new HashMap();
+    protected List memberTypesKeys = new ArrayList();
+
     protected QName itemTypeQName;
     protected String itemTypeClassName;
     protected boolean isUnion;
@@ -809,8 +811,17 @@
         this.memberTypes = memberTypes;
     }
 
+    public List getMemberTypesKeys() {
+        return memberTypesKeys;
+    }
+
+    public void setMemberTypesKeys(List memberTypesKeys) {
+        this.memberTypesKeys = memberTypesKeys;
+    }
+
     public void addMemberType(QName qname,String className){
         this.memberTypes.put(qname,className);
+        this.memberTypesKeys.add(qname);
     }
 
     public boolean isList() {

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java Mon Sep 17 04:39:52 2007
@@ -1619,9 +1619,7 @@
                     if (type instanceof XmlSchemaSimpleType) {
                         XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType) type;
 
-                        if ((simpleType != null) &&
-                                (simpleType.getContent() instanceof XmlSchemaSimpleTypeRestriction)) {
-                            // we only support simple type restriction
+                        if (simpleType != null) {
                             if (!isAlreadyProcessed(schemaTypeName)) {
                                 //process simple type
                                 processSimpleSchemaType(simpleType, null, parentSchema, null);
@@ -1991,34 +1989,6 @@
                 } else {
                     throw new SchemaCompilationException("Referenced name is null");
                 }
-
-            } else if (order && (item instanceof XmlSchemaChoice)) {
-
-                // this is a tempory patch for process only inner sequence choices
-                // but we have do this with a proper design
-                XmlSchemaChoice choice = (XmlSchemaChoice) item;
-                XmlSchemaObject choiceChild;
-                XmlSchemaObjectCollection schemaItems = choice.getItems();
-                for (int j = 0; j < schemaItems.getCount(); j++) {
-                   choiceChild = schemaItems.getItem(j);
-                   if (choiceChild instanceof XmlSchemaElement){
-                       // i.e this is an inner choice element
-                       //recursively process the element
-                        XmlSchemaElement xsElt = (XmlSchemaElement) choiceChild;
-
-                        boolean isArray = isArray(xsElt);
-                        processElement(xsElt, processedElementTypeMap, localNillableList, parentSchema); //we know for sure this is not an outer type
-                        processedElementArrayStatusMap.put(xsElt, (isArray) ? Boolean.TRUE : Boolean.FALSE);
-                        if (order) {
-                            //we need to keep the order of the elements. So push the elements to another
-                            //hashmap with the order number
-                            elementOrderMap.put(xsElt, new Integer(sequenceCounter));
-                            sequenceCounter++;
-                        }
-                       innerChoiceElementList.add(xsElt.getQName());
-                   }
-                }
-
             } else {
                 //there may be other types to be handled here. Add them
                 //when we are ready

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl Mon Sep 17 04:39:52 2007
@@ -86,7 +86,7 @@
             */
         </xsl:if>
 
-        public <xsl:if test="not(@unwrapped) or (@skip-write)">static</xsl:if> <xsl:if test="@isAbstract">abstract</xsl:if> class <xsl:value-of select="$name"/> <xsl:if test="$extension"> extends <xsl:value-of select="$extension"/></xsl:if> <xsl:if test="$restriction"> extends <xsl:value-of select="$restriction"/></xsl:if>
+        public <xsl:if test="not(@unwrapped) or (@skip-write)">static</xsl:if> <xsl:if test="@isAbstract and @unwrapped and not(@skip-write)">abstract</xsl:if> class <xsl:value-of select="$name"/> <xsl:if test="$extension"> extends <xsl:value-of select="$extension"/></xsl:if> <xsl:if test="$restriction"> extends <xsl:value-of select="$restriction"/></xsl:if>
         <xsl:if test="$union and not($restriction) and not($extension)"> extends  org.apache.axis2.databinding.types.Union </xsl:if>
         implements org.apache.axis2.databinding.ADBBean{
         <xsl:choose>
@@ -112,13 +112,13 @@
             return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
         }
 
-        <xsl:if test="$choice or (count(property[@innerchoice='yes']) > 0)">
+        <xsl:if test="$choice">
             /** Whenever a new property is set ensure all others are unset
              *  There can be only one choice and the last one wins
              */
             private void clearAllSettingTrackers() {
             <xsl:for-each select="property">
-                <xsl:if test="$choice or (@innerchoice='yes')">
+                <xsl:if test="$choice">
                    local<xsl:value-of select="@javaname"/>Tracker = false;
                 </xsl:if>
            </xsl:for-each>
@@ -213,10 +213,10 @@
                          <!-- call the validator-->
                                 validate<xsl:value-of select="$javaName"/>(param);
 
-                         <xsl:if test="$choice or (@innerchoice='yes')">
+                         <xsl:if test="$choice">
                               clearAllSettingTrackers();
                          </xsl:if>
-                         <xsl:if test="$min=0 or $choice or (@innerchoice='yes')">
+                         <xsl:if test="$min=0 or $choice">
                             <!-- the updating of setting tracker for null values should
                                  happen if the attribute is marked as nillable. Else
                                  the user can set a null value and it is never marked
@@ -331,7 +331,7 @@
                         <xsl:if test="not(enumFacet)">
                         <!-- Generate a tracker only if the min occurs is zero, which means if the user does
                            not bother to set that value, we do not send it -->
-                           <xsl:if test="$min=0 or $choice or (@innerchoice='yes')">
+                           <xsl:if test="$min=0 or $choice">
                            /*  This tracker boolean wil be used to detect whether the user called the set method
                           *   for this attribute. It will be used to determine whether to include this field
                            *   in the serialized XML
@@ -379,10 +379,10 @@
                               <!-- call the validator-->
                                    validate<xsl:value-of select="$javaName"/>(param);
 
-                               <xsl:if test="$choice or (@innerchoice='yes')">
+                               <xsl:if test="$choice">
                                    clearAllSettingTrackers();
                                </xsl:if>
-                               <xsl:if test="$min=0 or $choice or (@innerchoice='yes')">
+                               <xsl:if test="$min=0 or $choice">
                                    <!-- the updating of setting tracker for null values should
                                      happen if the attribute is marked as nillable. Else
                                      the user can set a null value and it is never marked
@@ -433,10 +433,10 @@
                                    <xsl:value-of select="$varName"/> = new <xsl:value-of select="$propertyType"/>{};
                                    }
 
-                            <xsl:if test="$choice or (@innerchoice='yes')">
+                            <xsl:if test="$choice">
                                    clearAllSettingTrackers();
                             </xsl:if>
-                            <xsl:if test="$min=0 or $choice or (@innerchoice='yes')">
+                            <xsl:if test="$min=0 or $choice">
                                  //update the setting tracker
                                 <xsl:value-of select="$settingTracker"/> = true;
                             </xsl:if>
@@ -460,10 +460,10 @@
                                * @param param <xsl:value-of select="$javaName"/>
                                */
                                public void set<xsl:value-of select="$javaName"/>(<xsl:value-of select="$propertyType"/> param){
-                            <xsl:if test="$choice or (@innerchoice='yes')">
+                            <xsl:if test="$choice">
                                 clearAllSettingTrackers();
                             </xsl:if>
-                            <xsl:if test="$min=0 or $choice or (@innerchoice='yes')">
+                            <xsl:if test="$min=0 or $choice">
                                 <xsl:choose>
                                    <xsl:when test="@primitive and not(@array)">
                                        // setting primitive attribute tracker to true
@@ -637,7 +637,7 @@
                             this.localObject = object;
                   </xsl:for-each>
                       } else {
-                          throw new RuntimeException("Invalid object type");
+                          throw new java.lang.RuntimeException("Invalid object type");
                       }
               }
 
@@ -863,7 +863,7 @@
 
 
                 <!-- write the type attribute if needed -->
-               <xsl:if test="$extension">
+               <xsl:if test="$extension and not(@anon)">
                java.lang.String namespacePrefix = registerPrefix(xmlWriter,"<xsl:value-of select="$nsuri"/>");
                if ((namespacePrefix != null) &amp;&amp; (namespacePrefix.trim().length() > 0)){
                    writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type",
@@ -983,7 +983,7 @@
                     <xsl:variable name="propertyBaseType"><xsl:value-of select="@arrayBaseType"/></xsl:variable>
                     <xsl:variable name="particleClassType" select="@particleClassType"></xsl:variable>
 
-                    <xsl:if test="$min=0 or $choice or (@innerchoice='yes')"> if (<xsl:value-of select="$settingTracker"/>){</xsl:if>
+                    <xsl:if test="$min=0 or $choice"> if (<xsl:value-of select="$settingTracker"/>){</xsl:if>
                     <xsl:choose>
                         <xsl:when test="@ours and not(@array) and not(@default)">
                             <xsl:choose>
@@ -1575,7 +1575,7 @@
                              </xsl:if>
                         </xsl:otherwise>
                     </xsl:choose>
-                    <xsl:if test="$min=0 or $choice or (@innerchoice='yes')">}</xsl:if>
+                    <xsl:if test="$min=0 or $choice">}</xsl:if>
 
                 </xsl:for-each>
                    <!-- write the end element for the type-->
@@ -2243,6 +2243,50 @@
                         throw new org.apache.axis2.databinding.ADBException("Error in parsing value");
                     }
                }
+
+               public static <xsl:value-of select="$name"/> fromString(java.lang.String value,
+                                                        java.lang.String namespaceURI){
+                    <xsl:value-of select="$name"/> object = new <xsl:value-of select="$name"/>();
+                    boolean isValueSet = false;
+                    <xsl:for-each select="memberType">
+                      // we have to set the object with the first matching type.
+                      if (!isValueSet) {
+                        <xsl:choose>
+                            <xsl:when test="@nsuri='http://www.w3.org/2001/XMLSchema'">
+                                try {
+                                    java.lang.reflect.Method converterMethod =
+                                            org.apache.axis2.databinding.utils.ConverterUtil.class.getMethod(
+                                                    "convertTo<xsl:value-of select="@shorttypename"/>",
+                                                    new java.lang.Class[]{java.lang.String.class});
+                                    object.setObject(converterMethod.invoke(null, new java.lang.Object[]{value}));
+                                    isValueSet = true;
+                                } catch (java.lang.Exception e) {
+                                }
+                            </xsl:when>
+                            <xsl:otherwise>
+                                try {
+                                   object.setObject(<xsl:value-of select="@type"/>.Factory.fromString(value, namespaceURI));
+                                   isValueSet = true;
+                                } catch (java.lang.Exception e) {
+                                }
+                            </xsl:otherwise>
+                        </xsl:choose>
+                      }
+                    </xsl:for-each>
+                    return object;
+                }
+
+                public static <xsl:value-of select="$name"/> fromString(javax.xml.stream.XMLStreamReader xmlStreamReader,
+                                                                    java.lang.String content) {
+                    if (content.indexOf(":") > -1){
+                        java.lang.String prefix = content.substring(0,content.indexOf(":"));
+                        java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix);
+                        return <xsl:value-of select="$name"/>.Factory.fromString(content,namespaceUri);
+                    } else {
+                       return <xsl:value-of select="$name"/>.Factory.fromString(content,"");
+                    }
+                }
+
         </xsl:if>
 
         <xsl:if test="$list and $simple">
@@ -2338,6 +2382,17 @@
                     return returnValue;
                 }
 
+                public static <xsl:value-of select="$name"/> fromString(javax.xml.stream.XMLStreamReader xmlStreamReader,
+                                                                    java.lang.String content) {
+                    if (content.indexOf(":") > -1){
+                        java.lang.String prefix = content.substring(0,content.indexOf(":"));
+                        java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix);
+                        return <xsl:value-of select="$name"/>.Factory.fromString(content,namespaceUri);
+                    } else {
+                       return <xsl:value-of select="$name"/>.Factory.fromString(content,"");
+                    }
+                }
+
             </xsl:if>
             <xsl:if test="enumFacet">
                 public static <xsl:value-of select="$name"/> fromValue(<xsl:value-of select="$propertyType"/> value)
@@ -2378,6 +2433,17 @@
                         throw new java.lang.IllegalArgumentException();
                     }
                 }
+
+                public static <xsl:value-of select="$name"/> fromString(javax.xml.stream.XMLStreamReader xmlStreamReader,
+                                                                    java.lang.String content) {
+                    if (content.indexOf(":") > -1){
+                        java.lang.String prefix = content.substring(0,content.indexOf(":"));
+                        java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix);
+                        return <xsl:value-of select="$name"/>.Factory.fromString(content,namespaceUri);
+                    } else {
+                       return <xsl:value-of select="$name"/>.Factory.fromString(content,"");
+                    }
+                }
             </xsl:if>
 
         </xsl:for-each>
@@ -2481,8 +2547,22 @@
                     </xsl:if>
 
                   }
+                <xsl:if test="$union">
+                  } else {
+                    // i.e this is an union type with out specific xsi:type
+                    java.lang.String content = reader.getElementText();
+                    if (content.indexOf(":") > -1){
+                        // i.e. this could be a qname
+                        prefix = content.substring(0,content.indexOf(":"));
+                        namespaceuri = reader.getNamespaceContext().getNamespaceURI(prefix);
+                        object = <xsl:value-of select="$name"/>.Factory.fromString(content,namespaceuri);
+                    } else {
+                        object = <xsl:value-of select="$name"/>.Factory.fromString(content,"");
+                    }
+                </xsl:if>
 
                 }
+
                 </xsl:if>
 
                 <xsl:if test="$list">
@@ -2550,18 +2630,8 @@
                                     <xsl:otherwise>
                                         <xsl:choose>
                                             <xsl:when test="@ours">
-                                                if (<xsl:value-of select="$attribName"/>.indexOf(":") > 0) {
-                                                    // this seems to be a Qname so find the namespace and send
-                                                    prefix = <xsl:value-of select="$attribName"/>.substring(0, <xsl:value-of select="$attribName"/>.indexOf(":"));
-                                                    namespaceuri = reader.getNamespaceURI(prefix);
-                                                    object.set<xsl:value-of select="$javaName"/>(
-                                                        <xsl:value-of select="@type"/>.Factory.fromString(<xsl:value-of select="$attribName"/>,namespaceuri));
-                                                } else {
-                                                    // this seems to be not a qname send and empty namespace incase of it is
-                                                    // check is done in fromString method
-                                                    object.set<xsl:value-of select="$javaName"/>(
-                                                        <xsl:value-of select="@type"/>.Factory.fromString(<xsl:value-of select="$attribName"/>,""));
-                                                }
+                                                  object.set<xsl:value-of select="$javaName"/>(
+                                                        <xsl:value-of select="@type"/>.Factory.fromString(reader,<xsl:value-of select="$attribName"/>));
                                             </xsl:when>
                                             <xsl:otherwise>
                                                  object.set<xsl:value-of select="$javaName"/>(
@@ -3370,7 +3440,7 @@
                                     }
                                 </xsl:if>
                             </xsl:if>
-                            <xsl:if test="$ordered and $min!=0 and not(@innerchoice='yes')">
+                            <xsl:if test="$ordered and $min!=0">
                                 else{
                                     // A start element we are not expecting indicates an invalid parameter was passed
                                     throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName());
@@ -3395,7 +3465,7 @@
 
                         <xsl:if test="property[not(@attribute)]">  <!-- this if is needed to skip all this when there are no propoerties-->
                         <xsl:if test="$unordered and not($particleClass)">
-                          <xsl:if test="not(property/enumFacet) and not($choice and $hasParticleType)">
+                          <xsl:if test="not(property/enumFacet) and not($choice or $hasParticleType)">
                              else{
                                         // A start element we are not expecting indicates an invalid parameter was passed
                                         throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName());

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateHeader.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateHeader.xsl?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateHeader.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateHeader.xsl Mon Sep 17 04:39:52 2007
@@ -86,7 +86,7 @@
 
         #include &lt;stdio.h&gt;
         #include &lt;axiom.h&gt;
-        #include &lt;axutil_utils.h&gt;
+        #include &lt;axis2_util.h&gt;
         #include &lt;axiom_soap.h&gt;
         #include &lt;axis2_client.h&gt;
 

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl Mon Sep 17 04:39:52 2007
@@ -240,7 +240,7 @@
               </xsl:if>
 
               <!-- the following element can be inside array or independent one -->
-                 <xsl:if test="$nativePropertyType!='axis2_char_t*'">
+                 <!--xsl:if test="$nativePropertyType!='axis2_char_t*'"-->
               if( <xsl:value-of select="$justAttriName"/> != NULL)
               {
                  <!-- how to free all the ours things -->
@@ -258,7 +258,7 @@
                    </xsl:when>
 
                    <!-- free axis2_char_t s -->
-                   <xsl:when test="$nativePropertyType='axis2_char_t*'">
+                   <xsl:when test="$nativePropertyType='axis2_char_t*' and not(@isarray)">
                       AXIS2_FREE( env-> allocator, <xsl:value-of select="$attriName"/>);
                    </xsl:when>
 
@@ -294,7 +294,7 @@
                  <xsl:value-of select="$justAttriName"/> = NULL;
               }
 
-              </xsl:if>
+              <!--/xsl:if-->
               <!-- close tags arrays -->
               <xsl:if test="@isarray">
                     }
@@ -405,7 +405,7 @@
               <xsl:when test="not(@type)">
                 <xsl:for-each select="property">
                  <xsl:if test="position()=1">
-                    current_element = axiom_node_get_data_element( parent, env);
+                    current_element = (axiom_element_t *)axiom_node_get_data_element( parent, env);
                     qname = axiom_element_get_qname( current_element, env, parent);
                     if ( axutil_qname_equals( qname, env, <xsl:value-of select="$name"/>-> qname ) )
                     {
@@ -436,7 +436,7 @@
 
             <xsl:for-each select="property/@attribute">
              <xsl:if test="position()=1">
-                 parent_element = axiom_node_get_data_element( parent, env);
+                 parent_element = (axiom_element_t *)axiom_node_get_data_element( parent, env);
              </xsl:if>
             </xsl:for-each>
 
@@ -635,9 +635,7 @@
                     /**
                      * building <xsl:value-of select="$CName"/> array
                      */
-                     <xsl:if test="position()=1">
                        arr_list = axutil_array_list_create( env, 10);
-                     </xsl:if>
                    </xsl:if>
 
                      <!-- for each non attribute properties there will always be an element-->
@@ -673,7 +671,7 @@
                                for ( current_node = first_node; current_node != NULL;
                                              current_node = axiom_node_get_next_sibling( current_node, env))
                                {
-                                  current_element = axiom_node_get_data_element( current_node, env);
+                                  current_element = (axiom_element_t *)axiom_node_get_data_element( current_node, env);
                                   qname = axiom_element_get_qname( current_element, env, current_node);
                                   element_qname = axutil_qname_create( env, "<xsl:value-of select="$propertyName"/>", "<xsl:value-of select="@nsuri"/>", "<xsl:choose>
                                                                    <xsl:when test="@prefix!=''"><xsl:value-of select="@prefix"/></xsl:when>
@@ -686,9 +684,12 @@
                                }
                              </xsl:otherwise>
                            </xsl:choose>
-                           if ( current_node != NULL)
+                           
+                           if (current_node <xsl:if test="(@minOccurs=0)"> &amp;&amp; axiom_node_get_data_element( current_node, env) &amp;&amp; !axutil_strcmp(&quot;<xsl:value-of select="$propertyName"/>&quot;, 
+                           axiom_element_get_localname((axiom_element_t *)axiom_node_get_data_element( current_node, env), env))
+                           </xsl:if>)
                            {
-                              <xsl:if test="../@ordered or not($anon or $istype)">current_element = axiom_node_get_data_element( current_node, env);</xsl:if>
+                              <xsl:if test="../@ordered or not($anon or $istype)">current_element = (axiom_element_t *)axiom_node_get_data_element( current_node, env);</xsl:if>
                               <!-- changes to following choose tag should be changed in another 2 places -->
                                  <xsl:choose>
                                     <xsl:when test="@ours">
@@ -957,7 +958,7 @@
                                              <xsl:when test="position()=1">first_node</xsl:when>
                                              <xsl:otherwise>axiom_node_get_next_sibling( current_node, env)</xsl:otherwise></xsl:choose>; current_node != NULL; current_node = axiom_node_get_next_sibling( current_node, env))
                                {
-                                  current_element = axiom_node_get_data_element( current_node, env);
+                                  current_element = (axiom_element_t *)axiom_node_get_data_element( current_node, env);
                                   qname = axiom_element_get_qname( current_element, env, current_node);
 
                                   if ( axutil_qname_equals( element_qname, env, qname) )
@@ -1129,7 +1130,7 @@
                                  */
                                for ( i = 0, current_node = first_node; current_node != NULL; current_node = axiom_node_get_next_sibling( current_node, env))
                                {
-                                  current_element = axiom_node_get_data_element( current_node, env);
+                                  current_element = (axiom_element_t *)axiom_node_get_data_element( current_node, env);
                                   qname = axiom_element_get_qname( current_element, env, current_node);
 
                                   if ( axutil_qname_equals( element_qname, env, qname)
@@ -1373,13 +1374,13 @@
             </xsl:if>
             <xsl:for-each select="property/@attribute">
              <xsl:if test="position()=1">
-                 parent_element = axiom_node_get_data_element( parent, env);
+                 parent_element = (axiom_element_t *)axiom_node_get_data_element( parent, env);
              </xsl:if>
             </xsl:for-each>
             <xsl:if test="property and (not(property/@attribute) or property/@attribute='' or property/@notattribute)">
                 if(has_parent)
                 {
-                    data_source = axiom_node_get_data_element(parent, env);
+                    data_source = (axiom_data_source_t *)axiom_node_get_data_element(parent, env);
                     if (!data_source)
                         return NULL;
                     stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */
@@ -1790,7 +1791,7 @@
                            axutil_stream_write(stream, env, start_input_str, start_input_str_len);
                             
                            text_value_<xsl:value-of select="$position"/>_temp = axutil_xml_quote_string(env, text_value_<xsl:value-of select="$position"/>, AXIS2_TRUE);
-                           if (text_value_2_temp)
+                           if (text_value_<xsl:value-of select="$position"/>_temp)
                            {
                                axutil_stream_write(stream, env, text_value_<xsl:value-of select="$position"/>_temp, axutil_strlen(text_value_<xsl:value-of select="$position"/>_temp));
                                AXIS2_FREE(env->allocator, text_value_<xsl:value-of select="$position"/>_temp);
@@ -1942,7 +1943,14 @@
                       return AXIS2_FAILURE;
                   }
                 </xsl:if>
-                <xsl:value-of select="$name"/>-> attrib_<xsl:value-of select="$CName"/> = param_<xsl:value-of select="$CName"/>;
+                <xsl:choose>
+                    <xsl:when test="@type='axis2_char_t*' and not(@isarray)">
+                        <xsl:value-of select="$name"/>->attrib_<xsl:value-of select="$CName"/> = (axis2_char_t *)axutil_strdup(env, param_<xsl:value-of select="$CName"/>);
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:value-of select="$name"/>->attrib_<xsl:value-of select="$CName"/> = param_<xsl:value-of select="$CName"/>;
+                    </xsl:otherwise>
+                </xsl:choose>
                 return AXIS2_SUCCESS;
              }
 

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java Mon Sep 17 04:39:52 2007
@@ -51,7 +51,7 @@
  */
 public class JavaBeanWriter implements BeanWriter {
 
-    private static final Log log = LogFactory.getLog(JavaBeanWriter .class);
+    private static final Log log = LogFactory.getLog(JavaBeanWriter.class);
 
     public static final String WRAPPED_DATABINDING_CLASS_NAME = "WrappedDatabinder";
 
@@ -602,7 +602,7 @@
                                       Map typeMap) {
         Map memberTypes = metainf.getMemberTypes();
         QName memberQName;
-        for (Iterator iter = memberTypes.keySet().iterator(); iter.hasNext();) {
+        for (Iterator iter = metainf.getMemberTypesKeys().iterator(); iter.hasNext();) {
             memberQName = (QName) iter.next();
             String memberClass = (String) memberTypes.get(memberQName);
             if (PrimitiveTypeFinder.isPrimitive(memberClass)) {
@@ -740,6 +740,13 @@
             // set the is particle class
             if (metainf.getParticleTypeStatusForQName(name)){
                 XSLTUtils.addAttribute(model, "particleClassType", "yes", property);
+            }
+
+            // if we have an particle class in a extension class then we have
+            // to consider the whole class has a particle type.
+
+            if (metainf.isHasParticleType()) {
+                XSLTUtils.addAttribute(model, "hasParticleType", "yes", rootElt);
             }
 
             // what happed if this contain attributes

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/sub-build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/sub-build.xml?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/sub-build.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/sub-build.xml Mon Sep 17 04:39:52 2007
@@ -362,6 +362,22 @@
 			<arg file="${testsuite.source.dir}/rampart.xsd"/>
 			<arg file="${schema.generated.src.dir}"/>
 		</java>
+        <echo>Compiling innerParticleExtension.xsd</echo>
+		<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+			<jvmarg line="${maven.junit.jvmargs}"/>
+			<classpath refid="maven.dependency.classpath"/>
+			<classpath location="${compiled.classes.dir}"/>
+			<arg file="${testsuite.source.dir}/innerParticleExtension.xsd"/>
+			<arg file="${schema.generated.src.dir}"/>
+		</java>
+        <echo>Compiling union2.xsd</echo>
+		<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+			<jvmarg line="${maven.junit.jvmargs}"/>
+			<classpath refid="maven.dependency.classpath"/>
+			<classpath location="${compiled.classes.dir}"/>
+			<arg file="${testsuite.source.dir}/union2.xsd"/>
+			<arg file="${schema.generated.src.dir}"/>
+		</java>
     </target>
 
 </project>

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/particalmaxoccurs/ParticalMaxOccursTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/particalmaxoccurs/ParticalMaxOccursTest.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/particalmaxoccurs/ParticalMaxOccursTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/particalmaxoccurs/ParticalMaxOccursTest.java Mon Sep 17 04:39:52 2007
@@ -346,8 +346,10 @@
             assertEquals(resultChoices[0].getParm1(), "Param11");
             assertEquals(resultChoices[1].getParm2(), "Param12");
         } catch (XMLStreamException e) {
+           e.printStackTrace();
             fail();
         } catch (Exception e) {
+           e.printStackTrace();
             fail();
         }
     }

Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl Mon Sep 17 04:39:52 2007
@@ -70,7 +70,7 @@
 	{
 	    axis2_svc_skeleton_t *svc_skeleton = NULL;
         /* Allocate memory for the structs */
-        svc_skeleton = AXIS2_MALLOC(env->allocator,
+        svc_skeleton = (axis2_svc_skeleton_t *)AXIS2_MALLOC(env->allocator,
             sizeof(axis2_svc_skeleton_t));
 
         svc_skeleton->ops = &amp;<xsl:value-of select="$skeletonname"/>_svc_skeleton_ops_var;

Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl Mon Sep 17 04:39:52 2007
@@ -34,6 +34,9 @@
     </xsl:for-each>
    </xsl:for-each>
 
+	#ifdef __cplusplus
+	extern "C" {
+	#endif
 
      <xsl:for-each select="method">
          <xsl:variable name="outputours"><xsl:value-of select="output/param/@ours"></xsl:value-of></xsl:variable>
@@ -66,5 +69,8 @@
                                           </xsl:for-each> );
      </xsl:for-each>
 
+	#ifdef __cplusplus
+	}
+	#endif
     </xsl:template>
  </xsl:stylesheet>

Modified: webservices/axis2/branches/java/jaxws21/modules/documentation/xdocs/@axis2_version_dir@/installationguide.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/documentation/xdocs/%40axis2_version_dir%40/installationguide.xml?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/documentation/xdocs/@axis2_version_dir@/installationguide.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/documentation/xdocs/@axis2_version_dir@/installationguide.xml Mon Sep 17 04:39:52 2007
@@ -194,7 +194,7 @@
 <h3>2. Starting up Axis2 Standalone Server</h3>
 <p>The standalone Axis2 server can be started by executing the
 following commands:<br />
-$AXIS2_HOME\bin\axis2server.bat (Windows)<br />
+%AXIS2_HOME%\bin\axis2server.bat (Windows)<br />
 $AXIS2_HOME/bin/axis2server.sh (Unix)</p>
 <p>After startup, the default web services included with Axis2 will
 be available by visiting http://localhost:8080/axis2/services/</p>
@@ -207,17 +207,17 @@
 <p>Locate the Ant build file (build.xml) inside the webapp
 directory, which resides in your Axis2 home directory (i.e:-
 $AXIS_HOME/webapp)". Run the Ant build by executing "ant
-create.war" inside the $AXIS2_HOME/webapps folder. You can find the
-generated axis2.war inside the $AXIS2_HOME/dist directory. All the
+create.war" inside the AXIS2_HOME/webapps folder. You can find the
+generated axis2.war inside the AXIS2_HOME/dist directory. All the
 services and modules that are present in the AXIS2_HOME/repository
 will be packed into the created axis2.war together with the Axis2
-configuration found at $AXIS2_HOME/conf/axis2.xml.</p>
+configuration found at AXIS2_HOME/conf/axis2.xml.</p>
 <p>Read <a href="#servlet_container">Installing Axis2 in a Servlet
 Container</a> to find out how to deploy the Axis2 Web application
 in a servlet container.</p>
 <a name="standalone4" id="standalone4"></a>
 <h3>4. Getting Familiar with the Convenient Axis2 Scripts</h3>
-<p>It is advised to add the $AXIS2_HOME/bin to the PATH, so that
+<p>It is advised to add the AXIS2_HOME/bin to the PATH, so that
 you'll be able to run the following scripts from anywhere.</p>
 <table border="1">
 <tbody>

Modified: webservices/axis2/branches/java/jaxws21/modules/documentation/xdocs/@axis2_version_dir@/quickstartguide.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/documentation/xdocs/%40axis2_version_dir%40/quickstartguide.xml?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/documentation/xdocs/@axis2_version_dir@/quickstartguide.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/documentation/xdocs/@axis2_version_dir@/quickstartguide.xml Mon Sep 17 04:39:52 2007
@@ -134,7 +134,11 @@
 <ol>
 <li>Create and compile the Java class.
 <pre>
-%AXIS2_HOME%/bin/java2wsdl -cp . -cn samples.quickstart.service.pojo.StockQuoteService -of StockQuoteService.wsdl
+(Windows)
+%AXIS2_HOME%\bin\java2wsdl -cp . -cn samples.quickstart.service.pojo.StockQuoteService -of StockQuoteService.wsdl
+
+(Linux)
+$AXIS2_HOME/bin/java2wsdl -cp . -cn samples.quickstart.service.pojo.StockQuoteService -of StockQuoteService.wsdl
 </pre></li>
 <li>Generate the WSDL using the command:</li>
 </ol>
@@ -142,7 +146,7 @@
 you need. For example, you might add custom faults or change the
 name of the generated elements. For example, this
 StockQuoteService.wsdl is in
-%AXIS2_HOME%/samples/quickstartadb/resources/META-INF folder, which
+AXIS2_HOME/samples/quickstartadb/resources/META-INF folder, which
 we'll be using throughout the rest of this guide, replaces the
 generic parameters created by the generation process.</p>
 <a name="services" id="services"></a>
@@ -266,7 +270,7 @@
 <p>To deploy the service using POJOs (Plain Old Java Objects),
 execute the following steps.</p>
 <p>Note the directory structure contained at
-&lt;AXIS2_HOME&gt;/samples/quickstart (the services.xml file is
+AXIS2_HOME/samples/quickstart (the services.xml file is
 from the first section of this guide):</p>
 <pre>
 - quickstart
@@ -470,7 +474,12 @@
 <p>Generate the skeleton using the WSDL2Java utility by typing the
 following in the Axis2_HOME/samples/quickstartadb directory:</p>
 <pre>
-%AXIS2_HOME%/bin/WSDL2Java -uri resources/META-INF/StockQuoteService.wsdl -p samples.quickstart.service.adb -d adb -s -ss -sd -ssi -o build/service
+(Windows)
+%AXIS2_HOME%\bin\WSDL2Java -uri resources\META-INF\StockQuoteService.wsdl -p samples.quickstart.service.adb -d adb -s -ss -sd -ssi -o build\service
+
+(Linux)
+$AXIS2_HOME/bin/WSDL2Java -uri resources/META-INF/StockQuoteService.wsdl -p samples.quickstart.service.adb -d adb -s -ss -sd -ssi -o build/service
+
 </pre>
 <p>Else, simply type ant generate.service in the
 Axis2_HOME/samples/quickstartadb directory.</p>
@@ -551,7 +560,7 @@
 following in the Axis2_HOME/samples/quickstartxmlbeans
 directory.</p>
 <pre>
-%AXIS2_HOME%/bin/WSDL2Java -uri resources/META-INF/StockQuoteService.wsdl -p samples.quickstart.service.xmlbeans -d xmlbeans -s -ss -sd -ssi -o build/service
+%AXIS2_HOME%\bin\WSDL2Java -uri resources\META-INF\StockQuoteService.wsdl -p samples.quickstart.service.xmlbeans -d xmlbeans -s -ss -sd -ssi -o build\service
 </pre>
 <p>Else simply type ant generate.service in the
 Axis2_HOME/samples/quickstartxmlbeans directory.</p>
@@ -636,7 +645,7 @@
 following at a console in the Axis2_HOME/samples/quickstartjibx
 directory:</p>
 <pre>
-%AXIS2_HOME%/bin/wsdl2java -uri resources/META-INF/StockQuoteService.wsdl -p samples.quickstart.service.jibx -d jibx -s -ss -sd -ssi -uw -o build/service
+%AXIS2_HOME%\bin\wsdl2java -uri resources\META-INF\StockQuoteService.wsdl -p samples.quickstart.service.jibx -d jibx -s -ss -sd -ssi -uw -o build\service
 </pre>
 <p>Else, simply type "ant generate.service" in the
 Axis2_HOME/samples/quickstartjibx directory.</p>
@@ -833,7 +842,7 @@
 <p>Generate the client databings by typing the following in the
 Axis2_HOME/samples/quickstartadb directory:</p>
 <pre>
-%AXIS2_HOME%/bin/WSDL2Java -uri resources/META-INF/StockQuoteService.wsdl -p samples.quickstart.clients -d adb -s -o build/client
+%AXIS2_HOME%\bin\WSDL2Java -uri resources\META-INF\StockQuoteService.wsdl -p samples.quickstart.clients -d adb -s -o build\client
 </pre>
 <p>Else, simply type ant generate.client in the
 Axis2_HOME/samples/quickstartadb directory.</p>
@@ -918,7 +927,7 @@
 <p>Generate the databings by typing the following in the
 xmlbeansClient directory.</p>
 <pre>
-%AXIS2_HOME%/bin/WSDL2Java -uri resources/META-INF/StockQuoteService.wsdl -p samples.quickstart.service.xmlbeans -d xmlbeans -s -o build/client
+%AXIS2_HOME%\bin\WSDL2Java -uri resources\META-INF\StockQuoteService.wsdl -p samples.quickstart.service.xmlbeans -d xmlbeans -s -o build\client
 </pre>
 <p>Else, simply type ant generate.client in the
 Axis2_HOME/samples/quickstartxmlbeans directory.</p>
@@ -1010,7 +1019,7 @@
 <p>Generate the client stub by typing the following at a console in
 the Axis2_HOME/samples/quickstartjibx directory.</p>
 <pre>
-%AXIS2_HOME%/bin/wsdl2java -uri resources/META-INF/StockQuoteService.wsdl -p samples.quickstart.clients -d jibx -s -uw -o build/client
+%AXIS2_HOME%\bin\wsdl2java -uri resources\META-INF\StockQuoteService.wsdl -p samples.quickstart.clients -d jibx -s -uw -o build\client
 </pre>
 <p>Else, simply type "ant generate.client".</p>
 <p>Next take a look at

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java Mon Sep 17 04:39:52 2007
@@ -53,10 +53,15 @@
 
     public void migratePropertiesToMessageContext(Map<String, Object> userContext,
                                                   MessageContext messageContext) {
-        
+
         // Avoid using putAll as this causes copies of the propery set
         if (userContext != null) {
-            for (String key: userContext.keySet()) {
+            // should not use iterator here because this map may be modified
+            // on different threads by the user or other JAX-WS code
+            String[] keys = new String[userContext.keySet().size()];
+            keys = userContext.keySet().toArray(keys);
+            for(int i=0; i < keys.length; i++) {
+                String key = keys[i];
                 Object value = userContext.get(key);
                 // Make sure mtom state in the user context, the message context, 
                 // the MEP context are the same.

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java Mon Sep 17 04:39:52 2007
@@ -63,14 +63,12 @@
     private EndpointDescription endpointDescription;
     private Map<String, Object> responseContext;
 
-    /* 
-     * CountDownLatch is used to track whether we've received and
-     * processed the async response.  For example, the client app
-     * could be polling on 30 second intervals, and we don't receive
-     * the async response until the 1:15 mark.  In that case, the
-     * first few polls calling the .get() would hit the latch.await()
-     * which blocks the thread if the latch count > 0
-     */
+    // CountDownLatch is used to track whether we've received and
+    // processed the async response.  For example, the client app
+    // could be polling on 30 second intervals, and we don't receive
+    // the async response until the 1:15 mark.  In that case, the
+    // first few polls calling the .get() would hit the latch.await()
+    // which blocks the thread if the latch count > 0
     private CountDownLatch latch;
     private boolean cacheValid = false;
     private Object cachedObject = null;
@@ -80,9 +78,11 @@
     // This object is just a cache object.
     private ClassLoader classLoader = null;
     
-    // the object to be returned
-    private Object obj = null;
-    // we need to save an exception if processResponse fails
+    // The response business object to be returned
+    private Object responseObject = null;
+    
+    // The exception to be returned in the event of a fault or failure in 
+    // processing the response content.
     private ExecutionException savedException = null;
     
     protected AsyncResponse(EndpointDescription ed) {
@@ -103,7 +103,7 @@
     
     protected void onError(Throwable flt, MessageContext faultCtx) {
         if (log.isDebugEnabled()) {
-            log.debug("AsyncResponse received a fault.  Counting down latch.");
+            log.debug("AsyncResponse received a fault.");
         }
 
         fault = flt;
@@ -116,12 +116,15 @@
 
         Throwable t = processFaultResponse();
         
+        // JAXWS 4.3.3 conformance bullet says to throw an ExecutionException from here
+        savedException = new ExecutionException(t);
+         
+        // Countdown so that the Future object will know that procesing is complete.
+        latch.countDown();
+        
         if (log.isDebugEnabled()) {
             log.debug("New latch count = [" + latch.getCount() + "]");
         }
-        
-        // JAXWS 4.3.3 conformance bullet says to throw an ExecutionException from here
-        savedException = new ExecutionException(t);
     }
     
     private void setThreadClassLoader(final ClassLoader cl) {
@@ -160,7 +163,7 @@
 
     protected void onComplete(MessageContext mc) {
         if (log.isDebugEnabled()) {
-            log.debug("AsyncResponse received a MessageContext. Counting down latch.");
+            log.debug("AsyncResponse received a MessageContext.");
         }
 
         // A new message context invalidates the cached object retrieved
@@ -174,26 +177,25 @@
         response.setEndpointDescription(endpointDescription);
         
         // Check for cached attachment file(s) if attachments exist. 
-        if(response.getAxisMessageContext().getAttachmentMap() != null){
-        	AttachmentUtils.findCachedAttachment(response.getAxisMessageContext().getAttachmentMap());
+        if (response.getAxisMessageContext().getAttachmentMap() != null){
+            AttachmentUtils.findCachedAttachment(response.getAxisMessageContext().getAttachmentMap());
         }
         
-        /*
-         * TODO: review?
-         * We need to process the response right when we get it, instead of
-         * caching it away for processing when the client poller calls .get().
-         * Reason for this is that some platforms (or web containers) will close
-         * down their threads immediately after "dropping off" the async response.
-         * If those threads disappear, the underlying input stream object may also
-         * disappear, thus causing a NullPointerException later when we try to .get().
-         * The NPE would manifest itself way down in the parser.
-         */
+        // Process the response as soon as it is available.  This means making sure that
+        // no content is left unread in the response stream.  Leaving content there could
+        // result in an error if the runtime is greedy about cleaning up.
         try {
-            obj = processResponse();
+            responseObject = processResponse();
         } catch (ExecutionException e) {
             savedException = e;
+            if (log.isDebugEnabled()) {
+                log.debug("An error occurred while processing the response: " + e.getCause());
+            }
+            latch.countDown();
         }
 
+        // Countdown so that the Future object will know that procesing is complete.
+        latch.countDown();
         if (log.isDebugEnabled()) {
             log.debug("New latch count = [" + latch.getCount() + "]");
         }
@@ -236,7 +238,7 @@
             throw savedException;
         }
         
-        return obj;
+        return responseObject;
     }
 
     public Object get(long timeout, TimeUnit unit)
@@ -266,7 +268,7 @@
                     "The client timed out while waiting for an asynchronous response");
         }
 
-        return obj;
+        return responseObject;
     }
 
     public boolean isCancelled() {
@@ -282,15 +284,10 @@
     }
 
     private Object processResponse() throws ExecutionException {
-        /*
-         * note the latch.countDown() here.  We have to make sure the countdown
-         * occurs everywhere we might leave the method, which could be a return
-         * or throw.
-         */
     	
         // If we don't have a fault, then we have to have a MessageContext for the response.
         if (response == null) {
-        	latch.countDown();
+            latch.countDown();
             throw new ExecutionException(ExceptionFactory.makeWebServiceException("null response"));
         }
 
@@ -300,15 +297,12 @@
             if (log.isDebugEnabled()) {
                 log.debug("Return object cached from last get()");
             }
-            latch.countDown();
             return cachedObject;
         }
 
         Object obj = null;
         try {
-            // TODO: IMPORTANT: this is the right call here, but beware that the messagecontext may be turned into
-            // a fault context with a fault message.  We need to check for this and, if necessary, make an exception and throw it.
-            // Invoke inbound handlers.
+            // Install the adapters and invoke inbound handlers.
             TransportHeadersAdapter.install(response);
             AttachmentsAdapter.install(response);
             HandlerInvokerUtils.invokeInboundHandlers(response.getMEPContext(),
@@ -316,20 +310,23 @@
                                                       HandlerChainProcessor.MEP.RESPONSE,
                                                       false);
 
-            // TODO: Check the type of the object to make sure it corresponds with
-            // the parameterized generic type.
+            // TODO: IMPORTANT: this is the right call here, but beware that the 
+            // messagecontext may be turned into a fault context with a fault message.  
+            // We need to check for this and, if necessary, make an exception and throw it.
             if (log.isDebugEnabled()) {
                 log.debug("Unmarshalling the async response message.");
             }
             
+            // Do the real work to unmarshall the response.
             obj = getResponseValueObject(response);
-            // Cache the object in case it is required again
-            cacheValid = true;
-            cachedObject = obj;
             
             if (log.isDebugEnabled() && obj != null) {
                 log.debug("Unmarshalled response object of type: " + obj.getClass());
             }
+            
+            // Cache the object in case it is required again
+            cacheValid = true;
+            cachedObject = obj;
 
             responseContext = new HashMap<String, Object>();
 
@@ -338,12 +335,7 @@
             ApplicationContextMigratorUtil.performMigrationFromMessageContext(Constants.APPLICATION_CONTEXT_MIGRATOR_LIST_ID,
                                                                               responseContext,
                                                                               response);
-            latch.countDown();
         } catch (Throwable t) {
-            if (log.isDebugEnabled()) {
-                log.debug("An error occurred while processing the response");
-            }
-            latch.countDown();
             throw new ExecutionException(ExceptionFactory.makeWebServiceException(t));
         }
 
@@ -363,26 +355,33 @@
                 // AttachmentsAdapter.install(faultMessageContext);
             	try {
                     // Invoke inbound handlers.
+            	    if (log.isDebugEnabled()) {
+            	        log.debug("Invoking the JAX-WS handler chain for the fault response.");
+            	    }
                     HandlerInvokerUtils.invokeInboundHandlers(faultMessageContext.getMEPContext(),
                                                           faultMessageContext.getInvocationContext()
                                                                              .getHandlers(),
                                                           HandlerChainProcessor.MEP.RESPONSE,
                                                           false);
             	} catch (Throwable t) {
-            		throwable = t;
+            	    if (log.isDebugEnabled()) {
+            	        log.debug("An error occurred (" + t.getClass() + " while processing " +
+            	        "the fault response handler chain.");
+            	    }
+            	    throwable = t;
             	}
             }
             if (throwable == null) {
+                // Do the real work to unmarshal the fault response.
                 throwable = getFaultResponse(faultMessageContext);
             }
-            latch.countDown();
+            
             if (throwable != null) {
                 return throwable;
             } else {
                 return ExceptionFactory.makeWebServiceException(fault);
             }
         } else {
-        	latch.countDown();
             return ExceptionFactory.makeWebServiceException(fault);
         }
     }

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/CallbackFuture.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/CallbackFuture.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/CallbackFuture.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/CallbackFuture.java Mon Sep 17 04:39:52 2007
@@ -190,7 +190,9 @@
                  */
                 try {
                     synchronized (cft) {
-                        cft.wait(180000);  // 3 minutes
+                        if(!cft.done) {
+                            cft.wait(180000);  // 3 minutes
+                        }
                     }
                 } catch (InterruptedException e) {
                     if (debug) {
@@ -261,13 +263,13 @@
             // Now that the content is available, call the JAX-WS AsyncHandler class
             // to deliver the response to the user.
             ClassLoader cl = handler.getClass().getClassLoader();
-        	if (log.isDebugEnabled()) {
-        		log.debug("Setting up the thread's ClassLoader");
-        		log.debug(cl.toString());
-        	}
-        	Thread.currentThread().setContextClassLoader(cl);
-        	
-        	if (debug) {
+            if (log.isDebugEnabled()) {
+                log.debug("Setting up the thread's ClassLoader");
+                log.debug(cl.toString());
+            }
+            Thread.currentThread().setContextClassLoader(cl);
+
+            if (debug) {
                 log.debug("Calling JAX-WS AsyncHandler with the Response object");
                 log.debug("AyncHandler class: " + handler.getClass());
             }

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/JAXBDispatch.java Mon Sep 17 04:39:52 2007
@@ -179,6 +179,8 @@
             }
         } catch (Exception e) {
             throw ExceptionFactory.makeWebServiceException(e);
+        } finally {
+            message.close();
         }
 
         return value;

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/dispatch/XMLDispatch.java Mon Sep 17 04:39:52 2007
@@ -25,6 +25,7 @@
 import org.apache.axis2.jaxws.message.Block;
 import org.apache.axis2.jaxws.message.Message;
 import org.apache.axis2.jaxws.message.Protocol;
+import org.apache.axis2.jaxws.message.XMLPart;
 import org.apache.axis2.jaxws.message.factory.BlockFactory;
 import org.apache.axis2.jaxws.message.factory.MessageFactory;
 import org.apache.axis2.jaxws.message.factory.SOAPEnvelopeBlockFactory;
@@ -198,6 +199,8 @@
                 log.debug("An error occured while creating the block");
             }
             throw ExceptionFactory.makeWebServiceException(e);
+        } finally {
+            message.close();
         }
 
         if (log.isDebugEnabled()) {

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java Mon Sep 17 04:39:52 2007
@@ -365,24 +365,29 @@
     protected Object createResponse(Method method, Object[] args, MessageContext responseContext,
                                     OperationDescription operationDesc) throws Throwable {
         Message responseMsg = responseContext.getMessage();
+        try {
 
-        if (log.isDebugEnabled()) {
-            log.debug("Processing the response Message to create the return value(s).");
-        }
+            if (log.isDebugEnabled()) {
+                log.debug("Processing the response Message to create the return value(s).");
+            }
 
-        // Find out if there was a fault on the response and create the appropriate 
-        // exception type.
-        if (hasFaultResponse(responseContext)) {
-            Throwable t = getFaultResponse(responseContext, operationDesc);
-            throw t;
-        }
+            // Find out if there was a fault on the response and create the appropriate 
+            // exception type.
+            if (hasFaultResponse(responseContext)) {
+                Throwable t = getFaultResponse(responseContext, operationDesc);
+                throw t;
+            }
 
-        Object object = MethodMarshallerFactory.getMarshaller(operationDesc, false)
-                .demarshalResponse(responseMsg, args, operationDesc);
-        if (log.isDebugEnabled()) {
-            log.debug("The response was processed and the return value created successfully.");
+            Object object =
+                    MethodMarshallerFactory.getMarshaller(operationDesc, true)
+                                       .demarshalResponse(responseMsg, args, operationDesc);
+            if (log.isDebugEnabled()) {
+                log.debug("The response was processed and the return value created successfully.");
+            }
+            return object;
+        } finally {
+            responseMsg.close();
         }
-        return object;
     }
 
     protected static Throwable getFaultResponse(MessageContext msgCtx,

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/InvocationContextFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/InvocationContextFactory.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/InvocationContextFactory.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/InvocationContextFactory.java Mon Sep 17 04:39:52 2007
@@ -18,6 +18,9 @@
  */
 package org.apache.axis2.jaxws.core;
 
+import org.apache.axis2.jaxws.server.EndpointInvocationContext;
+import org.apache.axis2.jaxws.server.EndpointInvocationContextImpl;
+
 import javax.xml.ws.Binding;
 
 /** The InvocationContextFactory is used to create instances of an InvocationContext. */
@@ -31,5 +34,15 @@
         }
 
         return ic;
+    }
+    
+    public static EndpointInvocationContext createEndpointInvocationContext(Binding binding) {
+        EndpointInvocationContext eic = new EndpointInvocationContextImpl();
+        
+        if (binding != null) {
+            eic.setHandlers(binding.getHandlerChain());
+        }
+        
+        return eic;
     }
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/controller/AxisInvocationController.java Mon Sep 17 04:39:52 2007
@@ -81,6 +81,8 @@
     * @see org.apache.axis2.jaxws.core.controller.InvocationController#invoke(org.apache.axis2.jaxws.core.InvocationContext)
     */
     public MessageContext doInvoke(MessageContext request) {
+        
+        
         // We need the qname of the operation being invoked to know which 
         // AxisOperation the OperationClient should be based on.
         // Note that the OperationDesc is only set through use of the Proxy. Dispatch
@@ -109,6 +111,9 @@
         try {
             execute(opClient, true, axisRequestMsgCtx);
         } catch (AxisFault af) {
+            // If an AxisFault was thrown, we need to cleanup the original OperationContext.
+            // Failure to do so results in a memory leak.
+            opClient.getOperationContext().cleanup();
             // save the fault in case it didn't come from the endpoint, and thus
             // there would be no message on the MessageContext
             faultexception = af;

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java Mon Sep 17 04:39:52 2007
@@ -639,18 +639,31 @@
             context.setIsxmlList(isList);
         }
         Block block = null;
+        boolean isBody = false;
         if (isHeader) {
             block = message.getHeaderBlock(headerNS, headerLocalPart, context, factory);
         } else {
             if (hasOutputBodyParams) {
                 block = message.getBodyBlock(0, context, factory);
+                isBody = true;
             } else {
                 // If there is only 1 block, we can use the get body block method
                 // that streams the whole block content.
                 block = message.getBodyBlock(context, factory);
+                //We look for body block only when the return type associated with operation is not void.
+                //If a null body block is returned in response on a operation that is not void, its a user error.               
+                isBody = true;
             }
         }
-
+        //We look for body block only when the return type associated with operation is not void.
+        //If a null body block is returned in response on a operation that has non void return type, its a user error.
+        if(isBody && block == null){
+           	if(log.isDebugEnabled()){
+           		log.debug("Empty Body Block Found in response Message for wsdl Operation defintion that expects an Output");
+           		log.debug("Return type associated with SEI operation is not void, Body Block cannot be null");
+           	}
+           	throw ExceptionFactory.makeWebServiceException(Messages.getMessage("MethodMarshallerUtilErr1"));	
+        }
         // Get the business object.  We want to return the object that represents the type.
         Element returnElement = new Element(block.getBusinessObject(true), block.getQName());
         return returnElement;

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/Protocol.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/Protocol.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/Protocol.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/Protocol.java Mon Sep 17 04:39:52 2007
@@ -24,6 +24,10 @@
 import javax.xml.ws.http.HTTPBinding;
 import javax.xml.ws.soap.SOAPBinding;
 
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
 /**
  * Protocol Each message has a protocol (soap11, soap12, rest) This enum represents the protocol
  * within the Message sub-component
@@ -33,11 +37,39 @@
 
     private static final Log log = LogFactory.getLog(Protocol.class);
 
+    private static Map<String, Protocol> protocolMappings; 
+    
     // These namespaces are used in the WSDL document to indentify a 
     // SOAP 1.1 vs. a SOAP 1.2 binding
     private static final String SOAP11_WSDL_BINDING = "http://schemas.xmlsoap.org/wsdl/soap";
     private static final String SOAP12_WSDL_BINDING = "http://schemas.xmlsoap.org/wsdl/soap12";
 
+    static {
+        // Normally a static HashMap can cause concurrency issues.
+        // However, if the HashMap is only queried (never modified) then 
+        // access by multiple theads is safe.
+        protocolMappings = new HashMap<String, Protocol>();
+        
+        protocolMappings.put(Protocol.SOAP11_WSDL_BINDING, Protocol.soap11);
+        protocolMappings.put(SOAPBinding.SOAP11HTTP_BINDING, Protocol.soap11);
+        protocolMappings.put(SOAPBinding.SOAP11HTTP_MTOM_BINDING, Protocol.soap11);
+        protocolMappings.put(Protocol.SOAP12_WSDL_BINDING, Protocol.soap12);
+        protocolMappings.put(SOAPBinding.SOAP12HTTP_BINDING, Protocol.soap12);
+        protocolMappings.put(SOAPBinding.SOAP12HTTP_MTOM_BINDING, Protocol.soap12);
+        protocolMappings.put(HTTPBinding.HTTP_BINDING, Protocol.rest);
+        
+        // Add each of the URLs with a "/" at the end for flexibility
+        Map<String, Protocol> updates = new HashMap<String, Protocol>();
+        Iterator<String> keys = protocolMappings.keySet().iterator();
+        while (keys.hasNext()) {
+            String key = keys.next();
+            if (!key.endsWith("/")) {
+                updates.put(key + "/", protocolMappings.get(key));    
+            }
+        }
+        protocolMappings.putAll(updates);
+    }
+    
     /**
      * Return the right value for the Protocol based on the binding URL that was passed in.
      *
@@ -50,44 +82,17 @@
             log.debug("Configuring message protocol for binding [" + url + "]");
         }
 
-        if (namespaceEquals(Protocol.SOAP11_WSDL_BINDING, url) ||
-                namespaceEquals(SOAPBinding.SOAP11HTTP_BINDING, url) ||
-                namespaceEquals(SOAPBinding.SOAP11HTTP_MTOM_BINDING, url)) {
-            if (debug) {
-                log.debug("SOAP 1.1 protocol configured for message");
-            }
-            return Protocol.soap11;
-        } else if (namespaceEquals(Protocol.SOAP12_WSDL_BINDING, url) ||
-                namespaceEquals(SOAPBinding.SOAP12HTTP_BINDING, url) ||
-                namespaceEquals(SOAPBinding.SOAP12HTTP_MTOM_BINDING, url)) {
-            if (debug) {
-                log.debug("SOAP 1.2 protocol configured for message");
+        Protocol proto = protocolMappings.get(url);
+        if (proto != null) {
+            if (log.isDebugEnabled()) {
+                log.debug("Found protocol mapping: " + proto);
             }
-            return Protocol.soap12;
-        } else if (namespaceEquals(HTTPBinding.HTTP_BINDING, url)) {
-            if (debug) {
-                log.debug("XML/HTTP protocol configured for message");
-            }
-            return Protocol.rest;
+            return proto;
         } else {
             if (debug) {
                 log.debug("Protocol was not found for:" + url);
             }
             return null;
         }
-    }
-
-    /*
-    * Check to see if the two strings (namespaces) passed in are the same, but
-    * also accounts for any trailing "/" characters in the string.
-    */
-    private static boolean namespaceEquals(String target, String input) {
-        if (target.equals(input)) {
-            return true;
-        } else if ((target + "/").equals(input)) {
-            return true;
-        }
-
-        return false;
     }
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java?rev=576381&r1=576380&r2=576381&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java Mon Sep 17 04:39:52 2007
@@ -317,4 +317,9 @@
      * @return String
      */
     public String getXMLPartContentType();
+
+    /**    
+     * Used primarily to ensure the parser is forwarded to the end so it can be closed.
+     */
+    public void close();
 }   



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