You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2007/05/28 13:47:41 UTC

svn commit: r542211 [1/3] - in /webservices/axis2/trunk/java: ./ modules/adb-codegen/test-resources/testsuite/ modules/adb/ modules/adb/src/org/apache/axis2/databinding/utils/ modules/adb/src/org/apache/axis2/databinding/utils/reader/ modules/codegen/s...

Author: deepal
Date: Mon May 28 04:47:38 2007
New Revision: 542211

URL: http://svn.apache.org/viewvc?view=rev&rev=542211
Log:
- Merged 1.2 branch and the trunk
- Build is working fine , but I do not know whether I have broken anything (need to double check)
- Will send a status note soon to the list

Modified:
    webservices/axis2/trunk/java/maven.xml
    webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/boolean.xsd
    webservices/axis2/trunk/java/modules/adb/pom.xml
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/WrappingXMLStreamReader.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
    webservices/axis2/trunk/java/modules/integration/project.xml
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java
    webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2OMBuilder.java
    webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/SchemaGenerator.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/BuilderUtil.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBinding.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingOperation.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/PolicyInclude.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/RobustOutOnlyAxisOperation.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPSender.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/SimpleHTTPServer.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/URLTemplatingUtil.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/Constants.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/EMailSender.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/EmailReceiver.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailTransportSender.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailWorker.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/MailWorkerManager.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/SynchronousMailListener.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/MailSorter.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/POP3Server.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/SMTPServer.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/PolicyUtil.java
    webservices/axis2/trunk/java/modules/parent/pom.xml
    webservices/axis2/trunk/java/modules/samples/soapwithattachments/src/sample/soapwithattachments/client/SWAClient.java
    webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/build.xml
    webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/pom.xml
    webservices/axis2/trunk/java/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
    webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/build.xml
    webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/pom.xml
    webservices/axis2/trunk/java/modules/tool/axis2-eclipse-service-plugin/src/main/java/org/apache/axis2/tool/service/control/Controller.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/CodegenBean.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/BottomPanel.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/Java2CodeFrame.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/OptionPane.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/OutPutPane.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/SecondFrame.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/BottomPanel.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/Java2WSDLFrame.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/MiddlePanel.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/OptionPanel.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/OutputPanel.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/Axi2PluginPage.java
    webservices/axis2/trunk/java/modules/tool/script/axis2.sh
    webservices/axis2/trunk/java/modules/tool/script/axis2server.sh

Modified: webservices/axis2/trunk/java/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/maven.xml?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/maven.xml (original)
+++ webservices/axis2/trunk/java/maven.xml Mon May 28 04:47:38 2007
@@ -898,7 +898,10 @@
 
 	<ant:filter filtersfile="xdocs-original/dynamic-labels.properties" />
         <ant:copy toDir="xdocs" filtering="on" overwrite="true" >
-            <ant:fileset dir="xdocs-original"/>
+            <ant:fileset dir="xdocs-original">
+          <ant:exclude name="images/**"/>
+           <ant:exclude name="@axis2_version_dir@/images/**"/>
+          </ant:fileset>
         </ant:copy>
 
 	<ant:move toDir="xdocs/${maven.xdoc.axis_doc_folder_name}">
@@ -914,6 +917,8 @@
         </ant:copy>
 	<!-- Delete the backup of xdocs folder. @see preGoal name="site" -->
 	<ant:delete dir="xdocs-original"/>
+<ant:delete dir="target/docs/@axis2_version_dir@"/>
+
     </postGoal>
 	
     <goal name="dist-docs" prereqs="init-dist, javadocs">

