axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r413867 - in /webservices/axis2/trunk/java/modules: codegen/src/org/apache/axis2/wsdl/codegen/emitter/ codegen/src/org/apache/axis2/wsdl/template/c/ codegen/src/org/apache/axis2/wsdl/template/general/ codegen/src/org/apache/axis2/wsdl/templ...
Date Tue, 13 Jun 2006 11:04:52 GMT
Author: chinthaka
Date: Tue Jun 13 04:04:51 2006
New Revision: 413867

URL: http://svn.apache.org/viewvc?rev=413867&view=rev
Log:
making templates to work on MEP constants rather than on URIs as we have two sets of MEP uris
with the introduction of WSDL 2.0.

Modified:
    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/c/StubHeaderTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/general/ServiceXMLTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java

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?rev=413867&r1=413866&r2=413867&view=diff
==============================================================================
--- 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
Tue Jun 13 04:04:51 2006
@@ -8,6 +8,7 @@
 import org.apache.axis2.namespace.Constants;
 import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.util.PolicyUtil;
+import org.apache.axis2.util.Utils;
 import org.apache.axis2.util.XSLTUtils;
 import org.apache.axis2.wsdl.SOAPHeaderMessage;
 import org.apache.axis2.wsdl.WSDL20Constants;
@@ -93,8 +94,8 @@
     protected static final String FAULT_SUFFIX = "Exception";
     protected static final String DATABINDING_SUPPORTER_NAME_SUFFIX = "DatabindingSupporter";
 
