You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2009/12/21 08:32:00 UTC

svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Author: hansbak
Date: Mon Dec 21 07:31:58 2009
New Revision: 892712

URL: http://svn.apache.org/viewvc?rev=892712&view=rev
Log:
Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in webservices including WSDL generation. see OFBIZ-3363 for more info. A contribution of Antwebsystems employee Chatree

Added:
    ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with props)
    ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with props)
    ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with props)
    ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with props)
    ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar   (with props)
    ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar   (with props)
    ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar   (with props)
    ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
    ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java   (with props)
Modified:
    ofbiz/trunk/LICENSE
    ofbiz/trunk/framework/common/servicedef/services_test.xml
    ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
    ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
    ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
    ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
    ofbiz/trunk/framework/service/testdef/servicetests.xml
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java

Modified: ofbiz/trunk/LICENSE
URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=892712&r1=892711&r2=892712&view=diff
==============================================================================
--- ofbiz/trunk/LICENSE (original)
+++ ofbiz/trunk/LICENSE Mon Dec 21 07:31:58 2009
@@ -87,6 +87,14 @@
 ofbiz/trunk/framework/jetty/lib/xmlParserAPIs-2.6.2.jar
 ofbiz/trunk/framework/service/lib/axis-ant.jar
 ofbiz/trunk/framework/service/lib/axis.jar
+ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
+ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
+ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
+ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar
+ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar
+ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
+ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
+ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
 ofbiz/trunk/framework/webapp/lib/fop-0.95.jar
 ofbiz/trunk/framework/webapp/lib/velocity-1.6.1.jar
 ofbiz/trunk/framework/webapp/lib/xmlgraphics-commons-1.3.1.jar

Modified: ofbiz/trunk/framework/common/servicedef/services_test.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services_test.xml?rev=892712&r1=892711&r2=892712&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/servicedef/services_test.xml (original)
+++ ofbiz/trunk/framework/common/servicedef/services_test.xml Mon Dec 21 07:31:58 2009
@@ -31,6 +31,12 @@
         <attribute name="message" type="String" mode="IN" optional="true"/>
         <attribute name="resp" type="String" mode="OUT"/>
     </service>
+    <service name="testSOAPScv" engine="java" export="true" validate="false" require-new-transaction="true"
+            location="org.ofbiz.common.CommonServices" invoke="testSOAPService">
+        <description>Test SOAP service</description>
+        <attribute name="productCategory" type="org.ofbiz.entity.GenericValue" mode="IN" optional="false"/>
+        <attribute name="products" type="List" mode="OUT" optional="true"/>
+    </service>
     <service name="blockingTestScv" engine="java" export="true" validate="false" require-new-transaction="true" transaction-timeout="20"
             location="org.ofbiz.common.CommonServices" invoke="blockingTestService">
         <description>Blocking Test service</description>
@@ -84,10 +90,15 @@
     </service>
 
     <service name="testSoap" engine="soap" export="true"
+            location="http://localhost:8080/webtools/control/SOAPService" invoke="testSOAPScv">
+        <description>SOAP service; calls the OFBiz test SOAP service</description>
+        <implements service="testSOAPScv"/>
+    </service>
+    
+    <service name="testSoapSimple" engine="soap" export="true"
             location="http://localhost:8080/webtools/control/SOAPService" invoke="testScv">
-        <description>Test SOAP service; calls the OFBiz test service</description>
-        <attribute name="message" type="String" mode="IN" optional="true"/>
-        <attribute name="resp" type="String" mode="OUT"/>
+        <description>simple SOAP service; calls the OFBiz test service</description>
+        <implements service="testScv"/>
     </service>
 
     <service name="testRemoteSoap" engine="soap" export="true"

Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java?rev=892712&r1=892711&r2=892712&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java Mon Dec 21 07:31:58 2009
@@ -26,6 +26,7 @@
 import javax.mail.internet.MimeMessage;
 import javax.transaction.xa.XAException;
 
+import javolution.util.FastList;
 import javolution.util.FastMap;
 
 import org.apache.log4j.Level;
@@ -84,6 +85,32 @@
         System.out.println("----- SVC: " + dctx.getName() + " -----");
         return response;
     }
+    
+    /**
+     * Generic Test SOAP Service
+     *@param dctx The DispatchContext that this service is operating in
+     *@param context Map containing the input parameters
+     *@return Map with the result of the service, the output parameters
+     */
+    public static Map<String, Object> testSOAPService(DispatchContext dctx, Map<String, ?> context) {
+        Delegator delegator = dctx.getDelegator();
+        Map<String, Object> response = ServiceUtil.returnSuccess();
+
+        GenericValue productCategory = (GenericValue) context.get("productCategory");
+        List<GenericValue> products = FastList.newInstance();
+        for (int i = 0; i < 3; i ++) {
+            GenericValue product = delegator.makeValue("Product");
+            product.put("productId", "PROD_TEST" + i);
+            product.put("productTypeId", "FINISHED_GOOD");
+            product.put("primaryProductCategoryId", "202");
+            product.put("internalName", "Product Test " + i);
+            product.put("productName", "Product Test " + i);
+            product.put("createdStamp", UtilDateTime.nowTimestamp());
+            products.add(product);
+        }
+        response.put("products", products);
+        return response;
+    }
 
     public static Map<String, Object> blockingTestService(DispatchContext dctx, Map<String, ?> context) {
         Long duration = (Long) context.get("duration");

Added: ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar?rev=892712&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar?rev=892712&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar?rev=892712&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar?rev=892712&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar?rev=892712&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar?rev=892712&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar?rev=892712&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar?rev=892712&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java?rev=892712&r1=892711&r2=892712&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java Mon Dec 21 07:31:58 2009
@@ -207,47 +207,56 @@
     public Part getWSDLPart(Definition def) throws WSDLException {
         Part part = def.createPart();
         part.setName(this.name);
-        part.setTypeName(new QName(ModelService.XSD, this.java2wsdlType()));
+        part.setTypeName(new QName(ModelService.TNS, this.java2wsdlType()));
         return part;
     }
 
     protected String java2wsdlType() throws WSDLException {
         if (ObjectType.instanceOf(java.lang.Character.class, this.type)) {
-            return "string";
+            return "std-String";
         } else if (ObjectType.instanceOf(java.lang.String.class, this.type)) {
-            return "string";
+            return "std-String";
         } else if (ObjectType.instanceOf(java.lang.Byte.class, this.type)) {
-            return "byte";
+            return "std-String";
         } else if (ObjectType.instanceOf(java.lang.Boolean.class, this.type)) {
-            return "boolean";
+            return "std-Boolean";
         } else if (ObjectType.instanceOf(java.lang.Integer.class, this.type)) {
-            return "int";
+            return "std-Integer";
         } else if (ObjectType.instanceOf(java.lang.Double.class, this.type)) {
-            return "double";
+            return "std-Double";
         } else if (ObjectType.instanceOf(java.lang.Float.class, this.type)) {
-            return "float";
+            return "std-Float";
         } else if (ObjectType.instanceOf(java.lang.Short.class, this.type)) {
-            return "short";
+            return "std-Integer";
         } else if (ObjectType.instanceOf(java.math.BigDecimal.class, this.type)) {
-            return "decimal";
+            return "std-Long";
         } else if (ObjectType.instanceOf(java.math.BigInteger.class, this.type)) {
-            return "integer";
+            return "std-Integer";
         } else if (ObjectType.instanceOf(java.util.Calendar.class, this.type)) {
-            return "dateTime";
+            return "sql-Timestamp";
         } else if (ObjectType.instanceOf(com.ibm.icu.util.Calendar.class, this.type)) {
-            return "dateTime";
+            return "sql-Timestamp";
         } else if (ObjectType.instanceOf(java.sql.Date.class, this.type)) {
-            return "date";
+            return "sql-Date";
         } else if (ObjectType.instanceOf(java.util.Date.class, this.type)) {
-            return "dateTime";
+            return "sql-Timestamp";
         } else if (ObjectType.instanceOf(java.lang.Long.class, this.type)) {
-            return "unsignedInt";
+            return "std-Long";
         } else if (ObjectType.instanceOf(java.sql.Timestamp.class, this.type)) {
-            return "string";
+            return "sql-Timestamp";
+        } else if (ObjectType.instanceOf(org.ofbiz.entity.GenericValue.class, this.type)) {
+            return "eeval-";
+        } else if (ObjectType.instanceOf(org.ofbiz.entity.GenericPK.class, this.type)) {
+            return "eepk-";
+        } else if (ObjectType.instanceOf(java.util.Map.class, this.type)) {
+            return "map-Map";
+        } else if (ObjectType.instanceOf(java.util.List.class, this.type)) {
+            return "col-LinkedList";
+        } else {
+            return "cus-obj";
         }
 
-        // TODO add array support (maybe even convert List objects); add GenericValue/Map support
-        throw new WSDLException(WSDLException.OTHER_ERROR, "Service cannot be described with WSDL (" + this.name + " / " + this.type + ")");
+        //throw new WSDLException(WSDLException.OTHER_ERROR, "Service cannot be described with WSDL (" + this.name + " / " + this.type + ")");
     }
 
     static class ModelParamValidator implements Serializable {

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java?rev=892712&r1=892711&r2=892712&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java Mon Dec 21 07:31:58 2009
@@ -41,9 +41,11 @@
 import javax.wsdl.Message;
 import javax.wsdl.Operation;
 import javax.wsdl.Output;
+import javax.wsdl.Part;
 import javax.wsdl.Port;
 import javax.wsdl.PortType;
 import javax.wsdl.Service;
+import javax.wsdl.Types;
 import javax.wsdl.WSDLException;
 import javax.wsdl.extensions.soap.SOAPAddress;
 import javax.wsdl.extensions.soap.SOAPBinding;
@@ -51,6 +53,8 @@
 import javax.wsdl.extensions.soap.SOAPOperation;
 import javax.wsdl.factory.WSDLFactory;
 import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
 
 import javolution.util.FastList;
 import javolution.util.FastMap;
@@ -66,6 +70,7 @@
 import org.ofbiz.service.group.GroupServiceModel;
 import org.ofbiz.service.group.ServiceGroupReader;
 import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 
 import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
 import com.ibm.wsdl.extensions.soap.SOAPBindingImpl;
@@ -1189,6 +1194,18 @@
 }
 
     public void getWSDL(Definition def, String locationURI) throws WSDLException {
+
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder builder = null;
+        Document document = null;
+        try {
+            builder = factory.newDocumentBuilder();
+            document = builder.newDocument();
+        } catch (Exception e) {
+            throw new WSDLException("can not create WSDL", module);
+        }
+        def.setTypes(this.getTypes(document, def));
+        
         // set the IN parameters
         Input input = def.createInput();
         Set<String> inParam = this.getInParamNames();
@@ -1196,12 +1213,25 @@
             Message inMessage = def.createMessage();
             inMessage.setQName(new QName(TNS, this.name + "Request"));
             inMessage.setUndefined(false);
+            Part parametersPart = def.createPart();
+            parametersPart.setName("map-Map");
+            parametersPart.setTypeName(new QName(TNS, "map-Map"));
+            inMessage.addPart(parametersPart);
+            Element documentation = document.createElement("wsdl:documentation");
             for (String paramName: inParam) {
                 ModelParam param = this.getParam(paramName);
                 if (!param.internal) {
-                    inMessage.addPart(param.getWSDLPart(def));
+                    Part part = param.getWSDLPart(def);
+                    Element attribute = document.createElement("attribute");
+                    attribute.setAttribute("name", paramName);
+                    attribute.setAttribute("type", part.getTypeName().getLocalPart());
+                    attribute.setAttribute("namespace", part.getTypeName().getNamespaceURI());
+                    attribute.setAttribute("java-class", param.type);
+                    attribute.setAttribute("optional", Boolean.toString(param.optional));
+                    documentation.appendChild(attribute);
                 }
             }
+            parametersPart.setDocumentationElement(documentation);
             def.addMessage(inMessage);
             input.setMessage(inMessage);
         }
@@ -1213,12 +1243,25 @@
             Message outMessage = def.createMessage();
             outMessage.setQName(new QName(TNS, this.name + "Response"));
             outMessage.setUndefined(false);
+            Part resultsPart = def.createPart();
+            resultsPart.setName("map-Map");
+            resultsPart.setTypeName(new QName(TNS, "map-Map"));
+            outMessage.addPart(resultsPart);
+            Element documentation = document.createElement("wsdl:documentation");
             for (String paramName: outParam) {
                 ModelParam param = this.getParam(paramName);
                 if (!param.internal) {
-                    outMessage.addPart(param.getWSDLPart(def));
+                    Part part = param.getWSDLPart(def);
+                    Element attribute = document.createElement("attribute");
+                    attribute.setAttribute("name", paramName);
+                    attribute.setAttribute("type", part.getTypeName().getLocalPart());
+                    attribute.setAttribute("namespace", part.getTypeName().getNamespaceURI());
+                    attribute.setAttribute("java-class", param.type);
+                    attribute.setAttribute("optional", Boolean.toString(param.optional));
+                    documentation.appendChild(attribute);
                 }
             }
+            resultsPart.setDocumentationElement(documentation);
             def.addMessage(outMessage);
             output.setMessage(outMessage);
         }
@@ -1291,4 +1334,410 @@
         service.addPort(port);
         def.addService(service);
     }
+    
+    public Types getTypes(Document document, Definition def) {
+        Types types = def.createTypes();
+        /* Schema */
+        Element schema = document.createElement("xsd:schema");
+        schema.setAttribute("targetNamespace", TNS);
+
+        /*-----------------------------------*/
+        /*--------- Standard Objects --------*/
+        /*-----------------------------------*/
+        
+        /* std-String Element */
+        Element stdStringElement = document.createElement("xsd:element");
+        stdStringElement.setAttribute("name", "std-String");
+        Element stdStringElement0 = document.createElement("xsd:complexType");
+        stdStringElement.appendChild(stdStringElement0);
+        Element stdStringElement1 = document.createElement("xsd:attribute");
+        stdStringElement0.appendChild(stdStringElement1);
+        stdStringElement1.setAttribute("name", "value");
+        stdStringElement1.setAttribute("type", "xsd:string");
+        stdStringElement1.setAttribute("use", "required");
+        schema.appendChild(stdStringElement);
+        /* std-Integer Element */
+        Element stdIntegerElement = document.createElement("xsd:element");
+        stdIntegerElement.setAttribute("name", "std-Integer");
+        Element stdIntegerElement0 = document.createElement("xsd:complexType");
+        stdIntegerElement.appendChild(stdIntegerElement0);
+        Element stdIntegerElement1 = document.createElement("xsd:attribute");
+        stdIntegerElement0.appendChild(stdIntegerElement1);
+        stdIntegerElement1.setAttribute("name", "value");
+        stdIntegerElement1.setAttribute("type", "xsd:integer");
+        stdIntegerElement1.setAttribute("use", "required");
+        schema.appendChild(stdIntegerElement);
+        /* std-Long Element */
+        Element stdLongElement = document.createElement("xsd:element");
+        stdLongElement.setAttribute("name", "std-Long");
+        Element stdLongElement0 = document.createElement("xsd:complexType");
+        stdLongElement.appendChild(stdLongElement0);
+        Element stdLongElement1 = document.createElement("xsd:attribute");
+        stdLongElement0.appendChild(stdLongElement1);
+        stdLongElement1.setAttribute("name", "value");
+        stdLongElement1.setAttribute("type", "xsd:long");
+        stdLongElement1.setAttribute("use", "required");
+        schema.appendChild(stdLongElement);
+        /* std-Float Element */
+        Element stdFloatElement = document.createElement("xsd:element");
+        stdFloatElement.setAttribute("name", "std-Float");
+        Element stdFloatElement0 = document.createElement("xsd:complexType");
+        stdFloatElement.appendChild(stdFloatElement0);
+        Element stdFloatElement1 = document.createElement("xsd:attribute");
+        stdFloatElement0.appendChild(stdFloatElement1);
+        stdFloatElement1.setAttribute("name", "value");
+        stdFloatElement1.setAttribute("type", "xsd:float");
+        stdFloatElement1.setAttribute("use", "required");
+        schema.appendChild(stdFloatElement);
+        /* std-Double Element */
+        Element stdDoubleElement = document.createElement("xsd:element");
+        stdDoubleElement.setAttribute("name", "std-Double");
+        Element stdDoubleElement0 = document.createElement("xsd:complexType");
+        stdDoubleElement.appendChild(stdDoubleElement0);
+        Element stdDoubleElement1 = document.createElement("xsd:attribute");
+        stdDoubleElement0.appendChild(stdDoubleElement1);
+        stdDoubleElement1.setAttribute("name", "value");
+        stdDoubleElement1.setAttribute("type", "xsd:double");
+        stdDoubleElement1.setAttribute("use", "required");
+        schema.appendChild(stdDoubleElement);
+        /* std-Boolean Element */
+        Element stdBooleanElement = document.createElement("xsd:element");
+        stdBooleanElement.setAttribute("name", "std-Boolean");
+        Element stdBooleanElement0 = document.createElement("xsd:complexType");
+        stdBooleanElement.appendChild(stdBooleanElement0);
+        Element stdBooleanElement1 = document.createElement("xsd:attribute");
+        stdBooleanElement0.appendChild(stdBooleanElement1);
+        stdBooleanElement1.setAttribute("name", "value");
+        stdBooleanElement1.setAttribute("type", "xsd:boolean");
+        stdBooleanElement1.setAttribute("use", "required");
+        schema.appendChild(stdBooleanElement);
+        /* std-Locale Element */
+        Element stdLocaleElement = document.createElement("xsd:element");
+        stdLocaleElement.setAttribute("name", "std-Locale");
+        Element stdLocaleElement0 = document.createElement("xsd:complexType");
+        stdLocaleElement.appendChild(stdLocaleElement0);
+        Element stdLocaleElement1 = document.createElement("xsd:attribute");
+        stdLocaleElement0.appendChild(stdLocaleElement1);
+        stdLocaleElement1.setAttribute("name", "value");
+        stdLocaleElement1.setAttribute("type", "xsd:string");
+        stdLocaleElement1.setAttribute("use", "required");
+        schema.appendChild(stdLocaleElement);
+
+        /*-----------------------------------*/
+        /*----------- SQL Objects -----------*/
+        /*-----------------------------------*/
+        
+        /* sql-Timestamp Element */
+        Element sqlTimestampElement = document.createElement("xsd:element");
+        sqlTimestampElement.setAttribute("name", "sql-Timestamp");
+        Element sqlTimestampElement0 = document.createElement("xsd:complexType");
+        sqlTimestampElement.appendChild(sqlTimestampElement0);
+        Element sqlTimestampElement1 = document.createElement("xsd:attribute");
+        sqlTimestampElement0.appendChild(sqlTimestampElement1);
+        sqlTimestampElement1.setAttribute("name", "value");
+        sqlTimestampElement1.setAttribute("type", "xsd:dateTime");
+        sqlTimestampElement1.setAttribute("use", "required");
+        schema.appendChild(sqlTimestampElement);
+        /* sql-Date Element */
+        Element sqlDateElement = document.createElement("xsd:element");
+        sqlDateElement.setAttribute("name", "sql-Date");
+        Element sqlDateElement0 = document.createElement("xsd:complexType");
+        sqlDateElement.appendChild(sqlDateElement0);
+        Element sqlDateElement1 = document.createElement("xsd:attribute");
+        sqlDateElement0.appendChild(sqlDateElement1);
+        sqlDateElement1.setAttribute("name", "value");
+        sqlDateElement1.setAttribute("type", "xsd:date");
+        sqlDateElement1.setAttribute("use", "required");
+        schema.appendChild(sqlDateElement);
+        /* sql-Time Element */
+        Element sqlTimeElement = document.createElement("xsd:element");
+        sqlTimeElement.setAttribute("name", "sql-Time");
+        Element sqlTimeElement0 = document.createElement("xsd:complexType");
+        sqlTimeElement.appendChild(sqlTimeElement0);
+        Element sqlTimeElement1 = document.createElement("xsd:attribute");
+        sqlTimeElement0.appendChild(sqlTimeElement1);
+        sqlTimeElement1.setAttribute("name", "value");
+        sqlTimeElement1.setAttribute("type", "xsd:time");
+        sqlTimeElement1.setAttribute("use", "required");
+        schema.appendChild(sqlTimeElement);
+
+        /*-----------------------------------*/
+        /*----------- List Objects -----------*/
+        /*-----------------------------------*/
+        
+        /* col-ArrayList Element */
+        Element colArrayListElement = document.createElement("xsd:element");
+        colArrayListElement.setAttribute("name", "col-ArrayList");
+        schema.appendChild(colArrayListElement);
+        /* col-LinkedList Element */
+        Element colLinkedListElement = document.createElement("xsd:element");
+        colLinkedListElement.setAttribute("name", "col-LinkedList");
+        schema.appendChild(colLinkedListElement);
+        /* col-Stack Element */
+        Element colStackElement = document.createElement("xsd:element");
+        colStackElement.setAttribute("name", "col-Stack");
+        schema.appendChild(colStackElement);
+        /* col-Vector Element */
+        Element colVectorElement = document.createElement("xsd:element");
+        colVectorElement.setAttribute("name", "col-Vector");
+        schema.appendChild(colVectorElement);
+        /* col-TreeSet Element */
+        Element colTreeSetElement = document.createElement("xsd:element");
+        colTreeSetElement.setAttribute("name", "col-TreeSet");
+        schema.appendChild(colTreeSetElement);
+        /* col-HashSet Element */
+        Element colHashSetElement = document.createElement("xsd:element");
+        colHashSetElement.setAttribute("name", "col-HashSet");
+        schema.appendChild(colHashSetElement);
+        /* col-Collection Element */
+        Element colCollectionElement = document.createElement("xsd:element");
+        colCollectionElement.setAttribute("name", "col-Collection");
+        schema.appendChild(colCollectionElement);
+        
+        /*-----------------------------------*/
+        /*----------- Map Objects -----------*/
+        /*-----------------------------------*/
+        
+        /* map-TreeMap Element */
+        Element mapTreeMapElement = document.createElement("xsd:element");
+        mapTreeMapElement.setAttribute("name", "map-TreeMap");
+        mapTreeMapElement.setAttribute("type", "tns:map-Map");
+        schema.appendChild(mapTreeMapElement);
+        /* map-WeakHashMap Element */
+        Element mapWeakHashMapElement = document.createElement("xsd:element");
+        mapWeakHashMapElement.setAttribute("name", "map-WeakHashMap");
+        mapWeakHashMapElement.setAttribute("type", "tns:map-Map");
+        schema.appendChild(mapWeakHashMapElement);
+        /* map-Hashtable Element */
+        Element mapHashtableElement = document.createElement("xsd:element");
+        mapHashtableElement.setAttribute("name", "map-Hashtable");
+        mapHashtableElement.setAttribute("type", "tns:map-Map");
+        schema.appendChild(mapHashtableElement);
+        /* map-Properties Element */
+        Element mapPropertiesElement = document.createElement("xsd:element");
+        mapPropertiesElement.setAttribute("name", "map-Properties");
+        mapPropertiesElement.setAttribute("type", "tns:map-Map");
+        schema.appendChild(mapPropertiesElement);
+        /* map-HashMap Element */
+        Element mapHashMapElement = document.createElement("xsd:element");
+        mapHashMapElement.setAttribute("name", "map-HashMap");
+        mapHashMapElement.setAttribute("type", "tns:map-Map");
+        schema.appendChild(mapHashMapElement);
+        /* map-Map Element */
+        Element mapMapElement = document.createElement("xsd:element");
+        mapMapElement.setAttribute("name", "map-Map");
+        mapMapElement.setAttribute("type", "tns:map-Map");
+        schema.appendChild(mapMapElement);
+        /* map-Entry Element */
+        Element mapEntryElement = document.createElement("xsd:element");
+        mapEntryElement.setAttribute("name", "map-Entry");
+        mapEntryElement.setAttribute("type", "tns:map-Entry");
+        schema.appendChild(mapEntryElement);
+        /* map-Key Element */
+        Element mapKeyElement = document.createElement("xsd:element");
+        mapKeyElement.setAttribute("name", "map-Key");
+        mapKeyElement.setAttribute("type", "tns:map-Key");
+        schema.appendChild(mapKeyElement);
+        /* map-Value Element */
+        Element mapValueElement = document.createElement("xsd:element");
+        mapValueElement.setAttribute("name", "map-Value");
+        mapValueElement.setAttribute("type", "tns:map-Value");
+        schema.appendChild(mapValueElement);
+        /* eepk- Element */
+        Element eepkElement = document.createElement("xsd:element");
+        eepkElement.setAttribute("name", "eepk-");
+        eepkElement.setAttribute("type", "tns:map-Value");
+        schema.appendChild(eepkElement);
+        /* eeval- Element */
+        Element eevalElement = document.createElement("xsd:element");
+        eevalElement.setAttribute("name", "eeval-");
+        eevalElement.setAttribute("type", "tns:map-Value");
+        schema.appendChild(eevalElement);
+
+        /*-----------------------------------*/
+        /*----------- Custom Objects -----------*/
+        /*-----------------------------------*/
+        
+        /* cus-obj Element */
+        Element cusObjElement = document.createElement("xsd:element");
+        cusObjElement.setAttribute("name", "cus-obj");
+        schema.appendChild(cusObjElement);
+
+        /*-----------------------------------*/
+        /*---------- Complex Types ----------*/
+        /*-----------------------------------*/
+        
+        /* map-Map Complex Type */
+        Element mapMapComplexType = document.createElement("xsd:complexType");
+        mapMapComplexType.setAttribute("name", "map-Map");
+        Element mapMapComplexType0 = document.createElement("xsd:sequence");
+        mapMapComplexType.appendChild(mapMapComplexType0);
+        Element mapMapComplexType1 = document.createElement("xsd:element");
+        mapMapComplexType1.setAttribute("ref", "tns:map-Entry");
+        mapMapComplexType1.setAttribute("minOccurs", "0");
+        mapMapComplexType1.setAttribute("maxOccurs", "unbounded");
+        mapMapComplexType0.appendChild(mapMapComplexType1);
+        schema.appendChild(mapMapComplexType);
+        /* map-Entry Complex Type */
+        Element mapEntryComplexType = document.createElement("xsd:complexType");
+        mapEntryComplexType.setAttribute("name", "map-Entry");
+        Element mapEntryComplexType0 = document.createElement("xsd:sequence");
+        mapEntryComplexType.appendChild(mapEntryComplexType0);
+        Element mapEntryComplexType1 = document.createElement("xsd:element");
+        mapEntryComplexType1.setAttribute("ref", "tns:map-Key");
+        mapEntryComplexType1.setAttribute("minOccurs", "1");
+        mapEntryComplexType1.setAttribute("maxOccurs", "1");
+        mapEntryComplexType0.appendChild(mapEntryComplexType1);
+        Element mapEntryComplexType2 = document.createElement("xsd:element");
+        mapEntryComplexType2.setAttribute("ref", "tns:map-Value");
+        mapEntryComplexType2.setAttribute("minOccurs", "1");
+        mapEntryComplexType2.setAttribute("maxOccurs", "1");
+        mapEntryComplexType0.appendChild(mapEntryComplexType2);
+        schema.appendChild(mapEntryComplexType);
+        /* map-Key Complex Type */
+        Element mapKeyComplexType = document.createElement("xsd:complexType");
+        mapKeyComplexType.setAttribute("name", "map-Key");
+        Element mapKeyComplexType0 = document.createElement("xsd:all");
+        mapKeyComplexType.appendChild(mapKeyComplexType0);
+        Element mapKeyComplexType1 = document.createElement("xsd:element");
+        mapKeyComplexType1.setAttribute("ref", "tns:std-String");
+        mapKeyComplexType1.setAttribute("minOccurs", "1");
+        mapKeyComplexType1.setAttribute("maxOccurs", "1");
+        mapKeyComplexType0.appendChild(mapKeyComplexType1);
+        schema.appendChild(mapKeyComplexType);
+        /* map-Value Complex Type */
+        Element mapValueComplexType = document.createElement("xsd:complexType");
+        mapValueComplexType.setAttribute("name", "map-Value");
+        Element mapValueComplexType0 = document.createElement("xsd:choice");
+        mapValueComplexType.appendChild(mapValueComplexType0);
+        Element mapValueComplexType1 = document.createElement("xsd:element");
+        mapValueComplexType1.setAttribute("ref", "tns:std-String");
+        mapValueComplexType1.setAttribute("minOccurs", "1");
+        mapValueComplexType1.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType1);
+        Element mapValueComplexType2 = document.createElement("xsd:element");
+        mapValueComplexType2.setAttribute("ref", "tns:std-Integer");
+        mapValueComplexType2.setAttribute("minOccurs", "1");
+        mapValueComplexType2.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType2);
+        Element mapValueComplexType3 = document.createElement("xsd:element");
+        mapValueComplexType3.setAttribute("ref", "tns:std-Long");
+        mapValueComplexType3.setAttribute("minOccurs", "1");
+        mapValueComplexType3.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType3);
+        Element mapValueComplexType4 = document.createElement("xsd:element");
+        mapValueComplexType4.setAttribute("ref", "tns:std-Float");
+        mapValueComplexType4.setAttribute("minOccurs", "1");
+        mapValueComplexType4.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType4);
+        Element mapValueComplexType5 = document.createElement("xsd:element");
+        mapValueComplexType5.setAttribute("ref", "tns:std-Double");
+        mapValueComplexType5.setAttribute("minOccurs", "1");
+        mapValueComplexType5.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType5);
+        Element mapValueComplexType6 = document.createElement("xsd:element");
+        mapValueComplexType6.setAttribute("ref", "tns:std-Boolean");
+        mapValueComplexType6.setAttribute("minOccurs", "1");
+        mapValueComplexType6.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType6);
+        Element mapValueComplexType7 = document.createElement("xsd:element");
+        mapValueComplexType7.setAttribute("ref", "tns:std-Locale");
+        mapValueComplexType7.setAttribute("minOccurs", "1");
+        mapValueComplexType7.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType7);
+        Element mapValueComplexType8 = document.createElement("xsd:element");
+        mapValueComplexType8.setAttribute("ref", "tns:sql-Timestamp");
+        mapValueComplexType8.setAttribute("minOccurs", "1");
+        mapValueComplexType8.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType8);
+        Element mapValueComplexType9 = document.createElement("xsd:element");
+        mapValueComplexType9.setAttribute("ref", "tns:sql-Date");
+        mapValueComplexType9.setAttribute("minOccurs", "1");
+        mapValueComplexType9.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType9);
+        Element mapValueComplexType10 = document.createElement("xsd:element");
+        mapValueComplexType10.setAttribute("ref", "tns:sql-Time");
+        mapValueComplexType10.setAttribute("minOccurs", "1");
+        mapValueComplexType10.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType10);
+        Element mapValueComplexType11 = document.createElement("xsd:element");
+        mapValueComplexType11.setAttribute("ref", "tns:col-ArrayList");
+        mapValueComplexType11.setAttribute("minOccurs", "1");
+        mapValueComplexType11.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType11);
+        Element mapValueComplexType12 = document.createElement("xsd:element");
+        mapValueComplexType12.setAttribute("ref", "tns:col-LinkedList");
+        mapValueComplexType12.setAttribute("minOccurs", "1");
+        mapValueComplexType12.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType12);
+        Element mapValueComplexType13 = document.createElement("xsd:element");
+        mapValueComplexType13.setAttribute("ref", "tns:col-Stack");
+        mapValueComplexType13.setAttribute("minOccurs", "1");
+        mapValueComplexType13.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType13);
+        Element mapValueComplexType14 = document.createElement("xsd:element");
+        mapValueComplexType14.setAttribute("ref", "tns:col-Vector");
+        mapValueComplexType14.setAttribute("minOccurs", "1");
+        mapValueComplexType14.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType14);
+        Element mapValueComplexType15 = document.createElement("xsd:element");
+        mapValueComplexType15.setAttribute("ref", "tns:col-TreeSet");
+        mapValueComplexType15.setAttribute("minOccurs", "1");
+        mapValueComplexType15.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType15);
+        Element mapValueComplexType16 = document.createElement("xsd:element");
+        mapValueComplexType16.setAttribute("ref", "tns:col-HashSet");
+        mapValueComplexType16.setAttribute("minOccurs", "1");
+        mapValueComplexType16.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType16);
+        Element mapValueComplexType17 = document.createElement("xsd:element");
+        mapValueComplexType17.setAttribute("ref", "tns:col-Collection");
+        mapValueComplexType17.setAttribute("minOccurs", "1");
+        mapValueComplexType17.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType17);
+        Element mapValueComplexType18 = document.createElement("xsd:element");
+        mapValueComplexType18.setAttribute("ref", "tns:map-HashMap");
+        mapValueComplexType18.setAttribute("minOccurs", "1");
+        mapValueComplexType18.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType18);
+        Element mapValueComplexType19 = document.createElement("xsd:element");
+        mapValueComplexType19.setAttribute("ref", "tns:map-Properties");
+        mapValueComplexType19.setAttribute("minOccurs", "1");
+        mapValueComplexType19.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType19);
+        Element mapValueComplexType20 = document.createElement("xsd:element");
+        mapValueComplexType20.setAttribute("ref", "tns:map-Hashtable");
+        mapValueComplexType20.setAttribute("minOccurs", "1");
+        mapValueComplexType20.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType20);
+        Element mapValueComplexType21 = document.createElement("xsd:element");
+        mapValueComplexType21.setAttribute("ref", "tns:map-WeakHashMap");
+        mapValueComplexType21.setAttribute("minOccurs", "1");
+        mapValueComplexType21.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType21);
+        Element mapValueComplexType22 = document.createElement("xsd:element");
+        mapValueComplexType22.setAttribute("ref", "tns:map-TreeMap");
+        mapValueComplexType22.setAttribute("minOccurs", "1");
+        mapValueComplexType22.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType22);
+        Element mapValueComplexType23 = document.createElement("xsd:element");
+        mapValueComplexType23.setAttribute("ref", "tns:map-Map");
+        mapValueComplexType23.setAttribute("minOccurs", "1");
+        mapValueComplexType23.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType23);
+        Element mapValueComplexType24 = document.createElement("xsd:element");
+        mapValueComplexType24.setAttribute("ref", "tns:eepk-");
+        mapValueComplexType24.setAttribute("minOccurs", "1");
+        mapValueComplexType24.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType24);
+        Element mapValueComplexType25 = document.createElement("xsd:element");
+        mapValueComplexType25.setAttribute("ref", "tns:eeval-");
+        mapValueComplexType25.setAttribute("minOccurs", "1");
+        mapValueComplexType25.setAttribute("maxOccurs", "1");
+        mapValueComplexType0.appendChild(mapValueComplexType25);
+        schema.appendChild(mapValueComplexType);
+        
+        types.setDocumentationElement(schema);
+        return types;
+    }
 }

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java?rev=892712&r1=892711&r2=892712&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java Mon Dec 21 07:31:58 2009
@@ -18,32 +18,32 @@
  *******************************************************************************/
 package org.ofbiz.service.engine;
 
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
+import java.io.StringReader;
 import java.util.List;
 import java.util.Map;
 
 import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.rpc.ServiceException;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
 
 import javolution.util.FastMap;
 
-import org.apache.axis.Message;
-import org.apache.axis.client.Call;
-import org.apache.axis.client.Service;
-import org.apache.axis.encoding.XMLType;
-import org.apache.axis.message.RPCElement;
-import org.apache.axis.message.RPCParam;
-import org.apache.axis.message.SOAPEnvelope;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.serialize.XmlSerializer;
 import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.ModelParam;
 import org.ofbiz.service.ModelService;
 import org.ofbiz.service.ServiceDispatcher;
-import org.ofbiz.base.util.Debug;
-import org.ofbiz.base.util.UtilValidate;
 
 /**
  * Generic Service SOAP Interface
@@ -78,113 +78,67 @@
 
     // Invoke the remote SOAP service
     private Map<String, Object> serviceInvoker(ModelService modelService, Map<String, Object> context) throws GenericServiceException {
+        Delegator delegator = dispatcher.getDelegator();
         if (modelService.location == null || modelService.invoke == null)
             throw new GenericServiceException("Cannot locate service to invoke");
-
-        Service service = null;
-        Call call = null;
-
+        
+        ServiceClient client = null;
+        QName serviceName = null;
+        
         try {
-            service = new Service();
-            call = (Call) service.createCall();
-        } catch (javax.xml.rpc.JAXRPCException e) {
-            throw new GenericServiceException("RPC service error", e);
-        } catch (ServiceException e) {//Add by Andy.Chen 2003.01.15
+            client = new ServiceClient();
+            Options options = new Options();
+            EndpointReference endPoint = new EndpointReference(this.getLocation(modelService));
+            options.setTo(endPoint);
+            client.setOptions(options);
+        } catch (AxisFault e) {
             throw new GenericServiceException("RPC service error", e);
         }
-
-        URL endPoint = null;
-
-        try {
-            endPoint = new URL(this.getLocation(modelService));
-        } catch (MalformedURLException e) {
-            throw new GenericServiceException("Location not a valid URL", e);
-        }
-
+        
         List<ModelParam> inModelParamList = modelService.getInModelParamList();
-
+        
         if (Debug.infoOn()) Debug.logInfo("[SOAPClientEngine.invoke] : Parameter length - " + inModelParamList.size(), module);
-
-        call.setTargetEndpointAddress(endPoint);
-
+        
         if (UtilValidate.isNotEmpty(modelService.nameSpace)) {
-            call.setOperationName(new QName(modelService.nameSpace, modelService.invoke));
+            serviceName = new QName(modelService.nameSpace, modelService.invoke);
         } else {
-            call.setOperationName(modelService.invoke);
+            serviceName = new QName(modelService.invoke);
         }
-
+        
         int i = 0;
-
-        call.setOperation(call.getOperationName().getLocalPart());
-        List<Object> vParams = new ArrayList<Object>();
+        
+        Map<String, Object> parameterMap = FastMap.newInstance();
         for (ModelParam p: inModelParamList) {
             if (Debug.infoOn()) Debug.logInfo("[SOAPClientEngine.invoke} : Parameter: " + p.name + " (" + p.mode + ") - " + i, module);
 
             // exclude params that ModelServiceReader insert into (internal params)
             if (!p.internal) {
-                QName qName = call.getParameterTypeByName(p.name); //.getTypeMapping().getTypeQName((Class) ObjectType.classNameClassMap.get(p.type));
-                call.addParameter(p.name, qName, getMode(p.mode));
-                vParams.add(context.get(p.name));
+                parameterMap.put(p.name, context.get(p.name));
             }
             i++;
         }
 
-        call.setReturnType(XMLType.XSD_ANYTYPE);
-        Object[] params=vParams.toArray(new Object[vParams.size()]);
-
-        Object result = null;
-
+        OMElement parameterSer = null;
+        
         try {
-            Debug.logInfo("[SOAPClientEngine.invoke] : Sending Call To SOAP Server", module);
-            result = call.invoke(params);
-        } catch (java.rmi.RemoteException e) {
-            throw new GenericServiceException("RPC error", e);
-        }
-        if (Debug.verboseOn()) {
-            Debug.log("SOAP Service Result - " + result, module);
+            String xmlParameters = XmlSerializer.serialize(parameterMap);
+            XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xmlParameters));
+            StAXOMBuilder builder = new StAXOMBuilder(reader);
+            parameterSer = builder.getDocumentElement();
+        } catch (Exception e) {
+            Debug.logError(e, module);
         }
-
-        return getResponseParams(call.getMessageContext().getResponseMessage());
-    }
-
-    private Map<String, Object> getResponseParams(Message respMessage) {
-        Map<String, Object> mRet = FastMap.newInstance();
+        
+        Map<String, Object> results = null;
         try {
-            SOAPEnvelope resEnv = respMessage.getSOAPEnvelope();
-            Iterator<?> i = resEnv.getBodyElements().iterator();
-            while (i.hasNext()) {
-                Object o = i.next();
-
-                if (o instanceof RPCElement) {
-                    RPCElement body = (RPCElement) o;
- 
-                    Iterator<?> p = body.getParams().iterator();
-                    while (p.hasNext()) {
-                        RPCParam param = (RPCParam) p.next();
-                        mRet.put(param.getName(), param.getValue());
-                        if (Debug.verboseOn()) {
-                            Debug.log("SOAP Client Param - " + param.getName() + "=" + param.getValue(), module);
-                        }
-                    }
-                }
-            }
-        } catch (org.apache.axis.AxisFault e) {
-            Debug.logError(e, "AxisFault", module);
-        } catch (org.xml.sax.SAXException e) {
-            Debug.logError(e, "SAXException", module);
-        }
-        return mRet;
-    }
-
-    private ParameterMode getMode(String sMode) {
-        if (sMode.equals("IN")) {
-            return ParameterMode.IN;
-        } else if (sMode.equals("OUT")) {
-            return ParameterMode.OUT;
-        } else if (sMode.equals("INOUT")) {
-            return ParameterMode.INOUT;
-        } else {
-            return null;
+            OMFactory factory = OMAbstractFactory.getOMFactory();
+            OMElement payload = factory.createOMElement(serviceName);
+            payload.addChild(parameterSer.getFirstElement());
+            OMElement respOMElement = client.sendReceive(payload);
+            results = (Map<String, Object>) XmlSerializer.deserialize(respOMElement.toString(), delegator);
+        } catch (Exception e) {
+            Debug.logError(e, module);
         }
+        return results;
     }
 }

Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java?rev=892712&view=auto
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java (added)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java Mon Dec 21 07:31:58 2009
@@ -0,0 +1,43 @@
+package org.ofbiz.service.test;
+
+import java.util.List;
+import java.util.Map;
+
+import javolution.util.FastMap;
+
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilDateTime;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.service.testtools.OFBizTestCase;
+
+public class ServiceSOAPTests extends OFBizTestCase {
+    
+    public final static String module = ServiceSOAPTests.class.getName();
+
+    public ServiceSOAPTests(String name) {
+        // TODO Auto-generated constructor stub
+        super(name);
+    }
+    
+    public void testSOAPSimpleService() throws Exception {
+        Map<String, Object> serviceContext = FastMap.newInstance();
+        serviceContext.put("defaultValue", new Double("123.4567"));
+        serviceContext.put("message", "Test Message !!!");
+        Map<String, Object> results = dispatcher.runSync("testSoapSimple", serviceContext);
+        String resp = (String) results.get("resp");
+    }
+    
+    public void testSOAPService() throws Exception {
+        Map<String, Object> serviceContext = FastMap.newInstance();
+        GenericValue productCategory = delegator.makeValue("ProductCategory");
+        productCategory.put("productCategoryId", "PRODCAT_TEST");
+        productCategory.put("productCategoryTypeId", "CATALOG_CATEGORY");
+        productCategory.put("categoryName", "Test ProductCategory");
+        productCategory.put("createdStamp", UtilDateTime.nowTimestamp());
+        serviceContext.put("productCategory", productCategory);
+        Map<String, Object> results = dispatcher.runSync("testSoap", serviceContext);
+        List<GenericValue> products = (List<GenericValue>) results.get("products");
+        assertNotNull(products);
+    }
+}

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/service/testdef/servicetests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/testdef/servicetests.xml?rev=892712&r1=892711&r2=892712&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/testdef/servicetests.xml (original)
+++ ofbiz/trunk/framework/service/testdef/servicetests.xml Mon Dec 21 07:31:58 2009
@@ -22,6 +22,7 @@
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
     <test-case case-name="service-tests"><junit-test-suite class-name="org.ofbiz.service.test.ServiceEngineTests"/></test-case>
+    <test-case case-name="service-soap-tests"><junit-test-suite class-name="org.ofbiz.service.test.ServiceSOAPTests"/></test-case>
 
     <test-case case-name="load-service-test-data">
         <entity-xml action="load" entity-xml-url="component://service/testdef/data/ServiceTestData.xml"/>

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java?rev=892712&r1=892711&r2=892712&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java Mon Dec 21 07:31:58 2009
@@ -18,33 +18,35 @@
  *******************************************************************************/
 package org.ofbiz.webapp.event;
 
-import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.io.StringReader;
 import java.io.Writer;
-import java.util.List;
+import java.util.Iterator;
 import java.util.Map;
 
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.wsdl.WSDLException;
-import javax.xml.soap.SOAPException;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
 
 import javolution.util.FastMap;
 
-import org.apache.axis.AxisFault;
-import org.apache.axis.Constants;
-import org.apache.axis.Message;
-import org.apache.axis.MessageContext;
-import org.apache.axis.message.RPCElement;
-import org.apache.axis.message.RPCParam;
-import org.apache.axis.message.SOAPEnvelope;
-import org.apache.axis.server.AxisServer;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
 import org.ofbiz.base.util.Debug;
-import org.ofbiz.base.util.UtilGenerics;
-import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilXml;
+import org.ofbiz.entity.GenericDelegator;
+import org.ofbiz.entity.serialize.XmlSerializer;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.LocalDispatcher;
@@ -72,7 +74,7 @@
      */
     public String invoke(Event event, RequestMap requestMap, HttpServletRequest request, HttpServletResponse response) throws EventHandlerException {
         LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
-        AxisServer axisServer;
+        GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
 
         // first check for WSDL request
         String wsdlReq = request.getParameter("wsdl");
@@ -138,163 +140,119 @@
         }
 
         // not a wsdl request; invoke the service
-        try {
-            axisServer = AxisServer.getServer(UtilMisc.toMap("name", "OFBiz/Axis Server", "provider", null));
-        } catch (AxisFault e) {
-            sendError(response, e);
-            throw new EventHandlerException("Problems with the AXIS server", e);
-        }
-        MessageContext mctx = new MessageContext(axisServer);
-        mctx.setEncodingStyle(Constants.URI_LITERAL_ENC); // sets the response encoding
-
-        // get the SOAP message
-        Message msg = null;
-
-        try {
-            msg = new Message(request.getInputStream(), false,
-                        request.getHeader("Content-Type"), request.getHeader("Content-Location"));
-        } catch (IOException ioe) {
-            sendError(response, "Problem processing the service");
-            throw new EventHandlerException("Cannot read the input stream", ioe);
-        }
-
-        if (msg == null) {
-            sendError(response, "No message");
-            throw new EventHandlerException("SOAP Message is null");
-        }
-
-        // log the request message
-        if (Debug.verboseOn()) {
-            try {
-                Debug.logInfo("Request Message:\n" + messageToString(msg) + "\n", module);
-            } catch (Throwable t) {
-            }
-        }
-
-        mctx.setRequestMessage(msg);
-
-        // new envelopes
-        SOAPEnvelope resEnv = new SOAPEnvelope();
+        
+        // request envelope
         SOAPEnvelope reqEnv = null;
-
+        
         // get the service name and parameters
         try {
-            reqEnv = (SOAPEnvelope) msg.getSOAPPart().getEnvelope();
-        } catch (SOAPException e) {
+            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(request.getInputStream());
+            StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(xmlReader);
+            reqEnv = (SOAPEnvelope) builder.getDocumentElement();
+            
+            // log the request message
+            if (Debug.verboseOn()) {
+                try {
+                    Debug.logInfo("Request Message:\n" + reqEnv + "\n", module);
+                } catch (Throwable t) {
+                }
+            }
+        } catch (Exception e) {
             sendError(response, "Problem processing the service");
             throw new EventHandlerException("Cannot get the envelope", e);
         }
-
-        List<Object> bodies = null;
-
-        try {
-            bodies = UtilGenerics.checkList(reqEnv.getBodyElements());
-        } catch (AxisFault e) {
-            sendError(response, e);
-            throw new EventHandlerException(e.getMessage(), e);
-        }
-
+        
         Debug.logVerbose("[Processing]: SOAP Event", module);
+        
+        try {
+            // each is a different service call
+            SOAPBody reqBody = reqEnv.getBody();
+            Iterator serviceIter = reqBody.getChildElements();
+            while (serviceIter.hasNext()) {
+                Object serviceObj = serviceIter.next();
+                if (serviceObj instanceof OMElement) {
+                    OMElement serviceElement = (OMElement) serviceObj;
+                    String serviceName = serviceElement.getLocalName();
+                    Map<String, Object> parameters = (Map<String, Object>) XmlSerializer.deserialize(serviceElement.toString(), delegator);
+                    try {
+                        // verify the service is exported for remote execution and invoke it
+                        ModelService model = dispatcher.getDispatchContext().getModelService(serviceName);
 
-        // each is a different service call
-        for (Object o: bodies) {
-
-            if (o instanceof RPCElement) {
-                RPCElement body = (RPCElement) o;
-                String serviceName = body.getMethodName();
-                List<RPCParam> params = null;
-                try {
-                    params = UtilGenerics.checkList(body.getParams());
-                } catch (Exception e) {
-                    sendError(response, e);
-                    throw new EventHandlerException(e.getMessage(), e);
-                }
-                Map<String, Object> serviceContext = FastMap.newInstance();
-                for (RPCParam param: params) {
-                    if (Debug.verboseOn()) Debug.logVerbose("[Reading Param]: " + param.getName(), module);
-                    serviceContext.put(param.getName(), param.getObjectValue());
-                }
-                try {
-                    // verify the service is exported for remote execution and invoke it
-                    ModelService model = dispatcher.getDispatchContext().getModelService(serviceName);
-
-                    if (model != null && model.export) {
-                        Map<String, Object> result = dispatcher.runSync(serviceName, serviceContext);
-
-                        Debug.logVerbose("[EventHandler] : Service invoked", module);
-                        RPCElement resBody = new RPCElement(serviceName + "Response");
-
-                        resBody.setPrefix(body.getPrefix());
-                        resBody.setNamespaceURI(body.getNamespaceURI());
-
-                        for (Map.Entry<String, Object> entry: result.entrySet()) {
-                            RPCParam par = new RPCParam(entry.getKey(), entry.getValue());
+                        if (model != null && model.export) {
+                            Map<String, Object> results = dispatcher.runSync(serviceName, parameters);
+                            Debug.logVerbose("[EventHandler] : Service invoked", module);
+
+                            // setup the response
+                            Debug.logVerbose("[EventHandler] : Setting up response message", module);
+                            String xmlResults = XmlSerializer.serialize(results);
+                            XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xmlResults));
+                            StAXOMBuilder resultsBuilder = new StAXOMBuilder(reader);
+                            OMElement resultSer = resultsBuilder.getDocumentElement();
+                            
+                            // create the response soap
+                            SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
+                            SOAPEnvelope resEnv = factory.createSOAPEnvelope();
+                            SOAPBody resBody = factory.createSOAPBody();
+                            OMElement resService = factory.createOMElement(new QName(serviceName + "Response"));
+                            resService.addChild(resultSer.getFirstElement());
+                            resBody.addChild(resService);
+                            resEnv.addChild(resBody);
+                            
+                            // log the response message
+                            if (Debug.verboseOn()) {
+                                try {
+                                    Debug.log("Response Message:\n" + resEnv + "\n", module);
+                                } catch (Throwable t) {
+                                }
+                            }
 
-                            resBody.addParam(par);
+                            resEnv.serialize(response.getOutputStream());
+                            response.getOutputStream().flush();
                         }
-                        resEnv.addBodyElement(resBody);
-                        resEnv.setEncodingStyle(Constants.URI_LITERAL_ENC);
-                    } else {
-                        sendError(response, "Requested service not available");
-                        throw new EventHandlerException("Service is not exported");
+
+                    } catch (GenericServiceException e) {
+                        sendError(response, "Problem processing the service");
+                        throw new EventHandlerException(e.getMessage(), e);
                     }
-                } catch (GenericServiceException e) {
-                    sendError(response, "Problem processing the service");
-                    throw new EventHandlerException(e.getMessage(), e);
-                } catch (javax.xml.soap.SOAPException e) {
-                    sendError(response, "Problem processing the service");
-                    throw new EventHandlerException(e.getMessage(), e);
                 }
             }
-        }
-
-        // setup the response
-        Debug.logVerbose("[EventHandler] : Setting up response message", module);
-        msg = new Message(resEnv);
-        mctx.setResponseMessage(msg);
-        if (msg == null) {
-            sendError(response, "No response message available");
-            throw new EventHandlerException("No response message available");
-        }
-
-        // log the response message
-        if (Debug.verboseOn()) {
-            try {
-                Debug.log("Response Message:\n" + messageToString(msg) + "\n", module);
-            } catch (Throwable t) {
-            }
-        }
-
-        try {
-            response.setContentType(msg.getContentType(Constants.DEFAULT_SOAP_VERSION));
-            response.setContentLength(Integer.parseInt(Long.toString(msg.getContentLength())));
-        } catch (AxisFault e) {
-            sendError(response, e);
+        } catch (Exception e) {
+            sendError(response, e.getMessage());
             throw new EventHandlerException(e.getMessage(), e);
         }
-
-        try {
-            msg.writeTo(response.getOutputStream());
-            response.flushBuffer();
-        } catch (IOException e) {
-            throw new EventHandlerException("Cannot write to the output stream");
-        } catch (SOAPException e) {
-            throw new EventHandlerException("Cannot write message to the output stream");
-        }
-
-        Debug.logVerbose("[EventHandler] : Message sent to requester", module);
-
+        
         return null;
     }
 
-    private void sendError(HttpServletResponse res, Object obj) throws EventHandlerException {
-        Message msg = new Message(obj);
-
+    private void sendError(HttpServletResponse res, String errorMessage) throws EventHandlerException {
         try {
-            res.setContentType(msg.getContentType(Constants.DEFAULT_SOAP_VERSION));
-            res.setContentLength(Integer.parseInt(Long.toString(msg.getContentLength())));
-            msg.writeTo(res.getOutputStream());
-            res.flushBuffer();
+            // setup the response
+            Map<String, Object> results = FastMap.newInstance();
+            results.put("errorMessage", errorMessage);
+            String xmlResults= XmlSerializer.serialize(results);
+            XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xmlResults));
+            StAXOMBuilder resultsBuilder = new StAXOMBuilder(xmlReader);
+            OMElement resultSer = resultsBuilder.getDocumentElement();
+            
+            // create the response soap
+            SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
+            SOAPEnvelope resEnv = factory.createSOAPEnvelope();
+            SOAPBody resBody = factory.createSOAPBody();
+            OMElement errMsg = factory.createOMElement(new QName("Response"));
+            errMsg.addChild(resultSer.getFirstElement());
+            resBody.addChild(errMsg);
+            resEnv.addChild(resBody);
+            
+            // log the response message
+            if (Debug.verboseOn()) {
+                try {
+                    Debug.log("Response Message:\n" + resEnv + "\n", module);
+                } catch (Throwable t) {
+                }
+            }
+            
+            resEnv.serialize(res.getOutputStream());
+            res.getOutputStream().flush();
         } catch (Exception e) {
             throw new EventHandlerException(e.getMessage(), e);
         }
@@ -320,10 +278,4 @@
         uri.append(reqInfo);
         return uri.toString();
     }
-
-    public static String messageToString(Message msg) throws SOAPException, IOException {
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        msg.writeTo(out);
-        return out.toString();
-    }
 }



Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Posted by Scott Gray <sc...@hotwaxmedia.com>.
Thanks Hans

Regards
Scott

On 22/12/2009, at 8:39 PM, Hans Bakker wrote:

> Hi Scott,
>
> thanks again for the suggestion, log message updated.
>
> Regards,
> Hans
>
> On Tue, 2009-12-22 at 20:12 +1300, Scott Gray wrote:
>> Thanks Hans, looks good.
>>
>> One reminder though, there were also unrelated changes in 893087,
>> please remember to either describe them in the commit message as well
>> or ideally commit them separately.
>>
>> Thanks
>> Scott
>>
>> On 22/12/2009, at 7:48 PM, Hans Bakker wrote:
>>
>>> Hi Scott,
>>> Thank you for the comment, suggestion implemented by Chatree and
>>> Committed revision 893087.
>>>
>>> Regards,
>>> Hans
>>>
>>> On Mon, 2009-12-21 at 23:21 +1300, Scott Gray wrote:
>>>> Hi Hans,
>>>>
>>>> Thanks for committing some tests, it's great to see.
>>>>
>>>> One small issue though, the test introduces a dependency on the
>>>> product data model from common and the service engine, this means  
>>>> the
>>>> test would fail in a framework only installation.  I would suggest
>>>> switching the entity over to TestingNode which along with the other
>>>> entities in framework/entity/entitydef/entitymodel_test.xml are
>>>> provided for testing the lower level tools.
>>>>
>>>> Regards
>>>> Scott
>>>>
>>>> HotWax Media
>>>> http://www.hotwaxmedia.com
>>>>
>>>> On 21/12/2009, at 8:32 PM, hansbak@apache.org wrote:
>>>>
>>>>> Author: hansbak
>>>>> Date: Mon Dec 21 07:31:58 2009
>>>>> New Revision: 892712
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
>>>>> Log:
>>>>> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in
>>>>> webservices including WSDL generation. see OFBIZ-3363 for more  
>>>>> info.
>>>>> A contribution of Antwebsystems employee Chatree
>>>>>
>>>>> Added:
>>>>>  ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with
>>>>> props)
>>>>>  ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with
>>>>> props)
>>>>>  ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with
>>>>> props)
>>>>>  ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with
>>>>> props)
>>>>>  ofbiz/trunk/framework/service/lib/axis2-transport-
>>>>> http-1.5.1.jar   (with props)
>>>>>  ofbiz/trunk/framework/service/lib/axis2-transport-
>>>>> local-1.5.1.jar   (with props)
>>>>>  ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
>>>>> (with props)
>>>>>  ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
>>>>>  ofbiz/trunk/framework/service/src/org/ofbiz/service/test/
>>>>> ServiceSOAPTests.java   (with props)
>>>>> Modified:
>>>>>  ofbiz/trunk/LICENSE
>>>>>  ofbiz/trunk/framework/common/servicedef/services_test.xml
>>>>>  ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>>>> CommonServices.java
>>>>>  ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>>>> ModelParam.java
>>>>>  ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>>>> ModelService.java
>>>>>  ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/
>>>>> SOAPClientEngine.java
>>>>>  ofbiz/trunk/framework/service/testdef/servicetests.xml
>>>>>  ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/
>>>>> SOAPEventHandler.java
>>>>>
>>>>> Modified: ofbiz/trunk/LICENSE
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=892712&r1=892711&r2=892712&view=diff
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- ofbiz/trunk/LICENSE (original)
>>>>> +++ ofbiz/trunk/LICENSE Mon Dec 21 07:31:58 2009
>>>>> @@ -87,6 +87,14 @@
>>>>> ofbiz/trunk/framework/jetty/lib/xmlParserAPIs-2.6.2.jar
>>>>> ofbiz/trunk/framework/service/lib/axis-ant.jar
>>>>> ofbiz/trunk/framework/service/lib/axis.jar
>>>>> +ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
>>>>> +ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
>>>>> +ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
>>>>> +ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar
>>>>> +ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar
>>>>> +ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
>>>>> +ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
>>>>> +ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
>>>>> ofbiz/trunk/framework/webapp/lib/fop-0.95.jar
>>>>> ofbiz/trunk/framework/webapp/lib/velocity-1.6.1.jar
>>>>> ofbiz/trunk/framework/webapp/lib/xmlgraphics-commons-1.3.1.jar
>>>>>
>>>>> Modified: ofbiz/trunk/framework/common/servicedef/ 
>>>>> services_test.xml
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services_test.xml?rev=892712&r1=892711&r2=892712&view=diff
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- ofbiz/trunk/framework/common/servicedef/services_test.xml
>>>>> (original)
>>>>> +++ ofbiz/trunk/framework/common/servicedef/services_test.xml Mon
>>>>> Dec 21 07:31:58 2009
>>>>> @@ -31,6 +31,12 @@
>>>>>       <attribute name="message" type="String" mode="IN"
>>>>> optional="true"/>
>>>>>       <attribute name="resp" type="String" mode="OUT"/>
>>>>>   </service>
>>>>> +    <service name="testSOAPScv" engine="java" export="true"
>>>>> validate="false" require-new-transaction="true"
>>>>> +            location="org.ofbiz.common.CommonServices"
>>>>> invoke="testSOAPService">
>>>>> +        <description>Test SOAP service</description>
>>>>> +        <attribute name="productCategory"
>>>>> type="org.ofbiz.entity.GenericValue" mode="IN" optional="false"/>
>>>>> +        <attribute name="products" type="List" mode="OUT"
>>>>> optional="true"/>
>>>>> +    </service>
>>>>>   <service name="blockingTestScv" engine="java" export="true"
>>>>> validate="false" require-new-transaction="true" transaction-
>>>>> timeout="20"
>>>>>           location="org.ofbiz.common.CommonServices"
>>>>> invoke="blockingTestService">
>>>>>       <description>Blocking Test service</description>
>>>>> @@ -84,10 +90,15 @@
>>>>>   </service>
>>>>>
>>>>>   <service name="testSoap" engine="soap" export="true"
>>>>> +            location="http://localhost:8080/webtools/control/SOAPService
>>>>> " invoke="testSOAPScv">
>>>>> +        <description>SOAP service; calls the OFBiz test SOAP
>>>>> service</description>
>>>>> +        <implements service="testSOAPScv"/>
>>>>> +    </service>
>>>>> +
>>>>> +    <service name="testSoapSimple" engine="soap" export="true"
>>>>>           location="http://localhost:8080/webtools/control/SOAPService
>>>>> " invoke="testScv">
>>>>> -        <description>Test SOAP service; calls the OFBiz test
>>>>> service</description>
>>>>> -        <attribute name="message" type="String" mode="IN"
>>>>> optional="true"/>
>>>>> -        <attribute name="resp" type="String" mode="OUT"/>
>>>>> +        <description>simple SOAP service; calls the OFBiz test
>>>>> service</description>
>>>>> +        <implements service="testScv"/>
>>>>>   </service>
>>>>>
>>>>>   <service name="testRemoteSoap" engine="soap" export="true"
>>>>>
>>>>> Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>>>> CommonServices.java
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java?rev=892712&r1=892711&r2=892712&view=diff
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>>>> CommonServices.java (original)
>>>>> +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>>>> CommonServices.java Mon Dec 21 07:31:58 2009
>>>>> @@ -26,6 +26,7 @@
>>>>> import javax.mail.internet.MimeMessage;
>>>>> import javax.transaction.xa.XAException;
>>>>>
>>>>> +import javolution.util.FastList;
>>>>> import javolution.util.FastMap;
>>>>>
>>>>> import org.apache.log4j.Level;
>>>>> @@ -84,6 +85,32 @@
>>>>>       System.out.println("----- SVC: " + dctx.getName() + "
>>>>> -----");
>>>>>       return response;
>>>>>   }
>>>>> +
>>>>> +    /**
>>>>> +     * Generic Test SOAP Service
>>>>> +     *@param dctx The DispatchContext that this service is
>>>>> operating in
>>>>> +     *@param context Map containing the input parameters
>>>>> +     *@return Map with the result of the service, the output
>>>>> parameters
>>>>> +     */
>>>>> +    public static Map<String, Object>
>>>>> testSOAPService(DispatchContext dctx, Map<String, ?> context) {
>>>>> +        Delegator delegator = dctx.getDelegator();
>>>>> +        Map<String, Object> response =  
>>>>> ServiceUtil.returnSuccess();
>>>>> +
>>>>> +        GenericValue productCategory = (GenericValue)
>>>>> context.get("productCategory");
>>>>> +        List<GenericValue> products = FastList.newInstance();
>>>>> +        for (int i = 0; i < 3; i ++) {
>>>>> +            GenericValue product =  
>>>>> delegator.makeValue("Product");
>>>>> +            product.put("productId", "PROD_TEST" + i);
>>>>> +            product.put("productTypeId", "FINISHED_GOOD");
>>>>> +            product.put("primaryProductCategoryId", "202");
>>>>> +            product.put("internalName", "Product Test " + i);
>>>>> +            product.put("productName", "Product Test " + i);
>>>>> +            product.put("createdStamp",
>>>>> UtilDateTime.nowTimestamp());
>>>>> +            products.add(product);
>>>>> +        }
>>>>> +        response.put("products", products);
>>>>> +        return response;
>>>>> +    }
>>>>>
>>>>>   public static Map<String, Object>
>>>>> blockingTestService(DispatchContext dctx, Map<String, ?>  
>>>>> context) {
>>>>>       Long duration = (Long) context.get("duration");
>>>>>
>>>>> Added: ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar?rev=892712&view=auto
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> Binary file - no diff available.
>>>>>
>>>>> Propchange: ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
>>>>> ------------------------------------------------------------------------------
>>>>>  svn:mime-type = application/octet-stream
>>>>>
>>>>> Added: ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar?rev=892712&view=auto
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> Binary file - no diff available.
>>>>>
>>>>> Propchange: ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
>>>>> ------------------------------------------------------------------------------
>>>>>  svn:mime-type = application/octet-stream
>>>>>
>>>>> Added: ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar?rev=892712&view=auto
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> Binary file - no diff available.
>>>>>
>>>>> Propchange: ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
>>>>> ------------------------------------------------------------------------------
>>>>>  svn:mime-type = application/octet-stream
>>>>>
>>>>> Added: ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar?rev=892712&view=auto
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> Binary file - no diff available.
>>>>>
>>>>> Propchange: ofbiz/trunk/framework/service/lib/axis2- 
>>>>> kernel-1.5.1.jar
>>>>> ------------------------------------------------------------------------------
>>>>>  svn:mime-type = application/octet-stream
>>>>>
>>>>> Added: ofbiz/trunk/framework/service/lib/axis2-transport-
>>>>> http-1.5.1.jar
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar?rev=892712&view=auto
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> Binary file - no diff available.
>>>>>
>>>>> Propchange: ofbiz/trunk/framework/service/lib/axis2-transport-
>>>>> http-1.5.1.jar
>>>>> ------------------------------------------------------------------------------
>>>>>  svn:mime-type = application/octet-stream
>>>>>
>>>>> Added: ofbiz/trunk/framework/service/lib/axis2-transport-
>>>>> local-1.5.1.jar
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar?rev=892712&view=auto
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> Binary file - no diff available.
>>>>>
>>>>> Propchange: ofbiz/trunk/framework/service/lib/axis2-transport-
>>>>> local-1.5.1.jar
>>>>> ------------------------------------------------------------------------------
>>>>>  svn:mime-type = application/octet-stream
>>>>>
>>>>> Added: ofbiz/trunk/framework/service/lib/commons- 
>>>>> httpclient-3.1.jar
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar?rev=892712&view=auto
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> Binary file - no diff available.
>>>>>
>>>>> Propchange: ofbiz/trunk/framework/service/lib/commons-
>>>>> httpclient-3.1.jar
>>>>> ------------------------------------------------------------------------------
>>>>>  svn:mime-type = application/octet-stream
>>>>>
>>>>> Added: ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar?rev=892712&view=auto
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> Binary file - no diff available.
>>>>>
>>>>> Propchange: ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
>>>>> ------------------------------------------------------------------------------
>>>>>  svn:mime-type = application/octet-stream
>>>>>
>>>>> Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>>>> ModelParam.java
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java?rev=892712&r1=892711&r2=892712&view=diff
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>>>> ModelParam.java (original)
>>>>> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>>>> ModelParam.java Mon Dec 21 07:31:58 2009
>>>>> @@ -207,47 +207,56 @@
>>>>>   public Part getWSDLPart(Definition def) throws WSDLException {
>>>>>       Part part = def.createPart();
>>>>>       part.setName(this.name);
>>>>> -        part.setTypeName(new QName(ModelService.XSD,
>>>>> this.java2wsdlType()));
>>>>> +        part.setTypeName(new QName(ModelService.TNS,
>>>>> this.java2wsdlType()));
>>>>>       return part;
>>>>>   }
>>>>>
>>>>>   protected String java2wsdlType() throws WSDLException {
>>>>>       if (ObjectType.instanceOf(java.lang.Character.class,
>>>>> this.type)) {
>>>>> -            return "string";
>>>>> +            return "std-String";
>>>>>       } else if (ObjectType.instanceOf(java.lang.String.class,
>>>>> this.type)) {
>>>>> -            return "string";
>>>>> +            return "std-String";
>>>>>       } else if (ObjectType.instanceOf(java.lang.Byte.class,
>>>>> this.type)) {
>>>>> -            return "byte";
>>>>> +            return "std-String";
>>>>>       } else if (ObjectType.instanceOf(java.lang.Boolean.class,
>>>>> this.type)) {
>>>>> -            return "boolean";
>>>>> +            return "std-Boolean";
>>>>>       } else if (ObjectType.instanceOf(java.lang.Integer.class,
>>>>> this.type)) {
>>>>> -            return "int";
>>>>> +            return "std-Integer";
>>>>>       } else if (ObjectType.instanceOf(java.lang.Double.class,
>>>>> this.type)) {
>>>>> -            return "double";
>>>>> +            return "std-Double";
>>>>>       } else if (ObjectType.instanceOf(java.lang.Float.class,
>>>>> this.type)) {
>>>>> -            return "float";
>>>>> +            return "std-Float";
>>>>>       } else if (ObjectType.instanceOf(java.lang.Short.class,
>>>>> this.type)) {
>>>>> -            return "short";
>>>>> +            return "std-Integer";
>>>>>       } else if (ObjectType.instanceOf(java.math.BigDecimal.class,
>>>>> this.type)) {
>>>>> -            return "decimal";
>>>>> +            return "std-Long";
>>>>>       } else if (ObjectType.instanceOf(java.math.BigInteger.class,
>>>>> this.type)) {
>>>>> -            return "integer";
>>>>> +            return "std-Integer";
>>>>>       } else if (ObjectType.instanceOf(java.util.Calendar.class,
>>>>> this.type)) {
>>>>> -            return "dateTime";
>>>>> +            return "sql-Timestamp";
>>>>>       } else if
>>>>> (ObjectType.instanceOf(com.ibm.icu.util.Calendar.class,
>>>>> this.type)) {
>>>>> -            return "dateTime";
>>>>> +            return "sql-Timestamp";
>>>>>       } else if (ObjectType.instanceOf(java.sql.Date.class,
>>>>> this.type)) {
>>>>> -            return "date";
>>>>> +            return "sql-Date";
>>>>>       } else if (ObjectType.instanceOf(java.util.Date.class,
>>>>> this.type)) {
>>>>> -            return "dateTime";
>>>>> +            return "sql-Timestamp";
>>>>>       } else if (ObjectType.instanceOf(java.lang.Long.class,
>>>>> this.type)) {
>>>>> -            return "unsignedInt";
>>>>> +            return "std-Long";
>>>>>       } else if (ObjectType.instanceOf(java.sql.Timestamp.class,
>>>>> this.type)) {
>>>>> -            return "string";
>>>>> +            return "sql-Timestamp";
>>>>> +        } else if
>>>>> (ObjectType.instanceOf(org.ofbiz.entity.GenericValue.class,
>>>>> this.type)) {
>>>>> +            return "eeval-";
>>>>> +        } else if
>>>>> (ObjectType.instanceOf(org.ofbiz.entity.GenericPK.class,
>>>>> this.type)) {
>>>>> +            return "eepk-";
>>>>> +        } else if (ObjectType.instanceOf(java.util.Map.class,
>>>>> this.type)) {
>>>>> +            return "map-Map";
>>>>> +        } else if (ObjectType.instanceOf(java.util.List.class,
>>>>> this.type)) {
>>>>> +            return "col-LinkedList";
>>>>> +        } else {
>>>>> +            return "cus-obj";
>>>>>       }
>>>>>
>>>>> -        // TODO add array support (maybe even convert List
>>>>> objects); add GenericValue/Map support
>>>>> -        throw new WSDLException(WSDLException.OTHER_ERROR,  
>>>>> "Service
>>>>> cannot be described with WSDL (" + this.name + " / " + this.type +
>>>>> ")");
>>>>> +        //throw new WSDLException(WSDLException.OTHER_ERROR,
>>>>> "Service cannot be described with WSDL (" + this.name + " / " +
>>>>> this.type + ")");
>>>>>   }
>>>>>
>>>>>   static class ModelParamValidator implements Serializable {
>>>>>
>>>>> Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>>>> ModelService.java
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java?rev=892712&r1=892711&r2=892712&view=diff
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>>>> ModelService.java (original)
>>>>> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>>>> ModelService.java Mon Dec 21 07:31:58 2009
>>>>> @@ -41,9 +41,11 @@
>>>>> import javax.wsdl.Message;
>>>>> import javax.wsdl.Operation;
>>>>> import javax.wsdl.Output;
>>>>> +import javax.wsdl.Part;
>>>>> import javax.wsdl.Port;
>>>>> import javax.wsdl.PortType;
>>>>> import javax.wsdl.Service;
>>>>> +import javax.wsdl.Types;
>>>>> import javax.wsdl.WSDLException;
>>>>> import javax.wsdl.extensions.soap.SOAPAddress;
>>>>> import javax.wsdl.extensions.soap.SOAPBinding;
>>>>> @@ -51,6 +53,8 @@
>>>>> import javax.wsdl.extensions.soap.SOAPOperation;
>>>>> import javax.wsdl.factory.WSDLFactory;
>>>>> import javax.xml.namespace.QName;
>>>>> +import javax.xml.parsers.DocumentBuilder;
>>>>> +import javax.xml.parsers.DocumentBuilderFactory;
>>>>>
>>>>> import javolution.util.FastList;
>>>>> import javolution.util.FastMap;
>>>>> @@ -66,6 +70,7 @@
>>>>> import org.ofbiz.service.group.GroupServiceModel;
>>>>> import org.ofbiz.service.group.ServiceGroupReader;
>>>>> import org.w3c.dom.Document;
>>>>> +import org.w3c.dom.Element;
>>>>>
>>>>> import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
>>>>> import com.ibm.wsdl.extensions.soap.SOAPBindingImpl;
>>>>> @@ -1189,6 +1194,18 @@
>>>>> }
>>>>>
>>>>>   public void getWSDL(Definition def, String locationURI) throws
>>>>> WSDLException {
>>>>> +
>>>>> +        DocumentBuilderFactory factory =
>>>>> DocumentBuilderFactory.newInstance();
>>>>> +        DocumentBuilder builder = null;
>>>>> +        Document document = null;
>>>>> +        try {
>>>>> +            builder = factory.newDocumentBuilder();
>>>>> +            document = builder.newDocument();
>>>>> +        } catch (Exception e) {
>>>>> +            throw new WSDLException("can not create WSDL",  
>>>>> module);
>>>>> +        }
>>>>> +        def.setTypes(this.getTypes(document, def));
>>>>> +
>>>>>       // set the IN parameters
>>>>>       Input input = def.createInput();
>>>>>       Set<String> inParam = this.getInParamNames();
>>>>> @@ -1196,12 +1213,25 @@
>>>>>           Message inMessage = def.createMessage();
>>>>>           inMessage.setQName(new QName(TNS, this.name +
>>>>> "Request"));
>>>>>           inMessage.setUndefined(false);
>>>>> +            Part parametersPart = def.createPart();
>>>>> +            parametersPart.setName("map-Map");
>>>>> +            parametersPart.setTypeName(new QName(TNS, "map- 
>>>>> Map"));
>>>>> +            inMessage.addPart(parametersPart);
>>>>> +            Element documentation =
>>>>> document.createElement("wsdl:documentation");
>>>>>           for (String paramName: inParam) {
>>>>>               ModelParam param = this.getParam(paramName);
>>>>>               if (!param.internal) {
>>>>> -                    inMessage.addPart(param.getWSDLPart(def));
>>>>> +                    Part part = param.getWSDLPart(def);
>>>>> +                    Element attribute =
>>>>> document.createElement("attribute");
>>>>> +                    attribute.setAttribute("name", paramName);
>>>>> +                    attribute.setAttribute("type",
>>>>> part.getTypeName().getLocalPart());
>>>>> +                    attribute.setAttribute("namespace",
>>>>> part.getTypeName().getNamespaceURI());
>>>>> +                    attribute.setAttribute("java-class",
>>>>> param.type);
>>>>> +                    attribute.setAttribute("optional",
>>>>> Boolean.toString(param.optional));
>>>>> +                    documentation.appendChild(attribute);
>>>>>               }
>>>>>           }
>>>>> +             
>>>>> parametersPart.setDocumentationElement(documentation);
>>>>>           def.addMessage(inMessage);
>>>>>           input.setMessage(inMessage);
>>>>>       }
>>>>> @@ -1213,12 +1243,25 @@
>>>>>           Message outMessage = def.createMessage();
>>>>>           outMessage.setQName(new QName(TNS, this.name +
>>>>> "Response"));
>>>>>           outMessage.setUndefined(false);
>>>>> +            Part resultsPart = def.createPart();
>>>>> +            resultsPart.setName("map-Map");
>>>>> +            resultsPart.setTypeName(new QName(TNS, "map-Map"));
>>>>> +            outMessage.addPart(resultsPart);
>>>>> +            Element documentation =
>>>>> document.createElement("wsdl:documentation");
>>>>>           for (String paramName: outParam) {
>>>>>               ModelParam param = this.getParam(paramName);
>>>>>               if (!param.internal) {
>>>>> -                    outMessage.addPart(param.getWSDLPart(def));
>>>>> +                    Part part = param.getWSDLPart(def);
>>>>> +                    Element attribute =
>>>>> document.createElement("attribute");
>>>>> +                    attribute.setAttribute("name", paramName);
>>>>> +                    attribute.setAttribute("type",
>>>>> part.getTypeName().getLocalPart());
>>>>> +                    attribute.setAttribute("namespace",
>>>>> part.getTypeName().getNamespaceURI());
>>>>> +                    attribute.setAttribute("java-class",
>>>>> param.type);
>>>>> +                    attribute.setAttribute("optional",
>>>>> Boolean.toString(param.optional));
>>>>> +                    documentation.appendChild(attribute);
>>>>>               }
>>>>>           }
>>>>> +            resultsPart.setDocumentationElement(documentation);
>>>>>           def.addMessage(outMessage);
>>>>>           output.setMessage(outMessage);
>>>>>       }
>>>>> @@ -1291,4 +1334,410 @@
>>>>>       service.addPort(port);
>>>>>       def.addService(service);
>>>>>   }
>>>>> +
>>>>> +    public Types getTypes(Document document, Definition def) {
>>>>> +        Types types = def.createTypes();
>>>>> +        /* Schema */
>>>>> +        Element schema = document.createElement("xsd:schema");
>>>>> +        schema.setAttribute("targetNamespace", TNS);
>>>>> +
>>>>> +        /*-----------------------------------*/
>>>>> +        /*--------- Standard Objects --------*/
>>>>> +        /*-----------------------------------*/
>>>>> +
>>>>> +        /* std-String Element */
>>>>> +        Element stdStringElement =
>>>>> document.createElement("xsd:element");
>>>>> +        stdStringElement.setAttribute("name", "std-String");
>>>>> +        Element stdStringElement0 =
>>>>> document.createElement("xsd:complexType");
>>>>> +        stdStringElement.appendChild(stdStringElement0);
>>>>> +        Element stdStringElement1 =
>>>>> document.createElement("xsd:attribute");
>>>>> +        stdStringElement0.appendChild(stdStringElement1);
>>>>> +        stdStringElement1.setAttribute("name", "value");
>>>>> +        stdStringElement1.setAttribute("type", "xsd:string");
>>>>> +        stdStringElement1.setAttribute("use", "required");
>>>>> +        schema.appendChild(stdStringElement);
>>>>> +        /* std-Integer Element */
>>>>> +        Element stdIntegerElement =
>>>>> document.createElement("xsd:element");
>>>>> +        stdIntegerElement.setAttribute("name", "std-Integer");
>>>>> +        Element stdIntegerElement0 =
>>>>> document.createElement("xsd:complexType");
>>>>> +        stdIntegerElement.appendChild(stdIntegerElement0);
>>>>> +        Element stdIntegerElement1 =
>>>>> document.createElement("xsd:attribute");
>>>>> +        stdIntegerElement0.appendChild(stdIntegerElement1);
>>>>> +        stdIntegerElement1.setAttribute("name", "value");
>>>>> +        stdIntegerElement1.setAttribute("type", "xsd:integer");
>>>>> +        stdIntegerElement1.setAttribute("use", "required");
>>>>> +        schema.appendChild(stdIntegerElement);
>>>>> +        /* std-Long Element */
>>>>> +        Element stdLongElement =
>>>>> document.createElement("xsd:element");
>>>>> +        stdLongElement.setAttribute("name", "std-Long");
>>>>> +        Element stdLongElement0 =
>>>>> document.createElement("xsd:complexType");
>>>>> +        stdLongElement.appendChild(stdLongElement0);
>>>>> +        Element stdLongElement1 =
>>>>> document.createElement("xsd:attribute");
>>>>> +        stdLongElement0.appendChild(stdLongElement1);
>>>>> +        stdLongElement1.setAttribute("name", "value");
>>>>> +        stdLongElement1.setAttribute("type", "xsd:long");
>>>>> +        stdLongElement1.setAttribute("use", "required");
>>>>> +        schema.appendChild(stdLongElement);
>>>>> +        /* std-Float Element */
>>>>> +        Element stdFloatElement =
>>>>> document.createElement("xsd:element");
>>>>> +        stdFloatElement.setAttribute("name", "std-Float");
>>>>> +        Element stdFloatElement0 =
>>>>> document.createElement("xsd:complexType");
>>>>> +        stdFloatElement.appendChild(stdFloatElement0);
>>>>> +        Element stdFloatElement1 =
>>>>> document.createElement("xsd:attribute");
>>>>> +        stdFloatElement0.appendChild(stdFloatElement1);
>>>>> +        stdFloatElement1.setAttribute("name", "value");
>>>>> +        stdFloatElement1.setAttribute("type", "xsd:float");
>>>>> +        stdFloatElement1.setAttribute("use", "required");
>>>>> +        schema.appendChild(stdFloatElement);
>>>>> +        /* std-Double Element */
>>>>> +        Element stdDoubleElement =
>>>>> document.createElement("xsd:element");
>>>>> +        stdDoubleElement.setAttribute("name", "std-Double");
>>>>> +        Element stdDoubleElement0 =
>>>>> document.createElement("xsd:complexType");
>>>>> +        stdDoubleElement.appendChild(stdDoubleElement0);
>>>>> +        Element stdDoubleElement1 =
>>>>> document.createElement("xsd:attribute");
>>>>> +        stdDoubleElement0.appendChild(stdDoubleElement1);
>>>>> +        stdDoubleElement1.setAttribute("name", "value");
>>>>> +        stdDoubleElement1.setAttribute("type", "xsd:double");
>>>>> +        stdDoubleElement1.setAttribute("use", "required");
>>>>> +        schema.appendChild(stdDoubleElement);
>>>>> +        /* std-Boolean Element */
>>>>> +        Element stdBooleanElement =
>>>>> document.createElement("xsd:element");
>>>>> +        stdBooleanElement.setAttribute("name", "std-Boolean");
>>>>> +        Element stdBooleanElement0 =
>>>>> document.createElement("xsd:complexType");
>>>>> +        stdBooleanElement.appendChild(stdBooleanElement0);
>>>>> +        Element stdBooleanElement1 =
>>>>> document.createElement("xsd:attribute");
>>>>> +        stdBooleanElement0.appendChild(stdBooleanElement1);
>>>>> +        stdBooleanElement1.setAttribute("name", "value");
>>>>> +        stdBooleanElement1.setAttribute("type", "xsd:boolean");
>>>>> +        stdBooleanElement1.setAttribute("use", "required");
>>>>> +        schema.appendChild(stdBooleanElement);
>>>>> +        /* std-Locale Element */
>>>>> +        Element stdLocaleElement =
>>>>> document.createElement("xsd:element");
>>>>> +        stdLocaleElement.setAttribute("name", "std-Locale");
>>>>> +        Element stdLocaleElement0 =
>>>>> document.createElement("xsd:complexType");
>>>>> +        stdLocaleElement.appendChild(stdLocaleElement0);
>>>>> +        Element stdLocaleElement1 =
>>>>> document.createElement("xsd:attribute");
>>>>> +        stdLocaleElement0.appendChild(stdLocaleElement1);
>>>>> +        stdLocaleElement1.setAttribute("name", "value");
>>>>> +        stdLocaleElement1.setAttribute("type", "xsd:string");
>>>>> +        stdLocaleElement1.setAttribute("use", "required");
>>>>> +        schema.appendChild(stdLocaleElement);
>>>>> +
>>>>> +        /*-----------------------------------*/
>>>>> +        /*----------- SQL Objects -----------*/
>>>>> +        /*-----------------------------------*/
>>>>> +
>>>>> +        /* sql-Timestamp Element */
>>>>> +        Element sqlTimestampElement =
>>>>> document.createElement("xsd:element");
>>>>> +        sqlTimestampElement.setAttribute("name", "sql- 
>>>>> Timestamp");
>>>>> +        Element sqlTimestampElement0 =
>>>>> document.createElement("xsd:complexType");
>>>>> +        sqlTimestampElement.appendChild(sqlTimestampElement0);
>>>>> +        Element sqlTimestampElement1 =
>>>>> document.createElement("xsd:attribute");
>>>>> +        sqlTimestampElement0.appendChild(sqlTimestampElement1);
>>>>> +        sqlTimestampElement1.setAttribute("name", "value");
>>>>> +        sqlTimestampElement1.setAttribute("type",  
>>>>> "xsd:dateTime");
>>>>> +        sqlTimestampElement1.setAttribute("use", "required");
>>>>> +        schema.appendChild(sqlTimestampElement);
>>>>> +        /* sql-Date Element */
>>>>> +        Element sqlDateElement =
>>>>> document.createElement("xsd:element");
>>>>> +        sqlDateElement.setAttribute("name", "sql-Date");
>>>>> +        Element sqlDateElement0 =
>>>>> document.createElement("xsd:complexType");
>>>>> +        sqlDateElement.appendChild(sqlDateElement0);
>>>>> +        Element sqlDateElement1 =
>>>>> document.createElement("xsd:attribute");
>>>>> +        sqlDateElement0.appendChild(sqlDateElement1);
>>>>> +        sqlDateElement1.setAttribute("name", "value");
>>>>> +        sqlDateElement1.setAttribute("type", "xsd:date");
>>>>> +        sqlDateElement1.setAttribute("use", "required");
>>>>> +        schema.appendChild(sqlDateElement);
>>>>> +        /* sql-Time Element */
>>>>> +        Element sqlTimeElement =
>>>>> document.createElement("xsd:element");
>>>>> +        sqlTimeElement.setAttribute("name", "sql-Time");
>>>>> +        Element sqlTimeElement0 =
>>>>> document.createElement("xsd:complexType");
>>>>> +        sqlTimeElement.appendChild(sqlTimeElement0);
>>>>> +        Element sqlTimeElement1 =
>>>>> document.createElement("xsd:attribute");
>>>>> +        sqlTimeElement0.appendChild(sqlTimeElement1);
>>>>> +        sqlTimeElement1.setAttribute("name", "value");
>>>>> +        sqlTimeElement1.setAttribute("type", "xsd:time");
>>>>> +        sqlTimeElement1.setAttribute("use", "required");
>>>>> +        schema.appendChild(sqlTimeElement);
>>>>> +
>>>>> +        /*-----------------------------------*/
>>>>> +        /*----------- List Objects -----------*/
>>>>> +        /*-----------------------------------*/
>>>>> +
>>>>> +        /* col-ArrayList Element */
>>>>> +        Element colArrayListElement =
>>>>> document.createElement("xsd:element");
>>>>> +        colArrayListElement.setAttribute("name", "col- 
>>>>> ArrayList");
>>>>> +        schema.appendChild(colArrayListElement);
>>>>> +        /* col-LinkedList Element */
>>>>> +        Element colLinkedListElement =
>>>>> document.createElement("xsd:element");
>>>>> +        colLinkedListElement.setAttribute("name", "col-
>>>>> LinkedList");
>>>>> +        schema.appendChild(colLinkedListElement);
>>>>> +        /* col-Stack Element */
>>>>> +        Element colStackElement =
>>>>> document.createElement("xsd:element");
>>>>> +        colStackElement.setAttribute("name", "col-Stack");
>>>>> +        schema.appendChild(colStackElement);
>>>>> +        /* col-Vector Element */
>>>>> +        Element colVectorElement =
>>>>> document.createElement("xsd:element");
>>>>> +        colVectorElement.setAttribute("name", "col-Vector");
>>>>> +        schema.appendChild(colVectorElement);
>>>>> +        /* col-TreeSet Element */
>>>>> +        Element colTreeSetElement =
>>>>> document.createElement("xsd:element");
>>>>> +        colTreeSetElement.setAttribute("name", "col-TreeSet");
>>>>> +        schema.appendChild(colTreeSetElement);
>>>>> +        /* col-HashSet Element */
>>>>> +        Element colHashSetElement =
>>>>> document.createElement("xsd:element");
>>>>> +        colHashSetElement.setAttribute("name", "col-HashSet");
>>>>> +        schema.appendChild(colHashSetElement);
>>>>> +        /* col-Collection Element */
>>>>> +        Element colCollectionElement =
>>>>> document.createElement("xsd:element");
>>>>> +        colCollectionElement.setAttribute("name", "col-
>>>>> Collection");
>>>>> +        schema.appendChild(colCollectionElement);
>>>>> +
>>>>> +        /*-----------------------------------*/
>>>>> +        /*----------- Map Objects -----------*/
>>>>> +        /*-----------------------------------*/
>>>>> +
>>>>> +        /* map-TreeMap Element */
>>>>> +        Element mapTreeMapElement =
>>>>> document.createElement("xsd:element");
>>>>> +        mapTreeMapElement.setAttribute("name", "map-TreeMap");
>>>>> +        mapTreeMapElement.setAttribute("type", "tns:map-Map");
>>>>> +        schema.appendChild(mapTreeMapElement);
>>>>> +        /* map-WeakHashMap Element */
>>>>> +        Element mapWeakHashMapElement =
>>>>> document.createElement("xsd:element");
>>>>> +        mapWeakHashMapElement.setAttribute("name", "map-
>>>>> WeakHashMap");
>>>>> +        mapWeakHashMapElement.setAttribute("type", "tns:map- 
>>>>> Map");
>>>>> +        schema.appendChild(mapWeakHashMapElement);
>>>>> +        /* map-Hashtable Element */
>>>>> +        Element mapHashtableElement =
>>>>> document.createElement("xsd:element");
>>>>> +        mapHashtableElement.setAttribute("name", "map- 
>>>>> Hashtable");
>>>>> +        mapHashtableElement.setAttribute("type", "tns:map-Map");
>>>>> +        schema.appendChild(mapHashtableElement);
>>>>> +        /* map-Properties Element */
>>>>> +        Element mapPropertiesElement =
>>>>> document.createElement("xsd:element");
>>>>> +        mapPropertiesElement.setAttribute("name", "map-
>>>>> Properties");
>>>>> +        mapPropertiesElement.setAttribute("type", "tns:map-Map");
>>>>> +        schema.appendChild(mapPropertiesElement);
>>>>> +        /* map-HashMap Element */
>>>>> +        Element mapHashMapElement =
>>>>> document.createElement("xsd:element");
>>>>> +        mapHashMapElement.setAttribute("name", "map-HashMap");
>>>>> +        mapHashMapElement.setAttribute("type", "tns:map-Map");
>>>>> +        schema.appendChild(mapHashMapElement);
>>>>> +        /* map-Map Element */
>>>>> +        Element mapMapElement =
>>>>> document.createElement("xsd:element");
>>>>> +        mapMapElement.setAttribute("name", "map-Map");
>>>>> +        mapMapElement.setAttribute("type", "tns:map-Map");
>>>>> +        schema.appendChild(mapMapElement);
>>>>> +        /* map-Entry Element */
>>>>> +        Element mapEntryElement =
>>>>> document.createElement("xsd:element");
>>>>> +        mapEntryElement.setAttribute("name", "map-Entry");
>>>>> +        mapEntryElement.setAttribute("type", "tns:map-Entry");
>>>>> +        schema.appendChild(mapEntryElement);
>>>>> +        /* map-Key Element */
>>>>> +        Element mapKeyElement =
>>>>> document.createElement("xsd:element");
>>>>> +        mapKeyElement.setAttribute("name", "map-Key");
>>>>> +        mapKeyElement.setAttribute("type", "tns:map-Key");
>>>>> +        schema.appendChild(mapKeyElement);
>>>>> +        /* map-Value Element */
>>>>> +        Element mapValueElement =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueElement.setAttribute("name", "map-Value");
>>>>> +        mapValueElement.setAttribute("type", "tns:map-Value");
>>>>> +        schema.appendChild(mapValueElement);
>>>>> +        /* eepk- Element */
>>>>> +        Element eepkElement =
>>>>> document.createElement("xsd:element");
>>>>> +        eepkElement.setAttribute("name", "eepk-");
>>>>> +        eepkElement.setAttribute("type", "tns:map-Value");
>>>>> +        schema.appendChild(eepkElement);
>>>>> +        /* eeval- Element */
>>>>> +        Element eevalElement =
>>>>> document.createElement("xsd:element");
>>>>> +        eevalElement.setAttribute("name", "eeval-");
>>>>> +        eevalElement.setAttribute("type", "tns:map-Value");
>>>>> +        schema.appendChild(eevalElement);
>>>>> +
>>>>> +        /*-----------------------------------*/
>>>>> +        /*----------- Custom Objects -----------*/
>>>>> +        /*-----------------------------------*/
>>>>> +
>>>>> +        /* cus-obj Element */
>>>>> +        Element cusObjElement =
>>>>> document.createElement("xsd:element");
>>>>> +        cusObjElement.setAttribute("name", "cus-obj");
>>>>> +        schema.appendChild(cusObjElement);
>>>>> +
>>>>> +        /*-----------------------------------*/
>>>>> +        /*---------- Complex Types ----------*/
>>>>> +        /*-----------------------------------*/
>>>>> +
>>>>> +        /* map-Map Complex Type */
>>>>> +        Element mapMapComplexType =
>>>>> document.createElement("xsd:complexType");
>>>>> +        mapMapComplexType.setAttribute("name", "map-Map");
>>>>> +        Element mapMapComplexType0 =
>>>>> document.createElement("xsd:sequence");
>>>>> +        mapMapComplexType.appendChild(mapMapComplexType0);
>>>>> +        Element mapMapComplexType1 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapMapComplexType1.setAttribute("ref", "tns:map-Entry");
>>>>> +        mapMapComplexType1.setAttribute("minOccurs", "0");
>>>>> +        mapMapComplexType1.setAttribute("maxOccurs",  
>>>>> "unbounded");
>>>>> +        mapMapComplexType0.appendChild(mapMapComplexType1);
>>>>> +        schema.appendChild(mapMapComplexType);
>>>>> +        /* map-Entry Complex Type */
>>>>> +        Element mapEntryComplexType =
>>>>> document.createElement("xsd:complexType");
>>>>> +        mapEntryComplexType.setAttribute("name", "map-Entry");
>>>>> +        Element mapEntryComplexType0 =
>>>>> document.createElement("xsd:sequence");
>>>>> +        mapEntryComplexType.appendChild(mapEntryComplexType0);
>>>>> +        Element mapEntryComplexType1 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapEntryComplexType1.setAttribute("ref", "tns:map-Key");
>>>>> +        mapEntryComplexType1.setAttribute("minOccurs", "1");
>>>>> +        mapEntryComplexType1.setAttribute("maxOccurs", "1");
>>>>> +        mapEntryComplexType0.appendChild(mapEntryComplexType1);
>>>>> +        Element mapEntryComplexType2 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapEntryComplexType2.setAttribute("ref", "tns:map- 
>>>>> Value");
>>>>> +        mapEntryComplexType2.setAttribute("minOccurs", "1");
>>>>> +        mapEntryComplexType2.setAttribute("maxOccurs", "1");
>>>>> +        mapEntryComplexType0.appendChild(mapEntryComplexType2);
>>>>> +        schema.appendChild(mapEntryComplexType);
>>>>> +        /* map-Key Complex Type */
>>>>> +        Element mapKeyComplexType =
>>>>> document.createElement("xsd:complexType");
>>>>> +        mapKeyComplexType.setAttribute("name", "map-Key");
>>>>> +        Element mapKeyComplexType0 =
>>>>> document.createElement("xsd:all");
>>>>> +        mapKeyComplexType.appendChild(mapKeyComplexType0);
>>>>> +        Element mapKeyComplexType1 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapKeyComplexType1.setAttribute("ref", "tns:std-String");
>>>>> +        mapKeyComplexType1.setAttribute("minOccurs", "1");
>>>>> +        mapKeyComplexType1.setAttribute("maxOccurs", "1");
>>>>> +        mapKeyComplexType0.appendChild(mapKeyComplexType1);
>>>>> +        schema.appendChild(mapKeyComplexType);
>>>>> +        /* map-Value Complex Type */
>>>>> +        Element mapValueComplexType =
>>>>> document.createElement("xsd:complexType");
>>>>> +        mapValueComplexType.setAttribute("name", "map-Value");
>>>>> +        Element mapValueComplexType0 =
>>>>> document.createElement("xsd:choice");
>>>>> +        mapValueComplexType.appendChild(mapValueComplexType0);
>>>>> +        Element mapValueComplexType1 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType1.setAttribute("ref", "tns:std- 
>>>>> String");
>>>>> +        mapValueComplexType1.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType1.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType1);
>>>>> +        Element mapValueComplexType2 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType2.setAttribute("ref", "tns:std-
>>>>> Integer");
>>>>> +        mapValueComplexType2.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType2.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType2);
>>>>> +        Element mapValueComplexType3 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType3.setAttribute("ref", "tns:std-Long");
>>>>> +        mapValueComplexType3.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType3.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType3);
>>>>> +        Element mapValueComplexType4 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType4.setAttribute("ref", "tns:std- 
>>>>> Float");
>>>>> +        mapValueComplexType4.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType4.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType4);
>>>>> +        Element mapValueComplexType5 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType5.setAttribute("ref", "tns:std- 
>>>>> Double");
>>>>> +        mapValueComplexType5.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType5.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType5);
>>>>> +        Element mapValueComplexType6 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType6.setAttribute("ref", "tns:std-
>>>>> Boolean");
>>>>> +        mapValueComplexType6.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType6.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType6);
>>>>> +        Element mapValueComplexType7 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType7.setAttribute("ref", "tns:std- 
>>>>> Locale");
>>>>> +        mapValueComplexType7.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType7.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType7);
>>>>> +        Element mapValueComplexType8 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType8.setAttribute("ref", "tns:sql-
>>>>> Timestamp");
>>>>> +        mapValueComplexType8.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType8.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType8);
>>>>> +        Element mapValueComplexType9 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType9.setAttribute("ref", "tns:sql-Date");
>>>>> +        mapValueComplexType9.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType9.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType9);
>>>>> +        Element mapValueComplexType10 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType10.setAttribute("ref", "tns:sql- 
>>>>> Time");
>>>>> +        mapValueComplexType10.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType10.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType10);
>>>>> +        Element mapValueComplexType11 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType11.setAttribute("ref", "tns:col-
>>>>> ArrayList");
>>>>> +        mapValueComplexType11.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType11.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType11);
>>>>> +        Element mapValueComplexType12 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType12.setAttribute("ref", "tns:col-
>>>>> LinkedList");
>>>>> +        mapValueComplexType12.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType12.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType12);
>>>>> +        Element mapValueComplexType13 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType13.setAttribute("ref", "tns:col- 
>>>>> Stack");
>>>>> +        mapValueComplexType13.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType13.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType13);
>>>>> +        Element mapValueComplexType14 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType14.setAttribute("ref", "tns:col-
>>>>> Vector");
>>>>> +        mapValueComplexType14.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType14.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType14);
>>>>> +        Element mapValueComplexType15 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType15.setAttribute("ref", "tns:col-
>>>>> TreeSet");
>>>>> +        mapValueComplexType15.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType15.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType15);
>>>>> +        Element mapValueComplexType16 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType16.setAttribute("ref", "tns:col-
>>>>> HashSet");
>>>>> +        mapValueComplexType16.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType16.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType16);
>>>>> +        Element mapValueComplexType17 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType17.setAttribute("ref", "tns:col-
>>>>> Collection");
>>>>> +        mapValueComplexType17.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType17.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType17);
>>>>> +        Element mapValueComplexType18 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType18.setAttribute("ref", "tns:map-
>>>>> HashMap");
>>>>> +        mapValueComplexType18.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType18.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType18);
>>>>> +        Element mapValueComplexType19 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType19.setAttribute("ref", "tns:map-
>>>>> Properties");
>>>>> +        mapValueComplexType19.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType19.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType19);
>>>>> +        Element mapValueComplexType20 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType20.setAttribute("ref", "tns:map-
>>>>> Hashtable");
>>>>> +        mapValueComplexType20.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType20.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType20);
>>>>> +        Element mapValueComplexType21 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType21.setAttribute("ref", "tns:map-
>>>>> WeakHashMap");
>>>>> +        mapValueComplexType21.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType21.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType21);
>>>>> +        Element mapValueComplexType22 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType22.setAttribute("ref", "tns:map-
>>>>> TreeMap");
>>>>> +        mapValueComplexType22.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType22.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType22);
>>>>> +        Element mapValueComplexType23 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType23.setAttribute("ref", "tns:map-Map");
>>>>> +        mapValueComplexType23.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType23.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType23);
>>>>> +        Element mapValueComplexType24 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType24.setAttribute("ref", "tns:eepk-");
>>>>> +        mapValueComplexType24.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType24.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType24);
>>>>> +        Element mapValueComplexType25 =
>>>>> document.createElement("xsd:element");
>>>>> +        mapValueComplexType25.setAttribute("ref", "tns:eeval-");
>>>>> +        mapValueComplexType25.setAttribute("minOccurs", "1");
>>>>> +        mapValueComplexType25.setAttribute("maxOccurs", "1");
>>>>> +        mapValueComplexType0.appendChild(mapValueComplexType25);
>>>>> +        schema.appendChild(mapValueComplexType);
>>>>> +
>>>>> +        types.setDocumentationElement(schema);
>>>>> +        return types;
>>>>> +    }
>>>>> }
>>>>>
>>>>> Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>>>> engine/
>>>>> SOAPClientEngine.java
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java?rev=892712&r1=892711&r2=892712&view=diff
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/
>>>>> SOAPClientEngine.java (original)
>>>>> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/
>>>>> SOAPClientEngine.java Mon Dec 21 07:31:58 2009
>>>>> @@ -18,32 +18,32 @@
>>>>>
>>>>> *******************************************************************************/
>>>>> package org.ofbiz.service.engine;
>>>>>
>>>>> -import java.net.MalformedURLException;
>>>>> -import java.net.URL;
>>>>> -import java.util.ArrayList;
>>>>> -import java.util.Iterator;
>>>>> +import java.io.StringReader;
>>>>> import java.util.List;
>>>>> import java.util.Map;
>>>>>
>>>>> import javax.xml.namespace.QName;
>>>>> -import javax.xml.rpc.ParameterMode;
>>>>> -import javax.xml.rpc.ServiceException;
>>>>> +import javax.xml.stream.XMLInputFactory;
>>>>> +import javax.xml.stream.XMLStreamReader;
>>>>>
>>>>> import javolution.util.FastMap;
>>>>>
>>>>> -import org.apache.axis.Message;
>>>>> -import org.apache.axis.client.Call;
>>>>> -import org.apache.axis.client.Service;
>>>>> -import org.apache.axis.encoding.XMLType;
>>>>> -import org.apache.axis.message.RPCElement;
>>>>> -import org.apache.axis.message.RPCParam;
>>>>> -import org.apache.axis.message.SOAPEnvelope;
>>>>> +import org.apache.axiom.om.OMAbstractFactory;
>>>>> +import org.apache.axiom.om.OMElement;
>>>>> +import org.apache.axiom.om.OMFactory;
>>>>> +import org.apache.axiom.om.impl.builder.StAXOMBuilder;
>>>>> +import org.apache.axis2.AxisFault;
>>>>> +import org.apache.axis2.addressing.EndpointReference;
>>>>> +import org.apache.axis2.client.Options;
>>>>> +import org.apache.axis2.client.ServiceClient;
>>>>> +import org.ofbiz.base.util.Debug;
>>>>> +import org.ofbiz.base.util.UtilValidate;
>>>>> +import org.ofbiz.entity.Delegator;
>>>>> +import org.ofbiz.entity.serialize.XmlSerializer;
>>>>> import org.ofbiz.service.GenericServiceException;
>>>>> import org.ofbiz.service.ModelParam;
>>>>> import org.ofbiz.service.ModelService;
>>>>> import org.ofbiz.service.ServiceDispatcher;
>>>>> -import org.ofbiz.base.util.Debug;
>>>>> -import org.ofbiz.base.util.UtilValidate;
>>>>>
>>>>> /**
>>>>> * Generic Service SOAP Interface
>>>>> @@ -78,113 +78,67 @@
>>>>>
>>>>>   // Invoke the remote SOAP service
>>>>>   private Map<String, Object> serviceInvoker(ModelService
>>>>> modelService, Map<String, Object> context) throws
>>>>> GenericServiceException {
>>>>> +        Delegator delegator = dispatcher.getDelegator();
>>>>>       if (modelService.location == null || modelService.invoke ==
>>>>> null)
>>>>>           throw new GenericServiceException("Cannot locate service
>>>>> to invoke");
>>>>> -
>>>>> -        Service service = null;
>>>>> -        Call call = null;
>>>>> -
>>>>> +
>>>>> +        ServiceClient client = null;
>>>>> +        QName serviceName = null;
>>>>> +
>>>>>       try {
>>>>> -            service = new Service();
>>>>> -            call = (Call) service.createCall();
>>>>> -        } catch (javax.xml.rpc.JAXRPCException e) {
>>>>> -            throw new GenericServiceException("RPC service  
>>>>> error",
>>>>> e);
>>>>> -        } catch (ServiceException e) {//Add by Andy.Chen  
>>>>> 2003.01.15
>>>>> +            client = new ServiceClient();
>>>>> +            Options options = new Options();
>>>>> +            EndpointReference endPoint = new
>>>>> EndpointReference(this.getLocation(modelService));
>>>>> +            options.setTo(endPoint);
>>>>> +            client.setOptions(options);
>>>>> +        } catch (AxisFault e) {
>>>>>           throw new GenericServiceException("RPC service error",
>>>>> e);
>>>>>       }
>>>>> -
>>>>> -        URL endPoint = null;
>>>>> -
>>>>> -        try {
>>>>> -            endPoint = new URL(this.getLocation(modelService));
>>>>> -        } catch (MalformedURLException e) {
>>>>> -            throw new GenericServiceException("Location not a  
>>>>> valid
>>>>> URL", e);
>>>>> -        }
>>>>> -
>>>>> +
>>>>>       List<ModelParam> inModelParamList =
>>>>> modelService.getInModelParamList();
>>>>> -
>>>>> +
>>>>>       if (Debug.infoOn())
>>>>> Debug.logInfo("[SOAPClientEngine.invoke] : Parameter length - " +
>>>>> inModelParamList.size(), module);
>>>>> -
>>>>> -        call.setTargetEndpointAddress(endPoint);
>>>>> -
>>>>> +
>>>>>       if (UtilValidate.isNotEmpty(modelService.nameSpace)) {
>>>>> -            call.setOperationName(new  
>>>>> QName(modelService.nameSpace,
>>>>> modelService.invoke));
>>>>> +            serviceName = new QName(modelService.nameSpace,
>>>>> modelService.invoke);
>>>>>       } else {
>>>>> -            call.setOperationName(modelService.invoke);
>>>>> +            serviceName = new QName(modelService.invoke);
>>>>>       }
>>>>> -
>>>>> +
>>>>>       int i = 0;
>>>>> -
>>>>> -         
>>>>> call.setOperation(call.getOperationName().getLocalPart());
>>>>> -        List<Object> vParams = new ArrayList<Object>();
>>>>> +
>>>>> +        Map<String, Object> parameterMap = FastMap.newInstance();
>>>>>       for (ModelParam p: inModelParamList) {
>>>>>           if (Debug.infoOn())
>>>>> Debug.logInfo("[SOAPClientEngine.invoke} : Parameter: " + p.name +
>>>>> " (" + p.mode + ") - " + i, module);
>>>>>
>>>>>           // exclude params that ModelServiceReader insert into
>>>>> (internal params)
>>>>>           if (!p.internal) {
>>>>> -                QName qName =
>>>>> call
>>>>> .getParameterTypeByName
>>>>> (p.name); //.getTypeMapping().getTypeQName((Class)
>>>>> ObjectType.classNameClassMap.get(p.type));
>>>>> -                call.addParameter(p.name, qName,  
>>>>> getMode(p.mode));
>>>>> -                vParams.add(context.get(p.name));
>>>>> +                parameterMap.put(p.name, context.get(p.name));
>>>>>           }
>>>>>           i++;
>>>>>       }
>>>>>
>>>>> -        call.setReturnType(XMLType.XSD_ANYTYPE);
>>>>> -        Object[] params=vParams.toArray(new
>>>>> Object[vParams.size()]);
>>>>> -
>>>>> -        Object result = null;
>>>>> -
>>>>> +        OMElement parameterSer = null;
>>>>> +
>>>>>       try {
>>>>> -            Debug.logInfo("[SOAPClientEngine.invoke] : Sending  
>>>>> Call
>>>>> To SOAP Server", module);
>>>>> -            result = call.invoke(params);
>>>>> -        } catch (java.rmi.RemoteException e) {
>>>>> -            throw new GenericServiceException("RPC error", e);
>>>>> -        }
>>>>> -        if (Debug.verboseOn()) {
>>>>> -            Debug.log("SOAP Service Result - " + result, module);
>>>>> +            String xmlParameters =
>>>>> XmlSerializer.serialize(parameterMap);
>>>>> +            XMLStreamReader reader =
>>>>> XMLInputFactory.newInstance().createXMLStreamReader(new
>>>>> StringReader(xmlParameters));
>>>>> +            StAXOMBuilder builder = new StAXOMBuilder(reader);
>>>>> +            parameterSer = builder.getDocumentElement();
>>>>> +        } catch (Exception e) {
>>>>> +            Debug.logError(e, module);
>>>>>       }
>>>>> -
>>>>> -        return
>>>>> getResponseParams(call.getMessageContext().getResponseMessage());
>>>>> -    }
>>>>> -
>>>>> -    private Map<String, Object> getResponseParams(Message
>>>>> respMessage) {
>>>>> -        Map<String, Object> mRet = FastMap.newInstance();
>>>>> +
>>>>> +        Map<String, Object> results = null;
>>>>>       try {
>>>>> -            SOAPEnvelope resEnv = respMessage.getSOAPEnvelope();
>>>>> -            Iterator<?> i = resEnv.getBodyElements().iterator();
>>>>> -            while (i.hasNext()) {
>>>>> -                Object o = i.next();
>>>>> -
>>>>> -                if (o instanceof RPCElement) {
>>>>> -                    RPCElement body = (RPCElement) o;
>>>>> -
>>>>> -                    Iterator<?> p = body.getParams().iterator();
>>>>> -                    while (p.hasNext()) {
>>>>> -                        RPCParam param = (RPCParam) p.next();
>>>>> -                        mRet.put(param.getName(),
>>>>> param.getValue());
>>>>> -                        if (Debug.verboseOn()) {
>>>>> -                            Debug.log("SOAP Client Param - " +
>>>>> param.getName() + "=" + param.getValue(), module);
>>>>> -                        }
>>>>> -                    }
>>>>> -                }
>>>>> -            }
>>>>> -        } catch (org.apache.axis.AxisFault e) {
>>>>> -            Debug.logError(e, "AxisFault", module);
>>>>> -        } catch (org.xml.sax.SAXException e) {
>>>>> -            Debug.logError(e, "SAXException", module);
>>>>> -        }
>>>>> -        return mRet;
>>>>> -    }
>>>>> -
>>>>> -    private ParameterMode getMode(String sMode) {
>>>>> -        if (sMode.equals("IN")) {
>>>>> -            return ParameterMode.IN;
>>>>> -        } else if (sMode.equals("OUT")) {
>>>>> -            return ParameterMode.OUT;
>>>>> -        } else if (sMode.equals("INOUT")) {
>>>>> -            return ParameterMode.INOUT;
>>>>> -        } else {
>>>>> -            return null;
>>>>> +            OMFactory factory = OMAbstractFactory.getOMFactory();
>>>>> +            OMElement payload =
>>>>> factory.createOMElement(serviceName);
>>>>> +            payload.addChild(parameterSer.getFirstElement());
>>>>> +            OMElement respOMElement =  
>>>>> client.sendReceive(payload);
>>>>> +            results = (Map<String, Object>)
>>>>> XmlSerializer.deserialize(respOMElement.toString(), delegator);
>>>>> +        } catch (Exception e) {
>>>>> +            Debug.logError(e, module);
>>>>>       }
>>>>> +        return results;
>>>>>   }
>>>>> }
>>>>>
>>>>> Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/
>>>>> ServiceSOAPTests.java
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java?rev=892712&view=auto
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/test/
>>>>> ServiceSOAPTests.java (added)
>>>>> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/test/
>>>>> ServiceSOAPTests.java Mon Dec 21 07:31:58 2009
>>>>> @@ -0,0 +1,43 @@
>>>>> +package org.ofbiz.service.test;
>>>>> +
>>>>> +import java.util.List;
>>>>> +import java.util.Map;
>>>>> +
>>>>> +import javolution.util.FastMap;
>>>>> +
>>>>> +import org.ofbiz.base.util.Debug;
>>>>> +import org.ofbiz.base.util.UtilDateTime;
>>>>> +import org.ofbiz.base.util.UtilMisc;
>>>>> +import org.ofbiz.entity.GenericValue;
>>>>> +import org.ofbiz.service.testtools.OFBizTestCase;
>>>>> +
>>>>> +public class ServiceSOAPTests extends OFBizTestCase {
>>>>> +
>>>>> +    public final static String module =
>>>>> ServiceSOAPTests.class.getName();
>>>>> +
>>>>> +    public ServiceSOAPTests(String name) {
>>>>> +        // TODO Auto-generated constructor stub
>>>>> +        super(name);
>>>>> +    }
>>>>> +
>>>>> +    public void testSOAPSimpleService() throws Exception {
>>>>> +        Map<String, Object> serviceContext =  
>>>>> FastMap.newInstance();
>>>>> +        serviceContext.put("defaultValue", new  
>>>>> Double("123.4567"));
>>>>> +        serviceContext.put("message", "Test Message !!!");
>>>>> +        Map<String, Object> results =
>>>>> dispatcher.runSync("testSoapSimple", serviceContext);
>>>>> +        String resp = (String) results.get("resp");
>>>>> +    }
>>>>> +
>>>>> +    public void testSOAPService() throws Exception {
>>>>> +        Map<String, Object> serviceContext =  
>>>>> FastMap.newInstance();
>>>>> +        GenericValue productCategory =
>>>>> delegator.makeValue("ProductCategory");
>>>>> +        productCategory.put("productCategoryId", "PRODCAT_TEST");
>>>>> +        productCategory.put("productCategoryTypeId",
>>>>> "CATALOG_CATEGORY");
>>>>> +        productCategory.put("categoryName", "Test
>>>>> ProductCategory");
>>>>> +        productCategory.put("createdStamp",
>>>>> UtilDateTime.nowTimestamp());
>>>>> +        serviceContext.put("productCategory", productCategory);
>>>>> +        Map<String, Object> results =
>>>>> dispatcher.runSync("testSoap", serviceContext);
>>>>> +        List<GenericValue> products = (List<GenericValue>)
>>>>> results.get("products");
>>>>> +        assertNotNull(products);
>>>>> +    }
>>>>> +}
>>>>>
>>>>> Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>>>> test/
>>>>> ServiceSOAPTests.java
>>>>> ------------------------------------------------------------------------------
>>>>>  svn:eol-style = native
>>>>>
>>>>> Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>>>> test/
>>>>> ServiceSOAPTests.java
>>>>> ------------------------------------------------------------------------------
>>>>>  svn:keywords = "Date Rev Author URL Id"
>>>>>
>>>>> Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>>>> test/
>>>>> ServiceSOAPTests.java
>>>>> ------------------------------------------------------------------------------
>>>>>  svn:mime-type = text/plain
>>>>>
>>>>> Modified: ofbiz/trunk/framework/service/testdef/servicetests.xml
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/testdef/servicetests.xml?rev=892712&r1=892711&r2=892712&view=diff
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- ofbiz/trunk/framework/service/testdef/servicetests.xml
>>>>> (original)
>>>>> +++ ofbiz/trunk/framework/service/testdef/servicetests.xml Mon Dec
>>>>> 21 07:31:58 2009
>>>>> @@ -22,6 +22,7 @@
>>>>>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>       xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd
>>>>> ">
>>>>>   <test-case case-name="service-tests"><junit-test-suite class-
>>>>> name="org.ofbiz.service.test.ServiceEngineTests"/></test-case>
>>>>> +    <test-case case-name="service-soap-tests"><junit-test-suite
>>>>> class-name="org.ofbiz.service.test.ServiceSOAPTests"/></test-case>
>>>>>
>>>>>   <test-case case-name="load-service-test-data">
>>>>>       <entity-xml action="load" entity-xml-url="component://
>>>>> service/testdef/data/ServiceTestData.xml"/>
>>>>>
>>>>> Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/
>>>>> SOAPEventHandler.java
>>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java?rev=892712&r1=892711&r2=892712&view=diff
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> =
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/
>>>>> SOAPEventHandler.java (original)
>>>>> +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/
>>>>> SOAPEventHandler.java Mon Dec 21 07:31:58 2009
>>>>> @@ -18,33 +18,35 @@
>>>>>
>>>>> *******************************************************************************/
>>>>> package org.ofbiz.webapp.event;
>>>>>
>>>>> -import java.io.ByteArrayOutputStream;
>>>>> import java.io.IOException;
>>>>> import java.io.OutputStream;
>>>>> +import java.io.StringReader;
>>>>> import java.io.Writer;
>>>>> -import java.util.List;
>>>>> +import java.util.Iterator;
>>>>> import java.util.Map;
>>>>>
>>>>> import javax.servlet.ServletContext;
>>>>> import javax.servlet.http.HttpServletRequest;
>>>>> import javax.servlet.http.HttpServletResponse;
>>>>> import javax.wsdl.WSDLException;
>>>>> -import javax.xml.soap.SOAPException;
>>>>> +import javax.xml.namespace.QName;
>>>>> +import javax.xml.stream.XMLInputFactory;
>>>>> +import javax.xml.stream.XMLStreamReader;
>>>>>
>>>>> import javolution.util.FastMap;
>>>>>
>>>>> -import org.apache.axis.AxisFault;
>>>>> -import org.apache.axis.Constants;
>>>>> -import org.apache.axis.Message;
>>>>> -import org.apache.axis.MessageContext;
>>>>> -import org.apache.axis.message.RPCElement;
>>>>> -import org.apache.axis.message.RPCParam;
>>>>> -import org.apache.axis.message.SOAPEnvelope;
>>>>> -import org.apache.axis.server.AxisServer;
>>>>> +import org.apache.axiom.om.OMAbstractFactory;
>>>>> +import org.apache.axiom.om.OMElement;
>>>>> +import org.apache.axiom.om.impl.builder.StAXOMBuilder;
>>>>> +import org.apache.axiom.om.util.StAXUtils;
>>>>> +import org.apache.axiom.soap.SOAPBody;
>>>>> +import org.apache.axiom.soap.SOAPEnvelope;
>>>>> +import org.apache.axiom.soap.SOAPFactory;
>>>>> +import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
>>>>> import org.ofbiz.base.util.Debug;
>>>>> -import org.ofbiz.base.util.UtilGenerics;
>>>>> -import org.ofbiz.base.util.UtilMisc;
>>>>> import org.ofbiz.base.util.UtilXml;
>>>>> +import org.ofbiz.entity.GenericDelegator;
>>>>> +import org.ofbiz.entity.serialize.XmlSerializer;
>>>>> import org.ofbiz.service.DispatchContext;
>>>>> import org.ofbiz.service.GenericServiceException;
>>>>> import org.ofbiz.service.LocalDispatcher;
>>>>> @@ -72,7 +74,7 @@
>>>>>    */
>>>>>   public String invoke(Event event, RequestMap requestMap,
>>>>> HttpServletRequest request, HttpServletResponse response) throws
>>>>> EventHandlerException {
>>>>>       LocalDispatcher dispatcher = (LocalDispatcher)
>>>>> request.getAttribute("dispatcher");
>>>>> -        AxisServer axisServer;
>>>>> +        GenericDelegator delegator = (GenericDelegator)
>>>>> request.getAttribute("delegator");
>>>>>
>>>>>       // first check for WSDL request
>>>>>       String wsdlReq = request.getParameter("wsdl");
>>>>> @@ -138,163 +140,119 @@
>>>>>       }
>>>>>
>>>>>       // not a wsdl request; invoke the service
>>>>> -        try {
>>>>> -            axisServer =
>>>>> AxisServer.getServer(UtilMisc.toMap("name", "OFBiz/Axis Server",
>>>>> "provider", null));
>>>>> -        } catch (AxisFault e) {
>>>>> -            sendError(response, e);
>>>>> -            throw new EventHandlerException("Problems with the  
>>>>> AXIS
>>>>> server", e);
>>>>> -        }
>>>>> -        MessageContext mctx = new MessageContext(axisServer);
>>>>> -        mctx.setEncodingStyle(Constants.URI_LITERAL_ENC); // sets
>>>>> the response encoding
>>>>> -
>>>>> -        // get the SOAP message
>>>>> -        Message msg = null;
>>>>> -
>>>>> -        try {
>>>>> -            msg = new Message(request.getInputStream(), false,
>>>>> -                        request.getHeader("Content-Type"),
>>>>> request.getHeader("Content-Location"));
>>>>> -        } catch (IOException ioe) {
>>>>> -            sendError(response, "Problem processing the  
>>>>> service");
>>>>> -            throw new EventHandlerException("Cannot read the  
>>>>> input
>>>>> stream", ioe);
>>>>> -        }
>>>>> -
>>>>> -        if (msg == null) {
>>>>> -            sendError(response, "No message");
>>>>> -            throw new EventHandlerException("SOAP Message is
>>>>> null");
>>>>> -        }
>>>>> -
>>>>> -        // log the request message
>>>>> -        if (Debug.verboseOn()) {
>>>>> -            try {
>>>>> -                Debug.logInfo("Request Message:\n" +
>>>>> messageToString(msg) + "\n", module);
>>>>> -            } catch (Throwable t) {
>>>>> -            }
>>>>> -        }
>>>>> -
>>>>> -        mctx.setRequestMessage(msg);
>>>>> -
>>>>> -        // new envelopes
>>>>> -        SOAPEnvelope resEnv = new SOAPEnvelope();
>>>>> +
>>>>> +        // request envelope
>>>>>       SOAPEnvelope reqEnv = null;
>>>>> -
>>>>> +
>>>>>       // get the service name and parameters
>>>>>       try {
>>>>> -            reqEnv = (SOAPEnvelope)
>>>>> msg.getSOAPPart().getEnvelope();
>>>>> -        } catch (SOAPException e) {
>>>>> +            XMLStreamReader xmlReader =
>>>>> StAXUtils.createXMLStreamReader(request.getInputStream());
>>>>> +            StAXSOAPModelBuilder builder = new
>>>>> StAXSOAPModelBuilder(xmlReader);
>>>>> +            reqEnv = (SOAPEnvelope) builder.getDocumentElement();
>>>>> +
>>>>> +            // log the request message
>>>>> +            if (Debug.verboseOn()) {
>>>>> +                try {
>>>>> +                    Debug.logInfo("Request Message:\n" + reqEnv +
>>>>> "\n", module);
>>>>> +                } catch (Throwable t) {
>>>>> +                }
>>>>> +            }
>>>>> +        } catch (Exception e) {
>>>>>           sendError(response, "Problem processing the service");
>>>>>           throw new EventHandlerException("Cannot get the
>>>>> envelope", e);
>>>>>       }
>>>>> -
>>>>> -        List<Object> bodies = null;
>>>>> -
>>>>> -        try {
>>>>> -            bodies =
>>>>> UtilGenerics.checkList(reqEnv.getBodyElements());
>>>>> -        } catch (AxisFault e) {
>>>>> -            sendError(response, e);
>>>>> -            throw new EventHandlerException(e.getMessage(), e);
>>>>> -        }
>>>>> -
>>>>> +
>>>>>       Debug.logVerbose("[Processing]: SOAP Event", module);
>>>>> +
>>>>> +        try {
>>>>> +            // each is a different service call
>>>>> +            SOAPBody reqBody = reqEnv.getBody();
>>>>> +            Iterator serviceIter = reqBody.getChildElements();
>>>>> +            while (serviceIter.hasNext()) {
>>>>> +                Object serviceObj = serviceIter.next();
>>>>> +                if (serviceObj instanceof OMElement) {
>>>>> +                    OMElement serviceElement = (OMElement)
>>>>> serviceObj;
>>>>> +                    String serviceName =
>>>>> serviceElement.getLocalName();
>>>>> +                    Map<String, Object> parameters = (Map<String,
>>>>> Object>) XmlSerializer.deserialize(serviceElement.toString(),
>>>>> delegator);
>>>>> +                    try {
>>>>> +                        // verify the service is exported for
>>>>> remote execution and invoke it
>>>>> +                        ModelService model =
>>>>> dispatcher.getDispatchContext().getModelService(serviceName);
>>>>>
>>>>> -        // each is a different service call
>>>>> -        for (Object o: bodies) {
>>>>> -
>>>>> -            if (o instanceof RPCElement) {
>>>>> -                RPCElement body = (RPCElement) o;
>>>>> -                String serviceName = body.getMethodName();
>>>>> -                List<RPCParam> params = null;
>>>>> -                try {
>>>>> -                    params =
>>>>> UtilGenerics.checkList(body.getParams());
>>>>> -                } catch (Exception e) {
>>>>> -                    sendError(response, e);
>>>>> -                    throw new  
>>>>> EventHandlerException(e.getMessage(),
>>>>> e);
>>>>> -                }
>>>>> -                Map<String, Object> serviceContext =
>>>>> FastMap.newInstance();
>>>>> -                for (RPCParam param: params) {
>>>>> -                    if (Debug.verboseOn())
>>>>> Debug.logVerbose("[Reading Param]: " + param.getName(), module);
>>>>> -                    serviceContext.put(param.getName(),
>>>>> param.getObjectValue());
>>>>> -                }
>>>>> -                try {
>>>>> -                    // verify the service is exported for remote
>>>>> execution and invoke it
>>>>> -                    ModelService model =
>>>>> dispatcher.getDispatchContext().getModelService(serviceName);
>>>>> -
>>>>> -                    if (model != null && model.export) {
>>>>> -                        Map<String, Object> result =
>>>>> dispatcher.runSync(serviceName, serviceContext);
>>>>> -
>>>>> -                        Debug.logVerbose("[EventHandler] :  
>>>>> Service
>>>>> invoked", module);
>>>>> -                        RPCElement resBody = new
>>>>> RPCElement(serviceName + "Response");
>>>>> -
>>>>> -                        resBody.setPrefix(body.getPrefix());
>>>>> -
>>>>> resBody.setNamespaceURI(body.getNamespaceURI());
>>>>> -
>>>>> -                        for (Map.Entry<String, Object> entry:
>>>>> result.entrySet()) {
>>>>> -                            RPCParam par = new
>>>>> RPCParam(entry.getKey(), entry.getValue());
>>>>> +                        if (model != null && model.export) {
>>>>> +                            Map<String, Object> results =
>>>>> dispatcher.runSync(serviceName, parameters);
>>>>> +                            Debug.logVerbose("[EventHandler] :
>>>>> Service invoked", module);
>>>>> +
>>>>> +                            // setup the response
>>>>> +                            Debug.logVerbose("[EventHandler] :
>>>>> Setting up response message", module);
>>>>> +                            String xmlResults =
>>>>> XmlSerializer.serialize(results);
>>>>> +                            XMLStreamReader reader =
>>>>> XMLInputFactory.newInstance().createXMLStreamReader(new
>>>>> StringReader(xmlResults));
>>>>> +                            StAXOMBuilder resultsBuilder = new
>>>>> StAXOMBuilder(reader);
>>>>> +                            OMElement resultSer =
>>>>> resultsBuilder.getDocumentElement();
>>>>> +
>>>>> +                            // create the response soap
>>>>> +                            SOAPFactory factory =
>>>>> OMAbstractFactory.getSOAP11Factory();
>>>>> +                            SOAPEnvelope resEnv =
>>>>> factory.createSOAPEnvelope();
>>>>> +                            SOAPBody resBody =
>>>>> factory.createSOAPBody();
>>>>> +                            OMElement resService =
>>>>> factory.createOMElement(new QName(serviceName + "Response"));
>>>>> +
>>>>> resService.addChild(resultSer.getFirstElement());
>>>>> +                            resBody.addChild(resService);
>>>>> +                            resEnv.addChild(resBody);
>>>>> +
>>>>> +                            // log the response message
>>>>> +                            if (Debug.verboseOn()) {
>>>>> +                                try {
>>>>> +                                    Debug.log("Response Message: 
>>>>> \n"
>>>>> + resEnv + "\n", module);
>>>>> +                                } catch (Throwable t) {
>>>>> +                                }
>>>>> +                            }
>>>>>
>>>>> -                            resBody.addParam(par);
>>>>> +
>>>>> resEnv.serialize(response.getOutputStream());
>>>>> +                            response.getOutputStream().flush();
>>>>>                       }
>>>>> -                        resEnv.addBodyElement(resBody);
>>>>> -
>>>>> resEnv.setEncodingStyle(Constants.URI_LITERAL_ENC);
>>>>> -                    } else {
>>>>> -                        sendError(response, "Requested service  
>>>>> not
>>>>> available");
>>>>> -                        throw new  
>>>>> EventHandlerException("Service is
>>>>> not exported");
>>>>> +
>>>>> +                    } catch (GenericServiceException e) {
>>>>> +                        sendError(response, "Problem processing  
>>>>> the
>>>>> service");
>>>>> +                        throw new
>>>>> EventHandlerException(e.getMessage(), e);
>>>>>                   }
>>>>> -                } catch (GenericServiceException e) {
>>>>> -                    sendError(response, "Problem processing the
>>>>> service");
>>>>> -                    throw new  
>>>>> EventHandlerException(e.getMessage(),
>>>>> e);
>>>>> -                } catch (javax.xml.soap.SOAPException e) {
>>>>> -                    sendError(response, "Problem processing the
>>>>> service");
>>>>> -                    throw new  
>>>>> EventHandlerException(e.getMessage(),
>>>>> e);
>>>>>               }
>>>>>           }
>>>>> -        }
>>>>> -
>>>>> -        // setup the response
>>>>> -        Debug.logVerbose("[EventHandler] : Setting up response
>>>>> message", module);
>>>>> -        msg = new Message(resEnv);
>>>>> -        mctx.setResponseMessage(msg);
>>>>> -        if (msg == null) {
>>>>> -            sendError(response, "No response message available");
>>>>> -            throw new EventHandlerException("No response message
>>>>> available");
>>>>> -        }
>>>>> -
>>>>> -        // log the response message
>>>>> -        if (Debug.verboseOn()) {
>>>>> -            try {
>>>>> -                Debug.log("Response Message:\n" +
>>>>> messageToString(msg) + "\n", module);
>>>>> -            } catch (Throwable t) {
>>>>> -            }
>>>>> -        }
>>>>> -
>>>>> -        try {
>>>>> -
>>>>> response
>>>>> .setContentType 
>>>>> (msg.getContentType(Constants.DEFAULT_SOAP_VERSION));
>>>>> -
>>>>> response
>>>>> .setContentLength
>>>>> (Integer.parseInt(Long.toString(msg.getContentLength())));
>>>>> -        } catch (AxisFault e) {
>>>>> -            sendError(response, e);
>>>>> +        } catch (Exception e) {
>>>>> +            sendError(response, e.getMessage());
>>>>>           throw new EventHandlerException(e.getMessage(), e);
>>>>>       }
>>>>> -
>>>>> -        try {
>>>>> -            msg.writeTo(response.getOutputStream());
>>>>> -            response.flushBuffer();
>>>>> -        } catch (IOException e) {
>>>>> -            throw new EventHandlerException("Cannot write to the
>>>>> output stream");
>>>>> -        } catch (SOAPException e) {
>>>>> -            throw new EventHandlerException("Cannot write message
>>>>> to the output stream");
>>>>> -        }
>>>>> -
>>>>> -        Debug.logVerbose("[EventHandler] : Message sent to
>>>>> requester", module);
>>>>> -
>>>>> +
>>>>>       return null;
>>>>>   }
>>>>>
>>>>> -    private void sendError(HttpServletResponse res, Object obj)
>>>>> throws EventHandlerException {
>>>>> -        Message msg = new Message(obj);
>>>>> -
>>>>> +    private void sendError(HttpServletResponse res, String
>>>>> errorMessage) throws EventHandlerException {
>>>>>       try {
>>>>> -
>>>>> res
>>>>> .setContentType 
>>>>> (msg.getContentType(Constants.DEFAULT_SOAP_VERSION));
>>>>> -
>>>>> res
>>>>> .setContentLength
>>>>> (Integer.parseInt(Long.toString(msg.getContentLength())));
>>>>> -            msg.writeTo(res.getOutputStream());
>>>>> -            res.flushBuffer();
>>>>> +            // setup the response
>>>>> +            Map<String, Object> results = FastMap.newInstance();
>>>>> +            results.put("errorMessage", errorMessage);
>>>>> +            String xmlResults= XmlSerializer.serialize(results);
>>>>> +            XMLStreamReader xmlReader =
>>>>> XMLInputFactory.newInstance().createXMLStreamReader(new
>>>>> StringReader(xmlResults));
>>>>> +            StAXOMBuilder resultsBuilder = new
>>>>> StAXOMBuilder(xmlReader);
>>>>> +            OMElement resultSer =
>>>>> resultsBuilder.getDocumentElement();
>>>>> +
>>>>> +            // create the response soap
>>>>> +            SOAPFactory factory =
>>>>> OMAbstractFactory.getSOAP11Factory();
>>>>> +            SOAPEnvelope resEnv = factory.createSOAPEnvelope();
>>>>> +            SOAPBody resBody = factory.createSOAPBody();
>>>>> +            OMElement errMsg = factory.createOMElement(new
>>>>> QName("Response"));
>>>>> +            errMsg.addChild(resultSer.getFirstElement());
>>>>> +            resBody.addChild(errMsg);
>>>>> +            resEnv.addChild(resBody);
>>>>> +
>>>>> +            // log the response message
>>>>> +            if (Debug.verboseOn()) {
>>>>> +                try {
>>>>> +                    Debug.log("Response Message:\n" + resEnv +
>>>>> "\n", module);
>>>>> +                } catch (Throwable t) {
>>>>> +                }
>>>>> +            }
>>>>> +
>>>>> +            resEnv.serialize(res.getOutputStream());
>>>>> +            res.getOutputStream().flush();
>>>>>       } catch (Exception e) {
>>>>>           throw new EventHandlerException(e.getMessage(), e);
>>>>>       }
>>>>> @@ -320,10 +278,4 @@
>>>>>       uri.append(reqInfo);
>>>>>       return uri.toString();
>>>>>   }
>>>>> -
>>>>> -    public static String messageToString(Message msg) throws
>>>>> SOAPException, IOException {
>>>>> -        ByteArrayOutputStream out = new ByteArrayOutputStream();
>>>>> -        msg.writeTo(out);
>>>>> -        return out.toString();
>>>>> -    }
>>>>> }
>>>>>
>>>>>
>>>>
>>> -- 
>>> Antwebsystems.com: Quality OFBiz services for competitive rates
>>>
>>
> -- 
> Antwebsystems.com: Quality OFBiz services for competitive rates
>


Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Posted by Hans Bakker <ma...@antwebsystems.com>.
Hi Scott,

thanks again for the suggestion, log message updated.

Regards,
Hans

On Tue, 2009-12-22 at 20:12 +1300, Scott Gray wrote:
> Thanks Hans, looks good.
> 
> One reminder though, there were also unrelated changes in 893087,  
> please remember to either describe them in the commit message as well  
> or ideally commit them separately.
> 
> Thanks
> Scott
> 
> On 22/12/2009, at 7:48 PM, Hans Bakker wrote:
> 
> > Hi Scott,
> > Thank you for the comment, suggestion implemented by Chatree and
> > Committed revision 893087.
> >
> > Regards,
> > Hans
> >
> > On Mon, 2009-12-21 at 23:21 +1300, Scott Gray wrote:
> >> Hi Hans,
> >>
> >> Thanks for committing some tests, it's great to see.
> >>
> >> One small issue though, the test introduces a dependency on the
> >> product data model from common and the service engine, this means the
> >> test would fail in a framework only installation.  I would suggest
> >> switching the entity over to TestingNode which along with the other
> >> entities in framework/entity/entitydef/entitymodel_test.xml are
> >> provided for testing the lower level tools.
> >>
> >> Regards
> >> Scott
> >>
> >> HotWax Media
> >> http://www.hotwaxmedia.com
> >>
> >> On 21/12/2009, at 8:32 PM, hansbak@apache.org wrote:
> >>
> >>> Author: hansbak
> >>> Date: Mon Dec 21 07:31:58 2009
> >>> New Revision: 892712
> >>>
> >>> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
> >>> Log:
> >>> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in
> >>> webservices including WSDL generation. see OFBIZ-3363 for more info.
> >>> A contribution of Antwebsystems employee Chatree
> >>>
> >>> Added:
> >>>   ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with
> >>> props)
> >>>   ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with
> >>> props)
> >>>   ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with
> >>> props)
> >>>   ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with
> >>> props)
> >>>   ofbiz/trunk/framework/service/lib/axis2-transport-
> >>> http-1.5.1.jar   (with props)
> >>>   ofbiz/trunk/framework/service/lib/axis2-transport-
> >>> local-1.5.1.jar   (with props)
> >>>   ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
> >>> (with props)
> >>>   ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
> >>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/test/
> >>> ServiceSOAPTests.java   (with props)
> >>> Modified:
> >>>   ofbiz/trunk/LICENSE
> >>>   ofbiz/trunk/framework/common/servicedef/services_test.xml
> >>>   ofbiz/trunk/framework/common/src/org/ofbiz/common/
> >>> CommonServices.java
> >>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> >>> ModelParam.java
> >>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/
> >>> ModelService.java
> >>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/
> >>> SOAPClientEngine.java
> >>>   ofbiz/trunk/framework/service/testdef/servicetests.xml
> >>>   ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/
> >>> SOAPEventHandler.java
> >>>
> >>> Modified: ofbiz/trunk/LICENSE
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=892712&r1=892711&r2=892712&view=diff
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> --- ofbiz/trunk/LICENSE (original)
> >>> +++ ofbiz/trunk/LICENSE Mon Dec 21 07:31:58 2009
> >>> @@ -87,6 +87,14 @@
> >>> ofbiz/trunk/framework/jetty/lib/xmlParserAPIs-2.6.2.jar
> >>> ofbiz/trunk/framework/service/lib/axis-ant.jar
> >>> ofbiz/trunk/framework/service/lib/axis.jar
> >>> +ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
> >>> +ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
> >>> +ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
> >>> +ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar
> >>> +ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar
> >>> +ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
> >>> +ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
> >>> +ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
> >>> ofbiz/trunk/framework/webapp/lib/fop-0.95.jar
> >>> ofbiz/trunk/framework/webapp/lib/velocity-1.6.1.jar
> >>> ofbiz/trunk/framework/webapp/lib/xmlgraphics-commons-1.3.1.jar
> >>>
> >>> Modified: ofbiz/trunk/framework/common/servicedef/services_test.xml
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services_test.xml?rev=892712&r1=892711&r2=892712&view=diff
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> --- ofbiz/trunk/framework/common/servicedef/services_test.xml
> >>> (original)
> >>> +++ ofbiz/trunk/framework/common/servicedef/services_test.xml Mon
> >>> Dec 21 07:31:58 2009
> >>> @@ -31,6 +31,12 @@
> >>>        <attribute name="message" type="String" mode="IN"
> >>> optional="true"/>
> >>>        <attribute name="resp" type="String" mode="OUT"/>
> >>>    </service>
> >>> +    <service name="testSOAPScv" engine="java" export="true"
> >>> validate="false" require-new-transaction="true"
> >>> +            location="org.ofbiz.common.CommonServices"
> >>> invoke="testSOAPService">
> >>> +        <description>Test SOAP service</description>
> >>> +        <attribute name="productCategory"
> >>> type="org.ofbiz.entity.GenericValue" mode="IN" optional="false"/>
> >>> +        <attribute name="products" type="List" mode="OUT"
> >>> optional="true"/>
> >>> +    </service>
> >>>    <service name="blockingTestScv" engine="java" export="true"
> >>> validate="false" require-new-transaction="true" transaction-
> >>> timeout="20"
> >>>            location="org.ofbiz.common.CommonServices"
> >>> invoke="blockingTestService">
> >>>        <description>Blocking Test service</description>
> >>> @@ -84,10 +90,15 @@
> >>>    </service>
> >>>
> >>>    <service name="testSoap" engine="soap" export="true"
> >>> +            location="http://localhost:8080/webtools/control/SOAPService
> >>> " invoke="testSOAPScv">
> >>> +        <description>SOAP service; calls the OFBiz test SOAP
> >>> service</description>
> >>> +        <implements service="testSOAPScv"/>
> >>> +    </service>
> >>> +
> >>> +    <service name="testSoapSimple" engine="soap" export="true"
> >>>            location="http://localhost:8080/webtools/control/SOAPService
> >>> " invoke="testScv">
> >>> -        <description>Test SOAP service; calls the OFBiz test
> >>> service</description>
> >>> -        <attribute name="message" type="String" mode="IN"
> >>> optional="true"/>
> >>> -        <attribute name="resp" type="String" mode="OUT"/>
> >>> +        <description>simple SOAP service; calls the OFBiz test
> >>> service</description>
> >>> +        <implements service="testScv"/>
> >>>    </service>
> >>>
> >>>    <service name="testRemoteSoap" engine="soap" export="true"
> >>>
> >>> Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/
> >>> CommonServices.java
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java?rev=892712&r1=892711&r2=892712&view=diff
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> --- ofbiz/trunk/framework/common/src/org/ofbiz/common/
> >>> CommonServices.java (original)
> >>> +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/
> >>> CommonServices.java Mon Dec 21 07:31:58 2009
> >>> @@ -26,6 +26,7 @@
> >>> import javax.mail.internet.MimeMessage;
> >>> import javax.transaction.xa.XAException;
> >>>
> >>> +import javolution.util.FastList;
> >>> import javolution.util.FastMap;
> >>>
> >>> import org.apache.log4j.Level;
> >>> @@ -84,6 +85,32 @@
> >>>        System.out.println("----- SVC: " + dctx.getName() + "  
> >>> -----");
> >>>        return response;
> >>>    }
> >>> +
> >>> +    /**
> >>> +     * Generic Test SOAP Service
> >>> +     *@param dctx The DispatchContext that this service is
> >>> operating in
> >>> +     *@param context Map containing the input parameters
> >>> +     *@return Map with the result of the service, the output
> >>> parameters
> >>> +     */
> >>> +    public static Map<String, Object>
> >>> testSOAPService(DispatchContext dctx, Map<String, ?> context) {
> >>> +        Delegator delegator = dctx.getDelegator();
> >>> +        Map<String, Object> response = ServiceUtil.returnSuccess();
> >>> +
> >>> +        GenericValue productCategory = (GenericValue)
> >>> context.get("productCategory");
> >>> +        List<GenericValue> products = FastList.newInstance();
> >>> +        for (int i = 0; i < 3; i ++) {
> >>> +            GenericValue product = delegator.makeValue("Product");
> >>> +            product.put("productId", "PROD_TEST" + i);
> >>> +            product.put("productTypeId", "FINISHED_GOOD");
> >>> +            product.put("primaryProductCategoryId", "202");
> >>> +            product.put("internalName", "Product Test " + i);
> >>> +            product.put("productName", "Product Test " + i);
> >>> +            product.put("createdStamp",  
> >>> UtilDateTime.nowTimestamp());
> >>> +            products.add(product);
> >>> +        }
> >>> +        response.put("products", products);
> >>> +        return response;
> >>> +    }
> >>>
> >>>    public static Map<String, Object>
> >>> blockingTestService(DispatchContext dctx, Map<String, ?> context) {
> >>>        Long duration = (Long) context.get("duration");
> >>>
> >>> Added: ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar?rev=892712&view=auto
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> Binary file - no diff available.
> >>>
> >>> Propchange: ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
> >>> ------------------------------------------------------------------------------
> >>>   svn:mime-type = application/octet-stream
> >>>
> >>> Added: ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar?rev=892712&view=auto
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> Binary file - no diff available.
> >>>
> >>> Propchange: ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
> >>> ------------------------------------------------------------------------------
> >>>   svn:mime-type = application/octet-stream
> >>>
> >>> Added: ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar?rev=892712&view=auto
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> Binary file - no diff available.
> >>>
> >>> Propchange: ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
> >>> ------------------------------------------------------------------------------
> >>>   svn:mime-type = application/octet-stream
> >>>
> >>> Added: ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar?rev=892712&view=auto
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> Binary file - no diff available.
> >>>
> >>> Propchange: ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
> >>> ------------------------------------------------------------------------------
> >>>   svn:mime-type = application/octet-stream
> >>>
> >>> Added: ofbiz/trunk/framework/service/lib/axis2-transport-
> >>> http-1.5.1.jar
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar?rev=892712&view=auto
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> Binary file - no diff available.
> >>>
> >>> Propchange: ofbiz/trunk/framework/service/lib/axis2-transport-
> >>> http-1.5.1.jar
> >>> ------------------------------------------------------------------------------
> >>>   svn:mime-type = application/octet-stream
> >>>
> >>> Added: ofbiz/trunk/framework/service/lib/axis2-transport-
> >>> local-1.5.1.jar
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar?rev=892712&view=auto
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> Binary file - no diff available.
> >>>
> >>> Propchange: ofbiz/trunk/framework/service/lib/axis2-transport-
> >>> local-1.5.1.jar
> >>> ------------------------------------------------------------------------------
> >>>   svn:mime-type = application/octet-stream
> >>>
> >>> Added: ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar?rev=892712&view=auto
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> Binary file - no diff available.
> >>>
> >>> Propchange: ofbiz/trunk/framework/service/lib/commons-
> >>> httpclient-3.1.jar
> >>> ------------------------------------------------------------------------------
> >>>   svn:mime-type = application/octet-stream
> >>>
> >>> Added: ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar?rev=892712&view=auto
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> Binary file - no diff available.
> >>>
> >>> Propchange: ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
> >>> ------------------------------------------------------------------------------
> >>>   svn:mime-type = application/octet-stream
> >>>
> >>> Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/
> >>> ModelParam.java
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java?rev=892712&r1=892711&r2=892712&view=diff
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/
> >>> ModelParam.java (original)
> >>> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/
> >>> ModelParam.java Mon Dec 21 07:31:58 2009
> >>> @@ -207,47 +207,56 @@
> >>>    public Part getWSDLPart(Definition def) throws WSDLException {
> >>>        Part part = def.createPart();
> >>>        part.setName(this.name);
> >>> -        part.setTypeName(new QName(ModelService.XSD,
> >>> this.java2wsdlType()));
> >>> +        part.setTypeName(new QName(ModelService.TNS,
> >>> this.java2wsdlType()));
> >>>        return part;
> >>>    }
> >>>
> >>>    protected String java2wsdlType() throws WSDLException {
> >>>        if (ObjectType.instanceOf(java.lang.Character.class,
> >>> this.type)) {
> >>> -            return "string";
> >>> +            return "std-String";
> >>>        } else if (ObjectType.instanceOf(java.lang.String.class,
> >>> this.type)) {
> >>> -            return "string";
> >>> +            return "std-String";
> >>>        } else if (ObjectType.instanceOf(java.lang.Byte.class,
> >>> this.type)) {
> >>> -            return "byte";
> >>> +            return "std-String";
> >>>        } else if (ObjectType.instanceOf(java.lang.Boolean.class,
> >>> this.type)) {
> >>> -            return "boolean";
> >>> +            return "std-Boolean";
> >>>        } else if (ObjectType.instanceOf(java.lang.Integer.class,
> >>> this.type)) {
> >>> -            return "int";
> >>> +            return "std-Integer";
> >>>        } else if (ObjectType.instanceOf(java.lang.Double.class,
> >>> this.type)) {
> >>> -            return "double";
> >>> +            return "std-Double";
> >>>        } else if (ObjectType.instanceOf(java.lang.Float.class,
> >>> this.type)) {
> >>> -            return "float";
> >>> +            return "std-Float";
> >>>        } else if (ObjectType.instanceOf(java.lang.Short.class,
> >>> this.type)) {
> >>> -            return "short";
> >>> +            return "std-Integer";
> >>>        } else if (ObjectType.instanceOf(java.math.BigDecimal.class,
> >>> this.type)) {
> >>> -            return "decimal";
> >>> +            return "std-Long";
> >>>        } else if (ObjectType.instanceOf(java.math.BigInteger.class,
> >>> this.type)) {
> >>> -            return "integer";
> >>> +            return "std-Integer";
> >>>        } else if (ObjectType.instanceOf(java.util.Calendar.class,
> >>> this.type)) {
> >>> -            return "dateTime";
> >>> +            return "sql-Timestamp";
> >>>        } else if
> >>> (ObjectType.instanceOf(com.ibm.icu.util.Calendar.class,  
> >>> this.type)) {
> >>> -            return "dateTime";
> >>> +            return "sql-Timestamp";
> >>>        } else if (ObjectType.instanceOf(java.sql.Date.class,
> >>> this.type)) {
> >>> -            return "date";
> >>> +            return "sql-Date";
> >>>        } else if (ObjectType.instanceOf(java.util.Date.class,
> >>> this.type)) {
> >>> -            return "dateTime";
> >>> +            return "sql-Timestamp";
> >>>        } else if (ObjectType.instanceOf(java.lang.Long.class,
> >>> this.type)) {
> >>> -            return "unsignedInt";
> >>> +            return "std-Long";
> >>>        } else if (ObjectType.instanceOf(java.sql.Timestamp.class,
> >>> this.type)) {
> >>> -            return "string";
> >>> +            return "sql-Timestamp";
> >>> +        } else if
> >>> (ObjectType.instanceOf(org.ofbiz.entity.GenericValue.class,
> >>> this.type)) {
> >>> +            return "eeval-";
> >>> +        } else if
> >>> (ObjectType.instanceOf(org.ofbiz.entity.GenericPK.class,  
> >>> this.type)) {
> >>> +            return "eepk-";
> >>> +        } else if (ObjectType.instanceOf(java.util.Map.class,
> >>> this.type)) {
> >>> +            return "map-Map";
> >>> +        } else if (ObjectType.instanceOf(java.util.List.class,
> >>> this.type)) {
> >>> +            return "col-LinkedList";
> >>> +        } else {
> >>> +            return "cus-obj";
> >>>        }
> >>>
> >>> -        // TODO add array support (maybe even convert List
> >>> objects); add GenericValue/Map support
> >>> -        throw new WSDLException(WSDLException.OTHER_ERROR, "Service
> >>> cannot be described with WSDL (" + this.name + " / " + this.type +
> >>> ")");
> >>> +        //throw new WSDLException(WSDLException.OTHER_ERROR,
> >>> "Service cannot be described with WSDL (" + this.name + " / " +
> >>> this.type + ")");
> >>>    }
> >>>
> >>>    static class ModelParamValidator implements Serializable {
> >>>
> >>> Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/
> >>> ModelService.java
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java?rev=892712&r1=892711&r2=892712&view=diff
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/
> >>> ModelService.java (original)
> >>> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/
> >>> ModelService.java Mon Dec 21 07:31:58 2009
> >>> @@ -41,9 +41,11 @@
> >>> import javax.wsdl.Message;
> >>> import javax.wsdl.Operation;
> >>> import javax.wsdl.Output;
> >>> +import javax.wsdl.Part;
> >>> import javax.wsdl.Port;
> >>> import javax.wsdl.PortType;
> >>> import javax.wsdl.Service;
> >>> +import javax.wsdl.Types;
> >>> import javax.wsdl.WSDLException;
> >>> import javax.wsdl.extensions.soap.SOAPAddress;
> >>> import javax.wsdl.extensions.soap.SOAPBinding;
> >>> @@ -51,6 +53,8 @@
> >>> import javax.wsdl.extensions.soap.SOAPOperation;
> >>> import javax.wsdl.factory.WSDLFactory;
> >>> import javax.xml.namespace.QName;
> >>> +import javax.xml.parsers.DocumentBuilder;
> >>> +import javax.xml.parsers.DocumentBuilderFactory;
> >>>
> >>> import javolution.util.FastList;
> >>> import javolution.util.FastMap;
> >>> @@ -66,6 +70,7 @@
> >>> import org.ofbiz.service.group.GroupServiceModel;
> >>> import org.ofbiz.service.group.ServiceGroupReader;
> >>> import org.w3c.dom.Document;
> >>> +import org.w3c.dom.Element;
> >>>
> >>> import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
> >>> import com.ibm.wsdl.extensions.soap.SOAPBindingImpl;
> >>> @@ -1189,6 +1194,18 @@
> >>> }
> >>>
> >>>    public void getWSDL(Definition def, String locationURI) throws
> >>> WSDLException {
> >>> +
> >>> +        DocumentBuilderFactory factory =
> >>> DocumentBuilderFactory.newInstance();
> >>> +        DocumentBuilder builder = null;
> >>> +        Document document = null;
> >>> +        try {
> >>> +            builder = factory.newDocumentBuilder();
> >>> +            document = builder.newDocument();
> >>> +        } catch (Exception e) {
> >>> +            throw new WSDLException("can not create WSDL", module);
> >>> +        }
> >>> +        def.setTypes(this.getTypes(document, def));
> >>> +
> >>>        // set the IN parameters
> >>>        Input input = def.createInput();
> >>>        Set<String> inParam = this.getInParamNames();
> >>> @@ -1196,12 +1213,25 @@
> >>>            Message inMessage = def.createMessage();
> >>>            inMessage.setQName(new QName(TNS, this.name +  
> >>> "Request"));
> >>>            inMessage.setUndefined(false);
> >>> +            Part parametersPart = def.createPart();
> >>> +            parametersPart.setName("map-Map");
> >>> +            parametersPart.setTypeName(new QName(TNS, "map-Map"));
> >>> +            inMessage.addPart(parametersPart);
> >>> +            Element documentation =
> >>> document.createElement("wsdl:documentation");
> >>>            for (String paramName: inParam) {
> >>>                ModelParam param = this.getParam(paramName);
> >>>                if (!param.internal) {
> >>> -                    inMessage.addPart(param.getWSDLPart(def));
> >>> +                    Part part = param.getWSDLPart(def);
> >>> +                    Element attribute =
> >>> document.createElement("attribute");
> >>> +                    attribute.setAttribute("name", paramName);
> >>> +                    attribute.setAttribute("type",
> >>> part.getTypeName().getLocalPart());
> >>> +                    attribute.setAttribute("namespace",
> >>> part.getTypeName().getNamespaceURI());
> >>> +                    attribute.setAttribute("java-class",  
> >>> param.type);
> >>> +                    attribute.setAttribute("optional",
> >>> Boolean.toString(param.optional));
> >>> +                    documentation.appendChild(attribute);
> >>>                }
> >>>            }
> >>> +            parametersPart.setDocumentationElement(documentation);
> >>>            def.addMessage(inMessage);
> >>>            input.setMessage(inMessage);
> >>>        }
> >>> @@ -1213,12 +1243,25 @@
> >>>            Message outMessage = def.createMessage();
> >>>            outMessage.setQName(new QName(TNS, this.name +
> >>> "Response"));
> >>>            outMessage.setUndefined(false);
> >>> +            Part resultsPart = def.createPart();
> >>> +            resultsPart.setName("map-Map");
> >>> +            resultsPart.setTypeName(new QName(TNS, "map-Map"));
> >>> +            outMessage.addPart(resultsPart);
> >>> +            Element documentation =
> >>> document.createElement("wsdl:documentation");
> >>>            for (String paramName: outParam) {
> >>>                ModelParam param = this.getParam(paramName);
> >>>                if (!param.internal) {
> >>> -                    outMessage.addPart(param.getWSDLPart(def));
> >>> +                    Part part = param.getWSDLPart(def);
> >>> +                    Element attribute =
> >>> document.createElement("attribute");
> >>> +                    attribute.setAttribute("name", paramName);
> >>> +                    attribute.setAttribute("type",
> >>> part.getTypeName().getLocalPart());
> >>> +                    attribute.setAttribute("namespace",
> >>> part.getTypeName().getNamespaceURI());
> >>> +                    attribute.setAttribute("java-class",  
> >>> param.type);
> >>> +                    attribute.setAttribute("optional",
> >>> Boolean.toString(param.optional));
> >>> +                    documentation.appendChild(attribute);
> >>>                }
> >>>            }
> >>> +            resultsPart.setDocumentationElement(documentation);
> >>>            def.addMessage(outMessage);
> >>>            output.setMessage(outMessage);
> >>>        }
> >>> @@ -1291,4 +1334,410 @@
> >>>        service.addPort(port);
> >>>        def.addService(service);
> >>>    }
> >>> +
> >>> +    public Types getTypes(Document document, Definition def) {
> >>> +        Types types = def.createTypes();
> >>> +        /* Schema */
> >>> +        Element schema = document.createElement("xsd:schema");
> >>> +        schema.setAttribute("targetNamespace", TNS);
> >>> +
> >>> +        /*-----------------------------------*/
> >>> +        /*--------- Standard Objects --------*/
> >>> +        /*-----------------------------------*/
> >>> +
> >>> +        /* std-String Element */
> >>> +        Element stdStringElement =
> >>> document.createElement("xsd:element");
> >>> +        stdStringElement.setAttribute("name", "std-String");
> >>> +        Element stdStringElement0 =
> >>> document.createElement("xsd:complexType");
> >>> +        stdStringElement.appendChild(stdStringElement0);
> >>> +        Element stdStringElement1 =
> >>> document.createElement("xsd:attribute");
> >>> +        stdStringElement0.appendChild(stdStringElement1);
> >>> +        stdStringElement1.setAttribute("name", "value");
> >>> +        stdStringElement1.setAttribute("type", "xsd:string");
> >>> +        stdStringElement1.setAttribute("use", "required");
> >>> +        schema.appendChild(stdStringElement);
> >>> +        /* std-Integer Element */
> >>> +        Element stdIntegerElement =
> >>> document.createElement("xsd:element");
> >>> +        stdIntegerElement.setAttribute("name", "std-Integer");
> >>> +        Element stdIntegerElement0 =
> >>> document.createElement("xsd:complexType");
> >>> +        stdIntegerElement.appendChild(stdIntegerElement0);
> >>> +        Element stdIntegerElement1 =
> >>> document.createElement("xsd:attribute");
> >>> +        stdIntegerElement0.appendChild(stdIntegerElement1);
> >>> +        stdIntegerElement1.setAttribute("name", "value");
> >>> +        stdIntegerElement1.setAttribute("type", "xsd:integer");
> >>> +        stdIntegerElement1.setAttribute("use", "required");
> >>> +        schema.appendChild(stdIntegerElement);
> >>> +        /* std-Long Element */
> >>> +        Element stdLongElement =
> >>> document.createElement("xsd:element");
> >>> +        stdLongElement.setAttribute("name", "std-Long");
> >>> +        Element stdLongElement0 =
> >>> document.createElement("xsd:complexType");
> >>> +        stdLongElement.appendChild(stdLongElement0);
> >>> +        Element stdLongElement1 =
> >>> document.createElement("xsd:attribute");
> >>> +        stdLongElement0.appendChild(stdLongElement1);
> >>> +        stdLongElement1.setAttribute("name", "value");
> >>> +        stdLongElement1.setAttribute("type", "xsd:long");
> >>> +        stdLongElement1.setAttribute("use", "required");
> >>> +        schema.appendChild(stdLongElement);
> >>> +        /* std-Float Element */
> >>> +        Element stdFloatElement =
> >>> document.createElement("xsd:element");
> >>> +        stdFloatElement.setAttribute("name", "std-Float");
> >>> +        Element stdFloatElement0 =
> >>> document.createElement("xsd:complexType");
> >>> +        stdFloatElement.appendChild(stdFloatElement0);
> >>> +        Element stdFloatElement1 =
> >>> document.createElement("xsd:attribute");
> >>> +        stdFloatElement0.appendChild(stdFloatElement1);
> >>> +        stdFloatElement1.setAttribute("name", "value");
> >>> +        stdFloatElement1.setAttribute("type", "xsd:float");
> >>> +        stdFloatElement1.setAttribute("use", "required");
> >>> +        schema.appendChild(stdFloatElement);
> >>> +        /* std-Double Element */
> >>> +        Element stdDoubleElement =
> >>> document.createElement("xsd:element");
> >>> +        stdDoubleElement.setAttribute("name", "std-Double");
> >>> +        Element stdDoubleElement0 =
> >>> document.createElement("xsd:complexType");
> >>> +        stdDoubleElement.appendChild(stdDoubleElement0);
> >>> +        Element stdDoubleElement1 =
> >>> document.createElement("xsd:attribute");
> >>> +        stdDoubleElement0.appendChild(stdDoubleElement1);
> >>> +        stdDoubleElement1.setAttribute("name", "value");
> >>> +        stdDoubleElement1.setAttribute("type", "xsd:double");
> >>> +        stdDoubleElement1.setAttribute("use", "required");
> >>> +        schema.appendChild(stdDoubleElement);
> >>> +        /* std-Boolean Element */
> >>> +        Element stdBooleanElement =
> >>> document.createElement("xsd:element");
> >>> +        stdBooleanElement.setAttribute("name", "std-Boolean");
> >>> +        Element stdBooleanElement0 =
> >>> document.createElement("xsd:complexType");
> >>> +        stdBooleanElement.appendChild(stdBooleanElement0);
> >>> +        Element stdBooleanElement1 =
> >>> document.createElement("xsd:attribute");
> >>> +        stdBooleanElement0.appendChild(stdBooleanElement1);
> >>> +        stdBooleanElement1.setAttribute("name", "value");
> >>> +        stdBooleanElement1.setAttribute("type", "xsd:boolean");
> >>> +        stdBooleanElement1.setAttribute("use", "required");
> >>> +        schema.appendChild(stdBooleanElement);
> >>> +        /* std-Locale Element */
> >>> +        Element stdLocaleElement =
> >>> document.createElement("xsd:element");
> >>> +        stdLocaleElement.setAttribute("name", "std-Locale");
> >>> +        Element stdLocaleElement0 =
> >>> document.createElement("xsd:complexType");
> >>> +        stdLocaleElement.appendChild(stdLocaleElement0);
> >>> +        Element stdLocaleElement1 =
> >>> document.createElement("xsd:attribute");
> >>> +        stdLocaleElement0.appendChild(stdLocaleElement1);
> >>> +        stdLocaleElement1.setAttribute("name", "value");
> >>> +        stdLocaleElement1.setAttribute("type", "xsd:string");
> >>> +        stdLocaleElement1.setAttribute("use", "required");
> >>> +        schema.appendChild(stdLocaleElement);
> >>> +
> >>> +        /*-----------------------------------*/
> >>> +        /*----------- SQL Objects -----------*/
> >>> +        /*-----------------------------------*/
> >>> +
> >>> +        /* sql-Timestamp Element */
> >>> +        Element sqlTimestampElement =
> >>> document.createElement("xsd:element");
> >>> +        sqlTimestampElement.setAttribute("name", "sql-Timestamp");
> >>> +        Element sqlTimestampElement0 =
> >>> document.createElement("xsd:complexType");
> >>> +        sqlTimestampElement.appendChild(sqlTimestampElement0);
> >>> +        Element sqlTimestampElement1 =
> >>> document.createElement("xsd:attribute");
> >>> +        sqlTimestampElement0.appendChild(sqlTimestampElement1);
> >>> +        sqlTimestampElement1.setAttribute("name", "value");
> >>> +        sqlTimestampElement1.setAttribute("type", "xsd:dateTime");
> >>> +        sqlTimestampElement1.setAttribute("use", "required");
> >>> +        schema.appendChild(sqlTimestampElement);
> >>> +        /* sql-Date Element */
> >>> +        Element sqlDateElement =
> >>> document.createElement("xsd:element");
> >>> +        sqlDateElement.setAttribute("name", "sql-Date");
> >>> +        Element sqlDateElement0 =
> >>> document.createElement("xsd:complexType");
> >>> +        sqlDateElement.appendChild(sqlDateElement0);
> >>> +        Element sqlDateElement1 =
> >>> document.createElement("xsd:attribute");
> >>> +        sqlDateElement0.appendChild(sqlDateElement1);
> >>> +        sqlDateElement1.setAttribute("name", "value");
> >>> +        sqlDateElement1.setAttribute("type", "xsd:date");
> >>> +        sqlDateElement1.setAttribute("use", "required");
> >>> +        schema.appendChild(sqlDateElement);
> >>> +        /* sql-Time Element */
> >>> +        Element sqlTimeElement =
> >>> document.createElement("xsd:element");
> >>> +        sqlTimeElement.setAttribute("name", "sql-Time");
> >>> +        Element sqlTimeElement0 =
> >>> document.createElement("xsd:complexType");
> >>> +        sqlTimeElement.appendChild(sqlTimeElement0);
> >>> +        Element sqlTimeElement1 =
> >>> document.createElement("xsd:attribute");
> >>> +        sqlTimeElement0.appendChild(sqlTimeElement1);
> >>> +        sqlTimeElement1.setAttribute("name", "value");
> >>> +        sqlTimeElement1.setAttribute("type", "xsd:time");
> >>> +        sqlTimeElement1.setAttribute("use", "required");
> >>> +        schema.appendChild(sqlTimeElement);
> >>> +
> >>> +        /*-----------------------------------*/
> >>> +        /*----------- List Objects -----------*/
> >>> +        /*-----------------------------------*/
> >>> +
> >>> +        /* col-ArrayList Element */
> >>> +        Element colArrayListElement =
> >>> document.createElement("xsd:element");
> >>> +        colArrayListElement.setAttribute("name", "col-ArrayList");
> >>> +        schema.appendChild(colArrayListElement);
> >>> +        /* col-LinkedList Element */
> >>> +        Element colLinkedListElement =
> >>> document.createElement("xsd:element");
> >>> +        colLinkedListElement.setAttribute("name", "col- 
> >>> LinkedList");
> >>> +        schema.appendChild(colLinkedListElement);
> >>> +        /* col-Stack Element */
> >>> +        Element colStackElement =
> >>> document.createElement("xsd:element");
> >>> +        colStackElement.setAttribute("name", "col-Stack");
> >>> +        schema.appendChild(colStackElement);
> >>> +        /* col-Vector Element */
> >>> +        Element colVectorElement =
> >>> document.createElement("xsd:element");
> >>> +        colVectorElement.setAttribute("name", "col-Vector");
> >>> +        schema.appendChild(colVectorElement);
> >>> +        /* col-TreeSet Element */
> >>> +        Element colTreeSetElement =
> >>> document.createElement("xsd:element");
> >>> +        colTreeSetElement.setAttribute("name", "col-TreeSet");
> >>> +        schema.appendChild(colTreeSetElement);
> >>> +        /* col-HashSet Element */
> >>> +        Element colHashSetElement =
> >>> document.createElement("xsd:element");
> >>> +        colHashSetElement.setAttribute("name", "col-HashSet");
> >>> +        schema.appendChild(colHashSetElement);
> >>> +        /* col-Collection Element */
> >>> +        Element colCollectionElement =
> >>> document.createElement("xsd:element");
> >>> +        colCollectionElement.setAttribute("name", "col- 
> >>> Collection");
> >>> +        schema.appendChild(colCollectionElement);
> >>> +
> >>> +        /*-----------------------------------*/
> >>> +        /*----------- Map Objects -----------*/
> >>> +        /*-----------------------------------*/
> >>> +
> >>> +        /* map-TreeMap Element */
> >>> +        Element mapTreeMapElement =
> >>> document.createElement("xsd:element");
> >>> +        mapTreeMapElement.setAttribute("name", "map-TreeMap");
> >>> +        mapTreeMapElement.setAttribute("type", "tns:map-Map");
> >>> +        schema.appendChild(mapTreeMapElement);
> >>> +        /* map-WeakHashMap Element */
> >>> +        Element mapWeakHashMapElement =
> >>> document.createElement("xsd:element");
> >>> +        mapWeakHashMapElement.setAttribute("name", "map-
> >>> WeakHashMap");
> >>> +        mapWeakHashMapElement.setAttribute("type", "tns:map-Map");
> >>> +        schema.appendChild(mapWeakHashMapElement);
> >>> +        /* map-Hashtable Element */
> >>> +        Element mapHashtableElement =
> >>> document.createElement("xsd:element");
> >>> +        mapHashtableElement.setAttribute("name", "map-Hashtable");
> >>> +        mapHashtableElement.setAttribute("type", "tns:map-Map");
> >>> +        schema.appendChild(mapHashtableElement);
> >>> +        /* map-Properties Element */
> >>> +        Element mapPropertiesElement =
> >>> document.createElement("xsd:element");
> >>> +        mapPropertiesElement.setAttribute("name", "map- 
> >>> Properties");
> >>> +        mapPropertiesElement.setAttribute("type", "tns:map-Map");
> >>> +        schema.appendChild(mapPropertiesElement);
> >>> +        /* map-HashMap Element */
> >>> +        Element mapHashMapElement =
> >>> document.createElement("xsd:element");
> >>> +        mapHashMapElement.setAttribute("name", "map-HashMap");
> >>> +        mapHashMapElement.setAttribute("type", "tns:map-Map");
> >>> +        schema.appendChild(mapHashMapElement);
> >>> +        /* map-Map Element */
> >>> +        Element mapMapElement =
> >>> document.createElement("xsd:element");
> >>> +        mapMapElement.setAttribute("name", "map-Map");
> >>> +        mapMapElement.setAttribute("type", "tns:map-Map");
> >>> +        schema.appendChild(mapMapElement);
> >>> +        /* map-Entry Element */
> >>> +        Element mapEntryElement =
> >>> document.createElement("xsd:element");
> >>> +        mapEntryElement.setAttribute("name", "map-Entry");
> >>> +        mapEntryElement.setAttribute("type", "tns:map-Entry");
> >>> +        schema.appendChild(mapEntryElement);
> >>> +        /* map-Key Element */
> >>> +        Element mapKeyElement =
> >>> document.createElement("xsd:element");
> >>> +        mapKeyElement.setAttribute("name", "map-Key");
> >>> +        mapKeyElement.setAttribute("type", "tns:map-Key");
> >>> +        schema.appendChild(mapKeyElement);
> >>> +        /* map-Value Element */
> >>> +        Element mapValueElement =
> >>> document.createElement("xsd:element");
> >>> +        mapValueElement.setAttribute("name", "map-Value");
> >>> +        mapValueElement.setAttribute("type", "tns:map-Value");
> >>> +        schema.appendChild(mapValueElement);
> >>> +        /* eepk- Element */
> >>> +        Element eepkElement =  
> >>> document.createElement("xsd:element");
> >>> +        eepkElement.setAttribute("name", "eepk-");
> >>> +        eepkElement.setAttribute("type", "tns:map-Value");
> >>> +        schema.appendChild(eepkElement);
> >>> +        /* eeval- Element */
> >>> +        Element eevalElement =  
> >>> document.createElement("xsd:element");
> >>> +        eevalElement.setAttribute("name", "eeval-");
> >>> +        eevalElement.setAttribute("type", "tns:map-Value");
> >>> +        schema.appendChild(eevalElement);
> >>> +
> >>> +        /*-----------------------------------*/
> >>> +        /*----------- Custom Objects -----------*/
> >>> +        /*-----------------------------------*/
> >>> +
> >>> +        /* cus-obj Element */
> >>> +        Element cusObjElement =
> >>> document.createElement("xsd:element");
> >>> +        cusObjElement.setAttribute("name", "cus-obj");
> >>> +        schema.appendChild(cusObjElement);
> >>> +
> >>> +        /*-----------------------------------*/
> >>> +        /*---------- Complex Types ----------*/
> >>> +        /*-----------------------------------*/
> >>> +
> >>> +        /* map-Map Complex Type */
> >>> +        Element mapMapComplexType =
> >>> document.createElement("xsd:complexType");
> >>> +        mapMapComplexType.setAttribute("name", "map-Map");
> >>> +        Element mapMapComplexType0 =
> >>> document.createElement("xsd:sequence");
> >>> +        mapMapComplexType.appendChild(mapMapComplexType0);
> >>> +        Element mapMapComplexType1 =
> >>> document.createElement("xsd:element");
> >>> +        mapMapComplexType1.setAttribute("ref", "tns:map-Entry");
> >>> +        mapMapComplexType1.setAttribute("minOccurs", "0");
> >>> +        mapMapComplexType1.setAttribute("maxOccurs", "unbounded");
> >>> +        mapMapComplexType0.appendChild(mapMapComplexType1);
> >>> +        schema.appendChild(mapMapComplexType);
> >>> +        /* map-Entry Complex Type */
> >>> +        Element mapEntryComplexType =
> >>> document.createElement("xsd:complexType");
> >>> +        mapEntryComplexType.setAttribute("name", "map-Entry");
> >>> +        Element mapEntryComplexType0 =
> >>> document.createElement("xsd:sequence");
> >>> +        mapEntryComplexType.appendChild(mapEntryComplexType0);
> >>> +        Element mapEntryComplexType1 =
> >>> document.createElement("xsd:element");
> >>> +        mapEntryComplexType1.setAttribute("ref", "tns:map-Key");
> >>> +        mapEntryComplexType1.setAttribute("minOccurs", "1");
> >>> +        mapEntryComplexType1.setAttribute("maxOccurs", "1");
> >>> +        mapEntryComplexType0.appendChild(mapEntryComplexType1);
> >>> +        Element mapEntryComplexType2 =
> >>> document.createElement("xsd:element");
> >>> +        mapEntryComplexType2.setAttribute("ref", "tns:map-Value");
> >>> +        mapEntryComplexType2.setAttribute("minOccurs", "1");
> >>> +        mapEntryComplexType2.setAttribute("maxOccurs", "1");
> >>> +        mapEntryComplexType0.appendChild(mapEntryComplexType2);
> >>> +        schema.appendChild(mapEntryComplexType);
> >>> +        /* map-Key Complex Type */
> >>> +        Element mapKeyComplexType =
> >>> document.createElement("xsd:complexType");
> >>> +        mapKeyComplexType.setAttribute("name", "map-Key");
> >>> +        Element mapKeyComplexType0 =
> >>> document.createElement("xsd:all");
> >>> +        mapKeyComplexType.appendChild(mapKeyComplexType0);
> >>> +        Element mapKeyComplexType1 =
> >>> document.createElement("xsd:element");
> >>> +        mapKeyComplexType1.setAttribute("ref", "tns:std-String");
> >>> +        mapKeyComplexType1.setAttribute("minOccurs", "1");
> >>> +        mapKeyComplexType1.setAttribute("maxOccurs", "1");
> >>> +        mapKeyComplexType0.appendChild(mapKeyComplexType1);
> >>> +        schema.appendChild(mapKeyComplexType);
> >>> +        /* map-Value Complex Type */
> >>> +        Element mapValueComplexType =
> >>> document.createElement("xsd:complexType");
> >>> +        mapValueComplexType.setAttribute("name", "map-Value");
> >>> +        Element mapValueComplexType0 =
> >>> document.createElement("xsd:choice");
> >>> +        mapValueComplexType.appendChild(mapValueComplexType0);
> >>> +        Element mapValueComplexType1 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType1.setAttribute("ref", "tns:std-String");
> >>> +        mapValueComplexType1.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType1.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType1);
> >>> +        Element mapValueComplexType2 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType2.setAttribute("ref", "tns:std- 
> >>> Integer");
> >>> +        mapValueComplexType2.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType2.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType2);
> >>> +        Element mapValueComplexType3 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType3.setAttribute("ref", "tns:std-Long");
> >>> +        mapValueComplexType3.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType3.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType3);
> >>> +        Element mapValueComplexType4 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType4.setAttribute("ref", "tns:std-Float");
> >>> +        mapValueComplexType4.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType4.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType4);
> >>> +        Element mapValueComplexType5 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType5.setAttribute("ref", "tns:std-Double");
> >>> +        mapValueComplexType5.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType5.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType5);
> >>> +        Element mapValueComplexType6 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType6.setAttribute("ref", "tns:std- 
> >>> Boolean");
> >>> +        mapValueComplexType6.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType6.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType6);
> >>> +        Element mapValueComplexType7 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType7.setAttribute("ref", "tns:std-Locale");
> >>> +        mapValueComplexType7.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType7.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType7);
> >>> +        Element mapValueComplexType8 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType8.setAttribute("ref", "tns:sql-
> >>> Timestamp");
> >>> +        mapValueComplexType8.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType8.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType8);
> >>> +        Element mapValueComplexType9 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType9.setAttribute("ref", "tns:sql-Date");
> >>> +        mapValueComplexType9.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType9.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType9);
> >>> +        Element mapValueComplexType10 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType10.setAttribute("ref", "tns:sql-Time");
> >>> +        mapValueComplexType10.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType10.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType10);
> >>> +        Element mapValueComplexType11 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType11.setAttribute("ref", "tns:col-
> >>> ArrayList");
> >>> +        mapValueComplexType11.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType11.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType11);
> >>> +        Element mapValueComplexType12 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType12.setAttribute("ref", "tns:col-
> >>> LinkedList");
> >>> +        mapValueComplexType12.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType12.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType12);
> >>> +        Element mapValueComplexType13 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType13.setAttribute("ref", "tns:col-Stack");
> >>> +        mapValueComplexType13.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType13.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType13);
> >>> +        Element mapValueComplexType14 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType14.setAttribute("ref", "tns:col- 
> >>> Vector");
> >>> +        mapValueComplexType14.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType14.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType14);
> >>> +        Element mapValueComplexType15 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType15.setAttribute("ref", "tns:col- 
> >>> TreeSet");
> >>> +        mapValueComplexType15.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType15.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType15);
> >>> +        Element mapValueComplexType16 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType16.setAttribute("ref", "tns:col- 
> >>> HashSet");
> >>> +        mapValueComplexType16.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType16.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType16);
> >>> +        Element mapValueComplexType17 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType17.setAttribute("ref", "tns:col-
> >>> Collection");
> >>> +        mapValueComplexType17.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType17.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType17);
> >>> +        Element mapValueComplexType18 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType18.setAttribute("ref", "tns:map- 
> >>> HashMap");
> >>> +        mapValueComplexType18.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType18.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType18);
> >>> +        Element mapValueComplexType19 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType19.setAttribute("ref", "tns:map-
> >>> Properties");
> >>> +        mapValueComplexType19.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType19.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType19);
> >>> +        Element mapValueComplexType20 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType20.setAttribute("ref", "tns:map-
> >>> Hashtable");
> >>> +        mapValueComplexType20.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType20.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType20);
> >>> +        Element mapValueComplexType21 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType21.setAttribute("ref", "tns:map-
> >>> WeakHashMap");
> >>> +        mapValueComplexType21.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType21.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType21);
> >>> +        Element mapValueComplexType22 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType22.setAttribute("ref", "tns:map- 
> >>> TreeMap");
> >>> +        mapValueComplexType22.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType22.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType22);
> >>> +        Element mapValueComplexType23 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType23.setAttribute("ref", "tns:map-Map");
> >>> +        mapValueComplexType23.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType23.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType23);
> >>> +        Element mapValueComplexType24 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType24.setAttribute("ref", "tns:eepk-");
> >>> +        mapValueComplexType24.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType24.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType24);
> >>> +        Element mapValueComplexType25 =
> >>> document.createElement("xsd:element");
> >>> +        mapValueComplexType25.setAttribute("ref", "tns:eeval-");
> >>> +        mapValueComplexType25.setAttribute("minOccurs", "1");
> >>> +        mapValueComplexType25.setAttribute("maxOccurs", "1");
> >>> +        mapValueComplexType0.appendChild(mapValueComplexType25);
> >>> +        schema.appendChild(mapValueComplexType);
> >>> +
> >>> +        types.setDocumentationElement(schema);
> >>> +        return types;
> >>> +    }
> >>> }
> >>>
> >>> Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> >>> engine/
> >>> SOAPClientEngine.java
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java?rev=892712&r1=892711&r2=892712&view=diff
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/
> >>> SOAPClientEngine.java (original)
> >>> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/
> >>> SOAPClientEngine.java Mon Dec 21 07:31:58 2009
> >>> @@ -18,32 +18,32 @@
> >>>
> >>> *******************************************************************************/
> >>> package org.ofbiz.service.engine;
> >>>
> >>> -import java.net.MalformedURLException;
> >>> -import java.net.URL;
> >>> -import java.util.ArrayList;
> >>> -import java.util.Iterator;
> >>> +import java.io.StringReader;
> >>> import java.util.List;
> >>> import java.util.Map;
> >>>
> >>> import javax.xml.namespace.QName;
> >>> -import javax.xml.rpc.ParameterMode;
> >>> -import javax.xml.rpc.ServiceException;
> >>> +import javax.xml.stream.XMLInputFactory;
> >>> +import javax.xml.stream.XMLStreamReader;
> >>>
> >>> import javolution.util.FastMap;
> >>>
> >>> -import org.apache.axis.Message;
> >>> -import org.apache.axis.client.Call;
> >>> -import org.apache.axis.client.Service;
> >>> -import org.apache.axis.encoding.XMLType;
> >>> -import org.apache.axis.message.RPCElement;
> >>> -import org.apache.axis.message.RPCParam;
> >>> -import org.apache.axis.message.SOAPEnvelope;
> >>> +import org.apache.axiom.om.OMAbstractFactory;
> >>> +import org.apache.axiom.om.OMElement;
> >>> +import org.apache.axiom.om.OMFactory;
> >>> +import org.apache.axiom.om.impl.builder.StAXOMBuilder;
> >>> +import org.apache.axis2.AxisFault;
> >>> +import org.apache.axis2.addressing.EndpointReference;
> >>> +import org.apache.axis2.client.Options;
> >>> +import org.apache.axis2.client.ServiceClient;
> >>> +import org.ofbiz.base.util.Debug;
> >>> +import org.ofbiz.base.util.UtilValidate;
> >>> +import org.ofbiz.entity.Delegator;
> >>> +import org.ofbiz.entity.serialize.XmlSerializer;
> >>> import org.ofbiz.service.GenericServiceException;
> >>> import org.ofbiz.service.ModelParam;
> >>> import org.ofbiz.service.ModelService;
> >>> import org.ofbiz.service.ServiceDispatcher;
> >>> -import org.ofbiz.base.util.Debug;
> >>> -import org.ofbiz.base.util.UtilValidate;
> >>>
> >>> /**
> >>> * Generic Service SOAP Interface
> >>> @@ -78,113 +78,67 @@
> >>>
> >>>    // Invoke the remote SOAP service
> >>>    private Map<String, Object> serviceInvoker(ModelService
> >>> modelService, Map<String, Object> context) throws
> >>> GenericServiceException {
> >>> +        Delegator delegator = dispatcher.getDelegator();
> >>>        if (modelService.location == null || modelService.invoke ==
> >>> null)
> >>>            throw new GenericServiceException("Cannot locate service
> >>> to invoke");
> >>> -
> >>> -        Service service = null;
> >>> -        Call call = null;
> >>> -
> >>> +
> >>> +        ServiceClient client = null;
> >>> +        QName serviceName = null;
> >>> +
> >>>        try {
> >>> -            service = new Service();
> >>> -            call = (Call) service.createCall();
> >>> -        } catch (javax.xml.rpc.JAXRPCException e) {
> >>> -            throw new GenericServiceException("RPC service error",
> >>> e);
> >>> -        } catch (ServiceException e) {//Add by Andy.Chen 2003.01.15
> >>> +            client = new ServiceClient();
> >>> +            Options options = new Options();
> >>> +            EndpointReference endPoint = new
> >>> EndpointReference(this.getLocation(modelService));
> >>> +            options.setTo(endPoint);
> >>> +            client.setOptions(options);
> >>> +        } catch (AxisFault e) {
> >>>            throw new GenericServiceException("RPC service error",  
> >>> e);
> >>>        }
> >>> -
> >>> -        URL endPoint = null;
> >>> -
> >>> -        try {
> >>> -            endPoint = new URL(this.getLocation(modelService));
> >>> -        } catch (MalformedURLException e) {
> >>> -            throw new GenericServiceException("Location not a valid
> >>> URL", e);
> >>> -        }
> >>> -
> >>> +
> >>>        List<ModelParam> inModelParamList =
> >>> modelService.getInModelParamList();
> >>> -
> >>> +
> >>>        if (Debug.infoOn())
> >>> Debug.logInfo("[SOAPClientEngine.invoke] : Parameter length - " +
> >>> inModelParamList.size(), module);
> >>> -
> >>> -        call.setTargetEndpointAddress(endPoint);
> >>> -
> >>> +
> >>>        if (UtilValidate.isNotEmpty(modelService.nameSpace)) {
> >>> -            call.setOperationName(new QName(modelService.nameSpace,
> >>> modelService.invoke));
> >>> +            serviceName = new QName(modelService.nameSpace,
> >>> modelService.invoke);
> >>>        } else {
> >>> -            call.setOperationName(modelService.invoke);
> >>> +            serviceName = new QName(modelService.invoke);
> >>>        }
> >>> -
> >>> +
> >>>        int i = 0;
> >>> -
> >>> -        call.setOperation(call.getOperationName().getLocalPart());
> >>> -        List<Object> vParams = new ArrayList<Object>();
> >>> +
> >>> +        Map<String, Object> parameterMap = FastMap.newInstance();
> >>>        for (ModelParam p: inModelParamList) {
> >>>            if (Debug.infoOn())
> >>> Debug.logInfo("[SOAPClientEngine.invoke} : Parameter: " + p.name +
> >>> " (" + p.mode + ") - " + i, module);
> >>>
> >>>            // exclude params that ModelServiceReader insert into
> >>> (internal params)
> >>>            if (!p.internal) {
> >>> -                QName qName =
> >>> call
> >>> .getParameterTypeByName
> >>> (p.name); //.getTypeMapping().getTypeQName((Class)
> >>> ObjectType.classNameClassMap.get(p.type));
> >>> -                call.addParameter(p.name, qName, getMode(p.mode));
> >>> -                vParams.add(context.get(p.name));
> >>> +                parameterMap.put(p.name, context.get(p.name));
> >>>            }
> >>>            i++;
> >>>        }
> >>>
> >>> -        call.setReturnType(XMLType.XSD_ANYTYPE);
> >>> -        Object[] params=vParams.toArray(new  
> >>> Object[vParams.size()]);
> >>> -
> >>> -        Object result = null;
> >>> -
> >>> +        OMElement parameterSer = null;
> >>> +
> >>>        try {
> >>> -            Debug.logInfo("[SOAPClientEngine.invoke] : Sending Call
> >>> To SOAP Server", module);
> >>> -            result = call.invoke(params);
> >>> -        } catch (java.rmi.RemoteException e) {
> >>> -            throw new GenericServiceException("RPC error", e);
> >>> -        }
> >>> -        if (Debug.verboseOn()) {
> >>> -            Debug.log("SOAP Service Result - " + result, module);
> >>> +            String xmlParameters =
> >>> XmlSerializer.serialize(parameterMap);
> >>> +            XMLStreamReader reader =
> >>> XMLInputFactory.newInstance().createXMLStreamReader(new
> >>> StringReader(xmlParameters));
> >>> +            StAXOMBuilder builder = new StAXOMBuilder(reader);
> >>> +            parameterSer = builder.getDocumentElement();
> >>> +        } catch (Exception e) {
> >>> +            Debug.logError(e, module);
> >>>        }
> >>> -
> >>> -        return
> >>> getResponseParams(call.getMessageContext().getResponseMessage());
> >>> -    }
> >>> -
> >>> -    private Map<String, Object> getResponseParams(Message
> >>> respMessage) {
> >>> -        Map<String, Object> mRet = FastMap.newInstance();
> >>> +
> >>> +        Map<String, Object> results = null;
> >>>        try {
> >>> -            SOAPEnvelope resEnv = respMessage.getSOAPEnvelope();
> >>> -            Iterator<?> i = resEnv.getBodyElements().iterator();
> >>> -            while (i.hasNext()) {
> >>> -                Object o = i.next();
> >>> -
> >>> -                if (o instanceof RPCElement) {
> >>> -                    RPCElement body = (RPCElement) o;
> >>> -
> >>> -                    Iterator<?> p = body.getParams().iterator();
> >>> -                    while (p.hasNext()) {
> >>> -                        RPCParam param = (RPCParam) p.next();
> >>> -                        mRet.put(param.getName(),  
> >>> param.getValue());
> >>> -                        if (Debug.verboseOn()) {
> >>> -                            Debug.log("SOAP Client Param - " +
> >>> param.getName() + "=" + param.getValue(), module);
> >>> -                        }
> >>> -                    }
> >>> -                }
> >>> -            }
> >>> -        } catch (org.apache.axis.AxisFault e) {
> >>> -            Debug.logError(e, "AxisFault", module);
> >>> -        } catch (org.xml.sax.SAXException e) {
> >>> -            Debug.logError(e, "SAXException", module);
> >>> -        }
> >>> -        return mRet;
> >>> -    }
> >>> -
> >>> -    private ParameterMode getMode(String sMode) {
> >>> -        if (sMode.equals("IN")) {
> >>> -            return ParameterMode.IN;
> >>> -        } else if (sMode.equals("OUT")) {
> >>> -            return ParameterMode.OUT;
> >>> -        } else if (sMode.equals("INOUT")) {
> >>> -            return ParameterMode.INOUT;
> >>> -        } else {
> >>> -            return null;
> >>> +            OMFactory factory = OMAbstractFactory.getOMFactory();
> >>> +            OMElement payload =  
> >>> factory.createOMElement(serviceName);
> >>> +            payload.addChild(parameterSer.getFirstElement());
> >>> +            OMElement respOMElement = client.sendReceive(payload);
> >>> +            results = (Map<String, Object>)
> >>> XmlSerializer.deserialize(respOMElement.toString(), delegator);
> >>> +        } catch (Exception e) {
> >>> +            Debug.logError(e, module);
> >>>        }
> >>> +        return results;
> >>>    }
> >>> }
> >>>
> >>> Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/
> >>> ServiceSOAPTests.java
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java?rev=892712&view=auto
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/test/
> >>> ServiceSOAPTests.java (added)
> >>> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/test/
> >>> ServiceSOAPTests.java Mon Dec 21 07:31:58 2009
> >>> @@ -0,0 +1,43 @@
> >>> +package org.ofbiz.service.test;
> >>> +
> >>> +import java.util.List;
> >>> +import java.util.Map;
> >>> +
> >>> +import javolution.util.FastMap;
> >>> +
> >>> +import org.ofbiz.base.util.Debug;
> >>> +import org.ofbiz.base.util.UtilDateTime;
> >>> +import org.ofbiz.base.util.UtilMisc;
> >>> +import org.ofbiz.entity.GenericValue;
> >>> +import org.ofbiz.service.testtools.OFBizTestCase;
> >>> +
> >>> +public class ServiceSOAPTests extends OFBizTestCase {
> >>> +
> >>> +    public final static String module =
> >>> ServiceSOAPTests.class.getName();
> >>> +
> >>> +    public ServiceSOAPTests(String name) {
> >>> +        // TODO Auto-generated constructor stub
> >>> +        super(name);
> >>> +    }
> >>> +
> >>> +    public void testSOAPSimpleService() throws Exception {
> >>> +        Map<String, Object> serviceContext = FastMap.newInstance();
> >>> +        serviceContext.put("defaultValue", new Double("123.4567"));
> >>> +        serviceContext.put("message", "Test Message !!!");
> >>> +        Map<String, Object> results =
> >>> dispatcher.runSync("testSoapSimple", serviceContext);
> >>> +        String resp = (String) results.get("resp");
> >>> +    }
> >>> +
> >>> +    public void testSOAPService() throws Exception {
> >>> +        Map<String, Object> serviceContext = FastMap.newInstance();
> >>> +        GenericValue productCategory =
> >>> delegator.makeValue("ProductCategory");
> >>> +        productCategory.put("productCategoryId", "PRODCAT_TEST");
> >>> +        productCategory.put("productCategoryTypeId",
> >>> "CATALOG_CATEGORY");
> >>> +        productCategory.put("categoryName", "Test  
> >>> ProductCategory");
> >>> +        productCategory.put("createdStamp",
> >>> UtilDateTime.nowTimestamp());
> >>> +        serviceContext.put("productCategory", productCategory);
> >>> +        Map<String, Object> results =
> >>> dispatcher.runSync("testSoap", serviceContext);
> >>> +        List<GenericValue> products = (List<GenericValue>)
> >>> results.get("products");
> >>> +        assertNotNull(products);
> >>> +    }
> >>> +}
> >>>
> >>> Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> >>> test/
> >>> ServiceSOAPTests.java
> >>> ------------------------------------------------------------------------------
> >>>   svn:eol-style = native
> >>>
> >>> Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> >>> test/
> >>> ServiceSOAPTests.java
> >>> ------------------------------------------------------------------------------
> >>>   svn:keywords = "Date Rev Author URL Id"
> >>>
> >>> Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> >>> test/
> >>> ServiceSOAPTests.java
> >>> ------------------------------------------------------------------------------
> >>>   svn:mime-type = text/plain
> >>>
> >>> Modified: ofbiz/trunk/framework/service/testdef/servicetests.xml
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/testdef/servicetests.xml?rev=892712&r1=892711&r2=892712&view=diff
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> --- ofbiz/trunk/framework/service/testdef/servicetests.xml  
> >>> (original)
> >>> +++ ofbiz/trunk/framework/service/testdef/servicetests.xml Mon Dec
> >>> 21 07:31:58 2009
> >>> @@ -22,6 +22,7 @@
> >>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>>        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd
> >>> ">
> >>>    <test-case case-name="service-tests"><junit-test-suite class-
> >>> name="org.ofbiz.service.test.ServiceEngineTests"/></test-case>
> >>> +    <test-case case-name="service-soap-tests"><junit-test-suite
> >>> class-name="org.ofbiz.service.test.ServiceSOAPTests"/></test-case>
> >>>
> >>>    <test-case case-name="load-service-test-data">
> >>>        <entity-xml action="load" entity-xml-url="component://
> >>> service/testdef/data/ServiceTestData.xml"/>
> >>>
> >>> Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/
> >>> SOAPEventHandler.java
> >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java?rev=892712&r1=892711&r2=892712&view=diff
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> =
> >>> = 
> >>> = 
> >>> ====================================================================
> >>> --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/
> >>> SOAPEventHandler.java (original)
> >>> +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/
> >>> SOAPEventHandler.java Mon Dec 21 07:31:58 2009
> >>> @@ -18,33 +18,35 @@
> >>>
> >>> *******************************************************************************/
> >>> package org.ofbiz.webapp.event;
> >>>
> >>> -import java.io.ByteArrayOutputStream;
> >>> import java.io.IOException;
> >>> import java.io.OutputStream;
> >>> +import java.io.StringReader;
> >>> import java.io.Writer;
> >>> -import java.util.List;
> >>> +import java.util.Iterator;
> >>> import java.util.Map;
> >>>
> >>> import javax.servlet.ServletContext;
> >>> import javax.servlet.http.HttpServletRequest;
> >>> import javax.servlet.http.HttpServletResponse;
> >>> import javax.wsdl.WSDLException;
> >>> -import javax.xml.soap.SOAPException;
> >>> +import javax.xml.namespace.QName;
> >>> +import javax.xml.stream.XMLInputFactory;
> >>> +import javax.xml.stream.XMLStreamReader;
> >>>
> >>> import javolution.util.FastMap;
> >>>
> >>> -import org.apache.axis.AxisFault;
> >>> -import org.apache.axis.Constants;
> >>> -import org.apache.axis.Message;
> >>> -import org.apache.axis.MessageContext;
> >>> -import org.apache.axis.message.RPCElement;
> >>> -import org.apache.axis.message.RPCParam;
> >>> -import org.apache.axis.message.SOAPEnvelope;
> >>> -import org.apache.axis.server.AxisServer;
> >>> +import org.apache.axiom.om.OMAbstractFactory;
> >>> +import org.apache.axiom.om.OMElement;
> >>> +import org.apache.axiom.om.impl.builder.StAXOMBuilder;
> >>> +import org.apache.axiom.om.util.StAXUtils;
> >>> +import org.apache.axiom.soap.SOAPBody;
> >>> +import org.apache.axiom.soap.SOAPEnvelope;
> >>> +import org.apache.axiom.soap.SOAPFactory;
> >>> +import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
> >>> import org.ofbiz.base.util.Debug;
> >>> -import org.ofbiz.base.util.UtilGenerics;
> >>> -import org.ofbiz.base.util.UtilMisc;
> >>> import org.ofbiz.base.util.UtilXml;
> >>> +import org.ofbiz.entity.GenericDelegator;
> >>> +import org.ofbiz.entity.serialize.XmlSerializer;
> >>> import org.ofbiz.service.DispatchContext;
> >>> import org.ofbiz.service.GenericServiceException;
> >>> import org.ofbiz.service.LocalDispatcher;
> >>> @@ -72,7 +74,7 @@
> >>>     */
> >>>    public String invoke(Event event, RequestMap requestMap,
> >>> HttpServletRequest request, HttpServletResponse response) throws
> >>> EventHandlerException {
> >>>        LocalDispatcher dispatcher = (LocalDispatcher)
> >>> request.getAttribute("dispatcher");
> >>> -        AxisServer axisServer;
> >>> +        GenericDelegator delegator = (GenericDelegator)
> >>> request.getAttribute("delegator");
> >>>
> >>>        // first check for WSDL request
> >>>        String wsdlReq = request.getParameter("wsdl");
> >>> @@ -138,163 +140,119 @@
> >>>        }
> >>>
> >>>        // not a wsdl request; invoke the service
> >>> -        try {
> >>> -            axisServer =
> >>> AxisServer.getServer(UtilMisc.toMap("name", "OFBiz/Axis Server",
> >>> "provider", null));
> >>> -        } catch (AxisFault e) {
> >>> -            sendError(response, e);
> >>> -            throw new EventHandlerException("Problems with the AXIS
> >>> server", e);
> >>> -        }
> >>> -        MessageContext mctx = new MessageContext(axisServer);
> >>> -        mctx.setEncodingStyle(Constants.URI_LITERAL_ENC); // sets
> >>> the response encoding
> >>> -
> >>> -        // get the SOAP message
> >>> -        Message msg = null;
> >>> -
> >>> -        try {
> >>> -            msg = new Message(request.getInputStream(), false,
> >>> -                        request.getHeader("Content-Type"),
> >>> request.getHeader("Content-Location"));
> >>> -        } catch (IOException ioe) {
> >>> -            sendError(response, "Problem processing the service");
> >>> -            throw new EventHandlerException("Cannot read the input
> >>> stream", ioe);
> >>> -        }
> >>> -
> >>> -        if (msg == null) {
> >>> -            sendError(response, "No message");
> >>> -            throw new EventHandlerException("SOAP Message is  
> >>> null");
> >>> -        }
> >>> -
> >>> -        // log the request message
> >>> -        if (Debug.verboseOn()) {
> >>> -            try {
> >>> -                Debug.logInfo("Request Message:\n" +
> >>> messageToString(msg) + "\n", module);
> >>> -            } catch (Throwable t) {
> >>> -            }
> >>> -        }
> >>> -
> >>> -        mctx.setRequestMessage(msg);
> >>> -
> >>> -        // new envelopes
> >>> -        SOAPEnvelope resEnv = new SOAPEnvelope();
> >>> +
> >>> +        // request envelope
> >>>        SOAPEnvelope reqEnv = null;
> >>> -
> >>> +
> >>>        // get the service name and parameters
> >>>        try {
> >>> -            reqEnv = (SOAPEnvelope)  
> >>> msg.getSOAPPart().getEnvelope();
> >>> -        } catch (SOAPException e) {
> >>> +            XMLStreamReader xmlReader =
> >>> StAXUtils.createXMLStreamReader(request.getInputStream());
> >>> +            StAXSOAPModelBuilder builder = new
> >>> StAXSOAPModelBuilder(xmlReader);
> >>> +            reqEnv = (SOAPEnvelope) builder.getDocumentElement();
> >>> +
> >>> +            // log the request message
> >>> +            if (Debug.verboseOn()) {
> >>> +                try {
> >>> +                    Debug.logInfo("Request Message:\n" + reqEnv +
> >>> "\n", module);
> >>> +                } catch (Throwable t) {
> >>> +                }
> >>> +            }
> >>> +        } catch (Exception e) {
> >>>            sendError(response, "Problem processing the service");
> >>>            throw new EventHandlerException("Cannot get the
> >>> envelope", e);
> >>>        }
> >>> -
> >>> -        List<Object> bodies = null;
> >>> -
> >>> -        try {
> >>> -            bodies =
> >>> UtilGenerics.checkList(reqEnv.getBodyElements());
> >>> -        } catch (AxisFault e) {
> >>> -            sendError(response, e);
> >>> -            throw new EventHandlerException(e.getMessage(), e);
> >>> -        }
> >>> -
> >>> +
> >>>        Debug.logVerbose("[Processing]: SOAP Event", module);
> >>> +
> >>> +        try {
> >>> +            // each is a different service call
> >>> +            SOAPBody reqBody = reqEnv.getBody();
> >>> +            Iterator serviceIter = reqBody.getChildElements();
> >>> +            while (serviceIter.hasNext()) {
> >>> +                Object serviceObj = serviceIter.next();
> >>> +                if (serviceObj instanceof OMElement) {
> >>> +                    OMElement serviceElement = (OMElement)
> >>> serviceObj;
> >>> +                    String serviceName =
> >>> serviceElement.getLocalName();
> >>> +                    Map<String, Object> parameters = (Map<String,
> >>> Object>) XmlSerializer.deserialize(serviceElement.toString(),
> >>> delegator);
> >>> +                    try {
> >>> +                        // verify the service is exported for
> >>> remote execution and invoke it
> >>> +                        ModelService model =
> >>> dispatcher.getDispatchContext().getModelService(serviceName);
> >>>
> >>> -        // each is a different service call
> >>> -        for (Object o: bodies) {
> >>> -
> >>> -            if (o instanceof RPCElement) {
> >>> -                RPCElement body = (RPCElement) o;
> >>> -                String serviceName = body.getMethodName();
> >>> -                List<RPCParam> params = null;
> >>> -                try {
> >>> -                    params =
> >>> UtilGenerics.checkList(body.getParams());
> >>> -                } catch (Exception e) {
> >>> -                    sendError(response, e);
> >>> -                    throw new EventHandlerException(e.getMessage(),
> >>> e);
> >>> -                }
> >>> -                Map<String, Object> serviceContext =
> >>> FastMap.newInstance();
> >>> -                for (RPCParam param: params) {
> >>> -                    if (Debug.verboseOn())
> >>> Debug.logVerbose("[Reading Param]: " + param.getName(), module);
> >>> -                    serviceContext.put(param.getName(),
> >>> param.getObjectValue());
> >>> -                }
> >>> -                try {
> >>> -                    // verify the service is exported for remote
> >>> execution and invoke it
> >>> -                    ModelService model =
> >>> dispatcher.getDispatchContext().getModelService(serviceName);
> >>> -
> >>> -                    if (model != null && model.export) {
> >>> -                        Map<String, Object> result =
> >>> dispatcher.runSync(serviceName, serviceContext);
> >>> -
> >>> -                        Debug.logVerbose("[EventHandler] : Service
> >>> invoked", module);
> >>> -                        RPCElement resBody = new
> >>> RPCElement(serviceName + "Response");
> >>> -
> >>> -                        resBody.setPrefix(body.getPrefix());
> >>> -
> >>> resBody.setNamespaceURI(body.getNamespaceURI());
> >>> -
> >>> -                        for (Map.Entry<String, Object> entry:
> >>> result.entrySet()) {
> >>> -                            RPCParam par = new
> >>> RPCParam(entry.getKey(), entry.getValue());
> >>> +                        if (model != null && model.export) {
> >>> +                            Map<String, Object> results =
> >>> dispatcher.runSync(serviceName, parameters);
> >>> +                            Debug.logVerbose("[EventHandler] :
> >>> Service invoked", module);
> >>> +
> >>> +                            // setup the response
> >>> +                            Debug.logVerbose("[EventHandler] :
> >>> Setting up response message", module);
> >>> +                            String xmlResults =
> >>> XmlSerializer.serialize(results);
> >>> +                            XMLStreamReader reader =
> >>> XMLInputFactory.newInstance().createXMLStreamReader(new
> >>> StringReader(xmlResults));
> >>> +                            StAXOMBuilder resultsBuilder = new
> >>> StAXOMBuilder(reader);
> >>> +                            OMElement resultSer =
> >>> resultsBuilder.getDocumentElement();
> >>> +
> >>> +                            // create the response soap
> >>> +                            SOAPFactory factory =
> >>> OMAbstractFactory.getSOAP11Factory();
> >>> +                            SOAPEnvelope resEnv =
> >>> factory.createSOAPEnvelope();
> >>> +                            SOAPBody resBody =
> >>> factory.createSOAPBody();
> >>> +                            OMElement resService =
> >>> factory.createOMElement(new QName(serviceName + "Response"));
> >>> +
> >>> resService.addChild(resultSer.getFirstElement());
> >>> +                            resBody.addChild(resService);
> >>> +                            resEnv.addChild(resBody);
> >>> +
> >>> +                            // log the response message
> >>> +                            if (Debug.verboseOn()) {
> >>> +                                try {
> >>> +                                    Debug.log("Response Message:\n"
> >>> + resEnv + "\n", module);
> >>> +                                } catch (Throwable t) {
> >>> +                                }
> >>> +                            }
> >>>
> >>> -                            resBody.addParam(par);
> >>> +
> >>> resEnv.serialize(response.getOutputStream());
> >>> +                            response.getOutputStream().flush();
> >>>                        }
> >>> -                        resEnv.addBodyElement(resBody);
> >>> -
> >>> resEnv.setEncodingStyle(Constants.URI_LITERAL_ENC);
> >>> -                    } else {
> >>> -                        sendError(response, "Requested service not
> >>> available");
> >>> -                        throw new EventHandlerException("Service is
> >>> not exported");
> >>> +
> >>> +                    } catch (GenericServiceException e) {
> >>> +                        sendError(response, "Problem processing the
> >>> service");
> >>> +                        throw new
> >>> EventHandlerException(e.getMessage(), e);
> >>>                    }
> >>> -                } catch (GenericServiceException e) {
> >>> -                    sendError(response, "Problem processing the
> >>> service");
> >>> -                    throw new EventHandlerException(e.getMessage(),
> >>> e);
> >>> -                } catch (javax.xml.soap.SOAPException e) {
> >>> -                    sendError(response, "Problem processing the
> >>> service");
> >>> -                    throw new EventHandlerException(e.getMessage(),
> >>> e);
> >>>                }
> >>>            }
> >>> -        }
> >>> -
> >>> -        // setup the response
> >>> -        Debug.logVerbose("[EventHandler] : Setting up response
> >>> message", module);
> >>> -        msg = new Message(resEnv);
> >>> -        mctx.setResponseMessage(msg);
> >>> -        if (msg == null) {
> >>> -            sendError(response, "No response message available");
> >>> -            throw new EventHandlerException("No response message
> >>> available");
> >>> -        }
> >>> -
> >>> -        // log the response message
> >>> -        if (Debug.verboseOn()) {
> >>> -            try {
> >>> -                Debug.log("Response Message:\n" +
> >>> messageToString(msg) + "\n", module);
> >>> -            } catch (Throwable t) {
> >>> -            }
> >>> -        }
> >>> -
> >>> -        try {
> >>> -
> >>> response
> >>> .setContentType(msg.getContentType(Constants.DEFAULT_SOAP_VERSION));
> >>> -
> >>> response
> >>> .setContentLength
> >>> (Integer.parseInt(Long.toString(msg.getContentLength())));
> >>> -        } catch (AxisFault e) {
> >>> -            sendError(response, e);
> >>> +        } catch (Exception e) {
> >>> +            sendError(response, e.getMessage());
> >>>            throw new EventHandlerException(e.getMessage(), e);
> >>>        }
> >>> -
> >>> -        try {
> >>> -            msg.writeTo(response.getOutputStream());
> >>> -            response.flushBuffer();
> >>> -        } catch (IOException e) {
> >>> -            throw new EventHandlerException("Cannot write to the
> >>> output stream");
> >>> -        } catch (SOAPException e) {
> >>> -            throw new EventHandlerException("Cannot write message
> >>> to the output stream");
> >>> -        }
> >>> -
> >>> -        Debug.logVerbose("[EventHandler] : Message sent to
> >>> requester", module);
> >>> -
> >>> +
> >>>        return null;
> >>>    }
> >>>
> >>> -    private void sendError(HttpServletResponse res, Object obj)
> >>> throws EventHandlerException {
> >>> -        Message msg = new Message(obj);
> >>> -
> >>> +    private void sendError(HttpServletResponse res, String
> >>> errorMessage) throws EventHandlerException {
> >>>        try {
> >>> -
> >>> res
> >>> .setContentType(msg.getContentType(Constants.DEFAULT_SOAP_VERSION));
> >>> -
> >>> res
> >>> .setContentLength
> >>> (Integer.parseInt(Long.toString(msg.getContentLength())));
> >>> -            msg.writeTo(res.getOutputStream());
> >>> -            res.flushBuffer();
> >>> +            // setup the response
> >>> +            Map<String, Object> results = FastMap.newInstance();
> >>> +            results.put("errorMessage", errorMessage);
> >>> +            String xmlResults= XmlSerializer.serialize(results);
> >>> +            XMLStreamReader xmlReader =
> >>> XMLInputFactory.newInstance().createXMLStreamReader(new
> >>> StringReader(xmlResults));
> >>> +            StAXOMBuilder resultsBuilder = new
> >>> StAXOMBuilder(xmlReader);
> >>> +            OMElement resultSer =
> >>> resultsBuilder.getDocumentElement();
> >>> +
> >>> +            // create the response soap
> >>> +            SOAPFactory factory =
> >>> OMAbstractFactory.getSOAP11Factory();
> >>> +            SOAPEnvelope resEnv = factory.createSOAPEnvelope();
> >>> +            SOAPBody resBody = factory.createSOAPBody();
> >>> +            OMElement errMsg = factory.createOMElement(new
> >>> QName("Response"));
> >>> +            errMsg.addChild(resultSer.getFirstElement());
> >>> +            resBody.addChild(errMsg);
> >>> +            resEnv.addChild(resBody);
> >>> +
> >>> +            // log the response message
> >>> +            if (Debug.verboseOn()) {
> >>> +                try {
> >>> +                    Debug.log("Response Message:\n" + resEnv +
> >>> "\n", module);
> >>> +                } catch (Throwable t) {
> >>> +                }
> >>> +            }
> >>> +
> >>> +            resEnv.serialize(res.getOutputStream());
> >>> +            res.getOutputStream().flush();
> >>>        } catch (Exception e) {
> >>>            throw new EventHandlerException(e.getMessage(), e);
> >>>        }
> >>> @@ -320,10 +278,4 @@
> >>>        uri.append(reqInfo);
> >>>        return uri.toString();
> >>>    }
> >>> -
> >>> -    public static String messageToString(Message msg) throws
> >>> SOAPException, IOException {
> >>> -        ByteArrayOutputStream out = new ByteArrayOutputStream();
> >>> -        msg.writeTo(out);
> >>> -        return out.toString();
> >>> -    }
> >>> }
> >>>
> >>>
> >>
> > -- 
> > Antwebsystems.com: Quality OFBiz services for competitive rates
> >
> 
-- 
Antwebsystems.com: Quality OFBiz services for competitive rates


Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Posted by Scott Gray <sc...@hotwaxmedia.com>.
Thanks Hans, looks good.

One reminder though, there were also unrelated changes in 893087,  
please remember to either describe them in the commit message as well  
or ideally commit them separately.

Thanks
Scott

On 22/12/2009, at 7:48 PM, Hans Bakker wrote:

> Hi Scott,
> Thank you for the comment, suggestion implemented by Chatree and
> Committed revision 893087.
>
> Regards,
> Hans
>
> On Mon, 2009-12-21 at 23:21 +1300, Scott Gray wrote:
>> Hi Hans,
>>
>> Thanks for committing some tests, it's great to see.
>>
>> One small issue though, the test introduces a dependency on the
>> product data model from common and the service engine, this means the
>> test would fail in a framework only installation.  I would suggest
>> switching the entity over to TestingNode which along with the other
>> entities in framework/entity/entitydef/entitymodel_test.xml are
>> provided for testing the lower level tools.
>>
>> Regards
>> Scott
>>
>> HotWax Media
>> http://www.hotwaxmedia.com
>>
>> On 21/12/2009, at 8:32 PM, hansbak@apache.org wrote:
>>
>>> Author: hansbak
>>> Date: Mon Dec 21 07:31:58 2009
>>> New Revision: 892712
>>>
>>> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
>>> Log:
>>> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in
>>> webservices including WSDL generation. see OFBIZ-3363 for more info.
>>> A contribution of Antwebsystems employee Chatree
>>>
>>> Added:
>>>   ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with
>>> props)
>>>   ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with
>>> props)
>>>   ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with
>>> props)
>>>   ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with
>>> props)
>>>   ofbiz/trunk/framework/service/lib/axis2-transport-
>>> http-1.5.1.jar   (with props)
>>>   ofbiz/trunk/framework/service/lib/axis2-transport-
>>> local-1.5.1.jar   (with props)
>>>   ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
>>> (with props)
>>>   ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
>>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/test/
>>> ServiceSOAPTests.java   (with props)
>>> Modified:
>>>   ofbiz/trunk/LICENSE
>>>   ofbiz/trunk/framework/common/servicedef/services_test.xml
>>>   ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>> CommonServices.java
>>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
>>> ModelParam.java
>>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>> ModelService.java
>>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/
>>> SOAPClientEngine.java
>>>   ofbiz/trunk/framework/service/testdef/servicetests.xml
>>>   ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/
>>> SOAPEventHandler.java
>>>
>>> Modified: ofbiz/trunk/LICENSE
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=892712&r1=892711&r2=892712&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/LICENSE (original)
>>> +++ ofbiz/trunk/LICENSE Mon Dec 21 07:31:58 2009
>>> @@ -87,6 +87,14 @@
>>> ofbiz/trunk/framework/jetty/lib/xmlParserAPIs-2.6.2.jar
>>> ofbiz/trunk/framework/service/lib/axis-ant.jar
>>> ofbiz/trunk/framework/service/lib/axis.jar
>>> +ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
>>> +ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
>>> +ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
>>> +ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar
>>> +ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar
>>> +ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
>>> +ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
>>> +ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
>>> ofbiz/trunk/framework/webapp/lib/fop-0.95.jar
>>> ofbiz/trunk/framework/webapp/lib/velocity-1.6.1.jar
>>> ofbiz/trunk/framework/webapp/lib/xmlgraphics-commons-1.3.1.jar
>>>
>>> Modified: ofbiz/trunk/framework/common/servicedef/services_test.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services_test.xml?rev=892712&r1=892711&r2=892712&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/framework/common/servicedef/services_test.xml
>>> (original)
>>> +++ ofbiz/trunk/framework/common/servicedef/services_test.xml Mon
>>> Dec 21 07:31:58 2009
>>> @@ -31,6 +31,12 @@
>>>        <attribute name="message" type="String" mode="IN"
>>> optional="true"/>
>>>        <attribute name="resp" type="String" mode="OUT"/>
>>>    </service>
>>> +    <service name="testSOAPScv" engine="java" export="true"
>>> validate="false" require-new-transaction="true"
>>> +            location="org.ofbiz.common.CommonServices"
>>> invoke="testSOAPService">
>>> +        <description>Test SOAP service</description>
>>> +        <attribute name="productCategory"
>>> type="org.ofbiz.entity.GenericValue" mode="IN" optional="false"/>
>>> +        <attribute name="products" type="List" mode="OUT"
>>> optional="true"/>
>>> +    </service>
>>>    <service name="blockingTestScv" engine="java" export="true"
>>> validate="false" require-new-transaction="true" transaction-
>>> timeout="20"
>>>            location="org.ofbiz.common.CommonServices"
>>> invoke="blockingTestService">
>>>        <description>Blocking Test service</description>
>>> @@ -84,10 +90,15 @@
>>>    </service>
>>>
>>>    <service name="testSoap" engine="soap" export="true"
>>> +            location="http://localhost:8080/webtools/control/SOAPService
>>> " invoke="testSOAPScv">
>>> +        <description>SOAP service; calls the OFBiz test SOAP
>>> service</description>
>>> +        <implements service="testSOAPScv"/>
>>> +    </service>
>>> +
>>> +    <service name="testSoapSimple" engine="soap" export="true"
>>>            location="http://localhost:8080/webtools/control/SOAPService
>>> " invoke="testScv">
>>> -        <description>Test SOAP service; calls the OFBiz test
>>> service</description>
>>> -        <attribute name="message" type="String" mode="IN"
>>> optional="true"/>
>>> -        <attribute name="resp" type="String" mode="OUT"/>
>>> +        <description>simple SOAP service; calls the OFBiz test
>>> service</description>
>>> +        <implements service="testScv"/>
>>>    </service>
>>>
>>>    <service name="testRemoteSoap" engine="soap" export="true"
>>>
>>> Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>> CommonServices.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java?rev=892712&r1=892711&r2=892712&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>> CommonServices.java (original)
>>> +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/
>>> CommonServices.java Mon Dec 21 07:31:58 2009
>>> @@ -26,6 +26,7 @@
>>> import javax.mail.internet.MimeMessage;
>>> import javax.transaction.xa.XAException;
>>>
>>> +import javolution.util.FastList;
>>> import javolution.util.FastMap;
>>>
>>> import org.apache.log4j.Level;
>>> @@ -84,6 +85,32 @@
>>>        System.out.println("----- SVC: " + dctx.getName() + "  
>>> -----");
>>>        return response;
>>>    }
>>> +
>>> +    /**
>>> +     * Generic Test SOAP Service
>>> +     *@param dctx The DispatchContext that this service is
>>> operating in
>>> +     *@param context Map containing the input parameters
>>> +     *@return Map with the result of the service, the output
>>> parameters
>>> +     */
>>> +    public static Map<String, Object>
>>> testSOAPService(DispatchContext dctx, Map<String, ?> context) {
>>> +        Delegator delegator = dctx.getDelegator();
>>> +        Map<String, Object> response = ServiceUtil.returnSuccess();
>>> +
>>> +        GenericValue productCategory = (GenericValue)
>>> context.get("productCategory");
>>> +        List<GenericValue> products = FastList.newInstance();
>>> +        for (int i = 0; i < 3; i ++) {
>>> +            GenericValue product = delegator.makeValue("Product");
>>> +            product.put("productId", "PROD_TEST" + i);
>>> +            product.put("productTypeId", "FINISHED_GOOD");
>>> +            product.put("primaryProductCategoryId", "202");
>>> +            product.put("internalName", "Product Test " + i);
>>> +            product.put("productName", "Product Test " + i);
>>> +            product.put("createdStamp",  
>>> UtilDateTime.nowTimestamp());
>>> +            products.add(product);
>>> +        }
>>> +        response.put("products", products);
>>> +        return response;
>>> +    }
>>>
>>>    public static Map<String, Object>
>>> blockingTestService(DispatchContext dctx, Map<String, ?> context) {
>>>        Long duration = (Long) context.get("duration");
>>>
>>> Added: ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar?rev=892712&view=auto
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> Binary file - no diff available.
>>>
>>> Propchange: ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
>>> ------------------------------------------------------------------------------
>>>   svn:mime-type = application/octet-stream
>>>
>>> Added: ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar?rev=892712&view=auto
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> Binary file - no diff available.
>>>
>>> Propchange: ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
>>> ------------------------------------------------------------------------------
>>>   svn:mime-type = application/octet-stream
>>>
>>> Added: ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar?rev=892712&view=auto
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> Binary file - no diff available.
>>>
>>> Propchange: ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
>>> ------------------------------------------------------------------------------
>>>   svn:mime-type = application/octet-stream
>>>
>>> Added: ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar?rev=892712&view=auto
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> Binary file - no diff available.
>>>
>>> Propchange: ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
>>> ------------------------------------------------------------------------------
>>>   svn:mime-type = application/octet-stream
>>>
>>> Added: ofbiz/trunk/framework/service/lib/axis2-transport-
>>> http-1.5.1.jar
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar?rev=892712&view=auto
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> Binary file - no diff available.
>>>
>>> Propchange: ofbiz/trunk/framework/service/lib/axis2-transport-
>>> http-1.5.1.jar
>>> ------------------------------------------------------------------------------
>>>   svn:mime-type = application/octet-stream
>>>
>>> Added: ofbiz/trunk/framework/service/lib/axis2-transport-
>>> local-1.5.1.jar
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar?rev=892712&view=auto
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> Binary file - no diff available.
>>>
>>> Propchange: ofbiz/trunk/framework/service/lib/axis2-transport-
>>> local-1.5.1.jar
>>> ------------------------------------------------------------------------------
>>>   svn:mime-type = application/octet-stream
>>>
>>> Added: ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar?rev=892712&view=auto
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> Binary file - no diff available.
>>>
>>> Propchange: ofbiz/trunk/framework/service/lib/commons-
>>> httpclient-3.1.jar
>>> ------------------------------------------------------------------------------
>>>   svn:mime-type = application/octet-stream
>>>
>>> Added: ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar?rev=892712&view=auto
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> Binary file - no diff available.
>>>
>>> Propchange: ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
>>> ------------------------------------------------------------------------------
>>>   svn:mime-type = application/octet-stream
>>>
>>> Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>> ModelParam.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java?rev=892712&r1=892711&r2=892712&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>> ModelParam.java (original)
>>> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>> ModelParam.java Mon Dec 21 07:31:58 2009
>>> @@ -207,47 +207,56 @@
>>>    public Part getWSDLPart(Definition def) throws WSDLException {
>>>        Part part = def.createPart();
>>>        part.setName(this.name);
>>> -        part.setTypeName(new QName(ModelService.XSD,
>>> this.java2wsdlType()));
>>> +        part.setTypeName(new QName(ModelService.TNS,
>>> this.java2wsdlType()));
>>>        return part;
>>>    }
>>>
>>>    protected String java2wsdlType() throws WSDLException {
>>>        if (ObjectType.instanceOf(java.lang.Character.class,
>>> this.type)) {
>>> -            return "string";
>>> +            return "std-String";
>>>        } else if (ObjectType.instanceOf(java.lang.String.class,
>>> this.type)) {
>>> -            return "string";
>>> +            return "std-String";
>>>        } else if (ObjectType.instanceOf(java.lang.Byte.class,
>>> this.type)) {
>>> -            return "byte";
>>> +            return "std-String";
>>>        } else if (ObjectType.instanceOf(java.lang.Boolean.class,
>>> this.type)) {
>>> -            return "boolean";
>>> +            return "std-Boolean";
>>>        } else if (ObjectType.instanceOf(java.lang.Integer.class,
>>> this.type)) {
>>> -            return "int";
>>> +            return "std-Integer";
>>>        } else if (ObjectType.instanceOf(java.lang.Double.class,
>>> this.type)) {
>>> -            return "double";
>>> +            return "std-Double";
>>>        } else if (ObjectType.instanceOf(java.lang.Float.class,
>>> this.type)) {
>>> -            return "float";
>>> +            return "std-Float";
>>>        } else if (ObjectType.instanceOf(java.lang.Short.class,
>>> this.type)) {
>>> -            return "short";
>>> +            return "std-Integer";
>>>        } else if (ObjectType.instanceOf(java.math.BigDecimal.class,
>>> this.type)) {
>>> -            return "decimal";
>>> +            return "std-Long";
>>>        } else if (ObjectType.instanceOf(java.math.BigInteger.class,
>>> this.type)) {
>>> -            return "integer";
>>> +            return "std-Integer";
>>>        } else if (ObjectType.instanceOf(java.util.Calendar.class,
>>> this.type)) {
>>> -            return "dateTime";
>>> +            return "sql-Timestamp";
>>>        } else if
>>> (ObjectType.instanceOf(com.ibm.icu.util.Calendar.class,  
>>> this.type)) {
>>> -            return "dateTime";
>>> +            return "sql-Timestamp";
>>>        } else if (ObjectType.instanceOf(java.sql.Date.class,
>>> this.type)) {
>>> -            return "date";
>>> +            return "sql-Date";
>>>        } else if (ObjectType.instanceOf(java.util.Date.class,
>>> this.type)) {
>>> -            return "dateTime";
>>> +            return "sql-Timestamp";
>>>        } else if (ObjectType.instanceOf(java.lang.Long.class,
>>> this.type)) {
>>> -            return "unsignedInt";
>>> +            return "std-Long";
>>>        } else if (ObjectType.instanceOf(java.sql.Timestamp.class,
>>> this.type)) {
>>> -            return "string";
>>> +            return "sql-Timestamp";
>>> +        } else if
>>> (ObjectType.instanceOf(org.ofbiz.entity.GenericValue.class,
>>> this.type)) {
>>> +            return "eeval-";
>>> +        } else if
>>> (ObjectType.instanceOf(org.ofbiz.entity.GenericPK.class,  
>>> this.type)) {
>>> +            return "eepk-";
>>> +        } else if (ObjectType.instanceOf(java.util.Map.class,
>>> this.type)) {
>>> +            return "map-Map";
>>> +        } else if (ObjectType.instanceOf(java.util.List.class,
>>> this.type)) {
>>> +            return "col-LinkedList";
>>> +        } else {
>>> +            return "cus-obj";
>>>        }
>>>
>>> -        // TODO add array support (maybe even convert List
>>> objects); add GenericValue/Map support
>>> -        throw new WSDLException(WSDLException.OTHER_ERROR, "Service
>>> cannot be described with WSDL (" + this.name + " / " + this.type +
>>> ")");
>>> +        //throw new WSDLException(WSDLException.OTHER_ERROR,
>>> "Service cannot be described with WSDL (" + this.name + " / " +
>>> this.type + ")");
>>>    }
>>>
>>>    static class ModelParamValidator implements Serializable {
>>>
>>> Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>> ModelService.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java?rev=892712&r1=892711&r2=892712&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>> ModelService.java (original)
>>> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/
>>> ModelService.java Mon Dec 21 07:31:58 2009
>>> @@ -41,9 +41,11 @@
>>> import javax.wsdl.Message;
>>> import javax.wsdl.Operation;
>>> import javax.wsdl.Output;
>>> +import javax.wsdl.Part;
>>> import javax.wsdl.Port;
>>> import javax.wsdl.PortType;
>>> import javax.wsdl.Service;
>>> +import javax.wsdl.Types;
>>> import javax.wsdl.WSDLException;
>>> import javax.wsdl.extensions.soap.SOAPAddress;
>>> import javax.wsdl.extensions.soap.SOAPBinding;
>>> @@ -51,6 +53,8 @@
>>> import javax.wsdl.extensions.soap.SOAPOperation;
>>> import javax.wsdl.factory.WSDLFactory;
>>> import javax.xml.namespace.QName;
>>> +import javax.xml.parsers.DocumentBuilder;
>>> +import javax.xml.parsers.DocumentBuilderFactory;
>>>
>>> import javolution.util.FastList;
>>> import javolution.util.FastMap;
>>> @@ -66,6 +70,7 @@
>>> import org.ofbiz.service.group.GroupServiceModel;
>>> import org.ofbiz.service.group.ServiceGroupReader;
>>> import org.w3c.dom.Document;
>>> +import org.w3c.dom.Element;
>>>
>>> import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
>>> import com.ibm.wsdl.extensions.soap.SOAPBindingImpl;
>>> @@ -1189,6 +1194,18 @@
>>> }
>>>
>>>    public void getWSDL(Definition def, String locationURI) throws
>>> WSDLException {
>>> +
>>> +        DocumentBuilderFactory factory =
>>> DocumentBuilderFactory.newInstance();
>>> +        DocumentBuilder builder = null;
>>> +        Document document = null;
>>> +        try {
>>> +            builder = factory.newDocumentBuilder();
>>> +            document = builder.newDocument();
>>> +        } catch (Exception e) {
>>> +            throw new WSDLException("can not create WSDL", module);
>>> +        }
>>> +        def.setTypes(this.getTypes(document, def));
>>> +
>>>        // set the IN parameters
>>>        Input input = def.createInput();
>>>        Set<String> inParam = this.getInParamNames();
>>> @@ -1196,12 +1213,25 @@
>>>            Message inMessage = def.createMessage();
>>>            inMessage.setQName(new QName(TNS, this.name +  
>>> "Request"));
>>>            inMessage.setUndefined(false);
>>> +            Part parametersPart = def.createPart();
>>> +            parametersPart.setName("map-Map");
>>> +            parametersPart.setTypeName(new QName(TNS, "map-Map"));
>>> +            inMessage.addPart(parametersPart);
>>> +            Element documentation =
>>> document.createElement("wsdl:documentation");
>>>            for (String paramName: inParam) {
>>>                ModelParam param = this.getParam(paramName);
>>>                if (!param.internal) {
>>> -                    inMessage.addPart(param.getWSDLPart(def));
>>> +                    Part part = param.getWSDLPart(def);
>>> +                    Element attribute =
>>> document.createElement("attribute");
>>> +                    attribute.setAttribute("name", paramName);
>>> +                    attribute.setAttribute("type",
>>> part.getTypeName().getLocalPart());
>>> +                    attribute.setAttribute("namespace",
>>> part.getTypeName().getNamespaceURI());
>>> +                    attribute.setAttribute("java-class",  
>>> param.type);
>>> +                    attribute.setAttribute("optional",
>>> Boolean.toString(param.optional));
>>> +                    documentation.appendChild(attribute);
>>>                }
>>>            }
>>> +            parametersPart.setDocumentationElement(documentation);
>>>            def.addMessage(inMessage);
>>>            input.setMessage(inMessage);
>>>        }
>>> @@ -1213,12 +1243,25 @@
>>>            Message outMessage = def.createMessage();
>>>            outMessage.setQName(new QName(TNS, this.name +
>>> "Response"));
>>>            outMessage.setUndefined(false);
>>> +            Part resultsPart = def.createPart();
>>> +            resultsPart.setName("map-Map");
>>> +            resultsPart.setTypeName(new QName(TNS, "map-Map"));
>>> +            outMessage.addPart(resultsPart);
>>> +            Element documentation =
>>> document.createElement("wsdl:documentation");
>>>            for (String paramName: outParam) {
>>>                ModelParam param = this.getParam(paramName);
>>>                if (!param.internal) {
>>> -                    outMessage.addPart(param.getWSDLPart(def));
>>> +                    Part part = param.getWSDLPart(def);
>>> +                    Element attribute =
>>> document.createElement("attribute");
>>> +                    attribute.setAttribute("name", paramName);
>>> +                    attribute.setAttribute("type",
>>> part.getTypeName().getLocalPart());
>>> +                    attribute.setAttribute("namespace",
>>> part.getTypeName().getNamespaceURI());
>>> +                    attribute.setAttribute("java-class",  
>>> param.type);
>>> +                    attribute.setAttribute("optional",
>>> Boolean.toString(param.optional));
>>> +                    documentation.appendChild(attribute);
>>>                }
>>>            }
>>> +            resultsPart.setDocumentationElement(documentation);
>>>            def.addMessage(outMessage);
>>>            output.setMessage(outMessage);
>>>        }
>>> @@ -1291,4 +1334,410 @@
>>>        service.addPort(port);
>>>        def.addService(service);
>>>    }
>>> +
>>> +    public Types getTypes(Document document, Definition def) {
>>> +        Types types = def.createTypes();
>>> +        /* Schema */
>>> +        Element schema = document.createElement("xsd:schema");
>>> +        schema.setAttribute("targetNamespace", TNS);
>>> +
>>> +        /*-----------------------------------*/
>>> +        /*--------- Standard Objects --------*/
>>> +        /*-----------------------------------*/
>>> +
>>> +        /* std-String Element */
>>> +        Element stdStringElement =
>>> document.createElement("xsd:element");
>>> +        stdStringElement.setAttribute("name", "std-String");
>>> +        Element stdStringElement0 =
>>> document.createElement("xsd:complexType");
>>> +        stdStringElement.appendChild(stdStringElement0);
>>> +        Element stdStringElement1 =
>>> document.createElement("xsd:attribute");
>>> +        stdStringElement0.appendChild(stdStringElement1);
>>> +        stdStringElement1.setAttribute("name", "value");
>>> +        stdStringElement1.setAttribute("type", "xsd:string");
>>> +        stdStringElement1.setAttribute("use", "required");
>>> +        schema.appendChild(stdStringElement);
>>> +        /* std-Integer Element */
>>> +        Element stdIntegerElement =
>>> document.createElement("xsd:element");
>>> +        stdIntegerElement.setAttribute("name", "std-Integer");
>>> +        Element stdIntegerElement0 =
>>> document.createElement("xsd:complexType");
>>> +        stdIntegerElement.appendChild(stdIntegerElement0);
>>> +        Element stdIntegerElement1 =
>>> document.createElement("xsd:attribute");
>>> +        stdIntegerElement0.appendChild(stdIntegerElement1);
>>> +        stdIntegerElement1.setAttribute("name", "value");
>>> +        stdIntegerElement1.setAttribute("type", "xsd:integer");
>>> +        stdIntegerElement1.setAttribute("use", "required");
>>> +        schema.appendChild(stdIntegerElement);
>>> +        /* std-Long Element */
>>> +        Element stdLongElement =
>>> document.createElement("xsd:element");
>>> +        stdLongElement.setAttribute("name", "std-Long");
>>> +        Element stdLongElement0 =
>>> document.createElement("xsd:complexType");
>>> +        stdLongElement.appendChild(stdLongElement0);
>>> +        Element stdLongElement1 =
>>> document.createElement("xsd:attribute");
>>> +        stdLongElement0.appendChild(stdLongElement1);
>>> +        stdLongElement1.setAttribute("name", "value");
>>> +        stdLongElement1.setAttribute("type", "xsd:long");
>>> +        stdLongElement1.setAttribute("use", "required");
>>> +        schema.appendChild(stdLongElement);
>>> +        /* std-Float Element */
>>> +        Element stdFloatElement =
>>> document.createElement("xsd:element");
>>> +        stdFloatElement.setAttribute("name", "std-Float");
>>> +        Element stdFloatElement0 =
>>> document.createElement("xsd:complexType");
>>> +        stdFloatElement.appendChild(stdFloatElement0);
>>> +        Element stdFloatElement1 =
>>> document.createElement("xsd:attribute");
>>> +        stdFloatElement0.appendChild(stdFloatElement1);
>>> +        stdFloatElement1.setAttribute("name", "value");
>>> +        stdFloatElement1.setAttribute("type", "xsd:float");
>>> +        stdFloatElement1.setAttribute("use", "required");
>>> +        schema.appendChild(stdFloatElement);
>>> +        /* std-Double Element */
>>> +        Element stdDoubleElement =
>>> document.createElement("xsd:element");
>>> +        stdDoubleElement.setAttribute("name", "std-Double");
>>> +        Element stdDoubleElement0 =
>>> document.createElement("xsd:complexType");
>>> +        stdDoubleElement.appendChild(stdDoubleElement0);
>>> +        Element stdDoubleElement1 =
>>> document.createElement("xsd:attribute");
>>> +        stdDoubleElement0.appendChild(stdDoubleElement1);
>>> +        stdDoubleElement1.setAttribute("name", "value");
>>> +        stdDoubleElement1.setAttribute("type", "xsd:double");
>>> +        stdDoubleElement1.setAttribute("use", "required");
>>> +        schema.appendChild(stdDoubleElement);
>>> +        /* std-Boolean Element */
>>> +        Element stdBooleanElement =
>>> document.createElement("xsd:element");
>>> +        stdBooleanElement.setAttribute("name", "std-Boolean");
>>> +        Element stdBooleanElement0 =
>>> document.createElement("xsd:complexType");
>>> +        stdBooleanElement.appendChild(stdBooleanElement0);
>>> +        Element stdBooleanElement1 =
>>> document.createElement("xsd:attribute");
>>> +        stdBooleanElement0.appendChild(stdBooleanElement1);
>>> +        stdBooleanElement1.setAttribute("name", "value");
>>> +        stdBooleanElement1.setAttribute("type", "xsd:boolean");
>>> +        stdBooleanElement1.setAttribute("use", "required");
>>> +        schema.appendChild(stdBooleanElement);
>>> +        /* std-Locale Element */
>>> +        Element stdLocaleElement =
>>> document.createElement("xsd:element");
>>> +        stdLocaleElement.setAttribute("name", "std-Locale");
>>> +        Element stdLocaleElement0 =
>>> document.createElement("xsd:complexType");
>>> +        stdLocaleElement.appendChild(stdLocaleElement0);
>>> +        Element stdLocaleElement1 =
>>> document.createElement("xsd:attribute");
>>> +        stdLocaleElement0.appendChild(stdLocaleElement1);
>>> +        stdLocaleElement1.setAttribute("name", "value");
>>> +        stdLocaleElement1.setAttribute("type", "xsd:string");
>>> +        stdLocaleElement1.setAttribute("use", "required");
>>> +        schema.appendChild(stdLocaleElement);
>>> +
>>> +        /*-----------------------------------*/
>>> +        /*----------- SQL Objects -----------*/
>>> +        /*-----------------------------------*/
>>> +
>>> +        /* sql-Timestamp Element */
>>> +        Element sqlTimestampElement =
>>> document.createElement("xsd:element");
>>> +        sqlTimestampElement.setAttribute("name", "sql-Timestamp");
>>> +        Element sqlTimestampElement0 =
>>> document.createElement("xsd:complexType");
>>> +        sqlTimestampElement.appendChild(sqlTimestampElement0);
>>> +        Element sqlTimestampElement1 =
>>> document.createElement("xsd:attribute");
>>> +        sqlTimestampElement0.appendChild(sqlTimestampElement1);
>>> +        sqlTimestampElement1.setAttribute("name", "value");
>>> +        sqlTimestampElement1.setAttribute("type", "xsd:dateTime");
>>> +        sqlTimestampElement1.setAttribute("use", "required");
>>> +        schema.appendChild(sqlTimestampElement);
>>> +        /* sql-Date Element */
>>> +        Element sqlDateElement =
>>> document.createElement("xsd:element");
>>> +        sqlDateElement.setAttribute("name", "sql-Date");
>>> +        Element sqlDateElement0 =
>>> document.createElement("xsd:complexType");
>>> +        sqlDateElement.appendChild(sqlDateElement0);
>>> +        Element sqlDateElement1 =
>>> document.createElement("xsd:attribute");
>>> +        sqlDateElement0.appendChild(sqlDateElement1);
>>> +        sqlDateElement1.setAttribute("name", "value");
>>> +        sqlDateElement1.setAttribute("type", "xsd:date");
>>> +        sqlDateElement1.setAttribute("use", "required");
>>> +        schema.appendChild(sqlDateElement);
>>> +        /* sql-Time Element */
>>> +        Element sqlTimeElement =
>>> document.createElement("xsd:element");
>>> +        sqlTimeElement.setAttribute("name", "sql-Time");
>>> +        Element sqlTimeElement0 =
>>> document.createElement("xsd:complexType");
>>> +        sqlTimeElement.appendChild(sqlTimeElement0);
>>> +        Element sqlTimeElement1 =
>>> document.createElement("xsd:attribute");
>>> +        sqlTimeElement0.appendChild(sqlTimeElement1);
>>> +        sqlTimeElement1.setAttribute("name", "value");
>>> +        sqlTimeElement1.setAttribute("type", "xsd:time");
>>> +        sqlTimeElement1.setAttribute("use", "required");
>>> +        schema.appendChild(sqlTimeElement);
>>> +
>>> +        /*-----------------------------------*/
>>> +        /*----------- List Objects -----------*/
>>> +        /*-----------------------------------*/
>>> +
>>> +        /* col-ArrayList Element */
>>> +        Element colArrayListElement =
>>> document.createElement("xsd:element");
>>> +        colArrayListElement.setAttribute("name", "col-ArrayList");
>>> +        schema.appendChild(colArrayListElement);
>>> +        /* col-LinkedList Element */
>>> +        Element colLinkedListElement =
>>> document.createElement("xsd:element");
>>> +        colLinkedListElement.setAttribute("name", "col- 
>>> LinkedList");
>>> +        schema.appendChild(colLinkedListElement);
>>> +        /* col-Stack Element */
>>> +        Element colStackElement =
>>> document.createElement("xsd:element");
>>> +        colStackElement.setAttribute("name", "col-Stack");
>>> +        schema.appendChild(colStackElement);
>>> +        /* col-Vector Element */
>>> +        Element colVectorElement =
>>> document.createElement("xsd:element");
>>> +        colVectorElement.setAttribute("name", "col-Vector");
>>> +        schema.appendChild(colVectorElement);
>>> +        /* col-TreeSet Element */
>>> +        Element colTreeSetElement =
>>> document.createElement("xsd:element");
>>> +        colTreeSetElement.setAttribute("name", "col-TreeSet");
>>> +        schema.appendChild(colTreeSetElement);
>>> +        /* col-HashSet Element */
>>> +        Element colHashSetElement =
>>> document.createElement("xsd:element");
>>> +        colHashSetElement.setAttribute("name", "col-HashSet");
>>> +        schema.appendChild(colHashSetElement);
>>> +        /* col-Collection Element */
>>> +        Element colCollectionElement =
>>> document.createElement("xsd:element");
>>> +        colCollectionElement.setAttribute("name", "col- 
>>> Collection");
>>> +        schema.appendChild(colCollectionElement);
>>> +
>>> +        /*-----------------------------------*/
>>> +        /*----------- Map Objects -----------*/
>>> +        /*-----------------------------------*/
>>> +
>>> +        /* map-TreeMap Element */
>>> +        Element mapTreeMapElement =
>>> document.createElement("xsd:element");
>>> +        mapTreeMapElement.setAttribute("name", "map-TreeMap");
>>> +        mapTreeMapElement.setAttribute("type", "tns:map-Map");
>>> +        schema.appendChild(mapTreeMapElement);
>>> +        /* map-WeakHashMap Element */
>>> +        Element mapWeakHashMapElement =
>>> document.createElement("xsd:element");
>>> +        mapWeakHashMapElement.setAttribute("name", "map-
>>> WeakHashMap");
>>> +        mapWeakHashMapElement.setAttribute("type", "tns:map-Map");
>>> +        schema.appendChild(mapWeakHashMapElement);
>>> +        /* map-Hashtable Element */
>>> +        Element mapHashtableElement =
>>> document.createElement("xsd:element");
>>> +        mapHashtableElement.setAttribute("name", "map-Hashtable");
>>> +        mapHashtableElement.setAttribute("type", "tns:map-Map");
>>> +        schema.appendChild(mapHashtableElement);
>>> +        /* map-Properties Element */
>>> +        Element mapPropertiesElement =
>>> document.createElement("xsd:element");
>>> +        mapPropertiesElement.setAttribute("name", "map- 
>>> Properties");
>>> +        mapPropertiesElement.setAttribute("type", "tns:map-Map");
>>> +        schema.appendChild(mapPropertiesElement);
>>> +        /* map-HashMap Element */
>>> +        Element mapHashMapElement =
>>> document.createElement("xsd:element");
>>> +        mapHashMapElement.setAttribute("name", "map-HashMap");
>>> +        mapHashMapElement.setAttribute("type", "tns:map-Map");
>>> +        schema.appendChild(mapHashMapElement);
>>> +        /* map-Map Element */
>>> +        Element mapMapElement =
>>> document.createElement("xsd:element");
>>> +        mapMapElement.setAttribute("name", "map-Map");
>>> +        mapMapElement.setAttribute("type", "tns:map-Map");
>>> +        schema.appendChild(mapMapElement);
>>> +        /* map-Entry Element */
>>> +        Element mapEntryElement =
>>> document.createElement("xsd:element");
>>> +        mapEntryElement.setAttribute("name", "map-Entry");
>>> +        mapEntryElement.setAttribute("type", "tns:map-Entry");
>>> +        schema.appendChild(mapEntryElement);
>>> +        /* map-Key Element */
>>> +        Element mapKeyElement =
>>> document.createElement("xsd:element");
>>> +        mapKeyElement.setAttribute("name", "map-Key");
>>> +        mapKeyElement.setAttribute("type", "tns:map-Key");
>>> +        schema.appendChild(mapKeyElement);
>>> +        /* map-Value Element */
>>> +        Element mapValueElement =
>>> document.createElement("xsd:element");
>>> +        mapValueElement.setAttribute("name", "map-Value");
>>> +        mapValueElement.setAttribute("type", "tns:map-Value");
>>> +        schema.appendChild(mapValueElement);
>>> +        /* eepk- Element */
>>> +        Element eepkElement =  
>>> document.createElement("xsd:element");
>>> +        eepkElement.setAttribute("name", "eepk-");
>>> +        eepkElement.setAttribute("type", "tns:map-Value");
>>> +        schema.appendChild(eepkElement);
>>> +        /* eeval- Element */
>>> +        Element eevalElement =  
>>> document.createElement("xsd:element");
>>> +        eevalElement.setAttribute("name", "eeval-");
>>> +        eevalElement.setAttribute("type", "tns:map-Value");
>>> +        schema.appendChild(eevalElement);
>>> +
>>> +        /*-----------------------------------*/
>>> +        /*----------- Custom Objects -----------*/
>>> +        /*-----------------------------------*/
>>> +
>>> +        /* cus-obj Element */
>>> +        Element cusObjElement =
>>> document.createElement("xsd:element");
>>> +        cusObjElement.setAttribute("name", "cus-obj");
>>> +        schema.appendChild(cusObjElement);
>>> +
>>> +        /*-----------------------------------*/
>>> +        /*---------- Complex Types ----------*/
>>> +        /*-----------------------------------*/
>>> +
>>> +        /* map-Map Complex Type */
>>> +        Element mapMapComplexType =
>>> document.createElement("xsd:complexType");
>>> +        mapMapComplexType.setAttribute("name", "map-Map");
>>> +        Element mapMapComplexType0 =
>>> document.createElement("xsd:sequence");
>>> +        mapMapComplexType.appendChild(mapMapComplexType0);
>>> +        Element mapMapComplexType1 =
>>> document.createElement("xsd:element");
>>> +        mapMapComplexType1.setAttribute("ref", "tns:map-Entry");
>>> +        mapMapComplexType1.setAttribute("minOccurs", "0");
>>> +        mapMapComplexType1.setAttribute("maxOccurs", "unbounded");
>>> +        mapMapComplexType0.appendChild(mapMapComplexType1);
>>> +        schema.appendChild(mapMapComplexType);
>>> +        /* map-Entry Complex Type */
>>> +        Element mapEntryComplexType =
>>> document.createElement("xsd:complexType");
>>> +        mapEntryComplexType.setAttribute("name", "map-Entry");
>>> +        Element mapEntryComplexType0 =
>>> document.createElement("xsd:sequence");
>>> +        mapEntryComplexType.appendChild(mapEntryComplexType0);
>>> +        Element mapEntryComplexType1 =
>>> document.createElement("xsd:element");
>>> +        mapEntryComplexType1.setAttribute("ref", "tns:map-Key");
>>> +        mapEntryComplexType1.setAttribute("minOccurs", "1");
>>> +        mapEntryComplexType1.setAttribute("maxOccurs", "1");
>>> +        mapEntryComplexType0.appendChild(mapEntryComplexType1);
>>> +        Element mapEntryComplexType2 =
>>> document.createElement("xsd:element");
>>> +        mapEntryComplexType2.setAttribute("ref", "tns:map-Value");
>>> +        mapEntryComplexType2.setAttribute("minOccurs", "1");
>>> +        mapEntryComplexType2.setAttribute("maxOccurs", "1");
>>> +        mapEntryComplexType0.appendChild(mapEntryComplexType2);
>>> +        schema.appendChild(mapEntryComplexType);
>>> +        /* map-Key Complex Type */
>>> +        Element mapKeyComplexType =
>>> document.createElement("xsd:complexType");
>>> +        mapKeyComplexType.setAttribute("name", "map-Key");
>>> +        Element mapKeyComplexType0 =
>>> document.createElement("xsd:all");
>>> +        mapKeyComplexType.appendChild(mapKeyComplexType0);
>>> +        Element mapKeyComplexType1 =
>>> document.createElement("xsd:element");
>>> +        mapKeyComplexType1.setAttribute("ref", "tns:std-String");
>>> +        mapKeyComplexType1.setAttribute("minOccurs", "1");
>>> +        mapKeyComplexType1.setAttribute("maxOccurs", "1");
>>> +        mapKeyComplexType0.appendChild(mapKeyComplexType1);
>>> +        schema.appendChild(mapKeyComplexType);
>>> +        /* map-Value Complex Type */
>>> +        Element mapValueComplexType =
>>> document.createElement("xsd:complexType");
>>> +        mapValueComplexType.setAttribute("name", "map-Value");
>>> +        Element mapValueComplexType0 =
>>> document.createElement("xsd:choice");
>>> +        mapValueComplexType.appendChild(mapValueComplexType0);
>>> +        Element mapValueComplexType1 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType1.setAttribute("ref", "tns:std-String");
>>> +        mapValueComplexType1.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType1.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType1);
>>> +        Element mapValueComplexType2 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType2.setAttribute("ref", "tns:std- 
>>> Integer");
>>> +        mapValueComplexType2.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType2.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType2);
>>> +        Element mapValueComplexType3 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType3.setAttribute("ref", "tns:std-Long");
>>> +        mapValueComplexType3.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType3.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType3);
>>> +        Element mapValueComplexType4 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType4.setAttribute("ref", "tns:std-Float");
>>> +        mapValueComplexType4.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType4.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType4);
>>> +        Element mapValueComplexType5 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType5.setAttribute("ref", "tns:std-Double");
>>> +        mapValueComplexType5.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType5.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType5);
>>> +        Element mapValueComplexType6 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType6.setAttribute("ref", "tns:std- 
>>> Boolean");
>>> +        mapValueComplexType6.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType6.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType6);
>>> +        Element mapValueComplexType7 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType7.setAttribute("ref", "tns:std-Locale");
>>> +        mapValueComplexType7.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType7.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType7);
>>> +        Element mapValueComplexType8 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType8.setAttribute("ref", "tns:sql-
>>> Timestamp");
>>> +        mapValueComplexType8.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType8.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType8);
>>> +        Element mapValueComplexType9 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType9.setAttribute("ref", "tns:sql-Date");
>>> +        mapValueComplexType9.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType9.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType9);
>>> +        Element mapValueComplexType10 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType10.setAttribute("ref", "tns:sql-Time");
>>> +        mapValueComplexType10.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType10.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType10);
>>> +        Element mapValueComplexType11 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType11.setAttribute("ref", "tns:col-
>>> ArrayList");
>>> +        mapValueComplexType11.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType11.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType11);
>>> +        Element mapValueComplexType12 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType12.setAttribute("ref", "tns:col-
>>> LinkedList");
>>> +        mapValueComplexType12.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType12.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType12);
>>> +        Element mapValueComplexType13 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType13.setAttribute("ref", "tns:col-Stack");
>>> +        mapValueComplexType13.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType13.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType13);
>>> +        Element mapValueComplexType14 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType14.setAttribute("ref", "tns:col- 
>>> Vector");
>>> +        mapValueComplexType14.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType14.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType14);
>>> +        Element mapValueComplexType15 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType15.setAttribute("ref", "tns:col- 
>>> TreeSet");
>>> +        mapValueComplexType15.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType15.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType15);
>>> +        Element mapValueComplexType16 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType16.setAttribute("ref", "tns:col- 
>>> HashSet");
>>> +        mapValueComplexType16.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType16.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType16);
>>> +        Element mapValueComplexType17 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType17.setAttribute("ref", "tns:col-
>>> Collection");
>>> +        mapValueComplexType17.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType17.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType17);
>>> +        Element mapValueComplexType18 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType18.setAttribute("ref", "tns:map- 
>>> HashMap");
>>> +        mapValueComplexType18.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType18.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType18);
>>> +        Element mapValueComplexType19 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType19.setAttribute("ref", "tns:map-
>>> Properties");
>>> +        mapValueComplexType19.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType19.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType19);
>>> +        Element mapValueComplexType20 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType20.setAttribute("ref", "tns:map-
>>> Hashtable");
>>> +        mapValueComplexType20.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType20.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType20);
>>> +        Element mapValueComplexType21 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType21.setAttribute("ref", "tns:map-
>>> WeakHashMap");
>>> +        mapValueComplexType21.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType21.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType21);
>>> +        Element mapValueComplexType22 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType22.setAttribute("ref", "tns:map- 
>>> TreeMap");
>>> +        mapValueComplexType22.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType22.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType22);
>>> +        Element mapValueComplexType23 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType23.setAttribute("ref", "tns:map-Map");
>>> +        mapValueComplexType23.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType23.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType23);
>>> +        Element mapValueComplexType24 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType24.setAttribute("ref", "tns:eepk-");
>>> +        mapValueComplexType24.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType24.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType24);
>>> +        Element mapValueComplexType25 =
>>> document.createElement("xsd:element");
>>> +        mapValueComplexType25.setAttribute("ref", "tns:eeval-");
>>> +        mapValueComplexType25.setAttribute("minOccurs", "1");
>>> +        mapValueComplexType25.setAttribute("maxOccurs", "1");
>>> +        mapValueComplexType0.appendChild(mapValueComplexType25);
>>> +        schema.appendChild(mapValueComplexType);
>>> +
>>> +        types.setDocumentationElement(schema);
>>> +        return types;
>>> +    }
>>> }
>>>
>>> Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
>>> engine/
>>> SOAPClientEngine.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java?rev=892712&r1=892711&r2=892712&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/
>>> SOAPClientEngine.java (original)
>>> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/
>>> SOAPClientEngine.java Mon Dec 21 07:31:58 2009
>>> @@ -18,32 +18,32 @@
>>>
>>> *******************************************************************************/
>>> package org.ofbiz.service.engine;
>>>
>>> -import java.net.MalformedURLException;
>>> -import java.net.URL;
>>> -import java.util.ArrayList;
>>> -import java.util.Iterator;
>>> +import java.io.StringReader;
>>> import java.util.List;
>>> import java.util.Map;
>>>
>>> import javax.xml.namespace.QName;
>>> -import javax.xml.rpc.ParameterMode;
>>> -import javax.xml.rpc.ServiceException;
>>> +import javax.xml.stream.XMLInputFactory;
>>> +import javax.xml.stream.XMLStreamReader;
>>>
>>> import javolution.util.FastMap;
>>>
>>> -import org.apache.axis.Message;
>>> -import org.apache.axis.client.Call;
>>> -import org.apache.axis.client.Service;
>>> -import org.apache.axis.encoding.XMLType;
>>> -import org.apache.axis.message.RPCElement;
>>> -import org.apache.axis.message.RPCParam;
>>> -import org.apache.axis.message.SOAPEnvelope;
>>> +import org.apache.axiom.om.OMAbstractFactory;
>>> +import org.apache.axiom.om.OMElement;
>>> +import org.apache.axiom.om.OMFactory;
>>> +import org.apache.axiom.om.impl.builder.StAXOMBuilder;
>>> +import org.apache.axis2.AxisFault;
>>> +import org.apache.axis2.addressing.EndpointReference;
>>> +import org.apache.axis2.client.Options;
>>> +import org.apache.axis2.client.ServiceClient;
>>> +import org.ofbiz.base.util.Debug;
>>> +import org.ofbiz.base.util.UtilValidate;
>>> +import org.ofbiz.entity.Delegator;
>>> +import org.ofbiz.entity.serialize.XmlSerializer;
>>> import org.ofbiz.service.GenericServiceException;
>>> import org.ofbiz.service.ModelParam;
>>> import org.ofbiz.service.ModelService;
>>> import org.ofbiz.service.ServiceDispatcher;
>>> -import org.ofbiz.base.util.Debug;
>>> -import org.ofbiz.base.util.UtilValidate;
>>>
>>> /**
>>> * Generic Service SOAP Interface
>>> @@ -78,113 +78,67 @@
>>>
>>>    // Invoke the remote SOAP service
>>>    private Map<String, Object> serviceInvoker(ModelService
>>> modelService, Map<String, Object> context) throws
>>> GenericServiceException {
>>> +        Delegator delegator = dispatcher.getDelegator();
>>>        if (modelService.location == null || modelService.invoke ==
>>> null)
>>>            throw new GenericServiceException("Cannot locate service
>>> to invoke");
>>> -
>>> -        Service service = null;
>>> -        Call call = null;
>>> -
>>> +
>>> +        ServiceClient client = null;
>>> +        QName serviceName = null;
>>> +
>>>        try {
>>> -            service = new Service();
>>> -            call = (Call) service.createCall();
>>> -        } catch (javax.xml.rpc.JAXRPCException e) {
>>> -            throw new GenericServiceException("RPC service error",
>>> e);
>>> -        } catch (ServiceException e) {//Add by Andy.Chen 2003.01.15
>>> +            client = new ServiceClient();
>>> +            Options options = new Options();
>>> +            EndpointReference endPoint = new
>>> EndpointReference(this.getLocation(modelService));
>>> +            options.setTo(endPoint);
>>> +            client.setOptions(options);
>>> +        } catch (AxisFault e) {
>>>            throw new GenericServiceException("RPC service error",  
>>> e);
>>>        }
>>> -
>>> -        URL endPoint = null;
>>> -
>>> -        try {
>>> -            endPoint = new URL(this.getLocation(modelService));
>>> -        } catch (MalformedURLException e) {
>>> -            throw new GenericServiceException("Location not a valid
>>> URL", e);
>>> -        }
>>> -
>>> +
>>>        List<ModelParam> inModelParamList =
>>> modelService.getInModelParamList();
>>> -
>>> +
>>>        if (Debug.infoOn())
>>> Debug.logInfo("[SOAPClientEngine.invoke] : Parameter length - " +
>>> inModelParamList.size(), module);
>>> -
>>> -        call.setTargetEndpointAddress(endPoint);
>>> -
>>> +
>>>        if (UtilValidate.isNotEmpty(modelService.nameSpace)) {
>>> -            call.setOperationName(new QName(modelService.nameSpace,
>>> modelService.invoke));
>>> +            serviceName = new QName(modelService.nameSpace,
>>> modelService.invoke);
>>>        } else {
>>> -            call.setOperationName(modelService.invoke);
>>> +            serviceName = new QName(modelService.invoke);
>>>        }
>>> -
>>> +
>>>        int i = 0;
>>> -
>>> -        call.setOperation(call.getOperationName().getLocalPart());
>>> -        List<Object> vParams = new ArrayList<Object>();
>>> +
>>> +        Map<String, Object> parameterMap = FastMap.newInstance();
>>>        for (ModelParam p: inModelParamList) {
>>>            if (Debug.infoOn())
>>> Debug.logInfo("[SOAPClientEngine.invoke} : Parameter: " + p.name +
>>> " (" + p.mode + ") - " + i, module);
>>>
>>>            // exclude params that ModelServiceReader insert into
>>> (internal params)
>>>            if (!p.internal) {
>>> -                QName qName =
>>> call
>>> .getParameterTypeByName
>>> (p.name); //.getTypeMapping().getTypeQName((Class)
>>> ObjectType.classNameClassMap.get(p.type));
>>> -                call.addParameter(p.name, qName, getMode(p.mode));
>>> -                vParams.add(context.get(p.name));
>>> +                parameterMap.put(p.name, context.get(p.name));
>>>            }
>>>            i++;
>>>        }
>>>
>>> -        call.setReturnType(XMLType.XSD_ANYTYPE);
>>> -        Object[] params=vParams.toArray(new  
>>> Object[vParams.size()]);
>>> -
>>> -        Object result = null;
>>> -
>>> +        OMElement parameterSer = null;
>>> +
>>>        try {
>>> -            Debug.logInfo("[SOAPClientEngine.invoke] : Sending Call
>>> To SOAP Server", module);
>>> -            result = call.invoke(params);
>>> -        } catch (java.rmi.RemoteException e) {
>>> -            throw new GenericServiceException("RPC error", e);
>>> -        }
>>> -        if (Debug.verboseOn()) {
>>> -            Debug.log("SOAP Service Result - " + result, module);
>>> +            String xmlParameters =
>>> XmlSerializer.serialize(parameterMap);
>>> +            XMLStreamReader reader =
>>> XMLInputFactory.newInstance().createXMLStreamReader(new
>>> StringReader(xmlParameters));
>>> +            StAXOMBuilder builder = new StAXOMBuilder(reader);
>>> +            parameterSer = builder.getDocumentElement();
>>> +        } catch (Exception e) {
>>> +            Debug.logError(e, module);
>>>        }
>>> -
>>> -        return
>>> getResponseParams(call.getMessageContext().getResponseMessage());
>>> -    }
>>> -
>>> -    private Map<String, Object> getResponseParams(Message
>>> respMessage) {
>>> -        Map<String, Object> mRet = FastMap.newInstance();
>>> +
>>> +        Map<String, Object> results = null;
>>>        try {
>>> -            SOAPEnvelope resEnv = respMessage.getSOAPEnvelope();
>>> -            Iterator<?> i = resEnv.getBodyElements().iterator();
>>> -            while (i.hasNext()) {
>>> -                Object o = i.next();
>>> -
>>> -                if (o instanceof RPCElement) {
>>> -                    RPCElement body = (RPCElement) o;
>>> -
>>> -                    Iterator<?> p = body.getParams().iterator();
>>> -                    while (p.hasNext()) {
>>> -                        RPCParam param = (RPCParam) p.next();
>>> -                        mRet.put(param.getName(),  
>>> param.getValue());
>>> -                        if (Debug.verboseOn()) {
>>> -                            Debug.log("SOAP Client Param - " +
>>> param.getName() + "=" + param.getValue(), module);
>>> -                        }
>>> -                    }
>>> -                }
>>> -            }
>>> -        } catch (org.apache.axis.AxisFault e) {
>>> -            Debug.logError(e, "AxisFault", module);
>>> -        } catch (org.xml.sax.SAXException e) {
>>> -            Debug.logError(e, "SAXException", module);
>>> -        }
>>> -        return mRet;
>>> -    }
>>> -
>>> -    private ParameterMode getMode(String sMode) {
>>> -        if (sMode.equals("IN")) {
>>> -            return ParameterMode.IN;
>>> -        } else if (sMode.equals("OUT")) {
>>> -            return ParameterMode.OUT;
>>> -        } else if (sMode.equals("INOUT")) {
>>> -            return ParameterMode.INOUT;
>>> -        } else {
>>> -            return null;
>>> +            OMFactory factory = OMAbstractFactory.getOMFactory();
>>> +            OMElement payload =  
>>> factory.createOMElement(serviceName);
>>> +            payload.addChild(parameterSer.getFirstElement());
>>> +            OMElement respOMElement = client.sendReceive(payload);
>>> +            results = (Map<String, Object>)
>>> XmlSerializer.deserialize(respOMElement.toString(), delegator);
>>> +        } catch (Exception e) {
>>> +            Debug.logError(e, module);
>>>        }
>>> +        return results;
>>>    }
>>> }
>>>
>>> Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/
>>> ServiceSOAPTests.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java?rev=892712&view=auto
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/test/
>>> ServiceSOAPTests.java (added)
>>> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/test/
>>> ServiceSOAPTests.java Mon Dec 21 07:31:58 2009
>>> @@ -0,0 +1,43 @@
>>> +package org.ofbiz.service.test;
>>> +
>>> +import java.util.List;
>>> +import java.util.Map;
>>> +
>>> +import javolution.util.FastMap;
>>> +
>>> +import org.ofbiz.base.util.Debug;
>>> +import org.ofbiz.base.util.UtilDateTime;
>>> +import org.ofbiz.base.util.UtilMisc;
>>> +import org.ofbiz.entity.GenericValue;
>>> +import org.ofbiz.service.testtools.OFBizTestCase;
>>> +
>>> +public class ServiceSOAPTests extends OFBizTestCase {
>>> +
>>> +    public final static String module =
>>> ServiceSOAPTests.class.getName();
>>> +
>>> +    public ServiceSOAPTests(String name) {
>>> +        // TODO Auto-generated constructor stub
>>> +        super(name);
>>> +    }
>>> +
>>> +    public void testSOAPSimpleService() throws Exception {
>>> +        Map<String, Object> serviceContext = FastMap.newInstance();
>>> +        serviceContext.put("defaultValue", new Double("123.4567"));
>>> +        serviceContext.put("message", "Test Message !!!");
>>> +        Map<String, Object> results =
>>> dispatcher.runSync("testSoapSimple", serviceContext);
>>> +        String resp = (String) results.get("resp");
>>> +    }
>>> +
>>> +    public void testSOAPService() throws Exception {
>>> +        Map<String, Object> serviceContext = FastMap.newInstance();
>>> +        GenericValue productCategory =
>>> delegator.makeValue("ProductCategory");
>>> +        productCategory.put("productCategoryId", "PRODCAT_TEST");
>>> +        productCategory.put("productCategoryTypeId",
>>> "CATALOG_CATEGORY");
>>> +        productCategory.put("categoryName", "Test  
>>> ProductCategory");
>>> +        productCategory.put("createdStamp",
>>> UtilDateTime.nowTimestamp());
>>> +        serviceContext.put("productCategory", productCategory);
>>> +        Map<String, Object> results =
>>> dispatcher.runSync("testSoap", serviceContext);
>>> +        List<GenericValue> products = (List<GenericValue>)
>>> results.get("products");
>>> +        assertNotNull(products);
>>> +    }
>>> +}
>>>
>>> Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
>>> test/
>>> ServiceSOAPTests.java
>>> ------------------------------------------------------------------------------
>>>   svn:eol-style = native
>>>
>>> Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
>>> test/
>>> ServiceSOAPTests.java
>>> ------------------------------------------------------------------------------
>>>   svn:keywords = "Date Rev Author URL Id"
>>>
>>> Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
>>> test/
>>> ServiceSOAPTests.java
>>> ------------------------------------------------------------------------------
>>>   svn:mime-type = text/plain
>>>
>>> Modified: ofbiz/trunk/framework/service/testdef/servicetests.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/testdef/servicetests.xml?rev=892712&r1=892711&r2=892712&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/framework/service/testdef/servicetests.xml  
>>> (original)
>>> +++ ofbiz/trunk/framework/service/testdef/servicetests.xml Mon Dec
>>> 21 07:31:58 2009
>>> @@ -22,6 +22,7 @@
>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd
>>> ">
>>>    <test-case case-name="service-tests"><junit-test-suite class-
>>> name="org.ofbiz.service.test.ServiceEngineTests"/></test-case>
>>> +    <test-case case-name="service-soap-tests"><junit-test-suite
>>> class-name="org.ofbiz.service.test.ServiceSOAPTests"/></test-case>
>>>
>>>    <test-case case-name="load-service-test-data">
>>>        <entity-xml action="load" entity-xml-url="component://
>>> service/testdef/data/ServiceTestData.xml"/>
>>>
>>> Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/
>>> SOAPEventHandler.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java?rev=892712&r1=892711&r2=892712&view=diff
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/
>>> SOAPEventHandler.java (original)
>>> +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/
>>> SOAPEventHandler.java Mon Dec 21 07:31:58 2009
>>> @@ -18,33 +18,35 @@
>>>
>>> *******************************************************************************/
>>> package org.ofbiz.webapp.event;
>>>
>>> -import java.io.ByteArrayOutputStream;
>>> import java.io.IOException;
>>> import java.io.OutputStream;
>>> +import java.io.StringReader;
>>> import java.io.Writer;
>>> -import java.util.List;
>>> +import java.util.Iterator;
>>> import java.util.Map;
>>>
>>> import javax.servlet.ServletContext;
>>> import javax.servlet.http.HttpServletRequest;
>>> import javax.servlet.http.HttpServletResponse;
>>> import javax.wsdl.WSDLException;
>>> -import javax.xml.soap.SOAPException;
>>> +import javax.xml.namespace.QName;
>>> +import javax.xml.stream.XMLInputFactory;
>>> +import javax.xml.stream.XMLStreamReader;
>>>
>>> import javolution.util.FastMap;
>>>
>>> -import org.apache.axis.AxisFault;
>>> -import org.apache.axis.Constants;
>>> -import org.apache.axis.Message;
>>> -import org.apache.axis.MessageContext;
>>> -import org.apache.axis.message.RPCElement;
>>> -import org.apache.axis.message.RPCParam;
>>> -import org.apache.axis.message.SOAPEnvelope;
>>> -import org.apache.axis.server.AxisServer;
>>> +import org.apache.axiom.om.OMAbstractFactory;
>>> +import org.apache.axiom.om.OMElement;
>>> +import org.apache.axiom.om.impl.builder.StAXOMBuilder;
>>> +import org.apache.axiom.om.util.StAXUtils;
>>> +import org.apache.axiom.soap.SOAPBody;
>>> +import org.apache.axiom.soap.SOAPEnvelope;
>>> +import org.apache.axiom.soap.SOAPFactory;
>>> +import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
>>> import org.ofbiz.base.util.Debug;
>>> -import org.ofbiz.base.util.UtilGenerics;
>>> -import org.ofbiz.base.util.UtilMisc;
>>> import org.ofbiz.base.util.UtilXml;
>>> +import org.ofbiz.entity.GenericDelegator;
>>> +import org.ofbiz.entity.serialize.XmlSerializer;
>>> import org.ofbiz.service.DispatchContext;
>>> import org.ofbiz.service.GenericServiceException;
>>> import org.ofbiz.service.LocalDispatcher;
>>> @@ -72,7 +74,7 @@
>>>     */
>>>    public String invoke(Event event, RequestMap requestMap,
>>> HttpServletRequest request, HttpServletResponse response) throws
>>> EventHandlerException {
>>>        LocalDispatcher dispatcher = (LocalDispatcher)
>>> request.getAttribute("dispatcher");
>>> -        AxisServer axisServer;
>>> +        GenericDelegator delegator = (GenericDelegator)
>>> request.getAttribute("delegator");
>>>
>>>        // first check for WSDL request
>>>        String wsdlReq = request.getParameter("wsdl");
>>> @@ -138,163 +140,119 @@
>>>        }
>>>
>>>        // not a wsdl request; invoke the service
>>> -        try {
>>> -            axisServer =
>>> AxisServer.getServer(UtilMisc.toMap("name", "OFBiz/Axis Server",
>>> "provider", null));
>>> -        } catch (AxisFault e) {
>>> -            sendError(response, e);
>>> -            throw new EventHandlerException("Problems with the AXIS
>>> server", e);
>>> -        }
>>> -        MessageContext mctx = new MessageContext(axisServer);
>>> -        mctx.setEncodingStyle(Constants.URI_LITERAL_ENC); // sets
>>> the response encoding
>>> -
>>> -        // get the SOAP message
>>> -        Message msg = null;
>>> -
>>> -        try {
>>> -            msg = new Message(request.getInputStream(), false,
>>> -                        request.getHeader("Content-Type"),
>>> request.getHeader("Content-Location"));
>>> -        } catch (IOException ioe) {
>>> -            sendError(response, "Problem processing the service");
>>> -            throw new EventHandlerException("Cannot read the input
>>> stream", ioe);
>>> -        }
>>> -
>>> -        if (msg == null) {
>>> -            sendError(response, "No message");
>>> -            throw new EventHandlerException("SOAP Message is  
>>> null");
>>> -        }
>>> -
>>> -        // log the request message
>>> -        if (Debug.verboseOn()) {
>>> -            try {
>>> -                Debug.logInfo("Request Message:\n" +
>>> messageToString(msg) + "\n", module);
>>> -            } catch (Throwable t) {
>>> -            }
>>> -        }
>>> -
>>> -        mctx.setRequestMessage(msg);
>>> -
>>> -        // new envelopes
>>> -        SOAPEnvelope resEnv = new SOAPEnvelope();
>>> +
>>> +        // request envelope
>>>        SOAPEnvelope reqEnv = null;
>>> -
>>> +
>>>        // get the service name and parameters
>>>        try {
>>> -            reqEnv = (SOAPEnvelope)  
>>> msg.getSOAPPart().getEnvelope();
>>> -        } catch (SOAPException e) {
>>> +            XMLStreamReader xmlReader =
>>> StAXUtils.createXMLStreamReader(request.getInputStream());
>>> +            StAXSOAPModelBuilder builder = new
>>> StAXSOAPModelBuilder(xmlReader);
>>> +            reqEnv = (SOAPEnvelope) builder.getDocumentElement();
>>> +
>>> +            // log the request message
>>> +            if (Debug.verboseOn()) {
>>> +                try {
>>> +                    Debug.logInfo("Request Message:\n" + reqEnv +
>>> "\n", module);
>>> +                } catch (Throwable t) {
>>> +                }
>>> +            }
>>> +        } catch (Exception e) {
>>>            sendError(response, "Problem processing the service");
>>>            throw new EventHandlerException("Cannot get the
>>> envelope", e);
>>>        }
>>> -
>>> -        List<Object> bodies = null;
>>> -
>>> -        try {
>>> -            bodies =
>>> UtilGenerics.checkList(reqEnv.getBodyElements());
>>> -        } catch (AxisFault e) {
>>> -            sendError(response, e);
>>> -            throw new EventHandlerException(e.getMessage(), e);
>>> -        }
>>> -
>>> +
>>>        Debug.logVerbose("[Processing]: SOAP Event", module);
>>> +
>>> +        try {
>>> +            // each is a different service call
>>> +            SOAPBody reqBody = reqEnv.getBody();
>>> +            Iterator serviceIter = reqBody.getChildElements();
>>> +            while (serviceIter.hasNext()) {
>>> +                Object serviceObj = serviceIter.next();
>>> +                if (serviceObj instanceof OMElement) {
>>> +                    OMElement serviceElement = (OMElement)
>>> serviceObj;
>>> +                    String serviceName =
>>> serviceElement.getLocalName();
>>> +                    Map<String, Object> parameters = (Map<String,
>>> Object>) XmlSerializer.deserialize(serviceElement.toString(),
>>> delegator);
>>> +                    try {
>>> +                        // verify the service is exported for
>>> remote execution and invoke it
>>> +                        ModelService model =
>>> dispatcher.getDispatchContext().getModelService(serviceName);
>>>
>>> -        // each is a different service call
>>> -        for (Object o: bodies) {
>>> -
>>> -            if (o instanceof RPCElement) {
>>> -                RPCElement body = (RPCElement) o;
>>> -                String serviceName = body.getMethodName();
>>> -                List<RPCParam> params = null;
>>> -                try {
>>> -                    params =
>>> UtilGenerics.checkList(body.getParams());
>>> -                } catch (Exception e) {
>>> -                    sendError(response, e);
>>> -                    throw new EventHandlerException(e.getMessage(),
>>> e);
>>> -                }
>>> -                Map<String, Object> serviceContext =
>>> FastMap.newInstance();
>>> -                for (RPCParam param: params) {
>>> -                    if (Debug.verboseOn())
>>> Debug.logVerbose("[Reading Param]: " + param.getName(), module);
>>> -                    serviceContext.put(param.getName(),
>>> param.getObjectValue());
>>> -                }
>>> -                try {
>>> -                    // verify the service is exported for remote
>>> execution and invoke it
>>> -                    ModelService model =
>>> dispatcher.getDispatchContext().getModelService(serviceName);
>>> -
>>> -                    if (model != null && model.export) {
>>> -                        Map<String, Object> result =
>>> dispatcher.runSync(serviceName, serviceContext);
>>> -
>>> -                        Debug.logVerbose("[EventHandler] : Service
>>> invoked", module);
>>> -                        RPCElement resBody = new
>>> RPCElement(serviceName + "Response");
>>> -
>>> -                        resBody.setPrefix(body.getPrefix());
>>> -
>>> resBody.setNamespaceURI(body.getNamespaceURI());
>>> -
>>> -                        for (Map.Entry<String, Object> entry:
>>> result.entrySet()) {
>>> -                            RPCParam par = new
>>> RPCParam(entry.getKey(), entry.getValue());
>>> +                        if (model != null && model.export) {
>>> +                            Map<String, Object> results =
>>> dispatcher.runSync(serviceName, parameters);
>>> +                            Debug.logVerbose("[EventHandler] :
>>> Service invoked", module);
>>> +
>>> +                            // setup the response
>>> +                            Debug.logVerbose("[EventHandler] :
>>> Setting up response message", module);
>>> +                            String xmlResults =
>>> XmlSerializer.serialize(results);
>>> +                            XMLStreamReader reader =
>>> XMLInputFactory.newInstance().createXMLStreamReader(new
>>> StringReader(xmlResults));
>>> +                            StAXOMBuilder resultsBuilder = new
>>> StAXOMBuilder(reader);
>>> +                            OMElement resultSer =
>>> resultsBuilder.getDocumentElement();
>>> +
>>> +                            // create the response soap
>>> +                            SOAPFactory factory =
>>> OMAbstractFactory.getSOAP11Factory();
>>> +                            SOAPEnvelope resEnv =
>>> factory.createSOAPEnvelope();
>>> +                            SOAPBody resBody =
>>> factory.createSOAPBody();
>>> +                            OMElement resService =
>>> factory.createOMElement(new QName(serviceName + "Response"));
>>> +
>>> resService.addChild(resultSer.getFirstElement());
>>> +                            resBody.addChild(resService);
>>> +                            resEnv.addChild(resBody);
>>> +
>>> +                            // log the response message
>>> +                            if (Debug.verboseOn()) {
>>> +                                try {
>>> +                                    Debug.log("Response Message:\n"
>>> + resEnv + "\n", module);
>>> +                                } catch (Throwable t) {
>>> +                                }
>>> +                            }
>>>
>>> -                            resBody.addParam(par);
>>> +
>>> resEnv.serialize(response.getOutputStream());
>>> +                            response.getOutputStream().flush();
>>>                        }
>>> -                        resEnv.addBodyElement(resBody);
>>> -
>>> resEnv.setEncodingStyle(Constants.URI_LITERAL_ENC);
>>> -                    } else {
>>> -                        sendError(response, "Requested service not
>>> available");
>>> -                        throw new EventHandlerException("Service is
>>> not exported");
>>> +
>>> +                    } catch (GenericServiceException e) {
>>> +                        sendError(response, "Problem processing the
>>> service");
>>> +                        throw new
>>> EventHandlerException(e.getMessage(), e);
>>>                    }
>>> -                } catch (GenericServiceException e) {
>>> -                    sendError(response, "Problem processing the
>>> service");
>>> -                    throw new EventHandlerException(e.getMessage(),
>>> e);
>>> -                } catch (javax.xml.soap.SOAPException e) {
>>> -                    sendError(response, "Problem processing the
>>> service");
>>> -                    throw new EventHandlerException(e.getMessage(),
>>> e);
>>>                }
>>>            }
>>> -        }
>>> -
>>> -        // setup the response
>>> -        Debug.logVerbose("[EventHandler] : Setting up response
>>> message", module);
>>> -        msg = new Message(resEnv);
>>> -        mctx.setResponseMessage(msg);
>>> -        if (msg == null) {
>>> -            sendError(response, "No response message available");
>>> -            throw new EventHandlerException("No response message
>>> available");
>>> -        }
>>> -
>>> -        // log the response message
>>> -        if (Debug.verboseOn()) {
>>> -            try {
>>> -                Debug.log("Response Message:\n" +
>>> messageToString(msg) + "\n", module);
>>> -            } catch (Throwable t) {
>>> -            }
>>> -        }
>>> -
>>> -        try {
>>> -
>>> response
>>> .setContentType(msg.getContentType(Constants.DEFAULT_SOAP_VERSION));
>>> -
>>> response
>>> .setContentLength
>>> (Integer.parseInt(Long.toString(msg.getContentLength())));
>>> -        } catch (AxisFault e) {
>>> -            sendError(response, e);
>>> +        } catch (Exception e) {
>>> +            sendError(response, e.getMessage());
>>>            throw new EventHandlerException(e.getMessage(), e);
>>>        }
>>> -
>>> -        try {
>>> -            msg.writeTo(response.getOutputStream());
>>> -            response.flushBuffer();
>>> -        } catch (IOException e) {
>>> -            throw new EventHandlerException("Cannot write to the
>>> output stream");
>>> -        } catch (SOAPException e) {
>>> -            throw new EventHandlerException("Cannot write message
>>> to the output stream");
>>> -        }
>>> -
>>> -        Debug.logVerbose("[EventHandler] : Message sent to
>>> requester", module);
>>> -
>>> +
>>>        return null;
>>>    }
>>>
>>> -    private void sendError(HttpServletResponse res, Object obj)
>>> throws EventHandlerException {
>>> -        Message msg = new Message(obj);
>>> -
>>> +    private void sendError(HttpServletResponse res, String
>>> errorMessage) throws EventHandlerException {
>>>        try {
>>> -
>>> res
>>> .setContentType(msg.getContentType(Constants.DEFAULT_SOAP_VERSION));
>>> -
>>> res
>>> .setContentLength
>>> (Integer.parseInt(Long.toString(msg.getContentLength())));
>>> -            msg.writeTo(res.getOutputStream());
>>> -            res.flushBuffer();
>>> +            // setup the response
>>> +            Map<String, Object> results = FastMap.newInstance();
>>> +            results.put("errorMessage", errorMessage);
>>> +            String xmlResults= XmlSerializer.serialize(results);
>>> +            XMLStreamReader xmlReader =
>>> XMLInputFactory.newInstance().createXMLStreamReader(new
>>> StringReader(xmlResults));
>>> +            StAXOMBuilder resultsBuilder = new
>>> StAXOMBuilder(xmlReader);
>>> +            OMElement resultSer =
>>> resultsBuilder.getDocumentElement();
>>> +
>>> +            // create the response soap
>>> +            SOAPFactory factory =
>>> OMAbstractFactory.getSOAP11Factory();
>>> +            SOAPEnvelope resEnv = factory.createSOAPEnvelope();
>>> +            SOAPBody resBody = factory.createSOAPBody();
>>> +            OMElement errMsg = factory.createOMElement(new
>>> QName("Response"));
>>> +            errMsg.addChild(resultSer.getFirstElement());
>>> +            resBody.addChild(errMsg);
>>> +            resEnv.addChild(resBody);
>>> +
>>> +            // log the response message
>>> +            if (Debug.verboseOn()) {
>>> +                try {
>>> +                    Debug.log("Response Message:\n" + resEnv +
>>> "\n", module);
>>> +                } catch (Throwable t) {
>>> +                }
>>> +            }
>>> +
>>> +            resEnv.serialize(res.getOutputStream());
>>> +            res.getOutputStream().flush();
>>>        } catch (Exception e) {
>>>            throw new EventHandlerException(e.getMessage(), e);
>>>        }
>>> @@ -320,10 +278,4 @@
>>>        uri.append(reqInfo);
>>>        return uri.toString();
>>>    }
>>> -
>>> -    public static String messageToString(Message msg) throws
>>> SOAPException, IOException {
>>> -        ByteArrayOutputStream out = new ByteArrayOutputStream();
>>> -        msg.writeTo(out);
>>> -        return out.toString();
>>> -    }
>>> }
>>>
>>>
>>
> -- 
> Antwebsystems.com: Quality OFBiz services for competitive rates
>


Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Posted by Hans Bakker <ma...@antwebsystems.com>.
Hi Scott,
Thank you for the comment, suggestion implemented by Chatree and
Committed revision 893087.

Regards,
Hans

On Mon, 2009-12-21 at 23:21 +1300, Scott Gray wrote:
> Hi Hans,
> 
> Thanks for committing some tests, it's great to see.
> 
> One small issue though, the test introduces a dependency on the  
> product data model from common and the service engine, this means the  
> test would fail in a framework only installation.  I would suggest  
> switching the entity over to TestingNode which along with the other  
> entities in framework/entity/entitydef/entitymodel_test.xml are  
> provided for testing the lower level tools.
> 
> Regards
> Scott
> 
> HotWax Media
> http://www.hotwaxmedia.com
> 
> On 21/12/2009, at 8:32 PM, hansbak@apache.org wrote:
> 
> > Author: hansbak
> > Date: Mon Dec 21 07:31:58 2009
> > New Revision: 892712
> >
> > URL: http://svn.apache.org/viewvc?rev=892712&view=rev
> > Log:
> > Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in  
> > webservices including WSDL generation. see OFBIZ-3363 for more info.  
> > A contribution of Antwebsystems employee Chatree
> >
> > Added:
> >    ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with  
> > props)
> >    ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with  
> > props)
> >    ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with  
> > props)
> >    ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with  
> > props)
> >    ofbiz/trunk/framework/service/lib/axis2-transport- 
> > http-1.5.1.jar   (with props)
> >    ofbiz/trunk/framework/service/lib/axis2-transport- 
> > local-1.5.1.jar   (with props)
> >    ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar    
> > (with props)
> >    ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
> >    ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> > ServiceSOAPTests.java   (with props)
> > Modified:
> >    ofbiz/trunk/LICENSE
> >    ofbiz/trunk/framework/common/servicedef/services_test.xml
> >    ofbiz/trunk/framework/common/src/org/ofbiz/common/ 
> > CommonServices.java
> >    ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
> >    ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> > ModelService.java
> >    ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/ 
> > SOAPClientEngine.java
> >    ofbiz/trunk/framework/service/testdef/servicetests.xml
> >    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ 
> > SOAPEventHandler.java
> >
> > Modified: ofbiz/trunk/LICENSE
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=892712&r1=892711&r2=892712&view=diff
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > --- ofbiz/trunk/LICENSE (original)
> > +++ ofbiz/trunk/LICENSE Mon Dec 21 07:31:58 2009
> > @@ -87,6 +87,14 @@
> > ofbiz/trunk/framework/jetty/lib/xmlParserAPIs-2.6.2.jar
> > ofbiz/trunk/framework/service/lib/axis-ant.jar
> > ofbiz/trunk/framework/service/lib/axis.jar
> > +ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
> > +ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
> > +ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
> > +ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar
> > +ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar
> > +ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
> > +ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
> > +ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
> > ofbiz/trunk/framework/webapp/lib/fop-0.95.jar
> > ofbiz/trunk/framework/webapp/lib/velocity-1.6.1.jar
> > ofbiz/trunk/framework/webapp/lib/xmlgraphics-commons-1.3.1.jar
> >
> > Modified: ofbiz/trunk/framework/common/servicedef/services_test.xml
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services_test.xml?rev=892712&r1=892711&r2=892712&view=diff
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > --- ofbiz/trunk/framework/common/servicedef/services_test.xml  
> > (original)
> > +++ ofbiz/trunk/framework/common/servicedef/services_test.xml Mon  
> > Dec 21 07:31:58 2009
> > @@ -31,6 +31,12 @@
> >         <attribute name="message" type="String" mode="IN"  
> > optional="true"/>
> >         <attribute name="resp" type="String" mode="OUT"/>
> >     </service>
> > +    <service name="testSOAPScv" engine="java" export="true"  
> > validate="false" require-new-transaction="true"
> > +            location="org.ofbiz.common.CommonServices"  
> > invoke="testSOAPService">
> > +        <description>Test SOAP service</description>
> > +        <attribute name="productCategory"  
> > type="org.ofbiz.entity.GenericValue" mode="IN" optional="false"/>
> > +        <attribute name="products" type="List" mode="OUT"  
> > optional="true"/>
> > +    </service>
> >     <service name="blockingTestScv" engine="java" export="true"  
> > validate="false" require-new-transaction="true" transaction- 
> > timeout="20"
> >             location="org.ofbiz.common.CommonServices"  
> > invoke="blockingTestService">
> >         <description>Blocking Test service</description>
> > @@ -84,10 +90,15 @@
> >     </service>
> >
> >     <service name="testSoap" engine="soap" export="true"
> > +            location="http://localhost:8080/webtools/control/SOAPService 
> > " invoke="testSOAPScv">
> > +        <description>SOAP service; calls the OFBiz test SOAP  
> > service</description>
> > +        <implements service="testSOAPScv"/>
> > +    </service>
> > +
> > +    <service name="testSoapSimple" engine="soap" export="true"
> >             location="http://localhost:8080/webtools/control/SOAPService 
> > " invoke="testScv">
> > -        <description>Test SOAP service; calls the OFBiz test  
> > service</description>
> > -        <attribute name="message" type="String" mode="IN"  
> > optional="true"/>
> > -        <attribute name="resp" type="String" mode="OUT"/>
> > +        <description>simple SOAP service; calls the OFBiz test  
> > service</description>
> > +        <implements service="testScv"/>
> >     </service>
> >
> >     <service name="testRemoteSoap" engine="soap" export="true"
> >
> > Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/ 
> > CommonServices.java
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java?rev=892712&r1=892711&r2=892712&view=diff
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > --- ofbiz/trunk/framework/common/src/org/ofbiz/common/ 
> > CommonServices.java (original)
> > +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/ 
> > CommonServices.java Mon Dec 21 07:31:58 2009
> > @@ -26,6 +26,7 @@
> > import javax.mail.internet.MimeMessage;
> > import javax.transaction.xa.XAException;
> >
> > +import javolution.util.FastList;
> > import javolution.util.FastMap;
> >
> > import org.apache.log4j.Level;
> > @@ -84,6 +85,32 @@
> >         System.out.println("----- SVC: " + dctx.getName() + " -----");
> >         return response;
> >     }
> > +
> > +    /**
> > +     * Generic Test SOAP Service
> > +     *@param dctx The DispatchContext that this service is  
> > operating in
> > +     *@param context Map containing the input parameters
> > +     *@return Map with the result of the service, the output  
> > parameters
> > +     */
> > +    public static Map<String, Object>  
> > testSOAPService(DispatchContext dctx, Map<String, ?> context) {
> > +        Delegator delegator = dctx.getDelegator();
> > +        Map<String, Object> response = ServiceUtil.returnSuccess();
> > +
> > +        GenericValue productCategory = (GenericValue)  
> > context.get("productCategory");
> > +        List<GenericValue> products = FastList.newInstance();
> > +        for (int i = 0; i < 3; i ++) {
> > +            GenericValue product = delegator.makeValue("Product");
> > +            product.put("productId", "PROD_TEST" + i);
> > +            product.put("productTypeId", "FINISHED_GOOD");
> > +            product.put("primaryProductCategoryId", "202");
> > +            product.put("internalName", "Product Test " + i);
> > +            product.put("productName", "Product Test " + i);
> > +            product.put("createdStamp", UtilDateTime.nowTimestamp());
> > +            products.add(product);
> > +        }
> > +        response.put("products", products);
> > +        return response;
> > +    }
> >
> >     public static Map<String, Object>  
> > blockingTestService(DispatchContext dctx, Map<String, ?> context) {
> >         Long duration = (Long) context.get("duration");
> >
> > Added: ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar?rev=892712&view=auto
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > Binary file - no diff available.
> >
> > Propchange: ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
> > ------------------------------------------------------------------------------
> >    svn:mime-type = application/octet-stream
> >
> > Added: ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar?rev=892712&view=auto
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > Binary file - no diff available.
> >
> > Propchange: ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
> > ------------------------------------------------------------------------------
> >    svn:mime-type = application/octet-stream
> >
> > Added: ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar?rev=892712&view=auto
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > Binary file - no diff available.
> >
> > Propchange: ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
> > ------------------------------------------------------------------------------
> >    svn:mime-type = application/octet-stream
> >
> > Added: ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar?rev=892712&view=auto
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > Binary file - no diff available.
> >
> > Propchange: ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
> > ------------------------------------------------------------------------------
> >    svn:mime-type = application/octet-stream
> >
> > Added: ofbiz/trunk/framework/service/lib/axis2-transport- 
> > http-1.5.1.jar
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar?rev=892712&view=auto
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > Binary file - no diff available.
> >
> > Propchange: ofbiz/trunk/framework/service/lib/axis2-transport- 
> > http-1.5.1.jar
> > ------------------------------------------------------------------------------
> >    svn:mime-type = application/octet-stream
> >
> > Added: ofbiz/trunk/framework/service/lib/axis2-transport- 
> > local-1.5.1.jar
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar?rev=892712&view=auto
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > Binary file - no diff available.
> >
> > Propchange: ofbiz/trunk/framework/service/lib/axis2-transport- 
> > local-1.5.1.jar
> > ------------------------------------------------------------------------------
> >    svn:mime-type = application/octet-stream
> >
> > Added: ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar?rev=892712&view=auto
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > Binary file - no diff available.
> >
> > Propchange: ofbiz/trunk/framework/service/lib/commons- 
> > httpclient-3.1.jar
> > ------------------------------------------------------------------------------
> >    svn:mime-type = application/octet-stream
> >
> > Added: ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar?rev=892712&view=auto
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > Binary file - no diff available.
> >
> > Propchange: ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
> > ------------------------------------------------------------------------------
> >    svn:mime-type = application/octet-stream
> >
> > Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> > ModelParam.java
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java?rev=892712&r1=892711&r2=892712&view=diff
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> > ModelParam.java (original)
> > +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> > ModelParam.java Mon Dec 21 07:31:58 2009
> > @@ -207,47 +207,56 @@
> >     public Part getWSDLPart(Definition def) throws WSDLException {
> >         Part part = def.createPart();
> >         part.setName(this.name);
> > -        part.setTypeName(new QName(ModelService.XSD,  
> > this.java2wsdlType()));
> > +        part.setTypeName(new QName(ModelService.TNS,  
> > this.java2wsdlType()));
> >         return part;
> >     }
> >
> >     protected String java2wsdlType() throws WSDLException {
> >         if (ObjectType.instanceOf(java.lang.Character.class,  
> > this.type)) {
> > -            return "string";
> > +            return "std-String";
> >         } else if (ObjectType.instanceOf(java.lang.String.class,  
> > this.type)) {
> > -            return "string";
> > +            return "std-String";
> >         } else if (ObjectType.instanceOf(java.lang.Byte.class,  
> > this.type)) {
> > -            return "byte";
> > +            return "std-String";
> >         } else if (ObjectType.instanceOf(java.lang.Boolean.class,  
> > this.type)) {
> > -            return "boolean";
> > +            return "std-Boolean";
> >         } else if (ObjectType.instanceOf(java.lang.Integer.class,  
> > this.type)) {
> > -            return "int";
> > +            return "std-Integer";
> >         } else if (ObjectType.instanceOf(java.lang.Double.class,  
> > this.type)) {
> > -            return "double";
> > +            return "std-Double";
> >         } else if (ObjectType.instanceOf(java.lang.Float.class,  
> > this.type)) {
> > -            return "float";
> > +            return "std-Float";
> >         } else if (ObjectType.instanceOf(java.lang.Short.class,  
> > this.type)) {
> > -            return "short";
> > +            return "std-Integer";
> >         } else if (ObjectType.instanceOf(java.math.BigDecimal.class,  
> > this.type)) {
> > -            return "decimal";
> > +            return "std-Long";
> >         } else if (ObjectType.instanceOf(java.math.BigInteger.class,  
> > this.type)) {
> > -            return "integer";
> > +            return "std-Integer";
> >         } else if (ObjectType.instanceOf(java.util.Calendar.class,  
> > this.type)) {
> > -            return "dateTime";
> > +            return "sql-Timestamp";
> >         } else if  
> > (ObjectType.instanceOf(com.ibm.icu.util.Calendar.class, this.type)) {
> > -            return "dateTime";
> > +            return "sql-Timestamp";
> >         } else if (ObjectType.instanceOf(java.sql.Date.class,  
> > this.type)) {
> > -            return "date";
> > +            return "sql-Date";
> >         } else if (ObjectType.instanceOf(java.util.Date.class,  
> > this.type)) {
> > -            return "dateTime";
> > +            return "sql-Timestamp";
> >         } else if (ObjectType.instanceOf(java.lang.Long.class,  
> > this.type)) {
> > -            return "unsignedInt";
> > +            return "std-Long";
> >         } else if (ObjectType.instanceOf(java.sql.Timestamp.class,  
> > this.type)) {
> > -            return "string";
> > +            return "sql-Timestamp";
> > +        } else if  
> > (ObjectType.instanceOf(org.ofbiz.entity.GenericValue.class,  
> > this.type)) {
> > +            return "eeval-";
> > +        } else if  
> > (ObjectType.instanceOf(org.ofbiz.entity.GenericPK.class, this.type)) {
> > +            return "eepk-";
> > +        } else if (ObjectType.instanceOf(java.util.Map.class,  
> > this.type)) {
> > +            return "map-Map";
> > +        } else if (ObjectType.instanceOf(java.util.List.class,  
> > this.type)) {
> > +            return "col-LinkedList";
> > +        } else {
> > +            return "cus-obj";
> >         }
> >
> > -        // TODO add array support (maybe even convert List  
> > objects); add GenericValue/Map support
> > -        throw new WSDLException(WSDLException.OTHER_ERROR, "Service  
> > cannot be described with WSDL (" + this.name + " / " + this.type +  
> > ")");
> > +        //throw new WSDLException(WSDLException.OTHER_ERROR,  
> > "Service cannot be described with WSDL (" + this.name + " / " +  
> > this.type + ")");
> >     }
> >
> >     static class ModelParamValidator implements Serializable {
> >
> > Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> > ModelService.java
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java?rev=892712&r1=892711&r2=892712&view=diff
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> > ModelService.java (original)
> > +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> > ModelService.java Mon Dec 21 07:31:58 2009
> > @@ -41,9 +41,11 @@
> > import javax.wsdl.Message;
> > import javax.wsdl.Operation;
> > import javax.wsdl.Output;
> > +import javax.wsdl.Part;
> > import javax.wsdl.Port;
> > import javax.wsdl.PortType;
> > import javax.wsdl.Service;
> > +import javax.wsdl.Types;
> > import javax.wsdl.WSDLException;
> > import javax.wsdl.extensions.soap.SOAPAddress;
> > import javax.wsdl.extensions.soap.SOAPBinding;
> > @@ -51,6 +53,8 @@
> > import javax.wsdl.extensions.soap.SOAPOperation;
> > import javax.wsdl.factory.WSDLFactory;
> > import javax.xml.namespace.QName;
> > +import javax.xml.parsers.DocumentBuilder;
> > +import javax.xml.parsers.DocumentBuilderFactory;
> >
> > import javolution.util.FastList;
> > import javolution.util.FastMap;
> > @@ -66,6 +70,7 @@
> > import org.ofbiz.service.group.GroupServiceModel;
> > import org.ofbiz.service.group.ServiceGroupReader;
> > import org.w3c.dom.Document;
> > +import org.w3c.dom.Element;
> >
> > import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
> > import com.ibm.wsdl.extensions.soap.SOAPBindingImpl;
> > @@ -1189,6 +1194,18 @@
> > }
> >
> >     public void getWSDL(Definition def, String locationURI) throws  
> > WSDLException {
> > +
> > +        DocumentBuilderFactory factory =  
> > DocumentBuilderFactory.newInstance();
> > +        DocumentBuilder builder = null;
> > +        Document document = null;
> > +        try {
> > +            builder = factory.newDocumentBuilder();
> > +            document = builder.newDocument();
> > +        } catch (Exception e) {
> > +            throw new WSDLException("can not create WSDL", module);
> > +        }
> > +        def.setTypes(this.getTypes(document, def));
> > +
> >         // set the IN parameters
> >         Input input = def.createInput();
> >         Set<String> inParam = this.getInParamNames();
> > @@ -1196,12 +1213,25 @@
> >             Message inMessage = def.createMessage();
> >             inMessage.setQName(new QName(TNS, this.name + "Request"));
> >             inMessage.setUndefined(false);
> > +            Part parametersPart = def.createPart();
> > +            parametersPart.setName("map-Map");
> > +            parametersPart.setTypeName(new QName(TNS, "map-Map"));
> > +            inMessage.addPart(parametersPart);
> > +            Element documentation =  
> > document.createElement("wsdl:documentation");
> >             for (String paramName: inParam) {
> >                 ModelParam param = this.getParam(paramName);
> >                 if (!param.internal) {
> > -                    inMessage.addPart(param.getWSDLPart(def));
> > +                    Part part = param.getWSDLPart(def);
> > +                    Element attribute =  
> > document.createElement("attribute");
> > +                    attribute.setAttribute("name", paramName);
> > +                    attribute.setAttribute("type",  
> > part.getTypeName().getLocalPart());
> > +                    attribute.setAttribute("namespace",  
> > part.getTypeName().getNamespaceURI());
> > +                    attribute.setAttribute("java-class", param.type);
> > +                    attribute.setAttribute("optional",  
> > Boolean.toString(param.optional));
> > +                    documentation.appendChild(attribute);
> >                 }
> >             }
> > +            parametersPart.setDocumentationElement(documentation);
> >             def.addMessage(inMessage);
> >             input.setMessage(inMessage);
> >         }
> > @@ -1213,12 +1243,25 @@
> >             Message outMessage = def.createMessage();
> >             outMessage.setQName(new QName(TNS, this.name +  
> > "Response"));
> >             outMessage.setUndefined(false);
> > +            Part resultsPart = def.createPart();
> > +            resultsPart.setName("map-Map");
> > +            resultsPart.setTypeName(new QName(TNS, "map-Map"));
> > +            outMessage.addPart(resultsPart);
> > +            Element documentation =  
> > document.createElement("wsdl:documentation");
> >             for (String paramName: outParam) {
> >                 ModelParam param = this.getParam(paramName);
> >                 if (!param.internal) {
> > -                    outMessage.addPart(param.getWSDLPart(def));
> > +                    Part part = param.getWSDLPart(def);
> > +                    Element attribute =  
> > document.createElement("attribute");
> > +                    attribute.setAttribute("name", paramName);
> > +                    attribute.setAttribute("type",  
> > part.getTypeName().getLocalPart());
> > +                    attribute.setAttribute("namespace",  
> > part.getTypeName().getNamespaceURI());
> > +                    attribute.setAttribute("java-class", param.type);
> > +                    attribute.setAttribute("optional",  
> > Boolean.toString(param.optional));
> > +                    documentation.appendChild(attribute);
> >                 }
> >             }
> > +            resultsPart.setDocumentationElement(documentation);
> >             def.addMessage(outMessage);
> >             output.setMessage(outMessage);
> >         }
> > @@ -1291,4 +1334,410 @@
> >         service.addPort(port);
> >         def.addService(service);
> >     }
> > +
> > +    public Types getTypes(Document document, Definition def) {
> > +        Types types = def.createTypes();
> > +        /* Schema */
> > +        Element schema = document.createElement("xsd:schema");
> > +        schema.setAttribute("targetNamespace", TNS);
> > +
> > +        /*-----------------------------------*/
> > +        /*--------- Standard Objects --------*/
> > +        /*-----------------------------------*/
> > +
> > +        /* std-String Element */
> > +        Element stdStringElement =  
> > document.createElement("xsd:element");
> > +        stdStringElement.setAttribute("name", "std-String");
> > +        Element stdStringElement0 =  
> > document.createElement("xsd:complexType");
> > +        stdStringElement.appendChild(stdStringElement0);
> > +        Element stdStringElement1 =  
> > document.createElement("xsd:attribute");
> > +        stdStringElement0.appendChild(stdStringElement1);
> > +        stdStringElement1.setAttribute("name", "value");
> > +        stdStringElement1.setAttribute("type", "xsd:string");
> > +        stdStringElement1.setAttribute("use", "required");
> > +        schema.appendChild(stdStringElement);
> > +        /* std-Integer Element */
> > +        Element stdIntegerElement =  
> > document.createElement("xsd:element");
> > +        stdIntegerElement.setAttribute("name", "std-Integer");
> > +        Element stdIntegerElement0 =  
> > document.createElement("xsd:complexType");
> > +        stdIntegerElement.appendChild(stdIntegerElement0);
> > +        Element stdIntegerElement1 =  
> > document.createElement("xsd:attribute");
> > +        stdIntegerElement0.appendChild(stdIntegerElement1);
> > +        stdIntegerElement1.setAttribute("name", "value");
> > +        stdIntegerElement1.setAttribute("type", "xsd:integer");
> > +        stdIntegerElement1.setAttribute("use", "required");
> > +        schema.appendChild(stdIntegerElement);
> > +        /* std-Long Element */
> > +        Element stdLongElement =  
> > document.createElement("xsd:element");
> > +        stdLongElement.setAttribute("name", "std-Long");
> > +        Element stdLongElement0 =  
> > document.createElement("xsd:complexType");
> > +        stdLongElement.appendChild(stdLongElement0);
> > +        Element stdLongElement1 =  
> > document.createElement("xsd:attribute");
> > +        stdLongElement0.appendChild(stdLongElement1);
> > +        stdLongElement1.setAttribute("name", "value");
> > +        stdLongElement1.setAttribute("type", "xsd:long");
> > +        stdLongElement1.setAttribute("use", "required");
> > +        schema.appendChild(stdLongElement);
> > +        /* std-Float Element */
> > +        Element stdFloatElement =  
> > document.createElement("xsd:element");
> > +        stdFloatElement.setAttribute("name", "std-Float");
> > +        Element stdFloatElement0 =  
> > document.createElement("xsd:complexType");
> > +        stdFloatElement.appendChild(stdFloatElement0);
> > +        Element stdFloatElement1 =  
> > document.createElement("xsd:attribute");
> > +        stdFloatElement0.appendChild(stdFloatElement1);
> > +        stdFloatElement1.setAttribute("name", "value");
> > +        stdFloatElement1.setAttribute("type", "xsd:float");
> > +        stdFloatElement1.setAttribute("use", "required");
> > +        schema.appendChild(stdFloatElement);
> > +        /* std-Double Element */
> > +        Element stdDoubleElement =  
> > document.createElement("xsd:element");
> > +        stdDoubleElement.setAttribute("name", "std-Double");
> > +        Element stdDoubleElement0 =  
> > document.createElement("xsd:complexType");
> > +        stdDoubleElement.appendChild(stdDoubleElement0);
> > +        Element stdDoubleElement1 =  
> > document.createElement("xsd:attribute");
> > +        stdDoubleElement0.appendChild(stdDoubleElement1);
> > +        stdDoubleElement1.setAttribute("name", "value");
> > +        stdDoubleElement1.setAttribute("type", "xsd:double");
> > +        stdDoubleElement1.setAttribute("use", "required");
> > +        schema.appendChild(stdDoubleElement);
> > +        /* std-Boolean Element */
> > +        Element stdBooleanElement =  
> > document.createElement("xsd:element");
> > +        stdBooleanElement.setAttribute("name", "std-Boolean");
> > +        Element stdBooleanElement0 =  
> > document.createElement("xsd:complexType");
> > +        stdBooleanElement.appendChild(stdBooleanElement0);
> > +        Element stdBooleanElement1 =  
> > document.createElement("xsd:attribute");
> > +        stdBooleanElement0.appendChild(stdBooleanElement1);
> > +        stdBooleanElement1.setAttribute("name", "value");
> > +        stdBooleanElement1.setAttribute("type", "xsd:boolean");
> > +        stdBooleanElement1.setAttribute("use", "required");
> > +        schema.appendChild(stdBooleanElement);
> > +        /* std-Locale Element */
> > +        Element stdLocaleElement =  
> > document.createElement("xsd:element");
> > +        stdLocaleElement.setAttribute("name", "std-Locale");
> > +        Element stdLocaleElement0 =  
> > document.createElement("xsd:complexType");
> > +        stdLocaleElement.appendChild(stdLocaleElement0);
> > +        Element stdLocaleElement1 =  
> > document.createElement("xsd:attribute");
> > +        stdLocaleElement0.appendChild(stdLocaleElement1);
> > +        stdLocaleElement1.setAttribute("name", "value");
> > +        stdLocaleElement1.setAttribute("type", "xsd:string");
> > +        stdLocaleElement1.setAttribute("use", "required");
> > +        schema.appendChild(stdLocaleElement);
> > +
> > +        /*-----------------------------------*/
> > +        /*----------- SQL Objects -----------*/
> > +        /*-----------------------------------*/
> > +
> > +        /* sql-Timestamp Element */
> > +        Element sqlTimestampElement =  
> > document.createElement("xsd:element");
> > +        sqlTimestampElement.setAttribute("name", "sql-Timestamp");
> > +        Element sqlTimestampElement0 =  
> > document.createElement("xsd:complexType");
> > +        sqlTimestampElement.appendChild(sqlTimestampElement0);
> > +        Element sqlTimestampElement1 =  
> > document.createElement("xsd:attribute");
> > +        sqlTimestampElement0.appendChild(sqlTimestampElement1);
> > +        sqlTimestampElement1.setAttribute("name", "value");
> > +        sqlTimestampElement1.setAttribute("type", "xsd:dateTime");
> > +        sqlTimestampElement1.setAttribute("use", "required");
> > +        schema.appendChild(sqlTimestampElement);
> > +        /* sql-Date Element */
> > +        Element sqlDateElement =  
> > document.createElement("xsd:element");
> > +        sqlDateElement.setAttribute("name", "sql-Date");
> > +        Element sqlDateElement0 =  
> > document.createElement("xsd:complexType");
> > +        sqlDateElement.appendChild(sqlDateElement0);
> > +        Element sqlDateElement1 =  
> > document.createElement("xsd:attribute");
> > +        sqlDateElement0.appendChild(sqlDateElement1);
> > +        sqlDateElement1.setAttribute("name", "value");
> > +        sqlDateElement1.setAttribute("type", "xsd:date");
> > +        sqlDateElement1.setAttribute("use", "required");
> > +        schema.appendChild(sqlDateElement);
> > +        /* sql-Time Element */
> > +        Element sqlTimeElement =  
> > document.createElement("xsd:element");
> > +        sqlTimeElement.setAttribute("name", "sql-Time");
> > +        Element sqlTimeElement0 =  
> > document.createElement("xsd:complexType");
> > +        sqlTimeElement.appendChild(sqlTimeElement0);
> > +        Element sqlTimeElement1 =  
> > document.createElement("xsd:attribute");
> > +        sqlTimeElement0.appendChild(sqlTimeElement1);
> > +        sqlTimeElement1.setAttribute("name", "value");
> > +        sqlTimeElement1.setAttribute("type", "xsd:time");
> > +        sqlTimeElement1.setAttribute("use", "required");
> > +        schema.appendChild(sqlTimeElement);
> > +
> > +        /*-----------------------------------*/
> > +        /*----------- List Objects -----------*/
> > +        /*-----------------------------------*/
> > +
> > +        /* col-ArrayList Element */
> > +        Element colArrayListElement =  
> > document.createElement("xsd:element");
> > +        colArrayListElement.setAttribute("name", "col-ArrayList");
> > +        schema.appendChild(colArrayListElement);
> > +        /* col-LinkedList Element */
> > +        Element colLinkedListElement =  
> > document.createElement("xsd:element");
> > +        colLinkedListElement.setAttribute("name", "col-LinkedList");
> > +        schema.appendChild(colLinkedListElement);
> > +        /* col-Stack Element */
> > +        Element colStackElement =  
> > document.createElement("xsd:element");
> > +        colStackElement.setAttribute("name", "col-Stack");
> > +        schema.appendChild(colStackElement);
> > +        /* col-Vector Element */
> > +        Element colVectorElement =  
> > document.createElement("xsd:element");
> > +        colVectorElement.setAttribute("name", "col-Vector");
> > +        schema.appendChild(colVectorElement);
> > +        /* col-TreeSet Element */
> > +        Element colTreeSetElement =  
> > document.createElement("xsd:element");
> > +        colTreeSetElement.setAttribute("name", "col-TreeSet");
> > +        schema.appendChild(colTreeSetElement);
> > +        /* col-HashSet Element */
> > +        Element colHashSetElement =  
> > document.createElement("xsd:element");
> > +        colHashSetElement.setAttribute("name", "col-HashSet");
> > +        schema.appendChild(colHashSetElement);
> > +        /* col-Collection Element */
> > +        Element colCollectionElement =  
> > document.createElement("xsd:element");
> > +        colCollectionElement.setAttribute("name", "col-Collection");
> > +        schema.appendChild(colCollectionElement);
> > +
> > +        /*-----------------------------------*/
> > +        /*----------- Map Objects -----------*/
> > +        /*-----------------------------------*/
> > +
> > +        /* map-TreeMap Element */
> > +        Element mapTreeMapElement =  
> > document.createElement("xsd:element");
> > +        mapTreeMapElement.setAttribute("name", "map-TreeMap");
> > +        mapTreeMapElement.setAttribute("type", "tns:map-Map");
> > +        schema.appendChild(mapTreeMapElement);
> > +        /* map-WeakHashMap Element */
> > +        Element mapWeakHashMapElement =  
> > document.createElement("xsd:element");
> > +        mapWeakHashMapElement.setAttribute("name", "map- 
> > WeakHashMap");
> > +        mapWeakHashMapElement.setAttribute("type", "tns:map-Map");
> > +        schema.appendChild(mapWeakHashMapElement);
> > +        /* map-Hashtable Element */
> > +        Element mapHashtableElement =  
> > document.createElement("xsd:element");
> > +        mapHashtableElement.setAttribute("name", "map-Hashtable");
> > +        mapHashtableElement.setAttribute("type", "tns:map-Map");
> > +        schema.appendChild(mapHashtableElement);
> > +        /* map-Properties Element */
> > +        Element mapPropertiesElement =  
> > document.createElement("xsd:element");
> > +        mapPropertiesElement.setAttribute("name", "map-Properties");
> > +        mapPropertiesElement.setAttribute("type", "tns:map-Map");
> > +        schema.appendChild(mapPropertiesElement);
> > +        /* map-HashMap Element */
> > +        Element mapHashMapElement =  
> > document.createElement("xsd:element");
> > +        mapHashMapElement.setAttribute("name", "map-HashMap");
> > +        mapHashMapElement.setAttribute("type", "tns:map-Map");
> > +        schema.appendChild(mapHashMapElement);
> > +        /* map-Map Element */
> > +        Element mapMapElement =  
> > document.createElement("xsd:element");
> > +        mapMapElement.setAttribute("name", "map-Map");
> > +        mapMapElement.setAttribute("type", "tns:map-Map");
> > +        schema.appendChild(mapMapElement);
> > +        /* map-Entry Element */
> > +        Element mapEntryElement =  
> > document.createElement("xsd:element");
> > +        mapEntryElement.setAttribute("name", "map-Entry");
> > +        mapEntryElement.setAttribute("type", "tns:map-Entry");
> > +        schema.appendChild(mapEntryElement);
> > +        /* map-Key Element */
> > +        Element mapKeyElement =  
> > document.createElement("xsd:element");
> > +        mapKeyElement.setAttribute("name", "map-Key");
> > +        mapKeyElement.setAttribute("type", "tns:map-Key");
> > +        schema.appendChild(mapKeyElement);
> > +        /* map-Value Element */
> > +        Element mapValueElement =  
> > document.createElement("xsd:element");
> > +        mapValueElement.setAttribute("name", "map-Value");
> > +        mapValueElement.setAttribute("type", "tns:map-Value");
> > +        schema.appendChild(mapValueElement);
> > +        /* eepk- Element */
> > +        Element eepkElement = document.createElement("xsd:element");
> > +        eepkElement.setAttribute("name", "eepk-");
> > +        eepkElement.setAttribute("type", "tns:map-Value");
> > +        schema.appendChild(eepkElement);
> > +        /* eeval- Element */
> > +        Element eevalElement = document.createElement("xsd:element");
> > +        eevalElement.setAttribute("name", "eeval-");
> > +        eevalElement.setAttribute("type", "tns:map-Value");
> > +        schema.appendChild(eevalElement);
> > +
> > +        /*-----------------------------------*/
> > +        /*----------- Custom Objects -----------*/
> > +        /*-----------------------------------*/
> > +
> > +        /* cus-obj Element */
> > +        Element cusObjElement =  
> > document.createElement("xsd:element");
> > +        cusObjElement.setAttribute("name", "cus-obj");
> > +        schema.appendChild(cusObjElement);
> > +
> > +        /*-----------------------------------*/
> > +        /*---------- Complex Types ----------*/
> > +        /*-----------------------------------*/
> > +
> > +        /* map-Map Complex Type */
> > +        Element mapMapComplexType =  
> > document.createElement("xsd:complexType");
> > +        mapMapComplexType.setAttribute("name", "map-Map");
> > +        Element mapMapComplexType0 =  
> > document.createElement("xsd:sequence");
> > +        mapMapComplexType.appendChild(mapMapComplexType0);
> > +        Element mapMapComplexType1 =  
> > document.createElement("xsd:element");
> > +        mapMapComplexType1.setAttribute("ref", "tns:map-Entry");
> > +        mapMapComplexType1.setAttribute("minOccurs", "0");
> > +        mapMapComplexType1.setAttribute("maxOccurs", "unbounded");
> > +        mapMapComplexType0.appendChild(mapMapComplexType1);
> > +        schema.appendChild(mapMapComplexType);
> > +        /* map-Entry Complex Type */
> > +        Element mapEntryComplexType =  
> > document.createElement("xsd:complexType");
> > +        mapEntryComplexType.setAttribute("name", "map-Entry");
> > +        Element mapEntryComplexType0 =  
> > document.createElement("xsd:sequence");
> > +        mapEntryComplexType.appendChild(mapEntryComplexType0);
> > +        Element mapEntryComplexType1 =  
> > document.createElement("xsd:element");
> > +        mapEntryComplexType1.setAttribute("ref", "tns:map-Key");
> > +        mapEntryComplexType1.setAttribute("minOccurs", "1");
> > +        mapEntryComplexType1.setAttribute("maxOccurs", "1");
> > +        mapEntryComplexType0.appendChild(mapEntryComplexType1);
> > +        Element mapEntryComplexType2 =  
> > document.createElement("xsd:element");
> > +        mapEntryComplexType2.setAttribute("ref", "tns:map-Value");
> > +        mapEntryComplexType2.setAttribute("minOccurs", "1");
> > +        mapEntryComplexType2.setAttribute("maxOccurs", "1");
> > +        mapEntryComplexType0.appendChild(mapEntryComplexType2);
> > +        schema.appendChild(mapEntryComplexType);
> > +        /* map-Key Complex Type */
> > +        Element mapKeyComplexType =  
> > document.createElement("xsd:complexType");
> > +        mapKeyComplexType.setAttribute("name", "map-Key");
> > +        Element mapKeyComplexType0 =  
> > document.createElement("xsd:all");
> > +        mapKeyComplexType.appendChild(mapKeyComplexType0);
> > +        Element mapKeyComplexType1 =  
> > document.createElement("xsd:element");
> > +        mapKeyComplexType1.setAttribute("ref", "tns:std-String");
> > +        mapKeyComplexType1.setAttribute("minOccurs", "1");
> > +        mapKeyComplexType1.setAttribute("maxOccurs", "1");
> > +        mapKeyComplexType0.appendChild(mapKeyComplexType1);
> > +        schema.appendChild(mapKeyComplexType);
> > +        /* map-Value Complex Type */
> > +        Element mapValueComplexType =  
> > document.createElement("xsd:complexType");
> > +        mapValueComplexType.setAttribute("name", "map-Value");
> > +        Element mapValueComplexType0 =  
> > document.createElement("xsd:choice");
> > +        mapValueComplexType.appendChild(mapValueComplexType0);
> > +        Element mapValueComplexType1 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType1.setAttribute("ref", "tns:std-String");
> > +        mapValueComplexType1.setAttribute("minOccurs", "1");
> > +        mapValueComplexType1.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType1);
> > +        Element mapValueComplexType2 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType2.setAttribute("ref", "tns:std-Integer");
> > +        mapValueComplexType2.setAttribute("minOccurs", "1");
> > +        mapValueComplexType2.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType2);
> > +        Element mapValueComplexType3 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType3.setAttribute("ref", "tns:std-Long");
> > +        mapValueComplexType3.setAttribute("minOccurs", "1");
> > +        mapValueComplexType3.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType3);
> > +        Element mapValueComplexType4 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType4.setAttribute("ref", "tns:std-Float");
> > +        mapValueComplexType4.setAttribute("minOccurs", "1");
> > +        mapValueComplexType4.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType4);
> > +        Element mapValueComplexType5 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType5.setAttribute("ref", "tns:std-Double");
> > +        mapValueComplexType5.setAttribute("minOccurs", "1");
> > +        mapValueComplexType5.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType5);
> > +        Element mapValueComplexType6 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType6.setAttribute("ref", "tns:std-Boolean");
> > +        mapValueComplexType6.setAttribute("minOccurs", "1");
> > +        mapValueComplexType6.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType6);
> > +        Element mapValueComplexType7 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType7.setAttribute("ref", "tns:std-Locale");
> > +        mapValueComplexType7.setAttribute("minOccurs", "1");
> > +        mapValueComplexType7.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType7);
> > +        Element mapValueComplexType8 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType8.setAttribute("ref", "tns:sql- 
> > Timestamp");
> > +        mapValueComplexType8.setAttribute("minOccurs", "1");
> > +        mapValueComplexType8.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType8);
> > +        Element mapValueComplexType9 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType9.setAttribute("ref", "tns:sql-Date");
> > +        mapValueComplexType9.setAttribute("minOccurs", "1");
> > +        mapValueComplexType9.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType9);
> > +        Element mapValueComplexType10 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType10.setAttribute("ref", "tns:sql-Time");
> > +        mapValueComplexType10.setAttribute("minOccurs", "1");
> > +        mapValueComplexType10.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType10);
> > +        Element mapValueComplexType11 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType11.setAttribute("ref", "tns:col- 
> > ArrayList");
> > +        mapValueComplexType11.setAttribute("minOccurs", "1");
> > +        mapValueComplexType11.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType11);
> > +        Element mapValueComplexType12 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType12.setAttribute("ref", "tns:col- 
> > LinkedList");
> > +        mapValueComplexType12.setAttribute("minOccurs", "1");
> > +        mapValueComplexType12.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType12);
> > +        Element mapValueComplexType13 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType13.setAttribute("ref", "tns:col-Stack");
> > +        mapValueComplexType13.setAttribute("minOccurs", "1");
> > +        mapValueComplexType13.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType13);
> > +        Element mapValueComplexType14 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType14.setAttribute("ref", "tns:col-Vector");
> > +        mapValueComplexType14.setAttribute("minOccurs", "1");
> > +        mapValueComplexType14.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType14);
> > +        Element mapValueComplexType15 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType15.setAttribute("ref", "tns:col-TreeSet");
> > +        mapValueComplexType15.setAttribute("minOccurs", "1");
> > +        mapValueComplexType15.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType15);
> > +        Element mapValueComplexType16 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType16.setAttribute("ref", "tns:col-HashSet");
> > +        mapValueComplexType16.setAttribute("minOccurs", "1");
> > +        mapValueComplexType16.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType16);
> > +        Element mapValueComplexType17 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType17.setAttribute("ref", "tns:col- 
> > Collection");
> > +        mapValueComplexType17.setAttribute("minOccurs", "1");
> > +        mapValueComplexType17.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType17);
> > +        Element mapValueComplexType18 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType18.setAttribute("ref", "tns:map-HashMap");
> > +        mapValueComplexType18.setAttribute("minOccurs", "1");
> > +        mapValueComplexType18.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType18);
> > +        Element mapValueComplexType19 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType19.setAttribute("ref", "tns:map- 
> > Properties");
> > +        mapValueComplexType19.setAttribute("minOccurs", "1");
> > +        mapValueComplexType19.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType19);
> > +        Element mapValueComplexType20 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType20.setAttribute("ref", "tns:map- 
> > Hashtable");
> > +        mapValueComplexType20.setAttribute("minOccurs", "1");
> > +        mapValueComplexType20.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType20);
> > +        Element mapValueComplexType21 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType21.setAttribute("ref", "tns:map- 
> > WeakHashMap");
> > +        mapValueComplexType21.setAttribute("minOccurs", "1");
> > +        mapValueComplexType21.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType21);
> > +        Element mapValueComplexType22 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType22.setAttribute("ref", "tns:map-TreeMap");
> > +        mapValueComplexType22.setAttribute("minOccurs", "1");
> > +        mapValueComplexType22.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType22);
> > +        Element mapValueComplexType23 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType23.setAttribute("ref", "tns:map-Map");
> > +        mapValueComplexType23.setAttribute("minOccurs", "1");
> > +        mapValueComplexType23.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType23);
> > +        Element mapValueComplexType24 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType24.setAttribute("ref", "tns:eepk-");
> > +        mapValueComplexType24.setAttribute("minOccurs", "1");
> > +        mapValueComplexType24.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType24);
> > +        Element mapValueComplexType25 =  
> > document.createElement("xsd:element");
> > +        mapValueComplexType25.setAttribute("ref", "tns:eeval-");
> > +        mapValueComplexType25.setAttribute("minOccurs", "1");
> > +        mapValueComplexType25.setAttribute("maxOccurs", "1");
> > +        mapValueComplexType0.appendChild(mapValueComplexType25);
> > +        schema.appendChild(mapValueComplexType);
> > +
> > +        types.setDocumentationElement(schema);
> > +        return types;
> > +    }
> > }
> >
> > Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/ 
> > SOAPClientEngine.java
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java?rev=892712&r1=892711&r2=892712&view=diff
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/ 
> > SOAPClientEngine.java (original)
> > +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/ 
> > SOAPClientEngine.java Mon Dec 21 07:31:58 2009
> > @@ -18,32 +18,32 @@
> >   
> > *******************************************************************************/
> > package org.ofbiz.service.engine;
> >
> > -import java.net.MalformedURLException;
> > -import java.net.URL;
> > -import java.util.ArrayList;
> > -import java.util.Iterator;
> > +import java.io.StringReader;
> > import java.util.List;
> > import java.util.Map;
> >
> > import javax.xml.namespace.QName;
> > -import javax.xml.rpc.ParameterMode;
> > -import javax.xml.rpc.ServiceException;
> > +import javax.xml.stream.XMLInputFactory;
> > +import javax.xml.stream.XMLStreamReader;
> >
> > import javolution.util.FastMap;
> >
> > -import org.apache.axis.Message;
> > -import org.apache.axis.client.Call;
> > -import org.apache.axis.client.Service;
> > -import org.apache.axis.encoding.XMLType;
> > -import org.apache.axis.message.RPCElement;
> > -import org.apache.axis.message.RPCParam;
> > -import org.apache.axis.message.SOAPEnvelope;
> > +import org.apache.axiom.om.OMAbstractFactory;
> > +import org.apache.axiom.om.OMElement;
> > +import org.apache.axiom.om.OMFactory;
> > +import org.apache.axiom.om.impl.builder.StAXOMBuilder;
> > +import org.apache.axis2.AxisFault;
> > +import org.apache.axis2.addressing.EndpointReference;
> > +import org.apache.axis2.client.Options;
> > +import org.apache.axis2.client.ServiceClient;
> > +import org.ofbiz.base.util.Debug;
> > +import org.ofbiz.base.util.UtilValidate;
> > +import org.ofbiz.entity.Delegator;
> > +import org.ofbiz.entity.serialize.XmlSerializer;
> > import org.ofbiz.service.GenericServiceException;
> > import org.ofbiz.service.ModelParam;
> > import org.ofbiz.service.ModelService;
> > import org.ofbiz.service.ServiceDispatcher;
> > -import org.ofbiz.base.util.Debug;
> > -import org.ofbiz.base.util.UtilValidate;
> >
> > /**
> >  * Generic Service SOAP Interface
> > @@ -78,113 +78,67 @@
> >
> >     // Invoke the remote SOAP service
> >     private Map<String, Object> serviceInvoker(ModelService  
> > modelService, Map<String, Object> context) throws  
> > GenericServiceException {
> > +        Delegator delegator = dispatcher.getDelegator();
> >         if (modelService.location == null || modelService.invoke ==  
> > null)
> >             throw new GenericServiceException("Cannot locate service  
> > to invoke");
> > -
> > -        Service service = null;
> > -        Call call = null;
> > -
> > +
> > +        ServiceClient client = null;
> > +        QName serviceName = null;
> > +
> >         try {
> > -            service = new Service();
> > -            call = (Call) service.createCall();
> > -        } catch (javax.xml.rpc.JAXRPCException e) {
> > -            throw new GenericServiceException("RPC service error",  
> > e);
> > -        } catch (ServiceException e) {//Add by Andy.Chen 2003.01.15
> > +            client = new ServiceClient();
> > +            Options options = new Options();
> > +            EndpointReference endPoint = new  
> > EndpointReference(this.getLocation(modelService));
> > +            options.setTo(endPoint);
> > +            client.setOptions(options);
> > +        } catch (AxisFault e) {
> >             throw new GenericServiceException("RPC service error", e);
> >         }
> > -
> > -        URL endPoint = null;
> > -
> > -        try {
> > -            endPoint = new URL(this.getLocation(modelService));
> > -        } catch (MalformedURLException e) {
> > -            throw new GenericServiceException("Location not a valid  
> > URL", e);
> > -        }
> > -
> > +
> >         List<ModelParam> inModelParamList =  
> > modelService.getInModelParamList();
> > -
> > +
> >         if (Debug.infoOn())  
> > Debug.logInfo("[SOAPClientEngine.invoke] : Parameter length - " +  
> > inModelParamList.size(), module);
> > -
> > -        call.setTargetEndpointAddress(endPoint);
> > -
> > +
> >         if (UtilValidate.isNotEmpty(modelService.nameSpace)) {
> > -            call.setOperationName(new QName(modelService.nameSpace,  
> > modelService.invoke));
> > +            serviceName = new QName(modelService.nameSpace,  
> > modelService.invoke);
> >         } else {
> > -            call.setOperationName(modelService.invoke);
> > +            serviceName = new QName(modelService.invoke);
> >         }
> > -
> > +
> >         int i = 0;
> > -
> > -        call.setOperation(call.getOperationName().getLocalPart());
> > -        List<Object> vParams = new ArrayList<Object>();
> > +
> > +        Map<String, Object> parameterMap = FastMap.newInstance();
> >         for (ModelParam p: inModelParamList) {
> >             if (Debug.infoOn())  
> > Debug.logInfo("[SOAPClientEngine.invoke} : Parameter: " + p.name +  
> > " (" + p.mode + ") - " + i, module);
> >
> >             // exclude params that ModelServiceReader insert into  
> > (internal params)
> >             if (!p.internal) {
> > -                QName qName =  
> > call 
> > .getParameterTypeByName 
> > (p.name); //.getTypeMapping().getTypeQName((Class)  
> > ObjectType.classNameClassMap.get(p.type));
> > -                call.addParameter(p.name, qName, getMode(p.mode));
> > -                vParams.add(context.get(p.name));
> > +                parameterMap.put(p.name, context.get(p.name));
> >             }
> >             i++;
> >         }
> >
> > -        call.setReturnType(XMLType.XSD_ANYTYPE);
> > -        Object[] params=vParams.toArray(new Object[vParams.size()]);
> > -
> > -        Object result = null;
> > -
> > +        OMElement parameterSer = null;
> > +
> >         try {
> > -            Debug.logInfo("[SOAPClientEngine.invoke] : Sending Call  
> > To SOAP Server", module);
> > -            result = call.invoke(params);
> > -        } catch (java.rmi.RemoteException e) {
> > -            throw new GenericServiceException("RPC error", e);
> > -        }
> > -        if (Debug.verboseOn()) {
> > -            Debug.log("SOAP Service Result - " + result, module);
> > +            String xmlParameters =  
> > XmlSerializer.serialize(parameterMap);
> > +            XMLStreamReader reader =  
> > XMLInputFactory.newInstance().createXMLStreamReader(new  
> > StringReader(xmlParameters));
> > +            StAXOMBuilder builder = new StAXOMBuilder(reader);
> > +            parameterSer = builder.getDocumentElement();
> > +        } catch (Exception e) {
> > +            Debug.logError(e, module);
> >         }
> > -
> > -        return  
> > getResponseParams(call.getMessageContext().getResponseMessage());
> > -    }
> > -
> > -    private Map<String, Object> getResponseParams(Message  
> > respMessage) {
> > -        Map<String, Object> mRet = FastMap.newInstance();
> > +
> > +        Map<String, Object> results = null;
> >         try {
> > -            SOAPEnvelope resEnv = respMessage.getSOAPEnvelope();
> > -            Iterator<?> i = resEnv.getBodyElements().iterator();
> > -            while (i.hasNext()) {
> > -                Object o = i.next();
> > -
> > -                if (o instanceof RPCElement) {
> > -                    RPCElement body = (RPCElement) o;
> > -
> > -                    Iterator<?> p = body.getParams().iterator();
> > -                    while (p.hasNext()) {
> > -                        RPCParam param = (RPCParam) p.next();
> > -                        mRet.put(param.getName(), param.getValue());
> > -                        if (Debug.verboseOn()) {
> > -                            Debug.log("SOAP Client Param - " +  
> > param.getName() + "=" + param.getValue(), module);
> > -                        }
> > -                    }
> > -                }
> > -            }
> > -        } catch (org.apache.axis.AxisFault e) {
> > -            Debug.logError(e, "AxisFault", module);
> > -        } catch (org.xml.sax.SAXException e) {
> > -            Debug.logError(e, "SAXException", module);
> > -        }
> > -        return mRet;
> > -    }
> > -
> > -    private ParameterMode getMode(String sMode) {
> > -        if (sMode.equals("IN")) {
> > -            return ParameterMode.IN;
> > -        } else if (sMode.equals("OUT")) {
> > -            return ParameterMode.OUT;
> > -        } else if (sMode.equals("INOUT")) {
> > -            return ParameterMode.INOUT;
> > -        } else {
> > -            return null;
> > +            OMFactory factory = OMAbstractFactory.getOMFactory();
> > +            OMElement payload = factory.createOMElement(serviceName);
> > +            payload.addChild(parameterSer.getFirstElement());
> > +            OMElement respOMElement = client.sendReceive(payload);
> > +            results = (Map<String, Object>)  
> > XmlSerializer.deserialize(respOMElement.toString(), delegator);
> > +        } catch (Exception e) {
> > +            Debug.logError(e, module);
> >         }
> > +        return results;
> >     }
> > }
> >
> > Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> > ServiceSOAPTests.java
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java?rev=892712&view=auto
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > --- ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> > ServiceSOAPTests.java (added)
> > +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> > ServiceSOAPTests.java Mon Dec 21 07:31:58 2009
> > @@ -0,0 +1,43 @@
> > +package org.ofbiz.service.test;
> > +
> > +import java.util.List;
> > +import java.util.Map;
> > +
> > +import javolution.util.FastMap;
> > +
> > +import org.ofbiz.base.util.Debug;
> > +import org.ofbiz.base.util.UtilDateTime;
> > +import org.ofbiz.base.util.UtilMisc;
> > +import org.ofbiz.entity.GenericValue;
> > +import org.ofbiz.service.testtools.OFBizTestCase;
> > +
> > +public class ServiceSOAPTests extends OFBizTestCase {
> > +
> > +    public final static String module =  
> > ServiceSOAPTests.class.getName();
> > +
> > +    public ServiceSOAPTests(String name) {
> > +        // TODO Auto-generated constructor stub
> > +        super(name);
> > +    }
> > +
> > +    public void testSOAPSimpleService() throws Exception {
> > +        Map<String, Object> serviceContext = FastMap.newInstance();
> > +        serviceContext.put("defaultValue", new Double("123.4567"));
> > +        serviceContext.put("message", "Test Message !!!");
> > +        Map<String, Object> results =  
> > dispatcher.runSync("testSoapSimple", serviceContext);
> > +        String resp = (String) results.get("resp");
> > +    }
> > +
> > +    public void testSOAPService() throws Exception {
> > +        Map<String, Object> serviceContext = FastMap.newInstance();
> > +        GenericValue productCategory =  
> > delegator.makeValue("ProductCategory");
> > +        productCategory.put("productCategoryId", "PRODCAT_TEST");
> > +        productCategory.put("productCategoryTypeId",  
> > "CATALOG_CATEGORY");
> > +        productCategory.put("categoryName", "Test ProductCategory");
> > +        productCategory.put("createdStamp",  
> > UtilDateTime.nowTimestamp());
> > +        serviceContext.put("productCategory", productCategory);
> > +        Map<String, Object> results =  
> > dispatcher.runSync("testSoap", serviceContext);
> > +        List<GenericValue> products = (List<GenericValue>)  
> > results.get("products");
> > +        assertNotNull(products);
> > +    }
> > +}
> >
> > Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> > ServiceSOAPTests.java
> > ------------------------------------------------------------------------------
> >    svn:eol-style = native
> >
> > Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> > ServiceSOAPTests.java
> > ------------------------------------------------------------------------------
> >    svn:keywords = "Date Rev Author URL Id"
> >
> > Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> > ServiceSOAPTests.java
> > ------------------------------------------------------------------------------
> >    svn:mime-type = text/plain
> >
> > Modified: ofbiz/trunk/framework/service/testdef/servicetests.xml
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/testdef/servicetests.xml?rev=892712&r1=892711&r2=892712&view=diff
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > --- ofbiz/trunk/framework/service/testdef/servicetests.xml (original)
> > +++ ofbiz/trunk/framework/service/testdef/servicetests.xml Mon Dec  
> > 21 07:31:58 2009
> > @@ -22,6 +22,7 @@
> >         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd 
> > ">
> >     <test-case case-name="service-tests"><junit-test-suite class- 
> > name="org.ofbiz.service.test.ServiceEngineTests"/></test-case>
> > +    <test-case case-name="service-soap-tests"><junit-test-suite  
> > class-name="org.ofbiz.service.test.ServiceSOAPTests"/></test-case>
> >
> >     <test-case case-name="load-service-test-data">
> >         <entity-xml action="load" entity-xml-url="component:// 
> > service/testdef/data/ServiceTestData.xml"/>
> >
> > Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ 
> > SOAPEventHandler.java
> > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java?rev=892712&r1=892711&r2=892712&view=diff
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > = 
> > ======================================================================
> > --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ 
> > SOAPEventHandler.java (original)
> > +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ 
> > SOAPEventHandler.java Mon Dec 21 07:31:58 2009
> > @@ -18,33 +18,35 @@
> >   
> > *******************************************************************************/
> > package org.ofbiz.webapp.event;
> >
> > -import java.io.ByteArrayOutputStream;
> > import java.io.IOException;
> > import java.io.OutputStream;
> > +import java.io.StringReader;
> > import java.io.Writer;
> > -import java.util.List;
> > +import java.util.Iterator;
> > import java.util.Map;
> >
> > import javax.servlet.ServletContext;
> > import javax.servlet.http.HttpServletRequest;
> > import javax.servlet.http.HttpServletResponse;
> > import javax.wsdl.WSDLException;
> > -import javax.xml.soap.SOAPException;
> > +import javax.xml.namespace.QName;
> > +import javax.xml.stream.XMLInputFactory;
> > +import javax.xml.stream.XMLStreamReader;
> >
> > import javolution.util.FastMap;
> >
> > -import org.apache.axis.AxisFault;
> > -import org.apache.axis.Constants;
> > -import org.apache.axis.Message;
> > -import org.apache.axis.MessageContext;
> > -import org.apache.axis.message.RPCElement;
> > -import org.apache.axis.message.RPCParam;
> > -import org.apache.axis.message.SOAPEnvelope;
> > -import org.apache.axis.server.AxisServer;
> > +import org.apache.axiom.om.OMAbstractFactory;
> > +import org.apache.axiom.om.OMElement;
> > +import org.apache.axiom.om.impl.builder.StAXOMBuilder;
> > +import org.apache.axiom.om.util.StAXUtils;
> > +import org.apache.axiom.soap.SOAPBody;
> > +import org.apache.axiom.soap.SOAPEnvelope;
> > +import org.apache.axiom.soap.SOAPFactory;
> > +import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
> > import org.ofbiz.base.util.Debug;
> > -import org.ofbiz.base.util.UtilGenerics;
> > -import org.ofbiz.base.util.UtilMisc;
> > import org.ofbiz.base.util.UtilXml;
> > +import org.ofbiz.entity.GenericDelegator;
> > +import org.ofbiz.entity.serialize.XmlSerializer;
> > import org.ofbiz.service.DispatchContext;
> > import org.ofbiz.service.GenericServiceException;
> > import org.ofbiz.service.LocalDispatcher;
> > @@ -72,7 +74,7 @@
> >      */
> >     public String invoke(Event event, RequestMap requestMap,  
> > HttpServletRequest request, HttpServletResponse response) throws  
> > EventHandlerException {
> >         LocalDispatcher dispatcher = (LocalDispatcher)  
> > request.getAttribute("dispatcher");
> > -        AxisServer axisServer;
> > +        GenericDelegator delegator = (GenericDelegator)  
> > request.getAttribute("delegator");
> >
> >         // first check for WSDL request
> >         String wsdlReq = request.getParameter("wsdl");
> > @@ -138,163 +140,119 @@
> >         }
> >
> >         // not a wsdl request; invoke the service
> > -        try {
> > -            axisServer =  
> > AxisServer.getServer(UtilMisc.toMap("name", "OFBiz/Axis Server",  
> > "provider", null));
> > -        } catch (AxisFault e) {
> > -            sendError(response, e);
> > -            throw new EventHandlerException("Problems with the AXIS  
> > server", e);
> > -        }
> > -        MessageContext mctx = new MessageContext(axisServer);
> > -        mctx.setEncodingStyle(Constants.URI_LITERAL_ENC); // sets  
> > the response encoding
> > -
> > -        // get the SOAP message
> > -        Message msg = null;
> > -
> > -        try {
> > -            msg = new Message(request.getInputStream(), false,
> > -                        request.getHeader("Content-Type"),  
> > request.getHeader("Content-Location"));
> > -        } catch (IOException ioe) {
> > -            sendError(response, "Problem processing the service");
> > -            throw new EventHandlerException("Cannot read the input  
> > stream", ioe);
> > -        }
> > -
> > -        if (msg == null) {
> > -            sendError(response, "No message");
> > -            throw new EventHandlerException("SOAP Message is null");
> > -        }
> > -
> > -        // log the request message
> > -        if (Debug.verboseOn()) {
> > -            try {
> > -                Debug.logInfo("Request Message:\n" +  
> > messageToString(msg) + "\n", module);
> > -            } catch (Throwable t) {
> > -            }
> > -        }
> > -
> > -        mctx.setRequestMessage(msg);
> > -
> > -        // new envelopes
> > -        SOAPEnvelope resEnv = new SOAPEnvelope();
> > +
> > +        // request envelope
> >         SOAPEnvelope reqEnv = null;
> > -
> > +
> >         // get the service name and parameters
> >         try {
> > -            reqEnv = (SOAPEnvelope) msg.getSOAPPart().getEnvelope();
> > -        } catch (SOAPException e) {
> > +            XMLStreamReader xmlReader =  
> > StAXUtils.createXMLStreamReader(request.getInputStream());
> > +            StAXSOAPModelBuilder builder = new  
> > StAXSOAPModelBuilder(xmlReader);
> > +            reqEnv = (SOAPEnvelope) builder.getDocumentElement();
> > +
> > +            // log the request message
> > +            if (Debug.verboseOn()) {
> > +                try {
> > +                    Debug.logInfo("Request Message:\n" + reqEnv +  
> > "\n", module);
> > +                } catch (Throwable t) {
> > +                }
> > +            }
> > +        } catch (Exception e) {
> >             sendError(response, "Problem processing the service");
> >             throw new EventHandlerException("Cannot get the  
> > envelope", e);
> >         }
> > -
> > -        List<Object> bodies = null;
> > -
> > -        try {
> > -            bodies =  
> > UtilGenerics.checkList(reqEnv.getBodyElements());
> > -        } catch (AxisFault e) {
> > -            sendError(response, e);
> > -            throw new EventHandlerException(e.getMessage(), e);
> > -        }
> > -
> > +
> >         Debug.logVerbose("[Processing]: SOAP Event", module);
> > +
> > +        try {
> > +            // each is a different service call
> > +            SOAPBody reqBody = reqEnv.getBody();
> > +            Iterator serviceIter = reqBody.getChildElements();
> > +            while (serviceIter.hasNext()) {
> > +                Object serviceObj = serviceIter.next();
> > +                if (serviceObj instanceof OMElement) {
> > +                    OMElement serviceElement = (OMElement)  
> > serviceObj;
> > +                    String serviceName =  
> > serviceElement.getLocalName();
> > +                    Map<String, Object> parameters = (Map<String,  
> > Object>) XmlSerializer.deserialize(serviceElement.toString(),  
> > delegator);
> > +                    try {
> > +                        // verify the service is exported for  
> > remote execution and invoke it
> > +                        ModelService model =  
> > dispatcher.getDispatchContext().getModelService(serviceName);
> >
> > -        // each is a different service call
> > -        for (Object o: bodies) {
> > -
> > -            if (o instanceof RPCElement) {
> > -                RPCElement body = (RPCElement) o;
> > -                String serviceName = body.getMethodName();
> > -                List<RPCParam> params = null;
> > -                try {
> > -                    params =  
> > UtilGenerics.checkList(body.getParams());
> > -                } catch (Exception e) {
> > -                    sendError(response, e);
> > -                    throw new EventHandlerException(e.getMessage(),  
> > e);
> > -                }
> > -                Map<String, Object> serviceContext =  
> > FastMap.newInstance();
> > -                for (RPCParam param: params) {
> > -                    if (Debug.verboseOn())  
> > Debug.logVerbose("[Reading Param]: " + param.getName(), module);
> > -                    serviceContext.put(param.getName(),  
> > param.getObjectValue());
> > -                }
> > -                try {
> > -                    // verify the service is exported for remote  
> > execution and invoke it
> > -                    ModelService model =  
> > dispatcher.getDispatchContext().getModelService(serviceName);
> > -
> > -                    if (model != null && model.export) {
> > -                        Map<String, Object> result =  
> > dispatcher.runSync(serviceName, serviceContext);
> > -
> > -                        Debug.logVerbose("[EventHandler] : Service  
> > invoked", module);
> > -                        RPCElement resBody = new  
> > RPCElement(serviceName + "Response");
> > -
> > -                        resBody.setPrefix(body.getPrefix());
> > -                         
> > resBody.setNamespaceURI(body.getNamespaceURI());
> > -
> > -                        for (Map.Entry<String, Object> entry:  
> > result.entrySet()) {
> > -                            RPCParam par = new  
> > RPCParam(entry.getKey(), entry.getValue());
> > +                        if (model != null && model.export) {
> > +                            Map<String, Object> results =  
> > dispatcher.runSync(serviceName, parameters);
> > +                            Debug.logVerbose("[EventHandler] :  
> > Service invoked", module);
> > +
> > +                            // setup the response
> > +                            Debug.logVerbose("[EventHandler] :  
> > Setting up response message", module);
> > +                            String xmlResults =  
> > XmlSerializer.serialize(results);
> > +                            XMLStreamReader reader =  
> > XMLInputFactory.newInstance().createXMLStreamReader(new  
> > StringReader(xmlResults));
> > +                            StAXOMBuilder resultsBuilder = new  
> > StAXOMBuilder(reader);
> > +                            OMElement resultSer =  
> > resultsBuilder.getDocumentElement();
> > +
> > +                            // create the response soap
> > +                            SOAPFactory factory =  
> > OMAbstractFactory.getSOAP11Factory();
> > +                            SOAPEnvelope resEnv =  
> > factory.createSOAPEnvelope();
> > +                            SOAPBody resBody =  
> > factory.createSOAPBody();
> > +                            OMElement resService =  
> > factory.createOMElement(new QName(serviceName + "Response"));
> > +                             
> > resService.addChild(resultSer.getFirstElement());
> > +                            resBody.addChild(resService);
> > +                            resEnv.addChild(resBody);
> > +
> > +                            // log the response message
> > +                            if (Debug.verboseOn()) {
> > +                                try {
> > +                                    Debug.log("Response Message:\n"  
> > + resEnv + "\n", module);
> > +                                } catch (Throwable t) {
> > +                                }
> > +                            }
> >
> > -                            resBody.addParam(par);
> > +                             
> > resEnv.serialize(response.getOutputStream());
> > +                            response.getOutputStream().flush();
> >                         }
> > -                        resEnv.addBodyElement(resBody);
> > -                         
> > resEnv.setEncodingStyle(Constants.URI_LITERAL_ENC);
> > -                    } else {
> > -                        sendError(response, "Requested service not  
> > available");
> > -                        throw new EventHandlerException("Service is  
> > not exported");
> > +
> > +                    } catch (GenericServiceException e) {
> > +                        sendError(response, "Problem processing the  
> > service");
> > +                        throw new  
> > EventHandlerException(e.getMessage(), e);
> >                     }
> > -                } catch (GenericServiceException e) {
> > -                    sendError(response, "Problem processing the  
> > service");
> > -                    throw new EventHandlerException(e.getMessage(),  
> > e);
> > -                } catch (javax.xml.soap.SOAPException e) {
> > -                    sendError(response, "Problem processing the  
> > service");
> > -                    throw new EventHandlerException(e.getMessage(),  
> > e);
> >                 }
> >             }
> > -        }
> > -
> > -        // setup the response
> > -        Debug.logVerbose("[EventHandler] : Setting up response  
> > message", module);
> > -        msg = new Message(resEnv);
> > -        mctx.setResponseMessage(msg);
> > -        if (msg == null) {
> > -            sendError(response, "No response message available");
> > -            throw new EventHandlerException("No response message  
> > available");
> > -        }
> > -
> > -        // log the response message
> > -        if (Debug.verboseOn()) {
> > -            try {
> > -                Debug.log("Response Message:\n" +  
> > messageToString(msg) + "\n", module);
> > -            } catch (Throwable t) {
> > -            }
> > -        }
> > -
> > -        try {
> > -             
> > response 
> > .setContentType(msg.getContentType(Constants.DEFAULT_SOAP_VERSION));
> > -             
> > response 
> > .setContentLength 
> > (Integer.parseInt(Long.toString(msg.getContentLength())));
> > -        } catch (AxisFault e) {
> > -            sendError(response, e);
> > +        } catch (Exception e) {
> > +            sendError(response, e.getMessage());
> >             throw new EventHandlerException(e.getMessage(), e);
> >         }
> > -
> > -        try {
> > -            msg.writeTo(response.getOutputStream());
> > -            response.flushBuffer();
> > -        } catch (IOException e) {
> > -            throw new EventHandlerException("Cannot write to the  
> > output stream");
> > -        } catch (SOAPException e) {
> > -            throw new EventHandlerException("Cannot write message  
> > to the output stream");
> > -        }
> > -
> > -        Debug.logVerbose("[EventHandler] : Message sent to  
> > requester", module);
> > -
> > +
> >         return null;
> >     }
> >
> > -    private void sendError(HttpServletResponse res, Object obj)  
> > throws EventHandlerException {
> > -        Message msg = new Message(obj);
> > -
> > +    private void sendError(HttpServletResponse res, String  
> > errorMessage) throws EventHandlerException {
> >         try {
> > -             
> > res 
> > .setContentType(msg.getContentType(Constants.DEFAULT_SOAP_VERSION));
> > -             
> > res 
> > .setContentLength 
> > (Integer.parseInt(Long.toString(msg.getContentLength())));
> > -            msg.writeTo(res.getOutputStream());
> > -            res.flushBuffer();
> > +            // setup the response
> > +            Map<String, Object> results = FastMap.newInstance();
> > +            results.put("errorMessage", errorMessage);
> > +            String xmlResults= XmlSerializer.serialize(results);
> > +            XMLStreamReader xmlReader =  
> > XMLInputFactory.newInstance().createXMLStreamReader(new  
> > StringReader(xmlResults));
> > +            StAXOMBuilder resultsBuilder = new  
> > StAXOMBuilder(xmlReader);
> > +            OMElement resultSer =  
> > resultsBuilder.getDocumentElement();
> > +
> > +            // create the response soap
> > +            SOAPFactory factory =  
> > OMAbstractFactory.getSOAP11Factory();
> > +            SOAPEnvelope resEnv = factory.createSOAPEnvelope();
> > +            SOAPBody resBody = factory.createSOAPBody();
> > +            OMElement errMsg = factory.createOMElement(new  
> > QName("Response"));
> > +            errMsg.addChild(resultSer.getFirstElement());
> > +            resBody.addChild(errMsg);
> > +            resEnv.addChild(resBody);
> > +
> > +            // log the response message
> > +            if (Debug.verboseOn()) {
> > +                try {
> > +                    Debug.log("Response Message:\n" + resEnv +  
> > "\n", module);
> > +                } catch (Throwable t) {
> > +                }
> > +            }
> > +
> > +            resEnv.serialize(res.getOutputStream());
> > +            res.getOutputStream().flush();
> >         } catch (Exception e) {
> >             throw new EventHandlerException(e.getMessage(), e);
> >         }
> > @@ -320,10 +278,4 @@
> >         uri.append(reqInfo);
> >         return uri.toString();
> >     }
> > -
> > -    public static String messageToString(Message msg) throws  
> > SOAPException, IOException {
> > -        ByteArrayOutputStream out = new ByteArrayOutputStream();
> > -        msg.writeTo(out);
> > -        return out.toString();
> > -    }
> > }
> >
> >
> 
-- 
Antwebsystems.com: Quality OFBiz services for competitive rates


Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Posted by Scott Gray <sc...@hotwaxmedia.com>.
Hi Hans,

Thanks for committing some tests, it's great to see.

One small issue though, the test introduces a dependency on the  
product data model from common and the service engine, this means the  
test would fail in a framework only installation.  I would suggest  
switching the entity over to TestingNode which along with the other  
entities in framework/entity/entitydef/entitymodel_test.xml are  
provided for testing the lower level tools.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 21/12/2009, at 8:32 PM, hansbak@apache.org wrote:

> Author: hansbak
> Date: Mon Dec 21 07:31:58 2009
> New Revision: 892712
>
> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
> Log:
> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in  
> webservices including WSDL generation. see OFBIZ-3363 for more info.  
> A contribution of Antwebsystems employee Chatree
>
> Added:
>    ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with  
> props)
>    ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with  
> props)
>    ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with  
> props)
>    ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with  
> props)
>    ofbiz/trunk/framework/service/lib/axis2-transport- 
> http-1.5.1.jar   (with props)
>    ofbiz/trunk/framework/service/lib/axis2-transport- 
> local-1.5.1.jar   (with props)
>    ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar    
> (with props)
>    ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
>    ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> ServiceSOAPTests.java   (with props)
> Modified:
>    ofbiz/trunk/LICENSE
>    ofbiz/trunk/framework/common/servicedef/services_test.xml
>    ofbiz/trunk/framework/common/src/org/ofbiz/common/ 
> CommonServices.java
>    ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
>    ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> ModelService.java
>    ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/ 
> SOAPClientEngine.java
>    ofbiz/trunk/framework/service/testdef/servicetests.xml
>    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ 
> SOAPEventHandler.java
>
> Modified: ofbiz/trunk/LICENSE
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=892712&r1=892711&r2=892712&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/LICENSE (original)
> +++ ofbiz/trunk/LICENSE Mon Dec 21 07:31:58 2009
> @@ -87,6 +87,14 @@
> ofbiz/trunk/framework/jetty/lib/xmlParserAPIs-2.6.2.jar
> ofbiz/trunk/framework/service/lib/axis-ant.jar
> ofbiz/trunk/framework/service/lib/axis.jar
> +ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
> +ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
> +ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
> +ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar
> +ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar
> +ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
> +ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
> +ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
> ofbiz/trunk/framework/webapp/lib/fop-0.95.jar
> ofbiz/trunk/framework/webapp/lib/velocity-1.6.1.jar
> ofbiz/trunk/framework/webapp/lib/xmlgraphics-commons-1.3.1.jar
>
> Modified: ofbiz/trunk/framework/common/servicedef/services_test.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services_test.xml?rev=892712&r1=892711&r2=892712&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/framework/common/servicedef/services_test.xml  
> (original)
> +++ ofbiz/trunk/framework/common/servicedef/services_test.xml Mon  
> Dec 21 07:31:58 2009
> @@ -31,6 +31,12 @@
>         <attribute name="message" type="String" mode="IN"  
> optional="true"/>
>         <attribute name="resp" type="String" mode="OUT"/>
>     </service>
> +    <service name="testSOAPScv" engine="java" export="true"  
> validate="false" require-new-transaction="true"
> +            location="org.ofbiz.common.CommonServices"  
> invoke="testSOAPService">
> +        <description>Test SOAP service</description>
> +        <attribute name="productCategory"  
> type="org.ofbiz.entity.GenericValue" mode="IN" optional="false"/>
> +        <attribute name="products" type="List" mode="OUT"  
> optional="true"/>
> +    </service>
>     <service name="blockingTestScv" engine="java" export="true"  
> validate="false" require-new-transaction="true" transaction- 
> timeout="20"
>             location="org.ofbiz.common.CommonServices"  
> invoke="blockingTestService">
>         <description>Blocking Test service</description>
> @@ -84,10 +90,15 @@
>     </service>
>
>     <service name="testSoap" engine="soap" export="true"
> +            location="http://localhost:8080/webtools/control/SOAPService 
> " invoke="testSOAPScv">
> +        <description>SOAP service; calls the OFBiz test SOAP  
> service</description>
> +        <implements service="testSOAPScv"/>
> +    </service>
> +
> +    <service name="testSoapSimple" engine="soap" export="true"
>             location="http://localhost:8080/webtools/control/SOAPService 
> " invoke="testScv">
> -        <description>Test SOAP service; calls the OFBiz test  
> service</description>
> -        <attribute name="message" type="String" mode="IN"  
> optional="true"/>
> -        <attribute name="resp" type="String" mode="OUT"/>
> +        <description>simple SOAP service; calls the OFBiz test  
> service</description>
> +        <implements service="testScv"/>
>     </service>
>
>     <service name="testRemoteSoap" engine="soap" export="true"
>
> Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/ 
> CommonServices.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java?rev=892712&r1=892711&r2=892712&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/framework/common/src/org/ofbiz/common/ 
> CommonServices.java (original)
> +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/ 
> CommonServices.java Mon Dec 21 07:31:58 2009
> @@ -26,6 +26,7 @@
> import javax.mail.internet.MimeMessage;
> import javax.transaction.xa.XAException;
>
> +import javolution.util.FastList;
> import javolution.util.FastMap;
>
> import org.apache.log4j.Level;
> @@ -84,6 +85,32 @@
>         System.out.println("----- SVC: " + dctx.getName() + " -----");
>         return response;
>     }
> +
> +    /**
> +     * Generic Test SOAP Service
> +     *@param dctx The DispatchContext that this service is  
> operating in
> +     *@param context Map containing the input parameters
> +     *@return Map with the result of the service, the output  
> parameters
> +     */
> +    public static Map<String, Object>  
> testSOAPService(DispatchContext dctx, Map<String, ?> context) {
> +        Delegator delegator = dctx.getDelegator();
> +        Map<String, Object> response = ServiceUtil.returnSuccess();
> +
> +        GenericValue productCategory = (GenericValue)  
> context.get("productCategory");
> +        List<GenericValue> products = FastList.newInstance();
> +        for (int i = 0; i < 3; i ++) {
> +            GenericValue product = delegator.makeValue("Product");
> +            product.put("productId", "PROD_TEST" + i);
> +            product.put("productTypeId", "FINISHED_GOOD");
> +            product.put("primaryProductCategoryId", "202");
> +            product.put("internalName", "Product Test " + i);
> +            product.put("productName", "Product Test " + i);
> +            product.put("createdStamp", UtilDateTime.nowTimestamp());
> +            products.add(product);
> +        }
> +        response.put("products", products);
> +        return response;
> +    }
>
>     public static Map<String, Object>  
> blockingTestService(DispatchContext dctx, Map<String, ?> context) {
>         Long duration = (Long) context.get("duration");
>
> Added: ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar?rev=892712&view=auto
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> Binary file - no diff available.
>
> Propchange: ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar
> ------------------------------------------------------------------------------
>    svn:mime-type = application/octet-stream
>
> Added: ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar?rev=892712&view=auto
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> Binary file - no diff available.
>
> Propchange: ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar
> ------------------------------------------------------------------------------
>    svn:mime-type = application/octet-stream
>
> Added: ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar?rev=892712&view=auto
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> Binary file - no diff available.
>
> Propchange: ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar
> ------------------------------------------------------------------------------
>    svn:mime-type = application/octet-stream
>
> Added: ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar?rev=892712&view=auto
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> Binary file - no diff available.
>
> Propchange: ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar
> ------------------------------------------------------------------------------
>    svn:mime-type = application/octet-stream
>
> Added: ofbiz/trunk/framework/service/lib/axis2-transport- 
> http-1.5.1.jar
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar?rev=892712&view=auto
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> Binary file - no diff available.
>
> Propchange: ofbiz/trunk/framework/service/lib/axis2-transport- 
> http-1.5.1.jar
> ------------------------------------------------------------------------------
>    svn:mime-type = application/octet-stream
>
> Added: ofbiz/trunk/framework/service/lib/axis2-transport- 
> local-1.5.1.jar
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar?rev=892712&view=auto
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> Binary file - no diff available.
>
> Propchange: ofbiz/trunk/framework/service/lib/axis2-transport- 
> local-1.5.1.jar
> ------------------------------------------------------------------------------
>    svn:mime-type = application/octet-stream
>
> Added: ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar?rev=892712&view=auto
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> Binary file - no diff available.
>
> Propchange: ofbiz/trunk/framework/service/lib/commons- 
> httpclient-3.1.jar
> ------------------------------------------------------------------------------
>    svn:mime-type = application/octet-stream
>
> Added: ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar?rev=892712&view=auto
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> Binary file - no diff available.
>
> Propchange: ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar
> ------------------------------------------------------------------------------
>    svn:mime-type = application/octet-stream
>
> Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> ModelParam.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java?rev=892712&r1=892711&r2=892712&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> ModelParam.java (original)
> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> ModelParam.java Mon Dec 21 07:31:58 2009
> @@ -207,47 +207,56 @@
>     public Part getWSDLPart(Definition def) throws WSDLException {
>         Part part = def.createPart();
>         part.setName(this.name);
> -        part.setTypeName(new QName(ModelService.XSD,  
> this.java2wsdlType()));
> +        part.setTypeName(new QName(ModelService.TNS,  
> this.java2wsdlType()));
>         return part;
>     }
>
>     protected String java2wsdlType() throws WSDLException {
>         if (ObjectType.instanceOf(java.lang.Character.class,  
> this.type)) {
> -            return "string";
> +            return "std-String";
>         } else if (ObjectType.instanceOf(java.lang.String.class,  
> this.type)) {
> -            return "string";
> +            return "std-String";
>         } else if (ObjectType.instanceOf(java.lang.Byte.class,  
> this.type)) {
> -            return "byte";
> +            return "std-String";
>         } else if (ObjectType.instanceOf(java.lang.Boolean.class,  
> this.type)) {
> -            return "boolean";
> +            return "std-Boolean";
>         } else if (ObjectType.instanceOf(java.lang.Integer.class,  
> this.type)) {
> -            return "int";
> +            return "std-Integer";
>         } else if (ObjectType.instanceOf(java.lang.Double.class,  
> this.type)) {
> -            return "double";
> +            return "std-Double";
>         } else if (ObjectType.instanceOf(java.lang.Float.class,  
> this.type)) {
> -            return "float";
> +            return "std-Float";
>         } else if (ObjectType.instanceOf(java.lang.Short.class,  
> this.type)) {
> -            return "short";
> +            return "std-Integer";
>         } else if (ObjectType.instanceOf(java.math.BigDecimal.class,  
> this.type)) {
> -            return "decimal";
> +            return "std-Long";
>         } else if (ObjectType.instanceOf(java.math.BigInteger.class,  
> this.type)) {
> -            return "integer";
> +            return "std-Integer";
>         } else if (ObjectType.instanceOf(java.util.Calendar.class,  
> this.type)) {
> -            return "dateTime";
> +            return "sql-Timestamp";
>         } else if  
> (ObjectType.instanceOf(com.ibm.icu.util.Calendar.class, this.type)) {
> -            return "dateTime";
> +            return "sql-Timestamp";
>         } else if (ObjectType.instanceOf(java.sql.Date.class,  
> this.type)) {
> -            return "date";
> +            return "sql-Date";
>         } else if (ObjectType.instanceOf(java.util.Date.class,  
> this.type)) {
> -            return "dateTime";
> +            return "sql-Timestamp";
>         } else if (ObjectType.instanceOf(java.lang.Long.class,  
> this.type)) {
> -            return "unsignedInt";
> +            return "std-Long";
>         } else if (ObjectType.instanceOf(java.sql.Timestamp.class,  
> this.type)) {
> -            return "string";
> +            return "sql-Timestamp";
> +        } else if  
> (ObjectType.instanceOf(org.ofbiz.entity.GenericValue.class,  
> this.type)) {
> +            return "eeval-";
> +        } else if  
> (ObjectType.instanceOf(org.ofbiz.entity.GenericPK.class, this.type)) {
> +            return "eepk-";
> +        } else if (ObjectType.instanceOf(java.util.Map.class,  
> this.type)) {
> +            return "map-Map";
> +        } else if (ObjectType.instanceOf(java.util.List.class,  
> this.type)) {
> +            return "col-LinkedList";
> +        } else {
> +            return "cus-obj";
>         }
>
> -        // TODO add array support (maybe even convert List  
> objects); add GenericValue/Map support
> -        throw new WSDLException(WSDLException.OTHER_ERROR, "Service  
> cannot be described with WSDL (" + this.name + " / " + this.type +  
> ")");
> +        //throw new WSDLException(WSDLException.OTHER_ERROR,  
> "Service cannot be described with WSDL (" + this.name + " / " +  
> this.type + ")");
>     }
>
>     static class ModelParamValidator implements Serializable {
>
> Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> ModelService.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java?rev=892712&r1=892711&r2=892712&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> ModelService.java (original)
> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ 
> ModelService.java Mon Dec 21 07:31:58 2009
> @@ -41,9 +41,11 @@
> import javax.wsdl.Message;
> import javax.wsdl.Operation;
> import javax.wsdl.Output;
> +import javax.wsdl.Part;
> import javax.wsdl.Port;
> import javax.wsdl.PortType;
> import javax.wsdl.Service;
> +import javax.wsdl.Types;
> import javax.wsdl.WSDLException;
> import javax.wsdl.extensions.soap.SOAPAddress;
> import javax.wsdl.extensions.soap.SOAPBinding;
> @@ -51,6 +53,8 @@
> import javax.wsdl.extensions.soap.SOAPOperation;
> import javax.wsdl.factory.WSDLFactory;
> import javax.xml.namespace.QName;
> +import javax.xml.parsers.DocumentBuilder;
> +import javax.xml.parsers.DocumentBuilderFactory;
>
> import javolution.util.FastList;
> import javolution.util.FastMap;
> @@ -66,6 +70,7 @@
> import org.ofbiz.service.group.GroupServiceModel;
> import org.ofbiz.service.group.ServiceGroupReader;
> import org.w3c.dom.Document;
> +import org.w3c.dom.Element;
>
> import com.ibm.wsdl.extensions.soap.SOAPAddressImpl;
> import com.ibm.wsdl.extensions.soap.SOAPBindingImpl;
> @@ -1189,6 +1194,18 @@
> }
>
>     public void getWSDL(Definition def, String locationURI) throws  
> WSDLException {
> +
> +        DocumentBuilderFactory factory =  
> DocumentBuilderFactory.newInstance();
> +        DocumentBuilder builder = null;
> +        Document document = null;
> +        try {
> +            builder = factory.newDocumentBuilder();
> +            document = builder.newDocument();
> +        } catch (Exception e) {
> +            throw new WSDLException("can not create WSDL", module);
> +        }
> +        def.setTypes(this.getTypes(document, def));
> +
>         // set the IN parameters
>         Input input = def.createInput();
>         Set<String> inParam = this.getInParamNames();
> @@ -1196,12 +1213,25 @@
>             Message inMessage = def.createMessage();
>             inMessage.setQName(new QName(TNS, this.name + "Request"));
>             inMessage.setUndefined(false);
> +            Part parametersPart = def.createPart();
> +            parametersPart.setName("map-Map");
> +            parametersPart.setTypeName(new QName(TNS, "map-Map"));
> +            inMessage.addPart(parametersPart);
> +            Element documentation =  
> document.createElement("wsdl:documentation");
>             for (String paramName: inParam) {
>                 ModelParam param = this.getParam(paramName);
>                 if (!param.internal) {
> -                    inMessage.addPart(param.getWSDLPart(def));
> +                    Part part = param.getWSDLPart(def);
> +                    Element attribute =  
> document.createElement("attribute");
> +                    attribute.setAttribute("name", paramName);
> +                    attribute.setAttribute("type",  
> part.getTypeName().getLocalPart());
> +                    attribute.setAttribute("namespace",  
> part.getTypeName().getNamespaceURI());
> +                    attribute.setAttribute("java-class", param.type);
> +                    attribute.setAttribute("optional",  
> Boolean.toString(param.optional));
> +                    documentation.appendChild(attribute);
>                 }
>             }
> +            parametersPart.setDocumentationElement(documentation);
>             def.addMessage(inMessage);
>             input.setMessage(inMessage);
>         }
> @@ -1213,12 +1243,25 @@
>             Message outMessage = def.createMessage();
>             outMessage.setQName(new QName(TNS, this.name +  
> "Response"));
>             outMessage.setUndefined(false);
> +            Part resultsPart = def.createPart();
> +            resultsPart.setName("map-Map");
> +            resultsPart.setTypeName(new QName(TNS, "map-Map"));
> +            outMessage.addPart(resultsPart);
> +            Element documentation =  
> document.createElement("wsdl:documentation");
>             for (String paramName: outParam) {
>                 ModelParam param = this.getParam(paramName);
>                 if (!param.internal) {
> -                    outMessage.addPart(param.getWSDLPart(def));
> +                    Part part = param.getWSDLPart(def);
> +                    Element attribute =  
> document.createElement("attribute");
> +                    attribute.setAttribute("name", paramName);
> +                    attribute.setAttribute("type",  
> part.getTypeName().getLocalPart());
> +                    attribute.setAttribute("namespace",  
> part.getTypeName().getNamespaceURI());
> +                    attribute.setAttribute("java-class", param.type);
> +                    attribute.setAttribute("optional",  
> Boolean.toString(param.optional));
> +                    documentation.appendChild(attribute);
>                 }
>             }
> +            resultsPart.setDocumentationElement(documentation);
>             def.addMessage(outMessage);
>             output.setMessage(outMessage);
>         }
> @@ -1291,4 +1334,410 @@
>         service.addPort(port);
>         def.addService(service);
>     }
> +
> +    public Types getTypes(Document document, Definition def) {
> +        Types types = def.createTypes();
> +        /* Schema */
> +        Element schema = document.createElement("xsd:schema");
> +        schema.setAttribute("targetNamespace", TNS);
> +
> +        /*-----------------------------------*/
> +        /*--------- Standard Objects --------*/
> +        /*-----------------------------------*/
> +
> +        /* std-String Element */
> +        Element stdStringElement =  
> document.createElement("xsd:element");
> +        stdStringElement.setAttribute("name", "std-String");
> +        Element stdStringElement0 =  
> document.createElement("xsd:complexType");
> +        stdStringElement.appendChild(stdStringElement0);
> +        Element stdStringElement1 =  
> document.createElement("xsd:attribute");
> +        stdStringElement0.appendChild(stdStringElement1);
> +        stdStringElement1.setAttribute("name", "value");
> +        stdStringElement1.setAttribute("type", "xsd:string");
> +        stdStringElement1.setAttribute("use", "required");
> +        schema.appendChild(stdStringElement);
> +        /* std-Integer Element */
> +        Element stdIntegerElement =  
> document.createElement("xsd:element");
> +        stdIntegerElement.setAttribute("name", "std-Integer");
> +        Element stdIntegerElement0 =  
> document.createElement("xsd:complexType");
> +        stdIntegerElement.appendChild(stdIntegerElement0);
> +        Element stdIntegerElement1 =  
> document.createElement("xsd:attribute");
> +        stdIntegerElement0.appendChild(stdIntegerElement1);
> +        stdIntegerElement1.setAttribute("name", "value");
> +        stdIntegerElement1.setAttribute("type", "xsd:integer");
> +        stdIntegerElement1.setAttribute("use", "required");
> +        schema.appendChild(stdIntegerElement);
> +        /* std-Long Element */
> +        Element stdLongElement =  
> document.createElement("xsd:element");
> +        stdLongElement.setAttribute("name", "std-Long");
> +        Element stdLongElement0 =  
> document.createElement("xsd:complexType");
> +        stdLongElement.appendChild(stdLongElement0);
> +        Element stdLongElement1 =  
> document.createElement("xsd:attribute");
> +        stdLongElement0.appendChild(stdLongElement1);
> +        stdLongElement1.setAttribute("name", "value");
> +        stdLongElement1.setAttribute("type", "xsd:long");
> +        stdLongElement1.setAttribute("use", "required");
> +        schema.appendChild(stdLongElement);
> +        /* std-Float Element */
> +        Element stdFloatElement =  
> document.createElement("xsd:element");
> +        stdFloatElement.setAttribute("name", "std-Float");
> +        Element stdFloatElement0 =  
> document.createElement("xsd:complexType");
> +        stdFloatElement.appendChild(stdFloatElement0);
> +        Element stdFloatElement1 =  
> document.createElement("xsd:attribute");
> +        stdFloatElement0.appendChild(stdFloatElement1);
> +        stdFloatElement1.setAttribute("name", "value");
> +        stdFloatElement1.setAttribute("type", "xsd:float");
> +        stdFloatElement1.setAttribute("use", "required");
> +        schema.appendChild(stdFloatElement);
> +        /* std-Double Element */
> +        Element stdDoubleElement =  
> document.createElement("xsd:element");
> +        stdDoubleElement.setAttribute("name", "std-Double");
> +        Element stdDoubleElement0 =  
> document.createElement("xsd:complexType");
> +        stdDoubleElement.appendChild(stdDoubleElement0);
> +        Element stdDoubleElement1 =  
> document.createElement("xsd:attribute");
> +        stdDoubleElement0.appendChild(stdDoubleElement1);
> +        stdDoubleElement1.setAttribute("name", "value");
> +        stdDoubleElement1.setAttribute("type", "xsd:double");
> +        stdDoubleElement1.setAttribute("use", "required");
> +        schema.appendChild(stdDoubleElement);
> +        /* std-Boolean Element */
> +        Element stdBooleanElement =  
> document.createElement("xsd:element");
> +        stdBooleanElement.setAttribute("name", "std-Boolean");
> +        Element stdBooleanElement0 =  
> document.createElement("xsd:complexType");
> +        stdBooleanElement.appendChild(stdBooleanElement0);
> +        Element stdBooleanElement1 =  
> document.createElement("xsd:attribute");
> +        stdBooleanElement0.appendChild(stdBooleanElement1);
> +        stdBooleanElement1.setAttribute("name", "value");
> +        stdBooleanElement1.setAttribute("type", "xsd:boolean");
> +        stdBooleanElement1.setAttribute("use", "required");
> +        schema.appendChild(stdBooleanElement);
> +        /* std-Locale Element */
> +        Element stdLocaleElement =  
> document.createElement("xsd:element");
> +        stdLocaleElement.setAttribute("name", "std-Locale");
> +        Element stdLocaleElement0 =  
> document.createElement("xsd:complexType");
> +        stdLocaleElement.appendChild(stdLocaleElement0);
> +        Element stdLocaleElement1 =  
> document.createElement("xsd:attribute");
> +        stdLocaleElement0.appendChild(stdLocaleElement1);
> +        stdLocaleElement1.setAttribute("name", "value");
> +        stdLocaleElement1.setAttribute("type", "xsd:string");
> +        stdLocaleElement1.setAttribute("use", "required");
> +        schema.appendChild(stdLocaleElement);
> +
> +        /*-----------------------------------*/
> +        /*----------- SQL Objects -----------*/
> +        /*-----------------------------------*/
> +
> +        /* sql-Timestamp Element */
> +        Element sqlTimestampElement =  
> document.createElement("xsd:element");
> +        sqlTimestampElement.setAttribute("name", "sql-Timestamp");
> +        Element sqlTimestampElement0 =  
> document.createElement("xsd:complexType");
> +        sqlTimestampElement.appendChild(sqlTimestampElement0);
> +        Element sqlTimestampElement1 =  
> document.createElement("xsd:attribute");
> +        sqlTimestampElement0.appendChild(sqlTimestampElement1);
> +        sqlTimestampElement1.setAttribute("name", "value");
> +        sqlTimestampElement1.setAttribute("type", "xsd:dateTime");
> +        sqlTimestampElement1.setAttribute("use", "required");
> +        schema.appendChild(sqlTimestampElement);
> +        /* sql-Date Element */
> +        Element sqlDateElement =  
> document.createElement("xsd:element");
> +        sqlDateElement.setAttribute("name", "sql-Date");
> +        Element sqlDateElement0 =  
> document.createElement("xsd:complexType");
> +        sqlDateElement.appendChild(sqlDateElement0);
> +        Element sqlDateElement1 =  
> document.createElement("xsd:attribute");
> +        sqlDateElement0.appendChild(sqlDateElement1);
> +        sqlDateElement1.setAttribute("name", "value");
> +        sqlDateElement1.setAttribute("type", "xsd:date");
> +        sqlDateElement1.setAttribute("use", "required");
> +        schema.appendChild(sqlDateElement);
> +        /* sql-Time Element */
> +        Element sqlTimeElement =  
> document.createElement("xsd:element");
> +        sqlTimeElement.setAttribute("name", "sql-Time");
> +        Element sqlTimeElement0 =  
> document.createElement("xsd:complexType");
> +        sqlTimeElement.appendChild(sqlTimeElement0);
> +        Element sqlTimeElement1 =  
> document.createElement("xsd:attribute");
> +        sqlTimeElement0.appendChild(sqlTimeElement1);
> +        sqlTimeElement1.setAttribute("name", "value");
> +        sqlTimeElement1.setAttribute("type", "xsd:time");
> +        sqlTimeElement1.setAttribute("use", "required");
> +        schema.appendChild(sqlTimeElement);
> +
> +        /*-----------------------------------*/
> +        /*----------- List Objects -----------*/
> +        /*-----------------------------------*/
> +
> +        /* col-ArrayList Element */
> +        Element colArrayListElement =  
> document.createElement("xsd:element");
> +        colArrayListElement.setAttribute("name", "col-ArrayList");
> +        schema.appendChild(colArrayListElement);
> +        /* col-LinkedList Element */
> +        Element colLinkedListElement =  
> document.createElement("xsd:element");
> +        colLinkedListElement.setAttribute("name", "col-LinkedList");
> +        schema.appendChild(colLinkedListElement);
> +        /* col-Stack Element */
> +        Element colStackElement =  
> document.createElement("xsd:element");
> +        colStackElement.setAttribute("name", "col-Stack");
> +        schema.appendChild(colStackElement);
> +        /* col-Vector Element */
> +        Element colVectorElement =  
> document.createElement("xsd:element");
> +        colVectorElement.setAttribute("name", "col-Vector");
> +        schema.appendChild(colVectorElement);
> +        /* col-TreeSet Element */
> +        Element colTreeSetElement =  
> document.createElement("xsd:element");
> +        colTreeSetElement.setAttribute("name", "col-TreeSet");
> +        schema.appendChild(colTreeSetElement);
> +        /* col-HashSet Element */
> +        Element colHashSetElement =  
> document.createElement("xsd:element");
> +        colHashSetElement.setAttribute("name", "col-HashSet");
> +        schema.appendChild(colHashSetElement);
> +        /* col-Collection Element */
> +        Element colCollectionElement =  
> document.createElement("xsd:element");
> +        colCollectionElement.setAttribute("name", "col-Collection");
> +        schema.appendChild(colCollectionElement);
> +
> +        /*-----------------------------------*/
> +        /*----------- Map Objects -----------*/
> +        /*-----------------------------------*/
> +
> +        /* map-TreeMap Element */
> +        Element mapTreeMapElement =  
> document.createElement("xsd:element");
> +        mapTreeMapElement.setAttribute("name", "map-TreeMap");
> +        mapTreeMapElement.setAttribute("type", "tns:map-Map");
> +        schema.appendChild(mapTreeMapElement);
> +        /* map-WeakHashMap Element */
> +        Element mapWeakHashMapElement =  
> document.createElement("xsd:element");
> +        mapWeakHashMapElement.setAttribute("name", "map- 
> WeakHashMap");
> +        mapWeakHashMapElement.setAttribute("type", "tns:map-Map");
> +        schema.appendChild(mapWeakHashMapElement);
> +        /* map-Hashtable Element */
> +        Element mapHashtableElement =  
> document.createElement("xsd:element");
> +        mapHashtableElement.setAttribute("name", "map-Hashtable");
> +        mapHashtableElement.setAttribute("type", "tns:map-Map");
> +        schema.appendChild(mapHashtableElement);
> +        /* map-Properties Element */
> +        Element mapPropertiesElement =  
> document.createElement("xsd:element");
> +        mapPropertiesElement.setAttribute("name", "map-Properties");
> +        mapPropertiesElement.setAttribute("type", "tns:map-Map");
> +        schema.appendChild(mapPropertiesElement);
> +        /* map-HashMap Element */
> +        Element mapHashMapElement =  
> document.createElement("xsd:element");
> +        mapHashMapElement.setAttribute("name", "map-HashMap");
> +        mapHashMapElement.setAttribute("type", "tns:map-Map");
> +        schema.appendChild(mapHashMapElement);
> +        /* map-Map Element */
> +        Element mapMapElement =  
> document.createElement("xsd:element");
> +        mapMapElement.setAttribute("name", "map-Map");
> +        mapMapElement.setAttribute("type", "tns:map-Map");
> +        schema.appendChild(mapMapElement);
> +        /* map-Entry Element */
> +        Element mapEntryElement =  
> document.createElement("xsd:element");
> +        mapEntryElement.setAttribute("name", "map-Entry");
> +        mapEntryElement.setAttribute("type", "tns:map-Entry");
> +        schema.appendChild(mapEntryElement);
> +        /* map-Key Element */
> +        Element mapKeyElement =  
> document.createElement("xsd:element");
> +        mapKeyElement.setAttribute("name", "map-Key");
> +        mapKeyElement.setAttribute("type", "tns:map-Key");
> +        schema.appendChild(mapKeyElement);
> +        /* map-Value Element */
> +        Element mapValueElement =  
> document.createElement("xsd:element");
> +        mapValueElement.setAttribute("name", "map-Value");
> +        mapValueElement.setAttribute("type", "tns:map-Value");
> +        schema.appendChild(mapValueElement);
> +        /* eepk- Element */
> +        Element eepkElement = document.createElement("xsd:element");
> +        eepkElement.setAttribute("name", "eepk-");
> +        eepkElement.setAttribute("type", "tns:map-Value");
> +        schema.appendChild(eepkElement);
> +        /* eeval- Element */
> +        Element eevalElement = document.createElement("xsd:element");
> +        eevalElement.setAttribute("name", "eeval-");
> +        eevalElement.setAttribute("type", "tns:map-Value");
> +        schema.appendChild(eevalElement);
> +
> +        /*-----------------------------------*/
> +        /*----------- Custom Objects -----------*/
> +        /*-----------------------------------*/
> +
> +        /* cus-obj Element */
> +        Element cusObjElement =  
> document.createElement("xsd:element");
> +        cusObjElement.setAttribute("name", "cus-obj");
> +        schema.appendChild(cusObjElement);
> +
> +        /*-----------------------------------*/
> +        /*---------- Complex Types ----------*/
> +        /*-----------------------------------*/
> +
> +        /* map-Map Complex Type */
> +        Element mapMapComplexType =  
> document.createElement("xsd:complexType");
> +        mapMapComplexType.setAttribute("name", "map-Map");
> +        Element mapMapComplexType0 =  
> document.createElement("xsd:sequence");
> +        mapMapComplexType.appendChild(mapMapComplexType0);
> +        Element mapMapComplexType1 =  
> document.createElement("xsd:element");
> +        mapMapComplexType1.setAttribute("ref", "tns:map-Entry");
> +        mapMapComplexType1.setAttribute("minOccurs", "0");
> +        mapMapComplexType1.setAttribute("maxOccurs", "unbounded");
> +        mapMapComplexType0.appendChild(mapMapComplexType1);
> +        schema.appendChild(mapMapComplexType);
> +        /* map-Entry Complex Type */
> +        Element mapEntryComplexType =  
> document.createElement("xsd:complexType");
> +        mapEntryComplexType.setAttribute("name", "map-Entry");
> +        Element mapEntryComplexType0 =  
> document.createElement("xsd:sequence");
> +        mapEntryComplexType.appendChild(mapEntryComplexType0);
> +        Element mapEntryComplexType1 =  
> document.createElement("xsd:element");
> +        mapEntryComplexType1.setAttribute("ref", "tns:map-Key");
> +        mapEntryComplexType1.setAttribute("minOccurs", "1");
> +        mapEntryComplexType1.setAttribute("maxOccurs", "1");
> +        mapEntryComplexType0.appendChild(mapEntryComplexType1);
> +        Element mapEntryComplexType2 =  
> document.createElement("xsd:element");
> +        mapEntryComplexType2.setAttribute("ref", "tns:map-Value");
> +        mapEntryComplexType2.setAttribute("minOccurs", "1");
> +        mapEntryComplexType2.setAttribute("maxOccurs", "1");
> +        mapEntryComplexType0.appendChild(mapEntryComplexType2);
> +        schema.appendChild(mapEntryComplexType);
> +        /* map-Key Complex Type */
> +        Element mapKeyComplexType =  
> document.createElement("xsd:complexType");
> +        mapKeyComplexType.setAttribute("name", "map-Key");
> +        Element mapKeyComplexType0 =  
> document.createElement("xsd:all");
> +        mapKeyComplexType.appendChild(mapKeyComplexType0);
> +        Element mapKeyComplexType1 =  
> document.createElement("xsd:element");
> +        mapKeyComplexType1.setAttribute("ref", "tns:std-String");
> +        mapKeyComplexType1.setAttribute("minOccurs", "1");
> +        mapKeyComplexType1.setAttribute("maxOccurs", "1");
> +        mapKeyComplexType0.appendChild(mapKeyComplexType1);
> +        schema.appendChild(mapKeyComplexType);
> +        /* map-Value Complex Type */
> +        Element mapValueComplexType =  
> document.createElement("xsd:complexType");
> +        mapValueComplexType.setAttribute("name", "map-Value");
> +        Element mapValueComplexType0 =  
> document.createElement("xsd:choice");
> +        mapValueComplexType.appendChild(mapValueComplexType0);
> +        Element mapValueComplexType1 =  
> document.createElement("xsd:element");
> +        mapValueComplexType1.setAttribute("ref", "tns:std-String");
> +        mapValueComplexType1.setAttribute("minOccurs", "1");
> +        mapValueComplexType1.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType1);
> +        Element mapValueComplexType2 =  
> document.createElement("xsd:element");
> +        mapValueComplexType2.setAttribute("ref", "tns:std-Integer");
> +        mapValueComplexType2.setAttribute("minOccurs", "1");
> +        mapValueComplexType2.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType2);
> +        Element mapValueComplexType3 =  
> document.createElement("xsd:element");
> +        mapValueComplexType3.setAttribute("ref", "tns:std-Long");
> +        mapValueComplexType3.setAttribute("minOccurs", "1");
> +        mapValueComplexType3.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType3);
> +        Element mapValueComplexType4 =  
> document.createElement("xsd:element");
> +        mapValueComplexType4.setAttribute("ref", "tns:std-Float");
> +        mapValueComplexType4.setAttribute("minOccurs", "1");
> +        mapValueComplexType4.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType4);
> +        Element mapValueComplexType5 =  
> document.createElement("xsd:element");
> +        mapValueComplexType5.setAttribute("ref", "tns:std-Double");
> +        mapValueComplexType5.setAttribute("minOccurs", "1");
> +        mapValueComplexType5.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType5);
> +        Element mapValueComplexType6 =  
> document.createElement("xsd:element");
> +        mapValueComplexType6.setAttribute("ref", "tns:std-Boolean");
> +        mapValueComplexType6.setAttribute("minOccurs", "1");
> +        mapValueComplexType6.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType6);
> +        Element mapValueComplexType7 =  
> document.createElement("xsd:element");
> +        mapValueComplexType7.setAttribute("ref", "tns:std-Locale");
> +        mapValueComplexType7.setAttribute("minOccurs", "1");
> +        mapValueComplexType7.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType7);
> +        Element mapValueComplexType8 =  
> document.createElement("xsd:element");
> +        mapValueComplexType8.setAttribute("ref", "tns:sql- 
> Timestamp");
> +        mapValueComplexType8.setAttribute("minOccurs", "1");
> +        mapValueComplexType8.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType8);
> +        Element mapValueComplexType9 =  
> document.createElement("xsd:element");
> +        mapValueComplexType9.setAttribute("ref", "tns:sql-Date");
> +        mapValueComplexType9.setAttribute("minOccurs", "1");
> +        mapValueComplexType9.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType9);
> +        Element mapValueComplexType10 =  
> document.createElement("xsd:element");
> +        mapValueComplexType10.setAttribute("ref", "tns:sql-Time");
> +        mapValueComplexType10.setAttribute("minOccurs", "1");
> +        mapValueComplexType10.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType10);
> +        Element mapValueComplexType11 =  
> document.createElement("xsd:element");
> +        mapValueComplexType11.setAttribute("ref", "tns:col- 
> ArrayList");
> +        mapValueComplexType11.setAttribute("minOccurs", "1");
> +        mapValueComplexType11.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType11);
> +        Element mapValueComplexType12 =  
> document.createElement("xsd:element");
> +        mapValueComplexType12.setAttribute("ref", "tns:col- 
> LinkedList");
> +        mapValueComplexType12.setAttribute("minOccurs", "1");
> +        mapValueComplexType12.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType12);
> +        Element mapValueComplexType13 =  
> document.createElement("xsd:element");
> +        mapValueComplexType13.setAttribute("ref", "tns:col-Stack");
> +        mapValueComplexType13.setAttribute("minOccurs", "1");
> +        mapValueComplexType13.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType13);
> +        Element mapValueComplexType14 =  
> document.createElement("xsd:element");
> +        mapValueComplexType14.setAttribute("ref", "tns:col-Vector");
> +        mapValueComplexType14.setAttribute("minOccurs", "1");
> +        mapValueComplexType14.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType14);
> +        Element mapValueComplexType15 =  
> document.createElement("xsd:element");
> +        mapValueComplexType15.setAttribute("ref", "tns:col-TreeSet");
> +        mapValueComplexType15.setAttribute("minOccurs", "1");
> +        mapValueComplexType15.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType15);
> +        Element mapValueComplexType16 =  
> document.createElement("xsd:element");
> +        mapValueComplexType16.setAttribute("ref", "tns:col-HashSet");
> +        mapValueComplexType16.setAttribute("minOccurs", "1");
> +        mapValueComplexType16.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType16);
> +        Element mapValueComplexType17 =  
> document.createElement("xsd:element");
> +        mapValueComplexType17.setAttribute("ref", "tns:col- 
> Collection");
> +        mapValueComplexType17.setAttribute("minOccurs", "1");
> +        mapValueComplexType17.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType17);
> +        Element mapValueComplexType18 =  
> document.createElement("xsd:element");
> +        mapValueComplexType18.setAttribute("ref", "tns:map-HashMap");
> +        mapValueComplexType18.setAttribute("minOccurs", "1");
> +        mapValueComplexType18.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType18);
> +        Element mapValueComplexType19 =  
> document.createElement("xsd:element");
> +        mapValueComplexType19.setAttribute("ref", "tns:map- 
> Properties");
> +        mapValueComplexType19.setAttribute("minOccurs", "1");
> +        mapValueComplexType19.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType19);
> +        Element mapValueComplexType20 =  
> document.createElement("xsd:element");
> +        mapValueComplexType20.setAttribute("ref", "tns:map- 
> Hashtable");
> +        mapValueComplexType20.setAttribute("minOccurs", "1");
> +        mapValueComplexType20.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType20);
> +        Element mapValueComplexType21 =  
> document.createElement("xsd:element");
> +        mapValueComplexType21.setAttribute("ref", "tns:map- 
> WeakHashMap");
> +        mapValueComplexType21.setAttribute("minOccurs", "1");
> +        mapValueComplexType21.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType21);
> +        Element mapValueComplexType22 =  
> document.createElement("xsd:element");
> +        mapValueComplexType22.setAttribute("ref", "tns:map-TreeMap");
> +        mapValueComplexType22.setAttribute("minOccurs", "1");
> +        mapValueComplexType22.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType22);
> +        Element mapValueComplexType23 =  
> document.createElement("xsd:element");
> +        mapValueComplexType23.setAttribute("ref", "tns:map-Map");
> +        mapValueComplexType23.setAttribute("minOccurs", "1");
> +        mapValueComplexType23.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType23);
> +        Element mapValueComplexType24 =  
> document.createElement("xsd:element");
> +        mapValueComplexType24.setAttribute("ref", "tns:eepk-");
> +        mapValueComplexType24.setAttribute("minOccurs", "1");
> +        mapValueComplexType24.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType24);
> +        Element mapValueComplexType25 =  
> document.createElement("xsd:element");
> +        mapValueComplexType25.setAttribute("ref", "tns:eeval-");
> +        mapValueComplexType25.setAttribute("minOccurs", "1");
> +        mapValueComplexType25.setAttribute("maxOccurs", "1");
> +        mapValueComplexType0.appendChild(mapValueComplexType25);
> +        schema.appendChild(mapValueComplexType);
> +
> +        types.setDocumentationElement(schema);
> +        return types;
> +    }
> }
>
> Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/ 
> SOAPClientEngine.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java?rev=892712&r1=892711&r2=892712&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/ 
> SOAPClientEngine.java (original)
> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/ 
> SOAPClientEngine.java Mon Dec 21 07:31:58 2009
> @@ -18,32 +18,32 @@
>   
> *******************************************************************************/
> package org.ofbiz.service.engine;
>
> -import java.net.MalformedURLException;
> -import java.net.URL;
> -import java.util.ArrayList;
> -import java.util.Iterator;
> +import java.io.StringReader;
> import java.util.List;
> import java.util.Map;
>
> import javax.xml.namespace.QName;
> -import javax.xml.rpc.ParameterMode;
> -import javax.xml.rpc.ServiceException;
> +import javax.xml.stream.XMLInputFactory;
> +import javax.xml.stream.XMLStreamReader;
>
> import javolution.util.FastMap;
>
> -import org.apache.axis.Message;
> -import org.apache.axis.client.Call;
> -import org.apache.axis.client.Service;
> -import org.apache.axis.encoding.XMLType;
> -import org.apache.axis.message.RPCElement;
> -import org.apache.axis.message.RPCParam;
> -import org.apache.axis.message.SOAPEnvelope;
> +import org.apache.axiom.om.OMAbstractFactory;
> +import org.apache.axiom.om.OMElement;
> +import org.apache.axiom.om.OMFactory;
> +import org.apache.axiom.om.impl.builder.StAXOMBuilder;
> +import org.apache.axis2.AxisFault;
> +import org.apache.axis2.addressing.EndpointReference;
> +import org.apache.axis2.client.Options;
> +import org.apache.axis2.client.ServiceClient;
> +import org.ofbiz.base.util.Debug;
> +import org.ofbiz.base.util.UtilValidate;
> +import org.ofbiz.entity.Delegator;
> +import org.ofbiz.entity.serialize.XmlSerializer;
> import org.ofbiz.service.GenericServiceException;
> import org.ofbiz.service.ModelParam;
> import org.ofbiz.service.ModelService;
> import org.ofbiz.service.ServiceDispatcher;
> -import org.ofbiz.base.util.Debug;
> -import org.ofbiz.base.util.UtilValidate;
>
> /**
>  * Generic Service SOAP Interface
> @@ -78,113 +78,67 @@
>
>     // Invoke the remote SOAP service
>     private Map<String, Object> serviceInvoker(ModelService  
> modelService, Map<String, Object> context) throws  
> GenericServiceException {
> +        Delegator delegator = dispatcher.getDelegator();
>         if (modelService.location == null || modelService.invoke ==  
> null)
>             throw new GenericServiceException("Cannot locate service  
> to invoke");
> -
> -        Service service = null;
> -        Call call = null;
> -
> +
> +        ServiceClient client = null;
> +        QName serviceName = null;
> +
>         try {
> -            service = new Service();
> -            call = (Call) service.createCall();
> -        } catch (javax.xml.rpc.JAXRPCException e) {
> -            throw new GenericServiceException("RPC service error",  
> e);
> -        } catch (ServiceException e) {//Add by Andy.Chen 2003.01.15
> +            client = new ServiceClient();
> +            Options options = new Options();
> +            EndpointReference endPoint = new  
> EndpointReference(this.getLocation(modelService));
> +            options.setTo(endPoint);
> +            client.setOptions(options);
> +        } catch (AxisFault e) {
>             throw new GenericServiceException("RPC service error", e);
>         }
> -
> -        URL endPoint = null;
> -
> -        try {
> -            endPoint = new URL(this.getLocation(modelService));
> -        } catch (MalformedURLException e) {
> -            throw new GenericServiceException("Location not a valid  
> URL", e);
> -        }
> -
> +
>         List<ModelParam> inModelParamList =  
> modelService.getInModelParamList();
> -
> +
>         if (Debug.infoOn())  
> Debug.logInfo("[SOAPClientEngine.invoke] : Parameter length - " +  
> inModelParamList.size(), module);
> -
> -        call.setTargetEndpointAddress(endPoint);
> -
> +
>         if (UtilValidate.isNotEmpty(modelService.nameSpace)) {
> -            call.setOperationName(new QName(modelService.nameSpace,  
> modelService.invoke));
> +            serviceName = new QName(modelService.nameSpace,  
> modelService.invoke);
>         } else {
> -            call.setOperationName(modelService.invoke);
> +            serviceName = new QName(modelService.invoke);
>         }
> -
> +
>         int i = 0;
> -
> -        call.setOperation(call.getOperationName().getLocalPart());
> -        List<Object> vParams = new ArrayList<Object>();
> +
> +        Map<String, Object> parameterMap = FastMap.newInstance();
>         for (ModelParam p: inModelParamList) {
>             if (Debug.infoOn())  
> Debug.logInfo("[SOAPClientEngine.invoke} : Parameter: " + p.name +  
> " (" + p.mode + ") - " + i, module);
>
>             // exclude params that ModelServiceReader insert into  
> (internal params)
>             if (!p.internal) {
> -                QName qName =  
> call 
> .getParameterTypeByName 
> (p.name); //.getTypeMapping().getTypeQName((Class)  
> ObjectType.classNameClassMap.get(p.type));
> -                call.addParameter(p.name, qName, getMode(p.mode));
> -                vParams.add(context.get(p.name));
> +                parameterMap.put(p.name, context.get(p.name));
>             }
>             i++;
>         }
>
> -        call.setReturnType(XMLType.XSD_ANYTYPE);
> -        Object[] params=vParams.toArray(new Object[vParams.size()]);
> -
> -        Object result = null;
> -
> +        OMElement parameterSer = null;
> +
>         try {
> -            Debug.logInfo("[SOAPClientEngine.invoke] : Sending Call  
> To SOAP Server", module);
> -            result = call.invoke(params);
> -        } catch (java.rmi.RemoteException e) {
> -            throw new GenericServiceException("RPC error", e);
> -        }
> -        if (Debug.verboseOn()) {
> -            Debug.log("SOAP Service Result - " + result, module);
> +            String xmlParameters =  
> XmlSerializer.serialize(parameterMap);
> +            XMLStreamReader reader =  
> XMLInputFactory.newInstance().createXMLStreamReader(new  
> StringReader(xmlParameters));
> +            StAXOMBuilder builder = new StAXOMBuilder(reader);
> +            parameterSer = builder.getDocumentElement();
> +        } catch (Exception e) {
> +            Debug.logError(e, module);
>         }
> -
> -        return  
> getResponseParams(call.getMessageContext().getResponseMessage());
> -    }
> -
> -    private Map<String, Object> getResponseParams(Message  
> respMessage) {
> -        Map<String, Object> mRet = FastMap.newInstance();
> +
> +        Map<String, Object> results = null;
>         try {
> -            SOAPEnvelope resEnv = respMessage.getSOAPEnvelope();
> -            Iterator<?> i = resEnv.getBodyElements().iterator();
> -            while (i.hasNext()) {
> -                Object o = i.next();
> -
> -                if (o instanceof RPCElement) {
> -                    RPCElement body = (RPCElement) o;
> -
> -                    Iterator<?> p = body.getParams().iterator();
> -                    while (p.hasNext()) {
> -                        RPCParam param = (RPCParam) p.next();
> -                        mRet.put(param.getName(), param.getValue());
> -                        if (Debug.verboseOn()) {
> -                            Debug.log("SOAP Client Param - " +  
> param.getName() + "=" + param.getValue(), module);
> -                        }
> -                    }
> -                }
> -            }
> -        } catch (org.apache.axis.AxisFault e) {
> -            Debug.logError(e, "AxisFault", module);
> -        } catch (org.xml.sax.SAXException e) {
> -            Debug.logError(e, "SAXException", module);
> -        }
> -        return mRet;
> -    }
> -
> -    private ParameterMode getMode(String sMode) {
> -        if (sMode.equals("IN")) {
> -            return ParameterMode.IN;
> -        } else if (sMode.equals("OUT")) {
> -            return ParameterMode.OUT;
> -        } else if (sMode.equals("INOUT")) {
> -            return ParameterMode.INOUT;
> -        } else {
> -            return null;
> +            OMFactory factory = OMAbstractFactory.getOMFactory();
> +            OMElement payload = factory.createOMElement(serviceName);
> +            payload.addChild(parameterSer.getFirstElement());
> +            OMElement respOMElement = client.sendReceive(payload);
> +            results = (Map<String, Object>)  
> XmlSerializer.deserialize(respOMElement.toString(), delegator);
> +        } catch (Exception e) {
> +            Debug.logError(e, module);
>         }
> +        return results;
>     }
> }
>
> Added: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> ServiceSOAPTests.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java?rev=892712&view=auto
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> ServiceSOAPTests.java (added)
> +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> ServiceSOAPTests.java Mon Dec 21 07:31:58 2009
> @@ -0,0 +1,43 @@
> +package org.ofbiz.service.test;
> +
> +import java.util.List;
> +import java.util.Map;
> +
> +import javolution.util.FastMap;
> +
> +import org.ofbiz.base.util.Debug;
> +import org.ofbiz.base.util.UtilDateTime;
> +import org.ofbiz.base.util.UtilMisc;
> +import org.ofbiz.entity.GenericValue;
> +import org.ofbiz.service.testtools.OFBizTestCase;
> +
> +public class ServiceSOAPTests extends OFBizTestCase {
> +
> +    public final static String module =  
> ServiceSOAPTests.class.getName();
> +
> +    public ServiceSOAPTests(String name) {
> +        // TODO Auto-generated constructor stub
> +        super(name);
> +    }
> +
> +    public void testSOAPSimpleService() throws Exception {
> +        Map<String, Object> serviceContext = FastMap.newInstance();
> +        serviceContext.put("defaultValue", new Double("123.4567"));
> +        serviceContext.put("message", "Test Message !!!");
> +        Map<String, Object> results =  
> dispatcher.runSync("testSoapSimple", serviceContext);
> +        String resp = (String) results.get("resp");
> +    }
> +
> +    public void testSOAPService() throws Exception {
> +        Map<String, Object> serviceContext = FastMap.newInstance();
> +        GenericValue productCategory =  
> delegator.makeValue("ProductCategory");
> +        productCategory.put("productCategoryId", "PRODCAT_TEST");
> +        productCategory.put("productCategoryTypeId",  
> "CATALOG_CATEGORY");
> +        productCategory.put("categoryName", "Test ProductCategory");
> +        productCategory.put("createdStamp",  
> UtilDateTime.nowTimestamp());
> +        serviceContext.put("productCategory", productCategory);
> +        Map<String, Object> results =  
> dispatcher.runSync("testSoap", serviceContext);
> +        List<GenericValue> products = (List<GenericValue>)  
> results.get("products");
> +        assertNotNull(products);
> +    }
> +}
>
> Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> ServiceSOAPTests.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> ServiceSOAPTests.java
> ------------------------------------------------------------------------------
>    svn:keywords = "Date Rev Author URL Id"
>
> Propchange: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ 
> ServiceSOAPTests.java
> ------------------------------------------------------------------------------
>    svn:mime-type = text/plain
>
> Modified: ofbiz/trunk/framework/service/testdef/servicetests.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/testdef/servicetests.xml?rev=892712&r1=892711&r2=892712&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/framework/service/testdef/servicetests.xml (original)
> +++ ofbiz/trunk/framework/service/testdef/servicetests.xml Mon Dec  
> 21 07:31:58 2009
> @@ -22,6 +22,7 @@
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd 
> ">
>     <test-case case-name="service-tests"><junit-test-suite class- 
> name="org.ofbiz.service.test.ServiceEngineTests"/></test-case>
> +    <test-case case-name="service-soap-tests"><junit-test-suite  
> class-name="org.ofbiz.service.test.ServiceSOAPTests"/></test-case>
>
>     <test-case case-name="load-service-test-data">
>         <entity-xml action="load" entity-xml-url="component:// 
> service/testdef/data/ServiceTestData.xml"/>
>
> Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ 
> SOAPEventHandler.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java?rev=892712&r1=892711&r2=892712&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ 
> SOAPEventHandler.java (original)
> +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ 
> SOAPEventHandler.java Mon Dec 21 07:31:58 2009
> @@ -18,33 +18,35 @@
>   
> *******************************************************************************/
> package org.ofbiz.webapp.event;
>
> -import java.io.ByteArrayOutputStream;
> import java.io.IOException;
> import java.io.OutputStream;
> +import java.io.StringReader;
> import java.io.Writer;
> -import java.util.List;
> +import java.util.Iterator;
> import java.util.Map;
>
> import javax.servlet.ServletContext;
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
> import javax.wsdl.WSDLException;
> -import javax.xml.soap.SOAPException;
> +import javax.xml.namespace.QName;
> +import javax.xml.stream.XMLInputFactory;
> +import javax.xml.stream.XMLStreamReader;
>
> import javolution.util.FastMap;
>
> -import org.apache.axis.AxisFault;
> -import org.apache.axis.Constants;
> -import org.apache.axis.Message;
> -import org.apache.axis.MessageContext;
> -import org.apache.axis.message.RPCElement;
> -import org.apache.axis.message.RPCParam;
> -import org.apache.axis.message.SOAPEnvelope;
> -import org.apache.axis.server.AxisServer;
> +import org.apache.axiom.om.OMAbstractFactory;
> +import org.apache.axiom.om.OMElement;
> +import org.apache.axiom.om.impl.builder.StAXOMBuilder;
> +import org.apache.axiom.om.util.StAXUtils;
> +import org.apache.axiom.soap.SOAPBody;
> +import org.apache.axiom.soap.SOAPEnvelope;
> +import org.apache.axiom.soap.SOAPFactory;
> +import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
> import org.ofbiz.base.util.Debug;
> -import org.ofbiz.base.util.UtilGenerics;
> -import org.ofbiz.base.util.UtilMisc;
> import org.ofbiz.base.util.UtilXml;
> +import org.ofbiz.entity.GenericDelegator;
> +import org.ofbiz.entity.serialize.XmlSerializer;
> import org.ofbiz.service.DispatchContext;
> import org.ofbiz.service.GenericServiceException;
> import org.ofbiz.service.LocalDispatcher;
> @@ -72,7 +74,7 @@
>      */
>     public String invoke(Event event, RequestMap requestMap,  
> HttpServletRequest request, HttpServletResponse response) throws  
> EventHandlerException {
>         LocalDispatcher dispatcher = (LocalDispatcher)  
> request.getAttribute("dispatcher");
> -        AxisServer axisServer;
> +        GenericDelegator delegator = (GenericDelegator)  
> request.getAttribute("delegator");
>
>         // first check for WSDL request
>         String wsdlReq = request.getParameter("wsdl");
> @@ -138,163 +140,119 @@
>         }
>
>         // not a wsdl request; invoke the service
> -        try {
> -            axisServer =  
> AxisServer.getServer(UtilMisc.toMap("name", "OFBiz/Axis Server",  
> "provider", null));
> -        } catch (AxisFault e) {
> -            sendError(response, e);
> -            throw new EventHandlerException("Problems with the AXIS  
> server", e);
> -        }
> -        MessageContext mctx = new MessageContext(axisServer);
> -        mctx.setEncodingStyle(Constants.URI_LITERAL_ENC); // sets  
> the response encoding
> -
> -        // get the SOAP message
> -        Message msg = null;
> -
> -        try {
> -            msg = new Message(request.getInputStream(), false,
> -                        request.getHeader("Content-Type"),  
> request.getHeader("Content-Location"));
> -        } catch (IOException ioe) {
> -            sendError(response, "Problem processing the service");
> -            throw new EventHandlerException("Cannot read the input  
> stream", ioe);
> -        }
> -
> -        if (msg == null) {
> -            sendError(response, "No message");
> -            throw new EventHandlerException("SOAP Message is null");
> -        }
> -
> -        // log the request message
> -        if (Debug.verboseOn()) {
> -            try {
> -                Debug.logInfo("Request Message:\n" +  
> messageToString(msg) + "\n", module);
> -            } catch (Throwable t) {
> -            }
> -        }
> -
> -        mctx.setRequestMessage(msg);
> -
> -        // new envelopes
> -        SOAPEnvelope resEnv = new SOAPEnvelope();
> +
> +        // request envelope
>         SOAPEnvelope reqEnv = null;
> -
> +
>         // get the service name and parameters
>         try {
> -            reqEnv = (SOAPEnvelope) msg.getSOAPPart().getEnvelope();
> -        } catch (SOAPException e) {
> +            XMLStreamReader xmlReader =  
> StAXUtils.createXMLStreamReader(request.getInputStream());
> +            StAXSOAPModelBuilder builder = new  
> StAXSOAPModelBuilder(xmlReader);
> +            reqEnv = (SOAPEnvelope) builder.getDocumentElement();
> +
> +            // log the request message
> +            if (Debug.verboseOn()) {
> +                try {
> +                    Debug.logInfo("Request Message:\n" + reqEnv +  
> "\n", module);
> +                } catch (Throwable t) {
> +                }
> +            }
> +        } catch (Exception e) {
>             sendError(response, "Problem processing the service");
>             throw new EventHandlerException("Cannot get the  
> envelope", e);
>         }
> -
> -        List<Object> bodies = null;
> -
> -        try {
> -            bodies =  
> UtilGenerics.checkList(reqEnv.getBodyElements());
> -        } catch (AxisFault e) {
> -            sendError(response, e);
> -            throw new EventHandlerException(e.getMessage(), e);
> -        }
> -
> +
>         Debug.logVerbose("[Processing]: SOAP Event", module);
> +
> +        try {
> +            // each is a different service call
> +            SOAPBody reqBody = reqEnv.getBody();
> +            Iterator serviceIter = reqBody.getChildElements();
> +            while (serviceIter.hasNext()) {
> +                Object serviceObj = serviceIter.next();
> +                if (serviceObj instanceof OMElement) {
> +                    OMElement serviceElement = (OMElement)  
> serviceObj;
> +                    String serviceName =  
> serviceElement.getLocalName();
> +                    Map<String, Object> parameters = (Map<String,  
> Object>) XmlSerializer.deserialize(serviceElement.toString(),  
> delegator);
> +                    try {
> +                        // verify the service is exported for  
> remote execution and invoke it
> +                        ModelService model =  
> dispatcher.getDispatchContext().getModelService(serviceName);
>
> -        // each is a different service call
> -        for (Object o: bodies) {
> -
> -            if (o instanceof RPCElement) {
> -                RPCElement body = (RPCElement) o;
> -                String serviceName = body.getMethodName();
> -                List<RPCParam> params = null;
> -                try {
> -                    params =  
> UtilGenerics.checkList(body.getParams());
> -                } catch (Exception e) {
> -                    sendError(response, e);
> -                    throw new EventHandlerException(e.getMessage(),  
> e);
> -                }
> -                Map<String, Object> serviceContext =  
> FastMap.newInstance();
> -                for (RPCParam param: params) {
> -                    if (Debug.verboseOn())  
> Debug.logVerbose("[Reading Param]: " + param.getName(), module);
> -                    serviceContext.put(param.getName(),  
> param.getObjectValue());
> -                }
> -                try {
> -                    // verify the service is exported for remote  
> execution and invoke it
> -                    ModelService model =  
> dispatcher.getDispatchContext().getModelService(serviceName);
> -
> -                    if (model != null && model.export) {
> -                        Map<String, Object> result =  
> dispatcher.runSync(serviceName, serviceContext);
> -
> -                        Debug.logVerbose("[EventHandler] : Service  
> invoked", module);
> -                        RPCElement resBody = new  
> RPCElement(serviceName + "Response");
> -
> -                        resBody.setPrefix(body.getPrefix());
> -                         
> resBody.setNamespaceURI(body.getNamespaceURI());
> -
> -                        for (Map.Entry<String, Object> entry:  
> result.entrySet()) {
> -                            RPCParam par = new  
> RPCParam(entry.getKey(), entry.getValue());
> +                        if (model != null && model.export) {
> +                            Map<String, Object> results =  
> dispatcher.runSync(serviceName, parameters);
> +                            Debug.logVerbose("[EventHandler] :  
> Service invoked", module);
> +
> +                            // setup the response
> +                            Debug.logVerbose("[EventHandler] :  
> Setting up response message", module);
> +                            String xmlResults =  
> XmlSerializer.serialize(results);
> +                            XMLStreamReader reader =  
> XMLInputFactory.newInstance().createXMLStreamReader(new  
> StringReader(xmlResults));
> +                            StAXOMBuilder resultsBuilder = new  
> StAXOMBuilder(reader);
> +                            OMElement resultSer =  
> resultsBuilder.getDocumentElement();
> +
> +                            // create the response soap
> +                            SOAPFactory factory =  
> OMAbstractFactory.getSOAP11Factory();
> +                            SOAPEnvelope resEnv =  
> factory.createSOAPEnvelope();
> +                            SOAPBody resBody =  
> factory.createSOAPBody();
> +                            OMElement resService =  
> factory.createOMElement(new QName(serviceName + "Response"));
> +                             
> resService.addChild(resultSer.getFirstElement());
> +                            resBody.addChild(resService);
> +                            resEnv.addChild(resBody);
> +
> +                            // log the response message
> +                            if (Debug.verboseOn()) {
> +                                try {
> +                                    Debug.log("Response Message:\n"  
> + resEnv + "\n", module);
> +                                } catch (Throwable t) {
> +                                }
> +                            }
>
> -                            resBody.addParam(par);
> +                             
> resEnv.serialize(response.getOutputStream());
> +                            response.getOutputStream().flush();
>                         }
> -                        resEnv.addBodyElement(resBody);
> -                         
> resEnv.setEncodingStyle(Constants.URI_LITERAL_ENC);
> -                    } else {
> -                        sendError(response, "Requested service not  
> available");
> -                        throw new EventHandlerException("Service is  
> not exported");
> +
> +                    } catch (GenericServiceException e) {
> +                        sendError(response, "Problem processing the  
> service");
> +                        throw new  
> EventHandlerException(e.getMessage(), e);
>                     }
> -                } catch (GenericServiceException e) {
> -                    sendError(response, "Problem processing the  
> service");
> -                    throw new EventHandlerException(e.getMessage(),  
> e);
> -                } catch (javax.xml.soap.SOAPException e) {
> -                    sendError(response, "Problem processing the  
> service");
> -                    throw new EventHandlerException(e.getMessage(),  
> e);
>                 }
>             }
> -        }
> -
> -        // setup the response
> -        Debug.logVerbose("[EventHandler] : Setting up response  
> message", module);
> -        msg = new Message(resEnv);
> -        mctx.setResponseMessage(msg);
> -        if (msg == null) {
> -            sendError(response, "No response message available");
> -            throw new EventHandlerException("No response message  
> available");
> -        }
> -
> -        // log the response message
> -        if (Debug.verboseOn()) {
> -            try {
> -                Debug.log("Response Message:\n" +  
> messageToString(msg) + "\n", module);
> -            } catch (Throwable t) {
> -            }
> -        }
> -
> -        try {
> -             
> response 
> .setContentType(msg.getContentType(Constants.DEFAULT_SOAP_VERSION));
> -             
> response 
> .setContentLength 
> (Integer.parseInt(Long.toString(msg.getContentLength())));
> -        } catch (AxisFault e) {
> -            sendError(response, e);
> +        } catch (Exception e) {
> +            sendError(response, e.getMessage());
>             throw new EventHandlerException(e.getMessage(), e);
>         }
> -
> -        try {
> -            msg.writeTo(response.getOutputStream());
> -            response.flushBuffer();
> -        } catch (IOException e) {
> -            throw new EventHandlerException("Cannot write to the  
> output stream");
> -        } catch (SOAPException e) {
> -            throw new EventHandlerException("Cannot write message  
> to the output stream");
> -        }
> -
> -        Debug.logVerbose("[EventHandler] : Message sent to  
> requester", module);
> -
> +
>         return null;
>     }
>
> -    private void sendError(HttpServletResponse res, Object obj)  
> throws EventHandlerException {
> -        Message msg = new Message(obj);
> -
> +    private void sendError(HttpServletResponse res, String  
> errorMessage) throws EventHandlerException {
>         try {
> -             
> res 
> .setContentType(msg.getContentType(Constants.DEFAULT_SOAP_VERSION));
> -             
> res 
> .setContentLength 
> (Integer.parseInt(Long.toString(msg.getContentLength())));
> -            msg.writeTo(res.getOutputStream());
> -            res.flushBuffer();
> +            // setup the response
> +            Map<String, Object> results = FastMap.newInstance();
> +            results.put("errorMessage", errorMessage);
> +            String xmlResults= XmlSerializer.serialize(results);
> +            XMLStreamReader xmlReader =  
> XMLInputFactory.newInstance().createXMLStreamReader(new  
> StringReader(xmlResults));
> +            StAXOMBuilder resultsBuilder = new  
> StAXOMBuilder(xmlReader);
> +            OMElement resultSer =  
> resultsBuilder.getDocumentElement();
> +
> +            // create the response soap
> +            SOAPFactory factory =  
> OMAbstractFactory.getSOAP11Factory();
> +            SOAPEnvelope resEnv = factory.createSOAPEnvelope();
> +            SOAPBody resBody = factory.createSOAPBody();
> +            OMElement errMsg = factory.createOMElement(new  
> QName("Response"));
> +            errMsg.addChild(resultSer.getFirstElement());
> +            resBody.addChild(errMsg);
> +            resEnv.addChild(resBody);
> +
> +            // log the response message
> +            if (Debug.verboseOn()) {
> +                try {
> +                    Debug.log("Response Message:\n" + resEnv +  
> "\n", module);
> +                } catch (Throwable t) {
> +                }
> +            }
> +
> +            resEnv.serialize(res.getOutputStream());
> +            res.getOutputStream().flush();
>         } catch (Exception e) {
>             throw new EventHandlerException(e.getMessage(), e);
>         }
> @@ -320,10 +278,4 @@
>         uri.append(reqInfo);
>         return uri.toString();
>     }
> -
> -    public static String messageToString(Message msg) throws  
> SOAPException, IOException {
> -        ByteArrayOutputStream out = new ByteArrayOutputStream();
> -        msg.writeTo(out);
> -        return out.toString();
> -    }
> }
>
>


Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Posted by David E Jones <de...@me.com>.
On Dec 21, 2009, at 6:28 PM, Adam Heath wrote:

> David E Jones wrote:
>> On Dec 21, 2009, at 2:04 AM, Adam Heath wrote:
>> 
>>> David E Jones wrote:
>>>> On Dec 21, 2009, at 1:49 AM, Adam Heath wrote:
>>>> 
>>>>> David E Jones wrote:
>>>>>> On Dec 21, 2009, at 1:35 AM, Adam Heath wrote:
>>>>>> 
>>>>>>> hansbak@apache.org wrote:
>>>>>>>> Author: hansbak
>>>>>>>> Date: Mon Dec 21 07:31:58 2009
>>>>>>>> New Revision: 892712
>>>>>>>> 
>>>>>>>> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
>>>>>>>> Log:
>>>>>>>> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in webservices including WSDL generation. see OFBIZ-3363 for more info. A contribution of Antwebsystems employee Chatree
>>>>>>>> 
>>>>>>>> Added:
>>>>>>>> ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with props)
>>>>>>>> ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with props)
>>>>>>>> ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with props)
>>>>>>>> ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with props)
>>>>>>>> ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar   (with props)
>>>>>>>> ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar   (with props)
>>>>>>>> ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar   (with props)
>>>>>>>> ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
>>>>>>>> ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java   (with props)
>>>>>>>> Modified:
>>>>>>>> ofbiz/trunk/LICENSE
>>>>>>>> ofbiz/trunk/framework/common/servicedef/services_test.xml
>>>>>>>> ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
>>>>>>>> ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
>>>>>>>> ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
>>>>>>>> ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
>>>>>>>> ofbiz/trunk/framework/service/testdef/servicetests.xml
>>>>>>>> ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
>>>>>>> What about .classpath?
>>>>>> What about it? We can't assume everyone uses Eclipse...
>>>>> What does using eclipse have to do with updating that file?  I don't
>>>>> use eclipse, but I still update .classpath.  I also don't use ant.bat,
>>>>> yet I just updated that.
>>>>> 
>>>>> If you know that you have to keep .classpath updated to make eclipse
>>>>> work, and you knowingly check in new libraries, or remove old ones,
>>>>> then why make eclipse broken?  It's really not that hard to change.
>>>>> 
>>>>> Honestly, I don't understand why you would think not keeping it
>>>>> uptodate is a good thing.
>>>>> 
>>>>> ... perplexed ...
>>>> Where did I write "not keeping it uptodate is a good thing?" And if I didn't write it, how can you assert I was thinking it?
>>> How else could what you wrote be interpreted?  Because you responded,
>>> it seemed to imply that you disagreed that it wasn't important to keep
>>> it uptodate.
>>> 
>>> If you actually meant something else, then you should have said so.
>>> 
>>> My 3 words meant that it should have been updated.  What did you
>>> actually mean?
>>> 
>>> I still can't see how your response could be interpreted in any other way.
>>> 
>>> And I'm rather perplexed at having to explain my 3 simple words in
>>> such detail, esp. to you, David.
>> 
>> What does it have to do with your 3 words?
>> 
>> What did I mean? I meant:
>> 
>> What about .classpath? If Hans doesn't use Eclipse, how can you expect him to
>> keep that Eclipse-specific file updated, especially since it has been
>> historically maintained by Eclipse users. Some things, like the
> LICENSE and
>> NOTICE files that Jacques pointed out, really are responsibilities
> of committers.
>> I wouldn't consider keeping the Eclipse .classpath file one of those
> responsibilities.
> 
> We are all in this together.  The more people who keep an eye on the
> various parts of the project, and the more people who keep things
> working, the better.
> 
> There are some things that are *very* easy to check.  .classpath is
> most definately one of those.  Keeping it in sync is so very very very
> simple, why shouldn't it be kept in sync when library changes occur?
> 
> At what level should due diligence be thrown out the window?
> 
> When the default memory requirements for ofbiz change, should only the
> shell scripts be changed, only the .bat files, or both?  What if new
> system properties need to be set?  Should that only be done in one set
> of files?
> 
> Or, for another example, what about keeping the embedded ant working,
> vs. an external, system installed ant?
> 
> I completely understand how some people may not use some small part of
> ofbiz; there are so many parts, it can be hard to keep them all in
> working order.  However, some of those small parts are at least easy
> to work with, and simple enough to see obviously broken behaviour,
> that updating them when other parts change is easy.
> 
> I really still can't believe that you are suggesting that keeping this
> very simple to understand text file uptodate is not a worthwhile goal
> for everyone.

Don't be ridiculous, I never wrote not implied any such thing. You really should check your assumptions and re-read what I did actually write.

And here I go, shouting into the wind again... I may be an idiot, but I'll try not to prove myself insane by writing more (even if I think that definition of insanity is BS).

-David


> 
>> Is that clear enough?
> 
> Clear, yes.  However, it still doesn't make any sense to me.
> 
>> Shall I go on? Why are you trying to imply that Hans should do this, as if he's
>> made some sort of mistake and it's his responsibility to correct it?
> Why didn't
>> you just correct it yourself if you care so much about it? Who says the
>> responsibility belongs to one more than another, and if it doesn't
> why are you
>> trying to get someone else to do something by implying it is their
> responsibility
>> instead of working with them in a more friendly and respectful way?
> 
> I didn't correct it myself, because more eyes/hands makes for a better
> project.  The more people we have looking over the system, the better
> the system will be.
> 
> Of course I could have correct this issue.  I could have even done it
> silently.  But then no one would learn, and no one would become better.
> 
> Besides, the best practices for contributors(1) says: first, do no harm.
> 
> I can understand when mistakes get made.  We are all human, none of us
> are perfect.  However, when a mistake is eventually made, if it is
> never pointed out, how can you expect the person who made the mistake
> to get better?  I don't point out issues to make people feel bad; I
> point them out to make them better.
> 
> I've said this before, I don't consider the background of a person
> when I read a commit message.  I just comment on that particular commit.
> 
>> Okay, I think that's about all I can figure out to say on this little topic...
>> if you need more clarification and expansion I'll try to put
> together a more
>> general philosophical background. On the other hand, I've written a
> few blog
>> entries that are related to this and that I think explain it rather
> well.
> 
> Which blog entries have you written?  Links would be nice.
> 
> 1:
> http://cwiki.apache.org/confluence/display/OFBADMIN/OFBiz+Contributors+Best+Practices
> 
> 


Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Posted by Adam Heath <do...@brainfood.com>.
David E Jones wrote:
> On Dec 21, 2009, at 2:04 AM, Adam Heath wrote:
> 
>> David E Jones wrote:
>>> On Dec 21, 2009, at 1:49 AM, Adam Heath wrote:
>>>
>>>> David E Jones wrote:
>>>>> On Dec 21, 2009, at 1:35 AM, Adam Heath wrote:
>>>>>
>>>>>> hansbak@apache.org wrote:
>>>>>>> Author: hansbak
>>>>>>> Date: Mon Dec 21 07:31:58 2009
>>>>>>> New Revision: 892712
>>>>>>>
>>>>>>> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
>>>>>>> Log:
>>>>>>> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in webservices including WSDL generation. see OFBIZ-3363 for more info. A contribution of Antwebsystems employee Chatree
>>>>>>>
>>>>>>> Added:
>>>>>>>  ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with props)
>>>>>>>  ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with props)
>>>>>>>  ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with props)
>>>>>>>  ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with props)
>>>>>>>  ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar   (with props)
>>>>>>>  ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar   (with props)
>>>>>>>  ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar   (with props)
>>>>>>>  ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
>>>>>>>  ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java   (with props)
>>>>>>> Modified:
>>>>>>>  ofbiz/trunk/LICENSE
>>>>>>>  ofbiz/trunk/framework/common/servicedef/services_test.xml
>>>>>>>  ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
>>>>>>>  ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
>>>>>>>  ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
>>>>>>>  ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
>>>>>>>  ofbiz/trunk/framework/service/testdef/servicetests.xml
>>>>>>>  ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
>>>>>> What about .classpath?
>>>>> What about it? We can't assume everyone uses Eclipse...
>>>> What does using eclipse have to do with updating that file?  I don't
>>>> use eclipse, but I still update .classpath.  I also don't use ant.bat,
>>>> yet I just updated that.
>>>>
>>>> If you know that you have to keep .classpath updated to make eclipse
>>>> work, and you knowingly check in new libraries, or remove old ones,
>>>> then why make eclipse broken?  It's really not that hard to change.
>>>>
>>>> Honestly, I don't understand why you would think not keeping it
>>>> uptodate is a good thing.
>>>>
>>>> ... perplexed ...
>>> Where did I write "not keeping it uptodate is a good thing?" And if I didn't write it, how can you assert I was thinking it?
>> How else could what you wrote be interpreted?  Because you responded,
>> it seemed to imply that you disagreed that it wasn't important to keep
>> it uptodate.
>>
>> If you actually meant something else, then you should have said so.
>>
>> My 3 words meant that it should have been updated.  What did you
>> actually mean?
>>
>> I still can't see how your response could be interpreted in any other way.
>>
>> And I'm rather perplexed at having to explain my 3 simple words in
>> such detail, esp. to you, David.
> 
> What does it have to do with your 3 words?
> 
> What did I mean? I meant:
> 
> What about .classpath? If Hans doesn't use Eclipse, how can you expect him to
> keep that Eclipse-specific file updated, especially since it has been
> historically maintained by Eclipse users. Some things, like the
LICENSE and
> NOTICE files that Jacques pointed out, really are responsibilities
of committers.
> I wouldn't consider keeping the Eclipse .classpath file one of those
responsibilities.

We are all in this together.  The more people who keep an eye on the
various parts of the project, and the more people who keep things
working, the better.

There are some things that are *very* easy to check.  .classpath is
most definately one of those.  Keeping it in sync is so very very very
simple, why shouldn't it be kept in sync when library changes occur?

At what level should due diligence be thrown out the window?

When the default memory requirements for ofbiz change, should only the
shell scripts be changed, only the .bat files, or both?  What if new
system properties need to be set?  Should that only be done in one set
of files?

Or, for another example, what about keeping the embedded ant working,
vs. an external, system installed ant?

I completely understand how some people may not use some small part of
 ofbiz; there are so many parts, it can be hard to keep them all in
working order.  However, some of those small parts are at least easy
to work with, and simple enough to see obviously broken behaviour,
that updating them when other parts change is easy.

I really still can't believe that you are suggesting that keeping this
very simple to understand text file uptodate is not a worthwhile goal
for everyone.

> Is that clear enough?

Clear, yes.  However, it still doesn't make any sense to me.

> Shall I go on? Why are you trying to imply that Hans should do this, as if he's
> made some sort of mistake and it's his responsibility to correct it?
Why didn't
> you just correct it yourself if you care so much about it? Who says the
> responsibility belongs to one more than another, and if it doesn't
why are you
> trying to get someone else to do something by implying it is their
responsibility
> instead of working with them in a more friendly and respectful way?

I didn't correct it myself, because more eyes/hands makes for a better
project.  The more people we have looking over the system, the better
the system will be.

Of course I could have correct this issue.  I could have even done it
silently.  But then no one would learn, and no one would become better.

Besides, the best practices for contributors(1) says: first, do no harm.

I can understand when mistakes get made.  We are all human, none of us
are perfect.  However, when a mistake is eventually made, if it is
never pointed out, how can you expect the person who made the mistake
to get better?  I don't point out issues to make people feel bad; I
point them out to make them better.

I've said this before, I don't consider the background of a person
when I read a commit message.  I just comment on that particular commit.

> Okay, I think that's about all I can figure out to say on this little topic...
> if you need more clarification and expansion I'll try to put
together a more
> general philosophical background. On the other hand, I've written a
few blog
> entries that are related to this and that I think explain it rather
well.

Which blog entries have you written?  Links would be nice.

1:
http://cwiki.apache.org/confluence/display/OFBADMIN/OFBiz+Contributors+Best+Practices



Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Posted by David E Jones <de...@me.com>.
On Dec 21, 2009, at 2:04 AM, Adam Heath wrote:

> David E Jones wrote:
>> On Dec 21, 2009, at 1:49 AM, Adam Heath wrote:
>> 
>>> David E Jones wrote:
>>>> On Dec 21, 2009, at 1:35 AM, Adam Heath wrote:
>>>> 
>>>>> hansbak@apache.org wrote:
>>>>>> Author: hansbak
>>>>>> Date: Mon Dec 21 07:31:58 2009
>>>>>> New Revision: 892712
>>>>>> 
>>>>>> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
>>>>>> Log:
>>>>>> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in webservices including WSDL generation. see OFBIZ-3363 for more info. A contribution of Antwebsystems employee Chatree
>>>>>> 
>>>>>> Added:
>>>>>>  ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with props)
>>>>>>  ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with props)
>>>>>>  ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with props)
>>>>>>  ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with props)
>>>>>>  ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar   (with props)
>>>>>>  ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar   (with props)
>>>>>>  ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar   (with props)
>>>>>>  ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
>>>>>>  ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java   (with props)
>>>>>> Modified:
>>>>>>  ofbiz/trunk/LICENSE
>>>>>>  ofbiz/trunk/framework/common/servicedef/services_test.xml
>>>>>>  ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
>>>>>>  ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
>>>>>>  ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
>>>>>>  ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
>>>>>>  ofbiz/trunk/framework/service/testdef/servicetests.xml
>>>>>>  ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
>>>>> What about .classpath?
>>>> What about it? We can't assume everyone uses Eclipse...
>>> What does using eclipse have to do with updating that file?  I don't
>>> use eclipse, but I still update .classpath.  I also don't use ant.bat,
>>> yet I just updated that.
>>> 
>>> If you know that you have to keep .classpath updated to make eclipse
>>> work, and you knowingly check in new libraries, or remove old ones,
>>> then why make eclipse broken?  It's really not that hard to change.
>>> 
>>> Honestly, I don't understand why you would think not keeping it
>>> uptodate is a good thing.
>>> 
>>> ... perplexed ...
>> 
>> Where did I write "not keeping it uptodate is a good thing?" And if I didn't write it, how can you assert I was thinking it?
> 
> How else could what you wrote be interpreted?  Because you responded,
> it seemed to imply that you disagreed that it wasn't important to keep
> it uptodate.
> 
> If you actually meant something else, then you should have said so.
> 
> My 3 words meant that it should have been updated.  What did you
> actually mean?
> 
> I still can't see how your response could be interpreted in any other way.
> 
> And I'm rather perplexed at having to explain my 3 simple words in
> such detail, esp. to you, David.

What does it have to do with your 3 words?

What did I mean? I meant:

What about .classpath? If Hans doesn't use Eclipse, how can you expect him to keep that Eclipse-specific file updated, especially since it has been historically maintained by Eclipse users. Some things, like the LICENSE and NOTICE files that Jacques pointed out, really are responsibilities of committers. I wouldn't consider keeping the Eclipse .classpath file one of those responsibilities.

Is that clear enough?

Shall I go on? Why are you trying to imply that Hans should do this, as if he's made some sort of mistake and it's his responsibility to correct it? Why didn't you just correct it yourself if you care so much about it? Who says the responsibility belongs to one more than another, and if it doesn't why are you trying to get someone else to do something by implying it is their responsibility instead of working with them in a more friendly and respectful way?

Okay, I think that's about all I can figure out to say on this little topic... if you need more clarification and expansion I'll try to put together a more general philosophical background. On the other hand, I've written a few blog entries that are related to this and that I think explain it rather well.

-David



Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Posted by Adam Heath <do...@brainfood.com>.
David E Jones wrote:
> On Dec 21, 2009, at 1:49 AM, Adam Heath wrote:
> 
>> David E Jones wrote:
>>> On Dec 21, 2009, at 1:35 AM, Adam Heath wrote:
>>>
>>>> hansbak@apache.org wrote:
>>>>> Author: hansbak
>>>>> Date: Mon Dec 21 07:31:58 2009
>>>>> New Revision: 892712
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
>>>>> Log:
>>>>> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in webservices including WSDL generation. see OFBIZ-3363 for more info. A contribution of Antwebsystems employee Chatree
>>>>>
>>>>> Added:
>>>>>   ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with props)
>>>>>   ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with props)
>>>>>   ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with props)
>>>>>   ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with props)
>>>>>   ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar   (with props)
>>>>>   ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar   (with props)
>>>>>   ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar   (with props)
>>>>>   ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
>>>>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java   (with props)
>>>>> Modified:
>>>>>   ofbiz/trunk/LICENSE
>>>>>   ofbiz/trunk/framework/common/servicedef/services_test.xml
>>>>>   ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
>>>>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
>>>>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
>>>>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
>>>>>   ofbiz/trunk/framework/service/testdef/servicetests.xml
>>>>>   ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
>>>> What about .classpath?
>>> What about it? We can't assume everyone uses Eclipse...
>> What does using eclipse have to do with updating that file?  I don't
>> use eclipse, but I still update .classpath.  I also don't use ant.bat,
>> yet I just updated that.
>>
>> If you know that you have to keep .classpath updated to make eclipse
>> work, and you knowingly check in new libraries, or remove old ones,
>> then why make eclipse broken?  It's really not that hard to change.
>>
>> Honestly, I don't understand why you would think not keeping it
>> uptodate is a good thing.
>>
>> ... perplexed ...
> 
> Where did I write "not keeping it uptodate is a good thing?" And if I didn't write it, how can you assert I was thinking it?

How else could what you wrote be interpreted?  Because you responded,
it seemed to imply that you disagreed that it wasn't important to keep
it uptodate.

If you actually meant something else, then you should have said so.

My 3 words meant that it should have been updated.  What did you
actually mean?

I still can't see how your response could be interpreted in any other way.

And I'm rather perplexed at having to explain my 3 simple words in
such detail, esp. to you, David.


Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Posted by David E Jones <de...@me.com>.
On Dec 21, 2009, at 1:49 AM, Adam Heath wrote:

> David E Jones wrote:
>> On Dec 21, 2009, at 1:35 AM, Adam Heath wrote:
>> 
>>> hansbak@apache.org wrote:
>>>> Author: hansbak
>>>> Date: Mon Dec 21 07:31:58 2009
>>>> New Revision: 892712
>>>> 
>>>> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
>>>> Log:
>>>> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in webservices including WSDL generation. see OFBIZ-3363 for more info. A contribution of Antwebsystems employee Chatree
>>>> 
>>>> Added:
>>>>   ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with props)
>>>>   ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with props)
>>>>   ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with props)
>>>>   ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with props)
>>>>   ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar   (with props)
>>>>   ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar   (with props)
>>>>   ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar   (with props)
>>>>   ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
>>>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java   (with props)
>>>> Modified:
>>>>   ofbiz/trunk/LICENSE
>>>>   ofbiz/trunk/framework/common/servicedef/services_test.xml
>>>>   ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
>>>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
>>>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
>>>>   ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
>>>>   ofbiz/trunk/framework/service/testdef/servicetests.xml
>>>>   ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
>>> What about .classpath?
>> 
>> What about it? We can't assume everyone uses Eclipse...
> 
> What does using eclipse have to do with updating that file?  I don't
> use eclipse, but I still update .classpath.  I also don't use ant.bat,
> yet I just updated that.
> 
> If you know that you have to keep .classpath updated to make eclipse
> work, and you knowingly check in new libraries, or remove old ones,
> then why make eclipse broken?  It's really not that hard to change.
> 
> Honestly, I don't understand why you would think not keeping it
> uptodate is a good thing.
> 
> ... perplexed ...

Where did I write "not keeping it uptodate is a good thing?" And if I didn't write it, how can you assert I was thinking it?

-David



Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Posted by Adam Heath <do...@brainfood.com>.
David E Jones wrote:
> On Dec 21, 2009, at 1:35 AM, Adam Heath wrote:
> 
>> hansbak@apache.org wrote:
>>> Author: hansbak
>>> Date: Mon Dec 21 07:31:58 2009
>>> New Revision: 892712
>>>
>>> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
>>> Log:
>>> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in webservices including WSDL generation. see OFBIZ-3363 for more info. A contribution of Antwebsystems employee Chatree
>>>
>>> Added:
>>>    ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with props)
>>>    ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with props)
>>>    ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with props)
>>>    ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with props)
>>>    ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar   (with props)
>>>    ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar   (with props)
>>>    ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar   (with props)
>>>    ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
>>>    ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java   (with props)
>>> Modified:
>>>    ofbiz/trunk/LICENSE
>>>    ofbiz/trunk/framework/common/servicedef/services_test.xml
>>>    ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
>>>    ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
>>>    ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
>>>    ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
>>>    ofbiz/trunk/framework/service/testdef/servicetests.xml
>>>    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
>> What about .classpath?
> 
> What about it? We can't assume everyone uses Eclipse...

What does using eclipse have to do with updating that file?  I don't
use eclipse, but I still update .classpath.  I also don't use ant.bat,
yet I just updated that.

If you know that you have to keep .classpath updated to make eclipse
work, and you knowingly check in new libraries, or remove old ones,
then why make eclipse broken?  It's really not that hard to change.

Honestly, I don't understand why you would think not keeping it
uptodate is a good thing.

... perplexed ...


Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Posted by David E Jones <de...@me.com>.
On Dec 21, 2009, at 1:35 AM, Adam Heath wrote:

> hansbak@apache.org wrote:
>> Author: hansbak
>> Date: Mon Dec 21 07:31:58 2009
>> New Revision: 892712
>> 
>> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
>> Log:
>> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in webservices including WSDL generation. see OFBIZ-3363 for more info. A contribution of Antwebsystems employee Chatree
>> 
>> Added:
>>    ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with props)
>>    ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with props)
>>    ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with props)
>>    ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with props)
>>    ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar   (with props)
>>    ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar   (with props)
>>    ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar   (with props)
>>    ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
>>    ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java   (with props)
>> Modified:
>>    ofbiz/trunk/LICENSE
>>    ofbiz/trunk/framework/common/servicedef/services_test.xml
>>    ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
>>    ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
>>    ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
>>    ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
>>    ofbiz/trunk/framework/service/testdef/servicetests.xml
>>    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
> 
> What about .classpath?

What about it? We can't assume everyone uses Eclipse...

-David


Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi

Posted by Jacques Le Roux <ja...@les7arts.com>.
Jacques

From: "Jacques Le Roux" <ja...@les7arts.com>
> From: "Adam Heath" <do...@brainfood.com>
>> hansbak@apache.org wrote:
>>> Author: hansbak
>>> Date: Mon Dec 21 07:31:58 2009
>>> New Revision: 892712
>>>
>>> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
>>> Log:
>>> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in webservices including WSDL generation. see OFBIZ-3363 for more
>>> info. A contribution of Antwebsystems employee Chatree
>>>
>>> Added:
>>>     ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with props)
>>>     ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with props)
>>>     ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with props)
>>>     ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with props)
>>>     ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar   (with props)
>>>     ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar   (with props)
>>>     ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar   (with props)
>>>     ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
>>>     ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java   (with props)
>>> Modified:
>>>     ofbiz/trunk/LICENSE
>>>     ofbiz/trunk/framework/common/servicedef/services_test.xml
>>>     ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
>>>     ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
>>>     ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
>>>     ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
>>>     ofbiz/trunk/framework/service/testdef/servicetests.xml
>>>     ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
>>
>> What about .classpath?
>
> And please guys, don't forget to update LICENCE (if needed), NOTICE and the libraries wiki page
>
> Thanks
> Jacques

There is nothing about BIRT in the NOTICE file, is it normal?

About the libraries wiki page, I noticed that these last times I was the only one to update it.
http://cwiki.apache.org/confluence/pages/viewpreviousversions.action?pageId=7766018

Do we want to continue to update it, or should we get rid of it?
Because there is nothing worse than not updated documentation, even no documentation is better

Jacques



Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi

Posted by Jacques Le Roux <ja...@les7arts.com>.
From: "Adam Heath" <do...@brainfood.com>
To: <de...@ofbiz.apache.org>
Cc: <co...@ofbiz.apache.org>
Sent: Monday, December 21, 2009 8:35 AM
Subject: Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ 
framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ 
framework/service/src/org/ofbi...


> hansbak@apache.org wrote:
>> Author: hansbak
>> Date: Mon Dec 21 07:31:58 2009
>> New Revision: 892712
>>
>> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
>> Log:
>> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in webservices including WSDL generation. see OFBIZ-3363 for more 
>> info. A contribution of Antwebsystems employee Chatree
>>
>> Added:
>>     ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with props)
>>     ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with props)
>>     ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with props)
>>     ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with props)
>>     ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar   (with props)
>>     ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar   (with props)
>>     ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar   (with props)
>>     ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
>>     ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java   (with props)
>> Modified:
>>     ofbiz/trunk/LICENSE
>>     ofbiz/trunk/framework/common/servicedef/services_test.xml
>>     ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
>>     ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
>>     ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
>>     ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
>>     ofbiz/trunk/framework/service/testdef/servicetests.xml
>>     ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java
>
> What about .classpath?

And please guys, don't forget to update LICENCE (if needed), NOTICE and the libraries wiki page

Thanks
Jacques 



Re: svn commit: r892712 - in /ofbiz/trunk: ./ framework/common/servicedef/ framework/common/src/org/ofbiz/common/ framework/service/lib/ framework/service/src/org/ofbiz/service/ framework/service/src/org/ofbiz/service/engine/ framework/service/src/org/ofbi...

Posted by Adam Heath <do...@brainfood.com>.
hansbak@apache.org wrote:
> Author: hansbak
> Date: Mon Dec 21 07:31:58 2009
> New Revision: 892712
> 
> URL: http://svn.apache.org/viewvc?rev=892712&view=rev
> Log:
> Upgrade Axis1 to Axis2. Ofbiz now supports complex parameters in webservices including WSDL generation. see OFBIZ-3363 for more info. A contribution of Antwebsystems employee Chatree
> 
> Added:
>     ofbiz/trunk/framework/service/lib/XmlSchema-1.4.3.jar   (with props)
>     ofbiz/trunk/framework/service/lib/axiom-api-1.2.8.jar   (with props)
>     ofbiz/trunk/framework/service/lib/axiom-impl-1.2.8.jar   (with props)
>     ofbiz/trunk/framework/service/lib/axis2-kernel-1.5.1.jar   (with props)
>     ofbiz/trunk/framework/service/lib/axis2-transport-http-1.5.1.jar   (with props)
>     ofbiz/trunk/framework/service/lib/axis2-transport-local-1.5.1.jar   (with props)
>     ofbiz/trunk/framework/service/lib/commons-httpclient-3.1.jar   (with props)
>     ofbiz/trunk/framework/service/lib/neethi-2.0.4.jar   (with props)
>     ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceSOAPTests.java   (with props)
> Modified:
>     ofbiz/trunk/LICENSE
>     ofbiz/trunk/framework/common/servicedef/services_test.xml
>     ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
>     ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelParam.java
>     ofbiz/trunk/framework/service/src/org/ofbiz/service/ModelService.java
>     ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/SOAPClientEngine.java
>     ofbiz/trunk/framework/service/testdef/servicetests.xml
>     ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/SOAPEventHandler.java

What about .classpath?