You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by cs...@apache.org on 2005/12/13 22:44:52 UTC

svn commit: r356627 - in /beehive/trunk/system-controls: ./ ant/ src/webservice/ src/webservice/control/ src/webservice/control/org/ src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/ src/webservice/jaxrpc-clients/ src/webserv...

Author: cschoett
Date: Tue Dec 13 13:43:55 2005
New Revision: 356627

URL: http://svn.apache.org/viewcvs?rev=356627&view=rev
Log:

Some restructuring for the service control's axis abstraction layer.  This commit is mostly some rearranging of files and build script changes. The service control's source tree has been split into two different trees:

 - system-controls/src/webservice/control
    Contains the core service control code which should not contain any axis dependencies (although there are currently a couple right now which I will remove).

 - system-controls/src/webservice/jaxrpc-clients/<client_name>
    Since we currently on have support for an axis client it is the only one there right now.

All package names have remained the same.

The build.xml file in the control source will look for a property 'jaxrpc.client' which maps to the name of a subfolder in the jaxrpc-clients tree.  The specified client is build and packaged with the webservice control.  Eventually it would be nice to be able to specify multiple clients but since we only have one right now that can be a future enhancement.



Added:
    beehive/trunk/system-controls/src/webservice/control/
    beehive/trunk/system-controls/src/webservice/control/build.xml
      - copied, changed from r356370, beehive/trunk/system-controls/src/webservice/build.xml
    beehive/trunk/system-controls/src/webservice/control/org/
      - copied from r356625, beehive/trunk/system-controls/src/webservice/org/
    beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/CallFactory.java   (with props)
    beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/GenericCall.java   (with props)
    beehive/trunk/system-controls/src/webservice/jaxrpc-clients/
    beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/
    beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/build.xml   (with props)
    beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/org/
    beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/org/apache/
    beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/org/apache/beehive/
    beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/org/apache/beehive/controls/
    beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/org/apache/beehive/controls/system/
    beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/org/apache/beehive/controls/system/jaxrpc/
    beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/org/apache/beehive/controls/system/jaxrpc/AxisCall.java   (with props)
Removed:
    beehive/trunk/system-controls/src/webservice/build.xml
    beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/ScAxisCall.java
    beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/ScCall.java
    beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/ScCallFactory.java
    beehive/trunk/system-controls/src/webservice/org/
Modified:
    beehive/trunk/system-controls/ant/systemcontrols.properties
    beehive/trunk/system-controls/build.xml
    beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.java
    beehive/trunk/system-controls/systemcontrols-imports.xml
    beehive/trunk/system-controls/test/webservice/build.xml
    beehive/trunk/system-controls/test/webservice/jcxgen-tests/build.xml

Modified: beehive/trunk/system-controls/ant/systemcontrols.properties
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/ant/systemcontrols.properties?rev=356627&r1=356626&r2=356627&view=diff
==============================================================================
--- beehive/trunk/system-controls/ant/systemcontrols.properties (original)
+++ beehive/trunk/system-controls/ant/systemcontrols.properties Tue Dec 13 13:43:55 2005
@@ -29,6 +29,9 @@
 ejbcontrol.jar.name=beehive-ejb-control.jar
 wsmcontrol.jar.name=beehive-webservice-control.jar
 
+# jaxrpc client to build with service control
+jaxrpc.client=axis
+
 #compile options
 compile.debug=true
 compile.deprecation=off

Modified: beehive/trunk/system-controls/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/build.xml?rev=356627&r1=356626&r2=356627&view=diff
==============================================================================
--- beehive/trunk/system-controls/build.xml (original)
+++ beehive/trunk/system-controls/build.xml Tue Dec 13 13:43:55 2005
@@ -37,7 +37,7 @@
         <ant dir="src/ejb" target="build" inheritAll="false"/>
         <ant dir="src/jdbc" target="build" inheritAll="false"/>
         <ant dir="src/jms" target="build" inheritAll="false"/>
-        <ant dir="src/webservice" target="build" inheritAll="false"/>
+        <ant dir="src/webservice/control" target="build" inheritAll="false"/>
 
         <echo message="--------------------------------------------------"/>
         <echo message="|      System Controls build ending              |"/>

Copied: beehive/trunk/system-controls/src/webservice/control/build.xml (from r356370, beehive/trunk/system-controls/src/webservice/build.xml)
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/build.xml?p2=beehive/trunk/system-controls/src/webservice/control/build.xml&p1=beehive/trunk/system-controls/src/webservice/build.xml&r1=356370&r2=356627&rev=356627&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/build.xml (original)
+++ beehive/trunk/system-controls/src/webservice/control/build.xml Tue Dec 13 13:43:55 2005
@@ -2,14 +2,19 @@
 
 <project name="Beehive/SystemControls/WebService" default="build" basedir=".">
 