Modified: webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/boolean.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/boolean.xsd?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/boolean.xsd (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test-resources/testsuite/boolean.xsd Mon May 28 04:47:38 2007
@@ -12,4 +12,4 @@
             <xs:attribute name="attribute1" type="xs:boolean"/>
         </xs:complexType>
     </xs:element>
-</xs:schema>
\ No newline at end of file
+</xs:schema>

Modified: webservices/axis2/trunk/java/modules/adb/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/pom.xml?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/adb/pom.xml Mon May 28 04:47:38 2007
@@ -15,6 +15,7 @@
  ! See the License for the specific language governing permissions and
  ! limitations under the License.
  !-->
+<<<<<<< .mine
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 	<parent>
@@ -82,4 +83,95 @@
 			</plugin>
 		</plugins>
 	</build>
+
+
+
+
+
+
+
+
+
+
+
+=======
+<project
+        xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.axis2</groupId>
+        <artifactId>axis2-parent</artifactId>
+        <version>SNAPSHOT</version>
+        <relativePath>../parent/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>axis2-adb</artifactId>
+    <name>Apache Axis 2.0 - Data Binding</name>
+    <description>Axis2 Data Binding module</description>
+    <scm>
+        <connection>
+            scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb</connection>
+        <developerConnection>
+            scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/adb</developerConnection>
+        <url>http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb</url>
+    </scm>
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axis2-kernel</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>xmlunit</groupId>
+            <artifactId>xmlunit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <sourceDirectory>src</sourceDirectory>
+        <testSourceDirectory>test</testSourceDirectory>
+        <resources>
+            <resource>
+                <directory>conf</directory>
+                <excludes>
+                    <exclude>**/*.properties</exclude>
+                </excludes>
+                <filtering>false</filtering>
+            </resource>
+            <resource>
+                <directory>src</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <inherited>true</inherited>
+                <configuration>
+                    <skip>false</skip>
+                    <excludes>
+                        <exclude>**/*Abstract*.java</exclude>
+                        <exclude>**/*Util*.java</exclude>
+                        <exclude>**/*PhaseResolvingTest.java</exclude>
+                    </excludes>
+                    <includes>
+                        <include>**/*Test.java</include>
+                    </includes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+>>>>>>> .theirs
 </project>

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java Mon May 28 04:47:38 2007
@@ -30,6 +30,8 @@
 import org.apache.axis2.engine.ObjectSupplier;
 import org.apache.axis2.util.StreamWrapper;
 import org.apache.ws.java2wsdl.utils.TypeTable;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.codehaus.jam.JClass;
 import org.codehaus.jam.JProperty;
 import org.codehaus.jam.JamClassIterator;
@@ -58,6 +60,8 @@
 
     private static int nsCount = 1;
 
+    private static final Log log = LogFactory.getLog(BeanUtil.class);
+
     /**
      * To Serilize Bean object this method is used, this will create an object array using given
      * bean object
@@ -270,8 +274,16 @@
                     object.add(value);
                 }
             }
-            return new ADBXMLStreamReaderImpl(beanName, object.toArray(), null, typeTable,
-                                              qualified);
+             // Added objectAttributes as a fix for issues AXIS2-2055 and AXIS2-1899 to 
+            // support polymorphism in POJO approach.
+            // For some reason, using QName(Constants.XSI_NAMESPACE, "type", "xsi") does not generate
+            // an xsi:type attribtue properly for inner objects. So just using a simple QName("type").
+//            ArrayList objectAttributes = new ArrayList();
+//            objectAttributes.add(new QName(Constants.XSI_NAMESPACE, "type", "xsi"));
+//            objectAttributes.add(beanObject.getClass().getName());
+            return new ADBXMLStreamReaderImpl(beanName, object.toArray(), null,
+                                              typeTable, qualified);
+
         } catch (java.io.IOException e) {
             throw new RuntimeException(e);
         } catch (java.beans.IntrospectionException e) {
@@ -303,8 +315,25 @@
                                      ObjectSupplier objectSupplier,
                                      String arrayLocalName)
             throws AxisFault {
-        Object beanObj;
+        Object beanObj =null;
         try {
+             // Added this block as a fix for issues AXIS2-2055 and AXIS2-1899
+            // to support polymorphism in POJO approach.
+            // Retrieve the type name of the instance from the 'type' attribute
+            // and retrieve the class.
+//            String instanceTypeName = beanElement.getAttributeValue(
+//                    new QName(Constants.XSI_NAMESPACE,"type","xsi"));
+//            if ((instanceTypeName != null) && (! beanClass.isArray())) {
+//                try {
+//                    beanClass = Class.forName(instanceTypeName);
+//                } catch (ClassNotFoundException ce) {
+//                    log.warn(ce);
+                    // This breaks samples , and Need to improve a bit to fully 
+                    // support this so , Exception just ignore here, we can fix
+                    // that later
+//                }
+//            }
+   
             if (beanClass.isArray()) {
                 ArrayList valueList = new ArrayList();
                 Class arrayClassType = beanClass.getComponentType();
@@ -338,11 +367,16 @@
                     PropertyDescriptor proprty = propDescs[i];
                     properties.put(proprty.getName(), proprty);
                 }
-
-                beanObj = objectSupplier.getObject(beanClass);
+                 beanObj = objectSupplier.getObject(beanClass);
                 boolean tuched = false;
                 Iterator elements = beanElement.getChildren();
                 while (elements.hasNext()) {
+                    // the beanClass could be an abstract one.
+                    // so create an instance only if there are elements, in
+                    // which case a concrete subclass is available to instantiate.
+//                    if (beanObj == null) {
+//                        beanObj = objectSupplier.getObject(beanClass);
+//                    }
                     OMElement parts;
                     Object objValue = elements.next();
                     if (objValue instanceof OMElement) {

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/WrappingXMLStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/WrappingXMLStreamReader.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/WrappingXMLStreamReader.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/WrappingXMLStreamReader.java Mon May 28 04:47:38 2007
@@ -106,7 +106,7 @@
     }
 
     public String getAttributePrefix(int i) {
-        return reader.getAttributeLocalName(i);
+        return reader.getAttributePrefix(i);
     }
 
     public String getAttributeType(int i) {

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Mon May 28 04:47:38 2007
@@ -53,6 +53,8 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.Text;
 
+import com.ibm.wsdl.util.xml.DOM2Writer;
+
 import javax.xml.namespace.QName;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -256,7 +258,22 @@
 
         return property;
     }
-
+    
+    
+    private Policy getBindingPolicyFromOperation(QName qName) {
+        AxisBindingOperation axisBindingOperation = null;
+        
+        if (axisBinding != null) {
+            axisBindingOperation = (AxisBindingOperation) axisBinding.getChild(qName);
+        }
+        
+        if (axisBindingOperation != null) {
+            return axisBindingOperation.getEffectivePolicy();
+        }
+        
+        return null;
+    }
+    
     private Object getBindingPropertyFromMessage(String name, QName qName, String key) {
 
         Object property = null;
@@ -654,7 +671,10 @@
                                                    codeGenConfiguration.getSourceLocation()),
                         codeGenConfiguration.getOutputLanguage());
 
+        
         writeClass(interfaceImplModel, writer);
+        
+        
     }
 
     /** Creates the DOM tree for implementations. */
@@ -927,15 +947,6 @@
      */
     protected void addEndpoint(Document doc, Element rootElement) throws Exception {
 
-        PolicyInclude policyInclude = axisService.getPolicyInclude();
-        Policy servicePolicy = policyInclude.getPolicy();
-
-        if (servicePolicy != null) {
-            String policyString = PolicyUtil.policyComponentToString(servicePolicy);
-            policyString = PolicyUtil.getSafeString(policyString);
-            addAttribute(doc, "policy", policyString, rootElement);
-        }
-
         Element endpointElement = doc.createElement("endpoint");
 
         String endpoint = this.axisEndpoint.getEndpointURL();
@@ -2080,7 +2091,8 @@
         /*
          * Setting the policy of the operation
          */
-        Policy policy = axisOperation.getPolicyInclude().getPolicy();
+        Policy policy = getBindingPolicyFromOperation(axisOperation.getName());
+        
         if (policy != null) {
             try {
                 addAttribute(doc, "policy",
@@ -2090,6 +2102,8 @@
                 throw new RuntimeException("can't serialize the policy ..");
             }
         }
+        
+//        System.out.println(DOM2Writer.nodeToString(methodElement));
 
 
         if (WSDLUtil.isInputPresentForMEP(messageExchangePattern)) {
@@ -2503,27 +2517,6 @@
 
         if (WSDLUtil.isInputPresentForMEP(mep)) {
 
-            /*
-             * Setting the input message policy as an attribute of the input element.
-             */
-            AxisMessage inputMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-            if (inputMessage != null) {
-                PolicyInclude policyInclude = inputMessage.getPolicyInclude();
-                Policy policy = policyInclude.getPolicy();
-
-                if (policy != null) {
-                    policy = (Policy)policy.normalize(policyInclude.getPolicyRegistry(), false);
-                    try {
-                        String policyString = PolicyUtil.policyComponentToString(policy);
-                        policyString = PolicyUtil.getSafeString(policyString);
-                        addAttribute(doc, "policy", policyString, inputElt);
-
-                    } catch (Exception e) {
-                        throw new RuntimeException(e);
-                    }
-                }
-            }
-
             Element[] param = getInputParamElement(doc, operation);
             for (int i = 0; i < param.length; i++) {
                 inputElt.appendChild(param[i]);
@@ -2581,24 +2574,6 @@
 
 
         if (WSDLUtil.isOutputPresentForMEP(mep)) {
-
-            AxisMessage outMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
-            if (outMessage != null) {
-                PolicyInclude policyInclude = outMessage.getPolicyInclude();
-                Policy policy = policyInclude.getPolicy();
-
-                if (policy != null) {
-                    policy = (Policy)policy.normalize(policyInclude.getPolicyRegistry(), false);
-
-                    try {
-                        String policyString = PolicyUtil.policyComponentToString(policy);
-                        policyString = PolicyUtil.getSafeString(policyString);
-
-                    } catch (Exception e) {
-                        throw new RuntimeException(e);
-                    }
-                }
-            }
 
             Element param = getOutputParamElement(doc, operation);
 

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl Mon May 28 04:47:38 2007
@@ -76,10 +76,14 @@
                    __operation = new org.apache.axis2.description.OutInAxisOperation();
                 </xsl:otherwise>
             </xsl:choose>
+            <xsl:if test="@policy">
+			    (__operation).getPolicyInclude().setPolicy(getPolicy("<xsl:value-of select="@policy"/>"));
+	    	</xsl:if>
 
             __operation.setName(new javax.xml.namespace.QName("<xsl:value-of select="@namespace"/>", "<xsl:value-of select="@name"/>"));
 	    _service.addOperation(__operation);
 	    
+	    <!-- 
 	    <xsl:if test="input/@policy">
 	    (__operation).getMessage(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_OUT_VALUE).getPolicyInclude().setPolicy(getPolicy("<xsl:value-of select="input/@policy"/>"));
 	    </xsl:if>
@@ -87,6 +91,7 @@
 	    <xsl:if test="output/@policy">
 	    (__operation).getMessage(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE).getPolicyInclude().setPolicy(getPolicy("<xsl:value-of select="output/@policy"/>"));
 	    </xsl:if>
+	    -->
 	    
             _operations[<xsl:value-of select="position()-1"/>]=__operation;
             
@@ -128,7 +133,7 @@
          populateFaults();
 
         _serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext,_service);
-        <xsl:if test="@policy">
+        <xsl:if test="//method[@policy]">
         _service.applyPolicy();
         </xsl:if>
 	

Modified: webservices/axis2/trunk/java/modules/integration/project.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/project.xml?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/project.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/project.xml Mon May 28 04:47:38 2007
@@ -360,6 +360,7 @@
                 <exclude>**/*InteropStubTest.class</exclude>
                 <exclude>**/*ServiceGroupContextTest.class</exclude>
                 <exclude>**/*EchoRawSwAFileInputTest.class</exclude>
+                <exclude>**/*EchoRawRuntimeProxyTest.class</exclude>
                 <exclude>**org/apache/axis2/mail/*.class</exclude>
 		<exclude>**org/apache/axis2/transport/DualChannelRequestResponseRawXMLTest.class</exclude>
                 <exclude>**org/apache/axis2/soap12testing/soap12testsuite/*.class</exclude>

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java Mon May 28 04:47:38 2007
@@ -37,7 +37,7 @@
 
 public class EchoRawRuntimeProxyTest extends UtilServerBasedTestCase {
     public static final EndpointReference targetEPR = new EndpointReference(
-            "http://apache.axis2.host"
+            "http://localhost:5555"
                     + "/axis2/services/EchoXMLService/echoOMElement");
 
     public static final QName serviceName = new QName("EchoXMLService");

Modified: webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2OMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2OMBuilder.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2OMBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2OMBuilder.java Mon May 28 04:47:38 2007
@@ -9,6 +9,7 @@
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.java2wsdl.utils.TypeTable;
 import org.codehaus.jam.JMethod;
+import org.codehaus.jam.JClass;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
@@ -185,7 +186,7 @@
                     .getSimpleName())) != null) {
                 namespaceURI = messagePartType.getNamespaceURI();
                 // avoid duplicate namespaces
-                if ((namespacePrefix = (String) messagePartType.getPrefix()) == null &&
+                if ((namespacePrefix = messagePartType.getPrefix()) == null &&
                         (namespacePrefix = (String) namespaceMap.get(namespaceURI)) == null) {
                     namespacePrefix = generatePrefix();
                     namespaceMap.put(namespaceURI, namespacePrefix);
@@ -206,7 +207,7 @@
                     .getSimpleName()
                     + RESPONSE)) != null) {
                 namespaceURI = messagePartType.getNamespaceURI();
-                if ((namespacePrefix = (String) messagePartType.getPrefix()) == null &&
+                if ((namespacePrefix = messagePartType.getPrefix()) == null &&
                         (namespacePrefix = (String) namespaceMap.get(namespaceURI)) == null) {
                     namespacePrefix = generatePrefix();
                     namespaceMap.put(namespaceURI, namespacePrefix);
@@ -229,30 +230,32 @@
             }
 
             if (jmethod.getExceptionTypes().length > 0) {
-                if ((messagePartType = typeTable.getComplexSchemaType(jmethod.getSimpleName() + "Fault")) != null) {
-                    namespaceURI = messagePartType.getNamespaceURI();
-                    if ((namespacePrefix = (String) messagePartType.getPrefix()) == null &&
-                            (namespacePrefix = (String) namespaceMap.get(namespaceURI)) == null) {
-                        namespacePrefix = generatePrefix();
-                        namespaceMap.put(namespaceURI, namespacePrefix);
+                JClass[] extypes = jmethod.getExceptionTypes() ;
+                for (int j= 0 ; j < extypes.length ; j++) {
+                    JClass extype = extypes[j] ;
+                    String exname = extype.getSimpleName() ;
+                    String q_exname= extype.getQualifiedName() ;
+                    if ((messagePartType = typeTable.getComplexSchemaType(q_exname)) != null) {
+                        namespaceURI = messagePartType.getNamespaceURI();
+                        if ((namespacePrefix = messagePartType.getPrefix()) == null &&
+                                (namespacePrefix = (String) namespaceMap.get(namespaceURI)) == null) {
+                            namespacePrefix = generatePrefix();
+                            namespaceMap.put(namespaceURI, namespacePrefix);
+                        }
+                        OMElement responseMessge = fac.createOMElement(
+                                MESSAGE_LOCAL_NAME, wsdl);
+                        responseMessge.addAttribute(ATTRIBUTE_NAME, exname, null);
+                        definitions.addChild(responseMessge);
+                        OMElement responsePart = fac.createOMElement(
+                                PART_ATTRIBUTE_NAME, wsdl);
+                        responseMessge.addChild(responsePart);
+                        responsePart.addAttribute(ATTRIBUTE_NAME, "part1", null);
+                        responsePart.addAttribute(ELEMENT_ATTRIBUTE_NAME,
+                                namespacePrefix + COLON_SEPARATOR
+                                        + exname, null);
                     }
-                    //Response Message
-                    OMElement responseMessge = fac.createOMElement(
-                            MESSAGE_LOCAL_NAME, wsdl);
-                    responseMessge.addAttribute(ATTRIBUTE_NAME, jmethod
-                            .getSimpleName()
-                            + "Fault", null);
-                    definitions.addChild(responseMessge);
-                    OMElement responsePart = fac.createOMElement(
-                            PART_ATTRIBUTE_NAME, wsdl);
-                    responseMessge.addChild(responsePart);
-                    responsePart.addAttribute(ATTRIBUTE_NAME, "part1", null);
-
-                    responsePart.addAttribute(ELEMENT_ATTRIBUTE_NAME,
-                            namespacePrefix + COLON_SEPARATOR
-                                    + jmethod.getSimpleName() + "Fault", null);
                 }
-            }
+            }// end for loop
         }
 
         // now add these unique namespaces to the the definitions element
@@ -307,16 +310,18 @@
                 operation.addChild(message);
             }
             if (jmethod.getExceptionTypes().length > 0) {
-                message = fac.createOMElement(FAULT_LOCAL_NAME, wsdl);
-                message.addAttribute(MESSAGE_LOCAL_NAME, tns.getPrefix()
-                        + COLON_SEPARATOR + jmethod.getSimpleName()
-                        + "Fault", null);
-                message.addAttribute(ATTRIBUTE_NAME, jmethod.getSimpleName()
-                        + "Fault", null);
-                namespace = message.declareNamespace(WSAD_NS,
-                        "wsaw");
-                message.addAttribute("Action", "urn:" + jmethod.getSimpleName(), namespace);
-                operation.addChild(message);
+            	JClass[] extypes = jmethod.getExceptionTypes() ;
+           	 	for (int j= 0 ; j < extypes.length ; j++) {
+           		 JClass extype = extypes[j] ;
+           		 String exname = extype.getSimpleName() ;
+
+           		 message = fac.createOMElement(FAULT_LOCAL_NAME, wsdl);
+           		 message.addAttribute(MESSAGE_LOCAL_NAME, tns.getPrefix()
+                        + COLON_SEPARATOR + exname, null);
+           		 message.addAttribute(ATTRIBUTE_NAME, exname, null);
+          		 operation.addChild(message);
+
+           	 	} // end for
             }
         }
 
@@ -391,11 +396,15 @@
             }
 
             if (jmethod.getExceptionTypes().length > 0) {
-
-                OMElement fault = fac.createOMElement(FAULT_LOCAL_NAME, wsdl);
-                fault.addAttribute(ATTRIBUTE_NAME, jmethod.getSimpleName() + "Fault", null);
-                addExtensionElement(fac, fault, soap, SOAP_BODY, SOAP_USE, use);
-                operation.addChild(fault);
+            	JClass[] extypes = jmethod.getExceptionTypes() ;
+           	 	for (int j= 0 ; j < extypes.length ; j++) {
+           	 		JClass extype = extypes[j] ;
+           	 		String exname = extype.getSimpleName() ;
+           	 		OMElement fault = fac.createOMElement(FAULT_LOCAL_NAME, wsdl);
+           	 		fault.addAttribute(ATTRIBUTE_NAME, exname, null);
+           	 		addExtensionElement(fac, fault, soap, SOAP_BODY, SOAP_USE, use);
+           	 		operation.addChild(fault);
+           	 	}
             }
         }
     }
@@ -437,11 +446,15 @@
                 operation.addChild(output);
             }
             if (jmethod.getExceptionTypes().length > 0) {
-
-                OMElement fault = fac.createOMElement(FAULT_LOCAL_NAME, wsdl);
-                fault.addAttribute(ATTRIBUTE_NAME, jmethod.getSimpleName() + "Fault", null);
-                addExtensionElement(fac, fault, soap12, SOAP_BODY, SOAP_USE, use);
-                operation.addChild(fault);
+                JClass[] extypes = jmethod.getExceptionTypes() ;
+                for (int j= 0 ; j < extypes.length ; j++) {
+                    JClass extype = extypes[j] ;
+                    String exname = extype.getSimpleName() ;
+                    OMElement fault = fac.createOMElement(FAULT_LOCAL_NAME, wsdl);
+                    fault.addAttribute(ATTRIBUTE_NAME, exname, null);
+                    addExtensionElement(fac, fault, soap12, SOAP_BODY, SOAP_USE, use);
+                    operation.addChild(fault);
+                }
             }
         }
     }

Modified: webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/SchemaGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/SchemaGenerator.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/SchemaGenerator.java (original)
+++ webservices/axis2/trunk/java/modules/java2wsdl/src/org/apache/ws/java2wsdl/SchemaGenerator.java Mon May 28 04:47:38 2007
@@ -223,15 +223,28 @@
                         continue;
                     }
                     if (jMethod.getExceptionTypes().length > 0) {
-                        methodSchemaType =
-                                createSchemaTypeForMethodPart(getSimpleName(jMethod) + "Fault");
-                        sequence = new XmlSchemaSequence();
-                        XmlSchemaElement elt1 = new XmlSchemaElement();
-                        elt1.setName(getSimpleName(jMethod) + "Fault");
-                        elt1.setSchemaTypeName(
-                                typeTable.getQNamefortheType(Object.class.getName()));
-                        sequence.getItems().add(elt1);
-                        methodSchemaType.setParticle(sequence);
+                        /*
+                    	methodSchemaType = createSchemaTypeForMethodPart(getSimpleName(jMethod) + "Fault");
+                         sequence = new XmlSchemaSequence();
+                         XmlSchemaElement elt1 = new XmlSchemaElement();
+                         elt1.setName(getSimpleName(jMethod) + "Fault");
+                         elt1.setSchemaTypeName(typeTable.getQNamefortheType(Object.class.getName()));
+                         sequence.getItems().add(elt1);
+                         methodSchemaType.setParticle(sequence);
+                        */
+//                    	 begin mj
+                        JClass[] extypes = jMethod.getExceptionTypes() ;
+                        for (int j= 0 ; j < extypes.length ; j++) {
+                            JClass extype = extypes[j] ;
+                            methodSchemaType = createSchemaTypeForMethodPart(extype.getSimpleName()+ "Fault");
+                            sequence = new XmlSchemaSequence();
+                           // methodSchemaType = createSchemaTypeForMethodPart(extype.getSimpleName());
+                           // methodSchemaType.setParticle(sequence);
+                        	generateSchemaForType(sequence, extype, extype.getSimpleName());
+                            methodSchemaType.setParticle(sequence);
+                        }
+                        // end mj
+
                     }
                     uniqueMethods.put(getSimpleName(jMethod), jMethod);
                     //create the schema type for the method wrapper
@@ -351,7 +364,8 @@
             JClass sup = javaType.getSuperclass();
 
 //          AXIS2-1749 inheritance
-            if ((sup != null) && !("java.lang.Object".compareTo(sup.getQualifiedName()) == 0)) {
+            if ((sup != null) && !( "java.lang.Object".compareTo(sup.getQualifiedName()) == 0) &&
+                !("org.apache.axis2".compareTo(sup.getContainingPackage().getQualifiedName()) == 0)) {
                 String superClassName = sup.getQualifiedName();
                 String superclassname = getSimpleName(sup);
                 String tgtNamespace;
@@ -366,7 +380,13 @@
                     tgtNamespacepfx = (String)targetNamespacePrefixMap.get(tgtNamespace);
                 }
 
-                QName basetype = new QName(tgtNamespace, superclassname, tgtNamespacepfx);
+                if (tgtNamespacepfx == null) {
+                    tgtNamespacepfx = generatePrefix();
+                    targetNamespacePrefixMap.put(tgtNamespace, tgtNamespacepfx) ;
+                }
+
+                QName basetype = new QName(tgtNamespace,superclassname,tgtNamespacepfx) ;
+
 
                 complexExtension.setBaseTypeName(basetype);
                 complexExtension.setParticle(sequence);
@@ -392,6 +412,11 @@
 
             // adding this type to the table
             typeTable.addComplexSchema(name, eltOuter.getQName());
+             // adding this type's package to the table, to support inheritance.
+//          typeTable.addComplexSchema(javaType.getContainingPackage().getQualifiedName(),
+//                    eltOuter.getQName());
+
+
 
             JClass tempClass = javaType;
             Set propertiesSet = new HashSet();
@@ -510,12 +535,8 @@
                 elt1.setMaxOccurs(Long.MAX_VALUE);
                 elt1.setMinOccurs(1);
             }
-
-            if (String.class.getName().equals(propertyName)) {
-                elt1.setNillable(true);
-            }
-
-
+            if(type.isPrimitiveType() == false)
+               elt1.setNillable(true) ;
         } else {
             if (isArryType) {
                 generateSchema(type.getArrayComponentType());

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/BuilderUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/BuilderUtil.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/BuilderUtil.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/BuilderUtil.java Mon May 28 04:47:38 2007
@@ -98,6 +98,9 @@
                     String value = (String) requestParameterMap.get(key);
                     if (value != null) {
                         soapFactory.createOMElement(key, null, bodyFirstChild).setText(value);
+                         if (value != null) {
+                               soapFactory.createOMElement(key, null, bodyFirstChild).setText(value);
+                         }
                     }
 
                 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java Mon May 28 04:47:38 2007
@@ -996,6 +996,35 @@
         }
     }
 
+    public static AxisServiceGroup loadServiceGroup(File serviceFile ,
+                                                     ConfigurationContext configCtx) throws AxisFault {
+         try {
+             DeploymentFileData currentDeploymentFile = new DeploymentFileData(null, null);
+             DeploymentClassLoader classLoader = new DeploymentClassLoader(new URL[]{serviceFile.toURL()},
+                     new ArrayList(),
+                     Thread.currentThread().getContextClassLoader());
+             currentDeploymentFile.setClassLoader(classLoader);
+             AxisServiceGroup serviceGroup = new AxisServiceGroup();
+             serviceGroup.setServiceGroupClassLoader(classLoader);
+             serviceGroup.setServiceGroupName(serviceFile.getName());
+             AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
+
+             HashMap wsdlServices = new HashMap();
+             ArchiveReader archiveReader = new ArchiveReader();
+             archiveReader.processFilesInFolder(serviceFile, wsdlServices);
+             InputStream serviceXml = classLoader.getResourceAsStream("META-INF/services.xml");
+             ArrayList serviceList = archiveReader.buildServiceGroup(serviceXml,
+                     currentDeploymentFile,
+                     serviceGroup,
+                     wsdlServices, configCtx);
+             fillServiceGroup(serviceGroup, serviceList, null, axisConfig);
+             return serviceGroup;
+         } catch (Exception e) {
+             throw new DeploymentException(e);
+         }
+    }
+
+
     public File getServicesDir() {
         return servicesDir;
     }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java Mon May 28 04:47:38 2007
@@ -11,6 +11,8 @@
 import org.apache.axis2.util.Loader;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.axis2.Constants;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.i18n.Messages;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ws.java2wsdl.AnnotationConstants;
@@ -67,14 +69,11 @@
             String extension = DeploymentFileData.getFileExtension(deploymentFileData.getName());
             if (".class".equals(extension)) {
                 File file = deploymentFileData.getFile();
+                File parentFile = file.getParentFile();
                 if (file != null) {
-                    File parentFile = file.getParentFile();
                     ClassLoader classLoader =
-                            Utils.createClassLoader(new URL[]{parentFile.toURL()},
-                                    configCtx.getAxisConfiguration().getSystemClassLoader(),
-                                    true,
-                                    (File)configCtx.getAxisConfiguration()
-                                            .getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
+                           Utils.getClassLoader(configCtx.getAxisConfiguration().getSystemClassLoader(), parentFile);
+
                     Thread.currentThread().setContextClassLoader(classLoader);
                     String className = file.getName();
                     className = className.replaceAll(".class", "");
@@ -209,6 +208,7 @@
                                                       configCtx.getAxisConfiguration(),
                                                       new ArrayList(),
                                                       new ArrayList());
+                                axisService.setName(className);
                                 setMessageReceivers(axisService);
                                 axisServiceList.add(axisService);
                             }
@@ -272,6 +272,31 @@
     }
 
     public void unDeploy(String fileName) {
-    }
+        if(fileName.endsWith(".class")){
+            String className = fileName.replaceAll(".class", "");
+            try {
+                AxisServiceGroup serviceGroup =
+                        configCtx.getAxisConfiguration().removeServiceGroup(className);
+                configCtx.removeServiceGroupContext(serviceGroup);
+                log.info(Messages.getMessage(DeploymentErrorMsgs.SERVICE_REMOVED,
+                        fileName));
+            } catch (AxisFault axisFault) {
+                //May be a faulty service
+                configCtx.getAxisConfiguration().removeFaultyService(fileName);
+            }
+        } else if (fileName.endsWith(".jar")){
+            try {
+                AxisServiceGroup serviceGroup =
+                        configCtx.getAxisConfiguration().removeServiceGroup(fileName);
+                configCtx.removeServiceGroupContext(serviceGroup);
+                log.info(Messages.getMessage(DeploymentErrorMsgs.SERVICE_REMOVED,
+                        fileName));
+            } catch (AxisFault axisFault) {
+                //May be a faulty service
+                configCtx.getAxisConfiguration().removeFaultyService(fileName);
+            }
+        }
+     }
+
 }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java Mon May 28 04:47:38 2007
@@ -34,6 +34,7 @@
 import org.apache.ws.java2wsdl.utils.TypeTable;
 import org.codehaus.jam.JAnnotation;
 import org.codehaus.jam.JMethod;
+import org.codehaus.jam.JClass;
 
 import javax.xml.namespace.QName;
 import java.io.BufferedReader;
@@ -370,11 +371,21 @@
                     outMessage.setName(opName + Java2WSDLConstants.RESPONSE);
                 }
                 if (jmethod.getExceptionTypes().length > 0) {
-                    AxisMessage faultMessage = new AxisMessage();
-                    faultMessage.setName(jmethod.getSimpleName() + "Fault");
-                    faultMessage.setElementQName(
-                            table.getComplexSchemaType(jmethod.getSimpleName() + "Fault"));
-                    operation.setFaultMessages(faultMessage);
+                    JClass[] extypes = jmethod.getExceptionTypes() ;
+                    for (int j= 0 ; j < extypes.length ; j++) {
+                        AxisMessage faultMessage = new AxisMessage();
+                        JClass extype = extypes[j] ;
+                        String exname = extype.getSimpleName() ;
+                        if(extypes.length>1){
+                            faultMessage.setName(jmethod.getSimpleName() + "Fault" + j);
+                        } else{
+                            faultMessage.setName(jmethod.getSimpleName() + "Fault");
+                        }
+                        faultMessage.setElementQName(
+                                table.getComplexSchemaType(exname + "Fault"));
+                        operation.setFaultMessages(faultMessage);
+                    }
+
                 }
             } else {
                 operation = getAxisOperationforJmethod(jmethod, table);
@@ -414,11 +425,20 @@
             outMessage.setName(opName + Java2WSDLConstants.RESPONSE);
         }
         if (jmethod.getExceptionTypes().length > 0) {
-            AxisMessage faultMessage = new AxisMessage();
-            faultMessage.setName(jmethod.getSimpleName() + "Fault");
-            faultMessage
-                    .setElementQName(table.getComplexSchemaType(jmethod.getSimpleName() + "Fault"));
-            operation.setFaultMessages(faultMessage);
+            JClass[] extypes = jmethod.getExceptionTypes() ;
+            for (int j= 0 ; j < extypes.length ; j++) {
+                AxisMessage faultMessage = new AxisMessage();
+                JClass extype = extypes[j] ;
+                String exname = extype.getSimpleName() ;
+                if(extypes.length >1){
+                    faultMessage.setName(jmethod.getSimpleName() + "Fault" + j);
+                } else {
+                    faultMessage.setName(jmethod.getSimpleName() + "Fault" );
+                }
+                faultMessage.setElementQName(
+                        table.getComplexSchemaType(exname + "Fault"));
+                operation.setFaultMessages(faultMessage);
+            }
         }
         operation.setName(new QName(opName));
         AxisMessage inMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
