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 na...@apache.org on 2007/02/27 06:43:58 UTC

svn commit: r512142 - in /webservices/axis2/trunk/java/modules: jaxws/test/org/apache/axis2/jaxws/sample/ jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/META-INF/ jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/sei/ kernel/src/org/apache/axis2...

Author: nagy
Date: Mon Feb 26 21:43:57 2007
New Revision: 512142

URL: http://svn.apache.org/viewvc?view=rev&rev=512142
Log:
Updated the WSDL 1.1-based deployment code to map the element QName of the input message for document/literal services to the AxisOperation in the same fashion as the WSDL 2.0-based deployment code does to enable SOAP Body-based routing for document/literal bare services, modified the mapping to adhere to the WS-I BP 1.1 definition of an "operation signature," and renamed the methods and fields to match what they are actually doing/containing.


Modified:
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/META-INF/doclitbare.wsdl
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/sei/DocLitBarePortType.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/WSDL11ToAxisServiceBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java?view=diff&rev=512142&r1=512141&r2=512142
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java Mon Feb 26 21:43:57 2007
@@ -8,6 +8,7 @@
 import junit.framework.TestCase;
 import org.apache.axis2.jaxws.sample.doclitbare.sei.BareDocLitService;
 import org.apache.axis2.jaxws.sample.doclitbare.sei.DocLitBarePortType;
+import org.apache.log4j.BasicConfigurator;
 
 public class BareTests extends TestCase {
 	
@@ -33,7 +34,24 @@
 		}
 	}
 	
