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 sc...@apache.org on 2007/02/21 03:55:19 UTC

svn commit: r509869 - in /webservices/axis2/trunk/java/modules/jaxws: src/org/apache/axis2/jaxws/marshaller/impl/alt/ src/org/apache/axis2/jaxws/message/ src/org/apache/axis2/jaxws/message/databinding/ src/org/apache/axis2/jaxws/message/databinding/imp...

Author: scheu
Date: Tue Feb 20 18:55:18 2007
New Revision: 509869

URL: http://svn.apache.org/viewvc?view=rev&rev=509869
Log:
AXIS2-2155
Contributor: Rich Scheuerle
Corrected the doc/lit wrapped minimal marshaller.  Now it marshals and unmarshals correctly named elements. Misc comment cleanup. More to come.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageImpl.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartImpl.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/DLWMinTests.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/dlwmin/META-INF/greeter.wsdl
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/dlwmin/sei/Greeter.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java Tue Feb 20 18:55:18 2007
@@ -98,7 +98,11 @@
             }
             
             // Unmarshall the ParamValues from the Message
-            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, false);
+            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, 
+                    message, 
+                    packages, 
+                    false, // output
+                    false); // never unmarshal by type for document/lit bare
             
             // Populate the response Holders
             MethodMarshallerUtils.updateResponseSignatureArgs(pds, pvList, signatureArgs);
@@ -135,7 +139,11 @@
             
             
             // Unmarshal the ParamValues from the message
-            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, true);
+            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, 
+                    message, 
+                    packages, 
+                    true, // input
+                    false); // never unmarshal by type for doc/lit bare
             
             // Build the signature arguments
             Object[] sigArguments = MethodMarshallerUtils.createRequestSignatureArgs(pds, pvList);

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java Tue Feb 20 18:55:18 2007
@@ -71,18 +71,18 @@
             // Sample Document message
             // ..
             // <soapenv:body>
-            //    <m:return ... >...</m:param>
+            //    <m:operationResponse ... >
+            //       <param>hello</param>
+            //    </m:operationResponse>
             // </soapenv:body>
             //
             // Important points.
             //   1) There is no operation element in the message
-            //   2) The data blocks are located underneath the operation element. 
-            //   3) The name of the data blocks (m:param) are defined by the schema.
-            //      (SOAP indicates that the name of the element is not important, but
-            //      for document processing, we will assume that the name corresponds to 
-            //      a schema root element)
-            //   4) The type of the data block is defined by schema; thus in most cases
-            //      an xsi:type will not be present
+            //   2) The data blocks are located underneath the body element. 
+            //   3) The name of the data block (m:operationResponse) is defined by the schema.
+            //      It matches the operation name + "Response", and it has a corresponding JAXB element.
+            //      This element is called the wrapper element
+            //   4) The parameters are (param) are child elements of the wrapper element.
             ParameterDescription[] pds =operationDesc.getParameterDescriptions();
             MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
             TreeSet<String> packages = marshalDesc.getPackages();
@@ -188,15 +188,17 @@
             // Sample Document message
             // ..
             // <soapenv:body>
-            //    <m:param .. >...</m:param>
+            //    <m:operation>
+            //      <param>hello</param>
+            //    </m:operation>
             // </soapenv:body>
             //
             // Important points.
             //   1) There is no operation element under the body.
             //   2) The data blocks are located underneath the body.  
-            //   3) The name of the data blocks (m:param) are defined by the schema
-            //   4) The type of the data block (data:foo) is defined by schema (and probably
-            //      is not present in the message
+            //   3) The name of the data block (m:operation) is defined by the schema and match the name of the operation.
+            //      This is called the wrapper element.  The wrapper element has a corresponding JAXB element pojo.
+            //   4) The parameters (m:param) are child elements of the wrapper element.
             ParameterDescription[] pds =operationDesc.getParameterDescriptions();
             MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
             TreeSet<String> packages = marshalDesc.getPackages();
@@ -280,18 +282,18 @@
             // Sample Document message
             // ..
             // <soapenv:body>
-            //    <m:return ... >...</m:param>
+            //    <m:operationResponse ... >
+            //       <param>hello</param>
+            //    </m:operationResponse>
             // </soapenv:body>
             //
             // Important points.
             //   1) There is no operation element in the message
-            //   2) The data blocks are located underneath the operation element. 
-            //   3) The name of the data blocks (m:param) are defined by the schema.
-            //      (SOAP indicates that the name of the element is not important, but
-            //      for document processing, we will assume that the name corresponds to 
-            //      a schema root element)
-            //   4) The type of the data block is defined by schema; thus in most cases
-            //      an xsi:type will not be present
+            //   2) The data blocks are located underneath the body element. 
+            //   3) The name of the data block (m:operationResponse) is defined by the schema.
+            //      It matches the operation name + "Response", and it has a corresponding JAXB element.
+            //      This element is called the wrapper element
+            //   4) The parameters are (param) are child elements of the wrapper element.
             
             // Get the operation information
             ParameterDescription[] pds =operationDesc.getParameterDescriptions();
@@ -379,16 +381,17 @@
             // Sample Document message
             // ..
             // <soapenv:body>