@@ -666,4 +686,4 @@
             return new DeploymentClassLoader(urls, embedded_jars, serviceClassLoader);
         }
     }
-}
\ No newline at end of file
+}

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBinding.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBinding.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBinding.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBinding.java Mon May 28 04:47:38 2007
@@ -20,12 +20,14 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.util.PolicyUtil;
 import org.apache.axis2.util.WSDLSerializationUtil;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.soap.SOAP11Constants;
+import org.apache.neethi.Policy;
 
 import javax.xml.namespace.QName;
 import java.util.HashMap;
@@ -200,5 +202,33 @@
         }
         WSDLSerializationUtil.addWSDLDocumentationElement(this, bindingElement, omFactory, wsdl);
         return bindingElement;
+    }
+    
+    public Policy getEffectivePolicy() {
+        ArrayList policyList = new ArrayList();
+        policyList.addAll(getPolicyInclude().getAttachedPolicies());
+     
+        // AxisEndpoint
+        AxisEndpoint axisEndpoint = (AxisEndpoint) getParent();
+        
+        if (axisEndpoint != null) {
+            policyList.addAll(axisEndpoint.getPolicyInclude()
+                    .getAttachedPolicies());
+        }
+        
+        AxisService service = null;
+        
+        if (axisEndpoint != null) {
+            service = (AxisService) axisEndpoint.getParent();
+        }
+        
+        if (service != null) {
+            Policy effectivePolicy = service.getPolicyInclude().getEffectivePolicy();
+            if (effectivePolicy != null) {
+                policyList.add(effectivePolicy);
+            }
+        }
+        
+        return PolicyUtil.getMergedPolicy(policyList,  this);
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java Mon May 28 04:47:38 2007
@@ -20,6 +20,7 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.util.WSDLSerializationUtil;
+import org.apache.axis2.util.PolicyUtil;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
@@ -27,6 +28,7 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.woden.wsdl20.extensions.soap.SOAPFaultCode;
 import org.apache.woden.wsdl20.extensions.soap.SOAPFaultSubcodes;
+import org.apache.neethi.Policy;
 
 import javax.xml.namespace.QName;
 import java.util.HashMap;
@@ -122,8 +124,8 @@
      * @param nameSpaceMap - The namespacemap of the service
      * @return The generated bindingMessage element
      */
-    public OMElement toWSDL20(OMNamespace wsdl, OMNamespace tns, OMNamespace wsoap, OMNamespace whttp,
-                              Map nameSpaceMap) {
+     public OMElement toWSDL20(OMNamespace wsdl, OMNamespace tns,
+            OMNamespace wsoap, OMNamespace whttp, Map nameSpaceMap) {
         String property;
         ArrayList list;
         OMFactory omFactory = OMAbstractFactory.getOMFactory();
@@ -133,20 +135,25 @@
         if (this.isFault()) {
 
             if (this.getParent() instanceof AxisBinding) {
-                bindingMessageElement =
-                        omFactory.createOMElement(WSDL2Constants.FAULT_LOCAL_NAME, wsdl);
-            } else if (WSDLConstants.WSDL_MESSAGE_DIRECTION_IN.equals(this.getDirection())) {
-                bindingMessageElement =
-                        omFactory.createOMElement(WSDL2Constants.IN_FAULT_LOCAL_NAME, wsdl);
+               bindingMessageElement = omFactory.createOMElement(
+                        WSDL2Constants.FAULT_LOCAL_NAME, wsdl);
+            } else if (WSDLConstants.WSDL_MESSAGE_DIRECTION_IN.equals(this
+                   .getDirection())) {
+                bindingMessageElement = omFactory.createOMElement(
+                        WSDL2Constants.IN_FAULT_LOCAL_NAME, wsdl);
             } else {
-                bindingMessageElement =
-                        omFactory.createOMElement(WSDL2Constants.OUT_FAULT_LOCAL_NAME, wsdl);
+                 bindingMessageElement = omFactory.createOMElement(
+                        WSDL2Constants.OUT_FAULT_LOCAL_NAME, wsdl);
             }
             bindingMessageElement.addAttribute(omFactory.createOMAttribute(
-                    WSDL2Constants.ATTRIBUTE_REF, null, tns.getPrefix() + ":" + this.name));
+                    WSDL2Constants.ATTRIBUTE_REF, null, tns.getPrefix() + ":"
+                            + this.name));
+
             // Fault specific properties
             SOAPFaultCode faultCode = (SOAPFaultCode) this.options
                     .get(WSDL2Constants.ATTR_WSOAP_CODE);
+            property = (String) this.options
+                    .get(WSDL2Constants.ATTR_WSOAP_SUBCODES);
             if (faultCode != null && faultCode.getQName() != null) {
                 bindingMessageElement.addAttribute(omFactory.createOMAttribute(
                         WSDL2Constants.ATTRIBUTE_CODE, wsoap, faultCode.getQName().getLocalPart()));
@@ -199,5 +206,56 @@
         WSDLSerializationUtil.addWSDLDocumentationElement(this, bindingMessageElement, omFactory, wsdl);
         return bindingMessageElement;
     }
+
+    public Policy getEffectivePolicy() {
+        ArrayList policyList = new ArrayList();
+
+        PolicyInclude policyInclude;
+
+        // AxisBindingMessage policies
+        policyInclude = getPolicyInclude();
+        policyList.addAll(policyInclude.getAttachedPolicies());
+
+        // AxisBindingOperation policies
+        AxisBindingOperation axisBindingOperation = (AxisBindingOperation) getParent();
+        if (axisBindingOperation != null) {
+            policyList.add(axisBindingOperation.getPolicyInclude()
+                    .getAttachedPolicies());
+        }
+
+        // AxisBinding policies
+        AxisBinding axisBinding = null;
+        if (axisBindingOperation != null) {
+            axisBinding = (AxisBinding) axisBindingOperation.getParent();
+        }
+
+        if (axisBinding != null) {
+                policyList.addAll(axisBinding.getPolicyInclude()
+                        .getAttachedPolicies());
+        }
+
+        // AxisEndpoint
+        AxisEndpoint axisEndpoint = null;
+        if (axisBinding != null) {
+            axisEndpoint = (AxisEndpoint) axisBinding.getParent();
+        }
+
+        if (axisEndpoint != null) {
+            policyList.addAll(axisEndpoint.getPolicyInclude()
+                    .getAttachedPolicies());
+        }
+
+        // AxisMessage
+        Policy axisOperationPolicy = axisMessage.getPolicyInclude()
+                .getEffectivePolicy();
+
+        if (axisOperationPolicy != null) {
+            policyList.add(axisOperationPolicy);
+        }
+
+        return PolicyUtil.getMergedPolicy(policyList, this);
+    }
+
+
 }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingOperation.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingOperation.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisBindingOperation.java Mon May 28 04:47:38 2007
@@ -20,12 +20,14 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.util.PolicyUtil;
 import org.apache.axis2.util.WSDLSerializationUtil;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.neethi.Policy;
 
 import javax.xml.namespace.QName;
 import java.util.HashMap;
@@ -215,5 +217,42 @@
         WSDLSerializationUtil.addWSDLDocumentationElement(this, bindingOpElement, omFactory, wsdl);
         return bindingOpElement;
     }