-    <import file="../../systemcontrols-imports.xml"/>
+    <import file="../../../systemcontrols-imports.xml"/>
 
     <property name="module.name" value="webservice-control"/>
-    <property name="module.dir" location="${src.dir}/webservice"/>
+    <property name="module.dir" location="${src.dir}/webservice/control"/>
     <property name="wsc.version" value="svn-snapshot"/>
 
     <path id="module.classpath">
-        <path refid="webservices.dependency.path"/>
+        <path refid="wsm.dependency.path"/>
+        <!-- todo: we should not have a dependency on axis here! -->
+        <path refid="axis.dependency.path"/>
+        <path refid="saaj.dependency.path"/>
+        <path refid="jaxrpc.dependency.path"/>
+        <path refid="wsdl4j.dependency.path"/>
         <path refid="controls.dependency.path"/>
         <path refid="velocity.dependency.path"/>
         <path refid="commons-logging.dependency.path"/>
@@ -22,6 +27,10 @@
     <!-- ========================================= -->
     <target name="build" description="Builds webservice control.">
 
+        <echo message="--------------------------------------------------"/>
+        <echo message="|      Core Service Control build starting       |"/>
+        <echo message="--------------------------------------------------"/>
+
         <mkdir dir="${classes.dir}/${module.name}"/>
         <mkdir dir="${gen.src.dir}/${module.name}"/>
 
@@ -36,6 +45,13 @@
             </fileset>
         </copy>
 
+        <echo message="--------------------------------------------------"/>
+        <echo message="|      Core Service Control build complete       |"/>
+        <echo message="--------------------------------------------------"/>
+
+
+        <ant dir="../jaxrpc-clients/${jaxrpc.client}" target="build" inheritAll="false"/>
+
         <control-jar destfile="${build.lib.dir}/${wsmcontrol.jar.name}" basedir="${classes.dir}/${module.name}">
             <manifest>
                 <attribute name="Extension-Name" value="Beehive Web Service Control"/>
@@ -48,6 +64,7 @@
                 <attribute name="Web-Service-Control-Version" value="${beehive.version}"/>
             </manifest>
         </control-jar>
+
     </target>
 
     <!-- ========================================= -->

Added: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/CallFactory.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/CallFactory.java?rev=356627&view=auto
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/CallFactory.java (added)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/CallFactory.java Tue Dec 13 13:43:55 2005
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.system.webservice.jaxrpc;
+
+import org.apache.beehive.controls.system.webservice.ServiceControl;
+
+import javax.xml.rpc.Service;
+import java.lang.reflect.Constructor;
+
+
+/**
+ * Factory for creating the JAX-RPC call abstraction used by the service control.  This factory
+ * determines the JAX-RPC implementations available at runtime by attemmpting to load various
+ * implementations using the class loader.  If found an implementation is added to the _callMappings
+ * Map along with its service control Call abstraction.
+ */
+public final class CallFactory {
+
+    /**
+     * Return an new GenericCall based on the implementation of the Service instance.
+     *
+     * @param service Service to create call for.
+     * @return An GenericCall instance.
+     */
+    static GenericCall getCall(Service service, ServiceControl.ServiceFactoryProviderType provider) {
+
+        switch (provider) {
+            case APACHE_AXIS:
+            case DEFAULT:
+                return getProviderCallImpl("org.apache.beehive.controls.system.jaxrpc.AxisCall", service);
+            default:
+                throw new UnsupportedOperationException("JAX-RPC service implementation for: "
+                        + service.getClass().getName() + "has not been registered with the CallFactory!");
+        }
+    }
+
+    static private GenericCall getProviderCallImpl(String callClass, Service service) {
+
+        try {
+            Class axisCallClass = Class.forName(callClass);
+            Constructor c = axisCallClass.getConstructor(Service.class);
+            return (GenericCall) c.newInstance(service);
+        }
+        catch (Exception e) {
+            throw new RuntimeException("Could not create JAX-RPC call for service control", e);
+        }
+    }
+}

Propchange: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/CallFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/CallFactory.java
------------------------------------------------------------------------------
    svn:executable = *

