geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r508812 - in /geronimo/server/trunk/modules: geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/ geronimo-axis2/src/main/java/org/apache/geronimo/axis2/
Date Sat, 17 Feb 2007 21:32:36 GMT
Author: dims
Date: Sat Feb 17 13:32:35 2007
New Revision: 508812

URL: http://svn.apache.org/viewvc?view=rev&rev=508812
Log:
Fix for GERONIMO-2842 - Geronimo Axis2 - JAXWS Web Services are not working for WSDL provided
situation
Fix for GERONIMO-2845 - Axis2 JAXWS handle document style WSDLs


Modified:
    geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
    geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
    geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java
    geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
    geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/PortInfo.java

Modified: geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java?view=diff&rev=508812&r1=508811&r2=508812
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
Sat Feb 17 13:32:35 2007
@@ -28,6 +28,7 @@
 import org.apache.geronimo.axis2.client.Axis2ServiceReference;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -46,6 +47,8 @@
 import org.apache.geronimo.xbeans.javaee.ServiceRefHandlerChainsType;
 
 import javax.wsdl.Definition;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
@@ -104,6 +107,7 @@
             if (!(obj instanceof WebservicesType)) {
                 return map;
             }
+            
             WebservicesType wst = (WebservicesType) obj;
 
             for (WebserviceDescriptionType desc : wst.getWebserviceDescription()) {
@@ -116,7 +120,27 @@
 
                 for (PortComponentType port : desc.getPortComponent()) {
 
-                    PortInfo portInfo = new PortInfo();
+                    org.apache.geronimo.axis2.PortInfo portInfo = new org.apache.geronimo.axis2.PortInfo();
+                    
+                    if(wsdlFile != null && !wsdlFile.equals("")){
+                    	URL wsdlURL = DeploymentUtil.createJarURL(moduleFile, wsdlFile);
+                    	InputStream wsdlStream = wsdlURL.openStream();
+        				if(wsdlStream == null){
+        					throw new DeploymentException("unable to read descriptor "+wsdlURL);
+        				}else {
+        					try {
+        						WSDLFactory factory = WSDLFactory.newInstance();
+        						WSDLReader reader = factory.newWSDLReader();
+        						reader.setFeature("javax.wsdl.importDocuments", true);
+        						reader.setFeature("javax.wsdl.verbose", false);
+        						wsdlDefinition = reader.readWSDL(wsdlURL.toString());
+        						portInfo.setWsdlDefinition(wsdlDefinition);
+        						wsdlStream.close();
+        					} catch (RuntimeException e) {
+        						throw new DeploymentException("invalid WSDL provided "+wsdlURL);
+        					}
+        				}
+                    }
 
                     String serviceLink = null;
                     ServiceImplBeanType beanType = port.getServiceImplBean();
@@ -159,6 +183,7 @@
                     if (map == null) {
                         map = new HashMap<String, PortInfo>();
                     }
+
                     map.put(serviceLink, portInfo);
                 }
             }
@@ -191,18 +216,7 @@
 		boolean status = super.configurePOJO(targetGBean, servletName, module, seiClassName, context);
         if(!status) {
             return false;
-        }
-
-        if(wsdlDefinition != null){
-			//add the WSDL
-			try {
-				AbstractName containerFactoryName = context.getNaming().createChildName(targetGBean.getAbstractName(),
getContainerFactoryGBeanInfo().getName(), NameFactory.GERONIMO_SERVICE);
-				GBeanData factory = context.getGBeanInstance(containerFactoryName); 
-				factory.setAttribute("wsdlDefinition", wsdlDefinition);
-			} catch (GBeanNotFoundException e) {
-				throw new DeploymentException("Unexpected condition"+e, e);
-			}
-		}
+        }       
 		
 		//change the URL
 		Map sharedContext = ((WebModule) module).getSharedContext();
