axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From barre...@apache.org
Subject svn commit: r453977 [2/2] - in /webservices/axis2/trunk/java/modules/jaxws: src/org/apache/axis2/jaxws/client/factory/ src/org/apache/axis2/jaxws/client/proxy/ src/org/apache/axis2/jaxws/description/ src/org/apache/axis2/jaxws/i18n/ src/org/apache/axis...
Date Sat, 07 Oct 2006 18:17:12 GMT
Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java?view=auto&rev=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/MethodMarshallerImpl.java Sat Oct  7 11:17:10 2006
@@ -0,0 +1,588 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * 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.axis2.jaxws.marshaller.impl;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.concurrent.Future;
+
+import javax.jws.WebParam.Mode;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.JAXBIntrospector;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Holder;
+import javax.xml.ws.Response;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.OperationDescription;
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.i18n.Messages;
+import org.apache.axis2.jaxws.marshaller.MethodMarshaller;
+import org.apache.axis2.jaxws.marshaller.MethodParameter;
+import org.apache.axis2.jaxws.message.Block;
+import org.apache.axis2.jaxws.message.Message;
+import org.apache.axis2.jaxws.message.MessageException;
+import org.apache.axis2.jaxws.message.Protocol;
+import org.apache.axis2.jaxws.message.factory.JAXBBlockFactory;
+import org.apache.axis2.jaxws.message.factory.MessageFactory;
+import org.apache.axis2.jaxws.message.factory.XMLStringBlockFactory;
+import org.apache.axis2.jaxws.registry.FactoryRegistry;
+import org.apache.axis2.jaxws.wrapper.JAXBWrapperTool;
+import org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperException;
+import org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public abstract class MethodMarshallerImpl implements MethodMarshaller {
+
+	private static String DEFAULT_ARG="arg";
+	private static QName SOAPENV_QNAME = new QName("http://schemas.xmlsoap.org/soap/envelope/", "Envelope");
+	private static Log log = LogFactory.getLog(MethodMarshallerImpl.class);
+	protected ServiceDescription serviceDesc = null;
+	protected EndpointDescription endpointDesc = null;
+	protected OperationDescription operationDesc = null;
+	protected Protocol protocol = Protocol.soap11;
+	
+	public MethodMarshallerImpl(ServiceDescription serviceDesc, EndpointDescription endpointDesc, OperationDescription operationDesc, Protocol protocol){
+		this.serviceDesc = serviceDesc;
+		this.endpointDesc = endpointDesc;
+		this.operationDesc = operationDesc;
+		this.protocol = protocol;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.jaxws.helper.XMLMessageConvertor#toJAXBObject(org.apache.axis2.jaxws.message.Message)
+	 */
+	public abstract Object demarshalResponse(Message message, Object[] inputArgs) throws IllegalAccessException, InstantiationException, ClassNotFoundException, JAXBWrapperException, JAXBException, XMLStreamException, MessageException; 
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.jaxws.helper.XMLMessageConvertor#toObjects(org.apache.axis2.jaxws.message.Message)
+	 */
+	public abstract Object[] demarshalRequest(Message message) throws ClassNotFoundException, JAXBException, MessageException, JAXBWrapperException, XMLStreamException, InstantiationException, IllegalAccessException;
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.jaxws.helper.XMLMessageConvertor#fromJAXBObject(java.lang.Object)
+	 */
+	public abstract Message marshalResponse(Object returnObject, Object[] holderObjects)throws ClassNotFoundException, JAXBException, MessageException, JAXBWrapperException, XMLStreamException, InstantiationException, IllegalAccessException; 
+	
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.jaxws.helper.XMLMessageConvertor#fromObjects(java.lang.Object[])
+	 */
+	public abstract Message marshalRequest(Object[] object)throws IllegalAccessException, InstantiationException, ClassNotFoundException, JAXBWrapperException, JAXBException, MessageException, XMLStreamException; 
+	
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.jaxws.marshaller.MethodMarshaller#demarshalFaultResponse(org.apache.axis2.jaxws.message.Message)
+	 */
+	public abstract Object demarshalFaultResponse(Message message); 
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.jaxws.marshaller.MethodMarshaller#isFault(org.apache.axis2.jaxws.message.Message)
+	 */
+	public abstract boolean isFault(Message message); 
+		
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.jaxws.marshaller.MethodMarshaller#marshalFaultResponse(java.lang.Throwable)
+	 */
+	public abstract Message marshalFaultResponse(Throwable throwable); 
+		
+	/*
+	 * Creates method output parameter/return parameter. reads webResult annotation and then matches them with the response/result value of Invoked method
+	 * and creates a name value pair.
+	 * Also hadnles situation where ResponseWrapper is a holder.
+	 */
+	
+	protected ArrayList<MethodParameter> toOutputMethodParameter(Object webResultValue){
+		ArrayList<MethodParameter> mps = new ArrayList<MethodParameter>();
+		String webResult = operationDesc.getWebResultName();
+		MethodParameter mp = new MethodParameter(webResult, webResultValue, null);
+		mps.add(mp);
+		return mps;
+	}
+	
+	protected ArrayList<MethodParameter> toOutputMethodParameter(Object webResultObject, Object[] holderObjects)throws IllegalAccessException, InstantiationException, ClassNotFoundException{
+		//Get all names of input parameters
+		ArrayList<String> paramNames = new ArrayList<String>();
+		paramNames =toArrayList(operationDesc.getWebParamNames());
+		
+		//Get all modes for params
+		ArrayList<Mode> paramMode = new ArrayList<Mode>();
+		paramMode = toArrayList(operationDesc.getWebParamModes());
+		
+		Method seiMethod = operationDesc.getSEIMethod();
+	    Class[] types = seiMethod.getParameterTypes();
+	    ArrayList<Class> paramTypes = toArrayList(types);
+	    ArrayList<Class> actualTypes = getInputTypes();
+	    
+		for(int i =0;i<types.length; i++){
+			if(!(types[i].isAssignableFrom(Holder.class))){
+				paramNames.remove(i);
+				paramMode.remove(i);
+				paramTypes.remove(i);
+			}
+		}
+		
+		ArrayList<Object> paramValues = toArrayList(holderObjects);
+		if(webResultObject!=null){
+			paramValues.add(webResultObject);
+			paramNames.add(operationDesc.getWebResultName());
+			//dummy mode for return object
+			paramMode.add(Mode.IN);
+		}
+		//lets create name value pair.
+		return createMethodParameters(paramNames, paramValues, paramMode, paramTypes, actualTypes);
+		
+	}
+	
+	protected ArrayList<MethodParameter> toInputMethodParameter(Object jaxbObject) throws JAXBWrapperException, IllegalAccessException, InstantiationException, ClassNotFoundException{
+		ArrayList<MethodParameter> mps = new ArrayList<MethodParameter>();
+		if(jaxbObject == null){
+			return mps;
+		}
+        ArrayList<String> webParam = toArrayList(operationDesc.getWebParamNames());
+        ArrayList<Mode> modes = toArrayList(operationDesc.getWebParamModes());
+        
+        if (log.isDebugEnabled()) {
+            log.debug("Attempting to unwrap object from WrapperClazz");
+        }
+        JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
+        Object[] objects = wrapperTool.unWrap(jaxbObject, webParam);
+        if (log.isDebugEnabled()) {
+            log.debug("Object unwrapped");
+        }
+        return toInputMethodParameters(objects);
+	}
+	/*
+	 * Creates method input parameters, reads webparam annotation and then matches them to the input parameters that the the invoked method was supplied 
+	 * and creates a name value pair.
+	 */
+	protected ArrayList<MethodParameter> toInputMethodParameters(Object[] objects)throws IllegalAccessException, InstantiationException, ClassNotFoundException{
+		ArrayList<MethodParameter> mps = new ArrayList<MethodParameter>();
+		//Hand no input parameters
+		if(objects == null){
+			return mps;
+		}
+		if(objects!=null && objects.length==0){
+			return mps;
+		}
+		
+		//Get all names of input parameters
+		ArrayList<String> paramNames = new ArrayList<String>();
+		paramNames =toArrayList(operationDesc.getWebParamNames());
+		//Get all the objects of input parameters
+		ArrayList<Object> paramValues = new ArrayList<Object>(); 
+		paramValues = toArrayList(objects);
+		//Get all modes for params
+		ArrayList<Mode> paramMode = new ArrayList<Mode>();
+		paramMode = toArrayList(operationDesc.getWebParamModes());
+		
+		Method seiMethod = operationDesc.getSEIMethod();
+		
+		Class[] clazz = seiMethod.getParameterTypes();
+		ArrayList<Class> paramTypes = toArrayList(clazz);
+     
+		ArrayList<Class> actualTypes = getInputTypes();
+		int i =0;
+		
+		//if no webParam defined then lets get default names.
+		if(paramNames.size() == 0 && paramValues.size()>0){
+			while(i< paramValues.size()){
+				paramNames.add(DEFAULT_ARG + i++);
+			}
+		}
+		if(paramNames.size() != paramValues.size()){
+			throw ExceptionFactory.makeWebServiceException(Messages.getMessage("InvalidWebParams"));
+		}
+		//lets create name value pair.
+		mps = createMethodParameters(paramNames, paramValues, paramMode, paramTypes, actualTypes);
+		
+		return mps;
+	}
+	
+	protected ArrayList<Class> getInputTypes(){
+		Method seiMethod = operationDesc.getSEIMethod();
+		ArrayList<Class> paramTypes = new ArrayList<Class>();
+		Type[] types = seiMethod.getGenericParameterTypes();
+		for(Type type:types){
+			if(ParameterizedType.class.isAssignableFrom(type.getClass())){
+				ParameterizedType pType = (ParameterizedType) type;
+				Class rawClazz = (Class)pType.getRawType();
+				Class actualClazz = (Class)pType.getActualTypeArguments()[0];
+				paramTypes.add(actualClazz);
+				/*
+				if(rawClazz.isAssignableFrom(Holder.class)){
+					Class actualClazz = (Class)pType.getActualTypeArguments()[0];
+					paramTypes.add(actualClazz);
+				}
+				*/
+			}
+			else{
+				Class formalClazz= (Class)type;
+				paramTypes.add(formalClazz);
+			}
+		}
+		return paramTypes;
+	}
+	
+	protected boolean isAsync(){
+		Method method = operationDesc.getSEIMethod();
+		if(method == null){
+			return false;
+		}
+		String methodName = method.getName();
+		Class returnType = method.getReturnType();
+		return methodName.endsWith("Async") && (returnType.isAssignableFrom(Response.class) || returnType.isAssignableFrom(Future.class));
+	}
+	
+	protected boolean isXmlRootElementDefined(Class jaxbClass){
+		XmlRootElement root = (XmlRootElement) jaxbClass.getAnnotation(XmlRootElement.class);
+		return root !=null;
+	}
+	
+	protected <T> ArrayList<T> toArrayList(T[] objects){
+		return (objects!=null)? new ArrayList<T>(Arrays.asList(objects)):new ArrayList<T>();
+	}
+	
+	protected Block createJAXBBlock(Object jaxbObject, JAXBContext context) throws MessageException{
+		JAXBBlockFactory factory = (JAXBBlockFactory)FactoryRegistry.getFactory(JAXBBlockFactory.class);
+		return factory.createFrom(jaxbObject,context,null);
+		
+	}
+	
+	protected Block createJAXBBlock(String name, Object jaxbObject, JAXBContext context) throws MessageException{
+		
+		JAXBIntrospector introspector = context.createJAXBIntrospector();
+		if(introspector.isElement(jaxbObject)){
+			return createJAXBBlock(jaxbObject, context);
+		}
+		else{
+			//Create JAXBElement then use that to create JAXBBlock.
+			Class clazz = jaxbObject.getClass();
+			JAXBElement<Object> element = new JAXBElement<Object>(new QName(name), clazz, jaxbObject);
+			JAXBBlockFactory factory = (JAXBBlockFactory)FactoryRegistry.getFactory(JAXBBlockFactory.class);
+			return factory.createFrom(element,context ,null);
+		}
+		
+	}
+	protected Block createJAXBBlock(OMElement om, JAXBContext context)throws javax.xml.stream.XMLStreamException{
+		JAXBBlockFactory factory = (JAXBBlockFactory)FactoryRegistry.getFactory(JAXBBlockFactory.class);
+		return factory.createFrom(om,context,null);
+		
+	}
+
+	protected Block createEmptyBodyBlock()throws MessageException{
+		String emptyBody = "";
+		XMLStringBlockFactory stringFactory = (XMLStringBlockFactory) FactoryRegistry.getFactory(XMLStringBlockFactory.class);
+		return stringFactory.createFrom(emptyBody, null, SOAPENV_QNAME);
+	}
+	
+	protected JAXBContext createJAXBContext(String wrapperClazzName) throws ClassNotFoundException, JAXBException {
+		Class wrapperClazz = loadClass(wrapperClazzName);
+		return createJAXBContext(wrapperClazz);
+        
+    }
+	
+	protected JAXBContext createJAXBContext(Class wrapperClazz) throws JAXBException{
+		return JAXBContext.newInstance(new Class[]{wrapperClazz});
+	}
+	
+	protected Class loadClass(String className)throws ClassNotFoundException{
+		return Class.forName(className, true, Thread.currentThread().getContextClassLoader());
+	}
+	/**
+	 * In this method I am trying get the return type of the method.
+	 * if SEI method is Async pooling implmentation then return type is actual type in Generic Response, example Response<ClassName>.
+	 * if SEI method is Async Callback implementation then return type is actual type of method parameter type AsyncHandler, example AsyncHandler<ClassName>
+	 * I use java reflection to get the return type.
+	 * @param isAsync
+	 * @return
+	 */
+	protected Class getReturnType(){
+		Method seiMethod = operationDesc.getSEIMethod();
+		Class returnType = seiMethod.getReturnType();
+		if(isAsync()){
+			//pooling implementation
+			if(Response.class.isAssignableFrom(returnType)){
+				Type type = seiMethod.getGenericReturnType();
+				ParameterizedType pType = (ParameterizedType) type;
+				return (Class)pType.getActualTypeArguments()[0];	
+			}
+			//Callback Implementation
+			else{
+				Type[] type = seiMethod.getGenericParameterTypes();
+				Class parameters[]= seiMethod.getParameterTypes();
+				int i=0;
+				for(Class param:parameters){
+					if(AsyncHandler.class.isAssignableFrom(param)){
+						ParameterizedType pType = (ParameterizedType)type[i];
+						return (Class)pType.getActualTypeArguments()[0];
+					}
+					i++;
+				}
+			}
+			
+		}
+		
+		return returnType;	
+	}
+	
+	protected ArrayList<MethodParameter> createMethodParameters(ArrayList<String> paramNames, ArrayList<Object>paramValues, ArrayList<Mode> paramModes, ArrayList<Class> paramTypes, ArrayList<Class> actualTypes) throws IllegalAccessException, InstantiationException, ClassNotFoundException{
+		ArrayList<MethodParameter> mps = new ArrayList<MethodParameter>();
+		int i=0;
+		for(String paramName:paramNames){
+			Object paramValue = paramValues.get(i);
+			
+			//initialize to default value.
+			Mode paramMode = Mode.IN;
+			if(paramModes !=null && paramModes.size() >0){
+				paramMode =paramModes.get(i);
+			}
+			Class paramType = null;
+			Class actualType = null;
+			if(paramTypes !=null){
+				paramType = paramTypes.get(i);
+			}
+			if(actualTypes!=null){
+				actualType = actualTypes.get(i);
+			}
+			MethodParameter mp = null;
+			//If call is Async call then lets filter AsyncHandler object name and value;
+			if(!isParamAsyncHandler(paramName, paramValue)){
+				
+				if(paramType !=null){
+					//Identify Holders and get Holder Values, this if condition will mostly execute during client side call
+					if(isHolder(paramValue) && isHolder(paramType)){
+						Object holderValue = getHolderValue(paramMode, paramValue);
+						mp = new MethodParameter(paramName, holderValue, paramMode, paramType, actualType, true);
+						
+					}
+					//Identify that param value is not Holders however if the method parameter is holder type and create Holder, this will mostly be called during server side call 
+					else if(!isHolder(paramValue) && isHolder(paramType)){
+						Holder<Object> holder = createHolder(paramType, paramValue);
+						mp=new MethodParameter(paramName, holder, paramMode, paramType, actualType, true);
+					}
+					else{
+						mp = new MethodParameter(paramName, paramValue, paramMode, paramType, actualType, false);
+					}
+				}
+				if(paramType == null){
+					if(isHolder(paramValue)){
+						Object holderValue = getHolderValue(paramMode, paramValue);
+						mp = new MethodParameter(paramName, holderValue, paramMode);	
+					}
+					else{
+						mp = new MethodParameter(paramName, paramValues, paramMode);
+					}
+				}
+				mps.add(mp);
+			}
+			
+			i++;
+		}
+		return mps;
+	}
+	
+	private boolean isParamAsyncHandler(String name, Object value){
+		//TODO I would like to check the name of the parameter to "asyncHandler" As per the JAX-WS specification
+		//However the RI tooling has a bug where it generates partName="asyncHandler" for doc/lit bare case instead of name="asyncHandler".
+		//Once fixed we can also check for name but for now this will work
+		if(value!=null && value instanceof AsyncHandler){
+			if(log.isDebugEnabled()){
+				log.debug("Parameter is AsycnHandler Object");
+			}
+			if(!isAsync()){
+				if (log.isDebugEnabled()) {
+		            log.debug("Method parameter type javax.xml.ws.AsyncHandler should only be used with Async Callback operations, method is Async if it returns a Future<?> and endswith letters 'Async'");
+		        }
+				throw ExceptionFactory.makeWebServiceException(Messages.getMessage("DocLitProxyHandlerErr3"));
+			}
+			return true;
+		}
+		return false;
+		
+	}
+	
+	protected boolean isHolder(Object value){
+		return value!=null && Holder.class.isAssignableFrom(value.getClass());
+	}
+	
+	protected boolean isHolder(Class type){
+		return type!=null && Holder.class.isAssignableFrom(type);
+	}
+	protected Object getHolderValue(Mode mode, Object value){
+		if(!Holder.class.isAssignableFrom(value.getClass())){
+			if(log.isDebugEnabled()){
+				log.debug("Object Not a Holder type");
+			}
+			ExceptionFactory.makeWebServiceException(Messages.getMessage("DocLitProxyHandlerErr5"));
+		}
+		if(mode !=null && mode.equals(Mode.IN)){
+			if(log.isDebugEnabled()){
+				log.debug("WebParam annotation's Mode cannot be IN for input parameter of type Holder");
+			}
+			throw ExceptionFactory.makeWebServiceException(Messages.getMessage("DocLitProxyHandlerErr4"));
+		}
+		Holder holder = (Holder)value;
+		return holder.value;
+		
+	}
+	
+	protected <T> Holder<T> createHolder(Class paramType, T value) throws IllegalAccessException, InstantiationException, ClassNotFoundException{
+		if(Holder.class.isAssignableFrom(paramType)){
+    		Class holderClazz = loadClass(paramType.getName());
+    		Holder<T> holder = (Holder<T>) holderClazz.newInstance();
+    		holder.value = value;
+    		return holder;
+    	}
+		return null;
+	}
+	
+	protected Message createMessage(Object jaxbObject, Class jaxbClazz, String jaxbClassName)throws JAXBException, MessageException, XMLStreamException{
+		Block bodyBlock = null;
+		JAXBContext ctx = createJAXBContext(jaxbClazz);
+		if (log.isDebugEnabled()) {
+            log.debug("Attempting to create Block");
+        }
+		if(isXmlRootElementDefined(jaxbClazz)){
+			bodyBlock = createJAXBBlock(jaxbObject, ctx);
+		}
+		else{
+			bodyBlock =  createJAXBBlock(jaxbClassName, jaxbObject, ctx);
+		}
+		if (log.isDebugEnabled()) {
+            log.debug("JAXBBlock Created");
+        }
+		
+		MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
+		
+		Message m = mf.create(protocol);
+		m.setBodyBlock(0,bodyBlock);
+		return m;
+	}
+	protected Message createEmptyMessage()throws JAXBException, MessageException, XMLStreamException{
+		Block emptyBodyBlock = createEmptyBodyBlock();
+		MessageFactory mf = (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
+		Message m = mf.create(protocol);
+		m.setBodyBlock(0,emptyBodyBlock);
+		return m;
+	}
+	
+	protected Object createBusinessObject(Class jaxbClazz, Message message) throws JAXBException, MessageException, XMLStreamException{
+		JAXBContext ctx = createJAXBContext(jaxbClazz);
+		
+		// Get a JAXBBlockFactory instance.  We'll need this to get the JAXBBlock
+        // out of the Message
+        JAXBBlockFactory factory = (JAXBBlockFactory)FactoryRegistry.getFactory(JAXBBlockFactory.class);
+        
+        Block block = message.getBodyBlock(0, ctx, factory);
+        try{
+        	return block.getBusinessObject(true);
+        }catch(Exception e){
+        //FIXME: this is the bare case where child of body is not a method but a primitive data type. Reader from Block is throwing exception.
+        	block = message.getBodyBlock(0, ctx,factory);
+        	OMElement om = block.getOMElement();
+        	
+        	XMLInputFactory xmlFactory = XMLInputFactory.newInstance();
+		
+        	Unmarshaller u = ctx.createUnmarshaller();
+        	Reader inputReader = new InputStreamReader(new ByteArrayInputStream(om.toString().getBytes()));
+        	XMLStreamReader sr = xmlFactory.createXMLStreamReader(inputReader);
+        	JAXBElement o =u.unmarshal(sr, jaxbClazz);
+        	return o.getValue();
+        
+        }       
+	}
+	
+	protected void createResponseHolders(Object bo, Object[] inputArgs, boolean isBare)throws JAXBWrapperException, InstantiationException, ClassNotFoundException, IllegalAccessException{
+		if(inputArgs == null){
+			return;
+		}
+		ArrayList<Object> objList = toArrayList(inputArgs);
+		for(Object arg:inputArgs){
+			if(arg == null){
+				objList.remove(arg);
+			}
+			else if(arg!=null && !Holder.class.isAssignableFrom(arg.getClass())){
+				objList.remove(arg);
+			}
+			
+		}
+		if(objList.size()<=0){
+			return;
+		}
+		ArrayList<MethodParameter> mps = null;
+		if(isBare){
+			mps = toInputMethodParameters(new Object[]{bo});
+			
+		}
+		else{
+			mps = toInputMethodParameter(bo);
+		}
+			
+		MethodParameter[] mpArray = mps.toArray(new MethodParameter[0]);
+		for(MethodParameter mp:mpArray){
+			if(!mp.isHolder()){
+				mps.remove(mp);
+			}
+		}
+		if(mps.size() <=0){
+			return;
+		}
+		mpArray = null;
+		int index=0;
+		for(Object inputArg: objList){
+			Holder inputHolder = (Holder)inputArg;
+			MethodParameter mp = mps.get(index);
+			Holder responseHolder = (Holder)mp.getValue();
+			inputHolder.value = responseHolder.value;
+			index++;
+		}
+		
+	}
+	
+	protected Object findProperty(String propertyName, Object jaxbObject)throws JAXBWrapperException{
+		JAXBWrapperTool wrapTool = new JAXBWrapperToolImpl();
+		if (log.isDebugEnabled()) {
+            log.debug("Attempting to unwrap objects");
+        }
+		Object[] webResult = wrapTool.unWrap(jaxbObject,new ArrayList<String>(Arrays.asList(new String[]{propertyName})));
+		if (log.isDebugEnabled()) {
+            log.debug("Object unwrapped");
+        }
+		//this is a parameter in JAXBObject
+		return webResult[0];
+	}
+
+	
+	
+}

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java Sat Oct  7 11:17:10 2006
@@ -20,8 +20,7 @@
 import java.util.Hashtable;
 import java.util.Map;
 
-import org.apache.axis2.jaxws.client.factory.DescriptorFactory;
-import org.apache.axis2.jaxws.client.factory.ProxyHandlerFactory;
+import org.apache.axis2.jaxws.marshaller.factory.MethodMarshallerFactory;
 import org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockFactoryImpl;
 import org.apache.axis2.jaxws.message.databinding.impl.OMBlockFactoryImpl;
 import org.apache.axis2.jaxws.message.databinding.impl.SOAPEnvelopeBlockFactoryImpl;
@@ -56,8 +55,7 @@
 		table.put(MessageFactory.class, new MessageFactoryImpl());
 		table.put(XMLPartFactory.class, new XMLPartFactoryImpl());
 		table.put(SAAJConverterFactory.class, new SAAJConverterFactoryImpl());
-		table.put(ProxyHandlerFactory.class, new ProxyHandlerFactory());
-		table.put(DescriptorFactory.class, new DescriptorFactory());
+		table.put(MethodMarshallerFactory.class, new MethodMarshallerFactory());
 	}
 	/**
 	 * FactoryRegistry is currently a static singleton

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java Sat Oct  7 11:17:10 2006
@@ -18,18 +18,23 @@
 
 import java.lang.reflect.Method;
 
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.namespace.QName;
 import javax.xml.ws.Holder;
 import javax.xml.ws.soap.SOAPBinding;
 
+import org.apache.axis2.jaxws.ExceptionFactory;
 import org.apache.axis2.jaxws.core.MessageContext;
 import org.apache.axis2.jaxws.core.util.MessageContextUtils;
 import org.apache.axis2.jaxws.description.EndpointDescription;
 import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
 import org.apache.axis2.jaxws.description.OperationDescription;
 import org.apache.axis2.jaxws.description.ServiceDescription;
-import org.apache.axis2.jaxws.message.Block;
+import org.apache.axis2.jaxws.i18n.Messages;
+import org.apache.axis2.jaxws.marshaller.MethodMarshaller;
+import org.apache.axis2.jaxws.marshaller.factory.MethodMarshallerFactory;
 import org.apache.axis2.jaxws.message.Message;
-import org.apache.axis2.jaxws.message.factory.MessageFactory;
+import org.apache.axis2.jaxws.message.Protocol;
 import org.apache.axis2.jaxws.registry.FactoryRegistry;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -42,7 +47,10 @@
 public class JavaBeanDispatcher extends JavaDispatcher {
 
     private static final Log log = LogFactory.getLog(JavaBeanDispatcher.class);
-    
+    private ServiceDescription serviceDesc = null;
+    private EndpointDescription endpointDesc = null;
+    private OperationDescription operationDesc = null;
+    private MethodMarshaller methodMarshaller = null;
     private Object serviceInstance;
     
     public JavaBeanDispatcher(Class implClass) {
@@ -58,50 +66,36 @@
             log.debug("Preparing to invoke service endpoint implementation " +
                     "class: " + serviceImplClass.getName());
         }
+        
+        initialize(mc);
+        methodMarshaller = createMethodMarshaller(mc.getMessage().getProtocol());
+        Object[] methodInputParams = methodMarshaller.demarshalRequest(mc.getMessage());
+        Method target = getJavaMethod(mc, serviceImplClass);
 
-        mc.setOperationName(mc.getAxisMessageContext().getAxisOperation().getName());
-        OperationDescription opDesc = getOperationDescription(mc);
-        mc.setOperationDescription(opDesc);
-        
-        Mapper mapper = new MapperImpl();
-        Method target = mapper.getJavaMethod(mc, serviceImplClass);
-        Object[] params = mapper.getInputParameterData(mc, target);
-        if(params!=null){
-        	for(Object param:params){
-        		if(param!=null && param instanceof Holder){
-        			throw new UnsupportedOperationException("Holders not supported yet");
-        		}
-        	}
-        }
         //At this point, we have the method that is going to be invoked and
         //the parameter data to invoke it with, so create an instance and 
         //do the invoke.
         serviceInstance = createServiceInstance();
-        Object response = target.invoke(serviceInstance, params);
+        //Passing method input params to grab holder values, if any.
+        Object response = target.invoke(serviceInstance, methodInputParams);
         
-        if(opDesc.isOneWay()){
-        	//Dont return response message context if its a one way operation.
-        	return null;
-        }
-        
-        //TODO:Support Holders 
-        if(!opDesc.isOneWay() && target.getReturnType().getName().equals("void")){
-        	//process everything that does not have holders two way with void is empty responsewrapper in soap body
-        	
-        }
-        Block responseBlock = mapper.getOutputParameterBlock(mc, response, target);
-       
-        //Create the Message for the response
-        MessageFactory factory = (MessageFactory) FactoryRegistry.getFactory(
-                MessageFactory.class);
-        Message message = factory.create(mc.getMessage().getProtocol());
-        message.setBodyBlock(0, responseBlock);
+        Message message = null;
+        //No need to create Response Messagecontext if its a one way call.
+        if(operationDesc.isOneWay()){
+        	message = null;
+        }
+        else if(target.getReturnType().getName().equals("void")){
+        	message = methodMarshaller.marshalResponse(null, methodInputParams);
+        }
+        else{
+        	message = methodMarshaller.marshalResponse(response, methodInputParams);
+        }
         
         MessageContext responseMsgCtx = MessageContextUtils.createMessageMessageContext(mc);
         responseMsgCtx.setMessage(message);
         
         //Enable MTOM if necessary
-        EndpointInterfaceDescription epInterfaceDesc = opDesc.getEndpointInterfaceDescription();
+        EndpointInterfaceDescription epInterfaceDesc = operationDesc.getEndpointInterfaceDescription();
         EndpointDescription epDesc = epInterfaceDesc.getEndpointDescription();
         
         String bindingType = epDesc.getBindingTypeValue();
@@ -115,6 +109,14 @@
         return responseMsgCtx;
     }
     
+    private void initialize(MessageContext mc){
+    	mc.setOperationName(mc.getAxisMessageContext().getAxisOperation().getName());
+    	serviceDesc = getServiceDescription(mc);
+        endpointDesc = getEndpointDescription(mc);
+        operationDesc = getOperationDescription(mc);
+        mc.setOperationDescription(operationDesc);
+        methodMarshaller = null;
+    }
     /*
      * Gets the OperationDescription associated with the request that is currently
      * being processed.
@@ -124,12 +126,25 @@
      */
 
     private OperationDescription getOperationDescription(MessageContext mc) {
+    	
         ServiceDescription sd = mc.getServiceDescription();
         EndpointDescription[] eds = sd.getEndpointDescriptions();
         EndpointDescription ed = eds[0];
         EndpointInterfaceDescription eid = ed.getEndpointInterfaceDescription();
         
         OperationDescription[] ops = eid.getOperation(mc.getOperationName());
+        String methodName = mc.getOperationName().getLocalPart();
+        for(OperationDescription op:ops){
+        	Method method = op.getSEIMethod();
+        	if(method.getName().equals(methodName)){
+        		if (log.isDebugEnabled()) {
+                    log.debug("wsdl operation: " + op.getName());
+                    log.debug("   java method: " + op.getJavaMethodName());
+                }
+        		return op;
+        	}
+        			
+        }
         OperationDescription op = ops[0];
         
         if (log.isDebugEnabled()) {
@@ -138,7 +153,105 @@
         }
         
         return op;        
+        
+    }
+    
+    private ServiceDescription getServiceDescription(MessageContext mc){
+    	return mc.getServiceDescription();
+    }
+    
+    private EndpointDescription getEndpointDescription(MessageContext mc){
+    	ServiceDescription sd = mc.getServiceDescription();
+    	EndpointDescription[] eds = sd.getEndpointDescriptions();
+        EndpointDescription ed = eds[0];
+        return ed;
+    }
+    
+    private MethodMarshaller createMethodMarshaller(Protocol protocol){
+    	javax.jws.soap.SOAPBinding.Style styleOnSEI = endpointDesc.getEndpointInterfaceDescription().getSoapBindingStyle();
+		javax.jws.soap.SOAPBinding.Style styleOnMethod = operationDesc.getSoapBindingStyle();
+		if(styleOnMethod!=null && styleOnSEI!=styleOnMethod){
+			throw ExceptionFactory.makeWebServiceException(Messages.getMessage("proxyErr2"));
+		}
+		if(styleOnSEI == javax.jws.soap.SOAPBinding.Style.RPC){
+			throw new UnsupportedOperationException("RPC/LIT not supported.");
+		}
+		
+		MethodMarshallerFactory cf = (MethodMarshallerFactory) FactoryRegistry.getFactory(MethodMarshallerFactory.class);
+		
+		if(styleOnSEI == javax.jws.soap.SOAPBinding.Style.DOCUMENT){
+			return createDocLitMessageConvertor(cf, protocol);
+		}
+		if(styleOnSEI == javax.jws.soap.SOAPBinding.Style.RPC){
+			return createRPCLitMessageConvertor(cf, protocol);
+			
+		}
+		return null;
     }
     
+    private MethodMarshaller createDocLitMessageConvertor(MethodMarshallerFactory cf, Protocol protocol){
+		ParameterStyle parameterStyle = null;
+		if(isDocLitBare(endpointDesc, operationDesc)){
+			parameterStyle = javax.jws.soap.SOAPBinding.ParameterStyle.BARE;
+		}
+		if(isDocLitWrapped(endpointDesc, operationDesc)){
+			parameterStyle = javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED;
+		}
+		return cf.createDocLitMethodMarshaller(parameterStyle, serviceDesc, endpointDesc, operationDesc, protocol);
+	}
+	
+	private MethodMarshaller createRPCLitMessageConvertor(MethodMarshallerFactory cf, Protocol protocol){
+		return cf.createDocLitMethodMarshaller(null, serviceDesc, endpointDesc, operationDesc, protocol);
+	}
+	
+    
+    public Method getJavaMethod(MessageContext mc, Class serviceImplClass) {
+		 QName opName = mc.getOperationName();
+		 
+	        if (opName == null)
+	            // TODO: NLS
+	            throw ExceptionFactory.makeWebServiceException("Operation name was not set");
+	        
+	        String localPart = opName.getLocalPart();
+	        Method[] methods = serviceImplClass.getMethods();
+	        for (int i = 0; i < methods.length; ++i) {
+	        	String webMethodName = operationDesc.getWebMethodOperationName();
+	            if (localPart.equals(methods[i].getName())){
+	                return methods[i];
+	            }
+	            if(webMethodName.equals(methods[i].getName())){
+	            	return methods[i];
+	            }
+	            
+	        }
+	        
+	        if (log.isDebugEnabled()) {
+	            log.debug("No Java method found for the operation");
+	        }
+	        // TODO: NLS
+	        throw ExceptionFactory.makeWebServiceException(Messages.getMessage("JavaBeanDispatcherErr1"));
+	}
+    
+    protected boolean isDocLitBare(EndpointDescription endpointDesc, OperationDescription operationDesc){
+		javax.jws.soap.SOAPBinding.ParameterStyle methodParamStyle = operationDesc.getSoapBindingParameterStyle();
+		if(methodParamStyle!=null){
+			return methodParamStyle == javax.jws.soap.SOAPBinding.ParameterStyle.BARE;
+		}
+		else{
+			javax.jws.soap.SOAPBinding.ParameterStyle SEIParamStyle = endpointDesc.getEndpointInterfaceDescription().getSoapBindingParameterStyle();
+			return SEIParamStyle == javax.jws.soap.SOAPBinding.ParameterStyle.BARE;
+		}
+	}
+	
+	protected boolean isDocLitWrapped(EndpointDescription endpointDesc, OperationDescription operationDesc){
+		javax.jws.soap.SOAPBinding.ParameterStyle methodParamStyle = operationDesc.getSoapBindingParameterStyle();
+		if(methodParamStyle!=null){
+			return methodParamStyle == javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED;
+		}
+		else{
+		javax.jws.soap.SOAPBinding.ParameterStyle SEIParamStyle = endpointDesc.getEndpointInterfaceDescription().getSoapBindingParameterStyle();
+		return SEIParamStyle == javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED;
+		}
+	}
     
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java Sat Oct  7 11:17:10 2006
@@ -41,10 +41,7 @@
 import org.apache.axis2.jaxws.JAXWSClientContext;
 import org.apache.axis2.jaxws.client.JAXBDispatch;
 import org.apache.axis2.jaxws.client.XMLDispatch;
-import org.apache.axis2.jaxws.client.factory.DescriptorFactory;
-import org.apache.axis2.jaxws.client.factory.ProxyHandlerFactory;
-import org.apache.axis2.jaxws.client.proxy.BaseProxyHandler;
-import org.apache.axis2.jaxws.client.proxy.ProxyDescriptor;
+import org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler;
 import org.apache.axis2.jaxws.description.DescriptionFactory;
 import org.apache.axis2.jaxws.description.ServiceDescription;
 import org.apache.axis2.jaxws.handler.PortData;
@@ -259,15 +256,10 @@
                 addPortData(portName, null, address);
     		}
     	}