-            //    <m:param .. >...</m:param>
+            //    <m:operation>
+            //      <param>hello</param>
+            //    </m:operation>
             // </soapenv:body>
             //
             // Important points.
             //   1) There is no operation element under the body.
             //   2) The data blocks are located underneath the body.  
-            //   3) The name of the data blocks (m:param) are defined by the schema
-            //   4) The type of the data block (data:foo) is defined by schema (and probably
-            //      is not present in the message
-            
+            //   3) The name of the data block (m:operation) is defined by the schema and match the name of the operation.
+            //      This is called the wrapper element.  The wrapper element has a corresponding JAXB element pojo.
+            //   4) The parameters (m:param) are child elements of the wrapper element.
             
             // Get the operation information
             ParameterDescription[] pds =operationDesc.getParameterDescriptions();

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java Tue Feb 20 18:55:18 2007
@@ -44,9 +44,6 @@
  * The Doc/Lit Wrapped Minimal Marshaller is used when
  *   1) The web service is Doc/Lit Wrapped, and
  *   2) The wrapper and fault bean objects are missing (hence the term 'Minimal')
- *   
- * TODO
- * This class was copied from RPC/LIT and is currently "UNDER DEVELOPMENT"
  *
  */
 public class DocLitWrappedMinimalMethodMarshaller implements MethodMarshaller {
@@ -61,37 +58,26 @@
         
         EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
         EndpointDescription endpointDesc = ed.getEndpointDescription();
-        Protocol protocol = null;
-        try {
-            protocol = Protocol.getProtocolForBinding(endpointDesc.getClientBindingID()); 
-        } catch (WebServiceException e) {
-            // TODO better handling than this?
-            e.printStackTrace();
-        }
+        Protocol protocol = Protocol.getProtocolForBinding(endpointDesc.getClientBindingID()); 
         
         // Note all exceptions are caught and rethrown with a WebServiceException
         try {
             
-            // Sample RPC message
+            // Sample Document message
             // ..
             // <soapenv:body>
-            //    <m:op xmlns:m="urn://api">
-            //       <param xsi:type="data:foo" >...</param>
-            //    </m:op>
+            //    <m:operation>
+            //      <param>hello</param>
+            //    </m:operation>
             // </soapenv:body>
             //
             // Important points.
-            //   1) RPC has an operation element under the body.  This is the name of the
-            //      wsdl operation.
-            //   2) The data blocks are located underneath the operation element.  (In doc/lit
-            //      the data elements are underneath the body.
-            //   3) The name of the data blocks (param) are defined by the wsdl:part not the
-            //      schema.  Note that the param is unqualified...per WS-I BP.
-            //   4) The type of the data block (data:foo) is defined by schema (thus there is 
-            //      JAXB type rendering.  Since we are using JAXB to marshal the data, 
-            //      we always generate an xsi:type attribute.  This is an implemenation detail
-            //      and is not defined by any spec.
-            
+            //   1) There is no operation element under the body.
+            //   2) The data blocks are located underneath the body.  
+            //   3) The name of the data block (m:operation) is defined by the schema and match the name of the operation.
+            //      This is called the wrapper element.  The wrapper element has a corresponding JAXB element pojo.
+            //   4) The parameters (m:param) are child elements of the wrapper element.
+            //   5) NOTE: For doc/literal wrapped "minimal", the wrapper JAXB element pojo is missing.
             
             // Get the operation information
             ParameterDescription[] pds =operationDesc.getParameterDescriptions();
@@ -105,12 +91,12 @@
             //to a method then an implementation MUST throw WebServiceException.
             if(pds.length > 0){
             	if(signatureArguments == null){
-            		throw ExceptionFactory.makeWebServiceException(Messages.getMessage("NullParamErr1", "Input", operationDesc.getJavaMethodName(), "rpc/lit"));
+            		throw ExceptionFactory.makeWebServiceException(Messages.getMessage("NullParamErr1", "Input", operationDesc.getJavaMethodName(), "doc/lit"));
             	}
             	if(signatureArguments !=null){
             		for(Object argument:signatureArguments){
             			if(argument == null){
-                            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("NullParamErr1", "Input", operationDesc.getJavaMethodName(), "rpc/lit"));
+                            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("NullParamErr1", "Input", operationDesc.getJavaMethodName(), "doc/lit"));
             			}
             		}
             	}
@@ -120,10 +106,11 @@
             MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
             Message m = mf.create(protocol);
             
-            // Indicate the style and operation element name.  This triggers the message to
-            // put the data blocks underneath the operation element
-            m.setStyle(Style.RPC);
-            m.setOperationElement(getRPCOperationQName(operationDesc));
+            // Indicate the style and wrapper element name.  This triggers the message to
+            // put the data blocks underneath the wrapper element
+            m.setStyle(Style.DOCUMENT);
+            m.setIndirection(1);
+            m.setOperationElement(getRequestWrapperQName(operationDesc));
             
             // The input object represent the signature arguments.
             // Signature arguments are both holders and non-holders
@@ -133,7 +120,8 @@
                         pds,
                         signatureArguments,
                         true,  // input
-                        false, true); // use partName since this is rpc/lit
+                        true,  // doc/lit wrapped
+                        true); // false
                         
             
             // Put values onto the message
@@ -176,12 +164,17 @@
             MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
             TreeSet<String> packages = marshalDesc.getPackages();
             