-    protected static Map MEPtoClassMap;
-    protected static Map MEPtoSuffixMap;
+    protected static Map mepToClassMap;
+    protected static Map mepToSuffixMap;
 
     protected int uniqueFaultNameCounter = 0;
     /**
@@ -133,14 +134,18 @@
                 "new javax.xml.namespace.QName(\"http://foo\", \"bar\")");
 
         //populate the MEP -> class map
-        MEPtoClassMap = new HashMap();
-        MEPtoClassMap.put(WSDLConstants.MEP_URI_IN_ONLY, "org.apache.axis2.receivers.AbstractInMessageReceiver");
-        MEPtoClassMap.put(WSDLConstants.MEP_URI_IN_OUT, "org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver");
+        mepToClassMap = new HashMap();
+        mepToClassMap.put(WSDLConstants.MEP_URI_IN_ONLY, "org.apache.axis2.receivers.AbstractInMessageReceiver");
+        mepToClassMap.put(WSDL20Constants.MEP_URI_IN_ONLY, "org.apache.axis2.receivers.AbstractInMessageReceiver");
+        mepToClassMap.put(WSDLConstants.MEP_URI_IN_OUT, "org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver");
+        mepToClassMap.put(WSDL20Constants.MEP_URI_IN_OUT, "org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver");
 
         //populate the MEP -> suffix map
-        MEPtoSuffixMap = new HashMap();
-        MEPtoSuffixMap.put(WSDLConstants.MEP_URI_IN_ONLY, MESSAGE_RECEIVER_SUFFIX + "InOnly");
-        MEPtoSuffixMap.put(WSDLConstants.MEP_URI_IN_OUT, MESSAGE_RECEIVER_SUFFIX + "InOut");
+        mepToSuffixMap = new HashMap();
+        mepToSuffixMap.put(WSDLConstants.MEP_URI_IN_ONLY, MESSAGE_RECEIVER_SUFFIX + "InOnly");
+        mepToSuffixMap.put(WSDL20Constants.MEP_URI_IN_ONLY, MESSAGE_RECEIVER_SUFFIX + "InOnly");
+        mepToSuffixMap.put(WSDLConstants.MEP_URI_IN_OUT, MESSAGE_RECEIVER_SUFFIX + "InOut");
+        mepToSuffixMap.put(WSDL20Constants.MEP_URI_IN_OUT, MESSAGE_RECEIVER_SUFFIX + "InOut");
         //register the other types as necessary
     }
 
@@ -467,7 +472,7 @@
         rootElement.appendChild(getUniqueListofFaults(doc));
 
         /////////////////////////////////////////////////////
-        //System.out.println(DOM2Writer.nodeToString(rootElement));
+//        System.out.println(DOM2Writer.nodeToString(rootElement));
         /////////////////////////////////////////////////////
 
 
@@ -727,7 +732,7 @@
 
         //for the server side codegen
         //we need to serialize the WSDL's
-//        writeWSDLFiles();
+        writeWSDLFiles();
     }
 
     /**
@@ -827,7 +832,7 @@
 
         if (codeGenConfiguration.isWriteMessageReceiver()) {
             //loop through the meps and generate code for each mep
-            Iterator it = MEPtoClassMap.keySet().iterator();
+            Iterator it = mepToClassMap.keySet().iterator();
             while (it.hasNext()) {
                 String mep = (String) it.next();
                 Document classModel = createDocumentForMessageReceiver(
@@ -855,7 +860,7 @@
 
         String localPart = makeJavaClassName(axisService.getName());
 
-        addAttribute(doc, "name", localPart + MEPtoSuffixMap.get(mep), rootElement);
+        addAttribute(doc, "name", localPart + mepToSuffixMap.get(mep), rootElement);
         addAttribute(doc, "skeletonname", localPart + SKELETON_CLASS_SUFFIX, rootElement);
         if (isServerSideInterface){
             addAttribute(doc, "skeletonInterfaceName", localPart + SKELETON_INTERFACE_SUFFIX,
@@ -864,7 +869,8 @@
             addAttribute(doc, "skeletonInterfaceName", localPart + SKELETON_CLASS_SUFFIX,
                     rootElement);
         }
-        addAttribute(doc, "basereceiver", (String) MEPtoClassMap.get(mep), rootElement);
+        addAttribute(doc, "basereceiver", (String) mepToClassMap.get(mep), rootElement);
+
         fillSyncAttributes(doc, rootElement);
 
         // ###########################################################################################
@@ -891,7 +897,7 @@
         doc.appendChild(rootElement);
 
         //////////////////////////////////
-        //System.out.println(DOM2Writer.nodeToString(rootElement));
+//        System.out.println(DOM2Writer.nodeToString(rootElement));
         ////////////////////////////////
         return doc;
     }
@@ -1103,19 +1109,21 @@
         }
         addAttribute(doc, "servicename", serviceName, rootElement);
 
-        Iterator it = MEPtoClassMap.keySet().iterator();
+        Iterator it = mepToClassMap.keySet().iterator();
         while (it.hasNext()) {
             Object key = it.next();
 
             if (Boolean.TRUE.equals(infoHolder.get(key))) {
-                Element elt = addElement(doc, "messagereceiver", className + MEPtoSuffixMap.get(key),
rootElement);
-                addAttribute(doc, "mep", key.toString(), elt);
+                Element elt = addElement(doc, "messagereceiver", className + mepToSuffixMap.get(key),
rootElement);
+                addAttribute(doc, "mepURI", key.toString(), elt);
             }
 
         }
 
         loadOperations(doc, rootElement, null);
 
+        System.out.println(DOM2Writer.nodeToString(rootElement));
+
         return rootElement;
     }
 
@@ -1162,7 +1170,7 @@
         //attach a list of faults
         rootElement.appendChild(getUniqueListofFaults(doc));
 
-        System.out.println(DOM2Writer.nodeToString(rootElement));
+//        System.out.println(DOM2Writer.nodeToString(rootElement));
 
         doc.appendChild(rootElement);
         return doc;
@@ -1225,7 +1233,10 @@
                 addAttribute(doc, "dbsupportname", portTypeName + localPart + DATABINDING_SUPPORTER_NAME_SUFFIX,
                         methodElement);
 
-                addAttribute(doc, "mep", axisOperation.getMessageExchangePattern(), methodElement);
+
+                addAttribute(doc, "mep", Utils.getAxisSpecifMEPConstant(axisOperation.getMessageExchangePattern())
+ "" , methodElement);
+                addAttribute(doc, "mepURI", axisOperation.getMessageExchangePattern(), methodElement);
+
 
                 addSOAPAction(doc, methodElement, axisOperation);
                 //add header ops for input
@@ -1261,7 +1272,8 @@
                     addAttribute(doc, "dbsupportname", portTypeName + localPart + DATABINDING_SUPPORTER_NAME_SUFFIX,
                             methodElement);
 
-                    addAttribute(doc, "mep", axisOperation.getMessageExchangePattern(), methodElement);
+                    addAttribute(doc, "mep", Utils.getAxisSpecifMEPConstant(axisOperation.getMessageExchangePattern())
+ "", methodElement);
+                    addAttribute(doc, "mepURI", axisOperation.getMessageExchangePattern(),
methodElement);
 
 
                     addSOAPAction(doc, methodElement, axisOperation);

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl?rev=413867&r1=413866&r2=413867&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl
Tue Jun 13 04:04:51 2006
@@ -75,7 +75,7 @@
         <xsl:if test="$isAsync='1'">
         <xsl:for-each select="method">
         <xsl:variable name="mep"><xsl:value-of select="@mep"/></xsl:variable>
-        <xsl:if test="$mep='http://www.w3.org/2004/08/wsdl/in-out'">
+        <xsl:if test="$mep='12'"> <!-- These constants can be found in org.apache.axis2.wsdl.WSDLConstants
-->
         void axis2_start_<xsl:value-of select="@name"/>( axis2_stub_t* stub, axis2_env_t**
env, <xsl:for-each select="input/param[@type!='']">
                                                     axis2_om_node_t*<xsl:text> </xsl:text>payload<!--<xsl:value-of
select="@name"></xsl:value-of>--> ,
                                                     </xsl:for-each>

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl?rev=413867&r1=413866&r2=413867&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl
Tue Jun 13 04:04:51 2006
@@ -74,7 +74,7 @@
                                           NULL);
             op = axis2_op_create_with_qname(env, op_qname);
             <xsl:choose>
-              <xsl:when test="@mep='http://www.w3.org/2004/08/wsdl/in-only'">
+              <xsl:when test="@mep='12'">
                 AXIS2_OP_SET_MSG_EXCHANGE_PATTERN(op, env, AXIS2_MEP_URI_IN_ONLY);
               </xsl:when>
               <xsl:otherwise>
@@ -121,7 +121,7 @@
       <!-- MTOM -->
 
       <!-- Code generation for the in-out mep -->
-      <xsl:if test="$mep='http://www.w3.org/2004/08/wsdl/in-out'">
+      <xsl:if test="$mep='12'"> <!-- These constants can be found in org.apache.axis2.wsdl.WSDLConstants
-->
         <xsl:if test="$isSync='1'">
           /**
            * Auto generated method signature
@@ -234,7 +234,7 @@
                 <!-- End of in-out mep -->
          </xsl:if> <!-- close for  test="$mep='http://www.w3.org/2004/08/wsdl/in-out'
-->
 
-         <xsl:if test="$mep='http://www.w3.org/2004/08/wsdl/in-only'">
+         <xsl:if test="$mep='10'">  <!-- These constants can be found in org.apache.axis2.wsdl.WSDLConstants
-->
           /**
            * Auto generated method signature
            */

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/general/ServiceXMLTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/general/ServiceXMLTemplate.xsl?rev=413867&r1=413866&r2=413867&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/general/ServiceXMLTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/general/ServiceXMLTemplate.xsl
Tue Jun 13 04:04:51 2006
@@ -18,7 +18,7 @@
                 <xsl:for-each select="messagereceiver">
                     <xsl:if test=".">
                         <messageReceiver>