@@ -212,7 +226,6 @@
         if(portInfoMap != null && portInfoMap.get(servletName) != null){
         	org.apache.geronimo.jaxws.PortInfo portInfo = (org.apache.geronimo.jaxws.PortInfo)
portInfoMap.get(servletName);
     		processURLPattern(contextRoot, portInfo);
-
         }
         
 		return status;

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java?view=diff&rev=508812&r1=508811&r2=508812
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
Sat Feb 17 13:32:35 2007
@@ -17,8 +17,27 @@
 
 package org.apache.geronimo.axis2;
 
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMNamespace;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URI;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+
+import javax.naming.Context;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.wsdl.Definition;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLWriter;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.Handler;
+
 import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
@@ -29,30 +48,13 @@
 import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.context.ServiceGroupContext;
-import org.apache.axis2.description.AxisMessage;
-import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.description.Parameter;
 import org.apache.axis2.description.TransportInDescription;
 import org.apache.axis2.description.TransportOutDescription;
-import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
-import org.apache.axis2.description.WSDL20ToAxisServiceBuilder;
-import org.apache.axis2.description.WSDLToAxisServiceBuilder;
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.axis2.engine.DependencyManager;
 import org.apache.axis2.jaxws.binding.BindingImpl;
-import org.apache.axis2.jaxws.description.DescriptionFactory;
-import org.apache.axis2.jaxws.description.EndpointDescription;
-import org.apache.axis2.jaxws.description.ServiceDescription;
-import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
-import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
-import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
-import org.apache.axis2.jaxws.description.builder.RequestWrapperAnnot;
-import org.apache.axis2.jaxws.description.builder.ResponseWrapperAnnot;
-import org.apache.axis2.jaxws.description.builder.WebMethodAnnot;
-import org.apache.axis2.jaxws.description.builder.WebParamAnnot;
-import org.apache.axis2.jaxws.description.builder.WebServiceAnnot;
 import org.apache.axis2.jaxws.description.builder.WsdlComposite;
 import org.apache.axis2.jaxws.description.builder.WsdlGenerator;
 import org.apache.axis2.jaxws.javaee.HandlerChainsType;
@@ -64,9 +66,6 @@
 import org.apache.axis2.transport.http.HTTPTransportUtils;
 import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.util.MessageContextBuilder;
-import org.apache.axis2.util.XMLUtils;
-import org.apache.axis2.wsdl.WSDLConstants;
-import org.apache.axis2.wsdl.WSDLUtil;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.jaxws.JAXWSAnnotationProcessor;
@@ -76,32 +75,6 @@
 import org.apache.geronimo.webservices.WebServiceContainer;
 import org.apache.ws.commons.schema.XmlSchema;
 
