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/10/06 16:53:12 UTC

svn commit: r582501 [3/7] - in /webservices/axis2/branches/java/jaxws21/modules: 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-resources/tests...

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=582501&r1=582500&r2=582501&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 Sat Oct  6 07:53:06 2007
@@ -691,13 +691,20 @@
             XSLTUtils.addAttribute(model, "name", xmlName, property);
             XSLTUtils.addAttribute(model, "nsuri", name.getNamespaceURI(), property);
 
-            String javaName = makeUniqueJavaClassName(propertyNames, xmlName);
-            // in a restriction if this element already there and array status have changed
-            // then we have to generate a new  name for this
-            if (parentMetaInf != null && metainf.isRestriction() && !missingQNames.contains(name) &&
-                    (parentMetaInf.getArrayStatusForQName(name) && !metainf.getArrayStatusForQName(name))) {
+            String javaName;
+            if (metainf.isJavaNameMappingAvailable(xmlName)) {
+                javaName = metainf.getJavaName(xmlName);
+            } else {
                 javaName = makeUniqueJavaClassName(propertyNames, xmlName);
+                // in a restriction if this element already there and array status have changed
+                // then we have to generate a new  name for this
+                if (parentMetaInf != null && metainf.isRestriction() && !missingQNames.contains(name) &&
+                        (parentMetaInf.getArrayStatusForQName(name) && !metainf.getArrayStatusForQName(name))) {
+                    javaName = makeUniqueJavaClassName(propertyNames, xmlName);
+                }
+                metainf.addXmlNameJavaNameMapping(xmlName,javaName);
             }
+
             XSLTUtils.addAttribute(model, "javaname", javaName, property);
 
             if (parentMetaInf != null && metainf.isRestriction() && missingQNames.contains(name)) {

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/base64binary.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/base64binary.xsd?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/base64binary.xsd (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/base64binary.xsd Sat Oct  6 07:53:06 2007
@@ -45,4 +45,14 @@
         <xs:element name="TestHexBinary" type="xmime:hexBinary"></xs:element>
         <xs:element name="ByteArray" nillable="true" type="xs:base64Binary"/>
 
+        <xs:element name="TestBase64MultiElement">
+            <xs:complexType>
+                <xs:sequence>
+                    <xs:element name="param1" type="xs:base64Binary"/>
+                    <xs:element name="param2" type="xs:string"/>
+                    <xs:element name="param3" type="xs:int"/>
+                </xs:sequence>
+            </xs:complexType>
+        </xs:element>
+
 </xs:schema>

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/extensions.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/extensions.xsd?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/extensions.xsd (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/extensions.xsd Sat Oct  6 07:53:06 2007
@@ -29,13 +29,11 @@
             <xs:element name="last" type="xs:string"/>
         </xs:sequence>
     </xs:complexType>
-
     <xs:simpleType name="simpleType">
         <xs:restriction base="xs:string">
             <xs:pattern value="[A-Z]*"></xs:pattern>
         </xs:restriction>
     </xs:simpleType>
-
     <xs:simpleType name="baseType">
         <xs:restriction base="xs:string">
             <xs:enumeration value="s1"></xs:enumeration>
@@ -44,7 +42,6 @@
             <xs:enumeration value="s4"></xs:enumeration>
         </xs:restriction>
     </xs:simpleType>
-
     <xs:element name="fullName">
         <xs:complexType>
             <xs:simpleContent>
@@ -56,19 +53,36 @@
             </xs:simpleContent>
         </xs:complexType>
     </xs:element>
-
     <xs:complexType name="ExtendedComplexType">
         <xs:complexContent>
             <xs:extension base="tns:type">
-                  <xs:sequence>
-                      <xs:element name="parentElement1" type="xs:string"></xs:element>
-                      <xs:element name="parentElement2" type="xs:string"></xs:element>
-                  </xs:sequence>
+                <xs:sequence>
+                    <xs:element name="parentElement1" type="xs:string"></xs:element>
+                    <xs:element name="parentElement2" type="xs:string"></xs:element>
+                </xs:sequence>
             </xs:extension>
         </xs:complexContent>
     </xs:complexType>
-
     <xs:element name="TestComplexElement" type="tns:ExtendedComplexType">
-
     </xs:element>
+
+    <xs:complexType name="P2apiAgPatAppt">
+        <xs:complexContent>
+            <xs:extension base="tns:P2apiDataRptGrp">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="aG_MAX_APPT_DETL_ROW" type="xs:int"/>
+                    <xs:element minOccurs="0" name="apptLst" nillable="true" type="xs:anyType"/>
+                </xs:sequence>
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+    <xs:complexType name="P2apiDataRptGrp">
+        <xs:sequence>
+            <xs:element minOccurs="0" name="sORT_ASCENDING" type="xs:int"/>
+            <xs:element minOccurs="0" name="sORT_DESCENDING" type="xs:int"/>
+            <xs:element minOccurs="0" name="SORT_ASCENDING" type="xs:int"/>
+            <xs:element minOccurs="0" name="SORT_DESCENDING" type="xs:int"/>
+        </xs:sequence>
+    </xs:complexType>
+
 </schema>

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/testattribute.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/testattribute.xsd?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/testattribute.xsd (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/testattribute.xsd Sat Oct  6 07:53:06 2007
@@ -53,7 +53,7 @@
     </xs:element>
 
     <xs:element name="TestAttributeReferenceElement" type="tns:TestAttributeReferenceType"/>
-    <xs:attribute   name="TestAttribute1" type="xs:string"/>
+    <xs:attribute name="TestAttribute1" type="xs:string"/>
     <xs:complexType name="TestAttributeReferenceType">
         <xs:sequence>
             <xs:element name="param1" type="xs:string"/>
@@ -61,5 +61,19 @@
         </xs:sequence>
         <xs:attribute use="optional" ref="tns:TestAttribute1"/>
     </xs:complexType>
+
+    <xs:attribute name="Type">
+        <xs:simpleType>
+            <xs:restriction base="xs:string">
+                <xs:pattern value="String|Base64"/>
+            </xs:restriction>
+        </xs:simpleType>
+    </xs:attribute>
+
+    <xs:element name="TestTypeElement">
+        <xs:complexType>
+            <xs:attribute ref="tns:Type"/>
+        </xs:complexType>
+    </xs:element>
 
 </xs:schema>

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/base64binary/Base64BinaryTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/base64binary/Base64BinaryTest.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/base64binary/Base64BinaryTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/base64binary/Base64BinaryTest.java Sat Oct  6 07:53:06 2007
@@ -25,6 +25,7 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axis2.databinding.types.*;
+import org.apache.axis2.databinding.ADBException;
 
 import javax.activation.DataHandler;
 import javax.xml.stream.XMLStreamException;
@@ -98,6 +99,36 @@
             TestHexBinary result = TestHexBinary.Factory.parse(xmlReader);
             assertEquals(result.getTestHexBinary().getHexBinary().toString(),testString);
             assertEquals(result.getTestHexBinary().getContentType().getContentType_type0(),"test content type");
+        } catch (XMLStreamException e) {
+            fail();
+        } catch (Exception e) {
+            fail();
+        }
+    }
+
+    public void testBase64MultiElement(){
+
+        TestBase64MultiElement testBase64MultiElement = new TestBase64MultiElement();
+        String testString = "testing base 64 elements";
+        DataHandler dataHandler = new DataHandler(new ByteArrayDataSource(testString.getBytes()));
+        testBase64MultiElement.setParam1(dataHandler);
+        testBase64MultiElement.setParam2("test string");
+        testBase64MultiElement.setParam3(5);
+
+        try {
+            OMElement omElement = testBase64MultiElement.getOMElement(TestBase64MultiElement.MY_QNAME,
+                    OMAbstractFactory.getOMFactory());
+            String omElementString = omElement.toStringWithConsume();
+            System.out.println("OM Element ==> " + omElementString);
+            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
+            TestBase64MultiElement result = TestBase64MultiElement.Factory.parse(xmlReader);
+            DataHandler resultDataHandler = result.getParam1();
+            byte[] buffer = new byte[128];
+            int length = resultDataHandler.getInputStream().read(buffer);
+            String resultString = new String(buffer,0,length);
+            assertEquals(testString,resultString);
+        } catch (ADBException e) {
+            fail();
         } catch (XMLStreamException e) {
             fail();
         } catch (Exception e) {

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDatePopulateTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDatePopulateTest.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDatePopulateTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/populate/simple/SimpleTypeDatePopulateTest.java Sat Oct  6 07:53:06 2007
@@ -31,9 +31,12 @@
                 "2002-02-28Z"
     } ;
     private String xmlString[] = {
-            "<dateParam xmlns=\"http://soapinterop.org/xsd\">"+values[0]+"</dateParam>",
-            "<dateParam xmlns=\"http://soapinterop.org/xsd\">"+values[1]+"</dateParam>",
-            "<dateParam xmlns=\"http://soapinterop.org/xsd\">"+values[2]+"</dateParam>"
+            "<dateParam xmlns=\"http://soapinterop.org/xsd\">"+
+                    ConverterUtil.convertToString(ConverterUtil.convertToDate(values[0])) +"</dateParam>",
+            "<dateParam xmlns=\"http://soapinterop.org/xsd\">"+
+                    ConverterUtil.convertToString(ConverterUtil.convertToDate(values[1]))+"</dateParam>",
+            "<dateParam xmlns=\"http://soapinterop.org/xsd\">"+
+                    ConverterUtil.convertToString(ConverterUtil.convertToDate(values[2]))+"</dateParam>"
     };
 
     protected void setUp() throws Exception {
@@ -44,8 +47,7 @@
     // force others to implement this method
     public void testPopulate() throws Exception {
 
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'Z'");
-        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-ddZ");
         Date date = null;
 
         for (int i = 0; i < values.length; i++) {

Modified: webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java Sat Oct  6 07:53:06 2007
@@ -96,8 +96,7 @@
     public static String convertToString(Date value) {
         // lexical form of the date is '-'? yyyy '-' mm '-' dd zzzzzz?
         // we have to serialize it with the GMT timezone
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'Z'");
-        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-ddZ");
         return simpleDateFormat.format(value);
     }
 

Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java Sat Oct  6 07:53:06 2007
@@ -19,6 +19,11 @@
 
 package org.apache.axis2.handlers.addressing;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.SOAPHeader;
@@ -32,6 +37,7 @@
 import org.apache.axis2.client.Options;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.handlers.AbstractHandler;
 import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.util.LoggingControl;
@@ -39,17 +45,25 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.Iterator;
-
 public abstract class AddressingInHandler extends AbstractHandler implements AddressingConstants {
 
     protected String addressingNamespace = Final.WSA_NAMESPACE;  // defaulting to final version
     protected String addressingVersion = null;
+    
+	public static final String DISABLE_REF_PARAMETER_EXTRACT = "disableRefParamExtract";
+    
     private static final Log log = LogFactory.getLog(AddressingInHandler.class);
 
-
+    private boolean disableRefparamExtract = false;
+    	  	 
+    public void init(HandlerDescription handlerdesc) {
+    	super.init(handlerdesc);
+    	disableRefparamExtract = JavaUtils.isTrueExplicitly(Utils.getParameterValue(handlerdesc.getParameter(DISABLE_REF_PARAMETER_EXTRACT)));
+    	if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
+    		log.debug("AddressingInHandler.init disableRefparamExtract="+disableRefparamExtract);
+    	}
+    }
+    
     public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
     	//Determine if we want to ignore addressing headers.
     	Parameter disableParam = msgContext.getParameter(DISABLE_ADDRESSING_HANDLERS);
@@ -149,22 +163,23 @@
             SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock)addressingHeadersIt.next();
             // TODO - Don't do role processing here!
             if (!SOAP12Constants.SOAP_ROLE_NONE.equals(soapHeaderBlock.getRole())) {
-                if (WSA_ACTION.equals(soapHeaderBlock.getLocalName())) {
+            	String localName = soapHeaderBlock.getLocalName();
+            	if (WSA_ACTION.equals(localName)) {
                     ignoreAction = checkDuplicateHeaders(WSA_ACTION, checkedHeaderNames,
                                                          duplicateHeaderNames);
-                } else if (WSA_TO.equals(soapHeaderBlock.getLocalName())) {
+                } else if (WSA_TO.equals(localName)) {
                     ignoreTo =
                             checkDuplicateHeaders(WSA_TO, checkedHeaderNames, duplicateHeaderNames);
-                } else if (WSA_MESSAGE_ID.equals(soapHeaderBlock.getLocalName())) {
+                } else if (WSA_MESSAGE_ID.equals(localName)) {
                     ignoreMessageID = checkDuplicateHeaders(WSA_MESSAGE_ID, checkedHeaderNames,
                                                             duplicateHeaderNames);
-                } else if (WSA_REPLY_TO.equals(soapHeaderBlock.getLocalName())) {
+                } else if (WSA_REPLY_TO.equals(localName)) {
                     ignoreReplyTo = checkDuplicateHeaders(WSA_REPLY_TO, checkedHeaderNames,
                                                           duplicateHeaderNames);
-                } else if (WSA_FAULT_TO.equals(soapHeaderBlock.getLocalName())) {
+                } else if (WSA_FAULT_TO.equals(localName)) {
                     ignoreFaultTo = checkDuplicateHeaders(WSA_FAULT_TO, checkedHeaderNames,
                                                           duplicateHeaderNames);
-                } else if (WSA_FROM.equals(soapHeaderBlock.getLocalName())) {
+                } else if (WSA_FROM.equals(localName)) {
                     ignoreFrom = checkDuplicateHeaders(WSA_FROM, checkedHeaderNames,
                                                        duplicateHeaderNames);
                 }
@@ -176,21 +191,22 @@
         while (addressingHeadersIt2.hasNext()) {
             SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock)addressingHeadersIt2.next();
             if (!SOAP12Constants.SOAP_ROLE_NONE.equals(soapHeaderBlock.getRole())) {
-                if (WSA_ACTION.equals(soapHeaderBlock.getLocalName()) && !ignoreAction) {
+            	String localName = soapHeaderBlock.getLocalName();
+                if (WSA_ACTION.equals(localName) && !ignoreAction) {
                     extractActionInformation(soapHeaderBlock, messageContext);
-                } else if (WSA_TO.equals(soapHeaderBlock.getLocalName()) && !ignoreTo) {
+                } else if (WSA_TO.equals(localName) && !ignoreTo) {
                     extractToEPRInformation(soapHeaderBlock, messageContextOptions, header,
                                             namespace);
                 } else
-                if (WSA_MESSAGE_ID.equals(soapHeaderBlock.getLocalName()) && !ignoreMessageID) {
+                if (WSA_MESSAGE_ID.equals(localName) && !ignoreMessageID) {
                     extractMessageIDInformation(soapHeaderBlock, messageContext);
-                } else if (WSA_REPLY_TO.equals(soapHeaderBlock.getLocalName()) && !ignoreReplyTo) {
+                } else if (WSA_REPLY_TO.equals(localName) && !ignoreReplyTo) {
                     extractReplyToEPRInformation(soapHeaderBlock, namespace, messageContext);
-                } else if (WSA_FAULT_TO.equals(soapHeaderBlock.getLocalName()) && !ignoreFaultTo) {
+                } else if (WSA_FAULT_TO.equals(localName) && !ignoreFaultTo) {
                     extractFaultToEPRInformation(soapHeaderBlock, namespace, messageContext);
-                } else if (WSA_RELATES_TO.equals(soapHeaderBlock.getLocalName())) {
+                } else if (WSA_RELATES_TO.equals(localName)) {
                     extractRelatesToInformation(soapHeaderBlock, messageContextOptions);
-                } else if (WSA_FROM.equals(soapHeaderBlock.getLocalName()) && !ignoreFrom) {
+                } else if (WSA_FROM.equals(localName) && !ignoreFrom) {
                     extractFromEPRInformation(soapHeaderBlock, namespace, messageContext);
                 }
             }
@@ -344,7 +360,9 @@
         }
 
         // check for reference parameters
-        extractToEprReferenceParameters(epr, header, namespace);
+        if(!disableRefparamExtract){
+        	extractToEprReferenceParameters(epr, header, namespace);
+        }
         soapHeaderBlock.setProcessed();
 
         if (log.isTraceEnabled()) {

Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java Sat Oct  6 07:53:06 2007
@@ -113,6 +113,8 @@
         private boolean replaceHeaders;  // determines whether we replace the existing headers or not, if they present
         private boolean includeOptionalHeaders;
 
+        private ArrayList existingWSAHeaders = null;
+        
         public WSAHeaderWriter(MessageContext mc, boolean isSubmissionNamespace, boolean addMU,
                                boolean replace, boolean includeOptional) {
             if (log.isDebugEnabled()) {
@@ -138,6 +140,20 @@
             addressingNamespaceObject =
                     factory.createOMNamespace(addressingNamespace, WSA_DEFAULT_PREFIX);
 
+            // if there is no soap header in the envelope being processed, add one.
+            if (header == null) {
+            	header = factory.createSOAPHeader(envelope);
+            }else{
+            	ArrayList addressingHeaders = header.getHeaderBlocksWithNSURI(addressingNamespace);
+            	if(addressingHeaders!=null && !addressingHeaders.isEmpty()){
+            		existingWSAHeaders = new ArrayList();
+            		for(Iterator iter=addressingHeaders.iterator();iter.hasNext();){
+            			OMElement oe = (OMElement)iter.next();
+            			existingWSAHeaders.add(oe.getLocalName());
+            		}
+            	}
+            }
+            
             isFinalAddressingNamespace = !isSubmissionNamespace;
             addMustUnderstandAttribute = addMU;
             replaceHeaders = replace;
@@ -475,8 +491,7 @@
          *         true - if new headers can't be added.
          */
         private boolean isAddressingHeaderAlreadyAvailable(String name, boolean multipleHeaders) {
-            QName qname = new QName(addressingNamespaceObject.getNamespaceURI(), name,
-                                    addressingNamespaceObject.getPrefix());
+        	QName qname = new QName(addressingNamespace, name, WSA_DEFAULT_PREFIX);
             boolean status = false;
 
             if (multipleHeaders) {
@@ -488,16 +503,17 @@
                     }
                 }
             } else {
-                OMElement addressingHeader = header.getFirstChildWithName(qname);
-
-                if (addressingHeader != null && replaceHeaders) {
+            	 boolean exists = didAddressingHeaderExist(name);
+            	  	  	 
+            	 if (exists && replaceHeaders) {
+            	 	  	                         OMElement addressingHeader = header.getFirstChildWithName(qname);
                     if (log.isTraceEnabled()) {
                         log.trace("isAddressingHeaderAlreadyAvailable: Removing existing header:" +
                                 addressingHeader.getLocalName());
                     }
                     addressingHeader.detach();
                 } else {
-                    status = addressingHeader != null;
+                    status = exists;
                 }
             }
 
@@ -505,6 +521,20 @@
                 log.trace("isAddressingHeaderAlreadyAvailable: name=" + name + " status=" + status);
             }
             return status;
+        }
+        
+        private boolean didAddressingHeaderExist(String headerName){
+        	if (log.isTraceEnabled()) {
+        		log.trace("didAddressingHeaderExist: headerName=" + headerName);
+        	}
+        	boolean result = false;
+        	if(existingWSAHeaders != null){
+        		result = existingWSAHeaders.contains(headerName);
+        		if (log.isTraceEnabled()) {
+        			log.trace("didAddressingHeaderExist: existingWSAHeaders=" + existingWSAHeaders+" result="+result);
+        		}
+        	}
+        	return result;
         }
 
         /**

Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingValidationHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingValidationHandler.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingValidationHandler.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingValidationHandler.java Sat Oct  6 07:53:06 2007
@@ -55,15 +55,15 @@
                 // Check if the wsa:MessageID is required or not.
                 checkMessageIDHeader(msgContext);
             }
-
-            // Check that if anonymous flag is in effect that the replyto and faultto are valid
-            //checkAnonymous(msgContext);
         }
 
         if (JavaUtils.isFalseExplicitly(flag)) {
             // Check that if wsaddressing=required that addressing headers were found inbound
             checkUsingAddressing(msgContext);
         }
+        
+        // Check that if wsamInvocationPattern flag is in effect that the replyto and faultto are valid
+        checkWSAMInvocationPattern(msgContext);
 
         return InvocationResponse.CONTINUE;
     }
@@ -95,38 +95,40 @@
      * Check that if a wsaw:Anonymous value was set on the AxisOperation that the values in the
      * ReplyTo+FaultTo are valid and fault if not.
      */
-    private void checkAnonymous(MessageContext msgContext) throws AxisFault {
-        String anonymous =
-                AddressingHelper.getAnonymousParameterValue(msgContext.getAxisOperation());
+    private void checkWSAMInvocationPattern(MessageContext msgContext) throws AxisFault {
+        String value =
+                AddressingHelper.getInvocationPatternParameterValue(msgContext.getAxisOperation());
         if (log.isTraceEnabled()) {
-            log.trace("checkAnonymous: Anonymous=" + anonymous);
+            log.trace("checkAnonymous: value=" + value);
         }
-        if ("required".equals(anonymous)) {
-            if (AddressingHelper.isReplyRedirected(msgContext)) {
-                EndpointReference anonEPR =
-                        new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL);
-                msgContext.setReplyTo(anonEPR);
-                msgContext.setFaultTo(anonEPR);
-                AddressingFaultsHelper.triggerOnlyAnonymousAddressSupportedFault(msgContext,
-                                                                                 AddressingConstants.WSA_REPLY_TO);
-            }
-            if (AddressingHelper.isFaultRedirected(msgContext)) {
-                EndpointReference anonEPR =
-                        new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL);
-                msgContext.setReplyTo(anonEPR);
-                msgContext.setFaultTo(anonEPR);
-                AddressingFaultsHelper.triggerOnlyAnonymousAddressSupportedFault(msgContext,
-                                                                                 AddressingConstants.WSA_FAULT_TO);
-            }
-        } else if ("prohibited".equals(anonymous)) {
-            if (!AddressingHelper.isReplyRedirected(msgContext)) {
-                AddressingFaultsHelper.triggerOnlyNonAnonymousAddressSupportedFault(msgContext,
-                                                                                    AddressingConstants.WSA_REPLY_TO);
-            }
-            if (!AddressingHelper.isFaultRedirected(msgContext)) {
-                AddressingFaultsHelper.triggerOnlyNonAnonymousAddressSupportedFault(msgContext,
-                                                                                    AddressingConstants.WSA_FAULT_TO);
-            }
+        if(!AddressingConstants.WSAM_INVOCATION_PATTERN_BOTH.equals(value)){
+        	if (WSAM_INVOCATION_PATTERN_SYNCHRONOUS.equals(value)) {
+        		if (AddressingHelper.isReplyRedirected(msgContext)) {
+        			EndpointReference anonEPR =
+        				new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL);
+        			msgContext.setReplyTo(anonEPR);
+        			msgContext.setFaultTo(anonEPR);
+        			AddressingFaultsHelper.triggerOnlyAnonymousAddressSupportedFault(msgContext,
+        					AddressingConstants.WSA_REPLY_TO);
+        		}
+        		if (AddressingHelper.isFaultRedirected(msgContext)) {
+        			EndpointReference anonEPR =
+        				new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL);
+        			msgContext.setReplyTo(anonEPR);
+        			msgContext.setFaultTo(anonEPR);
+        			AddressingFaultsHelper.triggerOnlyAnonymousAddressSupportedFault(msgContext,
+        					AddressingConstants.WSA_FAULT_TO);
+        		}
+        	} else if (WSAM_INVOCATION_PATTERN_ASYNCHRONOUS.equals(value)) {
+        		if (!AddressingHelper.isReplyRedirected(msgContext)) {
+        			AddressingFaultsHelper.triggerOnlyNonAnonymousAddressSupportedFault(msgContext,
+        					AddressingConstants.WSA_REPLY_TO);
+        		}
+        		if (!AddressingHelper.isFaultRedirected(msgContext)) {
+        			AddressingFaultsHelper.triggerOnlyNonAnonymousAddressSupportedFault(msgContext,
+        					AddressingConstants.WSA_FAULT_TO);
+        		}
+        	}
         }
     }
 

Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java Sat Oct  6 07:53:06 2007
@@ -40,7 +40,7 @@
 
         System.out.println(CodegenMessages.getMessage("wsdl2code.arg"));
         System.out.println(CodegenMessages.getMessage("wsdl2code.arg1"));
-        for (int i = 2; i <= 36; i++) {
+        for (int i = 2; i <= 37; i++) {
             System.out.println("  " + CodegenMessages.getMessage("wsdl2code.arg" + i));
         }
         System.exit(0);

Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Sat Oct  6 07:53:06 2007
@@ -2164,6 +2164,13 @@
         addAttribute(doc, "style", (String) getBindingPropertyFromOperation(
                 WSDLConstants.WSDL_1_1_STYLE, axisOperation.getName()), methodElement);
 
+        // add documentation for this operation
+        String comment = "";
+        if (axisOperation.getDocumentation() != null){
+            comment = axisOperation.getDocumentation().trim();
+        }
+        addAttribute(doc, "comment", comment, methodElement);
+
         String messageExchangePattern = axisOperation.getMessageExchangePattern();
         
         //Jaxws Specific
@@ -2787,6 +2794,11 @@
                 }
 
                 //as for the name of a fault, we generate an exception
+                String faultComment = "";
+                if (msg.getDocumentation() != null){
+                    faultComment = msg.getDocumentation().trim();
+                }
+                addAttribute(doc, "comment", faultComment, paramElement);
                 addAttribute(doc, "name",
                         (String) fullyQualifiedFaultClassNameMap.get(msg.getName()),
                         paramElement);

Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties Sat Oct  6 07:53:06 2007
@@ -65,11 +65,12 @@
 wsdl2code.arg29=  -E<key> <value>          Extra configuration options specific to certain databindings. Examples:
 wsdl2code.arg30=                           \t\t\t   -Ebindingfile <path>                   (for jibx) - specify the file path for the binding file
 wsdl2code.arg31=                           \t\t\t   -Etypesystemname <my_type_system_name> (for xmlbeans) - override the randomly generated type system name
-wsdl2code.arg32=                           \t\t\t   -Emp <package name> (for ADB) - extension mapper package name
-wsdl2code.arg33=                           \t\t\t   -Eosv (for ADB) - off strict validation.
-wsdl2code.arg34=  --noBuildXML             Don't generate the build.xml in the output directory
-wsdl2code.arg35=  --noWSDL                 Don't generate WSDL's in the resources directory
-wsdl2code.arg36=  --noMessageReceiver      Don't generate a MessageReceiver in the generated sources
+wsdl2code.arg32=                           \t\t\t   -Ejavaversion 1.5                      (for xmlbeans) - generates Java 1.5 code (typed lists instead of arrays) 
+wsdl2code.arg33=                           \t\t\t   -Emp <package name> (for ADB) - extension mapper package name
+wsdl2code.arg34=                           \t\t\t   -Eosv (for ADB) - turn off strict validation.
+wsdl2code.arg35=  --noBuildXML             Don't generate the build.xml in the output directory
+wsdl2code.arg36=  --noWSDL                 Don't generate WSDL's in the resources directory
+wsdl2code.arg37=  --noMessageReceiver      Don't generate a MessageReceiver in the generated sources
 
 ################## prop file loader #################################
 propfileload.frameworkMismatch=Number of frameworks and extension names do not match!

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=582501&r1=582500&r2=582501&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 Sat Oct  6 07:53:06 2007
@@ -191,7 +191,7 @@
                     }
                     ret_node = <xsl:choose>
                                    <xsl:when test="@ours">
-                               adb_<xsl:value-of select="$outputtype"/>_serialize(ret_val<xsl:value-of select="$position"/>, env, NULL, AXIS2_FALSE);
+                               adb_<xsl:value-of select="$outputtype"/>_serialize(ret_val<xsl:value-of select="$position"/>, env, NULL, AXIS2_FALSE, AXIS2_TRUE);
                                adb_<xsl:value-of select="$outputtype"/>_free(ret_val<xsl:value-of select="$position"/>, env);
                                adb_<xsl:value-of select="@type"/>_free(input_val<xsl:value-of select="$position"/>_<xsl:value-of select="position()"/>, env);
                                    </xsl:when>

Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl Sat Oct  6 07:53:06 2007
@@ -191,7 +191,7 @@
                 <xsl:if test="position()=1">
                     <xsl:choose>
                         <xsl:when test="@ours">
-                            payload = adb_<xsl:value-of select="@type"/>_serialize(<xsl:value-of select="@name"/>, env, NULL, AXIS2_FALSE);
+                            payload = adb_<xsl:value-of select="@type"/>_serialize(<xsl:value-of select="@name"/>, env, NULL, AXIS2_FALSE, AXIS2_TRUE);
                         </xsl:when>
                         <xsl:otherwise>
                             payload = <xsl:value-of select="@name"/>;
@@ -292,7 +292,7 @@
                 <xsl:if test="position()=1">
                     <xsl:choose>
                         <xsl:when test="@ours">
-                            payload = adb_<xsl:value-of select="@type"/>_serialize(<xsl:value-of select="@name"/>, env, NULL, AXIS2_FALSE);
+                            payload = adb_<xsl:value-of select="@type"/>_serialize(<xsl:value-of select="@name"/>, env, NULL, AXIS2_FALSE, AXIS2_TRUE);
                         </xsl:when>
                         <xsl:otherwise>
                             payload = <xsl:value-of select="@name"/>;
@@ -375,7 +375,7 @@
                 <xsl:if test="position()=1">
                     <xsl:choose>
                         <xsl:when test="@ours">
-                            payload = adb_<xsl:value-of select="@type"/>_serialize(<xsl:value-of select="@name"/>, env, NULL, AXIS2_FALSE);
+                            payload = adb_<xsl:value-of select="@type"/>_serialize(<xsl:value-of select="@name"/>, env, NULL, AXIS2_FALSE, AXIS2_TRUE);
                         </xsl:when>
                         <xsl:otherwise>
                             payload = <xsl:value-of select="@name"/>;

Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl Sat Oct  6 07:53:06 2007
@@ -231,10 +231,14 @@
                 <xsl:if test="$isSync='1'">
                     /**
                      * Auto generated method signature
+                     * <xsl:value-of select="@comment"/>
                      * @see <xsl:value-of select="$package"/>.<xsl:value-of select="$interfaceName"/>#<xsl:value-of select="@name"/>
                     <xsl:for-each select="input/param[@type!='']">
                      * @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
                     </xsl:text></xsl:for-each>
+                    <xsl:for-each select="fault/param[@type!='']">
+                     * @throws <xsl:value-of select="@name"/> : <xsl:value-of select="@comment"/>
+                    </xsl:for-each>
                      */
 
                     <xsl:choose>
@@ -568,6 +572,7 @@
             <xsl:if test="$isAsync='1'">
                 /**
                 * Auto generated method signature for Asynchronous Invocations
+                * <xsl:value-of select="@comment"/>
                 * @see <xsl:value-of select="$package"/>.<xsl:value-of select="$interfaceName"/>#start<xsl:value-of select="@name"/>
                 <xsl:for-each select="input/param[@type!='']">
                     * @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
@@ -873,6 +878,15 @@
             <!-- Start of in only mep-->
             <xsl:if test="$mep='10' or $mep='11'"> <!-- These constants can be found in org.apache.axis2.wsdl.WSDLConstants -->
                 <!-- for the in only mep there is no notion of sync or async. And there is no return type also -->
+                /**
+                  * Auto generated method signature
+                  * <xsl:value-of select="@comment"/>
+                 <xsl:if test="$mep='11'">
+                   <xsl:for-each select="fault/param[@type!='']">
+                     * @throws <xsl:value-of select="@name"/> : <xsl:value-of select="@comment"/>
+                    </xsl:for-each>
+                  </xsl:if>
+                  */
                 public void <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
                  <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
                     <xsl:choose>

Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl Sat Oct  6 07:53:06 2007
@@ -60,10 +60,14 @@
          <xsl:if test="$isSync='1'">
 
         /**
-                * Auto generated method signature
+          * Auto generated method signature
+          * <xsl:value-of select="@comment"/>
                 <xsl:for-each select="input/param[@type!='']">
                     * @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
                 </xsl:text></xsl:for-each>
+             <xsl:for-each select="fault/param[@type!='']">
+             * @throws <xsl:value-of select="@name"/> : <xsl:value-of select="@comment"/>
+             </xsl:for-each>
          */
 
          <xsl:choose>
@@ -144,6 +148,7 @@
         <xsl:if test="$isAsync='1'">
          /**
             * Auto generated method signature for Asynchronous Invocations
+            * <xsl:value-of select="@comment"/>
             <xsl:for-each select="input/param[@type!='']">
                 * @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
             </xsl:text></xsl:for-each>
@@ -183,7 +188,15 @@
         <!-- Code for in-only mep -->
        <xsl:if test="@mep='10' or @mep='11'">
        <xsl:variable name="mep"><xsl:value-of select="@mep"/></xsl:variable>
-
+       /**
+         * Auto generated method signature for Asynchronous Invocations
+         * <xsl:value-of select="@comment"/>
+           <xsl:if test="$mep='11'">
+               <xsl:for-each select="fault/param[@type!='']">
+                 * @throws <xsl:value-of select="@name"/> : <xsl:value-of select="@comment"/>
+               </xsl:for-each>
+           </xsl:if>
+         */
         public void <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
          <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
          <xsl:choose>

Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl Sat Oct  6 07:53:06 2007
@@ -40,6 +40,8 @@
                java method -->
         /**
          * Auto generated method signature
+         * <xsl:value-of select="@comment"/>
+         
          <xsl:choose>
             <xsl:when test="$isbackcompatible = 'true'">
                 <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
@@ -79,6 +81,9 @@
                     </xsl:choose>
             </xsl:otherwise>
         </xsl:choose>
+         <xsl:for-each select="fault/param[@type!='']">
+             * @throws <xsl:value-of select="@name"/> : <xsl:value-of select="@comment"/>
+         </xsl:for-each>
          */
 
         <xsl:choose>

Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl Sat Oct  6 07:53:06 2007
@@ -41,6 +41,7 @@
                java method -->
         /**
          * Auto generated method signature
+         * <xsl:value-of select="@comment"/>
          <!--  select only the body parameters  -->
          <xsl:choose>
             <xsl:when test="$isbackcompatible = 'true'">
@@ -82,6 +83,9 @@
                     </xsl:choose>
             </xsl:otherwise>
         </xsl:choose>
+         <xsl:for-each select="fault/param[@type!='']">
+             * @throws <xsl:value-of select="@name"/> : <xsl:value-of select="@comment"/>
+         </xsl:for-each>
          */
         <xsl:choose>
             <xsl:when test="$isbackcompatible = 'true'">

Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl Sat Oct  6 07:53:06 2007
@@ -171,7 +171,8 @@
                                      <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@name"/></xsl:if>
                                  </xsl:otherwise>
                              </xsl:choose>
-                        </xsl:for-each>,
+                        </xsl:for-each>
+                     <xsl:if test="count(input/param[@type!='']) > 0">,</xsl:if>
                     new <xsl:value-of select="$tempCallbackName"/>()
                 );
               </xsl:when>

Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestObjectCreationTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestObjectCreationTemplate.xsl?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestObjectCreationTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestObjectCreationTemplate.xsl Sat Oct  6 07:53:06 2007
@@ -25,7 +25,7 @@
     <!-- ############################   xmlbeans template   ##############################  -->
     <xsl:template match="databinders[@dbtype='xmlbeans']">
         //Create the desired XmlObject and provide it as the test object
-        public  org.apache.xmlbeans.XmlObject getTestObject(java.lang.Class type) throws Exception{
+        public  org.apache.xmlbeans.XmlObject getTestObject(java.lang.Class type) throws java.lang.Exception{
         java.lang.reflect.Method creatorMethod = null;
                 if (org.apache.xmlbeans.XmlObject.class.isAssignableFrom(type)){
                     Class[] declaredClasses = type.getDeclaredClasses();
@@ -41,7 +41,7 @@
                 if (creatorMethod!=null){
                     return  (org.apache.xmlbeans.XmlObject)creatorMethod.invoke(null,null);
                 }else{
-                    throw new Exception("Creator not found!");
+                    throw new java.lang.Exception("Creator not found!");
                 }
 
         }
@@ -87,14 +87,14 @@
     <!-- ############################   jaxme template   ##############################  -->
     <xsl:template match="databinders[@dbtype='jaxme']">
         //Create the desired Object and provide it as the test object
-        public  java.lang.Object getTestObject(java.lang.Class type) throws Exception{
+        public  java.lang.Object getTestObject(java.lang.Class type) throws java.lang.Exception{
             Class factoryClazz = org.apache.axis2.util.Loader.loadClass(type.getPackage().getName() + ".ObjectFactory"); 
             Object factory = factoryClazz.newInstance();   
             java.lang.reflect.Method creatorMethod = factoryClazz.getMethod("newInstance", new Class[]{ Class.class });
             if (creatorMethod != null) {
                 return creatorMethod.invoke(factory, null);
             } else {
-                throw new Exception("newInstance method not found!");
+                throw new java.lang.Exception("newInstance method not found!");
             }
         }
 
@@ -103,7 +103,7 @@
     <!-- ############################   ADB template   ###################################  -->
     <xsl:template match="databinders[@dbtype='adb']">
         //Create an ADBBean and provide it as the test object
-        public org.apache.axis2.databinding.ADBBean getTestObject(java.lang.Class type) throws Exception{
+        public org.apache.axis2.databinding.ADBBean getTestObject(java.lang.Class type) throws java.lang.Exception{
            return (org.apache.axis2.databinding.ADBBean) type.newInstance();
         }
 
@@ -164,7 +164,7 @@
     <!-- ############################   jaxme template   ##############################  -->
     <xsl:template match="databinders[@dbtype='jibx']">
         // create the desired object and provide it as the test object
-        public java.lang.Object getTestObject(java.lang.Class type) throws Exception {
+        public java.lang.Object getTestObject(java.lang.Class type) throws java.lang.Exception {
             return type.newInstance();
         }
 
@@ -173,7 +173,7 @@
     <!-- ############################   Jaxbri template   ###################################  -->
     <xsl:template match="databinders[@dbtype='jaxbri']">
         //Create an object and provide it as the test object
-        public Object getTestObject(java.lang.Class type) throws Exception{
+        public Object getTestObject(java.lang.Class type) throws java.lang.Exception{
            return type.newInstance();
         }
     </xsl:template>

Modified: webservices/axis2/branches/java/jaxws21/modules/distribution/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/distribution/pom.xml?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/distribution/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/distribution/pom.xml Sat Oct  6 07:53:06 2007
@@ -320,7 +320,8 @@
 				<copy file="../../modules/ping/target/ping-${version}.mar" tofile="target/tmp-repository/modules/ping-${ping.mar.version}.mar"/>
 				<copy file="../../modules/mex-mar/target/mex-${version}.mar" tofile="target/tmp-repository/modules/mex-${mex.mar.version}.mar"/>
 				<copy file="../../modules/scripting/target/axis2-scripting-${version}.mar" tofile="target/tmp-repository/modules/scripting-${scripting.mar.version}.mar"/>
-			
+				<copy file="../../modules/kernel/target/smtpfault.mar" tofile="target/tmp-repository/modules/smtpfault.mar"/>
+
 				<!-- generate modules.list -->			        
 				<echo file="target/tmp-repository/modules/modules.list" append="false">
 #

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java Sat Oct  6 07:53:06 2007
@@ -99,7 +99,7 @@
                 XmlSchema schema = (XmlSchema)schemas.get(i);
                 InputSource inputSource =
                         new InputSource(new StringReader(getSchemaAsString(schema)));
-                inputSource.setSystemId(baseURI);
+                inputSource.setSystemId(schema.getTargetNamespace());
                 xmlObjectsVector.add(inputSource);
             }
 
@@ -114,7 +114,7 @@
                         if(schema.getTargetNamespace().equals(publicId)){
                             InputSource inputSource =
                                     new InputSource(new StringReader(getSchemaAsString(schema)));
-                            inputSource.setSystemId(baseURI);
+                            inputSource.setSystemId(schema.getTargetNamespace());
                             return inputSource;
                         }
                     }

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=582501&r1=582500&r2=582501&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 Sat Oct  6 07:53:06 2007
@@ -25,14 +25,15 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import java.io.Serializable;
 import java.util.Map;
 
 /**
  * The PropertyMigrator implements the ApplicationContextMigrator in order to perform the necessary
  * manipulations of properties during a request or response flow.
  */
-public class PropertyMigrator implements ApplicationContextMigrator {
-	private static final Log log = LogFactory.getLog(PropertyMigrator.class);
+public class PropertyMigrator implements ApplicationContextMigrator, Serializable {
+    private static final Log log = LogFactory.getLog(PropertyMigrator.class);
     public void migratePropertiesFromMessageContext(Map<String, Object> userContext,
                                                     MessageContext messageContext) {
 

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/handler/MEPContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/handler/MEPContext.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/handler/MEPContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/handler/MEPContext.java Sat Oct  6 07:53:06 2007
@@ -22,11 +22,14 @@
 import org.apache.axis2.jaxws.description.EndpointDescription;
 import org.apache.axis2.jaxws.message.Message;
 
+import javax.xml.ws.handler.MessageContext.Scope;
+
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.Map.Entry;
 
 /**
  * The <tt>MEPContext</tt> is the version of the MessageContext
@@ -352,21 +355,20 @@
      */
     public Map<String, Object> getApplicationScopedProperties() {
         Map<String, Object> tempMap = new HashMap<String, Object>();
-        // better performance:
         if (!scopes.containsValue(Scope.APPLICATION)) {
             return tempMap;
         }
-        for(Iterator it = requestMC.getProperties().keySet().iterator(); it.hasNext();) {
-            String key = (String)it.next();
-            if ((getScope(key).equals(Scope.APPLICATION) && (requestMC.getProperties().containsKey(key)))) {
-                tempMap.put(key, get(key));
+        for(Iterator it = requestMC.getProperties().entrySet().iterator(); it.hasNext();) {
+            Entry entry = (Entry)it.next();
+            if (getScope((String)entry.getKey()).equals(Scope.APPLICATION)) {
+                tempMap.put((String)entry.getKey(), entry.getValue());
             }
         }
         if (responseMC != null) {
-            for(Iterator it = responseMC.getProperties().keySet().iterator(); it.hasNext();) {
-                String key = (String)it.next();
-                if ((getScope(key).equals(Scope.APPLICATION) && (responseMC.getProperties().containsKey(key)))) {
-                    tempMap.put(key, get(key));
+            for(Iterator it = responseMC.getProperties().entrySet().iterator(); it.hasNext();) {
+                Entry entry = (Entry)it.next();
+                if (getScope((String)entry.getKey()).equals(Scope.APPLICATION)) {
+                    tempMap.put((String)entry.getKey(), entry.getValue());
                 }
             }
         }

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/util/MessageUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/util/MessageUtils.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/util/MessageUtils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/util/MessageUtils.java Sat Oct  6 07:53:06 2007
@@ -34,7 +34,9 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.Constants.Configuration;
+import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.jaxws.ExceptionFactory;
 import org.apache.axis2.jaxws.handler.AttachmentsAdapter;
 import org.apache.axis2.jaxws.handler.TransportHeadersAdapter;
@@ -51,13 +53,17 @@
 import javax.activation.DataHandler;
 import javax.xml.namespace.QName;
 import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
 import javax.xml.soap.SOAPMessage;
 import javax.xml.ws.WebServiceException;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
@@ -312,5 +318,77 @@
                 }
             }
         } 
+    }
+    
+    /**
+     * This is for debug purposes only
+     * @param mc
+     */
+    private static void persistMessageContext(MessageContext mc) {
+        try {
+            ConfigurationContext cc = mc.getConfigurationContext();
+            OperationContext op = mc.getOperationContext();
+            if (cc == null && op != null) {
+                cc = op.getConfigurationContext();
+            }
+            
+            File theFile = null;
+            theFile = File.createTempFile("DebugPersist", null);
+            
+            // Setup an output stream to a physical file
+            FileOutputStream outStream = new FileOutputStream(theFile);
+
+            // Attach a stream capable of writing objects to the 
+            // stream connected to the file
+            ObjectOutputStream outObjStream = new ObjectOutputStream(outStream);
+
+            // Try to save the message context
+            outObjStream.writeObject(mc);
+            outObjStream.flush();
+            outObjStream.close();
+            outStream.flush();
+            outStream.close();
+            
+            // Now read in the persisted message
+            // Setup an input stream to the file
+            FileInputStream inStream = new FileInputStream(theFile);
+            
+            // attach a stream capable of reading objects from the 
+            // stream connected to the file
+            ObjectInputStream inObjStream = new ObjectInputStream(inStream);
+
+            org.apache.axis2.context.MessageContext restoredMC = 
+                (org.apache.axis2.context.MessageContext) inObjStream.readObject();
+            inObjStream.close();
+            inStream.close();
+            if (cc == null && op == null) {
+                return;
+            }
+            
+            if (cc != null) {
+                restoredMC.activate(cc);
+            } else {
+                restoredMC.activateWithOperationContext(op);
+            }
+            if (restoredMC.getServiceContext() == null) {
+                throw ExceptionFactory.makeWebServiceException("No Service Group!");
+            }
+            if (cc != null) {
+                mc.activate(cc);
+            } else {
+                mc.activateWithOperationContext(op);
+            }
+            if (mc.getOperationContext() == null) {
+                throw new RuntimeException("No Operation Context");
+            }
+            if (mc.getOperationContext().getServiceContext() == null) {
+                throw new RuntimeException("No Service Context");
+            }
+            return;
+        } catch (FileNotFoundException e) {
+        } catch (IOException e) {
+        } catch (ClassNotFoundException e) {
+        }
+        return;
     }
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/migrator/ApplicationContextMigratorUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/migrator/ApplicationContextMigratorUtil.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/migrator/ApplicationContextMigratorUtil.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/migrator/ApplicationContextMigratorUtil.java Sat Oct  6 07:53:06 2007
@@ -29,6 +29,7 @@
 import javax.xml.ws.handler.MessageContext.Scope;
 
 import java.util.AbstractSet;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -96,17 +97,28 @@
         ServiceDescription sd = messageContext.getEndpointDescription().getServiceDescription();
         if (sd != null) {
             ConfigurationContext configCtx = sd.getAxisConfigContext();
-            List<ApplicationContextMigrator> migratorList = (List<ApplicationContextMigrator>)configCtx.getProperty(contextMigratorListID);
-            synchronized(migratorList){
-                if (migratorList != null) {
-                    ListIterator<ApplicationContextMigrator> itr = migratorList.listIterator();
-                    while (itr.hasNext()) {
-                        ApplicationContextMigrator cpm = itr.next();
-                        if (log.isDebugEnabled()) {
-                            log.debug("migrator: " + cpm.getClass().getName() + ".migratePropertiesToMessageContext");
-                        }
-                        cpm.migratePropertiesToMessageContext(new ApplicationPropertyMapReader(requestContext, messageContext.getMEPContext()), messageContext);
+            List<ApplicationContextMigrator> migratorList = (List<ApplicationContextMigrator>) configCtx.getProperty(contextMigratorListID);
+            if (migratorList != null) {
+                
+                // Create copy to avoid using shared list
+                List listCPM = null;
+                
+                // synchronize on non-null migratorList
+                synchronized(migratorList){
+                     listCPM = new ArrayList(migratorList);
+                }
+                
+                ListIterator<ApplicationContextMigrator> itr = listCPM.listIterator();   // Iterate over non-shared list
+                while (itr.hasNext()) {
+                    ApplicationContextMigrator cpm = itr.next();
+                    if (log.isDebugEnabled()) {
+                        log.debug("migrator: " + cpm.getClass().getName() + ".migratePropertiesToMessageContext");
                     }
+                    
+                    // TODO: Synchronizing here is expensive too.
+                    // If a cpm requires synchronization, it should provide it inside of its migratePropertiesFromMessageContext implementation.
+                    
+                    cpm.migratePropertiesToMessageContext(new ApplicationPropertyMapReader(requestContext, messageContext.getMEPContext()), messageContext);
                 }
             }
         }
@@ -130,16 +142,27 @@
             List<ApplicationContextMigrator> migratorList =
                     (List<ApplicationContextMigrator>)configCtx.getProperty(contextMigratorListID);
 
-            synchronized(migratorList){
-                if (migratorList != null) {
-                    ListIterator<ApplicationContextMigrator> itr = migratorList.listIterator();
-                    while (itr.hasNext()) {
-                        ApplicationContextMigrator cpm = itr.next();
-                        if (log.isDebugEnabled()) {
-                            log.debug("migrator: " + cpm.getClass().getName() + ".migratePropertiesFromMessageContext");
-                        }
-                        cpm.migratePropertiesFromMessageContext(new ApplicationPropertyMapWriter(responseContext, messageContext.getMEPContext()), messageContext);
+            if (migratorList != null) {
+                
+                // Create copy to avoid using shared list
+                List listCPM = null;
+                
+                // synchronize on non-null migratorList
+                synchronized(migratorList){
+                     listCPM = new ArrayList(migratorList);
+                }
+            
+                ListIterator<ApplicationContextMigrator> itr = listCPM.listIterator();   // Iterate over non-shared list
+                while (itr.hasNext()) {
+                    ApplicationContextMigrator cpm = itr.next();
+                    if (log.isDebugEnabled()) {
+                        log.debug("migrator: " + cpm.getClass().getName() + ".migratePropertiesFromMessageContext");
                     }
+
+                    // TODO: Synchronizing here is expensive too.
+                    // If a cpm requires synchronization, it should provide it inside of its migratePropertiesFromMessageContext implementation.
+
+                    cpm.migratePropertiesFromMessageContext(new ApplicationPropertyMapWriter(responseContext, messageContext.getMEPContext()), messageContext);
                 }
             }
         }

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/ws/axis2/tests/EchoServiceImplWithSEI.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/ws/axis2/tests/EchoServiceImplWithSEI.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/ws/axis2/tests/EchoServiceImplWithSEI.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/ws/axis2/tests/EchoServiceImplWithSEI.java Sat Oct  6 07:53:06 2007
@@ -21,12 +21,16 @@
 package org.apache.ws.axis2.tests;
 
 import javax.jws.WebService;
+import javax.xml.ws.Holder;
 
 /**
  * 
  */
 @WebService(serviceName = "EchoService", endpointInterface="org.apache.ws.axis2.tests.EchoPort")
 public class EchoServiceImplWithSEI {
-    // TODO: Test all conditions in JSR-181 spec Sec 3.1 p13  
+    // TODO: Test all conditions in JSR-181 spec Sec 3.1 p13
+    public void echo(Holder<String> text) {
+        text.value = "Echo " + text.value;
+    }
 
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/pom.xml?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/pom.xml Sat Oct  6 07:53:06 2007
@@ -246,7 +246,28 @@
 							<goal>run</goal>
 						</goals>
 					</execution>
-				</executions>
+                    <execution>
+						<id>fault-module-package</id>
+						<phase>package</phase>
+						<configuration>
+							<tasks>
+								<property name="aar.tmp.dir" location="${basedir}/target/tmp"/>
+                                <mkdir dir="${aar.tmp.dir}/META-INF"/>
+                                <copy file="${basedir}/resources/smtpfault-module.xml" tofile="${aar.tmp.dir}/META-INF/module.xml"/>
+                                <copy todir="${aar.tmp.dir}">
+                                    <fileset dir="${basedir}/target/classes">
+                                        <include name="**/*SMTPFaultHandler.class"/>
+                                    </fileset>
+                                </copy>
+                                <jar destfile="${basedir}/target/smtpfault.mar" basedir="${aar.tmp.dir}"/>
+                                <delete dir="${aar.tmp.dir}"/>
+                            </tasks>
+						</configuration>
+						<goals>
+							<goal>run</goal>
+						</goals>
+					</execution>
+                </executions>
 			</plugin>
 		</plugins>
 	</build>

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java Sat Oct  6 07:53:06 2007
@@ -103,7 +103,10 @@
     static final String DISABLE_OUTBOUND_ADDRESSING_VALIDATION =
             "disableAddressingOutboundValidation";
 
-    static final String WSAW_ANONYMOUS_PARAMETER_NAME = "wsawAnonymous";
+    static final String WSAM_INVOCATION_PATTERN_PARAMETER_NAME = "wsamInvocationPattern";
+    static final String WSAM_INVOCATION_PATTERN_SYNCHRONOUS = "synchronous";
+    static final String WSAM_INVOCATION_PATTERN_ASYNCHRONOUS = "asynchronous";
+    static final String WSAM_INVOCATION_PATTERN_BOTH = "both";
 
     // ======================== Common Faults ==============================
     static final String FAULT_ACTION_NOT_SUPPORTED = "ActionNotSupported";

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/AddressingHelper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/AddressingHelper.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/AddressingHelper.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/AddressingHelper.java Sat Oct  6 07:53:06 2007
@@ -107,20 +107,23 @@
      *
      * @param axisOperation
      */
-    public static String getAnonymousParameterValue(AxisOperation axisOperation) {
+    public static String getInvocationPatternParameterValue(AxisOperation axisOperation) {
         String value = "";
         if (axisOperation != null) {
             value = Utils.getParameterValue(
-                    axisOperation.getParameter(AddressingConstants.WSAW_ANONYMOUS_PARAMETER_NAME));
+                    axisOperation.getParameter(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME));
+            if(value !=null){
+            	value = value.trim();
+            }
             if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug("getAnonymousParameterValue: value: '" + value + "'");
             }
         }
 
-        if (value == null || "".equals(value.trim())) {
-            value = "optional";
+        if (value == null || "".equals(value)) {
+            value = AddressingConstants.WSAM_INVOCATION_PATTERN_BOTH;
         }
-        return value.trim();
+        return value;
     }
 
     /**
@@ -131,25 +134,25 @@
      * @param axisOperation
      * @param value
      */
-    public static void setAnonymousParameterValue(AxisOperation axisOperation, String value) {
+    public static void setInvocationPatternParameterValue(AxisOperation axisOperation, String value) {
         if (value == null) {
             if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
-                log.debug("setAnonymousParameterValue: value passed in is null. return");
+                log.debug("setInvocationPatternParameterValue: value passed in is null. return");
             }
             return;
         }
 
         Parameter param =
-                axisOperation.getParameter(AddressingConstants.WSAW_ANONYMOUS_PARAMETER_NAME);
+                axisOperation.getParameter(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME);
         // If an existing parameter exists
         if (param != null) {
             if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
-                log.debug("setAnonymousParameterValue: Parameter already exists");
+                log.debug("setInvocationPatternParameterValue: Parameter already exists");
             }
             // and is not locked
             if (!param.isLocked()) {
                 if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
-                    log.debug("setAnonymousParameterValue: Parameter not locked. Setting value: " +
+                    log.debug("setInvocationPatternParameterValue: Parameter not locked. Setting value: " +
                             value);
                 }
                 // set the value
@@ -158,15 +161,15 @@
         } else {
             // otherwise, if no Parameter exists
             if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
-                log.debug("setAnonymousParameterValue: Parameter does not exist");
+                log.debug("setInvocationPatternParameterValue: Parameter does not exist");
             }
             // Create new Parameter with correct name/value
             param = new Parameter();
-            param.setName(AddressingConstants.WSAW_ANONYMOUS_PARAMETER_NAME);
+            param.setName(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME);
             param.setValue(value);
             try {
                 if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
-                    log.debug("setAnonymousParameterValue: Adding parameter with value: " + value);
+                    log.debug("setInvocationPatternParameterValue: Adding parameter with value: " + value);
                 }
                 // and add it to the AxisOperation object
                 axisOperation.addParameter(param);
@@ -176,7 +179,7 @@
                 // if statement.
                 if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                     log.debug(
-                            "setAnonymousParameterValue: addParameter failed: " + af.getMessage());
+                            "setInvocationPatternParameterValue: addParameter failed: " + af.getMessage());
                 }
             }
         }

Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java Sat Oct  6 07:53:06 2007
@@ -30,16 +30,20 @@
 import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.util.ObjectStateUtils;
+import org.apache.axis2.context.externalize.ExternalizeConstants;
+import org.apache.axis2.context.externalize.SafeObjectInputStream;
+import org.apache.axis2.context.externalize.SafeObjectOutputStream;
+import org.apache.axis2.context.externalize.SafeSerializable;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.Externalizable;
 import java.io.IOException;
-import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -51,11 +55,16 @@
  * Since the models for this in Submission and Final versions are different, lets make this to comply with
  * WS-A Final version. So any information found with WS-A submission will be "pumped" in to this model.
  */
-public class EndpointReference implements Serializable {
+public class EndpointReference implements Externalizable, SafeSerializable {
 
     private static final long serialVersionUID = 5278892171162372439L;
 
     private static final Log log = LogFactory.getLog(EndpointReference.class);
+    
+    //  supported revision levels, add a new level to manage compatible changes
+    private static final int REVISION_2 = 2;
+    // current revision level of this object
+    private static final int revisionID = REVISION_2;
 
     private static final String myClassName = "EndpointReference";
 
@@ -84,6 +93,12 @@
     private ArrayList extensibleElements;
     private ArrayList attributes;
 
+    /**
+     * No-Arg Constructor
+     * Required for Externalizable objects
+     */
+    public EndpointReference() {}
+ 
 
     /**
      * @param address
@@ -561,14 +576,21 @@
      * OMElements/Attributes, we need to actually serialize the OM structures
      * (at least in some cases.)
      */
-    private void writeObject(java.io.ObjectOutputStream out)
+    public void writeExternal(java.io.ObjectOutput o)
             throws IOException {
+        SafeObjectOutputStream out = SafeObjectOutputStream.install(o);
+        
+        // revision ID
+        out.writeInt(revisionID);
+        
+        // Correlation ID
         String logCorrelationIDString = getLogCorrelationIDString();
 
         // String object id
-        ObjectStateUtils.writeString(out, logCorrelationIDString, logCorrelationIDString
-                + ".logCorrelationIDString");
+        out.writeObject(logCorrelationIDString);
 
+        // Write out the content as xml
+        out.writeUTF("start xml"); // write marker
         OMElement om =
                 EndpointReferenceHelper.toOM(OMAbstractFactory.getOMFactory(),
                                              this,
@@ -594,7 +616,8 @@
         }
 
         out.writeInt(baos.size());
-        out.write(baos.toByteArray());
+        out.write(baos.toByteArray());  
+        out.writeUTF("end xml"); // write marker
 
         if (log.isDebugEnabled()) {
             byte[] buffer = baos.toByteArray();
@@ -610,12 +633,23 @@
     /**
      * Read the EPR to the specified InputStream.
      */
-    private void readObject(java.io.ObjectInputStream in)
+    public void readExternal(java.io.ObjectInput inObject)
             throws IOException, ClassNotFoundException {
-
+        SafeObjectInputStream in = SafeObjectInputStream.install(inObject);
+        
+        // revision ID
+        int revID = in.readInt();
+        
+        // make sure the object data is in a revision level we can handle
+        if (revID != REVISION_2) {
+            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_REVID);
+        }
+        
         // String object id
-        logCorrelationIDString = ObjectStateUtils.readString(in, "EndpointReference.logCorrelationIDString");
+        logCorrelationIDString = (String) in.readObject();
 
+        // Read xml content
+        in.readUTF(); // read marker
         int numBytes = in.readInt();
 
         byte[] serBytes = new byte[numBytes];
@@ -655,6 +689,7 @@
 
             throw ioe;
         }
+        in.readUTF(); // read marker
 
         ByteArrayInputStream bais = new ByteArrayInputStream(serBytes);
 



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