-                            <xsl:attribute name="mep"><xsl:value-of select="@mep"/></xsl:attribute>
+                            <xsl:attribute name="mep"><xsl:value-of select="@mepURI"/></xsl:attribute>
                             <xsl:choose>
                                 <xsl:when test="$package=''">
                                     <xsl:attribute name="class"><xsl:value-of select="."/></xsl:attribute>
@@ -45,7 +45,7 @@
 			<xsl:for-each select="method">
 				<operation>
 					<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
-					<xsl:attribute name="mep"><xsl:value-of select="@mep"/></xsl:attribute>
+					<xsl:attribute name="mep"><xsl:value-of select="@mepURI"/></xsl:attribute>
 					<actionMapping>
 						<xsl:value-of select="@soapaction"/>
 					</actionMapping>

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl?rev=413867&r1=413866&r2=413867&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl
Tue Jun 13 04:04:51 2006
@@ -45,7 +45,7 @@
             <xsl:choose>
                 <!-- Code generation for in-out only. Need to consider the other meps
also
                     They should be parts of this xsl:choose loop -->
-                <xsl:when test="$mep='http://www.w3.org/2004/08/wsdl/in-out'">
+                <xsl:when test="$mep='12'">
            /**
             * auto generated Axis2 call back method for <xsl:value-of select="@name"/>
method
             *

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?rev=413867&r1=413866&r2=413867&view=diff
==============================================================================
--- 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
Tue Jun 13 04:04:51 2006
@@ -72,7 +72,7 @@
         _operations = new org.apache.axis2.description.AxisOperation[<xsl:value-of select="count(method)"/>];
         <xsl:for-each select="method">
             <xsl:choose>
-                <xsl:when test="@mep='http://www.w3.org/2004/08/wsdl/in-only'">
+                <xsl:when test="@mep='10'">
                     __operation = new org.apache.axis2.description.OutOnlyAxisOperation();
                 </xsl:when>
                 <xsl:otherwise>
@@ -217,7 +217,7 @@
 	    <!-- MTOM -->
 
             <!-- Code generation for the in-out mep -->
-            <xsl:if test="$mep='http://www.w3.org/2004/08/wsdl/in-out'">
+            <xsl:if test="$mep='12'">  <!-- These constants can be found in org.apache.axis2.wsdl.WSDLConstants
-->
                 <xsl:if test="$isSync='1'">
                     /**
                     * Auto generated method signature
@@ -512,7 +512,7 @@
                 <!-- End of in-out mep -->
             </xsl:if>
             <!-- Start of in only mep-->
-            <xsl:if test="$mep='http://www.w3.org/2004/08/wsdl/in-only'">
+            <xsl:if test="$mep='10'"> <!-- 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 -->
                 public void <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
                 <xsl:for-each select="input/param[@type!='']">

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl?rev=413867&r1=413866&r2=413867&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
Tue Jun 13 04:04:51 2006
@@ -31,7 +31,7 @@
     public interface <xsl:value-of select="@name"></xsl:value-of> {
  		 <xsl:for-each select="method">
 		    <!-- Code for in-out mep -->
-         <xsl:if test="@mep='http://www.w3.org/2004/08/wsdl/in-out'">
+         <xsl:if test="@mep='12'">
          <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
 
         <!-- start of the sync block -->                                          
@@ -65,7 +65,7 @@
 
      </xsl:if>
         <!-- Code for in-only mep -->
-       <xsl:if test="@mep='http://www.w3.org/2004/08/wsdl/in-only'">
+       <xsl:if test="@mep='10'">
 
        <!-- For in-only meps there would not be any asynchronous methods since there is
no output -->
          /**

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl?rev=413867&r1=413866&r2=413867&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
Tue Jun 13 04:04:51 2006
@@ -27,7 +27,7 @@
     public class <xsl:value-of select="@name"/> extends junit.framework.TestCase{
 
      <xsl:for-each select="method">
-         <xsl:if test="@mep='http://www.w3.org/2004/08/wsdl/in-out'">
+         <xsl:if test="@mep='12'">
           <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
           <xsl:if test="$isSync='1'">
         /**
@@ -130,7 +130,7 @@
       <!-- end of in-out mep -->
       </xsl:if>
       <!-- start of in-only mep-->
-      <xsl:if test="@mep='http://www.w3.org/2004/08/wsdl/in-only'">
+      <xsl:if test="@mep='10'">
           /**
           * Auto generated test method
           */

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java?rev=413867&r1=413866&r2=413867&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisOperation.java
Tue Jun 13 04:04:51 2006
@@ -29,6 +29,7 @@
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.modules.Module;
 import org.apache.axis2.phaseresolver.PhaseResolver;
