You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ews-dev@ws.apache.org by gu...@apache.org on 2005/08/08 14:42:47 UTC

svn commit: r230793 [5/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/ ...

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/AxisEmitterBasedJaxRpcMapperContext.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/AxisEmitterBasedJaxRpcMapperContext.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/AxisEmitterBasedJaxRpcMapperContext.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/AxisEmitterBasedJaxRpcMapperContext.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,411 @@
+/*
+ * 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.context.impl;
+
+import org.apache.axis.wsdl.fromJava.Emitter;
+import org.apache.axis.wsdl.symbolTable.BindingEntry;
+import org.apache.axis.wsdl.symbolTable.PortTypeEntry;
+import org.apache.axis.wsdl.symbolTable.ServiceEntry;
+import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
+import org.apache.geronimo.ews.ws4j2ee.context.JaxRpcMapperContext;
+import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
+import org.apache.geronimo.ews.ws4j2ee.toWs.UnrecoverableGenerationFault;
+import org.apache.geronimo.ews.ws4j2ee.toWs.dd.JaxRpcMappingFileWriter;
+
+import javax.wsdl.Operation;
+import javax.wsdl.Port;
+import javax.xml.namespace.QName;
+import java.io.InputStream;
+import java.io.Writer;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+
+/**
+ * This class wrap the JAXRPCMapper and only expose a interface to
+ * the rest of the WS4j2ee.
+ *
+ * @author hemapani
+ */
+public class AxisEmitterBasedJaxRpcMapperContext implements JaxRpcMapperContext {
+    private Emitter emitter;
+    private J2EEWebServiceContext j2eewscontext;
+    private HashMap methods = new HashMap();
+
+    public AxisEmitterBasedJaxRpcMapperContext(Emitter emitter, J2EEWebServiceContext j2eewscontext) {
+        this.emitter = emitter;
+        this.j2eewscontext = j2eewscontext;
+        Method[] methods = emitter.getCls().getMethods();
+        for (int i = 0; i < methods.length; i++) {
+            this.methods.put(methods[i].getName(), methods[i]);
+        }
+    }
+
+    /**
+     * @param messageQName
+     * @return
+     */
+    public String getExceptionType(QName messageQName) {
+        throw new UnsupportedOperationException();
+        //return jaxrpcmapper.getExceptionType(messageQName);
+    }
+
+    /**
+     * @param bEntry
+     * @param operation
+     * @return
+     */
+    public String getJavaMethodName(BindingEntry bEntry, Operation operation) {
+        return operation.getName();
+    }
+
+    /**
+     * @param bEntry
+     * @param operation
+     * @param position
+     * @return
+     */
+    public String getJavaMethodParamType(BindingEntry bEntry,
+                                         Operation operation,
+                                         int position, QName type) {
+        Method m = (Method) this.methods.get(operation.getName());
+        //axis do not map the method names or types
+        //so this should do 
+        if (m == null)
+            throw new UnrecoverableGenerationFault("logic expected is differnet .. worng" +
+                    "design decision");
+        return m.getParameterTypes()[position].getName();
+    }
+
+    /**
+     * @param bEntry
+     * @param operation
+     * @return
+     */
+    public String getJavaMethodReturnType(BindingEntry bEntry,
+                                          Operation operation) {
+        Method m = (Method) this.methods.get(operation.getName());
+        //axis do not map the method names or types
+        //so this should do 
+        if (m == null)
+            throw new UnrecoverableGenerationFault("logic expected is differnet .. worng" +
+                    "design decision");
+        return m.getReturnType().getName();
+    }
+
+    /**
+     * @param typeQName
+     * @return
+     */
+    public String getJavaType(QName typeQName) {
+        throw new UnsupportedOperationException();
+        // return jaxrpcmapper.getJavaType(typeQName);
+    }
+
+    /**
+     * @param port
+     * @return
+     */
+    public String getPortName(Port port) {
+        return emitter.getServicePortName();
+    }
+
+    /**
+     * @param ptEntry
+     * @param bEntry
+     * @return
+     */
+    public String getServiceEndpointInterfaceName(PortTypeEntry ptEntry,
+                                                  BindingEntry bEntry) {
+        return emitter.getPortTypeName();
+    }
+
+    /**
+     * @param entry
+     * @return
+     */
+    public String getServiceInterfaceName(ServiceEntry entry) {
+        return emitter.getServiceElementName();
+    }
+
+    /**
+     * @param path
+     */
+    public void loadMappingFromDir(String path) {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * @param is
+     */
+    public void loadMappingFromInputStream(InputStream is) {
+        throw new UnsupportedOperationException();
+    }
+
+    public void serialize(Writer out) throws GenerationFault {
+        JaxRpcMappingFileWriter w = new JaxRpcMappingFileWriter(out, emitter, j2eewscontext);
+        w.write();
+//
+//        try {
+//            JAXBContext jc = JAXBContext.newInstance("org.apache.ws.ews.mapper.descriptor");
+//            ObjectFactory objFactory = new ObjectFactory();
+//
+//            JavaWsdlMapping jaxrpcmap = objFactory.createJavaWsdlMapping();
+//            jaxrpcmap.setVersion(new BigDecimal("1.0"));
+//            
+////adding pckage mappings
+//            Map map = emitter.getNamespaceMap();
+//            if (map != null) {
+//                Iterator packages = map.keySet().iterator();
+//                while (packages.hasNext()) {
+//                    PackageMappingType pkgmap = objFactory.createPackageMappingType();
+//                    //set the package name
+//                    FullyQualifiedClassType packagename = objFactory.createFullyQualifiedClassType();
+//                    String pkg = (String) packages.next();
+//                    String jaxrpcsei = j2eewscontext.getMiscInfo().getJaxrpcSEI();
+//                    if(pkg == null){
+//                    	//TODO this is temporrary work around to make sure 
+//                    	//the mapping is defined.
+//                    	String pkgName = Utils.getPackageNameFromQuallifiedName(jaxrpcsei);
+//						String val = (String)map.get(pkgName);
+//						if(val == null){
+//							val = Utils.javapkgToURI(pkgName);
+//							packagename.setValue(pkgName);
+//							pkgmap.setPackageType(packagename);
+//							//set the namespace URI
+//							XsdAnyURIType nsuri = objFactory.createXsdAnyURIType();
+//							nsuri.setValue(val);
+//							pkgmap.setNamespaceURI(nsuri);
+//						}else{
+//							continue;
+//						}
+//                    }else if(pkg.equals(jaxrpcsei)){
+//                   		continue;
+//                    }else{
+//						packagename.setValue(pkg);
+//						pkgmap.setPackageType(packagename);
+//						//set the namespace URI
+//						XsdAnyURIType nsuri = objFactory.createXsdAnyURIType();
+//						nsuri.setValue((String) map.get(pkg));
+//						pkgmap.setNamespaceURI(nsuri);
+//
+//                    }
+//                    //done :) add the package type
+//                    jaxrpcmap.getPackageMapping().add(pkgmap);
+//                }
+//            }
+//            
+////adding Service mappings
+/////////////////////////////
+//            Service service = j2eewscontext.getWSDLContext().gettargetService().getService();
+//            org.apache.ws.ews.mapper.descriptor.JavaWsdlMappingType.ServiceInterfaceMapping servciemaping = objFactory.createJavaWsdlMappingTypeServiceInterfaceMapping();
+//			
+//            	
+//            //get the sevice QName	
+//            XsdQNameType serviceName = objFactory.createXsdQNameType();
+//            serviceName.setValue(service.getQName());
+//            servciemaping.setWsdlServiceName(serviceName);
+//        	
+//            //set the service java Name 
+//            FullyQualifiedClassType serviceJavaName = objFactory.createFullyQualifiedClassType();
+//
+//            String name = emitter.getCls().getName();
+//            int index = name.lastIndexOf('.');
+//            String packageName = "";
+//            if (index > 0)
+//                packageName = name.substring(0, index + 1);
+//
+//            serviceJavaName.setValue(packageName + emitter.getServiceElementName());
+//
+//            servciemaping.setServiceInterface(serviceJavaName);
+//            jaxrpcmap.getServiceInterfaceMappingAndServiceEndpointInterfaceMapping().add(servciemaping);
+//
+//
+//
+//            Port wsdlport = j2eewscontext.getWSDLContext().getTargetPort();
+//            Binding binding = wsdlport.getBinding();
+//         	
+//            //create a portmap
+//            PortMappingType portmap = objFactory.createPortMappingType();
+//            //java port name 
+//            org.apache.ws.ews.mapper.descriptor.String javaportname = objFactory.createString();
+//            javaportname.setValue(emitter.getServicePortName());
+//            portmap.setJavaPortName(javaportname);
+//            //wsdl port name 
+//            org.apache.ws.ews.mapper.descriptor.String wsdlportname = objFactory.createString();
+//            wsdlportname.setValue(wsdlport.getName());
+//            portmap.setPortName(wsdlportname);
+//
+//            servciemaping.getPortMapping().add(portmap);
+//
+//            if (binding == null)
+//                throw new UnrecoverableGenerationFault("no port discription not match with the wsdl file");
+//
+//            org.apache.ws.ews.mapper.descriptor.JavaWsdlMappingType.ServiceEndpointInterfaceMapping seimapping = objFactory.createJavaWsdlMappingTypeServiceEndpointInterfaceMapping();
+//            
+////set java SEI name
+//            FullyQualifiedClassType seijavaName = objFactory.createFullyQualifiedClassType();
+//            seijavaName.setValue(emitter.getCls().getName());
+//            seimapping.setServiceEndpointInterface(seijavaName);
+////set the wsdl finding name
+//            XsdQNameType bindingQName = objFactory.createXsdQNameType();
+//            bindingQName.setValue(binding.getQName());
+//            seimapping.setWsdlBinding(bindingQName);
+////set the wsdl port type
+//            XsdQNameType portTypeQName = objFactory.createXsdQNameType();
+//            portTypeQName.setValue(binding.getPortType().getQName());
+//            seimapping.setWsdlPortType(portTypeQName);
+//            
+////add the operation mappings
+//            Iterator ops = binding.getPortType().getOperations().iterator();
+//
+//            while (ops.hasNext()) {
+//                ServiceEndpointMethodMappingType seimethodmapping = objFactory.createServiceEndpointMethodMappingType();
+//                Operation op = (Operation) ops.next();
+//            	
+//                //set the java method name
+//                org.apache.ws.ews.mapper.descriptor.String javamethodname = objFactory.createString();
+//                javamethodname.setValue(op.getName());
+//                seimethodmapping.setJavaMethodName(javamethodname);
+//            
+//                //TODO not sure what this WrappedElement do. FIXIT
+//                //seimethodmapping.setWrappedElement();
+//            	
+//                //set wsdl method name 
+//                org.apache.ws.ews.mapper.descriptor.String wsdlmethodname = objFactory.createString();
+//                wsdlmethodname.setValue(op.getName());
+//                seimethodmapping.setWsdlOperation(wsdlmethodname);
+//            
+//                //this work only when the method names are same
+//                //im printing it so that it is easier for user to change 
+//                //it am sure that no body will writing nor webservices.xml 
+//                //or mapper.xml files if there is a short cut.
+//				
+//            	
+//                //set return type
+//                Method mtd = (Method) methods.get(op.getName());
+//				Class ret = mtd.getReturnType();
+//				if(ret!= null && !("void".equals(ret.toString()))){
+//					//create return type  Map
+//					WsdlReturnValueMappingType retvalmap = objFactory.createWsdlReturnValueMappingType();
+//
+//					FullyQualifiedClassType retValjavaName = objFactory.createFullyQualifiedClassType();
+//					retValjavaName.setValue(ret.getName());
+//					retvalmap.setMethodReturnValue(retValjavaName);
+//					
+//					//set return type info
+//					Map parts = op.getOutput().getMessage().getParts();
+//					if (parts != null) {
+//						Iterator partIt = parts.values().iterator();
+//						if (partIt.hasNext()) {
+//							//set wsdl message type
+//							WsdlMessageType messageType = objFactory.createWsdlMessageType();
+//							messageType.setValue(op.getOutput().getMessage().getQName());
+//							retvalmap.setWsdlMessage(messageType);
+//            			
+//							//set wsdl message part type
+//							WsdlMessagePartNameType messagePartName = objFactory.createWsdlMessagePartNameType();
+//							messagePartName.setValue(((Part) partIt.next()).getName());
+//							retvalmap.setWsdlMessagePartName(messagePartName);
+//						}
+//
+//					}
+//
+//					seimethodmapping.setWsdlReturnValueMapping(retvalmap);
+//
+//				}
+//            
+//            
+//            	
+//                //create method param parts mappings	
+//                int position = 0;
+//                Class[] params = ((Method) methods.get(op.getName())).getParameterTypes();
+//
+//                Iterator parmIt = null;
+//                Map parameters = op.getInput().getMessage().getParts();
+//                if (parameters != null) {
+//                    parmIt = parameters.values().iterator();
+//                }
+//
+//                while (parmIt != null && parmIt.hasNext()) {
+//                    Part part = (Part) parmIt.next();
+//                    //create parts mapping
+//                    MethodParamPartsMappingType partsMapping = objFactory.createMethodParamPartsMappingType();
+//                    //set parameter position
+//                    XsdNonNegativeIntegerType pos = objFactory.createXsdNonNegativeIntegerType();
+//                    pos.setValue(new BigInteger(Integer.toString(position)));
+//                    partsMapping.setParamPosition(pos);
+//            		
+//                    //set parameter java typr
+//                    JavaTypeType javaType = objFactory.createJavaTypeType();
+//                    javaType.setValue(params[position].getName());
+//                    partsMapping.setParamType(javaType);
+//            		
+//                    //set message mapping
+//                    WsdlMessageMappingType msgmappingType = objFactory.createWsdlMessageMappingType();
+//                    //set mode
+//                    ParameterModeType mode = objFactory.createParameterModeType();
+//                    mode.setValue("IN");
+//                    msgmappingType.setParameterMode(mode);
+//                    //TODO Im a not sure what to do with the header 
+//                    //msgmappingType.setSoapHeader();
+//                    //set wsdl message type
+//                    WsdlMessageType messageType = objFactory.createWsdlMessageType();
+//                    messageType.setValue(op.getInput().getMessage().getQName());
+//                    msgmappingType.setWsdlMessage(messageType);
+//                    //set wsdl message part type
+//                    WsdlMessagePartNameType messagePartName = objFactory.createWsdlMessagePartNameType();
+//                    messagePartName.setValue(part.getName());
+//                    msgmappingType.setWsdlMessagePartName(messagePartName);
+//
+//                    partsMapping.setWsdlMessageMapping(msgmappingType);
+//                    seimethodmapping.getMethodParamPartsMapping().add(partsMapping);
+//                }
+//
+//                seimapping.getServiceEndpointMethodMapping().add(seimethodmapping);
+//
+//            }
+//            jaxrpcmap.getServiceInterfaceMappingAndServiceEndpointInterfaceMapping().add(seimapping);
+//                  
+////axis do not support XML type mapping or Exception
+////maping to be specifed so I do not brother tp print them out. 
+////jaxrpcmap.getExceptionMapping();
+////jaxrpcmap.getJavaXmlTypeMapping();
+//            
+//            Marshaller m = jc.createMarshaller();
+//            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+//            m.marshal(jaxrpcmap, out);
+//
+//            Unmarshaller u = jc.createUnmarshaller();
+//        } catch (Exception e) {
+//        	e.printStackTrace();
+//            throw GenerationFault.createGenerationFault(e);
+//        }
+    }
+
+    public String getPackageMappingClassName(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+    public int getPackageMappingCount() {
+        throw new UnsupportedOperationException();
+    }
+
+    public String getPackageMappingURI(int index) {
+        throw new UnsupportedOperationException();
+    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/ContextFactoryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/ContextFactoryImpl.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/ContextFactoryImpl.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/ContextFactoryImpl.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,73 @@
+/*
+ * 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.context.impl;
+
+import java.util.Map;
+
+import org.apache.axis.wsdl.symbolTable.SymbolTable;
+import org.apache.ws.ews.mapper.J2eeEmitter;
+import org.apache.ws.ews.mapper.jaxrpc.JaxRpcMapper;
+import org.apache.geronimo.ews.ws4j2ee.context.ContextFactory;
+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.wsdl.WSDLContext;
+import org.apache.geronimo.ews.ws4j2ee.context.wsdl.impl.AxisWSDLContext;
+import org.apache.geronimo.ews.ws4j2ee.toWs.UnrecoverableGenerationFault;
+
+/**
+ * <p>This class decouple the concreate implementations of the
+ * class from the rest of the code</p>
+ *
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public class ContextFactoryImpl implements ContextFactory {
+    private J2EEWebServiceContext currentContext;
+
+    public WSDLContext createWSDLContext(Object info) {
+        if (info instanceof SymbolTable)
+            return new AxisWSDLContext((SymbolTable) info);
+        throw new UnrecoverableGenerationFault("unknown context type");
+    }
+
+    public JaxRpcMapperContext createJaxRpcMapperContext(JaxRpcMapper mapper, J2eeEmitter emitter) {
+        return new JaxRpcMapperImpl(mapper, emitter);
+    }
+
+//    public WSCFContext createWSCFContext(InputStream in)
+//        throws GenerationFault {
+//        try {
+//            return new WSCFContextImpl(in);
+//        } catch (WSCFException e) {
+//            e.printStackTrace();
+//            throw new GenerationFault(e.getMessage());
+//        }
+//    }
+
+    public MiscInfo createMiscInfo(Map map) {
+        return new MiscInfoImpl(map);
+    }
+
+//    public static J2EEWebServiceContext getCurrentJ2EEWsContext() {
+//        return currentContext;
+//    }
+    public J2EEWebServiceContext getJ2EEWsContext(boolean hasWSDL) {
+        currentContext = new J2EEWebServiceContextImpl(hasWSDL);
+        return currentContext;
+    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/EJBDDContextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/EJBDDContextImpl.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/EJBDDContextImpl.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/EJBDDContextImpl.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.context.impl;
+
+import org.apache.geronimo.ews.ws4j2ee.context.j2eeDD.EJBContext;
+
+/**
+ * @author hemapani@opensource.lk
+ */
+public class EJBDDContextImpl implements EJBContext {
+    private String ejbName;
+    private String implBean;
+    private String ejbhomeInterface;
+    private String ejbRemoteInterface;
+    private String ejbLocalHomeInterfce;
+    private String ejbLocalInterface;
+
+    public EJBDDContextImpl(String ejbName,
+                            String implBean,
+                            String ejbhomeInterface,
+                            String ejbRemoteInterface,
+                            String ejbLocalHomeInterfce,
+                            String ejbLocalInterface) {
+        this.ejbName = ejbName;
+        this.implBean = implBean;
+        this.ejbhomeInterface = ejbhomeInterface;
+        this.ejbRemoteInterface = ejbRemoteInterface;
+        this.ejbLocalHomeInterfce = ejbLocalHomeInterfce;
+        this.ejbLocalInterface = ejbLocalInterface;
+    }
+
+    /**
+     * @return
+     */
+    public String getEjbLocalHomeInterfce() {
+        return ejbLocalHomeInterfce;
+    }
+
+    /**
+     * @return
+     */
+    public String getEjbLocalInterface() {
+        return ejbLocalInterface;
+    }
+
+    /**
+     * @return
+     */
+    public String getEjbName() {
+        return ejbName;
+    }
+
+    /**
+     * @return
+     */
+    public String getEjbRemoteInterface() {
+        return ejbRemoteInterface;
+    }
+
+    /**
+     * @return
+     */
+    public String getImplBean() {
+        return implBean;
+    }
+
+    /**
+     * @return
+     */
+    public String getEjbhomeInterface() {
+        return ejbhomeInterface;
+    }
+
+    /**
+     * @param string
+     */
+    public void setEjbhomeInterface(String string) {
+        ejbhomeInterface = string;
+    }
+
+    /**
+     * @param string
+     */
+    public void setEjbLocalHomeInterfce(String string) {
+        ejbLocalHomeInterfce = string;
+    }
+
+    /**
+     * @param string
+     */
+    public void setEjbLocalInterface(String string) {
+        ejbLocalInterface = string;
+    }
+
+    /**
+     * @param string
+     */
+    public void setEjbName(String string) {
+        ejbName = string;
+    }
+
+    /**
+     * @param string
+     */
+    public void setEjbRemoteInterface(String string) {
+        ejbRemoteInterface = string;
+    }
+
+    /**
+     * @param string
+     */
+    public void setImplBean(String string) {
+        implBean = string;
+    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/InputOutputFileImpl.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/InputOutputFileImpl.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/InputOutputFileImpl.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/InputOutputFileImpl.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,101 @@
+/*
+ * 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.context.impl;
+
+import org.apache.geronimo.ews.ws4j2ee.context.InputOutputFile;
+import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * @author hemapani@opensource.lk
+ */
+public class InputOutputFileImpl implements InputOutputFile {
+    private InputStream instream;
+    private String fileName;
+    private OutputStream outstream;
+
+    public InputOutputFileImpl(InputStream instream) {
+        this.instream = instream;
+    }
+
+    public InputOutputFileImpl(String fileName) throws GenerationFault {
+        this.fileName = fileName;
+    }
+
+    public InputOutputFileImpl(String fileName, InputStream instream) {
+        this.instream = instream;
+        this.fileName = fileName;
+    }
+
+    public String fileName() {
+        if (fileName == null)
+            throw new UnsupportedOperationException("asking for file name when input/output is a stream");
+        return fileName;
+    }
+
+    public InputStream getInputStream() throws GenerationFault {
+        try {
+            if (instream == null) {
+                File file = new File(fileName);
+                this.instream = new FileInputStream(file);
+            }
+            return instream;
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+            throw GenerationFault.createGenerationFault(e);
+        }
+    }
+
+    public OutputStream getOutStream() throws GenerationFault {
+        try {
+            if (outstream == null) {
+                File file = new File(fileName);
+                File parent = file.getParentFile();
+                if (!parent.exists())
+                    parent.mkdirs();
+                this.outstream = new FileOutputStream(file);
+            }
+            return outstream;
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+            throw GenerationFault.createGenerationFault(e);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#finalize()
+     */
+    protected void finalize() throws Throwable {
+        try {
+            if (outstream != null)
+                outstream.close();
+            if (instream != null) {
+                instream.close();
+            }
+        } catch (IOException e) {
+        }
+        super.finalize();
+    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/J2EEWebServiceContextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/J2EEWebServiceContextImpl.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/J2EEWebServiceContextImpl.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/J2EEWebServiceContextImpl.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,156 @@
+/*
+ * 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.context.impl;
+
+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.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.toWs.UnrecoverableGenerationFault;
+import org.apache.geronimo.ews.ws4j2ee.toWs.Ws4J2eeFactory;
+
+import java.util.Vector;
+
+/**
+ * <p>Code should use parsers and create runtime representation
+ * of the information taken fom the WSDL and configaration files.</p>
+ * <p>depend on hasWSDL or the not the implementation should
+ * <ol>
+ * <li>parse the WSDL and populate informatio in <code>WSDLContext</code></li>
+ * <li>parse the SEI or EJB and populate the information in <code>WSDLContext</code>
+ * with the help of the jaxrpc mapping file information.
+ * </li>
+ * </ol>
+ * </p>
+ *
+ * @author Srinath Perera(hemapani@opensorce.lk)
+ * @see org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext
+ */
+public class J2EEWebServiceContextImpl implements J2EEWebServiceContext {
+    private boolean hasWSDL = true;
+    private WSCFContext wscfcontext;
+    private WSDLContext wsdlcontext;
+    private JaxRpcMapperContext jaxrpcmappingcontext;
+    private MiscInfo miscInfo;
+    private Ws4J2eeFactory factory;
+    private Vector srcontext;
+    private EJBContext ejbcontext;
+    private WebContext webcontext;
+
+    public J2EEWebServiceContextImpl(boolean hasWSDL) {
+        this.hasWSDL = hasWSDL;
+        srcontext = new Vector();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext#getWSDLContext()
+     */
+    public WSDLContext getWSDLContext() {
+        return wsdlcontext;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext#setWSDLContext(org.apache.geronimo.ews.ws4j2ee.context.wsdl.WSDLContext)
+     */
+    public void setWSDLContext(WSDLContext wsdlcontext) {
+        this.wsdlcontext = wsdlcontext;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext#getJAXRPCMappingContext()
+     */
+    public JaxRpcMapperContext getJAXRPCMappingContext() {
+        return jaxrpcmappingcontext;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext#setJAXRPCMappingContext(org.apache.geronimo.ews.ws4j2ee.context.JaxRpcMapperContext)
+     */
+    public void setJAXRPCMappingContext(JaxRpcMapperContext context) {
+        this.jaxrpcmappingcontext = context;
+    }
+
+    public WSCFContext getWSCFContext() {
+        return wscfcontext;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext#setWSCFContext(org.apache.ws.ews.context.webservices.interfaces.WSCFContext)
+     */
+    public void setWSCFContext(WSCFContext wscfcontext) {
+        this.wscfcontext = wscfcontext;
+    }
+
+    public MiscInfo getMiscInfo() {
+        return miscInfo;
+    }
+
+    /**
+     * @param info
+     */
+    public void setMiscInfo(MiscInfo info) {
+        this.miscInfo = info;
+    }
+
+    public void validate() {
+        if (wscfcontext == null || miscInfo == null ||
+                (hasWSDL && wsdlcontext == null) || jaxrpcmappingcontext == null)
+            throw new UnrecoverableGenerationFault("valdation of the j2ee context failed");
+        miscInfo.validate();
+    }
+
+    public void setFactory(Ws4J2eeFactory factory) {
+        this.factory = factory;
+    }
+
+    public Ws4J2eeFactory getFactory() {
+        return this.factory;
+    }
+
+    public void addServiceReferenceContext(ServiceReferenceContext context) {
+        srcontext.add(context);
+    }
+
+    public EJBContext getEJBDDContext() {
+        return ejbcontext;
+    }
+
+    public ServiceReferenceContext getServiceReferenceContext(int index) {
+        return (ServiceReferenceContext) srcontext.get(index);
+    }
+
+    public int getServiceReferenceContextCount() {
+        return srcontext.size();
+    }
+
+    public WebContext getWebDDContext() {
+        return webcontext;
+    }
+
+    public void setEJBDDContext(EJBContext context) {
+        this.ejbcontext = context;
+    }
+
+    public void setWebDDContext(WebContext context) {
+        webcontext = context;
+    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/JaxRpcMapperImpl.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/JaxRpcMapperImpl.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/JaxRpcMapperImpl.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/JaxRpcMapperImpl.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,225 @@
+/*
+ * 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.context.impl;
+
+import org.apache.axis.wsdl.symbolTable.BindingEntry;
+import org.apache.axis.wsdl.symbolTable.PortTypeEntry;
+import org.apache.axis.wsdl.symbolTable.ServiceEntry;
+import org.apache.ws.ews.mapper.J2eeEmitter;
+import org.apache.ws.ews.mapper.MapperFault;
+import org.apache.ws.ews.mapper.jaxrpc.JaxRpcMapper;
+import org.apache.geronimo.ews.ws4j2ee.context.JaxRpcMapperContext;
+import org.apache.geronimo.ews.ws4j2ee.toWs.UnrecoverableGenerationFault;
+import org.apache.geronimo.ews.ws4j2ee.utils.Utils;
+
+import javax.wsdl.Operation;
+import javax.wsdl.Part;
+import javax.wsdl.Port;
+import javax.xml.namespace.QName;
+import java.io.InputStream;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * This class wrap the JAXRPCMapper and only expose a interface to
+ * the rest of the WS4j2ee.
+ *
+ * @author Srinath Perera(hemapani@opensource.lk)
+ * @see org.apache.geronimo.ews.ws4j2ee.context.JaxRpcMapperContext
+ */
+public class JaxRpcMapperImpl implements JaxRpcMapperContext {
+    private JaxRpcMapper jaxrpcmapper;
+    private J2eeEmitter j2ee;
+
+    public JaxRpcMapperImpl(JaxRpcMapper jaxrpcmapper, J2eeEmitter j2ee) {
+        this.jaxrpcmapper = jaxrpcmapper;
+        this.j2ee = j2ee;
+    }
+
+    /**
+     * @param messageQName
+     * @return
+     */
+    public String getExceptionType(QName messageQName) {
+        String exceptionName = jaxrpcmapper.getExceptionType(messageQName);
+        if (exceptionName == null) {
+            exceptionName = j2ee.getJavaName(messageQName);
+            if (exceptionName == null)
+                throw new UnrecoverableGenerationFault("the exception name in a SEI OP can not be null" +
+                        "possibly be a bug check the WSDL2Java data extraction");
+        }
+        return exceptionName;
+    }
+
+    /**
+     * @param bEntry
+     * @param operation
+     * @return
+     */
+    public String getJavaMethodName(BindingEntry bEntry, Operation operation) {
+        String opName = jaxrpcmapper.getJavaMethodName(bEntry.getQName(), bEntry.getBinding().getPortType().getQName(), operation.getName());
+        if (opName == null)
+            opName = operation.getName();
+        if (opName == null)
+            throw new UnrecoverableGenerationFault("the method name in a SEI OP can not be null" +
+                    "possibly be a bug check the WSDL2Java data extraction");
+        return Utils.firstCharacterToLowerCase(opName);
+    }
+
+    /**
+     * @param bEntry
+     * @param operation
+     * @param position
+     * @return
+     */
+    public String getJavaMethodParamType(BindingEntry bEntry,
+                                         Operation operation,
+                                         int position, QName parmType) {
+        String type = jaxrpcmapper.getJavaMethodParamType(bEntry.getQName(), bEntry.getBinding().getPortType().getQName(), operation.getName(), position);
+        if (type == null) {
+            type = j2ee.getJavaName(parmType);
+            if (type == null)
+                throw new UnrecoverableGenerationFault("the parm type name in a SEI OP can not be null" +
+                        "possibly be a bug check the WSDL2Java data extraction");
+        }
+        return type;
+    }
+
+    /**
+     * @param bEntry
+     * @param operation
+     * @return
+     */
+    public String getJavaMethodReturnType(BindingEntry bEntry,
+                                          Operation operation) {
+        String returnType = jaxrpcmapper.getJavaMethodReturnType(bEntry.getQName(), bEntry.getBinding().getPortType().getQName(), operation.getName());
+        if (returnType == null) {
+            Map parts = operation.getOutput().getMessage().getParts();
+            if (parts != null) {
+                Iterator returnlist = parts.values().iterator();
+                if (returnlist.hasNext()) {
+                    Part part = (Part) returnlist.next();
+                    returnType = jaxrpcmapper.getJavaType(part.getTypeName());
+                    if (returnType == null)
+                        returnType = j2ee.getJavaName(part.getTypeName());
+                }
+            }
+        }
+        return returnType;
+        // fixed inside 
+        // return Utils.jni2javaName(returnType);
+    }
+
+    /**
+     * @param typeQName
+     * @return
+     */
+    public String getJavaType(QName typeQName) {
+        String type = jaxrpcmapper.getJavaType(typeQName);
+        if (type == null)
+            type = j2ee.getJavaName(typeQName);
+        if (type == null)
+            throw new UnrecoverableGenerationFault("the type name can" +
+                    " not be null possibly be a bug check the WSDL2Java data extraction");
+        return type;
+    }
+
+    /**
+     * @param port
+     * @return
+     */
+    public String getPortName(Port port) {
+        String portName = jaxrpcmapper.getPortName(port.getName());
+        if (portName == null) {
+            portName = port.getName();
+            if (portName == null)
+                throw new UnrecoverableGenerationFault("the portName can" +
+                        " not be null, possibly be a bug check the WSDL2Java data extraction");
+        }
+        return portName;
+    }
+
+    /**
+     * @param ptEntry
+     * @param bEntry
+     * @return
+     */
+    public String getServiceEndpointInterfaceName(PortTypeEntry ptEntry,
+                                                  BindingEntry bEntry) {
+        String seiName = jaxrpcmapper.getServiceEndpointInterfaceName(ptEntry.getQName(), bEntry.getQName());
+        if (seiName == null) {
+            seiName = ptEntry.getName();
+            if (seiName == null)
+                throw new UnrecoverableGenerationFault("the seiName can" +
+                        " not be null, possibly be a bug check the WSDL2Java data extraction");
+        }
+        return seiName;
+    }
+
+    /**
+     * @param entry
+     * @return
+     */
+    public String getServiceInterfaceName(ServiceEntry entry) {
+        String serviceInterface = jaxrpcmapper.getServiceInterfaceName(entry.getQName());
+        if (serviceInterface == null) {
+            serviceInterface = entry.getName();
+            if (serviceInterface == null)
+                throw new UnrecoverableGenerationFault("the serviceInterface can" +
+                        " not be null, possibly be a bug check the WSDL2Java data extraction");
+        }
+        return serviceInterface;
+    }
+
+    /**
+     * @param path
+     */
+    public void loadMappingFromDir(String path) throws MapperFault {
+        jaxrpcmapper.loadMappingFromDir(path);
+    }
+
+    /**
+     * @param is
+     */
+    public void loadMappingFromInputStream(InputStream is) throws MapperFault {
+        jaxrpcmapper.loadMappingFromInputStream(is);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.JaxRpcMapperContext#serialize()
+     */
+    public void serialize(Writer out) {
+        throw new UnsupportedOperationException("when the wsdl is avalibe serialization not reqired");
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.JaxRpcMapperContext#getPackageMappingClassName(int)
+     */
+    public String getPackageMappingClassName(int index) {
+        return jaxrpcmapper.getPackageMappingClassName(index);
+    }
+
+    public int getPackageMappingCount() {
+        return jaxrpcmapper.getPackageMappingCount();
+    }
+
+    public String getPackageMappingURI(int index) {
+        return jaxrpcmapper.getPackageMappingURI(index);
+    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/MiscInfoImpl.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/MiscInfoImpl.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/MiscInfoImpl.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/MiscInfoImpl.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,323 @@
+/*
+ * 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.context.impl;
+
+import org.apache.geronimo.ews.ws4j2ee.context.InputOutputFile;
+import org.apache.geronimo.ews.ws4j2ee.context.MiscInfo;
+import org.apache.geronimo.ews.ws4j2ee.context.SEIOperation;
+import org.apache.ws.ews.context.webservices.server.WSCFHandler;
+import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationConstants;
+
+import java.util.ArrayList;
+import java.util.Map;
+
+/**
+ * @author Srinath Perera(hemapani@opensource.lk)
+ * @see org.apache.geronimo.ews.ws4j2ee.context.MiscInfo
+ */
+public class MiscInfoImpl implements MiscInfo {
+    private boolean useProvider = false;
+    
+    private ClassLoader classloader;
+    private boolean implwithEJB = true;
+    /* if Impl is avalible the class need not to be created agaien*/
+    private boolean implAvalible = true;
+
+    private String outputPath = ".";
+    private String j2eelink;
+    private String seiname;
+
+    private ArrayList operations;
+    private boolean verbose = false;
+    private String wsConfFileLocation;
+
+    private InputOutputFile wsdlFile;
+    private InputOutputFile jaxrpcfile;
+    private InputOutputFile wsconffile;
+
+    private String targetJ2EEContainer = GenerationConstants.JBOSS_CONTAINER;
+    private String implStyle = GenerationConstants.USE_LOCAL_AND_REMOTE;
+    private boolean seiExists = false;
+    private ArrayList classpathelements;
+    private boolean compile = true;
+    private Map map;
+
+    private WSCFHandler[] handlers;
+
+    public MiscInfoImpl(Map map) {
+        this.map = map;
+        operations = new ArrayList();
+        targetJ2EEContainer = GenerationConstants.JBOSS_CONTAINER;
+        implStyle = GenerationConstants.USE_REMOTE;
+    }
+
+    public String getOutPutPath() {
+        return outputPath;
+    }
+
+    public void setOutputPath(String string) {
+        outputPath = string;
+    }
+
+    public void validate() {
+    }
+
+    /**
+     * @return
+     */
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.MiscInfo#getSEIOperations()
+     */
+    public ArrayList getSEIOperations() {
+        return operations;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.MiscInfo#setSEIOperations(java.util.ArrayList)
+     */
+    public void setSEIOperations(SEIOperation operation) {
+        this.operations.add(operation);
+    }
+
+    /**
+     * @return
+     */
+    public boolean isVerbose() {
+        return verbose;
+    }
+
+    /**
+     * @return
+     */
+    public String getWsConfFileLocation() {
+        return wsConfFileLocation;
+    }
+
+    /**
+     * @param b
+     */
+    public void setVerbose(boolean b) {
+        verbose = b;
+    }
+
+    /**
+     * @param string
+     */
+    public void setWsConfFileLocation(String string) {
+        wsConfFileLocation = string;
+    }
+
+    /**
+     * @return
+     */
+    public String getJ2eeComponetLink() {
+        return j2eelink;
+    }
+
+    /**
+     * @param string
+     */
+    public void setJ2eeComponetLink(String string) {
+        j2eelink = string;
+    }
+
+    /**
+     * @return
+     */
+    public InputOutputFile getJaxrpcfile() {
+        return jaxrpcfile;
+    }
+
+    /**
+     * @return
+     */
+    public InputOutputFile getWsdlFile() {
+        return wsdlFile;
+    }
+
+    /**
+     * @param string
+     */
+    public void setJaxrpcfile(InputOutputFile string) {
+        jaxrpcfile = string;
+    }
+
+    /**
+     * @param string
+     */
+    public void setWsdlFile(InputOutputFile string) {
+        wsdlFile = string;
+    }
+
+    /**
+     * @return
+     */
+    public String getJaxrpcSEI() {
+        return seiname;
+    }
+
+    /**
+     * @param string
+     */
+    public void setJaxrpcSEI(String string) {
+        seiname = string;
+    }
+
+    /**
+     * @return
+     */
+    public String getImplStyle() {
+        return implStyle;
+    }
+
+    /**
+     * @return
+     */
+    public String getTargetJ2EEContainer() {
+        return targetJ2EEContainer;
+    }
+
+    /**
+     * @param string
+     */
+    public void setImplStyle(String string) {
+        implStyle = string;
+    }
+
+    /**
+     * @param string
+     */
+    public void setTargetJ2EEContainer(String string) {
+        targetJ2EEContainer = string;
+    }
+
+    /**
+     * @return
+     */
+    public boolean isImplwithEJB() {
+        return implwithEJB;
+    }
+
+    /**
+     * @param b
+     */
+    public void setImplwithEJB(boolean b) {
+        implwithEJB = b;
+    }
+
+    /**
+     * @return
+     */
+    public boolean isImplAvalible() {
+        return implAvalible;
+    }
+
+    /**
+     * @param b
+     */
+    public void setImplAvalible(boolean b) {
+        this.implAvalible = b;
+    }
+
+    /**
+     * @return
+     */
+    public InputOutputFile getWsconffile() {
+        return wsconffile;
+    }
+
+    /**
+     * @param string
+     */
+    public void setWsconffile(InputOutputFile string) {
+        wsconffile = string;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.MiscInfo#getHandlers()
+     */
+    public WSCFHandler[] getHandlers() {
+        return handlers;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.MiscInfo#setHandlers(org.apache.ws.ews.context.webservices.server.WSCFHandler[])
+     */
+    public void setHandlers(WSCFHandler[] handlers) {
+        this.handlers = handlers;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.MiscInfo#isSEIExists()
+     */
+    public boolean isSEIExists() {
+        return seiExists;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.MiscInfo#setSEIExists()
+     */
+    public void setSEIExists(boolean seiExists) {
+        this.seiExists = seiExists;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.MiscInfo#getClasspathElements()
+     */
+    public ArrayList getClasspathElements() {
+        return classpathelements;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.MiscInfo#setClassPathElements()
+     */
+    public void setClassPathElements(ArrayList classpathelements) {
+        this.classpathelements = classpathelements;
+    }
+
+    /**
+     * @return
+     */
+    public ClassLoader getClassloader() {
+        return classloader;
+    }
+
+    /**
+     * @param loader
+     */
+    public void setClassloader(ClassLoader loader) {
+        classloader = loader;
+    }
+
+    /**
+     * @return
+     */
+    public boolean isCompile() {
+        return compile;
+    }
+
+    /**
+     * @param b
+     */
+    public void setCompile(boolean b) {
+        compile = b;
+    }
+
+    public Object getProprty(Object key) {
+        return map.get(key);
+    }
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/SEIOperationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/SEIOperationImpl.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/SEIOperationImpl.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/SEIOperationImpl.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,75 @@
+/*
+ * 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.context.impl;
+
+import org.apache.geronimo.ews.ws4j2ee.context.SEIOperation;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+/**
+ * @author Srinath Perera(hemapani@opensource.lk)
+ * @see SEIOperation
+ */
+public class SEIOperationImpl implements SEIOperation {
+    private String methodName;
+    private String returnType;
+    private HashMap parameters = new HashMap();
+    private ArrayList parmNames = new ArrayList();
+    private ArrayList faults = new ArrayList();
+
+    public String getMethodName() {
+        return methodName;
+    }
+
+    public ArrayList getParameterNames() {
+        return parmNames;
+    }
+
+    public ArrayList getFaults() {
+        return faults;
+    }
+
+    public void setMethodName(String methodName) {
+        this.methodName = methodName;
+    }
+
+    public void addParameter(String type, String name) {
+        parmNames.add(name);
+        parameters.put(name, type);
+    }
+
+    public void addFault(String name) {
+        faults.add(name);
+    }
+
+    public String getReturnType() {
+        return returnType;
+    }
+
+    public void setReturnType(String returnType) {
+        this.returnType = returnType;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.SEIOperation#getParameterTypes()
+     */
+    public String getParameterType(String name) {
+        return (String) parameters.get(name);
+    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/WebDDContextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/WebDDContextImpl.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/WebDDContextImpl.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/impl/WebDDContextImpl.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,47 @@
+/*
+ * 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.context.impl;
+
+import org.apache.geronimo.ews.ws4j2ee.context.j2eeDD.WebContext;
+
+/**
+ * @author hemapani@opensource.lk
+ */
+public class WebDDContextImpl implements WebContext {
+    private String servletClass;
+    private String servletName;
+
+    public WebDDContextImpl(String servletClass, String servletName) {
+        this.servletClass = servletClass;
+        this.servletName = servletName;
+    }
+
+    /**
+     * @return
+     */
+    public String getServletClass() {
+        return servletClass;
+    }
+
+    /**
+     * @return
+     */
+    public String getServletName() {
+        return servletName;
+    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/j2eeDD/EJBContext.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/j2eeDD/EJBContext.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/j2eeDD/EJBContext.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/j2eeDD/EJBContext.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.context.j2eeDD;
+
+/**
+ * @author hemapani@opensource.lk
+ */
+public interface EJBContext {
+    public String getEjbLocalHomeInterfce();
+
+    public String getEjbLocalInterface();
+
+    public String getEjbName();
+
+    public String getEjbRemoteInterface();
+
+    public String getImplBean();
+
+    public String getEjbhomeInterface();
+
+    public void setEjbhomeInterface(String string);
+
+    public void setEjbLocalHomeInterfce(String string);
+
+    public void setEjbLocalInterface(String string);
+
+    public void setEjbName(String string);
+
+    public void setEjbRemoteInterface(String string);
+
+    public void setImplBean(String string);
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/j2eeDD/WebContext.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/j2eeDD/WebContext.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/j2eeDD/WebContext.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/j2eeDD/WebContext.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.context.j2eeDD;
+
+/**
+ * @author hemapani@opensource.lk
+ */
+public interface WebContext {
+    public String getServletClass();
+
+    public String getServletName();
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/security/SecurityContext4J2EE.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/security/SecurityContext4J2EE.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/security/SecurityContext4J2EE.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/security/SecurityContext4J2EE.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,112 @@
+/*
+ * 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.context.security;
+
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.cert.X509Certificate;
+
+/**
+ * @author Rajith Priyanga (rpriyanga@yahoo.com)
+ * @date Apr 5, 2004
+ * Note: When implementing this should have a reference to the MessageContext
+ */
+public interface SecurityContext4J2EE {
+    /**
+     * If the integrity of the important elements in the SOAP message is
+     * verified, this will return true. Otherwise false. This is a deployer
+     * dependent test.
+     * If the SOAP request pass this test at the check point this will return true.
+     */
+    public boolean sufficientIntegrity();
+
+    /**
+     * If the privacy of the important elements in the SOAP message is
+     * kept, this will return true. Otherwise false. This is a deployer
+     * dependent test.
+     * If the SOAP request pass this test at the check point this will return true.
+     */
+    public boolean sufficientPrivacy();
+
+    /**
+     * Returns the nonce if speciied at the username token.
+     *
+     * @return nonce. null if it is not mentioned.
+     */
+    public String getNonce();
+
+    /**
+     * Returns the created time if speciied in the username token.
+     *
+     * @return created time. null if it is not mentioned.
+     */
+    public String getCreated();
+
+    /**
+     * Returns true if the password is hashed.
+     *
+     * @return is Password Digested?
+     */
+    public boolean isPasswordDigested();
+
+    /**
+     * Returns the digest value of the password as it appears in the
+     * SOAP message's username token.
+     *
+     * @return password digest.
+     */
+    public char[] getPasswordDigest();
+
+    /**
+     * Returns the password. This is retrieved from the password store
+     * by comparing the username.
+     *
+     * @return actual password of the user.
+     */
+    public char[] getPasswordText();
+
+    /**
+     * Returns the username as appears in the SOAP header.
+     *
+     * @return username.
+     */
+    public String getUsername();
+
+    /**
+     * Returns the X509 certificate. If it is not available in the
+     * SOAP message	returns null.
+     *
+     * @return the X509 Certificate.
+     */
+    public X509Certificate getX509Certificate();
+
+    /**
+     * Returns the Kerberose ticket. If it is not available in the
+     * SOAP message	returns null.
+     *
+     * @return the X509 Certificate.
+     */
+    public byte[] getKerberoseTicket();
+
+    /**
+     * Returns a PasswordCallbackHandler which can be used in
+     * authentication done using JAAS module at the wrapper web service.
+     *
+     * @return CallbackHandler.
+     */
+    public CallbackHandler getPWDCallbackHandler4J2EE();
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/security/impl/SecurityContext4J2EEImpl.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/security/impl/SecurityContext4J2EEImpl.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/security/impl/SecurityContext4J2EEImpl.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/security/impl/SecurityContext4J2EEImpl.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,216 @@
+/*
+ * 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.context.security.impl;
+
+import org.apache.geronimo.ews.ws4j2ee.context.security.SecurityContext4J2EE;
+
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.cert.X509Certificate;
+
+/**
+ * @author Rajith Priyanga (rpriyanga@yahoo.com)
+ * @date Apr 6, 2004
+ */
+public class SecurityContext4J2EEImpl implements SecurityContext4J2EE {
+
+    private String nonce = null;
+    private String created = null;
+    private String username = null;
+    private char[] pwd = null;
+
+    private X509Certificate x509Cert = null;
+    private byte[] kerberosTicket = null;
+
+    private boolean privacy = false;
+    private boolean integrity = false;
+    private boolean isPwdDigested = false;
+    private CallbackHandler cbh;
+
+    public SecurityContext4J2EEImpl() {
+    }
+
+    /**
+     * @see org.apache.geranimo.ews.ws4j2ee.context.security.SecurityContext4J2EE#sufficientIntegrity()
+     */
+    public boolean sufficientIntegrity() {
+        // TODO 
+        return false;
+    }
+
+    /**
+     * @see org.apache.geranimo.ews.ws4j2ee.context.security.SecurityContext4J2EE#sufficientPrivacy()
+     */
+    public boolean sufficientPrivacy() {
+        // TODO 
+        return false;
+    }
+
+    /**
+     * @see org.apache.geranimo.ews.ws4j2ee.context.security.SecurityContext4J2EE#getNonce()
+     */
+    public String getNonce() {
+        return this.nonce;
+    }
+
+    /**
+     * @see org.apache.geranimo.ews.ws4j2ee.context.security.SecurityContext4J2EE#getCreated()
+     */
+    public String getCreated() {
+        return this.created;
+    }
+
+    /**
+     * @see org.apache.geranimo.ews.ws4j2ee.context.security.SecurityContext4J2EE#getPasswordDigest()
+     */
+    public char[] getPasswordDigest() {
+        if (this.isPwdDigested)
+            return this.pwd;
+        else
+            return null;
+    }
+
+    /**
+     * @see org.apache.geranimo.ews.ws4j2ee.context.security.SecurityContext4J2EE#getPasswordText()
+     */
+    public char[] getPasswordText() {
+        if (this.isPwdDigested)
+            return null;
+        else
+            return this.pwd;
+    }
+
+    /**
+     * @see org.apache.geranimo.ews.ws4j2ee.context.security.SecurityContext4J2EE#getUsername()
+     */
+    public String getUsername() {
+        return this.username;
+    }
+
+    /**
+     * Sets the created.
+     *
+     * @param created The created to set
+     */
+    public void setCreated(String created) {
+        this.created = created;
+    }
+
+    /**
+     * Sets the integrity.
+     *
+     * @param integrity The integrity to set
+     */
+    public void setIntegritySufficient(boolean sufficient) {
+        this.integrity = sufficient;
+    }
+
+    /**
+     * Sets the nonce.
+     *
+     * @param nonce The nonce to set
+     */
+    public void setNonce(String nonce) {
+        this.nonce = nonce;
+    }
+
+    /**
+     * Sets the privacy.
+     *
+     * @param privacy The privacy to set
+     */
+    public void setPrivacySufficient(boolean sufficient) {
+        this.privacy = sufficient;
+    }
+
+    /**
+     * Sets the username.
+     *
+     * @param username The username to set
+     */
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    /**
+     * @see org.apache.geranimo.ews.ws4j2ee.context.security.SecurityContext4J2EE#getX509Certificate()
+     */
+    public X509Certificate getX509Certificate() {
+        return this.x509Cert;
+    }
+
+    /**
+     * @see org.apache.geranimo.ews.ws4j2ee.context.security.SecurityContext4J2EE#getKerberoseTicket()
+     */
+    public byte[] getKerberoseTicket() {
+        return this.kerberosTicket;
+    }
+
+    /**
+     * Sets the kerberosTicket.
+     *
+     * @param kerberosTicket The kerberosTicket to set
+     */
+    public void setKerberosTicket(byte[] kerberosTicket) {
+        this.kerberosTicket = kerberosTicket;
+    }
+
+    /**
+     * Sets the x509Cert.
+     *
+     * @param x509Cert The x509Cert to set
+     */
+    public void setX509Certificate(X509Certificate x509Cert) {
+        this.x509Cert = x509Cert;
+    }
+
+    /**
+     * Sets the pwdDigest.
+     *
+     * @param pwdDigest The pwdDigest to set
+     */
+    public void setPasswordDigested(boolean isPwdDigested) {
+        this.isPwdDigested = isPwdDigested;
+    }
+
+    /**
+     * @return boolean
+     */
+    public boolean isPasswordDigested() {
+        return isPwdDigested;
+    }
+
+    /**
+     * Sets the pwd.
+     *
+     * @param pwd The pwd to set
+     */
+    public void setPassword(char[] password) {
+        this.pwd = password;
+    }
+
+    /**
+     * @see org.apache.geranimo.ews.ws4j2ee.context.security.SecurityContext4J2EE#getPWDCallbackHandler4J2EE()
+     */
+    public CallbackHandler getPWDCallbackHandler4J2EE() {
+        return this.cbh;
+    }
+
+    public void setPWDCallbackHandler4J2EE(CallbackHandler callbackHandler) {
+        this.cbh = callbackHandler;
+    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/client/impl/ServiceReferenceImpl.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/client/impl/ServiceReferenceImpl.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/client/impl/ServiceReferenceImpl.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/client/impl/ServiceReferenceImpl.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,174 @@
+/*
+ * 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.context.webservices.client.impl;
+
+import org.apache.ws.ews.context.webservices.server.WSCFHandler;
+import org.apache.ws.ews.context.webservices.client.ServiceReferenceContext;
+
+import javax.xml.namespace.QName;
+import java.util.Vector;
+
+/**
+ * @author Srinath Perera(hemapani@opensource.lk)
+ * @see org.apache.ws.ews.context.webservices.client.interfaces.ServiceReferance;
+ */
+public class ServiceReferenceImpl implements ServiceReferenceContext {
+    /**
+     * Service Reference Name. This defines a logical name for the
+     * reference that is used in the client source code. It is recommended,
+     * but not required that the name begin with service/*.
+     */
+    private String servicerefName;
+    /**
+     * Service type: The service-interface element defines the
+     * fully qualified name of the JAXRPC Service Interface class
+     * returned by the JNDI lookup.
+     */
+    private String serviceInterface;
+    /**
+     * WSDL definition (optional). The wsdl-file element specifies a
+     * location of the WSDL description of the service. The location
+     * is relative to the root of the module. The WSDL description may
+     * be a partial WSDL, but must at least include the portType and
+     * binding elements. The WSDL description provided by the developer
+     * is considered a template that must be preserved by the
+     * assembly/deployment process. In other words, the WSDL description contains
+     * a declaration of the application?s dependency on portTypes, bindings, and QNames.
+     * The WSDL document must be fully specified, including the service and port elements,
+     * if the application is dependent on port QNames
+     * (e.g. uses the Service.getPort(QName,Class) method). The developer must
+     * specify the wsdl-file if any of the Service methods declared
+     * in section 4.2.2.4 or 4.2.2.5 are used
+     */
+    private String wsdlFile;
+
+    private String sei;
+    /**
+     * Service Port. If the specified wsdl-file has more than
+     * one service element, the developer must specify the service-qname.
+     */
+    private QName servcieQName;
+    /**
+     * Ports. The developer declares requirements for container
+     * managed port resolution using the portcomponent-ref element.
+     * The port-component-ref elements are resolved to a WSDLport by
+     * the container. See Chapter 4 for a discussion of container
+     * managed port access.
+     */
+    private String portComponetlink;
+    /**
+     * JAX-RPC Mapping. The developer specifies the correlation
+     * of the WSDL definition to the interfaces using the jaxrpc-mapping-file element.
+     * The location is relative to the root of the module. The same mapping file must
+     * be used for all interfaces associated with a wsdl-file. The developer must
+     * specify the jaxrpc-mapping-file if the wsdl-file is specified.
+     */
+    private String jaxrpcmappingFile;
+    /**
+     * Handlers. A developer may optionally specify handlers associated with the
+     * service-ref using the handler element.
+     */
+    private Vector handlers = new Vector();
+
+    /**
+     * @return
+     */
+    public String getJaxrpcMappingFile() {
+        return jaxrpcmappingFile;
+    }
+
+    /**
+     * @return
+     */
+    public QName getServiceQName() {
+        return servcieQName;
+    }
+
+    /**
+     * @return
+     */
+    public String getServiceInterface() {
+        return serviceInterface;
+    }
+
+    /**
+     * @return
+     */
+    public String getServiceRefName() {
+        return servicerefName;
+    }
+
+    /**
+     * @return
+     */
+    public String getWsdlFile() {
+        return wsdlFile;
+    }
+
+    /**
+     * @param string
+     */
+    public void setJaxrpcMappingFile(String string) {
+        jaxrpcmappingFile = string;
+    }
+
+    /**
+     * @param name
+     */
+    public void setServiceQName(QName name) {
+        servcieQName = name;
+    }
+
+    /**
+     * @param string
+     */
+    public void setServiceInterface(String string) {
+        serviceInterface = string;
+    }
+
+    /**
+     * @param string
+     */
+    public void setServiceRefName(String string) {
+        servicerefName = string;
+    }
+
+    /**
+     * @param string
+     */
+    public void setWsdlFile(String string) {
+        wsdlFile = string;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ws.ews.context.webservices.client.interfaces.ServiceReferance#addHandler(org.apache.ws.ews.context.webservices.server.WSCFHandler)
+     */
+    public void addHandler(WSCFHandler handler) {
+        this.handlers.add(handler);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ws.ews.context.webservices.client.interfaces.ServiceReferance#getHandlers()
+     */
+    public WSCFHandler[] getHandlers() {
+        WSCFHandler[] wscfhandlers = new WSCFHandler[handlers.size()];
+        for (int i = 0; i < wscfhandlers.length; i++) {
+            wscfhandlers[i] = (WSCFHandler) handlers.get(i);
+        }
+        return wscfhandlers;
+    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/server/impl/AxisEmitterBasedWSCFContext.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/server/impl/AxisEmitterBasedWSCFContext.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/server/impl/AxisEmitterBasedWSCFContext.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/server/impl/AxisEmitterBasedWSCFContext.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,109 @@
+/*
+ * 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.context.webservices.server.impl;
+
+import org.apache.axis.wsdl.fromJava.Emitter;
+import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationFault;
+import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
+import org.apache.ws.ews.context.webservices.server.WSCFContext;
+import org.apache.ws.ews.context.webservices.server.WSCFWebserviceDescription;
+import org.apache.ws.ews.context.webservices.server.impl.AbstractWSCFContext;
+import org.apache.ws.ews.mapper.MapperFault;
+
+/**
+ * @author Srinath Perera(hemapani@opensource.lk)
+ * @see org.apache.geronimo.ews.ws4j2ee.context.webservices.server.WSCFContext
+ */
+public class AxisEmitterBasedWSCFContext extends AbstractWSCFContext implements WSCFContext {
+    private Emitter emitter;
+    private J2EEWebServiceContext j2eeweserviceContext;
+
+    public AxisEmitterBasedWSCFContext(Emitter emitter, J2EEWebServiceContext j2eeweserviceContext) {
+        this.emitter = emitter;
+        this.j2eeweserviceContext = j2eeweserviceContext;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.webservices.server.WSCFContext#getDescription()
+     */
+    public String getDescription() {
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.webservices.server.WSCFContext#getDisplayName()
+     */
+    public String getDisplayName() {
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.webservices.server.WSCFContext#getLargeIcon()
+     */
+    public String getLargeIcon() {
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.webservices.server.WSCFContext#getSmallIcon()
+     */
+    public String getSmallIcon() {
+        throw new UnsupportedOperationException();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.geronimo.ews.ws4j2ee.context.webservices.server.WSCFContext#getWebServicesDescription()
+     */
+    public WSCFWebserviceDescription[] getWebServicesDescription() {
+        throw new UnsupportedOperationException();
+    }
+
+    public void serialize(java.io.Writer out) throws MapperFault {
+        try {
+            out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+            out.write("<webservices xmlns=\"http://java.sun.com/xml/ns/j2ee\"\n");
+            out.write("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\n");
+            out.write("xmlns:ns1=\"http://www.Monson-Haefel.com/jwsbook/BookQuote\n");
+            out.write("xsi:schemaLocation=\"http://java.sun.com/xml/ns/j2ee\n");
+            out.write("http://www.ibm.com/standards/xml/webservices/j2ee/j2ee_web_services_1_1.xsd\" version=\"1.1\">\n");
+            out.write("<webservice-description>\n");
+            out.write("<webservice-description-name>" + emitter.getServiceElementName() + "</webservice-description-name>\n");
+            out.write("<wsdl-file>" + j2eeweserviceContext.getMiscInfo().getWsdlFile() + "</wsdl-file>\n");
+            out.write("<jaxrpc-mapping-file>" + j2eeweserviceContext.getMiscInfo().getJaxrpcfile() + "</jaxrpc-mapping-file>\n");
+            out.write("<port-component>\n");
+            out.write("<port-component-name>" + emitter.getPortTypeName() + "</port-component-name>\n");
+            out.write("<wsdl-port xmlns:ns1=\"" + j2eeweserviceContext.getWSDLContext().getTargetNSURI() + "\">\n");
+            out.write("ns1:" + j2eeweserviceContext.getWSDLContext().getTargetPort().getName());
+            out.write("</wsdl-port>\n");
+            out.write("<service-endpoint-interface>" + emitter.getCls().getName() + "</service-endpoint-interface>\n");
+            out.write("<service-impl-bean>\n");
+
+            //TODO let usprint the port type name for now here
+            //we got to print the ejb name here parsing the ejb-jar.xml
+            String ejbName = j2eeweserviceContext.getMiscInfo().getJ2eeComponetLink();
+            if (ejbName == null)
+                ejbName = emitter.getPortTypeName();
+            out.write("<ejb-link >" + ejbName + "</ejb-link>\n");
+            out.write("</service-impl-bean>\n");
+            out.write("</port-component>\n");
+            out.write("</webservice-description>\n");
+            out.write("</webservices>\n");
+        } catch (Exception e) {
+        }
+    }
+
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/server/impl/xmlbeans/WSCFContextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/server/impl/xmlbeans/WSCFContextImpl.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/server/impl/xmlbeans/WSCFContextImpl.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/server/impl/xmlbeans/WSCFContextImpl.java Mon Aug  8 05:40:25 2005
@@ -0,0 +1,43 @@
+/*
+ * 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.context.webservices.server.impl.xmlbeans;
+
+import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
+import org.apache.ws.ews.context.webservices.server.impl.AbstractWSCFContext;
+import org.apache.ws.ews.context.webservices.server.impl.WSCFException;
+import org.apache.ws.ews.context.webservices.server.WSCFContext;
+import org.apache.ws.ews.context.webservices.server.WSCFDocument;
+
+import java.io.InputStream;
+
+/**
+ * This is the concrete implementation of the WSCFContext where the whole context of the
+ * webservices.xml file will be published. The appropreate factory class will instanciate the class
+ * and in the factory a inputstream to the webservices.xml will be requires. This is not the
+ * starting point of the element tree, instead this s only giving an inteface
+ * to the element tree which is rooted at WSCFDocument.
+ */
+public class WSCFContextImpl extends AbstractWSCFContext implements WSCFContext {
+    /**
+     * The constructor that will create the element tree starting from the root element as WSCFDocument.
+     *
+     * @param document The document object to the webservices.xml
+     * @throws WSCFException
+     */
+    public WSCFContextImpl(InputStream in, J2EEWebServiceContext context) throws WSCFException {
+        this.document = (WSCFDocument) new WSCFDocumentImpl(in);
+    }
+}

Added: webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/server/impl/xmlbeans/WSCFDocumentImpl.java
URL: http://svn.apache.org/viewcvs/webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/server/impl/xmlbeans/WSCFDocumentImpl.java?rev=230793&view=auto
==============================================================================
--- webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/server/impl/xmlbeans/WSCFDocumentImpl.java (added)
+++ webservices/ews/trunk/ws4j2ee/src/java/org/apache/geronimo/ews/ws4j2ee/context/webservices/server/impl/xmlbeans/WSCFDocumentImpl.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.context.webservices.server.impl.xmlbeans;
+
+import com.sun.java.xml.ns.j2Ee.WebservicesDocument;
+import com.sun.java.xml.ns.j2Ee.WebservicesType;
+import org.apache.ws.ews.context.webservices.server.impl.AsbtractWSCFDocument;
+import org.apache.ws.ews.context.webservices.server.impl.WSCFException;
+import org.apache.ws.ews.context.webservices.server.WSCFConstants;
+import org.apache.ws.ews.context.webservices.server.WSCFDocument;
+import org.apache.xmlbeans.XmlException;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * This will encapsulate the webservices.xml document and this is the start of the
+ * parsing tree.This will be used to support the the methods of the WSCFContext. The
+ * class tree and the Interface tree will strat from here and there will be sufficient
+ * functionality provided by each class to expose the information and to further
+ * drill down the element tree.
+ */
+public class WSCFDocumentImpl extends AsbtractWSCFDocument implements WSCFConstants, WSCFDocument {
+    public WSCFDocumentImpl(InputStream in) throws WSCFException {
+        try {
+            WebservicesDocument wsDoc = WebservicesDocument.Factory.parse(in);
+            WebservicesType ws = wsDoc.getWebservices();
+            this.webservices = new WSCFWebservicesImpl(ws);
+        } catch (IOException je) {
+            throw new WSCFException(je);
+        } catch (XmlException je) {
+            throw new WSCFException(je);
+        }
+    }
+}



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