ws-ews-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guilla...@apache.org
Subject svn commit: r230793 [11/12] - in /webservices/ews/trunk/ws4j2ee: ./ docs/ docs/images/ docs/src/ samples/ samples/clients/ samples/ejb/ samples/ejb/bookquote/ samples/ejb/bookquote/META-INF/ samples/ejb/bookquote/com/ samples/ejb/bookquote/com/jwsbook/...
Date Mon, 08 Aug 2005 12:42:47 GMT
Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/utils/Utils.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/utils/Utils.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/utils/Utils.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/utils/Utils.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,338 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.geronimo.ews.ws4j2ee.utils;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.utils.ClassUtils;
+import org.apache.axis.utils.JavaUtils;
+import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
+import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * This class was taken from the axis XMLUtils. It should be properly adopted if to be used permanantly
+ */
+public class Utils {
+//    protected static Log log =
+//        LogFactory.getLog(XMLUtils.class.getName());
+        
+    public static final String charEncoding = "ISO-8859-1";
+    private static final String saxParserFactoryProperty =
+            "javax.xml.parsers.SAXParserFactory";
+
+    private static DocumentBuilderFactory dbf = getDOMFactory();
+
+    public static String getClassNameFromQuallifiedName(String qualifiedName) {
+        int index = qualifiedName.lastIndexOf('.');
+        if (index > 0)
+            qualifiedName = qualifiedName.substring(index + 1);
+        return qualifiedName;
+    }
+
+    public static String getPackageNameFromQuallifiedName(String qualifiedName) {
+        int index = qualifiedName.lastIndexOf('.');
+        if (index > 0)
+            return qualifiedName.substring(0, index);
+        else
+            return "";
+    }
+
+    public static String getAbsolutePath(String path, String confFileLocation) throws GenerationFault {
+        if (path != null) {
+            if (path.indexOf(":/") > -1 || path.indexOf(":\\") > -1 || path.startsWith("/"))
+                return path;
+            return confFileLocation + "/" + path;
+        } else {
+            throw new GenerationFault("the path can not be null");
+        }
+    }
+
+    public static String firstCharacterToLowerCase(String name) {
+        char[] charName = name.toCharArray();
+        if (charName.length > 0)
+            charName[0] = Character.toLowerCase(charName[0]);
+        return new String(charName);
+    }
+
+    public static String firstCharacterToUpperCase(String name) {
+        char[] charName = name.toCharArray();
+        if (charName.length > 0)
+            charName[0] = Character.toUpperCase(charName[0]);
+        return new String(charName);
+    }
+
+    public static String qName2JavaName(QName qname) {
+        return org.apache.axis.wsdl.toJava.Utils.makePackageName(qname.getNamespaceURI())
+                + "." + firstCharacterToUpperCase(JavaUtils.xmlNameToJava(qname.getLocalPart()));
+    }
+
+    public static Method getJavaMethod(String className, String methodName) throws AxisFault {
+        String primKey = null;
+        Class sei;
+        try {
+            sei = ClassUtils.forName(className);
+            java.lang.reflect.Method callMethod = null;
+            Method[] methods = sei.getMethods();
+            for (int i = 0; i < methods.length; i++) {
+                if (methods[i].getName().equals(methodName)) {
+                    callMethod = methods[i];
+                }
+            }
+            if (callMethod == null)
+                throw new org.apache.geronimo.ews.ws4j2ee.toWs.UnrecoverableGenerationFault("Method " + methodName + " not found in the class" + className);
+            return callMethod;
+        } catch (ClassNotFoundException e) {
+            throw AxisFault.makeFault(e);
+        }
+    }
+
+    public static Object createParameter(Object obj) {
+        return obj;
+    }
+
+    public static Object createParameter(int in) {
+        return new Integer(in);
+    }
+
+    public static Object createParameter(long in) {
+        return new Long(in);
+    }
+
+    public static Object createParameter(float in) {
+        return new Float(in);
+    }
+
+    public static Object createParameter(byte in) {
+        return new Byte(in);
+    }
+
+    public static Object createParameter(short in) {
+        return new Short(in);
+    }
+
+    public static Object createParameter(boolean in) {
+        return new Boolean(in);
+    }
+
+    public static Object createParameter(double in) {
+        return new Double(in);
+    }
+
+    public static String getParameter(String type, String name) {
+        if ("int".equals(type)) {
+            return "new Integer(" + name + ")";
+        } else if ("float".equals(type)) {
+            return "new Float(" + name + ")";
+        } else if ("double".equals(type)) {
+            return "new Double(" + name + ")";
+        } else if ("short".equals(type)) {
+            return "new Short(" + name + ")";
+        } else if ("boolean".equals(type)) {
+            return "new Boolean(" + name + ")";
+        } else if ("byte".equals(type)) {
+            return "new Byte(" + name + ")";
+        } else if ("long".equals(type)) {
+            return "new Long(" + name + ")";
+        } else if ("char".equals(type)) {
+            return "new Character(" + name + ")";
+        } else {
+            return name;
+        }
+    }
+
+    public static String getReturnCode(String type, String name) {
+        if ("java.lang.Integer".equals(type) || "int".equals(type)) {
+            return "((java.lang.Integer)" + name + ").intValue()";
+        } else if ("java.lang.Float".equals(type) || "float".equals(type)) {
+            return "((java.lang.Float)" + name + ").floatValue()";
+        } else if ("java.lang.Double".equals(type) || "double".equals(type)) {
+            return "((java.lang.Double)" + name + ").doubleValue()";
+        } else if ("java.lang.Short".equals(type) || "short".equals(type)) {
+            return "((java.lang.Short)" + name + ").shortValue()";
+        } else if ("java.lang.Boolean".equals(type) || "boolean".equals(type)) {
+            return "((java.lang.Boolean)" + name + ").booleanValue()";
+        } else if ("java.lang.Byte".equals(type) || "byte".equals(type)) {
+            return "((java.lang.Byte)" + name + ").byteValue()";
+        } else if ("java.lang.Long".equals(type) || "long".equals(type)) {
+            return "((java.lang.Long)" + name + ").longValue()";
+        } else if ("java.lang.Character".equals(type) || "char".equals(type)) {
+            return "((java.lang.Character)" + name + ").charValue()";
+        } else {
+            return "(" + type + ")" + name;
+        }
+    }
+
+    public static String getRootDirOfFile(String file) {
+        int index = file.lastIndexOf('/');
+        if (index < 0)
+            index = file.lastIndexOf('\\');
+        if (index > -1) {
+            return file.substring(0, index);
+        } else {
+            return file;
+        }
+    }
+
+    /**
+     * @param returnType
+     * @return
+     */
+    public static String jni2javaName(String returnType) {
+        if (returnType == null)
+            return null;
+        if (!returnType.startsWith("[")) {
+            return returnType;
+        } else {
+            returnType = returnType.substring(1);
+        }
+        String end = "[]";
+        while (returnType.startsWith("[")) {
+            end = end + "[]";
+            returnType = returnType.substring(1);
+        }
+        if (returnType.startsWith("B")) {
+            returnType = "byte";
+        } else if (returnType.startsWith("I")) {
+            returnType = "int";
+        } else if (returnType.startsWith("D")) {
+            returnType = "double";
+        } else if (returnType.startsWith("J")) {
+            returnType = "long";
+        } else if (returnType.startsWith("Z")) {
+            returnType = "boolean";
+        } else if (returnType.startsWith("F")) {
+            returnType = "float";
+        } else if (returnType.startsWith("S")) {
+            returnType = "short";
+        } else if (returnType.startsWith("L")) {
+            int index = returnType.indexOf(";@");
+            returnType.substring(1, index);
+        }
+        return returnType + end;
+    }
+
+    public static String getElementValue(NodeList nodesin) {
+        if (nodesin == null || nodesin.getLength() < 1)
+            return null;
+        Node node = nodesin.item(0);
+        NodeList nodes = node.getChildNodes();
+        for (int i = 0; i < nodes.getLength(); i++) {
+            Node temp = nodes.item(i);
+            if (temp instanceof Text) {
+                return ((Text) temp).getNodeValue();
+            }
+        }
+        return null;
+    }
+
+    public static String javapkgToURI(String pkg) {
+        StringTokenizer tok = new StringTokenizer(pkg, ".");
+        ArrayList tokens = new ArrayList();
+        while (tok.hasMoreElements()) {
+            tokens.add(tok.nextToken());
+        }
+        int size = tokens.size();
+        if (size > 0) {
+            StringBuffer uribuf = new StringBuffer();
+            uribuf.append("http://");
+            uribuf.append((String) tokens.get(size - 1));
+            for (int i = size - 2; i >= 0; i--) {
+                uribuf.append(".");
+                uribuf.append((String) tokens.get(i));
+            }
+            return uribuf.toString();
+        } else {
+            return pkg;
+        }
+    }
+
+    public static String getFileNamefromClass(J2EEWebServiceContext j2eewscontext, String qulifiedName) {
+        String outdir = j2eewscontext.getMiscInfo().getOutPutPath();
+        if (!outdir.endsWith("/"))
+            outdir = outdir + "/";
+        return outdir + qulifiedName.replace('.', '/') + ".java";
+    }
+
+    public static void prepareTheDir(String fileName) {
+        File file = new File(fileName);
+        File parent = file.getParentFile();
+        parent.mkdirs();
+    }
+    private static DocumentBuilderFactory getDOMFactory() {
+          DocumentBuilderFactory dbf;
+          try {
+              dbf = DocumentBuilderFactory.newInstance();
+              dbf.setNamespaceAware(true);
+          } catch (Exception e) {
+//              log.error(Messages.getMessage("exception00"), e );
+              dbf = null;
+          }
+          return (dbf);
+      }
+      
+    public static Document createDocument(InputStream in) throws GenerationFault {
+        try {
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            dbf.setValidating(false);
+            dbf.setExpandEntityReferences(false);
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            EntityResolver er = new EntityResolver() {
+                public InputSource resolveEntity(String publicId,
+                                                 String systemId)
+                        throws SAXException, IOException {
+                    InputStream is = null;
+                    if ("http://java.sun.com/dtd/ejb-jar_2_0.dtd".equalsIgnoreCase(systemId)) {
+                        return getInputSource(Utils.class.getClassLoader().getResourceAsStream("ejb-jar_2_0.dtd"));
+                    } else if ("http://java.sun.com/dtd/web-app_2_3.dtd".equalsIgnoreCase(systemId))
+                        return getInputSource(Utils.class.getClassLoader().getResourceAsStream("web-app_2_3.dtd"));
+                    return null;
+                }
+
+                private InputSource getInputSource(InputStream is) throws IOException {
+                    if (is == null)
+                        throw new IOException("error at the project set up can not find entity");
+                    return new InputSource(is);
+                }
+            };
+            db.setEntityResolver(er);
+            return db.parse(in);
+        } catch (Exception e) {
+            throw GenerationFault.createGenerationFault(e);
+        }
+    }
+
+
+}
+

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/ContextAccessible.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/ContextAccessible.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/ContextAccessible.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/ContextAccessible.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.geronimo.ews.ws4j2ee.wsutils;
+
+import org.apache.axis.MessageContext;
+
+/**
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public interface ContextAccessible {
+    public void setMessageContext(MessageContext context);
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/EWSProvider.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/EWSProvider.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/EWSProvider.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/EWSProvider.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.geronimo.ews.ws4j2ee.wsutils;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.MessageContext;
+import org.apache.axis.handlers.soap.SOAPService;
+import org.apache.axis.providers.java.RPCProvider;
+import org.apache.axis.utils.ClassUtils;
+
+import java.io.InputStream;
+import java.lang.reflect.Method;
+
+/**
+ * register the MessageContext in the jax-rpc runtime of the JSR109
+ *
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public class EWSProvider extends RPCProvider {
+    public static final String OPTION_EJB_NAME = "beanName";
+    public static final String OPTION_JNDI_LOOKUP_NAME = "beanJndiName";
+    public static final String OPTION_HOMEINTERFACE_NAME = "homeInterfaceName";
+    public static final String OPTION_REMOTEINTERFACE_NAME = "remoteInterfaceName";
+    public static final String OPTION_LOCALHOMEINTERFACE_NAME = "localHomeInterfaceName";
+    public static final String OPTION_LOCALINTERFACE_NAME = "localInterfaceName";
+    public static final String OPTION_USE_EJB = "j2eeStyle";
+
+    private String ejblookupName;
+    private String localhome;
+    private String home;
+    private String remote;
+    private String local;
+
+    private boolean ejbbased = false;
+
+    protected Object makeNewServiceObject(MessageContext msgContext,
+                                          String clsName)
+            throws Exception {
+        SOAPService service = msgContext.getService();
+        String j2eeStyle = (String) service.getOption(OPTION_USE_EJB);
+        if("ejb".equals(j2eeStyle) ){
+            java.util.Properties env = new java.util.Properties();
+            InputStream jndiIn = ClassUtils.getResourceAsStream(getClass(), "jndi.properties");
+            if (jndiIn != null) {
+                env.load(jndiIn);
+            } else {
+                throw new AxisFault("Do not find the JNDI properties file in the class path");
+            }
+            javax.naming.Context initial = new javax.naming.InitialContext(env);
+            ejblookupName = (String) service.getOption(OPTION_JNDI_LOOKUP_NAME);
+            remote = (String) service.getOption(OPTION_REMOTEINTERFACE_NAME);
+            home = (String) service.getOption(OPTION_HOMEINTERFACE_NAME);
+            local = (String) service.getOption(OPTION_LOCALINTERFACE_NAME);
+            localhome = (String) service.getOption(OPTION_LOCALHOMEINTERFACE_NAME);
+            if (remote != null && home != null && ejblookupName != null) {
+                Object objref = initial.lookup(ejblookupName);
+                Class homeClass = ClassUtils.forName(home);
+                Object homeObj = javax.rmi.PortableRemoteObject.narrow(objref, homeClass);
+                Method method = homeClass.getMethod("create", new Class[]{});
+                return method.invoke(homeObj, new Object[]{});
+            } else if (local != null && localhome != null && ejblookupName != null) {
+                Object homeObj = initial.lookup("java:comp/" + ejblookupName);
+                Class homeClass = ClassUtils.forName(localhome);
+                Method method = homeClass.getMethod("create", new Class[]{});
+                return method.invoke(homeObj, new Object[]{});
+            }
+            throw new AxisFault("Wrong configuration remote="+ remote + "home =" + home + "ejblookupName" + ejblookupName );
+        } else {
+            return super.makeNewServiceObject(msgContext, clsName);
+        }
+    }
+
+    protected Object invokeMethod(MessageContext msgContext,
+                                  Method method,
+                                  Object obj,
+                                  Object[] argValues)
+            throws Exception {
+        Method invokeMethod = obj.getClass().getMethod(method.getName(), method.getParameterTypes());
+        return invokeMethod.invoke(obj, argValues);
+    }
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/ImplBeanPool.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/ImplBeanPool.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/ImplBeanPool.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/ImplBeanPool.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.geronimo.ews.ws4j2ee.wsutils;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.utils.ClassUtils;
+
+/**
+ * <p>This class is the pool that pool the servlet based JSR109 implementations
+ * These is a issue of the same thing happen differently when the code gerneration
+ * Done using interfaces and DD + WSDL.</p>
+ *
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public class ImplBeanPool {
+    private static ImplBeanPool instance;
+
+    static {
+        instance = new ImplBeanPool();
+    }
+
+    public static Object getImplBean(String classname) throws AxisFault{
+        return instance.getBean(classname);
+    }
+
+    private Object getBean(String classname) throws AxisFault {
+        try {
+            Class implClass = ClassUtils.forName(classname);
+            return implClass.newInstance();
+        } catch (Exception e) {
+            throw AxisFault.makeFault(e);
+        }
+    }
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/J2EEFault.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/J2EEFault.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/J2EEFault.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/J2EEFault.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.geronimo.ews.ws4j2ee.wsutils;
+
+import java.rmi.RemoteException;
+
+/**
+ * <p>this error is throwd if the error happen at the ejb side
+ * in the wrapper WebService class.</p>
+ *
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public class J2EEFault extends RemoteException {
+
+    public J2EEFault() {
+        super();
+    }
+
+    public J2EEFault(String message) {
+        super(message);
+    }
+
+    public J2EEFault(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public J2EEFault(Throwable cause) {
+        super(cause.getMessage(), cause);
+    }
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/J2EEProvider.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/J2EEProvider.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/J2EEProvider.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/J2EEProvider.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.geronimo.ews.ws4j2ee.wsutils;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.MessageContext;
+import org.apache.axis.providers.java.RPCProvider;
+
+/**
+ * register the MessageContext in the jax-rpc runtime of the JSR109
+ *
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public class J2EEProvider extends RPCProvider {
+    protected Object makeNewServiceObject(MessageContext msgContext,
+                                          String clsName)
+            throws Exception {
+        ContextAccessible webservice =
+                (ContextAccessible) super.makeNewServiceObject(msgContext, clsName);
+        webservice.setMessageContext(msgContext);
+        System.out.println("message Context set");
+        return webservice;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.axis.Handler#invoke(org.apache.axis.MessageContext)
+     */
+    public void invoke(MessageContext msgContext) throws AxisFault {
+        super.invoke(msgContext);
+    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/JaxRpcRuntime.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/JaxRpcRuntime.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/JaxRpcRuntime.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/JaxRpcRuntime.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.geronimo.ews.ws4j2ee.wsutils;
+
+import org.apache.axis.MessageContext;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.rmi.PortableRemoteObject;
+
+/**
+ * <p>This class provide acsess to the JAX-RPC runtime dynamic information
+ * to the WS4J2ee runtime.</p>
+ *
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public class JaxRpcRuntime {
+    private static MessageContext MSG_CONTEXT = null;
+
+    public static void setMessageContext(MessageContext msgcontext) {
+        MSG_CONTEXT = msgcontext;
+    }
+
+    public static MessageContext getMessageContext(MessageContext msgcontext) {
+        return MSG_CONTEXT;
+    }
+
+    public static Object getRemoteHome(String jndiname, Class homeclass) throws J2EEFault {
+        try {
+            InitialContext context = new InitialContext();
+            Object objref = context.lookup(jndiname);
+            return PortableRemoteObject.narrow(objref, homeclass);
+        } catch (ClassCastException e) {
+            e.printStackTrace();
+            throw new J2EEFault(e);
+        } catch (NamingException e) {
+            e.printStackTrace();
+            throw new J2EEFault(e);
+        }
+    }
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/PropertyLoader.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/PropertyLoader.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/PropertyLoader.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/PropertyLoader.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.geronimo.ews.ws4j2ee.wsutils;
+
+import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationConstants;
+import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.Properties;
+
+/**
+ * Load a given property file
+ *
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public class PropertyLoader {
+    protected static Log log =
+            LogFactory.getLog(PropertyLoader.class.getName());
+    public Properties loadProperties(String propertyFile) throws GenerationFault {
+        try {
+            Properties properties = new Properties();
+            InputStream proIn = getClass().getClassLoader().getResourceAsStream(propertyFile);
+            if (proIn == null) {
+                proIn = GenerationConstants.class.getResourceAsStream("META-INF/" + propertyFile);
+            }
+            if (proIn == null) {
+                proIn = new FileInputStream("conf/" + propertyFile);
+            }
+            if (proIn == null) {
+                proIn = new FileInputStream(propertyFile);
+            }
+            if (proIn != null) {
+                properties.load(proIn);
+            } else {
+                throw new GenerationFault("the " + propertyFile + "not found");
+            }
+            return properties;
+        } catch (Exception e) {
+            log.error(e);
+            throw GenerationFault.createGenerationFault(e);
+        }
+    }
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/WSDDJavaEWSProvider.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/WSDDJavaEWSProvider.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/WSDDJavaEWSProvider.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/WSDDJavaEWSProvider.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.geronimo.ews.ws4j2ee.wsutils;
+
+import org.apache.axis.EngineConfiguration;
+import org.apache.axis.Handler;
+import org.apache.axis.deployment.wsdd.WSDDProvider;
+import org.apache.axis.deployment.wsdd.WSDDService;
+
+/**
+ * refering to axis comment of pluggable providers
+ * Look for file META-INF/services/org.apache.axis.deployment.wsdd.Provider
+ * in all the JARS, get the classes listed in those files and add them to
+ * providers list if they are valid providers.
+ * Here is how the scheme would work.
+ * A company providing a new provider will jar up their provider related
+ * classes in a JAR file. The following file containing the name of the new
+ * provider class is also made part of this JAR file.
+ * META-INF/services/org.apache.axis.deployment.wsdd.Provider
+ * By making this JAR part of the webapp, the new provider will be
+ * automatically discovered.
+ *
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public class WSDDJavaEWSProvider extends WSDDProvider {
+    public static final String PROVIDER_EWS = "ews";
+
+    public String getName() {
+        return PROVIDER_EWS;
+    }
+
+    public Handler newProviderInstance(WSDDService service,
+                                       EngineConfiguration registry)
+            throws Exception {
+        return new org.apache.geronimo.ews.ws4j2ee.wsutils.EWSProvider();
+    }
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/WSDDJavaJ2EEProvider.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/WSDDJavaJ2EEProvider.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/WSDDJavaJ2EEProvider.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/wsutils/WSDDJavaJ2EEProvider.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.geronimo.ews.ws4j2ee.wsutils;
+
+import org.apache.axis.EngineConfiguration;
+import org.apache.axis.Handler;
+import org.apache.axis.deployment.wsdd.WSDDProvider;
+import org.apache.axis.deployment.wsdd.WSDDService;
+
+/**
+ * refering to axis comment of pluggable providers
+ * Look for file META-INF/services/org.apache.axis.deployment.wsdd.Provider
+ * in all the JARS, get the classes listed in those files and add them to
+ * providers list if they are valid providers.
+ * Here is how the scheme would work.
+ * A company providing a new provider will jar up their provider related
+ * classes in a JAR file. The following file containing the name of the new
+ * provider class is also made part of this JAR file.
+ * META-INF/services/org.apache.axis.deployment.wsdd.Provider
+ * By making this JAR part of the webapp, the new provider will be
+ * automatically discovered.
+ *
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public class WSDDJavaJ2EEProvider extends WSDDProvider {
+    public static final String PROVIDER_J2EE = "j2ee";
+
+    public String getName() {
+        return PROVIDER_J2EE;
+    }
+
+    public Handler newProviderInstance(WSDDService service,
+                                       EngineConfiguration registry)
+            throws Exception {
+        return new org.apache.geronimo.ews.ws4j2ee.wsutils.J2EEProvider();
+    }
+}

Added: webservices/ews/trunk/ws4j2ee/src/resources/META-INF/services/org.apache.axis.deployment.wsdd.Provider
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/resources/META-INF/services/org.apache.axis.deployment.wsdd.Provider?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/resources/META-INF/services/org.apache.axis.deployment.wsdd.Provider (added)
+++ webservices/ews/trunk/ws4j2ee/src/resources/META-INF/services/org.apache.axis.deployment.wsdd.Provider Mon Aug  8 05:40:25 2005
@@ -0,0 +1,3 @@
+org.apache.geronimo.ews.ws4j2ee.wsutils.WSDDJavaJ2EEProvider
+org.apache.geronimo.ews.ws4j2ee.wsutils.WSDDJavaEWSProvider
+org.apache.geronimo.axis.WSDDJavaGeronimoProvider
\ No newline at end of file

Added: webservices/ews/trunk/ws4j2ee/src/resources/app.properties
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/resources/app.properties?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/resources/app.properties (added)
+++ webservices/ews/trunk/ws4j2ee/src/resources/app.properties Mon Aug  8 05:40:25 2005
@@ -0,0 +1,2 @@
+# Sample app properties.
+foo=bar

Added: webservices/ews/trunk/ws4j2ee/src/resources/client-config.wsdd
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/resources/client-config.wsdd?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/resources/client-config.wsdd (added)
+++ webservices/ews/trunk/ws4j2ee/src/resources/client-config.wsdd Mon Aug  8 05:40:25 2005
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment name="defaultClientConfig"
+            xmlns="http://xml.apache.org/axis/wsdd/"
+            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+   
+ <globalConfiguration>
+   <parameter name="sendMultiRefs" value="false"/>
+   <parameter name="disablePrettyXML" value="true"/>
+	
+  </globalConfiguration>
+ <!--
+  <service name="echoPort">
+  <requestFlow>
+       <handler type="dummy" />
+   </requestFlow>
+  </service> 
+  -->
+  <handler name ="dummy" type="java:testData.DummyHandler" />
+ <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>
+ <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/>
+ <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/>
+</deployment>
\ No newline at end of file

Added: webservices/ews/trunk/ws4j2ee/src/resources/common.xml
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/resources/common.xml?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/resources/common.xml (added)
+++ webservices/ews/trunk/ws4j2ee/src/resources/common.xml Mon Aug  8 05:40:25 2005
@@ -0,0 +1,76 @@
+	<property name="build.sysclasspath" value="last"/>
+	<property name="src" location="."/>
+	<property name="build" location="build"/>
+	<property name="build.classes" location="${build}/classes"/>
+	<property name="build.lib" location="${build}/lib"/>
+	<property name="lib" location="lib"/>
+	<property name="maven.repo.local" location="${user.home}/.maven/repository"/>
+	
+	
+	<!--- 
+	<property file="ewx.properties"></property>
+	expcted properties 
+		mapping.file
+		webservice.file
+		wsdl.file
+	-->
+	
+
+	
+	<path id="classpath" >
+		 <path refid="local.classpath"/>
+	     <pathelement location="target/classes"/>		
+	     <pathelement location="classes"/>
+		<fileset dir="${maven.repo.local}">
+		    <include name="axis/**/*-1.2.1*.jar"/>
+			<include name="commons-logging/**/*.jar"/>
+			<include name="commons-discovery/**/*.jar"/>
+			<include name="geronimo-spec/**/*.jar"/>
+			<include name="geronimo/**/*.jar"/>
+			<include name="sec/**/*.jar"/>
+			<include name="dom4j/**/*.jar"/>
+			<include name="jaxb-ri/**/*.jar"/>
+			<include name="xerces/**/*.jar"/>
+         <include name="ews/**/*.jar"/>
+         <include name="openejb/**/*.jar"/>
+		</fileset>
+	</path>
+	
+	<target name="init">
+		<mkdir dir="${build.classes}"/>
+      	<mkdir dir="${build.classes}/META-INF/"/>
+		<mkdir dir="${build.lib}"/>
+	</target>
+
+	<target name="compile" depends="init,copy-j2ee-resources">
+		<javac destdir="${build.classes}" debug="on">
+			<classpath refid="classpath" />
+			<src path="${src}"/>
+		</javac>
+	</target>
+	
+	
+	
+	<target name="jar" depends="compile">
+		<copy todir="${build.classes}" preservelastmodified="true">
+			<fileset dir="${src}">
+             <include name="*.properties"/>
+				<include name="META-INF/*.xml"/>
+				<include name="WEB-INF/*.xml"/>
+				<include name="META-INF/*.wsdl"/>
+				<include name="META-INF/*.wsdd"/>
+             <include name="WEB-INF/*.wsdl"/>
+             <include name="WEB-INF/*.wsdd"/>
+             <include name="*.wsdl"/>
+             <include name="*.wsdd"/>
+             <exclude name="build**"/>
+			</fileset>
+		</copy>
+
+		<jar jarfile="echo-ewsimpl.jar" basedir="${build.classes}" />
+	</target>
+
+	<target name="dist" depends="jar"/>
+  	<target name="clean">
+		<delete dir="${build}"/>
+	</target>

Propchange: webservices/ews/trunk/ws4j2ee/src/resources/common.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: webservices/ews/trunk/ws4j2ee/src/resources/jndi.properties
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/resources/jndi.properties?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/resources/jndi.properties (added)
+++ webservices/ews/trunk/ws4j2ee/src/resources/jndi.properties Mon Aug  8 05:40:25 2005
@@ -0,0 +1,26 @@
+##
+##
+##   Copyright 2003-2004 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.
+##
+
+##
+## Default JNDI Properties
+##
+## $Revision: 1.2 $ $Date$
+##
+
+java.naming.factory.initial=com.sun.jndi.rmi.registry.RegistryContextFactory
+java.naming.factory.url.pkgs=org.apache.geronimo.naming
+java.naming.provider.url=rmi://localhost:1099

Added: webservices/ews/trunk/ws4j2ee/src/resources/log4j.properties
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/resources/log4j.properties?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/resources/log4j.properties (added)
+++ webservices/ews/trunk/ws4j2ee/src/resources/log4j.properties Mon Aug  8 05:40:25 2005
@@ -0,0 +1,21 @@
+# Set root category priority to INFO and its only appender to CONSOLE.
+#log4j.rootCategory=INFO, CONSOLE
+log4j.rootCategory=FATAL, CONSOLE, LOGFILE
+
+# Set the enterprise logger category to FATAL and its only appender to CONSOLE.
+log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE,LOGFILE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=FATAL
+#log4j.appender.CONSOLE.Threshold=INFO
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
+
+# LOGFILE is set to be a File appender using a PatternLayout.
+log4j.appender.LOGFILE=org.apache.log4j.FileAppender
+log4j.appender.LOGFILE.File=axis.log
+log4j.appender.LOGFILE.Append=true
+log4j.appender.LOGFILE.Threshold=FATAL
+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

Added: webservices/ews/trunk/ws4j2ee/src/resources/simplelog.properties
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/resources/simplelog.properties?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/resources/simplelog.properties (added)
+++ webservices/ews/trunk/ws4j2ee/src/resources/simplelog.properties Mon Aug  8 05:40:25 2005
@@ -0,0 +1,2 @@
+org.apache.commons.logging.simplelog.defaultlog=fatal
+

Added: webservices/ews/trunk/ws4j2ee/src/resources/ws4j2ee.properties
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/resources/ws4j2ee.properties?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/resources/ws4j2ee.properties (added)
+++ webservices/ews/trunk/ws4j2ee/src/resources/ws4j2ee.properties Mon Aug  8 05:40:25 2005
@@ -0,0 +1,7 @@
+maven.repo.local=/home/hemapani/.maven/repository
+j2ee-container-dd=geronimo.xml
+ws4j2ee-provider=j2ee
+axis-host=127.0.0.1
+axis-port=8080
+axis-webapps-lib=C:/Servers/jakarta-tomcat-4.1.12/webapps/axis/WEB-INF/lib
+ejb-deploy=C:/Servers/jboss-3.2.3/server/default/deploy
\ No newline at end of file

Added: webservices/ews/trunk/ws4j2ee/src/resources/wsdd/client/secuirty-client-config.wsdd
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/resources/wsdd/client/secuirty-client-config.wsdd?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/resources/wsdd/client/secuirty-client-config.wsdd (added)
+++ webservices/ews/trunk/ws4j2ee/src/resources/wsdd/client/secuirty-client-config.wsdd Mon Aug  8 05:40:25 2005
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment name="defaultClientConfig"
+            xmlns="http://xml.apache.org/axis/wsdd/"
+            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+   
+ <globalConfiguration>
+   <parameter name="sendMultiRefs" value="false"/>
+   <parameter name="disablePrettyXML" value="true"/>
+	
+  </globalConfiguration>
+  
+  <handler name="basic-auth-secuirty" type="java:org.apache.ws.axis.security.ews.BasicAuth4J2EESender"/> 
+  <handler name="simple-secuirty" type="java:org.apache.ws.axis.security.ews.SimpleWSS4J2EESender"/> 
+  <handler name="all-secuirty" type="java:org.apache.ws.axis.security.ews.WSDoAllSender"/> 
+
+  <service name="echoPort">
+    <requestFlow>
+      <handler type="simple-secuirty" >
+         <parameter name="action" value="UsernameToken"/>
+         <parameter name="user" value="jsr109-group"/>
+         <parameter name="passwordType" value="PasswordDigest" />
+         <parameter name="passwordCallbackClass" value="org.apache.geronimo.ews.ws4j2ee.wsutils.security.SimpleClientPasswordCallbackHandler"/>
+      </handler>
+   </requestFlow>
+  </service> 
+  <handler name ="dummy" type="java:testData.DummyHandler" />
+ <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>
+ <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/>
+ <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/>
+</deployment>
\ No newline at end of file

Added: webservices/ews/trunk/ws4j2ee/src/resources/wsdd/client/simple-client-config.wsdd
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/resources/wsdd/client/simple-client-config.wsdd?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/resources/wsdd/client/simple-client-config.wsdd (added)
+++ webservices/ews/trunk/ws4j2ee/src/resources/wsdd/client/simple-client-config.wsdd Mon Aug  8 05:40:25 2005
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment name="defaultClientConfig"
+            xmlns="http://xml.apache.org/axis/wsdd/"
+            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+   
+ <globalConfiguration>
+   <parameter name="sendMultiRefs" value="false"/>
+   <parameter name="disablePrettyXML" value="true"/>
+	
+  </globalConfiguration>
+ 
+  <service name="echoPort">
+  <requestFlow>
+       <handler type="dummy" />
+   </requestFlow>
+  </service> 
+  <handler name ="dummy" type="java:testData.DummyHandler" />
+ <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>
+ <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/>
+ <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/>
+</deployment>
\ No newline at end of file

Added: webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/AbstractTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/AbstractTestCase.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/AbstractTestCase.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/AbstractTestCase.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+ 
+package org.apache.geronimo.ews;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+/**
+ * Abstract base class for test cases.
+ *
+ * @author <a href="jason@zenplex.com">Jason van Zyl</a>
+ */
+public abstract class AbstractTestCase
+	extends TestCase 
+{
+	protected String testDir = "src/test/";
+	protected String sampleDir = "samples/";
+	protected String outDir = "target/generated/samples/";
+	/** 
+	 * Basedir for all file I/O. Important when running tests from
+	 * the reactor.
+	 */
+	public String basedir = System.getProperty("basedir");
+    
+	/**
+	 * Constructor.
+	 */
+	public AbstractTestCase(String testName)
+	{
+		super(testName);
+	}
+    
+	/**
+	 * Get test input file.
+	 *
+	 * @param path Path to test input file.
+	 */
+	public String getTestFile(String path)
+	{
+		return new File(basedir,path).getAbsolutePath();
+	}
+}
+

Added: webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/AppTest.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/AppTest.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/AppTest.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/AppTest.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+ 
+package org.apache.geronimo.ews;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ *
+ * @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a>
+ */
+public class AppTest 
+    extends AbstractTestCase
+{
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public AppTest( String testName )
+    {
+        super( testName );
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite()
+    {
+        return new TestSuite( AppTest.class );
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp()
+    {
+        assertEquals( "maven kicks ass", "maven kicks ass" );
+    }
+}

Added: webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/NaughtyTest.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/NaughtyTest.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/NaughtyTest.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/NaughtyTest.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,39 @@
+package org.apache.geronimo.ews;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ *
+ * @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a>
+ */
+public class NaughtyTest
+    extends AbstractTestCase
+{
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public NaughtyTest( String testName )
+    {
+        super( testName );
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite()
+    {
+        return new TestSuite( NaughtyTest.class );
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp()
+    {
+        // Crash and burn!
+    }
+}

Added: webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/AntExecuterTest.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/AntExecuterTest.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/AntExecuterTest.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/AntExecuterTest.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package org.apache.geronimo.ews.ws4j2ee;
+
+import java.io.File;
+
+import org.apache.geronimo.ews.AbstractTestCase;
+import org.apache.geronimo.ews.ws4j2ee.utils.AntExecuter;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Ant;
+
+/**
+ * @author hemapani
+ */
+public class AntExecuterTest extends AbstractTestCase{
+	/**
+	 * @param testName
+	 */
+	public AntExecuterTest(String testName) {
+		super(testName);
+	}
+
+	public void testBuildFile() throws Exception{
+		try{
+			AntExecuter exec = new AntExecuter(null);
+			exec.execute(getTestFile(testDir + "testData/testBuildfile.xml"));
+		}catch(Exception e){
+			e.printStackTrace();
+			throw e;
+		}
+	}
+	public void testBuildFile1() throws Exception{
+		try{
+			Project project = new Project();
+			project.init();
+			Ant ant = new Ant();
+			ant.setProject(project);
+			File file = new File(getTestFile(testDir
+				 + "testData/testBuildfile.xml"));
+			ant.setAntfile(file.getAbsolutePath());
+			ant.setDir(file.getParentFile());
+			ant.init();
+			//ant.setOutput("ant.log");
+			ant.execute();
+			System.out.print("Done");
+		}catch(Exception e){
+			e.printStackTrace();
+			throw e;
+		}
+	}
+    
+}

Added: webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/EJBDDTest.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/EJBDDTest.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/EJBDDTest.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/EJBDDTest.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package org.apache.geronimo.ews.ws4j2ee;
+
+import java.io.FileInputStream;
+import java.util.HashMap;
+
+import org.apache.geronimo.ews.AbstractTestCase;
+import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
+import org.apache.geronimo.ews.ws4j2ee.context.JaxRpcMapperContext;
+import org.apache.geronimo.ews.ws4j2ee.context.MiscInfo;
+import org.apache.geronimo.ews.ws4j2ee.context.impl.MiscInfoImpl;
+import org.apache.geronimo.ews.ws4j2ee.context.j2eeDD.EJBContext;
+import org.apache.geronimo.ews.ws4j2ee.context.j2eeDD.WebContext;
+import org.apache.ws.ews.context.webservices.client.ServiceReferenceContext;
+import org.apache.ws.ews.context.webservices.server.WSCFContext;
+import org.apache.geronimo.ews.ws4j2ee.context.wsdl.WSDLContext;
+import org.apache.geronimo.ews.ws4j2ee.parsers.DomEJBDDParser;
+import org.apache.geronimo.ews.ws4j2ee.toWs.Ws4J2eeFactory;
+
+/**
+ * @author hemapani
+ */
+public class EJBDDTest extends AbstractTestCase{
+    private J2EEWebServiceContext con = new J2EEWebServiceContext() {
+        public WSDLContext getWSDLContext() {return null;}
+        public void setWSDLContext(WSDLContext wsdlcontext) {}
+        public WSCFContext getWSCFContext() {return null;}
+        public void setWSCFContext(WSCFContext wscfcontext) {}
+        public JaxRpcMapperContext getJAXRPCMappingContext() {return null;}
+        public void setJAXRPCMappingContext(JaxRpcMapperContext context) {}
+        public MiscInfo getMiscInfo() {return new MiscInfoImpl(new HashMap());}
+        public void setMiscInfo(MiscInfo info) {}
+        public void validate() {
+        }
+        public void setFactory(Ws4J2eeFactory factory){}
+        public Ws4J2eeFactory getFactory(){
+            return null;
+        }
+
+        public EJBContext getEJBDDContext(){
+            return null;
+        }
+        public void setEJBDDContext(EJBContext context){}
+
+        public WebContext getWebDDContext(){
+            return null;
+        }
+        public void setWebDDContext(WebContext context){}
+
+        public ServiceReferenceContext getServiceReferenceContext(int index){
+            return null;
+        }
+        public void addServiceReferenceContext(ServiceReferenceContext context){}
+        public int getServiceReferenceContextCount(){
+            return 0;
+        }
+    };
+
+    /**
+     * @param testName
+     */
+    public EJBDDTest(String testName) {
+        super(testName);
+    }
+
+//	public void testMathSample() throws Exception{
+//		try{
+//		   EJBDDParser pars = new EJBDDParser(con);
+//		   pars.parse(new FileInputStream(
+//		   	getTestFile(testDir+"testData/math/ejb-jar.xml")));
+//		   //Assert.assertEquals(con.getMiscInfo().getEjbName(),"MathFace"); 
+//		}catch(Exception e){
+//			e.printStackTrace();
+//			throw e;
+//		}
+//	}
+    public void testMathSampleWithDOM() throws Exception{
+        try{
+            DomEJBDDParser pars = new DomEJBDDParser(con);
+           pars.parse(new FileInputStream(
+            getTestFile(testDir+"testData/math/ejb-jar.xml")));
+           //Assert.assertEquals(con.getMiscInfo().getEjbName(),"MathFace"); 
+        }catch(Exception e){
+            e.printStackTrace();
+            throw e;
+        }
+    }
+//TODO
+//    public void testMathSampleWithDOMWithDOCTYPE() throws Exception{
+//        try{
+//            DomEJBDDParser pars = new DomEJBDDParser(con);
+//           pars.parse(new FileInputStream(
+//            getTestFile(testDir+"testData/math/ejb-jar1.xml")));
+//           //Assert.assertEquals(con.getMiscInfo().getEjbName(),"MathFace"); 
+//        }catch(Exception e){
+//            e.printStackTrace();
+//            throw e;
+//        }
+//    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/GenerateClientTest.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/GenerateClientTest.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/GenerateClientTest.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/GenerateClientTest.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.geronimo.ews.ws4j2ee;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.geronimo.ews.AbstractTestCase;
+import org.apache.geronimo.ews.ws4j2ee.toWs.Ws4J2EEClientwithWSDL;
+
+/**
+ * Unit test for simple App.
+ *
+ * @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a>
+ */
+public class GenerateClientTest 
+	extends AbstractTestCase
+{
+	private String outDir = "target/generated/samples/";
+	/**
+	 * Create the test case
+	 *
+	 * @param testName name of the test case
+	 */
+	public GenerateClientTest( String testName )
+	{
+		super( testName );
+	}
+
+	/**
+	 * @return the suite of tests being tested
+	 */
+	public static Test suite()
+	{
+		return new TestSuite( GenerateClientTest.class );
+	}
+	public void testDummy() {}
+	
+	public void testBookSample() throws Exception
+	{
+		//client side
+		String args[] = new String[]{getTestFile(sampleDir + "jaxrpc/book/webserviceClient.xml"),
+									 "-o" + getTestFile(outDir+"withWSDL/client/book/"),"-Euse-remote"};
+		Ws4J2EEClientwithWSDL.main(args);
+	}
+
+	public void testTimeSample() throws Exception{
+		String[] args;
+		args = new String[]{getTestFile(sampleDir + "jaxrpc/time/webserviceClient.xml"),
+									 "-o" + getTestFile(outDir+"withWSDL/client/time")};
+		Ws4J2EEClientwithWSDL.main(args);
+	}
+	public void testZipSample() throws Exception{
+			String args[] = new String[]{getTestFile(sampleDir + "mapper/frenchzip/webserviceClient.xml"),
+										 "-o" + getTestFile(outDir+"withWSDL/client/zip")};
+			Ws4J2EEClientwithWSDL.main(args);
+	}
+	public void testGoogleSample() throws Exception{
+			String[] args; 
+			args = new String[]{getTestFile(sampleDir + "mapper/google/webserviceClient.xml"),
+										 "-o" + getTestFile(outDir+"withWSDL/client/google")};
+			Ws4J2EEClientwithWSDL.main(args);
+	}	
+}

Added: webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/GenerateWithoutWSDLTest.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/GenerateWithoutWSDLTest.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/GenerateWithoutWSDLTest.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/GenerateWithoutWSDLTest.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+
+package org.apache.geronimo.ews.ws4j2ee;
+
+import org.apache.geronimo.ews.AbstractTestCase;
+import org.apache.geronimo.ews.ws4j2ee.toWs.Ws4J2ee;
+
+/**
+ * this test case with wsdl does not exists .. but the information is get by the 
+ * SEI. This should be the prefered way for the J2EE developer. User can give a 
+ * packaged application as explained by the JSR109 specification to the tool.
+ * the arguments are 
+ * 	GenerateWithoutWSDL &lt;webservices.xml-file&gt; -o&lt;targetoutput&gt; &lt;additionl argument that are given toJava2WSDL&gt;   
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public class GenerateWithoutWSDLTest extends AbstractTestCase {
+	private String outDir = "target/generated/samples/";
+    /**
+     * @param testName
+     */
+    public GenerateWithoutWSDLTest(String testName) {
+        super(testName);
+    }
+
+	public void testMathSample() throws Exception{
+		try{
+			String[] args2 = new String[]{
+				getTestFile(testDir+"testData/math/webservices.xml"),"-o",
+				getTestFile(outDir+"withoutWSDL/math/server") ,"-l" ,
+				"http://127.0.0.1/aixs/math"};
+			Ws4J2ee.main(args2);
+		}catch(Exception e){
+			e.printStackTrace();
+		}
+	}
+	
+	public void testServletBasedMathSample() throws Exception{
+		String[] args2 = new String[]{
+			getTestFile(testDir + "testData/math/webservice-ServletBased.xml"),"-o",
+			getTestFile(outDir+"withoutWSDL/math/server-servlet") ,"-l" ,
+			"http://127.0.0.1/aixs/math"};
+		Ws4J2ee.main(args2);
+	}
+	public void testMathSampleWithHandlers() throws Exception{
+		try{
+			String[] args2 = new String[]{
+				getTestFile(testDir + "testData/math/webservice-withHandler.xml"),"-o",
+				getTestFile(outDir+"withoutWSDL/math-withHandlers/server") ,"-l" ,
+				"http://127.0.0.1/aixs/math"};
+			Ws4J2ee.main(args2);
+		}catch(Exception e){
+			e.printStackTrace();
+		}
+	}
+	public void testBookSampleJar() throws Exception{
+		String[] args2 = new String[]{
+			getTestFile("target/generated/samples/bookquote.jar"),"-o"
+			,getTestFile(outDir+"withoutWSDL/bookquote-jar/")};
+		Ws4J2ee.main(args2);
+	}
+	public void testGoogleSampleJar() throws Exception{
+		String[] args2 = new String[]{
+			getTestFile("target/generated/samples/google.jar"),"-o",
+			getTestFile(outDir+"withoutWSDL/google-jar/")};
+		Ws4J2ee.main(args2);
+	}
+	public void testTimeSampleJar() throws Exception{
+		String[] args2 = new String[]{getTestFile("target/generated/samples/time.jar"),"-o",
+			getTestFile(outDir+"withoutWSDL/time-jar/")};
+		Ws4J2ee.main(args2);
+	}
+	public void testZipampleJar() throws Exception{
+		String[] args2 = new String[]{getTestFile("target/generated/samples/zip.jar"),"-o",
+			getTestFile(outDir+"withoutWSDL/zip-jar/")};
+		Ws4J2ee.main(args2);
+	}
+	
+	public void testBookSampleWar() throws Exception{
+		String[] args2 = new String[]{getTestFile("target/generated/samples/simple.war"),"-o",
+			getTestFile(outDir+"withoutWSDL/bookquote-war/")};
+		Ws4J2ee.main(args2);
+	}
+	public void testBookSampleEar() throws Exception{
+		String[] args2 = new String[]{
+				getTestFile("target/generated/samples/bookquote.ear"),"-o",
+				getTestFile(outDir+"withoutWSDL/bookquote-ear/")};
+		Ws4J2ee.main(args2);
+	}
+	
+	public void testEchoJar() throws Exception{
+		String[] args2 = new String[]{
+				getTestFile("target/generated/samples/echo.jar"),"-o",
+				getTestFile(outDir+"withoutWSDL/echo-jar/")};
+		Ws4J2ee.main(args2);
+	}
+    public void testEchoWar() throws Exception{
+//fix this once ohters fixed 
+//        String[] args2 = new String[]{
+//                getTestFile("target/generated/samples/echo.war"),"-o",
+//                outDir+"withoutWSDL/echo-war/"};
+//        Ws4J2ee.main(args2);
+    }
+}

Added: webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/JaxRpcMappingTest.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/JaxRpcMappingTest.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/JaxRpcMappingTest.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/JaxRpcMappingTest.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+ 
+ package org.apache.geronimo.ews.ws4j2ee;
+
+import java.util.HashMap;
+import java.util.List;
+
+import javax.wsdl.Operation;
+import javax.xml.namespace.QName;
+
+import junit.framework.Assert;
+
+import org.apache.axis.wsdl.symbolTable.BindingEntry;
+import org.apache.axis.wsdl.symbolTable.PortEntry;
+import org.apache.axis.wsdl.symbolTable.PortTypeEntry;
+import org.apache.axis.wsdl.symbolTable.ServiceEntry;
+import org.apache.geronimo.ews.AbstractTestCase;
+import org.apache.ws.ews.mapper.J2eeEmitter;
+import org.apache.ws.ews.mapper.jaxrpc.JaxRpcMapper;
+import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
+import org.apache.geronimo.ews.ws4j2ee.context.JaxRpcMapperContext;
+import org.apache.geronimo.ews.ws4j2ee.context.wsdl.WSDLContext;
+import org.apache.geronimo.ews.ws4j2ee.toWs.Ws4J2eeFactory;
+import org.apache.geronimo.ews.ws4j2ee.toWs.impl.Ws4J2eeFactoryImpl;
+
+/**
+ * @author hemapani
+ */
+public class JaxRpcMappingTest extends AbstractTestCase{
+	private Ws4J2eeFactory factory;
+    /**
+     * @param testName
+     */
+    public JaxRpcMappingTest(String testName) {
+        super(testName);
+		factory = new Ws4J2eeFactoryImpl();
+    }
+
+	public void testGoogleTypeMapping() throws Exception{
+	    try {
+	    	    
+	    	   J2EEWebServiceContext context = factory.getContextFactory().getJ2EEWsContext(true);
+	    	   context.setMiscInfo(factory.getContextFactory().createMiscInfo(new HashMap()));
+	           String mappingfile = sampleDir +"mapper/google/GoogleSearch.xml";
+	           String wsdlfile = sampleDir +"mapper/google/GoogleSearch.wsdl";
+	           J2eeEmitter j2ee = new J2eeEmitter();
+	           j2ee.setMappingFilePath(getTestFile(mappingfile));
+	           j2ee.setOutputDir(outDir);
+	           j2ee.setServerSide(true);
+	           j2ee.setVerbose(false);
+	           j2ee.setHelperWanted(true);
+	           System.out.println();
+	           j2ee.runServerSide(getTestFile(wsdlfile));
+	           WSDLContext wscontext = factory.getContextFactory().createWSDLContext(j2ee.getSymbolTable());
+			   context.setWSDLContext(wscontext);
+	           PortEntry port = wscontext.getPort(new QName("GoogleSearchPort"));
+	           BindingEntry be = wscontext.getBinding(new QName("urn:GoogleSearch","GoogleSearchBinding"));
+	           PortTypeEntry pe = wscontext.getPortType(new QName("urn:GoogleSearch","GoogleSearchPort"));
+               JaxRpcMapper mapper = j2ee.getJaxRpcMapper();
+	           JaxRpcMapperContext mc =factory.getContextFactory().createJaxRpcMapperContext(mapper,j2ee);
+	           context.setJAXRPCMappingContext(mc);
+	           Assert.assertNotNull(port);
+	           Assert.assertNotNull(be);
+	           Assert.assertNotNull(pe);
+	           Assert.assertEquals(mc.getJavaType(new QName("urn:GoogleSearch","GoogleSearchResult")),"org.objectweb.wssample.gen.google.MyGoogleSearchResult");
+	           Assert.assertEquals(mc.getJavaType(new QName("urn:GoogleSearch","ResultElementArray")),"org.objectweb.wssample.gen.google.ResultElement[]");
+	    } catch (Exception e) {
+	        e.printStackTrace();
+	        throw e;
+	    }
+	}
+	public void testBookTypeMapping() throws Exception{
+	    try {
+	    	
+			   J2EEWebServiceContext context = factory.getContextFactory().getJ2EEWsContext(true);
+			   context.setMiscInfo(factory.getContextFactory().createMiscInfo(new HashMap()));
+	           String mappingfile = sampleDir +"jaxrpc/book/BookQuote.xml";
+	           String wsdlfile = sampleDir +"jaxrpc/book/BookQuote.wsdl";
+	           J2eeEmitter j2ee = new J2eeEmitter();
+	           j2ee.setMappingFilePath(getTestFile(mappingfile));
+	           j2ee.setOutputDir(outDir);
+	           j2ee.setServerSide(true);
+	           j2ee.setVerbose(false);
+	           j2ee.setHelperWanted(true);
+	           System.out.println();
+	           j2ee.runServerSide(getTestFile(wsdlfile));
+	           WSDLContext wscontext = factory.getContextFactory().createWSDLContext(j2ee.getSymbolTable());
+	           PortEntry port = wscontext.getPort(new QName("BookQuotePort"));
+	           BindingEntry be = wscontext.getBinding(new QName("http://www.Monson-Haefel.com/jwsbook/BookQuote","BookQuoteBinding"));
+	           PortTypeEntry pe = wscontext.getPortType(new QName("http://www.Monson-Haefel.com/jwsbook/BookQuote","BookQuote"));
+	           ServiceEntry se = wscontext.getService(new QName("http://www.Monson-Haefel.com/jwsbook/BookQuote","BookQuoteService"));
+               JaxRpcMapper mapper = j2ee.getJaxRpcMapper();
+	           JaxRpcMapperContext mc =factory.getContextFactory().createJaxRpcMapperContext(mapper,j2ee);
+	           Assert.assertNotNull(port);
+	           Assert.assertNotNull(be);
+	           Assert.assertNotNull(pe);
+               System.out.println(mc.getExceptionType(new QName("http://www.Monson-Haefel.com/jwsbook/BookQuote","InvalidIsbnFault")));
+	           Assert.assertEquals(mc.getExceptionType(new QName("http://www.Monson-Haefel.com/jwsbook/BookQuote","InvalidIsbnFault")),"com.jwsbook.jaxrpc.InvalidIsbnException");
+	        
+	           String sei = mc.getServiceEndpointInterfaceName(pe,be);
+	           Assert.assertEquals(sei,"com.jwsbook.jaxrpc.BookQuote");
+	           String si = mc.getServiceInterfaceName(se);
+	           Assert.assertEquals(si,"com.jwsbook.jaxrpc.BookQuoteService");
+	           List l = pe.getPortType().getOperations();
+	           Operation op = (Operation)l.get(0);
+	           Assert.assertEquals(mc.getJavaMethodName(be,op),"getBookPrice");
+	           Assert.assertEquals(mc.getJavaMethodParamType(be,op,0,null),"java.lang.String");
+	           Assert.assertEquals(mc.getJavaMethodReturnType(be,op),"float");  
+	    } catch (Exception e) {
+	        e.printStackTrace();
+	        throw e;
+	    }
+	}
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/PackageModuleTest.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/PackageModuleTest.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/PackageModuleTest.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/PackageModuleTest.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.geronimo.ews.ws4j2ee;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import org.apache.geronimo.ews.AbstractTestCase;
+import org.apache.geronimo.ews.ws4j2ee.module.Module;
+import org.apache.geronimo.ews.ws4j2ee.module.ModuleFactory;
+import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
+
+/**
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public class PackageModuleTest extends AbstractTestCase {
+
+    /**
+     * @param testName
+     */
+    public PackageModuleTest(String testName) {
+        super(testName);
+    }
+
+    public void testLoadWarFile()
+        throws GenerationFault, ClassNotFoundException {
+        Module wmod =
+            ModuleFactory.createPackageModule(
+                getTestFile("target/generated/samples/simple.war"),new File("./target/temp/1"));
+        ClassLoader cl = wmod.getClassLoaderWithPackageLoaded();
+        cl.loadClass("com.jwsbook.jaxrpc.BookQuote");
+    }
+    public void testLoadEarFile()
+        throws GenerationFault, ClassNotFoundException {
+        Module wmod =
+            ModuleFactory.createPackageModule(
+                getTestFile("target/generated/samples/bookquote.ear"),new File("./target/temp/2"));
+        ClassLoader cl = wmod.getClassLoaderWithPackageLoaded();
+        cl.loadClass("com.jwsbook.jaxrpc.BookQuote");
+    }
+    
+    public void testLoadJarUsingURLClassLoader() throws MalformedURLException, ClassNotFoundException{
+    	URLClassLoader cl = new URLClassLoader(new URL[]{(new File("target/generated/samples/bookquote.jar")).toURL()});
+		cl.loadClass("com.jwsbook.jaxrpc.BookQuote");
+    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/WSDLTest.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/WSDLTest.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/WSDLTest.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/test/org/apache/geronimo/ews/ws4j2ee/WSDLTest.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+
+package org.apache.geronimo.ews.ws4j2ee;
+
+import java.util.HashMap;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Assert;
+
+import org.apache.axis.wsdl.symbolTable.BindingEntry;
+import org.apache.axis.wsdl.symbolTable.PortEntry;
+import org.apache.geronimo.ews.AbstractTestCase;
+import org.apache.ws.ews.mapper.J2eeEmitter;
+import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
+import org.apache.geronimo.ews.ws4j2ee.context.wsdl.WSDLContext;
+import org.apache.geronimo.ews.ws4j2ee.toWs.Ws4J2eeFactory;
+import org.apache.geronimo.ews.ws4j2ee.toWs.impl.Ws4J2eeFactoryImpl;
+
+/**
+ * @author hemapani
+ */
+public class WSDLTest extends AbstractTestCase {
+	private Ws4J2eeFactory factory;
+    /**
+     * @param testName
+     */
+    public WSDLTest(String testName) {
+        super(testName);
+		factory = new Ws4J2eeFactoryImpl();
+    }
+
+    public void testGoogleWSDL() throws Exception {
+        J2EEWebServiceContext context = factory.getContextFactory().getJ2EEWsContext(true);
+        context.setMiscInfo(factory.getContextFactory().createMiscInfo(new HashMap()));
+        String mappingfile = getTestFile(sampleDir + "mapper/google/GoogleSearch.xml");
+        String wsdlfile = getTestFile(sampleDir + "mapper/google/GoogleSearch.wsdl");
+        J2eeEmitter j2ee = new J2eeEmitter();
+        j2ee.setMappingFilePath(mappingfile);
+        j2ee.setOutputDir(outDir);
+        j2ee.setServerSide(true);
+        j2ee.setVerbose(false);
+        j2ee.setHelperWanted(true);
+        System.out.println();
+        j2ee.runServerSide(wsdlfile);
+        WSDLContext wscontext =
+			factory.getContextFactory().createWSDLContext(j2ee.getSymbolTable());
+        PortEntry port = wscontext.getPort(new QName("GoogleSearchPort"));
+        BindingEntry be =
+            wscontext.getBinding(
+                new QName("urn:GoogleSearch", "GoogleSearchBinding"));
+
+        Assert.assertEquals(wscontext.getTargetNSURI(), "urn:GoogleSearch");
+        Assert.assertNotNull(port);
+        Assert.assertNotNull(be);
+        Assert.assertNotNull(
+            wscontext.getService(
+                new QName("urn:GoogleSearch", "GoogleSearchService")));
+    }
+}



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


Mime
View raw message