+import org.apache.axis2.wsdl.WSDL20Constants;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -373,21 +374,22 @@
 
         int temp = MEP_CONSTANT_INVALID;
 
-        if (MEP_URI_IN_OUT.equals(getMessageExchangePattern())) {
+        String messageExchangePattern = getMessageExchangePattern();
+        if (MEP_URI_IN_OUT.equals(messageExchangePattern) || WSDL20Constants.MEP_URI_IN_OUT.equals(messageExchangePattern))
{
             temp = MEP_CONSTANT_IN_OUT;
-        } else if (MEP_URI_IN_ONLY.equals(getMessageExchangePattern())) {
+        } else if (MEP_URI_IN_ONLY.equals(messageExchangePattern) || WSDL20Constants.MEP_URI_IN_ONLY.equals(messageExchangePattern))
{
             temp = MEP_CONSTANT_IN_ONLY;
-        } else if (MEP_URI_IN_OPTIONAL_OUT.equals(getMessageExchangePattern())) {
+        } else if (MEP_URI_IN_OPTIONAL_OUT.equals(messageExchangePattern) || WSDL20Constants.MEP_URI_IN_OPTIONAL_OUT.equals(messageExchangePattern))
{
             temp = MEP_CONSTANT_IN_OPTIONAL_OUT;
-        } else if (MEP_URI_OUT_IN.equals(getMessageExchangePattern())) {
+        } else if (MEP_URI_OUT_IN.equals(messageExchangePattern) || WSDL20Constants.MEP_URI_OUT_IN.equals(messageExchangePattern))
{
             temp = MEP_CONSTANT_OUT_IN;
-        } else if (MEP_URI_OUT_ONLY.equals(getMessageExchangePattern())) {
+        } else if (MEP_URI_OUT_ONLY.equals(messageExchangePattern) || WSDL20Constants.MEP_URI_OUT_ONLY.equals(messageExchangePattern))
{
             temp = MEP_CONSTANT_OUT_ONLY;
-        } else if (MEP_URI_OUT_OPTIONAL_IN.equals(getMessageExchangePattern())) {
+        } else if (MEP_URI_OUT_OPTIONAL_IN.equals(messageExchangePattern) || WSDL20Constants.MEP_URI_OUT_OPTIONAL_IN.equals(messageExchangePattern))
{
             temp = MEP_CONSTANT_OUT_OPTIONAL_IN;
-        } else if (MEP_URI_ROBUST_IN_ONLY.equals(getMessageExchangePattern())) {
+        } else if (MEP_URI_ROBUST_IN_ONLY.equals(messageExchangePattern) || WSDL20Constants.MEP_URI_ROBUST_IN_ONLY.equals(messageExchangePattern))
{
             temp = MEP_CONSTANT_ROBUST_IN_ONLY;
-        } else if (MEP_URI_ROBUST_OUT_ONLY.equals(getMessageExchangePattern())) {
+        } else if (MEP_URI_ROBUST_OUT_ONLY.equals(messageExchangePattern) || WSDL20Constants.MEP_URI_ROBUST_OUT_ONLY.equals(messageExchangePattern))
{
             temp = MEP_CONSTANT_ROBUST_OUT_ONLY;
         }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java?rev=413867&r1=413866&r2=413867&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java Tue Jun
13 04:04:51 2006
@@ -18,20 +18,40 @@
 package org.apache.axis2.util;
 
 import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.soap.*;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPFaultCode;
+import org.apache.axiom.soap.SOAPFaultSubCode;
+import org.apache.axiom.soap.SOAPFaultValue;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.addressing.RelatesTo;
 import org.apache.axis2.client.Options;
-import org.apache.axis2.context.*;
-import org.apache.axis2.description.*;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.axis2.description.AxisModule;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.AxisServiceGroup;
+import org.apache.axis2.description.Flow;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.description.InOutAxisOperation;
+import org.apache.axis2.description.OutInAxisOperation;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.PhaseRule;
 import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.engine.AxisError;
 import org.apache.axis2.engine.Handler;
 import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.receivers.AbstractMessageReceiver;
 import org.apache.axis2.receivers.RawXMLINOutMessageReceiver;
+import org.apache.axis2.wsdl.WSDL20Constants;
 import org.apache.axis2.wsdl.WSDLConstants;
 
 import javax.xml.namespace.QName;
@@ -362,4 +382,41 @@
         }
         return false;
     }