+    
+    public Policy getEffectivePolicy() {
+        ArrayList policyList = new ArrayList();
 
+        PolicyInclude policyInclude;
+
+        // AxisBindingOperation policies
+        policyInclude = getPolicyInclude();
+        policyList.addAll(policyInclude.getAttachedPolicies());
+
+        // AxisBinding
+        AxisBinding axisBinding = (AxisBinding) getParent();
+        if (axisBinding != null) {    
+            policyList.addAll(axisBinding.getPolicyInclude()
+                    .getAttachedPolicies());
+        }
+
+        // AxisEndpoint
+        AxisEndpoint axisEndpoint = null;
+        if (axisBinding != null) {
+            axisEndpoint = (AxisEndpoint) axisBinding.getParent();
+        }
+
+        if (axisEndpoint != null) {
+            policyList.addAll(axisEndpoint.getPolicyInclude()
+                    .getAttachedPolicies());
+        }
+
+        // AxisOperation
+        Policy axisOperationPolicy = axisOperation.getPolicyInclude()
+                .getEffectivePolicy();
+        
+        if (axisOperationPolicy != null) {
+            policyList.add(axisOperationPolicy);
+        }
+        
+        return PolicyUtil.getMergedPolicy(policyList,  this);
+    }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java Mon May 28 04:47:38 2007
@@ -269,7 +269,7 @@
             return; // CHECKME: May be we need to throw an Exception ??
         }
 