-            // Indicate that the style is RPC.  This is important so that the message understands
-            // that the data blocks are underneath the operation element
-            message.setStyle(Style.RPC);
+            // Indicate that the style is Document, but the blocks are underneath
+            // the wrapper element
+            message.setStyle(Style.DOCUMENT);
+            message.setIndirection(1);
             
             // Unmarshal the ParamValues from the Message
-            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, true);
+            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, 
+                    message, 
+                    packages, 
+                    true, // input
+                    true);  // sigh...unmarshal by type because there is no wrapper
             
             // Build the signature arguments
             Object[] sigArguments = MethodMarshallerUtils.createRequestSignatureArgs(pds, pvList);
@@ -218,12 +211,7 @@
         // We want to respond with the same protocol as the request,
         // It the protocol is null, then use the Protocol defined by the binding
         if (protocol == null) {
-            try {
-                protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType());
-            } catch (WebServiceException e) {
-                // TODO better handling than this?
-                e.printStackTrace();
-            }
+            protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType());
         }
         
         // Note all exceptions are caught and rethrown with a WebServiceException
@@ -257,14 +245,11 @@
             MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
             Message m = mf.create(protocol);
             
-            // Indicate the style and operation element name.  This triggers the message to
+            // Indicate the style and wrapper element name.  This triggers the message to
             // put the data blocks underneath the operation element
-            m.setStyle(Style.RPC);
-            
-            // TODO Is there an annotation for the operation element response ?
-            QName rpcOpQName = getRPCOperationQName(operationDesc);
-            String localPart = rpcOpQName.getLocalPart() + "Response";
-            QName responseOp = new QName(rpcOpQName.getNamespaceURI(), localPart, rpcOpQName.getPrefix());
+            m.setStyle(Style.DOCUMENT);
+            m.setIndirection(1);
+            QName responseOp = getResponseWrapperQName(operationDesc);
             m.setOperationElement(responseOp);
             
             // Put the return object onto the message
@@ -275,7 +260,7 @@
                 returnNS = operationDesc.getResultTargetNamespace();
                 returnLocalPart = operationDesc.getResultName();
             } else {
-                returnNS = "";  // According to WSI BP the body part is unqualified
+                returnNS = operationDesc.getResultTargetNamespace();
                 returnLocalPart = operationDesc.getResultPartName();
             }
             
@@ -300,7 +285,7 @@
                         returnType, 
                         marshalDesc, 
                         m,
-                        true, // forceXSI since this is rpc/lit
+                        true, // force marshal by type
                         operationDesc.isResultHeader()); 
             }
             
@@ -310,7 +295,8 @@
                         pds, 
                         signatureArgs, 
                         false,  // output
-                        false, true);   // use partName since this is rpc/lit
+                        true,   // doc/lit wrapped
+                        false); // not rpc
 
             // TODO Should we check for null output body values?  Should we check for null output header values ?
             // Put values onto the message
@@ -354,9 +340,9 @@
             MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
             TreeSet<String> packages = marshalDesc.getPackages();
             
-            // Indicate that the style is RPC.  This is important so that the message understands
-            // that the data blocks are underneath the operation element
-            message.setStyle(Style.RPC);
+            // Indicate that the style is Document. 
+            message.setStyle(Style.DOCUMENT);
+            message.setIndirection(1);
             
             // Get the return value.
             Class returnType = operationDesc.getResultActualType();
@@ -365,10 +351,19 @@
                 // If the webresult is in the header, we need the name of the header so that we can find it.
                 Element returnElement = null;
                 if (operationDesc.isResultHeader()) {
-                    returnElement = MethodMarshallerUtils.getReturnElement(packages, message, returnType, true,
-                            operationDesc.getResultTargetNamespace(), operationDesc.getResultPartName());
+                    returnElement = MethodMarshallerUtils.getReturnElement(packages, 
+                            message, 
+                            null,  // For headers, unmarshal normally 
+                            true,  // is a header
+                            operationDesc.getResultTargetNamespace(), // header ns
+                            operationDesc.getResultPartName());       // header local part
                 } else {
-                    returnElement = MethodMarshallerUtils.getReturnElement(packages, message, returnType, false, null, null);
+                    returnElement = MethodMarshallerUtils.getReturnElement(packages, 
+                            message, 
+                            returnType, // Unmarshal by type
+                            false,      // not a header
+                            null, 
+                            null);
                 }
                 returnValue = returnElement.getTypeValue();
                 // TODO should we allow null if the return is a header?
@@ -381,7 +376,11 @@
             }
             
             // Unmarshall the ParamValues from the Message
-            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, false);
+            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, 
+                    message, 
+                    packages, 
+                    false, // output
+                    true); // unmarshal by type since there is no response wrapper
             
             // TODO Should we check for null output body values?  Should we check for null output header values ?
             
@@ -405,12 +404,7 @@
         // We want to respond with the same protocol as the request,
         // It the protocol is null, then use the Protocol defined by the binding
         if (protocol == null) {
-            try {
-                protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType());
-            } catch (WebServiceException e) {
-                // TODO better handling than this?
-                e.printStackTrace();
-            }
+            protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType());
         }
         
         // Note all exceptions are caught and rethrown with a WebServiceException