-	public void testOneWayEmpty(){
+    public void testTwoWaySyncWithBodyRouting(){
+        System.out.println("------------------------------");
+        System.out.println("Test : "+getName());
+        
+        try{
+            
+            BareDocLitService service = new BareDocLitService();
+            DocLitBarePortType proxy = service.getBareDocLitPort();
+            String response = proxy.twoWaySimple(10);
+            System.out.println("Sync Response =" + response);
+            System.out.println("------------------------------");
+        }catch(Exception e){
+            e.printStackTrace();
+            fail();
+        }
+    }
+
+    public void testOneWayEmpty(){
 		System.out.println("------------------------------");
 		System.out.println("Test : "+getName());
 		

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/META-INF/doclitbare.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/META-INF/doclitbare.wsdl?view=diff&rev=512142&r1=512141&r2=512142
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/META-INF/doclitbare.wsdl (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/META-INF/doclitbare.wsdl Mon Feb 26 21:43:57 2007
@@ -103,21 +103,18 @@
 		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
 
 		<wsdl:operation name="oneWayEmpty">
-			<soap:operation soapAction="http://doclitbare.sample.test.org/oneWayEmpty" />
 			<wsdl:input>
 				<soap:body use="literal"  />
 			</wsdl:input>
 		</wsdl:operation>
 		
 		<wsdl:operation name="oneWay">
-			<soap:operation soapAction="http://doclitbare.sample.test.org/oneWay" />
 			<wsdl:input>
 				<soap:body use="literal"  />
 			</wsdl:input>
 		</wsdl:operation>
 		
 		<wsdl:operation name="twoWaySimple">
-			<soap:operation soapAction="twoWaySimple" />
 			<wsdl:input>
 				<soap:body use="literal"  />
 			</wsdl:input>
@@ -127,7 +124,6 @@
 		</wsdl:operation>	
 		
 		<wsdl:operation name="twoWayHolder">
-			<soap:operation soapAction="http://doclitbare.sample.test.org/twoWayReturn" />
 			<wsdl:input>
 				<soap:body use="literal"  />
 			</wsdl:input>
@@ -147,7 +143,7 @@
 	
 	<wsdl:service name="BareDocLitService">
 		<wsdl:port binding="tns:DocLitBare" name="BareDocLitPort">
-			<soap:address location="http://localhost:8080/axis2/services/BareDocLitService" />
+			<soap:address location="http://localhost:1234/axis2/services/BareDocLitService" />
 		</wsdl:port>
 	</wsdl:service>
 	

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/sei/DocLitBarePortType.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/sei/DocLitBarePortType.java?view=diff&rev=512142&r1=512141&r2=512142
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/sei/DocLitBarePortType.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/doclitbare/sei/DocLitBarePortType.java Mon Feb 26 21:43:57 2007
@@ -28,7 +28,7 @@
     /**
      * 
      */
-    @WebMethod(action = "http://doclitbare.sample.test.org/oneWayEmpty")
+    @WebMethod
     @Oneway
     public void oneWayEmpty();
 
@@ -36,7 +36,7 @@
      * 
      * @param allByMyself
      */
-    @WebMethod(action = "http://doclitbare.sample.test.org/oneWay")
+    @WebMethod
     @Oneway
     public void oneWay(
         @WebParam(name = "String", targetNamespace = "http://doclitbare.sample.test.org", partName = "allByMyself")
@@ -48,7 +48,7 @@
      * @return
      *     returns java.lang.String
      */
-    @WebMethod(action = "http://doclitbare.sample.test.org/twoWaySimple")
+    @WebMethod
     @WebResult(name = "String", targetNamespace = "http://doclitbare.sample.test.org", partName = "allByMyself")
     public String twoWaySimple(
         @WebParam(name = "Integer", targetNamespace = "http://doclitbare.sample.test.org", partName = "allByMyself")
@@ -60,7 +60,7 @@
      * @throws FaultBeanWithWrapper
      * @throws SimpleFault
      */
-    @WebMethod(action = "http://doclitbare.sample.test.org/twoWayReturn")
+    @WebMethod
     public void twoWayHolder(
         @WebParam(name = "Composite", targetNamespace = "http://doclitbare.sample.test.org", mode = Mode.INOUT, partName = "allByMyself")
         Holder<Composite> allByMyself)

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=512142&r1=512141&r2=512142
==============================================================================
--- 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 Feb 26 21:43:57 2007
@@ -340,7 +340,7 @@
                     QName complexSchemaType = table.getComplexSchemaType(jmethod.getSimpleName());
                     inMessage.setElementQName(complexSchemaType);
                     if (complexSchemaType != null) {
-                        axisService.addmessageNameToOperationMapping(complexSchemaType.getLocalPart(), operation);
+                        axisService.addMessageElementQNameToOperationMapping(complexSchemaType, operation);
                     }
                 }
                 if (!jmethod.getReturnType().isVoidType()) {
@@ -350,7 +350,7 @@
                             Java2WSDLConstants.RESPONSE);
                     outMessage.setElementQName(qNamefortheType);
                     if (qNamefortheType != null) {
-                        axisService.addmessageNameToOperationMapping(qNamefortheType.getLocalPart(), operation);
+                        axisService.addMessageElementQNameToOperationMapping(qNamefortheType, operation);
                     }
                     outMessage.setName(opName + Java2WSDLConstants.RESPONSE);
                 }

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=512142&r1=512141&r2=512142
==============================================================================
--- 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 Mon Feb 26 21:43:57 2007
@@ -98,8 +98,12 @@
 public class AxisService extends AxisDescription {
 
     private Map endpointMap = new HashMap();
-
-    private Map messageNameToOperationsMap = new HashMap();
+    
+    /*This is a map between the QName of the element of a message
+     *specified in the WSDL and an Operation.  It enables SOAP Body-based
+     *dispatching for doc-literal bindings.
+     */ 
+    private Map messageElementQNameToOperationMap = new HashMap();
 
     private int nsCount = 0;
     private static final Log log = LogFactory.getLog(AxisService.class);
@@ -2235,24 +2239,51 @@
         return locator;
     }
 
-
-   
     /**
-     * When we are trying to find out the operation by the QName of the SOAPBody first child, this
-     * map will help to retrieve that data very fast.
-     *
-     * @param messageQNameToOperationMap
+     * Set the map of WSDL message element QNames to AxisOperations for this
+     * service.  This map is used during SOAP Body-based routing for
+     * document/literal bare services to match the first child element of the
+     * SOAP Body element to an operation.  (Routing for RPC and
+     * document/literal wrapped services occurs via the operationsAliasesMap.)
+     *
+     * From section 4.7.6 of the WS-I BP 1.1:
+     * the "operation signature" is "the fully qualified name of the child
+     * element of SOAP body of the SOAP input message described by an operation
+     * in a WSDL binding," and thus this map must be from a QName to an
+     * operation.
+     * 
+     * @param messageElementQNameToOperationMap The map from WSDL message
+     *                                          element QNames to
+     *                                          AxisOperations.
      */
-    public void setMessageNameToOperationsMap(Map messageQNameToOperationMap) {
-        this.messageNameToOperationsMap = messageQNameToOperationMap;
+    public void setMessageElementQNameToOperationMap(Map messageElementQNameToOperationMap) {
+        this.messageElementQNameToOperationMap = messageElementQNameToOperationMap;
     }
 
-    public AxisOperation getOperationByMessageName(String messageName) {
-            return (AxisOperation) messageNameToOperationsMap.get(messageName);
+    /**
+     * Look up an AxisOperation for this service based off of an element QName
+     * from a WSDL message element.
+     * 
+     * @param messageElementQName The QName to search for.
+     * @return The AxisOperation registered to the QName or null if no match
+     *         was found.
+     * @see #setMessageElementQNameToOperationMap(Map)
+     */
+    public AxisOperation getOperationByMessageElementQName(QName messageElementQName) {
+            return (AxisOperation) messageElementQNameToOperationMap.get(messageElementQName);
     }
 
-    public void addmessageNameToOperationMapping(String messageName, AxisOperation operation) {
-        messageNameToOperationsMap.put(messageName, operation);
+    /**
+     * Add an entry to the map between element QNames in WSDL messages and
+     * AxisOperations for this service.
+     * 
+     * @param messageElementQName The QName of the element on the input message
+     *                            that maps to the given operation.
+     * @param operation The AxisOperation to be mapped to.
+     * @see #setMessageElementQNameToOperationMap(Map)
+     */
+    public void addMessageElementQNameToOperationMapping(QName messageElementQName, AxisOperation operation) {
+        messageElementQNameToOperationMap.put(messageElementQName, operation);
     }
 
     public String getEndpointURL() {

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=512142&r1=512141&r2=512142
==============================================================================
--- 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 Feb 26 21:43:57 2007
@@ -799,6 +799,7 @@
                         QName elementName = part.getElementName();
                         if (elementName != null) {
                             message.setElementQName(elementName);
+                            ((AxisService)message.getParent().getParent()).addMessageElementQNameToOperationMapping(elementName, (AxisOperation)message.getParent());
                         } else {
                             throw new WSDLProcessingException("No element type is defined for message " +
                                     wsdl4jMessage.getQName().getLocalPart());
@@ -824,6 +825,7 @@
                         QName elementName = part.getElementName();
                         if (elementName != null) {
                             message.setElementQName(elementName);
+                            ((AxisService)message.getParent().getParent()).addMessageElementQNameToOperationMapping(elementName, (AxisOperation)message.getParent());
                         } else {
                             throw new WSDLProcessingException("No element type is defined for message" +
                                     wsdl4jMessage.getQName().getLocalPart());

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java?view=diff&rev=512142&r1=512141&r2=512142
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java Mon Feb 26 21:43:57 2007
@@ -905,7 +905,7 @@
         // populate this map so that this can be used in SOAPBody based dispatching
         if (elementQName != null) {
             axisService
-                    .addmessageNameToOperationMapping(elementQName.getLocalPart(), axisOperation);
+                    .addMessageElementQNameToOperationMapping(elementQName, axisOperation);
         }
     }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java?view=diff&rev=512142&r1=512141&r2=512142
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java Mon Feb 26 21:43:57 2007
@@ -49,7 +49,7 @@
         AxisOperation axisOperation = service.getOperation(operationName);
 
         if (axisOperation == null) {
-            axisOperation = service.getOperationByMessageName(bodyFirstChild.getLocalName());
+            axisOperation = service.getOperationByMessageElementQName(bodyFirstChild.getQName());
         }
         return axisOperation;
     }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java?view=diff&rev=512142&r1=512141&r2=512142
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java Mon Feb 26 21:43:57 2007
@@ -64,8 +64,9 @@
         AxisOperation axisOperation = service.getOperation(operationName);
 
         if (axisOperation == null) {
-            axisOperation = service.getOperationByMessageName(bodyFirstChild.getLocalName());
+            axisOperation = service.getOperationByMessageElementQName(bodyFirstChild.getQName());
         }
+        
         return axisOperation;
     }
 



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