-        Policy effPolicy = getPolicyInclude().getEffectivePolicy();
+        Policy effPolicy = getApplicablePolicy(this);
 
         if (effPolicy != null) {
 
@@ -407,4 +407,54 @@
 //    public abstract boolean isEngaged(QName moduleName);
 
     public abstract boolean isEngaged(String moduleName);
+
+     private Policy getApplicablePolicy(AxisDescription axisDescription) {
+
+        if (axisDescription instanceof AxisOperation) {
+            AxisOperation operation = (AxisOperation) axisDescription;
+            AxisService service = (AxisService) operation.getParent();
+
+            if (service != null) {
+
+                AxisEndpoint axisEndpoint = service.getEndpoint(service.getEndpointName());
+
+                AxisBinding axisBinding = null;
+
+                if (axisEndpoint != null) {
+                    axisBinding = axisEndpoint.getBinding();
+                }
+
+                AxisBindingOperation axisBindingOperation = null;
+
+                if (axisBinding != null) {
+                    axisBindingOperation = (AxisBindingOperation) axisBinding.getChild(operation.getName());
+                }
+
+                if (axisBindingOperation != null) {
+                    return axisBindingOperation.getEffectivePolicy();
+                }
+            }
+
+            return operation.getPolicyInclude().getEffectivePolicy();
+
+        } else if (axisDescription instanceof AxisService) {
+            AxisService service = (AxisService) axisDescription;
+
+            AxisEndpoint axisEndpoint = service.getEndpoint(service.getEndpointName());
+            AxisBinding axisBinding = null;
+
+            if (axisEndpoint != null) {
+                axisBinding = axisEndpoint.getBinding();
+            }
+
+            if (axisBinding != null) {
+                return axisBinding.getEffectivePolicy();
+            }
+
+            return service.getPolicyInclude().getEffectivePolicy();
+
+        } else {
+            return axisDescription.getPolicyInclude().getEffectivePolicy();
+        }
+    }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/OutInAxisOperation.java Mon May 28 04:47:38 2007
@@ -73,6 +73,7 @@
         } else {
             mep.put(MESSAGE_LABEL_IN_VALUE, msgContext);
             opContext.setComplete(true);
+            opContext.cleanup();
         }
     }
 