-    	DescriptorFactory df = (DescriptorFactory)FactoryRegistry.getFactory(DescriptorFactory.class);
-    	ProxyDescriptor pd = df.create(sei, serviceDescription);
-    	pd.setPort(ports.get(portName));
-    	ProxyHandlerFactory phf =(ProxyHandlerFactory) FactoryRegistry.getFactory(ProxyHandlerFactory.class);
-    	BaseProxyHandler proxyHandler = phf.create(pd, this);
+    	JAXWSProxyHandler proxyHandler = new JAXWSProxyHandler(this, sei, ports.get(portName));
     	
     	Class[] seiClazz = new Class[]{sei, BindingProvider.class};
     	Object proxyClass = Proxy.newProxyInstance(sei.getClassLoader(), seiClazz, proxyHandler);
-    	
     	return sei.cast(proxyClass);
     }
     

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/JAXBWrapperTool.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/JAXBWrapperTool.java?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/JAXBWrapperTool.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/JAXBWrapperTool.java Sat Oct  7 11:17:10 2006
@@ -23,6 +23,7 @@
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBElement;
 
+import org.apache.axis2.jaxws.marshaller.MethodParameter;
 import org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperException;
 
 
@@ -48,7 +49,16 @@
      * @return list of Objects in the same order as the element names.
      */ 
     public Object wrap(Class jaxbClass, String jaxbClassName, ArrayList<String> childNames, Map<String, Object> childObjects) throws JAXBWrapperException;
