axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r552745 - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/rpc/receivers/ kernel/src/org/apache/axis2/deployment/ kernel/src/org/apache/axis2/deployment/util/ kernel/src/org/apache/axis2/description/ kernel/src/org/apache/...
Date Tue, 03 Jul 2007 08:51:16 GMT
Author: deepal
Date: Tue Jul  3 01:51:14 2007
New Revision: 552745

URL: http://svn.apache.org/viewvc?view=rev&rev=552745
Log:
fixing AXIS2-1720
 - if the java method is void and it has a exception then we generate robust-in operation
for that
 -in wsdl1.1 we generate in , out and fault messages

And  AXIS2-2889

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCInOutAsyncMessageReceiver.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.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/ServiceBuilder.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/AxisService.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCInOutAsyncMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCInOutAsyncMessageReceiver.java?view=diff&rev=552745&r1=552744&r2=552745
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCInOutAsyncMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCInOutAsyncMessageReceiver.java
Tue Jul  3 01:51:14 2007
@@ -24,10 +24,7 @@
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisMessage;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.*;
 import org.apache.axis2.description.java2wsdl.Java2WSDLConstants;
 import org.apache.axis2.receivers.AbstractInOutAsyncMessageReceiver;
 import org.apache.axis2.wsdl.WSDLConstants;
@@ -97,14 +94,24 @@
             // Handling the response
 
             AxisMessage outaxisMessage = op.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