@@ -378,7 +379,7 @@
             if (responseMessageContext.getReplyTo() != null) {
                 sc.setTargetEPR(responseMessageContext.getReplyTo());
             }
-            if (resenvelope.getBody().hasFault()) {
+             if (resenvelope.getBody().hasFault()||responseMessageContext.isProcessingFault()) {
                 if (options.isExceptionToBeThrownOnSOAPFault()) {
                     // does the SOAPFault has a detail element for Excpetion
                     throw Utils.getInboundFaultFromMessageContext(responseMessageContext);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/PolicyInclude.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/PolicyInclude.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/PolicyInclude.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/PolicyInclude.java Mon May 28 04:47:38 2007
@@ -25,6 +25,7 @@
 import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.List;
 
 public class PolicyInclude {
 
@@ -294,5 +295,16 @@
 
     public void removeAllPolicyElements() {
         wrapperElements.clear();
+    }
+    
+    public List getAttachedPolicies() {
+    
+        ArrayList  arrayList = new ArrayList();
+        
+        for (Iterator iterator = wrapperElements.values().iterator(); iterator.hasNext();) {
+            arrayList.add(((Wrapper) iterator.next()).value);
+        }
+        
+        return arrayList;
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/RobustOutOnlyAxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/RobustOutOnlyAxisOperation.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/RobustOutOnlyAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/RobustOutOnlyAxisOperation.java Mon May 28 04:47:38 2007
@@ -101,9 +101,9 @@
                 responseMessageContext.setEnvelope(envelope);
             }
             if (envelope != null) {
-                if (envelope.getBody().hasFault()) {
+                if (envelope.getBody().hasFault()|| responseMessageContext.isProcessingFault()) {
                     //receiving a fault
-                    engine.receive(responseMessageContext);
+                    AxisEngine.receive(responseMessageContext);
                     throw Utils.getInboundFaultFromMessageContext(responseMessageContext);
                 }
             }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Mon May 28 04:47:38 2007
@@ -277,7 +277,12 @@
 
             axisService.setName(wsdl4jService.getQName().getLocalPart());
             populateEndpoints(binding, wsdl4jService);
+            processPoliciesInDefintion(wsdl4jDefinition);
+            axisService.getPolicyInclude().setPolicyRegistry(registry);
 
+
+            processPoliciesInDefintion(wsdl4jDefinition);
+            axisService.getPolicyInclude().setPolicyRegistry(registry);
             return axisService;
         } catch (WSDLException e) {
             log.error(e);
@@ -336,6 +341,8 @@
                     } else {
                         populateEndpoint(axisEndpoint, port, false);
                     }
+                    
+                    axisEndpoint.setParent(axisService);
                     axisService.addEndpoint(port.getName(), axisEndpoint);
                 }
             }
@@ -364,11 +371,10 @@
         Binding wsdl4jBinding = wsdl4jDefinition.getBinding(wsdl4jPort.getBinding().getQName());
 
         axisBinding.setName(wsdl4jBinding.getQName());
+        axisBinding.setParent(axisEndpoint);
         axisEndpoint.setBinding(axisBinding);
         addDocumentation(axisEndpoint, wsdl4jPort.getDocumentationElement());
         populateBinding(axisBinding, wsdl4jBinding, isSetMessageQNames);
-
-
     }
 
     private void populatePortType(PortType wsdl4jPortType) throws AxisFault {
@@ -534,7 +540,8 @@
                     addQNameReference(faultMessage, wsdl4jFault.getMessage());
                 }
             }