+
+    /**
+         * Maps the String URI of the Message exchange pattern to a integer.
+         * Further, in the first lookup, it will cache the looked
+         * up value so that the subsequent method calls are extremely efficient.
+         */
+        public static int getAxisSpecifMEPConstant(String messageExchangePattern) {
+
+
+            int mepConstant = WSDLConstants.MEP_CONSTANT_INVALID;
+
+            if (WSDLConstants.MEP_URI_IN_OUT.equals(messageExchangePattern) || WSDL20Constants.MEP_URI_IN_OUT.equals(messageExchangePattern))
{
+                mepConstant = WSDLConstants.MEP_CONSTANT_IN_OUT;
+            } else if (WSDLConstants.MEP_URI_IN_ONLY.equals(messageExchangePattern) || WSDL20Constants.MEP_URI_IN_ONLY.equals(messageExchangePattern))
{
+                mepConstant = WSDLConstants.MEP_CONSTANT_IN_ONLY;
+            } else if (WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(messageExchangePattern)
|| WSDL20Constants.MEP_URI_IN_OPTIONAL_OUT.equals(messageExchangePattern)) {
+                mepConstant = WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT;
+            } else if (WSDLConstants.MEP_URI_OUT_IN.equals(messageExchangePattern) || WSDL20Constants.MEP_URI_OUT_IN.equals(messageExchangePattern))
{
+                mepConstant = WSDLConstants.MEP_CONSTANT_OUT_IN;
+            } else if (WSDLConstants.MEP_URI_OUT_ONLY.equals(messageExchangePattern) || WSDL20Constants.MEP_URI_OUT_ONLY.equals(messageExchangePattern))
{
+                mepConstant = WSDLConstants.MEP_CONSTANT_OUT_ONLY;
+            } else if (WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(messageExchangePattern)
|| WSDL20Constants.MEP_URI_OUT_OPTIONAL_IN.equals(messageExchangePattern)) {
+                mepConstant = WSDLConstants.MEP_CONSTANT_OUT_OPTIONAL_IN;
+            } else if (WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(messageExchangePattern)
|| WSDL20Constants.MEP_URI_ROBUST_IN_ONLY.equals(messageExchangePattern)) {
+                mepConstant = WSDLConstants.MEP_CONSTANT_ROBUST_IN_ONLY;
+            } else if (WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(messageExchangePattern)
|| WSDL20Constants.MEP_URI_ROBUST_OUT_ONLY.equals(messageExchangePattern)) {
+                mepConstant = WSDLConstants.MEP_CONSTANT_ROBUST_OUT_ONLY;
+            }
+
+            if (mepConstant == WSDLConstants.MEP_CONSTANT_INVALID) {
+                throw new AxisError(Messages.getMessage("mepmappingerror"));
+            }
+
+
+            return mepConstant;
+        }
+
 }



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


Mime
View raw message