@@ -448,17 +442,32 @@
     
     /**
      * @param opDesc
-     * @return qualified qname to use in the rpc message to represent the operation
-     * (per WSI BP)
+     * @return request wrapper qname
+     */
+    private static QName getRequestWrapperQName(OperationDescription opDesc) {
+        
+        QName qName = opDesc.getName();
+        
+        String localPart = opDesc.getRequestWrapperLocalName();
+        String uri = opDesc.getRequestWrapperTargetNamespace();
+        String prefix = "dlwmin";  // Prefer using an actual prefix
+                
+        
+        qName = new QName(uri, localPart, prefix);
+        return qName;
+    }
+    
+    /**
+     * @param opDesc
+     * @return request wrapper qname
      */
-    private static QName getRPCOperationQName(OperationDescription opDesc) {
+    private static QName getResponseWrapperQName(OperationDescription opDesc) {
+        
         QName qName = opDesc.getName();
         
-        String localPart = qName.getLocalPart();
-        String uri = (qName.getNamespaceURI().length() == 0) ? 
-                      opDesc.getEndpointInterfaceDescription().getTargetNamespace() :
-                      qName.getNamespaceURI();
-        String prefix = "rpcOp";  // Prefer using an actual prefix
+        String localPart = opDesc.getResponseWrapperLocalName();
+        String uri = opDesc.getResponseWrapperTargetNamespace();
+        String prefix = "dlwmin";  // Prefer using an actual prefix
                 
         
         qName = new QName(uri, localPart, prefix);

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java Tue Feb 20 18:55:18 2007
@@ -119,18 +119,18 @@
             // Sample Document message
             // ..
             // <soapenv:body>
-            //    <m:return ... >...</m:param>
+            //    <m:operationResponse ... >
+            //       <param>hello</param>
+            //    </m:operationResponse>
             // </soapenv:body>
             //
             // Important points.
             //   1) There is no operation element in the message
-            //   2) The data blocks are located underneath the operation element. 
-            //   3) The name of the data blocks (m:param) are defined by the schema.
-            //      (SOAP indicates that the name of the element is not important, but
-            //      for document processing, we will assume that the name corresponds to 
-            //      a schema root element)
-            //   4) The type of the data block is defined by schema; thus in most cases
-            //      an xsi:type will not be present
+            //   2) The data blocks are located underneath the body element. 
+            //   3) The name of the data block (m:operationResponse) is defined by the schema.
+            //      It matches the operation name + "Response", and it has a corresponding JAXB element.
+            //      This element is called the wrapper element
+            //   4) The parameters are (param) are child elements of the wrapper element.
             ParameterDescription[] pds =operationDesc.getParameterDescriptions();
             MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
             TreeSet<String> packages = marshalDesc.getPackages();
@@ -267,15 +267,17 @@
             // Sample Document message
             // ..
             // <soapenv:body>
-            //    <m:param .. >...</m:param>
+            //    <m:operation>
+            //      <param>hello</param>
+            //    </m:operation>
             // </soapenv:body>
             //
             // Important points.
             //   1) There is no operation element under the body.
             //   2) The data blocks are located underneath the body.  
-            //   3) The name of the data blocks (m:param) are defined by the schema
-            //   4) The type of the data block (data:foo) is defined by schema (and probably
-            //      is not present in the message
+            //   3) The name of the data block (m:operation) is defined by the schema and match the name of the operation.
+            //      This is called the wrapper element.  The wrapper element has a corresponding JAXB element pojo.
+            //   4) The parameters (m:param) are child elements of the wrapper element.
             ParameterDescription[] pds =operationDesc.getParameterDescriptions();
             MarshalServiceRuntimeDescription marshalDesc = MethodMarshallerUtils.getMarshalDesc(endpointDesc);
             TreeSet<String> packages = marshalDesc.getPackages();
@@ -376,18 +378,18 @@
             // Sample Document message
             // ..
             // <soapenv:body>
-            //    <m:return ... >...</m:param>
+            //    <m:operationResponse ... >
+            //       <param>hello</param>
+            //    </m:operationResponse>
             // </soapenv:body>
             //
             // Important points.
             //   1) There is no operation element in the message
-            //   2) The data blocks are located underneath the operation element. 
-            //   3) The name of the data blocks (m:param) are defined by the schema.
-            //      (SOAP indicates that the name of the element is not important, but
-            //      for document processing, we will assume that the name corresponds to 
-            //      a schema root element)
-            //   4) The type of the data block is defined by schema; thus in most cases
-            //      an xsi:type will not be present
+            //   2) The data blocks are located underneath the body element. 
+            //   3) The name of the data block (m:operationResponse) is defined by the schema.
+            //      It matches the operation name + "Response", and it has a corresponding JAXB element.
+            //      This element is called the wrapper element
+            //   4) The parameters are (param) are child elements of the wrapper element.
             
             // Get the operation information
             ParameterDescription[] pds =operationDesc.getParameterDescriptions();
@@ -515,15 +517,17 @@
             // Sample Document message
             // ..
             // <soapenv:body>
-            //    <m:param .. >...</m:param>
+            //    <m:operation>
+            //      <param>hello</param>
+            //    </m:operation>
             // </soapenv:body>
             //
             // Important points.
             //   1) There is no operation element under the body.
             //   2) The data blocks are located underneath the body.  
-            //   3) The name of the data blocks (m:param) are defined by the schema
-            //   4) The type of the data block (data:foo) is defined by schema (and probably
-            //      is not present in the message
+            //   3) The name of the data block (m:operation) is defined by the schema and match the name of the operation.
+            //      This is called the wrapper element.  The wrapper element has a corresponding JAXB element pojo.
+            //   4) The parameters (m:param) are child elements of the wrapper element.
             
             
             // Get the operation information

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java Tue Feb 20 18:55:18 2007
@@ -97,7 +97,11 @@
      * @return PDElements
      */
     static List<PDElement> getPDElements(MarshalServiceRuntimeDescription marshalDesc,
-            ParameterDescription[] params, Object[] sigArguments, boolean isInput, boolean isDocLitWrapped, boolean isRPC) {
+            ParameterDescription[] params, 
+            Object[] sigArguments, 
+            boolean isInput, 
+            boolean isDocLitWrapped, 
+            boolean isRPC) {
         List<PDElement> pdeList = new ArrayList<PDElement>();
         
         int index = 0;
@@ -164,12 +168,14 @@
      * @param message Message
      * @param packages set of packages needed to unmarshal objects for this operation
      * @param isInput indicates if input or output  params (input on server, output on client)
+     * @param isUnmarshalByType (discouraged...but must be used for rpc)
      * @return ParamValues
      */
     static List<PDElement> getPDElements(ParameterDescription[] params, 
             Message message, 
             TreeSet<String> packages, 
-            boolean isInput) throws XMLStreamException {
+            boolean isInput, 
+            boolean isUnmarshalByType) throws XMLStreamException {
         
         List<PDElement> pdeList = new ArrayList<PDElement>();
         
@@ -207,8 +213,8 @@
                 
                 // RPC is type based, so unfortuately the type of 
                 // object must be provided
-                if (message.getStyle() == Style.RPC) {
-                    context.setRPCType(pd.getParameterActualType());
+                if (isUnmarshalByType && !pd.isHeader()) {
+                    context.setProcessType(pd.getParameterActualType());
                 }
                 
                 // Unmarshal the object into a JAXB object or JAXBElement
@@ -352,10 +358,13 @@
      * @param pdeList element enabled objects
      * @param message Message
      * @param packages Packages needed to do a JAXB Marshal
-     * @param isRPC 
+     * @param isMarshalByType (discouraged...but must be used for rpc)
      * @throws MessageException
      */
-    static void toMessage(List<PDElement> pdeList, Message message, TreeSet<String> packages, boolean isRPC) throws WebServiceException {
+    static void toMessage(List<PDElement> pdeList, 
+            Message message, 
+            TreeSet<String> packages, 
+            boolean isMarshalByType) throws WebServiceException {
         
         int totalBodyBlocks = 0;
         for (int i=0; i<pdeList.size(); i++) {
@@ -372,8 +381,8 @@
             // Create the JAXBBlockContext
             // RPC uses type marshalling, so use the rpcType
             JAXBBlockContext context = new JAXBBlockContext(packages);
-            if (isRPC) {
-                context.setRPCType(pde.getParam().getParameterActualType());
+            if (isMarshalByType && !pde.getParam().isHeader()) {
+                context.setProcessType(pde.getParam().getParameterActualType());
             }
                 
             // Create a JAXBBlock out of the value.
@@ -409,7 +418,7 @@
      * @param returnType
      * @param marshalDesc
      * @param message
-     * @param isRPC
+     * @param isMarshalByType..we must do this for RPC...discouraged otherwise
      * @param isHeader
      * @throws MessageException
      */
@@ -417,15 +426,15 @@
             Class returnType, 
             MarshalServiceRuntimeDescription marshalDesc,
             Message message, 
-            boolean isRPC,
+            boolean isMarshalByType,
             boolean isHeader)
             throws WebServiceException {
         
         // Create the JAXBBlockContext
         // RPC uses type marshalling, so recored the rpcType
         JAXBBlockContext context = new JAXBBlockContext(marshalDesc.getPackages());
-        if (isRPC) {
-            context.setRPCType(returnType);
+        if (isMarshalByType && !isHeader) {
+            context.setProcessType(returnType);
         }
         
         //  Create a JAXBBlock out of the value.
@@ -444,7 +453,7 @@
      * Unmarshal the return object from the message
      * @param packages
      * @param message
-     * @param rpcType RPC Declared Type class (only used for RPC processing)
+     * @param unmarshalType Used only to indicate unmarshaling by type...only necessary for rpc
      * @param isHeader
      * @param headerNS (only needed if isHeader)
      * @param headerLocalPart (only needed if isHeader)
@@ -454,7 +463,7 @@
      */
     static Element getReturnElement(TreeSet<String> packages, 
             Message message, 
-            Class rpcType,
+            Class unmarshalType,  // set to null unless style=rpce
             boolean isHeader,
             String headerNS, 
             String headerLocalPart)
@@ -463,8 +472,8 @@
         
         // The return object is the first block in the body
         JAXBBlockContext context = new JAXBBlockContext(packages);
-        if (rpcType != null) {
-            context.setRPCType(rpcType);  // RPC is type-based, so the unmarshalled type must be provided
+        if (unmarshalType != null && !isHeader) {
+            context.setProcessType(unmarshalType);  
         }
         Block block = null;
         if (isHeader) {
@@ -554,7 +563,7 @@
                 // RPC uses type marshalling, so recored the rpcType
                 JAXBBlockContext context = new JAXBBlockContext(marshalDesc.getPackages());
                 if (isRPC) {
-                    context.setRPCType(faultBeanObject.getClass());
+                    context.setProcessType(faultBeanObject.getClass());
                 }
                 
                 
@@ -753,7 +762,7 @@
                 // RPC is problem ! 
                 // Since RPC is type based, JAXB needs the declared type
                 // to unmarshal the object.
-                blockContext.setRPCType(faultBeanFormalClass);
+                blockContext.setProcessType(faultBeanFormalClass);
                 
             }
             

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java Tue Feb 20 18:55:18 2007
@@ -52,13 +52,7 @@
         
         EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
         EndpointDescription endpointDesc = ed.getEndpointDescription();
-        Protocol protocol = null;
-        try {
-            protocol = Protocol.getProtocolForBinding(endpointDesc.getClientBindingID()); 
-        } catch (WebServiceException e) {
-            // TODO better handling than this?
-            e.printStackTrace();
-        }
+        Protocol protocol = Protocol.getProtocolForBinding(endpointDesc.getClientBindingID()); 
         
         // Note all exceptions are caught and rethrown with a WebServiceException
         try {
@@ -172,7 +166,11 @@
             message.setStyle(Style.RPC);
             
             // Unmarshal the ParamValues from the Message
-            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, true);
+            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, 
+                    message, 
+                    packages, 
+                    true, // input
+                    true); // unmarshal by type
             
             // Build the signature arguments
             Object[] sigArguments = MethodMarshallerUtils.createRequestSignatureArgs(pds, pvList);
@@ -209,12 +207,7 @@
         // We want to respond with the same protocol as the request,
         // It the protocol is null, then use the Protocol defined by the binding
         if (protocol == null) {
-            try {
-                protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType());
-            } catch (WebServiceException e) {
-                // TODO better handling than this?
-                e.printStackTrace();
-            }
+            protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType());
         }
         
         // Note all exceptions are caught and rethrown with a WebServiceException
@@ -372,7 +365,11 @@
             }
             
             // Unmarshall the ParamValues from the Message
-            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, false);
+            List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, 
+                    message, 
+                    packages, 
+                    false, // output
+                    true); // unmarshal by type
             
             // TODO Should we check for null output body values?  Should we check for null output header values ?
             
@@ -396,12 +393,7 @@
         // We want to respond with the same protocol as the request,
         // It the protocol is null, then use the Protocol defined by the binding
         if (protocol == null) {
-            try {
-                protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType());
-            } catch (WebServiceException e) {
-                // TODO better handling than this?
-                e.printStackTrace();
-            }
+            protocol = Protocol.getProtocolForBinding(endpointDesc.getBindingType());
         }
         
         // Note all exceptions are caught and rethrown with a WebServiceException

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/XMLPart.java Tue Feb 20 18:55:18 2007
@@ -84,12 +84,31 @@
     
     /**
      * Set the Style. 
-     * If the style is DOCUMENT, the body blocks are loaced underneath the body element.
+     * If the style is DOCUMENT, the body blocks are located underneath the body element.
      * If the style is set to RPC, then the body blocks are located underneath the
      * rpc operation.
      * @param style Style
+     * @see set indirection
      */
     public void setStyle(Style style) throws WebServiceException;
+    
+    /**
+     * Set indirection.  Used to force the code to look for blocks at a particular location.
+     * For DOCUMENT the default is 0
+     * For RPC the default is 1
+     * This method is used to override these settings for special cases. 
+     * @param indirection (0 or 1)
+     */
+    public void setIndirection(int indirection);
+    
+    /**
+     * Get indirection.  Used to force the code to look for blocks at a particular location.
+     * For DOCUMENT the default is 0
+     * For RPC the default is 1
+     * This method is used to override these settings for special cases. 
+     * @return indirection (0 or 1)
+     */
+    public int getIndirection();
 
     /**
      * @return the QName of the operation element if Style.rpc.  Otherwise null

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java Tue Feb 20 18:55:18 2007
@@ -38,14 +38,14 @@
 	private TreeSet<String> contextPackages;  // List of packages needed by the context
 	private JAXBContext jaxbContext = null;
     
-    // For RPC processing only
+    // For RPC processing only...discouraged for other modes
     // In RPC processing, JAXB needs to unmarshal using the
     // "declared type unmarshalling" approach because the
     // element is not known by schema.  If this block will be 
-    // unmarshalled in this fashion, use RPCType to set the 
+    // unmarshalled in this fashion, use processType to set the 
     // declared type.  Please do not use this property for 
     // document style processing.
-    private Class RPCType = null;
+    private Class processType = null;
 	
 	/**
 	 * Normal Constructor JAXBBlockContext
@@ -104,16 +104,16 @@
     /**
      * @return RPC Declared Type
      */
-    public Class getRPCType() {
-        return RPCType;
+    public Class getProcessType() {
+        return processType;
     }
 
     /**
-     * Set RPC Declared Type.  Please do not 
-     * use this property if the message is style=document
+     * Set RPC Declared Type.  The use of 
+     * use this property if the message is style=document is discouraged.
      * @param type
      */
-    public void setRPCType(Class type) {
-        RPCType = type;
+    public void setProcessType(Class type) {
+        processType = type;
     }
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java Tue Feb 20 18:55:18 2007
@@ -107,10 +107,10 @@
             Object jaxb = null;
             
             // Unmarshal into the business object.
-            if (ctx.getRPCType() == null) {
+            if (ctx.getProcessType() == null) {
                 jaxb = unmarshalByElement(u, reader); // preferred and always used for style=document
             } else {
-                jaxb = unmarshalByType(u, reader, ctx.getRPCType());
+                jaxb = unmarshalByType(u, reader, ctx.getProcessType());
             }
             
             
@@ -204,10 +204,10 @@
             JAXBXMLStreamWriterFilter filter = new JAXBXMLStreamWriterFilter(writer);
             
             // Marshal the object
-            if (ctx.getRPCType() == null) {
+            if (ctx.getProcessType() == null) {
                 marshalByElement(busObject, m, filter);
             } else {
-                marshalByType(busObject, m, filter, ctx.getRPCType());
+                marshalByType(busObject, m, filter, ctx.getProcessType());
             }
             
             // Successfully marshalled the data

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageImpl.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageImpl.java Tue Feb 20 18:55:18 2007
@@ -438,4 +438,12 @@
         return postPivot;
     }
 
+    public int getIndirection() {
+        return xmlPart.getIndirection();
+    }
+
+    public void setIndirection(int indirection) {
+        xmlPart.setIndirection(indirection);
+    }
+
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java Tue Feb 20 18:55:18 2007
@@ -89,7 +89,7 @@
 	
 	Protocol protocol = Protocol.unknown;  // Protocol defaults to unknown
     Style style = Style.DOCUMENT;          // Style defaults to document
-    
+    int indirection = 0;                   // Default indirection for Document
 	
 	// The actual xml representation is always one of the following
 	//   OM if the content is an OM tree
@@ -275,6 +275,14 @@
 	public Style getStyle() {
         return style;
     }
+    
+    /* (non-Javadoc)
+     * @see org.apache.axis2.jaxws.message.XMLPart#getIndirection()
+     */
+    public int getIndirection() {
+        return indirection;
+    }
+    
 
     /* (non-Javadoc)
      * @see org.apache.axis2.jaxws.message.XMLPart#setStyle(javax.jws.soap.SOAPBinding.Style)
@@ -287,6 +295,21 @@
             }
         }
         this.style = style;
+        if (style == Style.RPC) {
+            setIndirection(1);
+        } else {
+            setIndirection(0);
+        }
+    }
+    
+    public void setIndirection(int indirection) {
+        if (this.indirection != indirection) {
+            if (contentType == SPINE) {
+                // Must switch to something other than XMLSpine
+                getContentAsOMElement();
+            }
+        }
+        this.indirection = indirection;
     }
 
     public QName getOperationElement() throws WebServiceException {
@@ -317,7 +340,7 @@
     }
 
     public void setOperationElement(QName operationQName) throws WebServiceException {
-        if (this.style == Style.RPC) {
+        if (indirection == 1) {
             this.getContentAsXMLSpine().setOperationElement(operationQName);
         }
     }
@@ -625,7 +648,7 @@
 	protected XMLSpine _createSpine(Protocol protocol) throws WebServiceException {
 		// Default implementation is to simply construct the spine. 
 		// Derived classes may wish to construct a different kind of XMLSpine
-		return new XMLSpineImpl(protocol, getStyle());
+		return new XMLSpineImpl(protocol, getStyle(), getIndirection());
 	}
 	
 	private void setConsumed(boolean consume) { 

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartImpl.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartImpl.java Tue Feb 20 18:55:18 2007
@@ -91,7 +91,7 @@
 
 	@Override
 	protected XMLSpine _convertOM2Spine(OMElement om) throws WebServiceException {
-		return new XMLSpineImpl((org.apache.axiom.soap.SOAPEnvelope) om, getStyle());
+		return new XMLSpineImpl((org.apache.axiom.soap.SOAPEnvelope) om, getStyle(), getIndirection());
 	}
 
 	@Override

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLSpineImpl.java Tue Feb 20 18:55:18 2007
@@ -71,6 +71,7 @@
 	
 	private Protocol protocol = Protocol.unknown;
     private Style style = Style.DOCUMENT;
+    private int indirection = 0;
 	private SOAPEnvelope root = null;
 	private SOAPFactory soapFactory = null;
 	
@@ -82,12 +83,14 @@
 	 * (i.e. the Envelope, Header and Body)
      * @param protocol Protocol
      * @param style Style
+     * @param indirection (0 or 1) indicates location of body blocks
      * @param opQName QName if the Style is RPC
 	 */
-	public XMLSpineImpl(Protocol protocol, Style style) {
+	public XMLSpineImpl(Protocol protocol, Style style, int indirection) {
 		super();
 		this.protocol = protocol;
         this.style = style;
+        this.indirection = indirection;
 		soapFactory = _getFactory(protocol);
 		root = _createEmptyEnvelope(protocol, style, soapFactory);
 	}
@@ -96,11 +99,13 @@
 	 * Create spine from an existing OM tree
 	 * @param envelope
      * @param style Style
+     * @param indirection (0 or 1) indicates location of body blocks
 	 * @throws WebServiceException
 	 */
-	public XMLSpineImpl(SOAPEnvelope envelope, Style style) throws WebServiceException {
+	public XMLSpineImpl(SOAPEnvelope envelope, Style style, int indirection) throws WebServiceException {
 		super();
         this.style = style;
+        this.indirection = indirection;
 		init(envelope);
 		if (root.getNamespace().getNamespaceURI().equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
 			protocol = Protocol.soap11;
@@ -509,7 +514,7 @@
      */
     private OMElement _getBodyBlockParent() {
         SOAPBody body = root.getBody();
-        if (!body.hasFault() && style == Style.RPC) {
+        if (!body.hasFault() && indirection == 1) {
             //  For RPC the blocks are within the operation element
             OMElement op = body.getFirstElement();
             if (op == null) {

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/DLWMinTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/DLWMinTests.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/DLWMinTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/DLWMinTests.java Tue Feb 20 18:55:18 2007
@@ -18,8 +18,10 @@
 
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
 import javax.xml.ws.Service;
 
+import org.apache.axis2.jaxws.dispatch.DispatchTestConstants;
 import org.apache.axis2.jaxws.sample.dlwmin.sei.Greeter;
 
 import junit.framework.TestCase;
@@ -51,5 +53,32 @@
         String me = "Scheu";
         String response = proxy.greetMe(me);
         assertTrue("Hello Scheu".equals(response));
+    }
+    
+    public void testGreetMe_Dispatch() {
+        // Get a dispatch
+        Service svc = Service.create(QNAME_SERVICE);
+        svc.addPort(QNAME_PORT, null, URL_ENDPOINT);
+        Dispatch<String> dispatch = svc.createDispatch(QNAME_PORT, 
+                String.class, Service.Mode.PAYLOAD);
+        BindingProvider p = (BindingProvider) dispatch;
+        p.getRequestContext().put(
+                BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
+        p.getRequestContext().put(
+                BindingProvider.SOAPACTION_URI_PROPERTY, "greetMe");
+        
+        String request =
+            "<pre:greetMe xmlns:pre='http://apache.org/axis2/jaxws/sample/dlwmin'>" +
+            "<pre:requestType>Scheu</pre:requestType>" +
+            "</pre:greetMe>";
+        System.out.println("Doc/Lit Wrapped Minimal Request =" + request);
+        String response = dispatch.invoke(request);
+        System.out.println("Doc/Lit Wrapped Minimal Response =" + response);
+        
+        assertTrue(response.contains("Hello Scheu"));
+        assertTrue(response.contains("dlwmin:greetMeResponse"));
+        assertTrue(response.contains(":responseType") ||
+                   response.contains("responseType xmlns="));  // assert that response type is a qualified element
+        assertTrue(!response.contains("type")); // xsi:type should not be used
     }
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/dlwmin/META-INF/greeter.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/dlwmin/META-INF/greeter.wsdl?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/dlwmin/META-INF/greeter.wsdl (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/dlwmin/META-INF/greeter.wsdl Tue Feb 20 18:55:18 2007
@@ -20,12 +20,11 @@
 <wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:tns="http://apache.org/axis2/jaxws/sample/dlwmin"
-    xmlns:x1="http://apache.org/axis2/jaxws/sample/dlwmin/params"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     targetNamespace="http://apache.org/axis2/jaxws/sample/dlwmin" name="HelloWorld">
     <wsdl:types>
-        <schema targetNamespace="http://apache.org/axis2/jaxws/sample/dlwmin/params" 
+        <schema targetNamespace="http://apache.org/axis2/jaxws/sample/dlwmin" 
             xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
             <import namespace="http://apache.org/axis2/jaxws/sample/dlwmin/types"
                     schemaLocation="greeterTypes.xsd" />
@@ -51,10 +50,10 @@
 
    
     <wsdl:message name="greetMeRequest">
-        <wsdl:part element="x1:greetMe" name="in"/>
+        <wsdl:part element="tns:greetMe" name="in"/>
     </wsdl:message>
     <wsdl:message name="greetMeResponse">
-        <wsdl:part element="x1:greetMeResponse" name="out"/>
+        <wsdl:part element="tns:greetMeResponse" name="out"/>
     </wsdl:message>
 
         

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/dlwmin/sei/Greeter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/dlwmin/sei/Greeter.java?view=diff&rev=509869&r1=509868&r2=509869
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/dlwmin/sei/Greeter.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/dlwmin/sei/Greeter.java Tue Feb 20 18:55:18 2007
@@ -26,10 +26,10 @@
 @WebService(targetNamespace = "http://apache.org/axis2/jaxws/sample/dlwmin", name = "Greeter")
 
 public interface Greeter {
-    @WebResult(targetNamespace = "http://apache.org/axis2/jaxws/sample/dlwmin/params", name = "responseType")
+    @WebResult(targetNamespace = "http://apache.org/axis2/jaxws/sample/dlwmin", name = "responseType")
     @WebMethod(operationName = "greetMe", action="greetMe")
     public java.lang.String greetMe(
-        @WebParam(targetNamespace = "http://apache.org/axis2/jaxws/sample/dlwmin/params", name = "requestType")
+        @WebParam(targetNamespace = "http://apache.org/axis2/jaxws/sample/dlwmin", name = "requestType")
         java.lang.String requestType
     );
 }



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