-
+            
+            axisBindingOperation.setParent(axisBinding);
             axisBinding.addChild(axisBindingOperation.getName(), axisBindingOperation);
         }
         axisBinding.setProperty(WSDL2Constants.HTTP_LOCATION_TABLE, httpLocationMap);
@@ -565,15 +572,10 @@
         // process the imports
         WSDL4JImportedWSDLHelper.processImports(wsdl4jDefinition, new ArrayList());
 
-        // Adding the policies in the Definition to the the PolicyRegistry
-        processPoliciesInDefintion(wsdl4jDefinition);
-
         // setup the schemaMap
         schemaMap = getSchemaMap(wsdl4jDefinition.getTypes());
         
-        
         setPolicyRegistryFromService(axisService);
-        processPoliciesInDefintion(wsdl4jDefinition);
         
         setupComplete = true; // if any part of setup fails, don't mark
         // setupComplete        
@@ -2149,50 +2151,34 @@
     private int getPolicyAttachmentPoint(AxisDescription description,
                                          String originOfExtensibilityElements) {
         int result = -1; // Attachment Point Not Identified
-        if (description instanceof AxisService || description instanceof AxisEndpoint || description instanceof AxisBinding) {
-            // wsdl:service
-            if (SERVICE.equals(originOfExtensibilityElements)) {
-                result = PolicyInclude.SERVICE_POLICY;
-                // wsdl:service -> wsdl:port
-            } else if (PORT.equals(originOfExtensibilityElements)) {
-                result = PolicyInclude.PORT_POLICY;
-                // wsdl:binding
-            } else if (BINDING.equals(originOfExtensibilityElements)) {
-                result = PolicyInclude.BINDING_POLICY;
-            }
-            // TODO policy for wsdl:portType ?
-        } else if (description instanceof AxisOperation) {
-            // wsdl:portType -> wsdl:operation
-            if (PORT_TYPE_OPERATION.equals(originOfExtensibilityElements)) {
-                result = PolicyInclude.OPERATION_POLICY;
-                // wsdl:binding -> wsdl:operation
-            } else {
-                result = PolicyInclude.BINDING_POLICY;
-            }
-        } else {
-            // wsdl:portType -> wsdl:operation -> wsdl:input
-
-            if (PORT_TYPE_OPERATION_INPUT.equals(originOfExtensibilityElements)) {
-                result = PolicyInclude.INPUT_POLICY;
-                // wsdl:binding -> wsdl:operation -> wsdl:input
-            } else if (BINDING_OPERATION_INPUT
-                    .equals(originOfExtensibilityElements)) {
-                result = PolicyInclude.BINDING_INPUT_POLICY;
-                // wsdl:portType -> wsdl:operation -> wsdl:put
-            } else if (PORT_TYPE_OPERATION_OUTPUT
-                    .equals(originOfExtensibilityElements)) {
-                result = PolicyInclude.OUTPUT_POLICY;
-                // wsdl:binding -> wsdl:operation -> wsdl:output
-            } else if (BINDING_OPERATION_OUTPUT
-                    .equals(originOfExtensibilityElements)) {
-                result = PolicyInclude.BINDING_OUTPUT_POLICY;
-            }
-            // TODO Faults ..
-        }
+        
+        if (SERVICE.equals(originOfExtensibilityElements)) {
+            result = PolicyInclude.SERVICE_POLICY;
+        } else if (PORT.equals(originOfExtensibilityElements)) {
+            result = PolicyInclude.PORT_POLICY;
+        } else if (BINDING.equals(originOfExtensibilityElements)) {
+            result = PolicyInclude.BINDING_POLICY;
+        } else if (BINDING_OPERATION.equals(originOfExtensibilityElements)) {
+            result = PolicyInclude.BINDING_OPERATION_POLICY;
+        } else if (BINDING_OPERATION_INPUT.equals(originOfExtensibilityElements)) {
+            result = PolicyInclude.BINDING_INPUT_POLICY;
+        } else if (BINDING_OPERATION_OUTPUT.equals(originOfExtensibilityElements)) {
+            result = PolicyInclude.BINDING_OUTPUT_POLICY;
+        } else if (PORT_TYPE.equals(originOfExtensibilityElements)) {
+            result = PolicyInclude.PORT_TYPE_POLICY;
+        } else if (PORT_TYPE_OPERATION.equals(originOfExtensibilityElements)) {
+            result = PolicyInclude.OPERATION_POLICY;
+        } else if (PORT_TYPE_OPERATION_INPUT.equals(originOfExtensibilityElements)) {
+            result = PolicyInclude.INPUT_POLICY;
+        } else if (PORT_TYPE_OPERATION_OUTPUT.equals(originOfExtensibilityElements)) {
+            result = PolicyInclude.OUTPUT_POLICY;
+        } 
+        
         if (isTraceEnabled) {
             log.trace("getPolicyAttachmentPoint:: axisDescription=" + description +
                     " extensibilityPoint=" + originOfExtensibilityElements + " result=" + result);
         }
+        
         return result;
     }
 
