You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/06/23 19:25:08 UTC

svn commit: r193188 [3/3] - in /incubator/beehive/sandbox/ekoneil: ./ controls/src/api/org/apache/beehive/controls/api/properties/ controls/test/infra/tch/ controls/test/tools/tch/ external/xmlbeans/ netui/src/compiler-core/org/apache/beehive/netui/com...

Modified: incubator/beehive/sandbox/ekoneil/wsm/drt/tests/org/apache/beehive/wsm/axis/AxisHookTest.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/drt/tests/org/apache/beehive/wsm/axis/AxisHookTest.java?rev=193188&r1=193187&r2=193188&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/drt/tests/org/apache/beehive/wsm/axis/AxisHookTest.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/drt/tests/org/apache/beehive/wsm/axis/AxisHookTest.java Thu Jun 23 10:25:04 2005
@@ -34,10 +34,11 @@
 import org.apache.beehive.wsm.model.BeehiveWsMethodMetadata;
 import org.apache.beehive.wsm.model.BeehiveWsParameterMetadata;
 import org.apache.beehive.wsm.model.BeehiveWsTypeMetadata;
-import org.apache.beehive.wsm.model.jsr181.Jsr181MethodMetadataImpl;
+import org.apache.beehive.wsm.model.impl.DefaultMethodMetadataImpl;
+import org.apache.beehive.wsm.model.impl.DefaultSOAPBindingInfoImpl;
 import org.apache.beehive.wsm.model.jsr181.Jsr181ParameterMetadataImpl;
 import org.apache.beehive.wsm.model.jsr181.Jsr181TypeMetadataImpl;
-import org.apache.beehive.wsm.model.jsr181.SOAPBindingInfo;
+import org.apache.beehive.wsm.model.BeehiveWsSOAPBindingInfo;
 
 /**
  *
@@ -153,7 +154,7 @@
 
     protected BeehiveWsMethodMetadata makeFakeOnewayMethod() {
         BeehiveWsMethodMetadata wsmm =
-            new Jsr181MethodMetadataImpl(WM_JAVAONEWAYMETHODNAME, Void.TYPE);
+            new DefaultMethodMetadataImpl(WM_JAVAONEWAYMETHODNAME, Void.TYPE);
         wsmm.setWmOperationName(WM_ONEWAY + WM_OPERATION);
         wsmm.setWmAction(WM_ONEWAY + WM_ACTION);
         wsmm.setOneWay(true);
@@ -169,7 +170,7 @@
     
     protected BeehiveWsMethodMetadata makeFakeMethod() {
         BeehiveWsMethodMetadata wsmm =
-            new Jsr181MethodMetadataImpl(WM_JAVAMETHODNAME, String.class);
+            new DefaultMethodMetadataImpl(WM_JAVAMETHODNAME, String.class);
         wsmm.setWmOperationName(WM_OPERATION);
         wsmm.setWmAction(WM_ACTION);
         wsmm.setWrName(WM_RESULT);
@@ -184,7 +185,7 @@
     
     protected BeehiveWsMethodMetadata makeFakeMethodWithException() {
         BeehiveWsMethodMetadata wsmm =
-            new Jsr181MethodMetadataImpl(WM_JAVAMETHODWITHEXCEPIONNAME, String.class);
+            new DefaultMethodMetadataImpl(WM_JAVAMETHODWITHEXCEPIONNAME, String.class);
         wsmm.setWmOperationName(WM_EXCEPTION + WM_OPERATION);
         wsmm.setWmAction(WM_EXCEPTION + WM_ACTION);
         wsmm.setWrName(WM_RESULT);
@@ -197,8 +198,8 @@
         return wsmm;
     }
 
-    protected SOAPBindingInfo makeFakeSoapBinding() {
-        SOAPBindingInfo sbi = new SOAPBindingInfo();
+    protected BeehiveWsSOAPBindingInfo makeFakeSoapBinding() {
+        BeehiveWsSOAPBindingInfo sbi = new DefaultSOAPBindingInfoImpl();
         sbi.setStyle(SOAPBinding.Style.DOCUMENT);
         sbi.setUse(SOAPBinding.Use.LITERAL);
         sbi.setParameterStyle(SOAPBinding.ParameterStyle.WRAPPED);

Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsMethodMetadata.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsMethodMetadata.java?rev=193188&r1=193187&r2=193188&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsMethodMetadata.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsMethodMetadata.java Thu Jun 23 10:25:04 2005
@@ -21,50 +21,48 @@
 import javax.xml.namespace.QName;
 
 /**
- * @author Daryoush
  */