-    
+    /**
+     * wrap
+     * Creates a jaxb object that is initialized with the child objects
+     * @param jaxbClass
+     * @param jaxbClassName
+     * @param methodParameters
+     * @return
+     * @throws JAXBWrapperException
+     */
+    public Object wrap(Class jaxbClass, String jaxbClassName, ArrayList<MethodParameter> methodParameters) throws JAXBWrapperException;
     /**
      * wrapAsJAXBElement
      * Creates a JAXBElement that is initialized with the child objects and can be serialsed to xml later.

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/impl/JAXBWrapperToolImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/impl/JAXBWrapperToolImpl.java?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/impl/JAXBWrapperToolImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/impl/JAXBWrapperToolImpl.java Sat Oct  7 11:17:10 2006
@@ -37,6 +37,7 @@
 import javax.xml.namespace.QName;
 
 import org.apache.axis2.jaxws.i18n.Messages;
+import org.apache.axis2.jaxws.marshaller.MethodParameter;
 import org.apache.axis2.jaxws.wrapper.JAXBWrapperTool;
 
 
@@ -113,6 +114,22 @@
 		}catch(NoSuchFieldException e){
 			throw new JAXBWrapperException(e);
 		}
+	}
+	
+	public Object wrap(Class jaxbClass, String jaxbClassName, ArrayList<MethodParameter> mps) throws JAXBWrapperException{
+		if(mps == null){
+			throw new JAXBWrapperException(Messages.getMessage("JAXBWrapperErr7"));
+		}
+		ArrayList<String> nameList = new ArrayList<String>();
+		Map<String, Object> objectList = new WeakHashMap<String, Object>();
+		for(MethodParameter mp:mps){
+			String name = mp.getName();
+			Object object = mp.getValue();
+			
+			nameList.add(name);
+			objectList.put(name, object);
+		}
+		return wrap(jaxbClass, jaxbClassName, nameList, objectList);
 	}
 	
 	public JAXBElement wrapAsJAXBElement(Class jaxbClass, String jaxbClassName,

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/AnnotationServiceImplDescriptionTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/AnnotationServiceImplDescriptionTests.java?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/AnnotationServiceImplDescriptionTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/AnnotationServiceImplDescriptionTests.java Sat Oct  7 11:17:10 2006
@@ -133,8 +133,10 @@
         // Check the Java parameters, WebParam names, and WebResult (actually lack thereof) for each of these operations
         
         // Note regarding WebParam names:
-        // Unlike the Java paramaters, the WebParam names will remove the JAX-WS AsyncHandler
-        // parameter.  That is because it is NOT part of the contract, and thus it is NOT part of
+        //In the client Async Call the the WebParam name will not remove JAX-WS AsyncHandler.
+        //Proxy invoking the the Async Call will check the input method object and if
+        //its of type JAX-WS AsyncHandler then that WebParam will be skipped.
+        //This is done because AsyncHandler is NOT part of the contract, and thus it is NOT part of
         // the JAXB object constructed for the method invocation.  The AsyncHandler is part of the 
         // JAX-WS programming model to support an asynchronous callback to receive the response.
         
@@ -173,7 +175,7 @@
                     assertEquals(checkParams[0], "java.lang.String" );
                     assertEquals(checkParams[1], "javax.xml.ws.AsyncHandler");
                     // Check the WebParam Names (see note above) 
-                    assertEquals(1, webParamNames.length);
+                    assertEquals(2, webParamNames.length);
                     assertEquals("invoke_str", webParamNames[0]);
                     // Check the lack of a WebResult annotation
                     assertEquals(false, operation.isWebResultAnnotationSpecified());
@@ -210,7 +212,7 @@
                     assertEquals(checkParams[1], "int");
                     assertEquals(checkParams[2], "javax.xml.ws.AsyncHandler");
                     // Check the WebParam Names (see note above) 
-                    assertEquals(2, webParamNames.length);
+                    assertEquals(3, webParamNames.length);
                     assertEquals("twoWayHolder_str", webParamNames[0]);
                     assertEquals("twoWayHolder_int", webParamNames[1]);
                     // Check the lack of a WebResult annotation

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java Sat Oct  7 11:17:10 2006
@@ -94,7 +94,6 @@
         suite.addTestSuite(NonWrapTests.class);
         suite.addTestSuite(WrapTests.class);
         suite.addTestSuite(AddNumbersTests.class);
-        suite.addTestSuite(BareTests.class);
         
         // Start (and stop) the server only once for all the tests
         TestSetup testSetup = new TestSetup(suite) {

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/AddNumbersTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/AddNumbersTests.java?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/AddNumbersTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/AddNumbersTests.java Sat Oct  7 11:17:10 2006
@@ -27,6 +27,7 @@
 			System.out.println("----------------------------------");
 		}catch(Exception e){
 			e.printStackTrace();
+			fail();
 		}
 	}
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/BareTests.java Sat Oct  7 11:17:10 2006
@@ -30,6 +30,7 @@
 			System.out.println("------------------------------");
 		}catch(Exception e){
 			e.printStackTrace();
+			fail();
 		}
 	}
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/NonWrapTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/NonWrapTests.java?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/NonWrapTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/NonWrapTests.java Sat Oct  7 11:17:10 2006
@@ -5,11 +5,13 @@
 
 import java.util.concurrent.Future;
 
+import javax.xml.ws.Holder;
 import org.apache.axis2.jaxws.sample.nonwrap.sei.DocLitNonWrapPortType;
 import org.apache.axis2.jaxws.sample.nonwrap.sei.DocLitNonWrapService;
 import org.test.sample.nonwrap.ObjectFactory;
 import org.test.sample.nonwrap.ReturnType;
 import org.test.sample.nonwrap.TwoWay;
+import org.test.sample.nonwrap.TwoWayHolder;
 
 import junit.framework.TestCase;
 
@@ -42,6 +44,7 @@
 			System.out.println("------------------------------");
 		}catch(Exception e){
 			e.printStackTrace();
+			fail();
 		}
 	}
 	public void testTwoWayASyncCallback(){
@@ -58,6 +61,30 @@
 			System.out.println("------------------------------");
 		}catch(Exception e){
 			e.printStackTrace();
+			fail();
+		}
+	}
+	public void testTwoWayHolder(){
+		System.out.println("------------------------------");
+		System.out.println("Test : "+getName());
+		try{
+			TwoWayHolder twh = new TwoWayHolder();
+			twh.setTwoWayHolderInt(new Integer(0));
+			twh.setTwoWayHolderStr(new String("Request Holder String"));
+			Holder<TwoWayHolder> holder = new Holder<TwoWayHolder>(twh);
+			TwoWay twoWay = new ObjectFactory().createTwoWay();
+			twoWay.setTwowayStr("testing sync call for java bean non wrap endpoint");
+			DocLitNonWrapService service = new DocLitNonWrapService();
+			DocLitNonWrapPortType proxy = service.getDocLitNonWrapPort();
+			proxy.twoWayHolder(holder);
+			twh = holder.value;
+			System.out.println("Holder string ="+twh.getTwoWayHolderStr());
+			System.out.println("Holder int ="+twh.getTwoWayHolderInt());
+			
+			System.out.println("------------------------------");
+		}catch(Exception e){
+			e.printStackTrace();
+			fail();
 		}
 	}
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/WrapTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/WrapTests.java?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/WrapTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/WrapTests.java Sat Oct  7 11:17:10 2006
@@ -3,6 +3,7 @@
  */
 package org.apache.axis2.jaxws.sample;
 