-            if (outaxisMessage != null) {
+            if (outaxisMessage != null && outaxisMessage.getElementQName() !=null)
{
                 messageNameSpace = outaxisMessage.getElementQName().getNamespaceURI();
+            } else {
+                messageNameSpace = service.getTargetNamespace();
             }
 
             OMNamespace ns = fac.createOMNamespace(messageNameSpace,
                                                    service.getSchemaTargetNamespacePrefix());
             SOAPEnvelope envelope = fac.getDefaultEnvelope();
             OMElement bodyContent = null;
+
+            if (WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(
+                    op.getMessageExchangePattern())){
+                OMElement bodyChild = fac.createOMElement(outMessage.getAxisMessage().getName(),
ns);
+                envelope.getBody().addChild(bodyChild);
+                outMessage.setEnvelope(envelope);
+                return;
+            }
             Parameter generateBare = service.getParameter(Java2WSDLConstants.DOC_LIT_BARE_PARAMETER);
             if (generateBare!=null && "true".equals(generateBare.getValue())) {
                 RPCUtil.processResonseAsDocLitBare(resObject, service,

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java?view=diff&rev=552745&r1=552744&r2=552745
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
Tue Jul  3 01:51:14 2007
@@ -29,10 +29,7 @@
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisMessage;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.*;
 import org.apache.axis2.description.java2wsdl.Java2WSDLConstants;
 import org.apache.axis2.receivers.AbstractInOutMessageReceiver;
 import org.apache.axis2.wsdl.WSDLConstants;
@@ -110,8 +107,10 @@
 
             // Handling the response
             AxisMessage outaxisMessage = op.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
-            if (outaxisMessage != null) {
+            if (outaxisMessage != null && outaxisMessage.getElementQName() !=null)
{
                 messageNameSpace = outaxisMessage.getElementQName().getNamespaceURI();
+            } else {
+                messageNameSpace = service.getTargetNamespace();
             }
 
             OMNamespace ns = fac.createOMNamespace(messageNameSpace,
@@ -119,7 +118,14 @@
             SOAPEnvelope envelope = fac.getDefaultEnvelope();
             OMElement bodyContent = null;
 
-             Parameter generateBare = service.getParameter(Java2WSDLConstants.DOC_LIT_BARE_PARAMETER);
+            if (WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(
+                    op.getMessageExchangePattern())){
+                OMElement bodyChild = fac.createOMElement(outMessage.getAxisMessage().getName(),
ns);
+                envelope.getBody().addChild(bodyChild);
+                outMessage.setEnvelope(envelope);
+                return;
+            }
+            Parameter generateBare = service.getParameter(Java2WSDLConstants.DOC_LIT_BARE_PARAMETER);
             if (generateBare!=null && "true".equals(generateBare.getValue())) {
                 RPCUtil.processResonseAsDocLitBare(resObject, service,
                         envelope, fac, ns,

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java?view=diff&rev=552745&r1=552744&r2=552745
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
Tue Jul  3 01:51:14 2007
@@ -34,6 +34,7 @@
 import org.apache.axis2.databinding.utils.reader.NullXMLStreamReader;
 import org.apache.axis2.description.AxisMessage;
 import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.WSDL2Constants;
 import org.apache.axis2.description.java2wsdl.TypeTable;
 import org.apache.axis2.engine.ObjectSupplier;
 import org.apache.axis2.util.StreamWrapper;

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=552745&r1=552744&r2=552745
==============================================================================
--- 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
Tue Jul  3 01:51:14 2007
@@ -653,7 +653,7 @@
     public static String getAxisServiceName(String fileName) {
         char seperator = '.';
         String value;
-        int index = fileName.indexOf(seperator);
+        int index = fileName.lastIndexOf(seperator);
 
         if (index > 0) {
             value = fileName.substring(0, index);

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=552745&r1=552744&r2=552745
==============================================================================
--- 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
Tue Jul  3 01:51:14 2007
@@ -120,7 +120,6 @@
                                 messageReciverMap.put(
                                         WSDL2Constants.MEP_URI_IN_ONLY,
                                         messageReceiver);
-                                messageReciverMap.put(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY,messageReceiver);
                                 Class inoutMessageReceiver = Loader.loadClass(
                                         "org.apache.axis2.rpc.receivers.RPCMessageReceiver");
                                 MessageReceiver inOutmessageReceiver =
@@ -128,6 +127,7 @@
                                 messageReciverMap.put(
                                         WSDL2Constants.MEP_URI_IN_OUT,
                                         inOutmessageReceiver);
+                                 messageReciverMap.put(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY,inOutmessageReceiver);
                                 AxisService axisService = AxisService.createService(className,
                                                                                     configCtx.getAxisConfiguration(),
                                                                                     messageReciverMap,

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java?view=diff&rev=552745&r1=552744&r2=552745
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
Tue Jul  3 01:51:14 2007
@@ -394,8 +394,17 @@
         while (operations.hasNext()) {
             AxisOperation operation = (AxisOperation) operations.next();
             if (operation.getMessageReceiver() == null) {
-                operation.setMessageReceiver(loadDefaultMessageReceiver(
-                        operation.getMessageExchangePattern(), service));
+                MessageReceiver messageReceiver = loadDefaultMessageReceiver(
+                        operation.getMessageExchangePattern(), service);
+                if (messageReceiver == null  &&
+                        //we assume that if the MEP is ROBUST_IN_ONLY then the in-out MR
can handle that
+                        WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(
+                                operation.getMessageExchangePattern())) {
+                    messageReceiver = loadDefaultMessageReceiver(
+                            WSDL2Constants.MEP_URI_IN_OUT, service);
+
+                }
+                operation.setMessageReceiver(messageReceiver);
             }
         }
     }

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=552745&r1=552744&r2=552745
==============================================================================
--- 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
Tue Jul  3 01:51:14 2007
@@ -103,7 +103,6 @@
     public static URL[] getURLsForAllJars(URL url, File tmpDir) {
         try {
             ArrayList array = new ArrayList();
-            String urlString = url.toString();
             InputStream in = url.openStream();
             String fileName = url.getFile();
             int index = fileName.lastIndexOf('/');

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java?view=diff&rev=552745&r1=552744&r2=552745
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
Tue Jul  3 01:51:14 2007
@@ -1484,7 +1484,6 @@
             messageReciverMap.put(
                     WSDL2Constants.MEP_URI_IN_ONLY,
                     messageReceiver);
-            messageReciverMap.put(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY, messageReceiver);
             Class inoutMessageReceiver = Loader.loadClass(
                     "org.apache.axis2.rpc.receivers.RPCMessageReceiver");
             MessageReceiver inOutmessageReceiver =
@@ -1492,6 +1491,7 @@
             messageReciverMap.put(
                     WSDL2Constants.MEP_URI_IN_OUT,
                     inOutmessageReceiver);
+            messageReciverMap.put(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY, inOutmessageReceiver);
 
             return createService(implClass,
                                  axisConfig,

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java?view=diff&rev=552745&r1=552744&r2=552745
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
Tue Jul  3 01:51:14 2007
@@ -1,21 +1,3 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
 package org.apache.axis2.description;
 
 import org.apache.axiom.om.OMAbstractFactory;
@@ -51,6 +33,24 @@
 import java.util.Iterator;
 import java.util.Map;
 
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ *
+ *
+ */
+
 public class AxisService2WSDL11 implements Java2WSDLConstants {
 
     private AxisService axisService;
@@ -234,6 +234,8 @@
                     .equals(MEP)
                     || WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY
                     .equals(MEP)
+                    || WSDL2Constants.MEP_URI_ROBUST_IN_ONLY
+                    .equals(MEP)
                     || WSDL2Constants.MEP_URI_IN_OUT
                     .equals(MEP)) {
                 AxisMessage outAxisMessage = axisOperation
@@ -373,6 +375,8 @@
                     .equals(MEP)
                     || WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY
                     .equals(MEP)
+                    || WSDL2Constants.MEP_URI_ROBUST_IN_ONLY
+                    .equals(MEP)
                     || WSDL2Constants.MEP_URI_IN_OUT
                     .equals(MEP)) {
                 AxisMessage outAxisMessage = axisOperation
@@ -610,6 +614,8 @@
                     .equals(MEP)
                     || WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY
                     .equals(MEP)
+                    || WSDL2Constants.MEP_URI_ROBUST_IN_ONLY
+                    .equals(MEP)
                     || WSDL2Constants.MEP_URI_IN_OUT
                     .equals(MEP)) {
                 AxisMessage outAxisMessage = axisOperation
@@ -743,6 +749,8 @@
                     || WSDL2Constants.MEP_URI_IN_OPTIONAL_OUT
                     .equals(MEP)
                     || WSDL2Constants.MEP_URI_ROBUST_OUT_ONLY
+                    .equals(MEP)
+                    || WSDL2Constants.MEP_URI_ROBUST_IN_ONLY
                     .equals(MEP)
                     || WSDL2Constants.MEP_URI_IN_OUT
                     .equals(MEP)) {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java?view=diff&rev=552745&r1=552744&r2=552745
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
Tue Jul  3 01:51:14 2007
@@ -23,6 +23,7 @@
 import org.apache.axis2.description.AxisMessage;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.WSDL2Constants;
 import org.apache.axis2.description.java2wsdl.bytecode.MethodTable;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
@@ -227,6 +228,14 @@
             AxisOperation axisOperation = service.getOperation(new QName(methodName));
             if (axisOperation == null) {
                 axisOperation = Utils.getAxisOperationForJmethod(jMethod);
+                if (WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(
+                        axisOperation.getMessageExchangePattern())){
+                    AxisMessage outMessage = axisOperation.getMessage(
+                            WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
+                    if (outMessage !=null ){
+                        outMessage.setName(methodName + RESPONSE);
+                    }
+                }
                 addToService = true;
             }
             // Maintain a list of methods we actually work with

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java?view=diff&rev=552745&r1=552744&r2=552745
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java
Tue Jul  3 01:51:14 2007
@@ -23,6 +23,7 @@
 import org.apache.axis2.description.AxisMessage;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.WSDL2Constants;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -87,6 +88,14 @@
             AxisOperation axisOperation = service.getOperation(new QName(methodName));
             if (axisOperation == null) {
                 axisOperation = Utils.getAxisOperationForJmethod(jMethod);
+                if (WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(
+                        axisOperation.getMessageExchangePattern())){
+                    AxisMessage outMessage = axisOperation.getMessage(
+                            WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
+                    if (outMessage !=null ){
+                        outMessage.setName(methodName + RESULT);
+                    }
+                }
                 addToService = true;
             }
 



---------------------------------------------------------------------
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