-import javax.naming.Context;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLWriter;
-import javax.xml.namespace.QName;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.handler.Handler;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringBufferInputStream;
-import java.io.StringReader;
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CountDownLatch;
-
 
 public class Axis2WebServiceContainer implements WebServiceContainer {
 
@@ -112,34 +85,31 @@
 
     private transient final ClassLoader classLoader;
     private final String endpointClassName;
-    private final org.apache.geronimo.jaxws.PortInfo portInfo;
+    private final PortInfo portInfo;
     private ConfigurationContext configurationContext;
     private String contextRoot = null;
     private Map servicesMap;
-    private Definition wsdlDefinition;
     private JNDIResolver jndiResolver;
     private JAXWSAnnotationProcessor annotationProcessor;
     private Object endpointInstance;
     private List<Handler> chain;
     private AxisService service;
 
-    public Axis2WebServiceContainer(org.apache.geronimo.jaxws.PortInfo portInfo,
+    public Axis2WebServiceContainer(PortInfo portInfo,
                                     String endpointClassName,
-                                    Definition wsdlDefinition,
                                     ClassLoader classLoader,
                                     Context context,
                                     URL configurationBaseUrl) {
         this.classLoader = classLoader;
         this.endpointClassName = endpointClassName;
         this.portInfo = portInfo;
-        this.wsdlDefinition = wsdlDefinition;
         try {
             configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
             configurationContext.setServicePath(portInfo.getLocation());
-          
-            if(wsdlDefinition != null){ //WSDL Has been provided
+            
+            if(portInfo.getWsdlDefinition() != null){ //WSDL Has been provided
             	AxisServiceGenerator serviceGen = new AxisServiceGenerator();
-            	service = serviceGen.getServiceFromWSDL(portInfo, endpointClassName, wsdlDefinition,
classLoader);
+            	service = serviceGen.getServiceFromWSDL(portInfo, endpointClassName, portInfo.getWsdlDefinition(),
classLoader);
             	        	            	
             }else { //No WSDL, Axis2 will handle it. Is it ?
             	service = AxisService.createService(endpointClassName, configurationContext.getAxisConfiguration(),
JAXWSMessageReceiver.class);
@@ -333,10 +303,10 @@
                 }
             }
             if (uri.getQuery().startsWith("wsdl")) {
-            	if(wsdlDefinition != null){
+            	if(portInfo.getWsdlDefinition() != null){
             		WSDLFactory factory = WSDLFactory.newInstance();
             		WSDLWriter writer = factory.newWSDLWriter();            		
-            		writer.writeWSDL(wsdlDefinition, response.getOutputStream());
+            		writer.writeWSDL(portInfo.getWsdlDefinition(), response.getOutputStream());
             		return;
             	}else {
                     service.printWSDL(response.getOutputStream());

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java?view=diff&rev=508812&r1=508811&r2=508812
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainerFactoryGBean.java
Sat Feb 17 13:32:35 2007
@@ -23,14 +23,12 @@
 import javax.naming.Context;
 import javax.naming.NamingException;
 import javax.transaction.TransactionManager;
-import javax.wsdl.Definition;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.jaxws.PortInfo;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.naming.enc.EnterpriseNamingContext;
 import org.apache.geronimo.transaction.GeronimoUserTransaction;
@@ -41,20 +39,18 @@
 
 	private static final Log log = LogFactory.getLog(Axis2WebServiceContainerFactoryGBean.class);
     private final ClassLoader classLoader;
-    private final PortInfo portInfo;
+    private final org.apache.geronimo.axis2.PortInfo portInfo;
     private final String endpointClassName;
     private URL configurationBaseUrl;
     private Context context;
-    private Definition wsdlDefinition;
 
-    public Axis2WebServiceContainerFactoryGBean(PortInfo portInfo, 
+    public Axis2WebServiceContainerFactoryGBean(org.apache.geronimo.axis2.PortInfo portInfo,

     		String endpointClassName, 
     		ClassLoader classLoader, 
     		Map componentContext,
             Kernel kernel,
             TransactionManager transactionManager,
-            URL configurationBaseUrl, 
-            Definition wsdlDefinition) throws InstantiationException, IllegalAccessException,
ClassNotFoundException {
+            URL configurationBaseUrl) throws InstantiationException, IllegalAccessException,
ClassNotFoundException {
     	
     	if (componentContext != null) {
             GeronimoUserTransaction userTransaction = new GeronimoUserTransaction(transactionManager);
@@ -71,29 +67,27 @@
         this.portInfo = portInfo;
         this.classLoader = classLoader;
         this.endpointClassName = endpointClassName;
-        this.wsdlDefinition = wsdlDefinition;
         this.configurationBaseUrl = configurationBaseUrl;
     }
 
     public WebServiceContainer getWebServiceContainer() {
-        return new Axis2WebServiceContainer(portInfo, endpointClassName, wsdlDefinition,
classLoader, context, configurationBaseUrl);
+        return new Axis2WebServiceContainer(portInfo, endpointClassName, classLoader, context,
configurationBaseUrl);
     }
 
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(Axis2WebServiceContainerFactoryGBean.class,
NameFactory.GERONIMO_SERVICE);
-        infoBuilder.addAttribute("portInfo", PortInfo.class, true, true);
+        infoBuilder.addAttribute("portInfo", org.apache.geronimo.axis2.PortInfo.class, true,
true);
         infoBuilder.addAttribute("endpointClassName", String.class, true, true);
         infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
         infoBuilder.addAttribute("componentContext", Map.class, true, true);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addReference("TransactionManager", TransactionManager.class, NameFactory.TRANSACTION_MANAGER);
         infoBuilder.addAttribute("configurationBaseUrl", URL.class, true);
-        infoBuilder.addAttribute("wsdlDefinition", Definition.class, true);
 
         infoBuilder.setConstructor(new String[]{"portInfo", "endpointClassName", "classLoader",
-                "componentContext", "kernel", "TransactionManager", "configurationBaseUrl",
"wsdlDefinition"});
+                "componentContext", "kernel", "TransactionManager", "configurationBaseUrl"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java?view=diff&rev=508812&r1=508811&r2=508812
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
Sat Feb 17 13:32:35 2007
@@ -16,8 +16,8 @@
  */
 package org.apache.geronimo.axis2;
 
+import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.StringBufferInputStream;
 import java.io.StringReader;
 import java.lang.reflect.Method;
 import java.net.URI;
@@ -64,24 +64,31 @@
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaObject;
+import org.apache.ws.commons.schema.XmlSchemaParticle;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
 import org.apache.ws.commons.schema.XmlSchemaType;
 
+//TODO: RPC style with more Genericway, 
+//TODO: Consider there is a problem for Doc Lit & Bare
+//TODO: Handle Fault Messages
+//TODO: Investigate more on JAXB Wrapper class gen default behaviour 
+
 public class AxisServiceGenerator {
 	
+	private static String WSDL_ENCODING = "UTF-8";
+	
 	public AxisServiceGenerator(){
 		super();
 	}
 	
 	public AxisService getServiceFromWSDL(org.apache.geronimo.jaxws.PortInfo portInfo, String
endpointClassName, Definition wsdlDefinition, ClassLoader classLoader) throws Exception {
 		WSDLToAxisServiceBuilder wsdlBuilder = null;
-   		
         WSDLFactory factory = WSDLFactory.newInstance();
         WSDLWriter writer = factory.newWSDLWriter();
         
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         writer.writeWSDL(wsdlDefinition, out);
-        String wsdlContent = out.toString("UTF-8"); //TODO WSDL Doc must be either UTF-8
or UTF-16
+        String wsdlContent = out.toString(WSDL_ENCODING); //Will the Axis2 give us this information
soon ?
         
    		OMNamespace documentElementNS = ((OMElement)XMLUtils.toOM(new StringReader(wsdlContent))).getNamespace();
    		
@@ -95,14 +102,14 @@
 
    		//Decide WSDL Version : 
     	if(WSDLConstants.WSDL20_2006Constants.DEFAULT_NAMESPACE_URI.equals(documentElementNS.getNamespaceURI())){
-    		wsdlBuilder = new WSDL20ToAxisServiceBuilder(new StringBufferInputStream(wsdlContent),
serviceQName, null);
+    		wsdlBuilder = new WSDL20ToAxisServiceBuilder(new ByteArrayInputStream(wsdlContent.getBytes()),
serviceQName, null);
     	}
     	else if(Constants.NS_URI_WSDL11.equals(documentElementNS.getNamespaceURI())){
     		wsdlBuilder = new WSDL11ToAxisServiceBuilder(wsdlDefinition, serviceQName , portName);
     	}
     	//populate with axis2 objects
     	AxisService service = wsdlBuilder.populateService();
-    	service.addParameter(new Parameter("ServiceClass", endpointClassName));
+    	service.addParameter(new Parameter(Constants.SERVICE_CLASS, endpointClassName));
         service.setWsdlFound(true);
         service.setClassLoader(classLoader);
     	
@@ -129,7 +136,6 @@
    	 			String axisOpName = operation.getName().getLocalPart();
    	 			if(method.getName().equals(axisOpName)){
    	 				fillOperationInformation(method, operation, dbc);
-   	 				break;
    	 			}
    	 		}
    	 	}
@@ -148,96 +154,131 @@
 	}
 	
 	private void fillOperationInformation(Method method, AxisOperation operation, DescriptionBuilderComposite
dbc) throws Exception{
-			
 			MethodDescriptionComposite mdc = new MethodDescriptionComposite();
 			WebMethodAnnot webMethodAnnot = WebMethodAnnot.createWebMethodAnnotImpl();
 			webMethodAnnot.setOperationName(method.getName());
 			
-			//TODO: Might need implement more here
-//			if(operation.getStyle().equals(AxisOperation.STYLE_DOC)){
-//				
-//			}else if(operation.getStyle().equals(AxisOperation.STYLE_RPC)){
-//				
-//			}
-			
-			
-			mdc.setWebMethodAnnot(webMethodAnnot);
-			mdc.setMethodName(method.getName());
+			if(operation.getStyle().equals(AxisOperation.STYLE_DOC)){
+				fillDocOperationInfo(method, operation, dbc, mdc, webMethodAnnot);
+			}else if(operation.getStyle().equals(AxisOperation.STYLE_RPC)){
+				throw new RuntimeException("Not Yet Implemented");
+			}
+	}
+	
+	private void fillDocOperationInfo(Method method, AxisOperation operation, DescriptionBuilderComposite
dbc, MethodDescriptionComposite mdc, WebMethodAnnot webMethodAnnot ) throws Exception{
+		mdc.setWebMethodAnnot(webMethodAnnot);
+		mdc.setMethodName(method.getName());
 
-	 		String MEP = operation.getMessageExchangePattern();
-	 		
-	 		if (WSDLUtil.isInputPresentForMEP(MEP)) {
-	 			AxisMessage inAxisMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-	 			if(inAxisMessage != null){
-	 				
-	 				XmlSchemaType schemaType = inAxisMessage.getSchemaElement().getSchemaType();
+ 		String MEP = operation.getMessageExchangePattern();
+ 		
+ 		if (WSDLUtil.isInputPresentForMEP(MEP)) {
+ 			AxisMessage inAxisMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+ 			if(inAxisMessage != null){
+ 				
+ 				XmlSchemaElement element = inAxisMessage.getSchemaElement();
+ 				XmlSchemaType schemaType = element.getSchemaType();
+ 				
+ 				if(schemaType instanceof XmlSchemaComplexType){
+
+ 					XmlSchemaComplexType complexSchemaType = (XmlSchemaComplexType)element.getSchemaType();
+ 					XmlSchemaParticle particle = complexSchemaType.getParticle();
+ 					
+// 					TODO: What if we have more than one complex type in a sequence ???
+ 					if (particle instanceof XmlSchemaSequence) {
+ 						XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) particle;
+ 						Iterator iterator = xmlSchemaSequence.getItems().getIterator();
+ 						
+ 						while (iterator.hasNext()) {
+ 							XmlSchemaElement innerElement = (XmlSchemaElement) iterator.next();
+ 							XmlSchemaType innerElementSchemaType = innerElement.getSchemaType();
+ 							
+ 							if(!(innerElementSchemaType instanceof XmlSchemaComplexType)){
+ 								element = innerElement;
+ 								break;
+ 							}else { 
+ 								XmlSchemaComplexType innerComplexSchemaType = (XmlSchemaComplexType)innerElementSchemaType;
+ 			 					XmlSchemaParticle innerParticle = innerComplexSchemaType.getParticle();
+ 			 					XmlSchemaSequence innerXmlSchemaSequence = (XmlSchemaSequence) innerParticle;
+ 		 						iterator = innerXmlSchemaSequence.getItems().getIterator();
+ 							}
+ 						}
+ 					}
+ 				}
+ 				
+ 				ParameterDescriptionComposite pdc = new ParameterDescriptionComposite();
+				WebParamAnnot webParamAnnot = WebParamAnnot.createWebParamAnnotImpl();
+			
+				webParamAnnot.setName(element.getName());
+				pdc.setWebParamAnnot(webParamAnnot);
+					
+				Class[] paramTypes = method.getParameterTypes();
+					
+				for(Class paramType : paramTypes){
+						String strParamType = paramType.toString();
+						pdc.setParameterType(strParamType.split(" ")[1]);
+				}
+					
+				mdc.addParameterDescriptionComposite(pdc);
+ 			}
+ 		}
+ 		
+ 		if (WSDLUtil.isOutputPresentForMEP(MEP)) {
+ 			AxisMessage outAxisMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
+ 			
+ 			if(outAxisMessage != null){
+ 				
+ 				if(!method.getReturnType().toString().equals("void")){
+ 					mdc.setReturnType(method.getReturnType().toString().split(" ")[1]);
+ 					
+ 					XmlSchemaElement element = outAxisMessage.getSchemaElement();
+	 				XmlSchemaType schemaType = element.getSchemaType();
 	 				
 	 				if(schemaType instanceof XmlSchemaComplexType){
-	 					XmlSchemaComplexType complexSchemaType = (XmlSchemaComplexType)schemaType;
+
+	 					XmlSchemaComplexType complexSchemaType = (XmlSchemaComplexType)element.getSchemaType();
+	 					XmlSchemaParticle particle = complexSchemaType.getParticle();
 	 					
-	 					if(complexSchemaType.getParticle() instanceof XmlSchemaSequence){
-	 						XmlSchemaSequence sequence = (XmlSchemaSequence)complexSchemaType.getParticle();
-	 						for(Iterator iterator = sequence.getItems().getIterator(); iterator.hasNext();){
-	 							XmlSchemaObject xmlObject = (XmlSchemaObject)iterator.next();
+//	 					TODO: What if we have more than one complex type in a sequence ???
+	 					if (particle instanceof XmlSchemaSequence) {
+	 						XmlSchemaSequence xmlSchemaSequence = (XmlSchemaSequence) particle;
+	 						Iterator iterator = xmlSchemaSequence.getItems().getIterator();
+	 						
+	 						while (iterator.hasNext()) {
+	 							XmlSchemaElement innerElement = (XmlSchemaElement) iterator.next();
+	 							XmlSchemaType innerElementSchemaType = innerElement.getSchemaType();
 	 							
-	 							if(xmlObject instanceof XmlSchemaElement){
-	 								XmlSchemaElement xmlElement = (XmlSchemaElement)xmlObject;
-	 								
-	 								ParameterDescriptionComposite pdc = new ParameterDescriptionComposite();
-	 								WebParamAnnot webParamAnnot = WebParamAnnot.createWebParamAnnotImpl();
-           	 				
-	 								webParamAnnot.setName(xmlElement.getName());
-	 								pdc.setWebParamAnnot(webParamAnnot);
-	 								
-	 								Class[] paramTypes = method.getParameterTypes();
-	 								
-	 								for(Class paramType : paramTypes){
-	 									String strParamType = paramType.toString();
-	 									pdc.setParameterType(strParamType.split(" ")[1]);
-	 								}
-	 								
-	 								mdc.addParameterDescriptionComposite(pdc);
+	 							if(!(innerElementSchemaType instanceof XmlSchemaComplexType)){
+	 								element = innerElement;
+	 								break;
+	 							}else { 
+	 								XmlSchemaComplexType innerComplexSchemaType = (XmlSchemaComplexType)innerElementSchemaType;
+	 			 					XmlSchemaParticle innerParticle = innerComplexSchemaType.getParticle();
+	 			 					XmlSchemaSequence innerXmlSchemaSequence = (XmlSchemaSequence) innerParticle;
+	 		 						iterator = innerXmlSchemaSequence.getItems().getIterator();
 	 							}
-	 							
 	 						}
 	 					}
 	 				}
-	 			}
-	 		}
-	 		
-	 		if (WSDLUtil.isOutputPresentForMEP(MEP)) {
-	 			AxisMessage outAxisMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
-	 			
-	 			if(outAxisMessage != null){
-
-	 				XmlSchemaType schemaType = outAxisMessage.getSchemaElement().getSchemaType();
-	 				mdc.setReturnType(method.getReturnType().toString().split(" ")[1]);
 	 				
-	   	 			if(schemaType instanceof XmlSchemaComplexType){
-		 					XmlSchemaComplexType complexSchemaType = (XmlSchemaComplexType)schemaType;
-		 					
-		 					if(complexSchemaType.getParticle() instanceof XmlSchemaSequence){
-		 						XmlSchemaSequence sequence = (XmlSchemaSequence)complexSchemaType.getParticle();
-		 						for(Iterator iterator = sequence.getItems().getIterator(); iterator.hasNext();){
-		 							XmlSchemaObject xmlObject = (XmlSchemaObject)iterator.next();
-		 							
-		 							if(xmlObject instanceof XmlSchemaElement){
-		 								XmlSchemaElement xmlElement = (XmlSchemaElement)xmlObject;
-		 								WebResultAnnot webResult = WebResultAnnot.createWebResultAnnotImpl();
-		 								webResult.setName(xmlElement.getName());
-		 								mdc.setWebResultAnnot(webResult);
-		 							}
-		 						}
-		 					}
-		 				}
-		 				
-		 				ResponseWrapperAnnot responseWrap = ResponseWrapperAnnot.createResponseWrapperAnnotImpl();
-		 				responseWrap.setClassName(getWrapperClassName(outAxisMessage.getElementQName()));
-		 				mdc.setResponseWrapperAnnot(responseWrap);
-		 			}
-	 		}
-	 		mdc.setWebMethodAnnot(webMethodAnnot);
-	 		dbc.addMethodDescriptionComposite(mdc);
+	 				WebResultAnnot webResult = WebResultAnnot.createWebResultAnnotImpl();
+					webResult.setName(element.getName());
+					mdc.setWebResultAnnot(webResult);
+
+					ResponseWrapperAnnot responseWrap = ResponseWrapperAnnot.createResponseWrapperAnnotImpl();
+		 			responseWrap.setClassName(getWrapperClassName(outAxisMessage.getElementQName()));
+		 			mdc.setResponseWrapperAnnot(responseWrap);
+ 					}
+ 				
+	 			}
+ 		}
+ 		
+ 		List faultMessages = operation.getFaultMessages(); 
+ 		if(faultMessages != null){//TODO Implement it 
+ 			
+ 		}
+ 		
+ 		mdc.setWebMethodAnnot(webMethodAnnot);
+ 		dbc.addMethodDescriptionComposite(mdc);
 	}
 	
 	//TODO: Has to verify how JAXB default class wrapper class generation logic

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/PortInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/PortInfo.java?view=diff&rev=508812&r1=508811&r2=508812
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/PortInfo.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/PortInfo.java
Sat Feb 17 13:32:35 2007
@@ -17,80 +17,21 @@
 
 package org.apache.geronimo.axis2;
 
-import org.apache.axis2.jaxws.javaee.PortComponentHandlerType;
+import javax.wsdl.Definition;
 
-import java.io.Serializable;
-import java.util.List;
+public class PortInfo extends org.apache.geronimo.jaxws.PortInfo {
+	
+	private Definition wsdlDefinition;
+	
+    public Definition getWsdlDefinition() {
+		return wsdlDefinition;
+	}
+
+	public void setWsdlDefinition(Definition wsdlDefinition) {
+		this.wsdlDefinition = wsdlDefinition;
+	}
 
-
-public class PortInfo implements Serializable {
-
-    private String serviceName;
-    private String portName;
-    private String seiInterfaceName;
-    private String wsdlFile;
-    private String servletLink;
-    private String urlpattern;
-
-    private List<PortComponentHandlerType> handlers;
-
-    public String getPortName() {
-        return portName;
-    }
-
-    public void setPortName(String pn) {
-        portName = pn;
-    }
-
-    public String getServiceEndpointInterfaceName() {
-        return seiInterfaceName;
-    }
-
-    public void setServiceEndpointInterfaceName(String sei) {
-        seiInterfaceName = sei;
-    }
-
-    public String getServletLink() {
-        return servletLink;
-    }
-
-    public void setServletLink(String sl) {
-        servletLink = sl;
-    }
-
-    public String getWsdlFile() {
-        return wsdlFile;
-    }
-
-    public void setWsdlFile(String wf) {
-        wsdlFile = wf;
-    }
-
-    public void setHandlers(List<PortComponentHandlerType> h) {
-        handlers = h;
-    }
-
-    public List<PortComponentHandlerType> getHandlers() {
-        return handlers;
-    }
-
-    public String getServiceName() {
-        return serviceName;
-    }
-
-    public void setServiceName(String sn) {
-        serviceName = sn;
-    }
-    
-    public String getURLPattern() {
-        return urlpattern;
-    }
-    
-    public void setURLPattern(String up) {
-        urlpattern = up;
-    }
-
-    public String toString() {
-        return "[" + serviceName + ":" + portName + ":" + seiInterfaceName + ":" + wsdlFile
+ ":" + urlpattern + "]";
+	public String toString() {
+        return "[" + getServiceName() + ":" + getPortName() + ":" + getServiceEndpointInterfaceName()
+ ":" + getWsdlFile() + ":" + getLocation() + "]";
     }
 }



Mime
View raw message