@@ -2401,6 +2387,7 @@
                     if ((key = policy.getName()) != null
                             || (key = policy.getId()) != null) {
                         registry.register(key, policy);
+                        registry.register("#" + key, policy);
                     }
 
                 }
@@ -2447,4 +2434,4 @@
 //            }
 //        }
 //    }
-}
\ No newline at end of file
+}

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java Mon May 28 04:47:38 2007
@@ -69,7 +69,7 @@
                 log.debug(msgctx.getLogIDString() + " " + Messages.getMessage("checkingrelatesto",
                                                                               relatesTo));
             }
-            if (relatesTo != null && !"".equals(relatesTo)) {
+            if (relatesTo != null && !"".equals(relatesTo) && (msgctx.getOperationContext()==null)) {
                 OperationContext operationContext =
                         msgctx.getConfigurationContext()
                                 .getOperationContext(relatesTo);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java Mon May 28 04:47:38 2007
@@ -115,7 +115,7 @@
         }
         ConfigurationContext confContext = msgContext.getConfigurationContext();
         ArrayList preCalculatedPhases;
-        if (msgContext.isFault()) {
+        if (msgContext.isFault()|| msgContext.isProcessingFault()) {
             preCalculatedPhases = confContext.getAxisConfiguration().getInFaultFlowPhases();
             msgContext.setFLOW(MessageContext.IN_FAULT_FLOW);
         } else {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java Mon May 28 04:47:38 2007
@@ -606,7 +606,6 @@
                                new ServletBasedOutTransportInfo(response));
         // set the transport Headers
         msgContext.setProperty(MessageContext.TRANSPORT_HEADERS, getTransportHeaders(request));
-        msgContext.setServiceGroupContextId(UUIDGenerator.getUUID());
         msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST, request);
         msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE, response);
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPSender.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPSender.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPSender.java Mon May 28 04:47:38 2007
@@ -19,7 +19,9 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.transport.MessageFormatter;
 import org.apache.axis2.transport.TransportUtils;
@@ -267,7 +269,14 @@
             if (contenttypeHeader != null) {
                 value = contenttypeHeader.getValue();
             }
-
+             OperationContext opContext = msgContext.getOperationContext();
+            if(opContext!=null){
+                MessageContext inMessageContext =
+                        opContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+                if(inMessageContext!=null){
+                    inMessageContext.setProcessingFault(true);
+                }
+            }
             if (value != null) {
 
                 processResponse(method, msgContext);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/SimpleHTTPServer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/SimpleHTTPServer.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/SimpleHTTPServer.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/SimpleHTTPServer.java Mon May 28 04:47:38 2007
@@ -56,6 +56,7 @@
      * Embedded commons http core based server
      */
     SimpleHttpServer embedded = null;
+    private String localAddress;
     int port = -1;
 
     public static int DEFAULT_PORT = 8080;
@@ -257,21 +258,25 @@
             }
         }
         //if the host address is not present
-        String localAddress;
+        String ipAddress;
         if (ip != null) {
-            localAddress = ip;
+            ipAddress = ip;
         } else {
             try {
-                localAddress = HttpUtils.getIpAddress();
-                if (localAddress == null) {
-                    localAddress = "127.0.0.1";
+                if(localAddress==null){
+                    localAddress = HttpUtils.getIpAddress();
                 }
+                if (localAddress == null) {
+                   ipAddress = "127.0.0.1";
+                 } else {
+                    ipAddress = localAddress;
+                 }
             } catch (SocketException e) {
                 throw AxisFault.makeFault(e);
             }
         }
         if (embedded != null) {
-            return new EndpointReference[]{new EndpointReference("http://" + localAddress + ":" +
+            return new EndpointReference[]{new EndpointReference("http://" + ipAddress + ":" +
                                                                  (embedded.getPort())
                                                                  + "/" + configurationContext.getServiceContextPath() + "/" + serviceName)};
         } else {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/URLTemplatingUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/URLTemplatingUtil.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/URLTemplatingUtil.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/util/URLTemplatingUtil.java Mon May 28 04:47:38 2007
@@ -223,7 +223,12 @@
                 if (replacedQuery.charAt(0) == '?') {
                     appendedURI = new URI(targetURL.toString () + replacedQuery);
                 } else {
-                    targetURI = new URI(targetURL.toString() + "/");
+                     String uriString = targetURL.toString();
+                    if (!uriString.endsWith("/")) {
+                    targetURI = new URI(uriString + "/");
+                    } else {
+                        targetURI = new URI(uriString);
+                    }
                     appendedURI = targetURI.resolve(replacedQuery);
                 }
                 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSMessageReceiver.java Mon May 28 04:47:38 2007
@@ -172,7 +172,6 @@
                                                            message.getJMSReplyTo()));
 
             msgContext.setServerSide(true);
-            msgContext.setServiceGroupContextId(UUIDGenerator.getUUID());
             msgContext.setMessageID(message.getJMSMessageID());
 
             Destination replyTo = message.getJMSReplyTo();

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/Constants.java?view=diff&rev=542211&r1=542210&r2=542211
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/Constants.java Mon May 28 04:47:38 2007
@@ -80,4 +80,6 @@
     public static final String MAIL_SYNC = "_MAIL_SYNC_";
     public static final String IN_REPLY_TO = "In-Reply-To";
     public static final String MAILTO = "mailto";
+    public static final String MAPPING_TABLE = "mappingTable";
+    public static final String CALLBACK_TABLE = "callbackTable";
 }



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