Added: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/GenericCall.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/GenericCall.java?rev=356627&view=auto
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/GenericCall.java (added)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/GenericCall.java Tue Dec 13 13:43:55 2005
@@ -0,0 +1,402 @@
+/*
+ * B E A   S Y S T E M S
+ *
+ * N E T U I
+ *
+ * Copyright (c) 2001-2003  BEA Systems, Inc.
+ *
+ * All Rights Reserved. Unpublished rights reserved under the copyright laws
+ * of the United States. The software contained on this media is proprietary
+ * to and embodies the confidential technology of BEA Systems, Inc. The
+ * possession or receipt of this information does not convey any right to
+ * disclose its contents, reproduce it, or use,  or license the use,
+ * for manufacture or sale, the information or anything described
+ * therein. Any use, disclosure, or reproduction without BEA System's
+ * prior written permission is strictly prohibited.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.controls.system.webservice.jaxrpc;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Call;
+import javax.xml.rpc.holders.Holder;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.beehive.controls.api.ControlException;
+import org.apache.beehive.controls.system.webservice.utils.HolderUtils;
+import org.apache.beehive.controls.system.webservice.utils.TypeRegistrar;
+import org.apache.beehive.controls.system.webservice.wsdl.WsdlOpFault;
+import org.apache.beehive.controls.system.webservice.wsdl.WsdlOpFaultList;
+import org.apache.beehive.controls.system.webservice.wsdl.WsdlOpParameter;
+import org.apache.beehive.controls.system.webservice.wsdl.WsdlOpReturnType;
+import org.apache.beehive.controls.system.webservice.wsdl.WsdlOperation;
+
+/**
+ * The abstract base class for the service control's JAX-RPC Call abstraction layer.  Due to some
+ * JAX-RPC limitations it becomes necessary for the service control to use some implementation specific
+ * API's.  This base class and classes derived from it are used to hide any SOAP stack implementation
+ * specific APIs and enable the service control to perform dynamic discovery of its runtime environment.
+ */
+public abstract class GenericCall
+{
+    /**
+     * Value for wrapped operation style.
+     */
+    protected static final String WRAPPED_OPSTYLE = "wrapped";
+
+    /**
+     * Value for document operation style.
+     */
+    protected static final String DOCUMENT_OPSTYLE = "document";
+
+    /**
+     * Value for rpc operation style.
+     */
+    protected static final String RPC_OPSTYLE = "rpc";
+
+    /**
+     * JAX-RPC call.
+     */
+    protected Call _call;
+
+    /**
+     * Wsdl operation object model this call was configured with.
+     */
+    private WsdlOperation _op;
+
+    /**
+     * Number of call parameters.
+     */
+    private int _parameterCount;
+
+    /**
+     * Is this a oneway call? See JSR 181 specification.
+     */
+    protected boolean _isOneWay = false;
+
+    /**
+     * Configure this call for the specified wsdl operation.
+     *
+     * @param op       WsdlOperation used to configure the call.
+     * @param method   Webservice control's method.
+     * @param portType The port type to configure call with.
+     */
+    void configure(WsdlOperation op, Method method, QName portType) {
+
+        _op = op;
+        setOperationName(_op.getOperationName());
+        setOperationStyle(_op.getSOAPBindingStyle(), _op.getSOAPParameterStyle(), _op.getSOAPBindingUse());
+        setCallParameters(method);
+        setCallReturnType(method.getReturnType());
+        setFaults();
+        setServicePortName(portType);
+    }
+
+    /**
+     * Invoke the call.  Basically the same as calling the invoke() method on a standard JAX-RPC call object.
+     * As an added bonus this invoke method does not require that you remove any OUT mode parameters from the
+     * args array.
+     *
+     * @param args Values for the call's parameters.
+     * @return The result from the call.
+     * @throws java.rmi.RemoteException On error.
+     */
+    Object invoke(Object[] args) throws RemoteException {
+        Object result = _call.invoke(processArgs(args));
+        setHolderValues(args);
+        return result;
+    }
+
+    /**
+     * Set user defined properties from the service control.  Each of these property values can be set
+     * by the user and may change on a per-call basis.
+     *
+     * @param wsdlPort        The WSDL port. Equivalent to the setPortTypeName() JAX-RPC API.
+     * @param serviceEndpoint The service endpoint. Equivalent to the setTargetEndpointAddress() JAX-RPC API.
+     * @param username        Username for the call. Equivalent to the JAX-RPC Call.USERNAME_PROPERTY.
+     * @param password        Password for the call. Equivalent to the JAX-RPC Call.PASSWORD_PROPERTY.
+     */
+    void setUserDefinedProperties(QName wsdlPort, String serviceEndpoint, String username, String password) {
+        _call.setPortTypeName(wsdlPort);
+        _call.setTargetEndpointAddress(serviceEndpoint);
+
+        if (username != null) {
+            _call.setProperty(Call.USERNAME_PROPERTY, username);
+        }
+        else {
+            _call.removeProperty(Call.USERNAME_PROPERTY);
+        }
+
+        if (password != null) {
+            _call.setProperty(Call.PASSWORD_PROPERTY, password);
+        }
+        else {
+            _call.removeProperty(Call.PASSWORD_PROPERTY);
+        }
+    }
+
+    /* -----------------------------  Abstract Methods ------------------------- */
+
+    /**
+     * Add a parameter to the Call (abstract).
+     *
+     * @param paramName  QName of the parameter.
+     * @param paramClass Class of the parameter.
+     * @param xmlType    XMLType of the parameter.
+     * @param mode       JAX-RPC parameter mode.
+     * @param isHeader   true if this parameter should be placed in the header of the message.
+     */
+    abstract protected void addParameter(QName paramName, Class paramClass, QName xmlType,
+                                         WsdlOpParameter.ParameterMode mode, boolean isHeader);
+
+    /**
+     * Add a fault to the Call (abstract).
+     *
+     * @param faultName     QName of the fault.
+     * @param xmlType       QName of the fault's xml type.
+     * @param isComplexType Is this fault a complex data type?
+     * @param style         SOAPBindingStyle.
+     * @param use           SOAPBindingUse.
+     */
+    abstract protected void addFault(QName faultName, QName xmlType, boolean isComplexType,
+                                     WsdlOperation.SOAPBindingStyle style, WsdlOperation.SOAPBindingUse use);
+
+    /**
+     * Register a type.
+     *
+     * @param typeClass Class of type to register.
+     * @param xmlName   XML type of class to register.
+     * @param style     SOAPBinding style.
+     * @param use       SOAPBinding use.
+     * @return QName of the registered type.
+     */
+    abstract protected QName registerType(Class typeClass, QName xmlName,
+                                          WsdlOperation.SOAPBindingStyle style, WsdlOperation.SOAPBindingUse use);
+
+    /**
+     * Set the service port name for the call (abstract).  May be necessary to support JAX-RPC handlers.
+     *
+     * @param portQName QName of the service port.
+     */
+    abstract protected void setServicePortName(QName portQName);
+
+    /* -----------------------------   Protected Methods ------------------------- */
+
+    /**
+     * Mark this call as a oneway call (no return value).  See JSR181 specification for details.
+     *
+     * @param isOneWay true if one way.
+     */
+    protected void setOneWay(boolean isOneWay) {
+        _isOneWay = isOneWay;
+    }
+
+    /**
+     * Set the operation name for the call.
+     *
+     * @param opName The operation QName.
+     */
+    protected void setOperationName(QName opName) {
+        _call.setOperationName(opName);
+    }
+
+    /**
+     * Set the operation style for this call.
+     *
+     * @param style          JAX-RPC style.
+     * @param parameterStyle JAX-RPC parameter style.
+     * @param use            JAX-RPC use.
+     */
+    protected void setOperationStyle(WsdlOperation.SOAPBindingStyle style,
+                                     WsdlOperation.SOAPParameterStyle parameterStyle,
+                                     WsdlOperation.SOAPBindingUse use) {
+
+        if (style == WsdlOperation.SOAPBindingStyle.DOCUMENT) {
+            if (parameterStyle == WsdlOperation.SOAPParameterStyle.WRAPPED) {
+                _call.setProperty(Call.OPERATION_STYLE_PROPERTY, WRAPPED_OPSTYLE);
+            }
+            else {
+                _call.setProperty(Call.OPERATION_STYLE_PROPERTY, DOCUMENT_OPSTYLE);
+            }
+
+        }
+        else if (style == WsdlOperation.SOAPBindingStyle.RPC) {
+            _call.setProperty(Call.OPERATION_STYLE_PROPERTY, RPC_OPSTYLE);
+
+        }
+        else {
+            throw new ControlException("Invalid Binding style: " + style);
+        }
+    }
+
+    /**
+     * Set the return type of the Call.
+     *
+     * @param returnType    Return type class.
+     * @param xmlReturnType Return Xml type.
+     */
+    protected void setReturnType(Class returnType, QName xmlReturnType) {
+        _call.setReturnType(xmlReturnType, returnType);
+    }
+
+    /**
+     * Process the argument list for the call before the call's invoke() method is called.
+     * Processing consists of removing any OUT mode parameters and pulling values from Holders
+     * and placing them in the new argument list.
+     *
+     * @param args Argument list for a Call.
+     * @return A new argument list with any OUT mode parameters removed and Holder values insterted.
+     */
+    protected Object[] processArgs(Object[] args) {
+        ArrayList<Object> pList = new ArrayList<Object>();
+        List<WsdlOpParameter> parameters = _op.getParameters();
+
+        for (int i = 0; i < _parameterCount; i++) {
+            WsdlOpParameter.ParameterMode mode = parameters.get(i).getMode();
+            if (mode.equals(WsdlOpParameter.ParameterMode.IN)) {
+                pList.add(args[i]);
+
+            }
+            else if (mode.equals(WsdlOpParameter.ParameterMode.INOUT)) {
+                if (args[i] instanceof Holder) {
+                    try {
+                        Holder holder = (Holder) args[i];
+                        Field valueField = holder.getClass().getField("value");
+                        pList.add(valueField.get(holder));
+                    }
+                    catch (Exception e) {
+                        throw new ControlException("failed in getting holder value for call argument");
+                    }
+                }
+                else {
+                    pList.add(args[i]);
+                }
+            }
+        }
+        return pList.toArray();
+    }
+
+    /**
+     * After a Call has been invoked it is necessary to map values for OUT and INOUT mode parameters back
+     * into their Holders from the arg list to the Call.
+     *
+     * @param args The argument list which the Call was invoked with.
+     */
+    protected void setHolderValues(Object[] args) {
+        Map outParams = _call.getOutputParams();
+        if (outParams.isEmpty()) {
+            return;
+        }
+
+        List<WsdlOpParameter> parameters = _op.getParameters();
+        for (int i = 0; i < _parameterCount; i++) {
+
+            WsdlOpParameter param = parameters.get(i);
+            if (!param.getMode().equals(WsdlOpParameter.ParameterMode.IN)
+                    && args[i] instanceof Holder) {
+
+                QName paramQName = param.getName();
+                if (!param.isElementFormQualified()) {
+                    paramQName = new QName(paramQName.getLocalPart());
+                }
+
+                try {
+                    Holder holder = (Holder) args[i];
+                    if (outParams.containsKey(paramQName)) {
+                        HolderUtils.stuffHolderValue(holder, outParams.get(paramQName));
+                    }
+                }
+                catch (Exception e) {
+                    throw new ControlException("Failed in getting holder value for: " + paramQName);
+                }
+            }
+        }
+    }
+
+    /* -----------------------------   Protected Methods ------------------------- */
+
+    /**
+     * Set the parameter list for this call.
+     *
+     * @param method service control method.
+     */
+    private void setCallParameters(Method method) {
+
+        WsdlOpParameter[] operationParameters = _op.getParameters().toArray(new WsdlOpParameter[0]);
+        Class[] methodParameterTypes = method.getParameterTypes();
+        Type[] genericMethodParamTypes = method.getGenericParameterTypes();
+        _parameterCount = operationParameters.length;
+
+        if (operationParameters.length != methodParameterTypes.length) {
+            throw new ControlException("Object model and method definition don't match!");
+        }
+
+        for (int i = 0; i < methodParameterTypes.length; i++) {
+            setCallParameter(operationParameters[i], methodParameterTypes[i], genericMethodParamTypes[i]);
+        }
+    }
+
+    /**
+     * Set a call pararmeter on the call.
+     *
+     * @param opParam     Parameter.
+     * @param javaType    Java type of parameter.
+     * @param genericType Generic type of the java class.
+     */
+    private void setCallParameter(WsdlOpParameter opParam, Class javaType, Type genericType) {
+
+        WsdlOpParameter.ParameterMode mode = opParam.getMode();
+        if (mode != WsdlOpParameter.ParameterMode.IN && Holder.class.isAssignableFrom(javaType)) {
+            javaType = TypeRegistrar.getHoldersValueClass(genericType);
+        }
+
+        QName registeredTypeQName = registerType(javaType, opParam.getXmlType(),
+                                                 _op.getSOAPBindingStyle(), _op.getSOAPBindingUse());
+
+        QName paramName = opParam.getName();
+        if (!opParam.isElementFormQualified()) {
+            paramName = new QName(paramName.getLocalPart());
+        }
+        addParameter(paramName, javaType, registeredTypeQName, mode, opParam.isHeader());
+    }
+
+    /**
+     * Set the return type for the call.
+     *
+     * @param returnType Return type class.
+     */
+    private void setCallReturnType(Class returnType) {
+
+        WsdlOpReturnType rtype = _op.getReturnType();
+        QName resultTypeName = (rtype != null) ? rtype.getXmlType() : null;
+        if (!_op.isOneway() && returnType != void.class) {
+            resultTypeName = registerType(returnType, resultTypeName, _op.getSOAPBindingStyle(), _op.getSOAPBindingUse());
+        }
+        setOneWay(_op.isOneway());
+        setReturnType(returnType, resultTypeName);
+    }
+
+    /**
+     * Set the faults for the call.
+     */
+    private void setFaults() {
+
+        WsdlOpFaultList faultList = _op.getFaults();
+        for (WsdlOpFault fault : faultList) {
+            QName faultName = fault.getName();
+            if (!fault.isElementFormQualified()) {
+                faultName = new QName(faultName.getLocalPart());
+            }
+
+            addFault(faultName, fault.getXmlType(), fault.isComplextType(),
+                     _op.getSOAPBindingStyle(), _op.getSOAPBindingUse());
+        }
+    }
+}