-public interface BeehiveWsMethodMetadata {
-    
-    boolean isOneWay();
+public abstract class BeehiveWsMethodMetadata {
 
-    void setOneWay(boolean oneway);
+    public abstract boolean isOneWay();
 
-    String getWmAction();
+    public abstract void setOneWay(boolean oneway);
 
-    void setWmAction(String wmAction);
+    public abstract String getWmAction();
 
-    String getWmOperationName();
+    public abstract void setWmAction(String wmAction);
 
-    void setWmOperationName(String wmOperationName);
+    public abstract String getWmOperationName();
 
-    String getWrName();
+    public abstract void setWmOperationName(String wmOperationName);
 
-    void setWrName(String wrName);
+    public abstract String getWrName();
 
-    String getWrTargetNamespace();
+    public abstract void setWrName(String wrName);
 
-    void setWrTargetNamespace(String wrTargetNamespace);
+    public abstract String getWrTargetNamespace();
 
-    List<BeehiveWsParameterMetadata> getParams();
+    public abstract void setWrTargetNamespace(String wrTargetNamespace);
 
-    void addParam(BeehiveWsParameterMetadata parameter);
+    public abstract List<BeehiveWsParameterMetadata> getParams();
 
-    void addParams(List<? extends BeehiveWsParameterMetadata> parameters);
+    public abstract void addParam(BeehiveWsParameterMetadata parameter);
 
-    BeehiveWsParameterMetadata findParam(String parmName);
+    public abstract void addParams(List<? extends BeehiveWsParameterMetadata> parameters);
 
-    String getJavaMethodName();
+    public abstract BeehiveWsParameterMetadata findParam(String parmName);
 
-    Class getJavaReturnType();
+    public abstract String getJavaMethodName();
 
-    String getJavaReturnTypeFullName();
+    public abstract void setJavaMethodName(String methodName);
 
-    QName getXmlReturnType();
+    public abstract Class getJavaReturnType();
 
-    void setXmlReturnType(QName xmlType);
+    public abstract String getJavaReturnTypeFullName();
 
-    /**
-     * @param javaType
-     */
-    void setReturnType(Class javaType);
+    public abstract QName getXmlReturnType();
+
+    public abstract void setXmlReturnType(QName xmlType);
+
+    public abstract void setReturnType(Class javaType);
 }

Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsParameterMetadata.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsParameterMetadata.java?rev=193188&r1=193187&r2=193188&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsParameterMetadata.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsParameterMetadata.java Thu Jun 23 10:25:04 2005
@@ -21,33 +21,33 @@
 import javax.xml.namespace.QName;
 
 /**
- * @author Daryoush
  */
-public interface BeehiveWsParameterMetadata {
-    
-    boolean isWpHeader();
+public abstract class BeehiveWsParameterMetadata {
 
-    void setWpHeader(boolean wpHeader);
+    public abstract boolean isWpHeader();
 
-    WebParam.Mode getWpMode();
+    public abstract void setWpHeader(boolean wpHeader);
 
-    void setWpMode(WebParam.Mode wpMode);
+    public abstract WebParam.Mode getWpMode();
 
-    String getWpName();
+    public abstract void setWpMode(WebParam.Mode wpMode);
 
-    void setWpName(String wpName);
+    public abstract String getWpName();
 
-    String getWpTargetNamespace();
+    public abstract void setWpName(String wpName);
 
-    void setWpTargetNamespace(String wpTargetNamespace);
+    public abstract String getWpTargetNamespace();
 
-    Class getJavaType();
+    public abstract void setWpTargetNamespace(String wpTargetNamespace);
 
-    void setJavaType(Class javaType);
+    public abstract Class getJavaType();
 
-    String getJavaTypeFullName();   // this should be moved to web service elementtype later.
+    public abstract void setJavaType(Class javaType);
 
-    QName getXmlType();
+    /* todo: this should be moved to web service elementtype later. */
+    public abstract String getJavaTypeFullName(); 
 
-    void setXmlType(QName xmlType);
+    public abstract QName getXmlType();
+
+    public abstract void setXmlType(QName xmlType);
 }

Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsSOAPBindingInfo.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsSOAPBindingInfo.java?rev=193188&r1=193187&r2=193188&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsSOAPBindingInfo.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsSOAPBindingInfo.java Thu Jun 23 10:25:04 2005
@@ -20,9 +20,8 @@
 import javax.jws.soap.SOAPBinding;
 
 /**
- * @author dmehrtash
  */
-public interface BeehiveWsSOAPBindingInfo {
+public abstract class BeehiveWsSOAPBindingInfo {
     
     /**
      * @return Returns the parameterStyle.
@@ -32,8 +31,7 @@
     /**
      * @param parameterStyle The parameterStyle to set.
      */
-    public abstract void setParameterStyle(
-        SOAPBinding.ParameterStyle parameterStyle);
+    public abstract void setParameterStyle(SOAPBinding.ParameterStyle parameterStyle);
 
     /**
      * @return Returns the style.

Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsSOAPMessageHandlerInfo.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsSOAPMessageHandlerInfo.java?rev=193188&r1=193187&r2=193188&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsSOAPMessageHandlerInfo.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsSOAPMessageHandlerInfo.java Thu Jun 23 10:25:04 2005
@@ -21,9 +21,8 @@
 import java.util.Map;
 
 /**
- * @author dmehrtash
  */
-public interface BeehiveWsSOAPMessageHandlerInfo {
+public abstract class BeehiveWsSOAPMessageHandlerInfo {
 
     /**
      * @return Returns the className.

Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsTypeMetadata.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsTypeMetadata.java?rev=193188&r1=193187&r2=193188&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsTypeMetadata.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/BeehiveWsTypeMetadata.java Thu Jun 23 10:25:04 2005
@@ -20,52 +20,49 @@
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.beehive.wsm.model.java.JavaTypeInfo;
-
 /**
- * @author Daryoush
  */
-public interface BeehiveWsTypeMetadata {
+public abstract class  BeehiveWsTypeMetadata {
 
-    String getHcFileName();
+    public abstract String getHcFileName();
 
-    void setHcFileName(String hcFileName);
+    public abstract void setHcFileName(String hcFileName);
 
-    public String getHcName();
+    public abstract  String getHcName();
 
-    public void setHcName(String hcName);
+    public abstract  void setHcName(String hcName);
 
-    String getSiValue();
+    public abstract String getSiValue();
 
-    void setSiValue(String siValue);
+    public abstract void setSiValue(String siValue);
 
-    BeehiveWsSOAPBindingInfo getSoapBinding();
+    public abstract BeehiveWsSOAPBindingInfo getSoapBinding();
 
-    void setSoapBinding(BeehiveWsSOAPBindingInfo soapBinding);
+    public abstract void setSoapBinding(BeehiveWsSOAPBindingInfo soapBinding);
 
-    String getWsName();
+    public abstract String getWsName();
 
-    void setWsName(String wsName);
+    public abstract void setWsName(String wsName);
 
-    String getWsServiceName();
+    public abstract String getWsServiceName();
 
-    void setWsServiceName(String wsServiceName);
+    public abstract void setWsServiceName(String wsServiceName);
 
-    String getWsTargetNamespace();
+    public abstract String getWsTargetNamespace();
 
-    void setWsTargetNamespace(String wsTargetNamespace);
+    public abstract void setWsTargetNamespace(String wsTargetNamespace);
 
-    public String[] getTargetNamespaceParts();
+    public abstract  String[] getTargetNamespaceParts();
 
-    String getWsEndpointInterface();
+    public abstract String getWsEndpointInterface();
 
-    void setWsEndpointInterface(String wsEndpointInterface);
+    public abstract void setWsEndpointInterface(String wsEndpointInterface);
 
-    String getWsWsdlLocation();
+    public abstract String getWsWsdlLocation();
 
-    void setWsWsdlLocation(String wsWsdlLocation);
+    public abstract void setWsWsdlLocation(String wsWsdlLocation);
 
-    Collection<? extends BeehiveWsMethodMetadata> getMethods();
+    public abstract Collection<? extends BeehiveWsMethodMetadata> getMethods();
 
     public abstract BeehiveWsMethodMetadata getMethod(String methodName, Class... paramTypes);
 
@@ -73,17 +70,16 @@
      * @throws ValidationException if duplicate methods are encountered or if a
      *                             Document style service attempts to overload methods.
      */
-    void addMethod(BeehiveWsMethodMetadata method)
+    public abstract void addMethod(BeehiveWsMethodMetadata method)
         throws ValidationException;
 
-    List<? extends BeehiveWsSOAPMessageHandlerInfo> getSoapHandlers();
+    public abstract List<? extends BeehiveWsSOAPMessageHandlerInfo> getSoapHandlers();
+
+    public abstract void addSOAPHandler(BeehiveWsSOAPMessageHandlerInfo soapHandler);
 
-    void addSOAPHandler(BeehiveWsSOAPMessageHandlerInfo soapHandler);
+    public abstract String getClassName();
 
-    String getClassName();
+    public abstract void setClassName(String className);
 
-    void setClassName(String className);
 
-    void merge(JavaTypeInfo jt)
-        throws Exception;
 }

Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181MethodMetadataImpl.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181MethodMetadataImpl.java?rev=193188&r1=193187&r2=193188&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181MethodMetadataImpl.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181MethodMetadataImpl.java Thu Jun 23 10:25:04 2005
@@ -20,52 +20,24 @@
 import java.lang.annotation.Annotation;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import javax.jws.Oneway;
 import javax.jws.WebMethod;
 import javax.jws.WebParam;
 import javax.jws.WebResult;
-import javax.xml.namespace.QName;
 
-import org.apache.beehive.wsm.model.BeehiveWsMethodMetadata;
 import org.apache.beehive.wsm.model.BeehiveWsParameterMetadata;
-import org.apache.beehive.wsm.model.ValidationException;
+import org.apache.beehive.wsm.model.impl.DefaultMethodMetadataImpl;
 import org.apache.beehive.wsm.model.java.JavaMethodInfo;
 import org.apache.beehive.wsm.model.java.JavaParameterInfo;
 
 public class Jsr181MethodMetadataImpl
-    implements BeehiveWsMethodMetadata, java.io.Serializable {
+    extends DefaultMethodMetadataImpl
+    implements java.io.Serializable {
 
     private static final long serialVersionUID = 1L;
     private static final String DEFAULT_WRNAME = "return";
 
-    private String wmOperationName;
-    private String wmAction;
-    private boolean oneway = false;
-    private List<BeehiveWsParameterMetadata> params = new ArrayList<BeehiveWsParameterMetadata>();
-    private String wrName;
-    private String wrTargetNamespace;
-    private String javaMethodName;
-    private Class javaReturnType;
-    private QName mXMLReturnType;
-
-    public void validate()
-        throws ValidationException {
-        return; // no validation required
-    }
-
-    public Jsr181MethodMetadataImpl(String operationName, Class javaType, QName xmlReturnType) {
-        this(operationName, javaType);
-        setXmlReturnType(xmlReturnType);
-    }
-
-    public Jsr181MethodMetadataImpl(String methodName, Class returnType) {
-        super();
-        javaMethodName = methodName;
-        javaReturnType = returnType;
-    }
-
     public Jsr181MethodMetadataImpl(JavaMethodInfo jm) {
 
         super();
@@ -76,8 +48,11 @@
             return;
         }
 
-        javaMethodName = jm.getMethodName();
-        javaReturnType = jm.getReturnType();
+        String javaMethodName = jm.getMethodName();
+        Class javaReturnType = jm.getReturnType();
+
+        setJavaMethodName(javaMethodName);
+        setReturnType(javaReturnType);
 
         // get webMethod's webParams
         List<BeehiveWsParameterMetadata> webParams = new ArrayList<BeehiveWsParameterMetadata>();
@@ -171,181 +146,5 @@
         }
     }
 
-    public boolean isOneWay() {
-        return oneway;
-    }
-
-    public void setOneWay(boolean oneway) {
-        this.oneway = oneway;
-    }
-
-    public String getWmAction() {
-        return wmAction;
-    }
-
-    public void setWmAction(String wmAction) {
-        this.wmAction = wmAction;
-    }
-
-    public String getWmOperationName() {
-        return wmOperationName;
-    }
-
-    public void setWmOperationName(String wmOperationName) {
-        this.wmOperationName = wmOperationName;
-    }
-
-    public String getWrName() {
-        return wrName;
-    }
-
-    public void setWrName(String wrName) {
-        this.wrName = wrName;
-    }
-
-    public String getWrTargetNamespace() {
-        return wrTargetNamespace;
-    }
-
-    public void setWrTargetNamespace(String wrTargetNamespace) {
-        this.wrTargetNamespace = wrTargetNamespace;
-    }
-
-    public List<BeehiveWsParameterMetadata> getParams() {
-        return Collections.unmodifiableList(params);
-    }
-
-    public void addParams(List<? extends BeehiveWsParameterMetadata> parameters) {
-        if(null != parameters) {
-            params.addAll(parameters);
-        }
-        // todo: checks
-    }
-
-    public void addParam(BeehiveWsParameterMetadata parameter) {
-        if(null != parameter) {
-            params.add(parameter);
-        }
-        // todo: checks
-    }
-
-    public String getJavaMethodName() {
-        return javaMethodName;
-    }
-
-    public Class getJavaReturnType() {
-        return javaReturnType;
-    }
 
-    public String getSignature() {
-        StringBuilder sb = new StringBuilder(getJavaMethodName());
-        sb.append('(');
-        boolean firstParam = true;
-        if(null != params) {
-            for(BeehiveWsParameterMetadata p : params) {
-                if(firstParam) {
-                    firstParam = false;
-                }
-                else {
-                    sb.append(',');
-                }
-                sb.append(p.getJavaType());
-            }
-        }
-        sb.append(')');
-        return sb.toString();
-    }
-
-    public String toString() {
-        String signature = getJavaReturnType().toString() + " " + getJavaMethodName() + "( ";
-        for(BeehiveWsParameterMetadata p : params) {
-            signature += p.getJavaType().toString() + " ";
-        }
-        return signature + ")";
-    }
-
-    public boolean equals(Object o) {
-        if(! (o instanceof Jsr181MethodMetadataImpl)) {
-            return false;
-        }
-        Jsr181MethodMetadataImpl m = (Jsr181MethodMetadataImpl)o;
-
-        // check name
-        if(! getJavaMethodName().equals(m.getJavaMethodName())) {
-            return false;
-        }
-
-        // check return type
-        if(! getJavaReturnType().equals(m.getJavaReturnType())) {
-            return false;
-        }
-
-        // check all parameters (types, not names!)
-        if(params.size() != m.params.size()) {
-            return false;
-        }
-        for(int i = 0; i < params.size(); i++) {
-            if(! m.params.get(i).getJavaType().equals(params.get(i).getJavaType())) {
-                return false;
-            }
-        }
-        // check exceptions?
-
-        return true;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.beehive.wsm.jsr181.model.Jsr181MethodMetadata#getJavaReturnTypeFullName()
-     *
-     * NOTE THIS METHOD AND SUPPORTING METHOD SHOULD BE MOVED OUT TO A ELEMENT CLASS
-     * THAT ENCAPSULATES QNAME AND CLASS
-
-     */
-    public String getJavaReturnTypeFullName() {
-        return getClassName(getJavaReturnType());
-    }
-
-    private String getClassName(Class cls) {
-        if(cls.isArray()) {
-            return getClassName(cls.getComponentType()) + "[]";
-        }
-        else {
-            return cls.getName().replace('$', '.');
-        }
-    }
-
-    public QName getXmlReturnType() {
-        return mXMLReturnType;
-    }
-
-    public void setXmlReturnType(QName xmlReturnType) {
-        mXMLReturnType = xmlReturnType;
-    }
-
-    /*
-      * @see org.apache.beehive.wsm.jsr181.model.Jsr181MethodMetadata#setReturnType(java.lang.Class)
-      */
-    public void setReturnType(Class javaType) {
-        this.javaReturnType = javaType;
-
-    }
-
-    /*
-     * @see org.apache.beehive.wsm.jsr181.model.BeehiveWsMethodMetadata#findParam(java.lang.String)
-     */
-    public BeehiveWsParameterMetadata findParam(String parmName) {
-        // walk the list of parameters until the parameter with paramName is found
-        // there are small number of parameters, so walking the list should be ok
-        if(null == parmName)
-            return null;
-
-        BeehiveWsParameterMetadata res = null;
-        for(BeehiveWsParameterMetadata nxtParam : params) {
-            if(parmName.equals(nxtParam.getWpName())) {
-                res = nxtParam;
-                break;
-            }
-        }
-        return res;
-    }
 }

Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ParameterMetadataImpl.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ParameterMetadataImpl.java?rev=193188&r1=193187&r2=193188&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ParameterMetadataImpl.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181ParameterMetadataImpl.java Thu Jun 23 10:25:04 2005
@@ -20,29 +20,16 @@
 import java.lang.annotation.Annotation;
 import java.util.Collection;
 import javax.jws.WebParam;
-import javax.xml.namespace.QName;
 
-import org.apache.beehive.wsm.model.BeehiveWsParameterMetadata;
-import org.apache.beehive.wsm.model.ValidationException;
+import org.apache.beehive.wsm.model.impl.DefaultParameterMetadataImpl;
 import org.apache.beehive.wsm.model.java.JavaParameterInfo;
 
 public class Jsr181ParameterMetadataImpl
-    implements BeehiveWsParameterMetadata, java.io.Serializable {
+    extends DefaultParameterMetadataImpl
+    implements java.io.Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    private String wpName;
-    private String wpTargetNamespace;
-    private WebParam.Mode wpMode;
-    private boolean wpHeader;
-    private Class javaType;
-    private QName mXMLType;
-
-    public void validate()
-        throws ValidationException {
-        return; // no validation required
-    }
-
     public Jsr181ParameterMetadataImpl() {
     }
 
@@ -56,7 +43,7 @@
             return;
         }
 
-        javaType = jp.getType();
+        setJavaType( jp.getType());
 
         // set default values
         setWpName(jp.getName());
@@ -76,46 +63,6 @@
         }
     }
 
-    public boolean isWpHeader() {
-        return wpHeader;
-    }
-
-    public void setWpHeader(boolean wpHeader) {
-        this.wpHeader = wpHeader;
-    }
-
-    public WebParam.Mode getWpMode() {
-        return wpMode;
-    }
-
-    public void setWpMode(WebParam.Mode wpMode) {
-        this.wpMode = wpMode;
-    }
-
-    public String getWpName() {
-        return wpName;
-    }
-
-    public void setWpName(String wpName) {
-        this.wpName = wpName;
-    }
-
-    public String getWpTargetNamespace() {
-        return wpTargetNamespace;
-    }
-
-    public void setWpTargetNamespace(String wpTargetNamespace) {
-        this.wpTargetNamespace = wpTargetNamespace;
-    }
-
-    public Class getJavaType() {
-        return javaType;
-    }
-
-    public void setJavaType(Class javaType) {
-        this.javaType = javaType;
-    }
-
     private void initFromAnnotation(WebParam annotation) {
         if(null != annotation) {
             if(0 < annotation.name().length()) {
@@ -125,32 +72,5 @@
             setWpMode(annotation.mode());
             setWpHeader(annotation.header());
         }
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.beehive.wsm.jsr181.model.Jsr181ParameterMetadata#getJavaTypeFullName()
-     *
-     * NOTE THIS METHOD AND SUPPORTING METHOD SHOULD BE MOVED OUT TO A ELEMENT CLASS
-     * THAT ENCAPSULATES QNAME AND CLASS
-     */
-    public String getJavaTypeFullName() {
-        return getClassName(getJavaType());
-    }
-
-    private String getClassName(Class cls) {
-        if(cls.isArray()) {
-            return getClassName(cls.getComponentType()) + "[]";
-        }
-        else {
-            return cls.getName().replace('$', '.');
-        }
-    }
-
-    public QName getXmlType() {
-        return mXMLType;
-    }
-
-    public void setXmlType(QName xmlType) {
-        mXMLType = xmlType;
     }
 }

Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181TypeMetadataImpl.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181TypeMetadataImpl.java?rev=193188&r1=193187&r2=193188&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181TypeMetadataImpl.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/jsr181/Jsr181TypeMetadataImpl.java Thu Jun 23 10:25:04 2005
@@ -25,12 +25,8 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
 import javax.jws.HandlerChain;
 import javax.jws.WebMethod;
 import javax.jws.WebService;
@@ -43,6 +39,9 @@
 import org.apache.beehive.wsm.model.BeehiveWsSOAPBindingInfo;
 import org.apache.beehive.wsm.model.BeehiveWsSOAPMessageHandlerInfo;
 import org.apache.beehive.wsm.model.BeehiveWsTypeMetadata;
+import org.apache.beehive.wsm.model.impl.DefaultSOAPBindingInfoImpl;
+import org.apache.beehive.wsm.model.impl.DefaultSOAPMessageHandlerInfoImpl;
+import org.apache.beehive.wsm.model.impl.DefaultTypeMetadataImpl;
 import org.apache.beehive.wsm.model.ValidationException;
 import org.apache.beehive.wsm.model.java.JavaMethodInfo;
 import org.apache.beehive.wsm.model.java.JavaTypeInfo;
@@ -61,23 +60,9 @@
  *
  */
 public class Jsr181TypeMetadataImpl
-    implements BeehiveWsTypeMetadata, java.io.Serializable {
+    extends DefaultTypeMetadataImpl implements java.io.Serializable {
 
     private static final long serialVersionUID = 1L;
-
-    private String wsName;
-    private String wsServiceName;
-    private String wsWsdlLocation;
-    private String wsTargetNamespace;
-    private String wsEndpointInterface;
-    private Map<String, BeehiveWsMethodMetadata> methodMap = new HashMap<String, BeehiveWsMethodMetadata>();
-    private Set<BeehiveWsMethodMetadata> noDuplicateMethods;
-    private BeehiveWsSOAPBindingInfo soapBinding;
-    private String hcFileName;
-    private String hcName;
-    private List<BeehiveWsSOAPMessageHandlerInfo> soapHandlers = new ArrayList<BeehiveWsSOAPMessageHandlerInfo>();
-    private String siValue;
-    private String className;
     private File baseLocation;
 
     /**
@@ -138,9 +123,9 @@
             jt.logError("no annotations or web methods found");
         }
 
-        // check required parameter: className
-        className = jt.getName();
-        if((null == className) || (0 == className.length())) {
+        // check required parameter: getClassName()
+        setClassName(jt.getName());
+        if((null == getClassName()) || (0 == getClassName().length())) {
             jt.logError("web service class is null");
         }
         baseLocation = jt.getLocation();
@@ -257,7 +242,7 @@
         }
 
         // initialize fields with values from annotations
-        wsEndpointInterface = annotation.endpointInterface().trim();
+        setWsEndpointInterface(annotation.endpointInterface().trim());
 
         setWsName(annotation.name());
         setWsTargetNamespace(annotation.targetNamespace());
@@ -268,7 +253,7 @@
         // set default values
 
         // name
-        String name = className;
+        String name = getClassName();
         if(-1 < name.indexOf('.')) {
             int index = name.lastIndexOf('.');
             name = name.substring(index + 1);
@@ -278,7 +263,7 @@
         }
 
         // serviceName
-        String serviceName = className;
+        String serviceName = getClassName();
         if(-1 < serviceName.indexOf('.')) {
             int index = serviceName.lastIndexOf('.');
             serviceName = serviceName.substring(index + 1);
@@ -289,7 +274,7 @@
 
         // targetNamespace
         if(0 == getWsTargetNamespace().length()) {
-            setWsTargetNamespace(getTargetNamespace(className));
+            setWsTargetNamespace(getTargetNamespace(getClassName()));
         }
     }
 
@@ -300,7 +285,7 @@
         }
 
         // set soap binding from annotation
-        setSoapBinding(new SOAPBindingInfo(annotation));
+        setSoapBinding(new DefaultSOAPBindingInfoImpl(annotation));
 
         // validate soap binding
         BeehiveWsSOAPBindingInfo sbi = getSoapBinding();
@@ -337,7 +322,7 @@
             throw new IllegalArgumentException("@SOAPMessageHandlers and @HandlerChain are mutually exclusive");
 
         for(SOAPMessageHandler soapMessageHandler : annotation.value()) {
-            BeehiveWsSOAPMessageHandlerInfo smhi = new SOAPMessageHandlerInfo(soapMessageHandler);
+            BeehiveWsSOAPMessageHandlerInfo smhi = new DefaultSOAPMessageHandlerInfoImpl(soapMessageHandler);
             // todo: validate smhi.getClassName()
             addSOAPHandler(smhi);
         }
@@ -420,262 +405,14 @@
                 for(org.apache.beehive.wsm.handlerconfig.j2ee.String soapRole : handler.getSoapRoleArray())
                     roles.add(soapRole.getStringValue());
 
-                SOAPMessageHandlerInfo soapHandler =
-                    new SOAPMessageHandlerInfo(handlerClassName, handlerName, initParams, roles, headers);
+                BeehiveWsSOAPMessageHandlerInfo soapHandler =
+                    new DefaultSOAPMessageHandlerInfoImpl(handlerClassName, handlerName, initParams, roles, headers);
 
                 addSOAPHandler(soapHandler);
             }
         }
     }
 
-    /**
-     * @return Returns the hcFileName.
-     */
-    public String getHcFileName() {
-        return hcFileName;
-    }
-
-    /**
-     * @param hcFileName The hcFileName to set.
-     */
-    public void setHcFileName(String hcFileName) {
-        this.hcFileName = hcFileName;
-    }
-
-    /**
-     * @return Returns the hcName.
-     */
-    public String getHcName() {
-        return hcName;
-    }
-
-    /**
-     * @param hcName The hcName to set.
-     */
-    public void setHcName(String hcName) {
-        this.hcName = hcName;
-    }
-
-
-    /**
-     * @return Returns the siRunAs.
-     */
-    public String getSiValue() {
-        return siValue;
-    }
-
-    /**
-     * @param siValue The siRunAs to set.
-     */
-    public void setSiValue(String siValue) {
-        this.siValue = siValue;
-    }
-
-    /**
-     * @return Returns the soapBinding.
-     */
-    public BeehiveWsSOAPBindingInfo getSoapBinding() {
-        if(soapBinding == null) {
-            soapBinding = new SOAPBindingInfo();
-        }
-        return soapBinding;
-    }
-
-    /**
-     * @param soapBinding The soapBinding to set.
-     */
-    public void setSoapBinding(BeehiveWsSOAPBindingInfo soapBinding) {
-        this.soapBinding = soapBinding;
-    }
-
-    /**
-     * @return Returns the wsName.
-     */
-    public String getWsName() {
-        return wsName;
-    }
-
-    /**
-     * @param wsName The wsName to set.
-     */
-    public void setWsName(String wsName) {
-        this.wsName = wsName;
-    }
-
-    /**
-     * @return Returns the wsServiceName.
-     */
-    public String getWsServiceName() {
-        return wsServiceName;
-    }
-
-    /**
-     * @param wsServiceName The wsServiceName to set.
-     */
-    public void setWsServiceName(String wsServiceName) {
-        this.wsServiceName = wsServiceName;
-    }
-
-    /**
-     * @return Returns the wsTargetNamespace.
-     */
-    public String getWsTargetNamespace() {
-        return wsTargetNamespace;
-    }
-
-    /**
-     * @param wsTargetNamespace The wsTargetNamespace to set.
-     */
-    public void setWsTargetNamespace(String wsTargetNamespace) {
-        this.wsTargetNamespace = wsTargetNamespace;
-    }
-
-
-    public String[] getTargetNamespaceParts() {
-        // strip the "http://" from the targetnamespace
-        String namespace = getWsTargetNamespace().substring(7, getWsTargetNamespace().length());
-        String[] beforeTranspose = namespace.split("[\\./]");
-        String[] res = new String[beforeTranspose.length];
-        for(int i = 0; i < res.length; i++)
-            res[i] = beforeTranspose[res.length - i - 1];
-        return res;
-    }
-
-    /**
-     * @return Returns the wsEndpointInterface.
-     */
-    public String getWsEndpointInterface() {
-        return wsEndpointInterface;
-    }
-
-    /**
-     * @param wsEndpointInterface The wsEndpointInterface to set.
-     */
-    public void setWsEndpointInterface(String wsEndpointInterface) {
-        this.wsEndpointInterface = wsEndpointInterface;
-    }
-
-    /**
-     * @return Returns the wsWsdlLocation.
-     */
-    public String getWsWsdlLocation() {
-        return wsWsdlLocation;
-    }
-
-    /**
-     * @param wsWsdlLocation The wsWsdlLocation to set.
-     */
-    public void setWsWsdlLocation(String wsWsdlLocation) {
-        this.wsWsdlLocation = wsWsdlLocation;
-    }
-
-    /**
-     * @return Returns the methods.
-     */
-    public Collection<BeehiveWsMethodMetadata> getMethods() {
-        if(noDuplicateMethods == null) {
-            noDuplicateMethods = Collections
-                .unmodifiableSet(new HashSet<BeehiveWsMethodMetadata>
-                (methodMap.values()));
-        }
-        return noDuplicateMethods;
-    }
-
-    public BeehiveWsMethodMetadata getMethod(String methodName, Class... paramTypes) {
-        String sig = createCompleteMethodSignature(methodName, paramTypes);
-
-        BeehiveWsMethodMetadata meta = methodMap.get(sig);
-        if(meta == null) {
-            /*
-             * NOTE jcolwell@bea.com 2004-Nov-29 --
-             * this fallback may be a bad thing but it is nice to have if the
-             * WSDLProcessor cannot map the Java types properly when used on the
-             * client side.
-             */
-            meta = methodMap.get(methodName + '(' + paramTypes.length + ')');
-        }
-        return meta;
-    }
-
-    public void addMethod(BeehiveWsMethodMetadata method)
-        throws ValidationException {
-
-        // NOTE jcolwell@bea.com 2004-Nov-29 -- clear the Set that prevents
-        // duplicates being returned from getMethods().
-        noDuplicateMethods = null;
-        List<? extends BeehiveWsParameterMetadata> params = method.getParams();
-        Class[] paramTypes = new Class[params.size()];
-        int j = 0;
-        for(BeehiveWsParameterMetadata param : params) {
-            Class javaType = param.getJavaType();
-            if(null == javaType) {
-                throw new ValidationException("<null> is not a valid parameter class");
-            }
-            paramTypes[j++] = javaType;
-        }
-        String opName = method.getWmOperationName();
-        String sig = createCompleteMethodSignature(opName, paramTypes);
-
-        if(methodMap.containsKey(sig)) {
-            throw new ValidationException(sig + " is already present in this Web Service and duplicate methods are not permitted");
-        }
-        else if(SOAPBinding.Style.DOCUMENT.equals(getSoapBinding().getStyle()) && methodMap.containsKey(opName)) {
-            throw new ValidationException("document-style does not allow duplicate methods: " + opName);
-        }
-        else {
-            methodMap.put(sig, method);
-            methodMap.put(opName + '(' + paramTypes.length + ')', method);
-        }
-    }
-
-    public List<? extends BeehiveWsSOAPMessageHandlerInfo> getSoapHandlers() {
-        return Collections.unmodifiableList(soapHandlers);
-    }
-
-    public void addSOAPHandler(BeehiveWsSOAPMessageHandlerInfo soapHandler) {
-        soapHandlers.add(soapHandler);
-    }
-
-    public String getClassName() {
-        return className;
-    }
-
-    public void setClassName(String className) {
-        this.className = className;
-    }
-
-    private String getTargetNamespace(String fqClassName) {
-        if((null == fqClassName) || (0 == fqClassName.length())) {
-            return fqClassName;
-        }
-        String[] tokens = fqClassName.split("\\.");
-        String targetNamespace = tokens[0];
-        for(int i = 1; i <= tokens.length - 2; i++) {
-            targetNamespace = tokens[i] + "." + targetNamespace;
-        }
-        return "http://" + targetNamespace;
-    }
-
-    // todo: this needs to go, as it should really be in Jsr181MethodMetadataImpl!!!
-    private String createCompleteMethodSignature(String name, Class... paramTypes) {
-
-        StringBuilder sb = new StringBuilder(name);
-        sb.append('(');
-        boolean firstParam = true;
-        if(paramTypes != null) {
-            for(Class type : paramTypes) {
-                if(firstParam) {
-                    firstParam = false;
-                }
-                else {
-                    sb.append(',');
-                }
-                sb.append(type.getName());
-            }
-        }
-        sb.append(')');
-        return sb.toString();
-    }
 
     /**
      * @param jt SIB type info.
@@ -716,7 +453,7 @@
      * @param jt SIB type info.
      * @throws ValidationException
      */
-    protected void validateContract(JavaTypeInfo jt)
+    private void validateContract(JavaTypeInfo jt)
         throws ValidationException {
 
         // get all implemented methods
@@ -744,6 +481,19 @@
             }
         }
     }
+    
+    private String getTargetNamespace(String fqClassName) {
+        if((null == fqClassName) || (0 == fqClassName.length())) {
+            return fqClassName;
+        }
+        String[] tokens = fqClassName.split("\\.");
+        String targetNamespace = tokens[0];
+        for(int i = 1; i <= tokens.length - 2; i++) {
+            targetNamespace = tokens[i] + "." + targetNamespace;
+        }
+        return "http://" + targetNamespace;
+    }
+    
 
     /**
      * Finds a resource given a resource path. Tries absolute path (http://...
@@ -781,8 +531,8 @@
         }
         if(resourcePath.startsWith("/")) {
             String base = basePath.toString();
-            String temp = className;
-            int lastIdx = className.lastIndexOf('.');
+            String temp = getClassName();
+            int lastIdx = getClassName().lastIndexOf('.');
             if(0 >= lastIdx) {
                 return null;
             }

Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/wsdl/XmlBeanWSDLProcessor.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/wsdl/XmlBeanWSDLProcessor.java?rev=193188&r1=193187&r2=193188&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/wsdl/XmlBeanWSDLProcessor.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/model/wsdl/XmlBeanWSDLProcessor.java Thu Jun 23 10:25:04 2005
@@ -29,10 +29,10 @@
 import org.apache.beehive.wsm.model.BeehiveWsParameterMetadata;
 import org.apache.beehive.wsm.model.BeehiveWsSOAPBindingInfo;
 import org.apache.beehive.wsm.model.BeehiveWsTypeMetadata;
-import org.apache.beehive.wsm.model.jsr181.Jsr181MethodMetadataImpl;
-import org.apache.beehive.wsm.model.jsr181.Jsr181ParameterMetadataImpl;
-import org.apache.beehive.wsm.model.jsr181.Jsr181TypeMetadataImpl;
-import org.apache.beehive.wsm.model.jsr181.SOAPBindingInfo;
+import org.apache.beehive.wsm.model.impl.DefaultMethodMetadataImpl;
+import org.apache.beehive.wsm.model.impl.DefaultParameterMetadataImpl;
+import org.apache.beehive.wsm.model.impl.DefaultSOAPBindingInfoImpl;
+import org.apache.beehive.wsm.model.impl.DefaultTypeMetadataImpl;
 import org.apache.xmlbeans.SchemaType;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.impl.xb.xsdschema.ComplexType;
@@ -74,10 +74,11 @@
 
     /* declared to prevent no-args construction */
     private XmlBeanWSDLProcessor() {
+        super();
     }
 
     public XmlBeanWSDLProcessor(DefinitionsDocument defDoc, BindingLookupService lookupService) {
-        super();
+        this();
         this.defDoc = defDoc;
         this.lookupService = lookupService;
     }
@@ -89,7 +90,7 @@
 
     public BeehiveWsTypeMetadata getObjectModel() throws Exception {
 
-        BeehiveWsTypeMetadata wsm = new Jsr181TypeMetadataImpl();
+        BeehiveWsTypeMetadata wsm = new DefaultTypeMetadataImpl();
         Map<String, BeehiveWsMethodMetadata> methodMap = new HashMap<String, BeehiveWsMethodMetadata>();
         TDefinitions defs = defDoc.getDefinitions();
         wsm.setWsTargetNamespace(defs.getTargetNamespace());
@@ -122,7 +123,7 @@
             }
 
             for(TOperation op : operations) {
-                processTOperation(op, wsm, methodMap, messageMap, tBind, types);
+                processTOperation(op, wsm, methodMap, messageMap, types);
             }
         }
 
@@ -136,7 +137,6 @@
                                    BeehiveWsTypeMetadata wsm,
                                    Map<String, BeehiveWsMethodMetadata> methodMap,
                                    Map<String, TPart[]> messageMap,
-                                   TBinding tBind,
                                    TTypes types)
         throws Exception {
         String opName = op.getName();
@@ -148,7 +148,7 @@
         if(null != outputParam) {
             TPart[] messageParts = messageMap.get(outputParam.getMessage().getLocalPart());
             // output parameters are not wrapped
-            paraMeta = processParameters(opName, messageParts, tBind, types, messageMap, wsm, true);
+            paraMeta = processParameters(opName, messageParts, types, wsm, true);
         }
         Class returnType;
         QName returnXMLType;
@@ -170,14 +170,13 @@
             returnXMLType = null;
             if(paraMeta.length > 1) {
                 outParamMap = new HashMap<String, BeehiveWsParameterMetadata>(paraMeta.length);
-                boolean returnIsSet = false;
                 for(BeehiveWsParameterMetadata cpm : paraMeta) {
                     outParamMap.put(cpm.getWpName(), cpm);
                 }
             }
         }
 
-        BeehiveWsMethodMetadata wmm = new Jsr181MethodMetadataImpl(opName, returnType, returnXMLType);
+        BeehiveWsMethodMetadata wmm = new DefaultMethodMetadataImpl(opName, returnType, returnXMLType);
         wmm.setWmOperationName(opName);
         // FIXME jcolwell@bea.com 2004-Nov-10 -- do something better with the action
         wmm.setWmAction(opName);
@@ -199,12 +198,11 @@
         if(inputParam != null) {
             TPart[] messageParts = messageMap.get(inputParam.getMessage().getLocalPart());
 
-            BeehiveWsParameterMetadata[] params =
-                processParameters(opName, messageParts, tBind, types, messageMap, wsm, false);
+            BeehiveWsParameterMetadata[] params = processParameters(opName, messageParts, types, wsm, false);
 
             if(paramOrder != null) {
-                // Paramorder is only used for rpc.  if there is a paramoder then order the parameters,
-                // remove all the in/out parameters from the out map
+                // Paramorder is only used for rpc AND doc/lit/bare.  if there is a paramoder then order
+                // the parameters, remove all the in/out parameters from the out map
                 for(Object ord : paramOrder) {
                     for(BeehiveWsParameterMetadata wpm : params) {
                         if(ord.equals(wpm.getWpName())) {
@@ -269,9 +267,7 @@
 
     private BeehiveWsParameterMetadata[] processParameters(String operationName,
                                                            TPart[] messageParts,
-                                                           TBinding tBind,
                                                            TTypes types,
-                                                           Map<String, TPart[]> messageMap,
                                                            BeehiveWsTypeMetadata wsm,
                                                            boolean isOutputParameters) {
 
@@ -284,12 +280,11 @@
         // name should be the same as the name of the opeartion.
         boolean paramStyleIsSet = false;
 
-        boolean shouldUnwrap;
-
         if(isOutputParameters) {
             paramStyleIsSet = true;  // only set this for input parameters
         }
-        shouldUnwrap = isWrapped(operationName, messageParts, tBind, isOutputParameters);
+
+        final boolean shouldUnwrap = isWrapped(operationName, messageParts, isOutputParameters);
 
         List<BeehiveWsParameterMetadata> paramList = new ArrayList<BeehiveWsParameterMetadata>(messageParts.length);
         for(TPart messagePart : messageParts) {
@@ -313,10 +308,14 @@
                     unwrapMessagePart(operationName, isOutputParameters, messagePart) // when we do want to unwrap, we should only unwrap the parts the parameters
                     // the parts that are for headers, for instance, should remain intact.
                     ) {
-                    if(!isOutputParameters) {// only set the mode if this is input parameters
-                        wsm.getSoapBinding().setParameterStyle(SOAPBinding.ParameterStyle.WRAPPED);
+
+                    // only set the mode if this is input parameters
+                    if(!isOutputParameters) {
+                        wsm.getSoapBinding().setParameterStyle(getParameterStyle(operationName, isOutputParameters,
+                                                                                 messagePart.getName()));
                         paramStyleIsSet = true;
                     }
+
                     if(types != null) { // if there are some type
                         try {
                             Schema[] schemas = selectChildren(types, Schema.class);
@@ -337,20 +336,43 @@
                                         * complextype   only  has name and type is defined as
                                         * <complexType> child
                                         */
-                                        paramList.add(elementToParamMetaData(s
-                                            .getTargetNamespace(), e));
+                                        paramList.add(elementToParamMetaData(s.getTargetNamespace(), e));
                                     }
                                     else {
                                         // we have <element name=xxx> and its child must be comlexType, or somethig is wrong
-                                        ComplexType ct = e.getComplexType();
-                                        if(ct != null && ct.isSetSequence()) {
-                                            // DOC/LIT WSDL
-                                            /* NOTE: There may be other groupings that this code needs
-                                            * to understand also.  At this point we expect: <element name="xxx" type="yyy">
-                                            * or <element ref="zzz">
-                                            */
-                                            Group g = ct.getSequence();
-                                            for(Element el : g.getElementArray()) {
+                                        final ComplexType ct = e.getComplexType();
+                                        assert ct != null : "Expected complex type!!";
+                                        assert ct.isSetSequence() == true : "Expected sequence structure!!!";
+
+                                        // todo: not handling <complexContent>, sequence may be null if in the form
+                                        // todo: of <sequence/>
+                                        Group g = ct.getSequence();
+                                        Element[] els = null;
+                                        if (g != null) {
+                                            els = ct.getSequence().getElementArray();
+                                        }
+                                        boolean paramAdded = false;
+
+                                        // in the case of bare parameters if the complex object is an array
+                                        // type, set the name of the parameter to the name of the element containing the
+                                        // complex type.
+                                        if (getParameterStyle(operationName, isOutputParameters, messagePart.getName())
+                                                == SOAPBinding.ParameterStyle.BARE  )
+                                        {
+                                            // doc / lit / bare
+                                            if (els != null && els.length == 1) {
+                                                BeehiveWsParameterMetadata  pm = elementToParamMetaData(s.getTargetNamespace(), els[0]);
+                                                if (pm.getJavaType().isArray()) {
+                                                    pm.setWpName(e.getName());
+                                                    paramList.add(pm);
+                                                    paramAdded = true;
+                                                }
+                                            }
+                                        }
+
+                                        if (!paramAdded && els != null) {
+                                            // doc / lit / wrapped
+                                            for(Element el : els) {
                                                 paramList.add(elementToParamMetaData(s.getTargetNamespace(), el));
                                             }
                                         }
@@ -373,7 +395,7 @@
                     if(!paramStyleIsSet)   // Only set the style to bare if it hasn't been done in previous parts processing
                         wsm.getSoapBinding().setParameterStyle(SOAPBinding.ParameterStyle.BARE);
 
-                    BeehiveWsParameterMetadata wpm = new Jsr181ParameterMetadataImpl();
+                    BeehiveWsParameterMetadata wpm = new DefaultParameterMetadataImpl();
 
                     wpm.setWpTargetNamespace(element.getNamespaceURI());
                     wpm.setWpName(name);    //  NAME SHOULD BE THE NAME OF THE MESSAGE PART. element.getLocalPart());
@@ -383,7 +405,7 @@
                 }
             }
             else { // this is an rpc and with no element attribute
-                BeehiveWsParameterMetadata wpm = new Jsr181ParameterMetadataImpl();
+                BeehiveWsParameterMetadata wpm = new DefaultParameterMetadataImpl();
                 // FIXME jcolwell@bea.com 2004-Nov-09 -- figure out where
                 // RPC parameter namespaces should be specified in the WSDL.
                 wpm.setWpTargetNamespace(wsm.getWsTargetNamespace());
@@ -413,7 +435,7 @@
     // if a part is on the header or is a MIME.  The header and MIME parts should not effect the wrapped
     // determination.
     // TODO: the logic here may not work with MIME types, verify later.
-    private boolean isWrapped(String operationName, TPart[] messagePart, TBinding tBind, boolean isOutputParameters) {
+    private boolean isWrapped(String operationName, TPart[] messagePart, boolean isOutputParameters) {
         for(TPart message : messagePart) {
             if(!message.isSetElement()) return false;  // RPC-Encoded
             if(true == unwrapMessagePart(operationName, isOutputParameters, message)) return true;
@@ -439,11 +461,38 @@
     }
 
     /**
+     * Get the SOAP parameter style for the specified operation.  If the operationName matches the
+     * messagePartName bare parameter style is detected.
+     *
+     * @param operationName Name of the operation to check.
+     * @param outputParam Is this an output parameter
+     * @param messagePartName The message part name.
+     * @return BARE or WRAPPED
+     */
+    private SOAPBinding.ParameterStyle getParameterStyle(String operationName, boolean outputParam, String messagePartName) {
+
+        assert messagePartName != null : "Invalid message part name!!!";
+
+        if(outputParam) {
+            if (messagePartName.equals(operationName + "Response")) {
+                return SOAPBinding.ParameterStyle.BARE;
+            }
+        } else {
+            if (messagePartName.equals(operationName)) {
+                return SOAPBinding.ParameterStyle.BARE;
+            }
+        }
+
+        // otherwise default to wrapped
+        return SOAPBinding.ParameterStyle.WRAPPED;
+    }
+
+    /**
      * @param targetNamespace
      * @param el
      */
     private BeehiveWsParameterMetadata elementToParamMetaData(String targetNamespace, Element el) {
-        BeehiveWsParameterMetadata wpm = new Jsr181ParameterMetadataImpl();
+        BeehiveWsParameterMetadata wpm = new DefaultParameterMetadataImpl();
         // FIXME
         // jcolwell@bea.com
         // 2004-Nov-09
@@ -489,7 +538,7 @@
     private void processTBinding(TBinding tBind, BeehiveWsTypeMetadata wsm) {
 
         org.xmlsoap.schemas.wsdl.soap.TBinding[] soapBinding = getSOAPBinding(tBind);
-        BeehiveWsSOAPBindingInfo soapInfo = new SOAPBindingInfo();
+        BeehiveWsSOAPBindingInfo soapInfo = new DefaultSOAPBindingInfoImpl();
         if(soapBinding != null && soapBinding.length > 0) {
             if(TStyleChoice.RPC.equals(soapBinding[0].getStyle())) {
                 soapInfo.setStyle(SOAPBinding.Style.RPC);

Modified: incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor/apt/WsmAnnotationProcessor.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor/apt/WsmAnnotationProcessor.java?rev=193188&r1=193187&r2=193188&view=diff
==============================================================================
--- incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor/apt/WsmAnnotationProcessor.java (original)
+++ incubator/beehive/sandbox/ekoneil/wsm/src/core/org/apache/beehive/wsm/processor/apt/WsmAnnotationProcessor.java Thu Jun 23 10:25:04 2005
@@ -90,13 +90,13 @@
                 ClassDeclaration classDecl = (ClassDeclaration)_decl;
                 messager.printNotice("processing service implementation bean: " + classDecl.getQualifiedName());
 
-                BeehiveWsTypeMetadata om = null;
+                Jsr181TypeMetadataImpl om = null;
                 String endpointInterface = wsAnnotation.endpointInterface().trim();
 
                 // start from endpoint interface
                 if(null != endpointInterface && 0 < endpointInterface.length()) {
                     // get object model for service endpoint interface
-                    om = getEndpointInterfaceObjectModel(endpointInterface);
+                    om = (Jsr181TypeMetadataImpl) getEndpointInterfaceObjectModel(endpointInterface);
 
                     // merge abstract and concrete object models
                     om.merge(new MirrorTypeInfo(classDecl, env));