+import javax.xml.ws.Holder;
 import org.apache.axis2.jaxws.sample.wrap.sei.DocLitWrap;
 import org.apache.axis2.jaxws.sample.wrap.sei.DocLitWrapService;
 
@@ -42,6 +43,7 @@
 			System.out.println("------------------------------");
 		}catch(Exception e){
 			e.printStackTrace();
+			fail();
 		}
 	}
 	
@@ -57,6 +59,27 @@
 			System.out.println("------------------------------");
 		}catch(Exception e){
 			e.printStackTrace();
+			fail();
+		}
+	}
+	
+	public void testTwoWayHolder(){
+		System.out.println("------------------------------");
+		System.out.println("Test : "+getName());
+		try{
+			String holderString = new String("Test twoWay Sync");
+			Integer holderInteger = new Integer(0);
+			Holder<String> strHolder = new Holder<String>(holderString);
+			Holder<Integer> intHolder = new Holder<Integer>(holderInteger);
+			DocLitWrapService service = new DocLitWrapService();
+			DocLitWrap proxy = service.getDocLitWrapPort();
+			proxy.twoWayHolder(strHolder, intHolder);
+			System.out.println("Holder Response String =" + strHolder.value);;
+			System.out.println("Holder Response Integer ="+ intHolder.value);
+			System.out.println("------------------------------");
+		}catch(Exception e){
+			e.printStackTrace();
+			fail();
 		}
 	}
 

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/nonwrap/DocLitNonWrapPortTypeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/nonwrap/DocLitNonWrapPortTypeImpl.java?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/nonwrap/DocLitNonWrapPortTypeImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/nonwrap/DocLitNonWrapPortTypeImpl.java Sat Oct  7 11:17:10 2006
@@ -66,7 +66,10 @@
 	 * @see org.apache.axis2.jaxws.sample.nonwrap.sei.DocLitNonWrapPortType#twoWayHolder(javax.xml.ws.Holder)
 	 */
 	public void twoWayHolder(Holder<TwoWayHolder> allByMyself) {
-		// TODO Auto-generated method stub
+		//TODO Auto-generated method stub
+		TwoWayHolder twh = allByMyself.value;
+		twh.setTwoWayHolderInt(10);
+		twh.setTwoWayHolderStr("Response String");
 
 	}
 

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/nonwrap/META-INF/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/nonwrap/META-INF/services.xml?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/nonwrap/META-INF/services.xml (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/nonwrap/META-INF/services.xml Sat Oct  7 11:17:10 2006
@@ -4,9 +4,6 @@
    <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.jaxws.server.JAXWSMessageReceiver"/>
   </messageReceivers>
   <parameter locked="false" name="ServiceClass">org.apache.axis2.jaxws.sample.nonwrap.DocLitNonWrapPortTypeImpl</parameter>
-  <operation name="invoke" mep="http://www.w3.org/2004/08/wsdl/in-out">
-    <actionMapping/>
-  </operation>
  </service>
 </serviceGroup>
 

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/wrap/DocLitWrapImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/wrap/DocLitWrapImpl.java?view=diff&rev=453977&r1=453976&r2=453977
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/wrap/DocLitWrapImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/wrap/DocLitWrapImpl.java Sat Oct  7 11:17:10 2006
@@ -48,7 +48,9 @@
 	 */
 	public void twoWayHolder(Holder<String> twoWayHolderStr,
 			Holder<Integer> twoWayHolderInt) {
-		// TODO Auto-generated method stub
+
+		twoWayHolderInt.value = 10;
+		twoWayHolderStr.value = "Response String";
 
 	}
 



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


Mime
View raw message