Propchange: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/GenericCall.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/GenericCall.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.java?rev=356627&r1=356625&r2=356627&view=diff
==============================================================================
--- beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.java (original)
+++ beehive/trunk/system-controls/src/webservice/control/org/apache/beehive/controls/system/webservice/jaxrpc/ServiceControlImpl.java Tue Dec 13 13:43:55 2005
@@ -66,7 +66,7 @@
     private int _timeout = TIMOUT_DEFAULT;
 
     private transient Service _service;
-    private transient HashMap<String, ScCall> _callCache;
+    private transient HashMap<String, GenericCall> _callCache;
 
     private Element[] _handlerOutputHeaders;
     private HandlerInfo _handlerInfo;
@@ -133,7 +133,7 @@
         ServiceControl.OperationName opName = _context.getMethodPropertySet(method, ServiceControl.OperationName.class);
         WsdlOperation op = _wsdl.getOperation(opName.value());
 
-        ScCall call;
+        GenericCall call;
         if (getCallCache().containsKey(opName.value())) {
             call = getCallCache().get(opName.value());
         } else {
@@ -259,13 +259,13 @@
      * @param op
      * @return Call
      */
-    private ScCall buildCallObject(Method method, WsdlOperation op) {
+    private GenericCall buildCallObject(Method method, WsdlOperation op) {
 
 
         ServiceControl.ServiceFactoryProviderType sfpt =
                 _context.getControlPropertySet(ServiceControl.ServiceFactoryProvider.class).value();
 
-        ScCall call = ScCallFactory.getCall(getService(_serviceName), sfpt);
+        GenericCall call = CallFactory.getCall(getService(_serviceName), sfpt);
         call.configure(op, method, _portType);
         return call;
     }
@@ -315,9 +315,9 @@
      * if a serialization has occured.
      * @return HashMap
      */
-    private HashMap<String, ScCall> getCallCache() {
+    private HashMap<String, GenericCall> getCallCache() {
         if (_callCache == null) {
-            _callCache = new HashMap<String, ScCall>();
+            _callCache = new HashMap<String, GenericCall>();
         }
         return _callCache;
     }

Added: beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/build.xml?rev=356627&view=auto
==============================================================================
--- beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/build.xml (added)
+++ beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/build.xml Tue Dec 13 13:43:55 2005
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project name="Beehive/SystemControls/WebService/JaxRpcClient" default="build" basedir=".">
+
+    <import file="../../../../systemcontrols-imports.xml"/>
+
+    <property name="module.name" value="jaxrpc-client"/>
+    <property name="module.dir" location="${src.dir}/webservice/jaxrpc-clients/axis"/>
+    <property name="wsc.version" value="svn-snapshot"/>
+
+    <path id="module.classpath">
+        <path location="${classes.dir}/webservice-control"/>
+        <path refid="wsm.dependency.path"/>
+        <path refid="axis.dependency.path"/>
+    </path>
+
+    <!-- ========================================= -->
+    <!-- build - build the webservice control      -->
+    <!-- ========================================= -->
+    <target name="build" description="Builds axis client support for service control.">
+
+        <echo message="--------------------------------------------------"/>
+        <echo message="|      AXIS client support build starting        |"/>
+        <echo message="--------------------------------------------------"/>
+
+        <javac srcdir="${module.dir}"
+             destdir="${classes.dir}/webservice-control"
+             classpathref="module.classpath"
+             debug="${compiler.debug}"
+             nowarn="${compiler.nowarn}">
+        </javac>
+
+        <echo message="--------------------------------------------------"/>
+        <echo message="|      AXIS client support build complete        |"/>
+        <echo message="--------------------------------------------------"/>
+    </target>
+</project>

Propchange: beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/org/apache/beehive/controls/system/jaxrpc/AxisCall.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/org/apache/beehive/controls/system/jaxrpc/AxisCall.java?rev=356627&view=auto
==============================================================================
--- beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/org/apache/beehive/controls/system/jaxrpc/AxisCall.java (added)
+++ beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/org/apache/beehive/controls/system/jaxrpc/AxisCall.java Tue Dec 13 13:43:55 2005
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.controls.system.jaxrpc;
+
+import javax.jws.soap.SOAPBinding;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceException;
+import javax.xml.rpc.encoding.TypeMapping;
+
+import org.apache.axis.constants.Use;
+import org.apache.axis.encoding.XMLType;
+import org.apache.beehive.controls.system.webservice.wsdl.WsdlOpParameter;
+import org.apache.beehive.controls.system.webservice.wsdl.WsdlOperation;
+import org.apache.beehive.controls.system.webservice.utils.AxisTypeRegistrar;
+import org.apache.beehive.controls.system.webservice.jaxrpc.GenericCall;
+import org.apache.beehive.wsm.axis.databinding.TypeSystemLookupService;
+import org.apache.beehive.wsm.databinding.BindingLookupService;
+
+/**
+ * This is the AXIS 1.2 implementation of the call abstraction layer of the service control.
+ */
+public final class AxisCall extends GenericCall
+{
+
+    private AxisTypeRegistrar _typeRegistrar;
+
+    /**
+     * Create a new ScAxisCall instance.
+     *
+     * @param service Service to create the call with.
+     * @throws ServiceException On error.
+     */
+    public AxisCall(Service service)
+        throws ServiceException {
+        TypeMapping typeMapping = service.getTypeMappingRegistry().getDefaultTypeMapping();
+        BindingLookupService bindingLookupService = TypeSystemLookupService.getInstance();
+
+        _call = service.createCall();
+        _typeRegistrar = new AxisTypeRegistrar(typeMapping, bindingLookupService);
+    }
+
+    /* -----------------------------   Protected Methods ------------------------- */
+
+    /**
+     * Add a fault to the Call.
+     *
+     * @param faultName     QName of the fault.
+     * @param xmlType       QName of the xmltype of the fault.
+     * @param isComplexType Is the xmlType a complex type?
+     * @param style         SOAPBinding style.
+     * @param use           SOAPBinding use.
+     */
+    protected void addFault(QName faultName, QName xmlType, boolean isComplexType,
+                            WsdlOperation.SOAPBindingStyle style, WsdlOperation.SOAPBindingUse use) {
+
+        BindingLookupService bindingLookupService = TypeSystemLookupService.getInstance();
+        Class javaType = bindingLookupService.qname2class(xmlType);
+
+        QName registeredTypeQName = registerType(javaType, xmlType, style, use);
+        ((org.apache.axis.client.Call) _call).addFault(faultName, javaType, registeredTypeQName, isComplexType);
+    }
+
+    /**
+     * Add a parameter to the Call.
+     *
+     * @param paramName  QName of the parameter to add.
+     * @param paramClass Class of the parameter to add.
+     * @param xmlType    XMLType of the parameter to add.
+     * @param mode       Mode of the parameter.
+     * @param isHeader   True if this parameter should be placed in the header of the SOAP message.
+     */
+    protected void addParameter(QName paramName, Class paramClass, QName xmlType, WsdlOpParameter.ParameterMode mode, boolean isHeader) {
+
+        ParameterMode jaxrpcMode;
+        if (mode == WsdlOpParameter.ParameterMode.IN) {
+            jaxrpcMode = ParameterMode.IN;
+        }
+        else if (mode == WsdlOpParameter.ParameterMode.INOUT) {
+            jaxrpcMode = ParameterMode.INOUT;
+        }
+        else {
+            jaxrpcMode = ParameterMode.OUT;
+        }
+
+        if (isHeader) {
+            ((org.apache.axis.client.Call) _call).addParameterAsHeader(paramName, xmlType, paramClass,
+                                                                       jaxrpcMode, jaxrpcMode);
+        }
+        else {
+            ((org.apache.axis.client.Call) _call).addParameter(paramName, xmlType, paramClass, jaxrpcMode);
+        }
+    }
+
+    /**
+     * Register a type.
+     *
+     * @param typeClass
+     * @param xmlName
+     * @param style
+     * @param use
+     * @return QName
+     */
+    protected QName registerType(Class typeClass, QName xmlName,
+                                 WsdlOperation.SOAPBindingStyle style, WsdlOperation.SOAPBindingUse use) {
+
+        SOAPBinding.Style jaxrpcStyle =
+                (style == WsdlOperation.SOAPBindingStyle.DOCUMENT) ? SOAPBinding.Style.DOCUMENT : SOAPBinding.Style.RPC;
+        SOAPBinding.Use jaxrpcUse =
+                (use == WsdlOperation.SOAPBindingUse.LITERAL) ? SOAPBinding.Use.LITERAL : SOAPBinding.Use.ENCODED;
+
+        return _typeRegistrar.registerType(typeClass, xmlName, jaxrpcStyle, jaxrpcUse);
+    }
+
+    /**
+     * Set the operational style of the Call.
+     *
+     * @param style          JAX-RPC style.
+     * @param parameterStyle JAX-RPC parameter style.
+     * @param use            JAX-RPC use.
+     */
+    protected void setOperationStyle(WsdlOperation.SOAPBindingStyle style,
+                                     WsdlOperation.SOAPParameterStyle parameterStyle,
+                                     WsdlOperation.SOAPBindingUse use) {
+        super.setOperationStyle(style, parameterStyle, use);
+
+        if (style == WsdlOperation.SOAPBindingStyle.RPC && use == WsdlOperation.SOAPBindingUse.LITERAL) {
+            ((org.apache.axis.client.Call) _call).setOperationUse(Use.LITERAL);
+        }
+    }
+
+    /**
+     * Set the return type for the Call.
+     *
+     * @param returnType    Java return type.
+     * @param xmlReturnType Xml return type.
+     */
+    protected void setReturnType(Class returnType, QName xmlReturnType) {
+        if (!_isOneWay && returnType != void.class) {
+            super.setReturnType(returnType, xmlReturnType);
+        }
+        else {
+            _call.setReturnType(XMLType.AXIS_VOID);
+        }
+    }
+
+    /**
+     * Set the port name for the call.
+     *
+     * @param portQName QName .
+     */
+    protected void setServicePortName(QName portQName) {
+        _call.setProperty(org.apache.axis.client.Call.WSDL_PORT_NAME, portQName);
+    }
+}

Propchange: beehive/trunk/system-controls/src/webservice/jaxrpc-clients/axis/org/apache/beehive/controls/system/jaxrpc/AxisCall.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/system-controls/systemcontrols-imports.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/systemcontrols-imports.xml?rev=356627&r1=356626&r2=356627&view=diff
==============================================================================
--- beehive/trunk/system-controls/systemcontrols-imports.xml (original)
+++ beehive/trunk/system-controls/systemcontrols-imports.xml Tue Dec 13 13:43:55 2005
@@ -14,13 +14,29 @@
 
     <property file="${beehive.home}/system-controls/ant/systemcontrols.properties"/>
 
-    <path id="webservices.dependency.path">
+    <path id="wsm.dependency.path">
         <fileset file="${beehive.home}/wsm/build/jars/beehive-wsm.jar"/>
         <fileset file="${beehive.home}/wsm/build/jars/beehive-wsm-axis.jar"/>
         <fileset file="${beehive.home}/wsm/build/jars/beehive-wsdltypes.jar"/>
         <fileset file="${beehive.home}/wsm/build/jars/beehive-jsr181.jar"/>
-        <fileset dir="${beehive.home}/wsm/external/axis-1.2" includes="*.jar"/>
         <path refid="servlet.dependency.path"/>
+    </path>
+
+    <path id="axis.dependency.path">
+        <fileset dir="${beehive.home}/wsm/external/axis-1.2" includes="axis.jar"/>
+        <fileset dir="${beehive.home}/wsm/external/axis-1.2" includes="jaxrpc.jar"/>
+    </path>
+
+    <path id="jaxrpc.dependency.path">
+        <fileset dir="${beehive.home}/wsm/external/axis-1.2" includes="jaxrpc.jar"/>
+    </path>
+
+    <path id="saaj.dependency.path">
+        <fileset dir="${beehive.home}/wsm/external/axis-1.2" includes="saaj.jar"/>
+    </path>
+
+    <path id="wsdl4j.dependency.path">
+        <fileset dir="${beehive.home}/wsm/external/axis-1.2" includes="wsdl4j.jar"/>
     </path>
 
     <path id="ejb.dependency.path">

Modified: beehive/trunk/system-controls/test/webservice/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/build.xml?rev=356627&r1=356626&r2=356627&view=diff
==============================================================================
--- beehive/trunk/system-controls/test/webservice/build.xml (original)
+++ beehive/trunk/system-controls/test/webservice/build.xml Tue Dec 13 13:43:55 2005
@@ -60,7 +60,11 @@
     <path id="client.classpath">
         <pathelement path="${client.classes}"/>
         <pathelement path="${beehive-webservice-control.jar}"/>
-        <path refid="webservices.dependency.path"/>
+        <path refid="wsm.dependency.path"/>
+        <path refid="axis.dependency.path"/>
+        <path refid="saaj.dependency.path"/>
+        <path refid="jaxrpc.dependency.path"/>
+        <path refid="wsdl4j.dependency.path"/>
         <path refid="controls.dependency.path"/>
         <path refid="junit.dependency.path"/>
         <path refid="xbean.dependency.path"/>

Modified: beehive/trunk/system-controls/test/webservice/jcxgen-tests/build.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/system-controls/test/webservice/jcxgen-tests/build.xml?rev=356627&r1=356626&r2=356627&view=diff
==============================================================================
--- beehive/trunk/system-controls/test/webservice/jcxgen-tests/build.xml (original)
+++ beehive/trunk/system-controls/test/webservice/jcxgen-tests/build.xml Tue Dec 13 13:43:55 2005
@@ -36,7 +36,11 @@
               location="${beehive.home}/system-controls/build/jars/beehive-webservice-control.jar"/>
 
     <path id="beehive.classpath">
-        <path refid="webservices.dependency.path"/>
+        <path refid="wsm.dependency.path"/>
+        <path refid="wsdl4j.dependency.path"/>
+        <path refid="axis.dependency.path"/>
+        <path refid="jaxrpc.dependency.path"/>
+        <path refid="saaj.dependency.path"/>
         <path refid="controls.dependency.path"/>
         <path refid="junit.dependency.path"/>
     </path>