cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r488948 [2/3] - in /incubator/cxf/trunk: ./ api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/phase/ api/src/main/java/org/apache/cxf/service/model/ buildtools/src/main/resources/ integration/jca/src/main/java/org/apache...
Date Wed, 20 Dec 2006 08:07:59 GMT
Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java Wed Dec 20 00:07:54 2006
@@ -20,19 +20,10 @@
 package org.apache.cxf.jaxws;
 
 import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Collection;
 import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.TreeSet;
 
-import javax.xml.ws.Holder;
 import javax.xml.ws.handler.MessageContext;
 
-import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
 import org.apache.cxf.common.util.factory.Factory;
 import org.apache.cxf.jaxws.context.WebServiceContextImpl;
 import org.apache.cxf.jaxws.support.ContextPropertiesMapping;
@@ -40,8 +31,6 @@
 import org.apache.cxf.service.invoker.ApplicationScopePolicy;
 import org.apache.cxf.service.invoker.FactoryInvoker;
 import org.apache.cxf.service.invoker.ScopePolicy;
-import org.apache.cxf.service.model.BindingMessageInfo;
-import org.apache.cxf.service.model.BindingOperationInfo;
 
 public class JAXWSMethodInvoker extends FactoryInvoker {
 
@@ -66,106 +55,15 @@
 
     @SuppressWarnings("unchecked")
     protected Object invoke(Exchange exchange, final Object serviceObject, Method m, List<Object> params) {
-        BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
-        List<Object> orderedParams = params;
-        if (bop != null && bop.getInput() != null) {
-            orderedParams = getOrderedParamList(params, bop.getInput());
-        }
-        checkHolder(m, orderedParams, exchange);
         // set up the webservice request context 
         MessageContext ctx = 
             ContextPropertiesMapping.createWebServiceContext(exchange);
         WebServiceContextImpl.setMessageContext(ctx);
         
-        List<Object> res = (List<Object>) super.invoke(exchange, serviceObject,
-            m, orderedParams);
-        if (bop != null && bop.getOutput() != null) {
-            getOrderedReturnList(res, orderedParams, bop.getOutput());
-        } else {
-            for (Object o : orderedParams) {
-                if (o instanceof Holder) {
-                    res.add(((Holder) o).value);
-                }
-            }
-        }
+        List<Object> res = (List<Object>) super.invoke(exchange, serviceObject, m, params);
+        
         //update the webservice response context
         ContextPropertiesMapping.updateWebServiceContext(exchange, ctx);
         return res;
     }
-
-    @SuppressWarnings("unchecked")
-    private void checkHolder(Method method, List<Object> params, Exchange exchange) {
-        if (method != null) {
-
-            Type[] para = method.getGenericParameterTypes();
-            for (int i = 0; i < para.length; i++) {
-                if (para[i] instanceof ParameterizedType) {
-                    ParameterizedType paramType = (ParameterizedType)para[i];
-                    if (((Class)paramType.getRawType()).getName().equals("javax.xml.ws.Holder")) {
-                        if (i >= params.size()) {
-                            params.add(new Holder());
-                        } else {
-                            params.set(i, new Holder(params.get(i)));
-                        }
-                    }
-                }
-            }
-        }
-    }
-    
-    private List<Object> getOrderedParamList(List<Object> params, BindingMessageInfo bmi) {
-        List<SoapHeaderInfo> headers = bmi.getExtensors(SoapHeaderInfo.class);
-        if (headers == null || headers.isEmpty()) {
-            return params;
-        }
-        List<Object> orderedParams = new ArrayList<Object>();
-        
-        // Add non-header params to the list first.
-        int headerIdx = params.size() - headers.size();
-        orderedParams.addAll(params.subList(0, headerIdx));
-        
-        Map<Integer, Object> headerParams = new TreeMap<Integer, Object>();
-        for (SoapHeaderInfo header : headers) {
-            headerParams.put(header.getSequence(), params.get(headerIdx));
-            headerIdx++;
-        }
-        // Insert the header params according to their wsdl message order.
-        for (Integer i : headerParams.keySet()) {
-            if (i.intValue() <= orderedParams.size()) {
-                orderedParams.add(i.intValue(), headerParams.get(i));
-            } else {
-                orderedParams.add(headerParams.get(i));
-            }
-        }
-
-        return orderedParams;
-    }
-
-    private void getOrderedReturnList(List<Object> res, List<Object> params, BindingMessageInfo bmi) {
-        List<SoapHeaderInfo> headers = bmi.getExtensors(SoapHeaderInfo.class);
-        int returnIdx = 0;
-        if (headers != null && !headers.isEmpty()) {
-            Collection<Integer> headerIndices = new TreeSet<Integer>();
-            for (SoapHeaderInfo header : headers) {
-                headerIndices.add(header.getSequence());
-            }
-            // XXX - Does this assume that the header parts in the IN message
-            // have the same order as in the out message?
-            for (Integer i : headerIndices) {
-                if (i.intValue() <= returnIdx && params.get(i) instanceof Holder) {
-                    res.add(i.intValue(), ((Holder) params.get(i.intValue())).value);
-                    returnIdx++;
-                } else {
-                    break;
-                }
-            }
-        }
-        for (int i = returnIdx; i < params.size(); i++) {
-            Object o = params.get(i);
-            if (o instanceof Holder) {
-                res.add(((Holder) o).value);
-            }
-        }
-    }
-
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientFactoryBean.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientFactoryBean.java Wed Dec 20 00:07:54 2006
@@ -18,8 +18,8 @@
  */
 package org.apache.cxf.jaxws;
 
+import org.apache.cxf.frontend.ClientFactoryBean;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
-import org.apache.cxf.service.factory.ClientFactoryBean;
 
 /**
  * Bean to help easily create Client endpoints for JAX-WS.

Copied: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java (from r486881, incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java?view=diff&rev=488948&p1=incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java&r1=486881&p2=incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointInvocationHandler.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java Wed Dec 20 00:07:54 2006
@@ -21,60 +21,62 @@
 
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
+import java.util.Iterator;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.FutureTask;
+import java.util.concurrent.atomic.AtomicReference;
 import java.util.logging.Logger;
 
 import javax.xml.ws.AsyncHandler;
 import javax.xml.ws.Binding;
 import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Holder;
 import javax.xml.ws.Response;
 import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.frontend.MethodDispatcher;
 import org.apache.cxf.jaxws.support.ContextPropertiesMapping;
-import org.apache.cxf.service.factory.MethodDispatcher;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.workqueue.OneShotAsyncExecutor;
 
-public final class EndpointInvocationHandler extends BindingProviderImpl implements InvocationHandler {
+public class JaxWsClientProxy extends org.apache.cxf.frontend.ClientProxy implements
+    InvocationHandler, BindingProvider {
 
-    private static final Logger LOG = LogUtils.getL7dLogger(EndpointInvocationHandler.class);
+    private static final Logger LOG = LogUtils.getL7dLogger(JaxWsClientProxy.class);
 
-    private Endpoint endpoint;
+    protected AtomicReference<Map<String, Object>> requestContext = 
+            new AtomicReference<Map<String, Object>>();
+    protected Map<String, Object> responseContext;
 
-    private Client client;
+    private Endpoint endpoint;
+    private final Binding binding;
 
-    public EndpointInvocationHandler(Client c, Binding b) {
-        super(b);
-        endpoint = c.getEndpoint();
-        client = c;
+    public JaxWsClientProxy(Client c, Binding b) {
+        super(c);
+        this.endpoint = c.getEndpoint();
+        this.binding = b;
         setupEndpointAddressContext();
     }
-    
+
     private void setupEndpointAddressContext() {
-        //NOTE for jms transport the address would be null
-        if (null != endpoint 
-            && null != endpoint.getEndpointInfo().getAddress()) {
-            Map<String, Object> requestContext = this.getRequestContext();
-            requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
-                           endpoint.getEndpointInfo().getAddress());
-        }    
+        // NOTE for jms transport the address would be null
+        if (null != endpoint && null != endpoint.getEndpointInfo().getAddress()) {
+            getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, 
+                                    endpoint.getEndpointInfo().getAddress());
+        }
     }
 
     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
-       
-        MethodDispatcher dispatcher = 
-            (MethodDispatcher)endpoint.getService().get(MethodDispatcher.class.getName());
+
+        MethodDispatcher dispatcher = (MethodDispatcher)endpoint.getService().get(
+                                                                                  MethodDispatcher.class
+                                                                                      .getName());
         BindingOperationInfo oi = dispatcher.getBindingOperation(method, endpoint);
         if (oi == null) {
             // check for method on BindingProvider and Object
@@ -87,74 +89,43 @@
             Message msg = new Message("NO_OPERATION_INFO", LOG, method.getName());
             throw new WebServiceException(msg.toString());
         }
-       
+
         Object[] params = args;
         if (null == params) {
             params = new Object[0];
         }
 
-        Object[] paramsWithOutHolder = handleHolder(params);
-        Map<String, Object> requestContext = this.getRequestContext();
-        Map<String, Object> responseContext = this.getResponseContext();
+        Map<String, Object> reqContext = this.getRequestContext();
+        Map<String, Object> resContext = this.getResponseContext();
         Map<String, Object> context = new HashMap<String, Object>();
-        
-        //need to do context mapping from jax-ws to cxf message
-        ContextPropertiesMapping.mapRequestfromJaxws2Cxf(requestContext);
-        
-        context.put(Client.REQUEST_CONTEXT, requestContext);
-        context.put(Client.RESPONSE_CONTEXT, responseContext);
 
-        requestContext.put(Method.class.getName(), method);
+        // need to do context mapping from jax-ws to cxf message
+        ContextPropertiesMapping.mapRequestfromJaxws2Cxf(reqContext);
+
+        context.put(Client.REQUEST_CONTEXT, reqContext);
+        context.put(Client.RESPONSE_CONTEXT, resContext);
+
+        reqContext.put(Method.class.getName(), method);
 
         boolean isAsync = method.getName().endsWith("Async");
-        
+
         Object result = null;
         if (isAsync) {
-            result = invokeAsync(method, oi, params, paramsWithOutHolder, context);
+            result = invokeAsync(method, oi, params, context);
         } else {
-            result = invokeSync(method, oi, params, paramsWithOutHolder, context);
+            result = invokeSync(method, oi, params, context);
         }
-        // need to do context mapping from cxf message to jax-ws 
-        ContextPropertiesMapping.mapResponsefromCxf2Jaxws(responseContext);
+        // need to do context mapping from cxf message to jax-ws
+        ContextPropertiesMapping.mapResponsefromCxf2Jaxws(resContext);
         return result;
-        
-    }
-
 
-    Object invokeSync(Method method, 
-                          BindingOperationInfo oi, 
-                          Object[] params, 
-                          Object[] paramsWithOutHolder, 
-                          Map<String, Object> context) throws Exception {
-        Object rawRet[] = client.invoke(oi, paramsWithOutHolder, context);
-
-        if (rawRet != null && rawRet.length != 0) {
-            List<Object> retList = new ArrayList<Object>();
-            handleHolderReturn(params, method, rawRet, retList);
-            Object[] obj = retList.toArray();
-            return obj == null || obj.length == 0 ? null : obj[0];
-        } else {
-            return null;
-        }
-    }
-    
-    Client getClient() {
-        return client;
     }
 
-    private Object invokeAsync(Method method, 
-                               BindingOperationInfo oi, 
-                               Object[] params, 
-                               Object[] paramsWithOutHolder, 
+    private Object invokeAsync(Method method, BindingOperationInfo oi, Object[] params,
                                Map<String, Object> context) {
-        
-        FutureTask<Object> f = new FutureTask<Object>(new JAXWSAsyncCallable(this, 
-                                                                             method,
-                                                                             oi,
-                                                                             params,
-                                                                             paramsWithOutHolder,
-                                                                             context
-                                                                             ));
+
+        FutureTask<Object> f = new FutureTask<Object>(new JAXWSAsyncCallable(this, method, oi, params,
+                                                                             context));
 
         endpoint.getService().setExecutor(OneShotAsyncExecutor.getInstance());
         endpoint.getService().getExecutor().execute(f);
@@ -170,59 +141,32 @@
         }
     }
 
-    private Object[] handleHolder(Object[] params) {
-        // get value out of Holder
-        Object[] ret = new Object[params.length];
-        for (int i = 0; i < params.length; i++) {
-            if (params[i] instanceof Holder) {
-                ret[i] = ((Holder)params[i]).value;
-            } else {
-                ret[i] = params[i];
-            }
+    public Map<String, Object> getRequestContext() {
+        if (null == requestContext.get()) {
+            requestContext.compareAndSet(null, new ConcurrentHashMap<String, Object>(4));
         }
-        return ret;
+        return (Map<String, Object>)requestContext.get();
     }
 
-    private void handleHolderReturn(Object[] params, Method method, Object[] rawRet, List<Object> retList) {
-
-        int idx = 0;
-
-        if (method == null) {
-            return;
-        }
-        if (!((Class)method.getReturnType()).getName().equals("void")) {
-            retList.add(rawRet[0]);
-            idx++;
-        }
-        int holderStartIndex = 0;
-        Type[] para = method.getGenericParameterTypes();
-        for (int i = 0; i < para.length; i++) {
-            if (para[i] instanceof ParameterizedType) {
-                ParameterizedType paramType = (ParameterizedType)para[i];
-                if (((Class)paramType.getRawType()).getName().equals("javax.xml.ws.Holder")) {
-                    break;
-                } else {
-                    holderStartIndex++;
-                }
-            } else {
-                holderStartIndex++;
-            }
+    public Map<String, Object> getResponseContext() {
+        if (responseContext == null) {
+            responseContext = new HashMap<String, Object>();
         }
+        return responseContext;
+    }
 
-        for (int i = idx; i < rawRet.length; i++, holderStartIndex++) {
-            try {
-                ((Holder)params[holderStartIndex]).getClass().getField("value").set(params[holderStartIndex],
-                                                                                    rawRet[i]);
-            } catch (IllegalArgumentException e) {
-                e.printStackTrace();
-            } catch (SecurityException e) {
-                e.printStackTrace();
-            } catch (IllegalAccessException e) {
-                e.printStackTrace();
-            } catch (NoSuchFieldException e) {
-                e.printStackTrace();
-            }
+    public Binding getBinding() {
+        return binding;
+    }
 
+    protected void populateResponseContext(MessageContext ctx) {
+        Iterator<String> iter = ctx.keySet().iterator();
+        Map<String, Object> respCtx = getResponseContext();
+        while (iter.hasNext()) {
+            String obj = iter.next();
+            if (MessageContext.Scope.APPLICATION.compareTo(ctx.getScope(obj)) == 0) {
+                respCtx.put(obj, ctx.get(obj));
+            }
         }
     }
 }

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsProxyFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsProxyFactoryBean.java?view=auto&rev=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsProxyFactoryBean.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsProxyFactoryBean.java Wed Dec 20 00:07:54 2006
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.cxf.jaxws;
+
+import org.apache.cxf.frontend.ClientProxyFactoryBean;
+
+public class JaxWsProxyFactoryBean extends ClientProxyFactoryBean {
+
+    public JaxWsProxyFactoryBean() {
+        super();
+        setClientFactoryBean(new JaxWsClientFactoryBean());
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsProxyFactoryBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsProxyFactoryBean.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsProxyFactoryBean.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsServerFactoryBean.java Wed Dec 20 00:07:54 2006
@@ -18,8 +18,10 @@
  */
 package org.apache.cxf.jaxws;
 
+import org.apache.cxf.frontend.ServerFactoryBean;
+import org.apache.cxf.jaxws.binding.soap.JaxWsSoapBindingInfoFactoryBean;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
-import org.apache.cxf.service.factory.ServerFactoryBean;
+import org.apache.cxf.service.invoker.Invoker;
 
 /**
  * Bean to help easily create Server endpoints for JAX-WS.
@@ -27,5 +29,11 @@
 public class JaxWsServerFactoryBean extends ServerFactoryBean {
     public JaxWsServerFactoryBean() {
         setServiceFactory(new JaxWsServiceFactoryBean());
+        setBindingFactory(new JaxWsSoapBindingInfoFactoryBean());
+    }
+
+    @Override
+    protected Invoker createInvoker() {
+        return new JAXWSMethodInvoker(getServiceBean());
     }
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java Wed Dec 20 00:07:54 2006
@@ -63,6 +63,7 @@
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.AbstractBindingInfoFactoryBean;
 import org.apache.cxf.service.factory.AbstractServiceFactoryBean;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.ServiceInfo;
@@ -146,7 +147,7 @@
             dispatchService.setDataBinding(db);
             serviceFactory = sf;
         } else {
-            JaxWsServiceFactoryBean sf = new JaxWsServiceFactoryBean();
+            ReflectionServiceFactoryBean sf = new JaxWsServiceFactoryBean();
             sf.setBus(bus);
             sf.setServiceName(serviceName);
             // maybe we can find another way to create service which have no SEI
@@ -229,7 +230,7 @@
         LOG.log(Level.FINE, "creating port for portName", portName);
         LOG.log(Level.FINE, "endpoint interface:", serviceEndpointInterface);
 
-        JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
+        ReflectionServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
         serviceFactory.setBus(bus);
         serviceFactory.setServiceName(serviceName);
         serviceFactory.setServiceClass(serviceEndpointInterface);
@@ -282,7 +283,7 @@
 
         Client client = new ClientImpl(bus, jaxwsEndpoint);
 
-        InvocationHandler ih = new EndpointInvocationHandler(client, jaxwsEndpoint.getJaxwsBinding());
+        InvocationHandler ih = new JaxWsClientProxy(client, jaxwsEndpoint.getJaxwsBinding());
 
         // configuration stuff
         // createHandlerChainForBinding(serviceEndpointInterface, portName,

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/JaxWsSoapBindingInfoFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/JaxWsSoapBindingInfoFactoryBean.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/JaxWsSoapBindingInfoFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/JaxWsSoapBindingInfoFactoryBean.java Wed Dec 20 00:07:54 2006
@@ -18,12 +18,17 @@
  */
 package org.apache.cxf.jaxws.binding.soap;
 
+import java.lang.reflect.Method;
+
 import javax.jws.soap.SOAPBinding;
 import javax.jws.soap.SOAPBinding.Style;
 import javax.jws.soap.SOAPBinding.Use;
 
 import org.apache.cxf.binding.soap.SoapBindingInfoFactoryBean;
+import org.apache.cxf.frontend.MethodDispatcher;
 import org.apache.cxf.jaxws.support.AbstractJaxWsServiceFactoryBean;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.MessagePartInfo;
 
 /**
  * Introspects the SOAPBinding annotation to provide to construct
@@ -45,9 +50,13 @@
     }
 
     Class<?> getServiceClass() {
-        return ((AbstractJaxWsServiceFactoryBean)getServiceFactory()).getJaxWsImplementorInfo()
+        return getJaxWsServiceFactory().getJaxWsImplementorInfo()
             .getEndpointClass();
     }
+
+    private AbstractJaxWsServiceFactoryBean getJaxWsServiceFactory() {
+        return (AbstractJaxWsServiceFactoryBean)getServiceFactory();
+    }
     
     @Override
     public String getUse() {
@@ -61,5 +70,14 @@
         }
         return super.getStyle();
     }
+
+    @Override
+    protected boolean isHeader(BindingOperationInfo op, MessagePartInfo part) {
+        MethodDispatcher md = (MethodDispatcher) getService().get(MethodDispatcher.class.getName());
+        Method method = md.getMethod(op);
+        
+        return getJaxWsServiceFactory().isHeader(method, part.getIndex());
+    }
+    
     
 }

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java?view=auto&rev=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java Wed Dec 20 00:07:54 2006
@@ -0,0 +1,92 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.cxf.jaxws.interceptors;
+
+import java.util.List;
+
+import javax.xml.ws.Holder;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
+import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.cxf.service.model.OperationInfo;
+
+public class HolderInInterceptor extends AbstractPhaseInterceptor<Message> {
+
+    public static final String CLIENT_HOLDERS = "client.holders";
+    
+    public HolderInInterceptor() {
+        super();
+        setPhase(Phase.PRE_INVOKE);
+    }
+
+    @SuppressWarnings("unchecked")
+    public void handleMessage(Message message) throws Fault {
+        List<Object> inObjects = message.getContent(List.class);
+
+        Exchange exchange = message.getExchange();
+        
+        OperationInfo op = exchange.get(OperationInfo.class);
+        if (op == null || !op.hasOutput() || op.getOutput().size() == 0) {
+            return;
+        }
+        
+        List<MessagePartInfo> parts = op.getOutput().getMessageParts();
+        
+        boolean client = Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE));
+        if (client) {
+            int holderIdx = 0;
+            int partIdx = 0;
+            for (MessagePartInfo part : parts) {
+                if (part.getIndex() == -1) {
+                    partIdx++;
+                    break;
+                }
+            }
+            
+            List<Holder> holders = (List<Holder>) exchange.get(CLIENT_HOLDERS);
+            for (MessagePartInfo part : parts) {
+                int idx = part.getIndex();
+                if (idx >= 0) {
+                    Holder holder = holders.get(holderIdx);
+                    holder.value = inObjects.get(partIdx);
+                    holderIdx++;
+                    partIdx++;
+                }
+            }
+        } else {
+            for (MessagePartInfo part : parts) {
+                int idx = part.getIndex();
+                if (idx >= 0) {
+                    if (part.getProperty(ReflectionServiceFactoryBean.MODE_INOUT) != null) {
+                        Object object = inObjects.get(idx);
+                        inObjects.set(idx, new Holder(object));
+                    } else {
+                        inObjects.add(idx, new Holder());
+                    } 
+                }
+            }
+        }
+    }
+}

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java?view=auto&rev=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java Wed Dec 20 00:07:54 2006
@@ -0,0 +1,124 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.cxf.jaxws.interceptors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.ws.Holder;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
+import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.cxf.service.model.OperationInfo;
+
+
+public class HolderOutInterceptor extends AbstractPhaseInterceptor<Message> {
+
+    public HolderOutInterceptor() {
+        super();
+        addBefore(WrapperClassOutInterceptor.class.getName());
+        setPhase(Phase.PRE_LOGICAL);
+    }
+
+    @SuppressWarnings("unchecked")
+    public void handleMessage(Message message) throws Fault {
+        List<Object> outObjects = message.getContent(List.class);
+        Exchange exchange = message.getExchange();
+        OperationInfo op = exchange.get(OperationInfo.class);
+        
+        if (op == null || !op.hasOutput() || op.getOutput().size() == 0) {
+            return;
+        }
+
+        List<MessagePartInfo> parts = op.getOutput().getMessageParts();
+        
+        // is this a client invocation?
+        if (Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE))) {
+            // Extract the Holders and store them for later
+            List<Holder> holders = new ArrayList<Holder>();
+            int size = op.getInput().size();
+            List<Object> newObjects = new ArrayList<Object>(size);
+            for (int i = 0; i < size; i++) {
+                newObjects.add(null);
+            }
+            
+            for (MessagePartInfo part : parts) {
+                int idx = part.getIndex();
+                if (idx >= 0) {
+                    Holder holder = (Holder) outObjects.get(idx);
+                    if (part.getProperty(ReflectionServiceFactoryBean.MODE_INOUT) != null) {
+                        newObjects.set(idx, holder.value);
+                    } 
+                    holders.add(holder);
+                }
+            }
+            
+            if (holders.size() == 0) {
+                return;
+            }
+            
+            int i = 0;
+            for (MessagePartInfo part : op.getInput().getMessageParts()) {
+                // if this is an in/out param, we already took care of it above since it has a holder.
+                if (part.getProperty(ReflectionServiceFactoryBean.MODE_INOUT) != null) {
+                    i++;
+                    continue;
+                }
+                
+                newObjects.set(part.getIndex(), outObjects.get(i));
+                i++;
+            }
+            
+            message.setContent(List.class, newObjects);
+            message.getExchange().put(HolderInInterceptor.CLIENT_HOLDERS, holders);
+        } else {
+            // Add necessary holders so we match the method signature of the service class
+            List<Object> reqObjects = message.getExchange().getInMessage().getContent(List.class);
+    
+            int outIdx = 0;
+            for (MessagePartInfo part : parts) {
+                if (part.getIndex() == -1) {
+                    outIdx++;
+                    break;
+                }
+            }
+            
+            for (MessagePartInfo part : parts) {
+                int methodIdx = part.getIndex();
+                if (methodIdx >= 0) {
+                    Holder holder = (Holder) reqObjects.get(methodIdx);
+                    Object o = holder.value;
+                    if (outIdx >= outObjects.size()) {
+                        outObjects.add(o);
+                    } else {
+                        outObjects.add(outIdx, o);
+                    }
+                    outIdx++;
+                }
+            }
+        }
+    }
+    
+}

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java Wed Dec 20 00:07:54 2006
@@ -35,6 +35,8 @@
 import org.apache.cxf.jaxws.handler.LogicalHandlerInterceptor;
 import org.apache.cxf.jaxws.handler.StreamHandlerInterceptor;
 import org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor;
+import org.apache.cxf.jaxws.interceptors.HolderInInterceptor;
+import org.apache.cxf.jaxws.interceptors.HolderOutInterceptor;
 import org.apache.cxf.jaxws.interceptors.WrapperClassInInterceptor;
 import org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor;
 import org.apache.cxf.service.Service;
@@ -73,11 +75,13 @@
         List<Interceptor> in = super.getInInterceptors();
         in.addAll(handlerInterceptors);
         in.add(new WrapperClassInInterceptor());
+        in.add(new HolderInInterceptor());
         
         List<Interceptor> out = super.getOutInterceptors();
         out.addAll(handlerInterceptors);
         out.add(new WrapperClassOutInterceptor());
-
+        out.add(new HolderOutInterceptor());
+        
         getInFaultInterceptors().add(new ClientFaultConverter());
     }
     

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java Wed Dec 20 00:07:54 2006
@@ -34,6 +34,7 @@
 import javax.jws.soap.SOAPBinding.ParameterStyle;
 import javax.jws.soap.SOAPBinding.Style;
 import javax.xml.namespace.QName;
+import javax.xml.ws.Holder;
 import javax.xml.ws.RequestWrapper;
 import javax.xml.ws.ResponseWrapper;
 import javax.xml.ws.WebFault;
@@ -315,6 +316,7 @@
 
     @Override
     public Boolean isInParam(Method method, int j) {
+        method = getDeclaredMethod(method);
         if (j < 0) {
             return Boolean.FALSE;
         }
@@ -330,13 +332,18 @@
 
     @Override
     public Boolean isOutParam(Method method, int j) {
+        method = getDeclaredMethod(method);
         if (j == -1) {
             return !method.getReturnType().equals(void.class);
         }
 
         WebParam webParam = getWebParam(method, j);
 
-        return webParam != null && (webParam.mode().equals(Mode.OUT) || webParam.mode().equals(Mode.INOUT));
+        if (webParam != null && (webParam.mode().equals(Mode.OUT) || webParam.mode().equals(Mode.INOUT))) {
+            return Boolean.TRUE;
+        }
+        
+        return method.getParameterTypes()[j] == Holder.class;
     }
 
     @Override
@@ -429,4 +436,17 @@
         }
         return null;
     }
+
+    @Override
+    public Boolean isHeader(Method method, int j) {
+        method = getDeclaredMethod(method);
+        if (j >= 0) {
+            WebParam webParam = getWebParam(method, j);
+            return webParam != null && webParam.header();
+        } else {
+            WebResult webResult = getWebResult(method);
+            return webResult != null && webResult.header();
+        }
+    }
+    
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java Wed Dec 20 00:07:54 2006
@@ -19,10 +19,7 @@
 
 package org.apache.cxf.jaxws.support;
 
-import java.lang.reflect.Array;
-import java.lang.reflect.GenericArrayType;
 import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -31,12 +28,12 @@
 import javax.wsdl.Operation;
 import javax.xml.namespace.QName;
 import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.Holder;
 import javax.xml.ws.Service;
 
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.EndpointException;
 import org.apache.cxf.jaxws.interceptors.WebFaultOutInterceptor;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.factory.ServiceConstructionException;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.FaultInfo;
@@ -48,12 +45,6 @@
 
 public class JaxWsServiceFactoryBean extends AbstractJaxWsServiceFactoryBean {
 
-    public static final String MODE_OUT = "messagepart.mode.out";
-
-    public static final String MODE_INOUT = "messagepart.mode.inout";
-
-    public static final String HOLDER = "messagepart.isholder";
-
     private JaxWsServiceConfiguration jaxWsConfiguration;
 
     public JaxWsServiceFactoryBean() {
@@ -85,7 +76,7 @@
     }
 
     @Override
-    protected Endpoint createEndpoint(EndpointInfo ei) throws EndpointException {
+    public Endpoint createEndpoint(EndpointInfo ei) throws EndpointException {
         return new JaxWsEndpointImpl(getBus(), getService(), ei);
     }
 
@@ -193,6 +184,7 @@
                 MessageInfo input = o.getOutput();
                 MessagePartInfo part = input.getMessageParts().get(0);
                 part.setTypeClass(getResponseWrapper(method));
+                part.setIndex(-1);
             }
             
             setFaultClassInfo(o, method);
@@ -226,54 +218,32 @@
 
     private void initializeParameter(OperationInfo o, Method method, int i, 
                                      Class paramType, Type genericType) {
-        if (isWrapped(method)) {
-            return;
-        }
         boolean isIn = isInParam(method, i);
         boolean isOut = isOutParam(method, i);
 
+        MessagePartInfo part = null;
         if (isIn && !isOut) {
             QName name = getInPartName(o, method, i);
-            MessagePartInfo part = o.getInput().getMessagePart(name);
+            part = o.getInput().getMessagePart(name);
             initializeParameter(part, paramType, genericType);
+            part.setIndex(i);
         } else if (!isIn && isOut) {
             QName name = getOutPartName(o, method, i);
-            MessagePartInfo part = o.getOutput().getMessagePart(name);
+            part = o.getOutput().getMessagePart(name);
             initializeParameter(part, paramType, genericType);
+            part.setIndex(i);
         } else if (isIn && isOut) {
             QName name = getOutPartName(o, method, i);
-            MessagePartInfo part = o.getInput().getMessagePart(name);
-            part.setProperty(JaxWsServiceFactoryBean.MODE_INOUT, Boolean.TRUE);
+            part = o.getInput().getMessagePart(name);
+            part.setProperty(ReflectionServiceFactoryBean.MODE_INOUT, Boolean.TRUE);
             initializeParameter(part, paramType, genericType);
+            part.setIndex(i);
             
             part = o.getOutput().getMessagePart(name);
-            part.setProperty(JaxWsServiceFactoryBean.MODE_INOUT, Boolean.TRUE);
+            part.setProperty(ReflectionServiceFactoryBean.MODE_INOUT, Boolean.TRUE);
             initializeParameter(part, paramType, genericType);
+            part.setIndex(i);
         }
-    }
-
-    private void initializeParameter(MessagePartInfo part, Class rawClass, Type type) {
-        if (rawClass.equals(Holder.class) && type instanceof ParameterizedType) {
-            ParameterizedType paramType = (ParameterizedType)type;
-            rawClass = getHolderClass(paramType);
-        }
-        part.setProperty(GENERIC_TYPE, type);
-        part.setTypeClass(rawClass);
-    }
-
-    private static Class getHolderClass(ParameterizedType paramType) {
-        Object rawType = paramType.getActualTypeArguments()[0];
-        Class rawClass;
-        if (rawType instanceof GenericArrayType) {
-            rawClass = (Class) ((GenericArrayType) rawType).getGenericComponentType();
-            rawClass = Array.newInstance(rawClass, 0).getClass();
-        } else {
-            if (rawType instanceof ParameterizedType) {
-                rawType = (Class) ((ParameterizedType) rawType).getRawType();
-            }
-            rawClass = (Class) rawType;
-        }
-        return rawClass;
     }
 
     public void setJaxWsConfiguration(JaxWsServiceConfiguration jaxWsConfiguration) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBean.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ProviderServiceFactoryBean.java Wed Dec 20 00:07:54 2006
@@ -72,7 +72,7 @@
     }
 
     @Override
-    protected Endpoint createEndpoint(EndpointInfo ei) throws EndpointException  {
+    public Endpoint createEndpoint(EndpointInfo ei) throws EndpointException  {
         return new JaxWsEndpointImpl(getBus(), getService(), ei);
     }
     

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java Wed Dec 20 00:07:54 2006
@@ -21,7 +21,7 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.binding.BindingFactoryManager;
 import org.apache.cxf.binding.soap.SoapBindingFactory;
-import org.apache.cxf.binding.soap.SoapDestinationFactory;
+import org.apache.cxf.binding.soap.SoapTransportFactory;
 import org.apache.cxf.test.AbstractCXFTest;
 import org.apache.cxf.transport.ConduitInitiatorManager;
 import org.apache.cxf.transport.DestinationFactoryManager;
@@ -34,7 +34,7 @@
  */
 public abstract class AbstractJaxWsTest extends AbstractCXFTest {
 
-    LocalTransportFactory localTransport;
+    protected LocalTransportFactory localTransport;
 
     private Bus bus;
 
@@ -51,7 +51,7 @@
 
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
 
-        SoapDestinationFactory soapDF = new SoapDestinationFactory();
+        SoapTransportFactory soapDF = new SoapTransportFactory();
         soapDF.setBus(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java Wed Dec 20 00:07:54 2006
@@ -32,11 +32,12 @@
 
 import org.apache.cxf.Bus;
 
+import org.apache.cxf.frontend.ServerFactoryBean;
 import org.apache.cxf.jaxws.service.Hello;
 import org.apache.cxf.jaxws.service.HelloInterface;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.service.Service;
-import org.apache.cxf.service.factory.ServerFactoryBean;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.InterfaceInfo;
 import org.apache.cxf.transport.local.LocalTransportFactory;
@@ -81,7 +82,7 @@
     }
     
     private Definition createService(boolean wrapped) throws Exception {
-        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
 
         Bus bus = getBus();
         bean.setBus(bus);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java Wed Dec 20 00:07:54 2006
@@ -32,7 +32,7 @@
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.binding.BindingFactoryManager;
 import org.apache.cxf.binding.soap.SoapBindingFactory;
-import org.apache.cxf.binding.soap.SoapDestinationFactory;
+import org.apache.cxf.binding.soap.SoapTransportFactory;
 import org.apache.cxf.bus.cxf.CXFBusFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.configuration.Configurer;
@@ -86,7 +86,7 @@
         javax.xml.ws.Service service = new SOAPService();
         Greeter greeter = service.getPort(PORT_NAME, Greeter.class);
         
-        EndpointInvocationHandler eih = (EndpointInvocationHandler)Proxy.getInvocationHandler(greeter);
+        JaxWsClientProxy eih = (JaxWsClientProxy)Proxy.getInvocationHandler(greeter);
         Client client = eih.getClient();
         JaxWsEndpointImpl endpoint = (JaxWsEndpointImpl)client.getEndpoint();
         assertEquals("Unexpected bean name", PORT_NAME.toString(), endpoint.getBeanName());
@@ -150,7 +150,7 @@
         javax.xml.ws.Service service = new SOAPService();
         Greeter greeter = service.getPort(PORT_NAME, Greeter.class);
 
-        EndpointInvocationHandler eih = (EndpointInvocationHandler)Proxy.getInvocationHandler(greeter);
+        JaxWsClientProxy eih = (JaxWsClientProxy)Proxy.getInvocationHandler(greeter);
         Client client = eih.getClient();
         JaxWsEndpointImpl endpoint = (JaxWsEndpointImpl)client.getEndpoint();
         assertEquals("Unexpected bean name", PORT_NAME.toString(), endpoint.getBeanName());
@@ -320,7 +320,7 @@
             .registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bindingFactory);
 
         DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
-        SoapDestinationFactory soapDF = new SoapDestinationFactory();
+        SoapTransportFactory soapDF = new SoapTransportFactory();
         soapDF.setBus(bus);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
         dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/GreeterTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/GreeterTest.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/GreeterTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/GreeterTest.java Wed Dec 20 00:07:54 2006
@@ -24,9 +24,10 @@
 import org.w3c.dom.Node;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.frontend.ServerFactoryBean;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.service.Service;
-import org.apache.cxf.service.factory.ServerFactoryBean;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.invoker.BeanInvoker;
 import org.apache.cxf.transport.local.LocalTransportFactory;
 import org.apache.hello_world_soap_http.GreeterImpl;
@@ -43,7 +44,7 @@
     }
 
     public void testEndpoint() throws Exception {
-        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
         URL resource = getClass().getResource("/wsdl/hello_world.wsdl");
         assertNotNull(resource);        
         bean.setWsdlURL(resource);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java Wed Dec 20 00:07:54 2006
@@ -25,9 +25,10 @@
 import org.w3c.dom.Node;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.frontend.ServerFactoryBean;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.service.Service;
-import org.apache.cxf.service.factory.ServerFactoryBean;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.transport.local.LocalTransportFactory;
@@ -36,7 +37,7 @@
 
 public class HeaderTest extends AbstractJaxWsTest {
     public void testInvocation() throws Exception {
-        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
 
         Bus bus = getBus();
         bean.setBus(bus);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java Wed Dec 20 00:07:54 2006
@@ -19,9 +19,6 @@
 
 package org.apache.cxf.jaxws;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Proxy;
 import java.net.URL;
@@ -39,25 +36,25 @@
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.Service;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.factory.ServiceConstructionException;
 import org.apache.cxf.service.invoker.BeanInvoker;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.transport.Destination;
-import org.apache.cxf.transport.MessageObserver;
 import org.apache.hello_world_soap_http.BadRecordLitFault;
 import org.apache.hello_world_soap_http.Greeter;
 import org.apache.hello_world_soap_http.GreeterImpl;
 
 public class JaxWsClientTest extends AbstractJaxWsTest {
 
-    static String responseMessage;
     private final QName serviceName = new QName("http://apache.org/hello_world_soap_http",
                     "SOAPService");    
     private final QName portName = new QName("http://apache.org/hello_world_soap_http",
                     "SoapPort");
     private final String address = "http://localhost:9000/SoapContext/SoapPort";
+    private Destination d;
     @Override
     public void setUp() throws Exception {
         super.setUp();
@@ -65,8 +62,7 @@
         EndpointInfo ei = new EndpointInfo(null, "http://schemas.xmlsoap.org/soap/http");
         ei.setAddress(address);
 
-        Destination d = localTransport.getDestination(ei);
-        d.setMessageObserver(new EchoObserver());
+        d = localTransport.getDestination(ei);
     }
 
     public void testCreate() throws Exception {
@@ -103,7 +99,7 @@
     }
 
     public void testEndpoint() throws Exception {
-        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
         URL resource = getClass().getResource("/wsdl/hello_world.wsdl");
         assertNotNull(resource);
         bean.setWsdlURL(resource);
@@ -126,7 +122,10 @@
         bop = bop.getUnwrappedOperation();
         assertNotNull(bop);
 
-        responseMessage = "sayHiResponse.xml";
+        MessagePartInfo part = bop.getOutput().getMessageParts().get(0);
+        assertEquals(-1, part.getIndex());
+        
+        d.setMessageObserver(new MessageReplayObserver("sayHiResponse.xml"));
         Object ret[] = client.invoke(bop, new Object[0], null);
         assertNotNull(ret);
         assertEquals("Wrong number of return objects", 1, ret.length);
@@ -134,7 +133,7 @@
         // test fault handling
         bop = ei.getBinding().getOperation(new QName(namespace, "testDocLitFault"));
         bop = bop.getUnwrappedOperation();
-        responseMessage = "testDocLitFault.xml";
+        d.setMessageObserver(new MessageReplayObserver("testDocLitFault.xml"));
         try {
             client.invoke(bop, new Object[] {"BadRecordLitFault"}, null);
             fail("Should have returned a fault!");
@@ -142,7 +141,7 @@
             assertEquals("foo", fault.getFaultInfo().trim());
             assertEquals("Hadrian did it.", fault.getMessage());
         }
-        
+
         try {
             client.getEndpoint().getOutInterceptors().add(new NestedFaultThrower());
             client.getEndpoint().getOutInterceptors().add(new FaultThrower());
@@ -186,46 +185,4 @@
 
     }
 
-    static class EchoObserver implements MessageObserver {
-
-        public void onMessage(Message message) {
-            try {
-
-                InputStream in = message.getContent(InputStream.class);
-                while (in.available() > 0) {
-                    in.read();
-                }
-                
-                Conduit backChannel = message.getDestination().getBackChannel(message, null, null);
-
-                backChannel.send(message);
-
-                OutputStream out = message.getContent(OutputStream.class);
-                assertNotNull(out);
-                in = getClass().getResourceAsStream(responseMessage);
-                copy(in, out, 2045);
-
-                out.close();
-                in.close();
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    private static void copy(final InputStream input, final OutputStream output, final int bufferSize)
-        throws IOException {
-        try {
-            final byte[] buffer = new byte[bufferSize];
-
-            int n = input.read(buffer);
-            while (-1 != n) {
-                output.write(buffer, 0, n);
-                n = input.read(buffer);
-            }
-        } finally {
-            input.close();
-            output.close();
-        }
-    }
 }

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/MessageReplayObserver.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/MessageReplayObserver.java?view=auto&rev=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/MessageReplayObserver.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/MessageReplayObserver.java Wed Dec 20 00:07:54 2006
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.cxf.jaxws;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import junit.framework.Assert;
+
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.transport.MessageObserver;
+
+public class MessageReplayObserver implements MessageObserver {
+    String responseMessage;
+    
+    public MessageReplayObserver(String responseMessage) {
+        this.responseMessage = responseMessage;
+    }
+    
+    public void onMessage(Message message) {
+        try {
+
+            InputStream in = message.getContent(InputStream.class);
+            while (in.available() > 0) {
+                in.read();
+            }
+            
+            Conduit backChannel = message.getDestination().getBackChannel(message, null, null);
+
+            backChannel.send(message);
+
+            OutputStream out = message.getContent(OutputStream.class);
+            Assert.assertNotNull(out);
+            in = getClass().getResourceAsStream(responseMessage);
+            IOUtils.copy(in, out, 2045);
+
+            out.close();
+            in.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/MessageReplayObserver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/MessageReplayObserver.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/MessageReplayObserver.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceModelUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceModelUtilsTest.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceModelUtilsTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceModelUtilsTest.java Wed Dec 20 00:07:54 2006
@@ -34,6 +34,7 @@
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.service.Service;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.ServiceModelUtil;
@@ -44,7 +45,7 @@
    
     Message message;
     Exchange exchange;
-    JaxWsServiceFactoryBean bean;
+    ReflectionServiceFactoryBean bean;
     
     public void setUp() throws Exception {
         super.setUp();

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java Wed Dec 20 00:07:54 2006
@@ -27,11 +27,12 @@
 import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
+import org.apache.cxf.frontend.ServerFactoryBean;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.Service;
-import org.apache.cxf.service.factory.ServerFactoryBean;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.invoker.BeanInvoker;
 import org.apache.cxf.transport.local.LocalTransportFactory;
 import org.apache.hello_world_soap_http.GreeterImpl;
@@ -47,7 +48,7 @@
 
         bus = getBus();
 
-        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
         URL resource = getClass().getResource("/wsdl/hello_world.wsdl");
         assertNotNull(resource);
         bean.setWsdlURL(resource);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java Wed Dec 20 00:07:54 2006
@@ -37,6 +37,7 @@
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.service.Service;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.invoker.BeanInvoker;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
@@ -61,7 +62,7 @@
         message.setExchange(exchange);        
 
 
-        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
         URL resource = getClass().getResource("/wsdl/calculator.wsdl");
         assertNotNull(resource);
         bean.setWsdlURL(resource);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java?view=diff&rev=488948&r1=488947&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java Wed Dec 20 00:07:54 2006
@@ -36,6 +36,7 @@
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.service.Service;
+import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.invoker.BeanInvoker;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
@@ -60,7 +61,7 @@
         message.setExchange(exchange);        
 
 
-        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
         URL resource = getClass().getResource("/wsdl/hello_world_rpc_lit.wsdl");
         assertNotNull(resource);
         bean.setWsdlURL(resource);

Copied: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java (from r481634, incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java?view=diff&rev=488948&p1=incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java&r1=481634&p2=incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java&r2=488948
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/HeaderClientServerTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java Wed Dec 20 00:07:54 2006
@@ -17,24 +17,22 @@
  * under the License.
  */
 
-package org.apache.cxf.systest.jaxws;
+package org.apache.cxf.jaxws.header;
 
 
 
 import java.lang.reflect.UndeclaredThrowableException;
-
 import java.net.URL;
 
 import javax.xml.namespace.QName;
 import javax.xml.ws.Endpoint;
 import javax.xml.ws.Holder;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.cxf.systest.common.ClientServerSetupBase;
-import org.apache.cxf.systest.common.ClientServerTestBase;
-import org.apache.cxf.systest.common.TestServerBase;
+import org.apache.cxf.BusFactoryHelper;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jaxws.AbstractJaxWsTest;
+import org.apache.cxf.jaxws.EndpointImpl;
 import org.apache.header_test.SOAPHeaderService;
 import org.apache.header_test.TestHeader;
 import org.apache.header_test.TestHeaderImpl;
@@ -49,7 +47,7 @@
 import org.apache.header_test.types.TestHeader6Response;
 
 
-public class HeaderClientServerTest extends ClientServerTestBase {
+public class HeaderClientServerTest extends AbstractJaxWsTest {
 
     private final QName serviceName = new QName("http://apache.org/header_test",
                                                 "SOAPHeaderService");    
@@ -58,40 +56,18 @@
 
     private TestHeader proxy;
     
-    
-    public static class MyServer extends TestServerBase {
+    public void setUp() throws Exception {
+        super.setUp();
+        BusFactoryHelper.newInstance().setDefaultBus(getBus());
+        
+        Object implementor = new TestHeaderImpl();
+        String address = "http://localhost:9104/SoapHeaderContext/SoapHeaderPort";
+        EndpointImpl e = (EndpointImpl) Endpoint.publish(address, implementor);
         
-        protected void run()  {
-            Object implementor = new TestHeaderImpl();
-            String address = "http://localhost:9104/SoapHeaderContext/SoapHeaderPort";
-            Endpoint.publish(address, implementor);
-            
-        }
-        
-
-        public static void main(String[] args) {
-            try { 
-                MyServer s = new MyServer(); 
-                s.start();
-            } catch (Exception ex) {
-                ex.printStackTrace();
-                System.exit(-1);
-            } finally { 
-                System.out.println("done!");
-            }
-        }
+        e.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
+        e.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());
     }
     
-    public static Test suite() throws Exception {
-        TestSuite suite = new TestSuite(HeaderClientServerTest.class);
-        return new ClientServerSetupBase(suite) {
-            public void startServers() throws Exception {
-                assertTrue("server did not launch correctly", launchServer(MyServer.class));
-            }
-        };
-                       
-    }  
-
     public void testInHeader() throws Exception {
         URL wsdl = getClass().getResource("/wsdl/soapheader.wsdl");
         assertNotNull(wsdl);
@@ -203,32 +179,28 @@
         SOAPHeaderService service = new SOAPHeaderService(wsdl, serviceName);
         assertNotNull(service);
         proxy = service.getPort(portName, TestHeader.class);
-        
-        try {
-            TestHeader6 in = new TestHeader6();
-            String val = new String(TestHeader6.class.getSimpleName());
-            Holder<TestHeader3> inoutHeader = new Holder<TestHeader3>();
-            for (int idx = 0; idx < 2; idx++) {
-                val += idx;                
-                in.setRequestType(val);
-                inoutHeader.value = new TestHeader3();
-                TestHeader6Response returnVal = proxy.testHeaderPartBeforeBodyPart(inoutHeader, in);
-                //inoutHeader copied to return
-                //in copied to inoutHeader
-                assertNotNull(returnVal);
-                assertNull(returnVal.getResponseType());
-                assertEquals(val, inoutHeader.value.getRequestType());
-                
-                in.setRequestType(null);
-                inoutHeader.value.setRequestType(val);
-                returnVal = proxy.testHeaderPartBeforeBodyPart(inoutHeader, in);
-                assertNotNull(returnVal);
-                assertEquals(val, returnVal.getResponseType());
-                assertNull(inoutHeader.value.getRequestType());
-            }
-        } catch (UndeclaredThrowableException ex) {
-            throw (Exception)ex.getCause();
-        } 
+    
+        TestHeader6 in = new TestHeader6();
+        String val = new String(TestHeader6.class.getSimpleName());
+        Holder<TestHeader3> inoutHeader = new Holder<TestHeader3>();
+        for (int idx = 0; idx < 2; idx++) {
+            val += idx;                
+            in.setRequestType(val);
+            inoutHeader.value = new TestHeader3();
+            TestHeader6Response returnVal = proxy.testHeaderPartBeforeBodyPart(inoutHeader, in);
+            //inoutHeader copied to return
+            //in copied to inoutHeader
+            assertNotNull(returnVal);
+            assertNull(returnVal.getResponseType());
+            assertEquals(val, inoutHeader.value.getRequestType());
+            
+            in.setRequestType(null);
+            inoutHeader.value.setRequestType(val);
+            returnVal = proxy.testHeaderPartBeforeBodyPart(inoutHeader, in);
+            assertNotNull(returnVal);
+            assertEquals(val, returnVal.getResponseType());
+            assertNull(inoutHeader.value.getRequestType());
+        }
     }
 
     public static void main(String[] args) {

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderService.java?view=auto&rev=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderService.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderService.java Wed Dec 20 00:07:54 2006
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.cxf.jaxws.holder;
+
+import javax.jws.WebParam;
+import javax.jws.WebParam.Mode;
+import javax.jws.WebService;
+import javax.xml.ws.Holder;
+
+@WebService
+public interface HolderService {
+
+    String echo(String s1, String s2, @WebParam(mode = Mode.OUT)
+    Holder<String> outS2);
+
+    String echo2(String s1, @WebParam(mode = Mode.OUT)
+    Holder<String> outS2, String s2);
+
+    String echo3(@WebParam(mode = Mode.INOUT, header = true)
+    Holder<String> header, String s1);
+
+}

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderService.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderServiceImpl.java?view=auto&rev=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderServiceImpl.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderServiceImpl.java Wed Dec 20 00:07:54 2006
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.cxf.jaxws.holder;
+
+import javax.jws.WebParam;
+import javax.jws.WebParam.Mode;
+import javax.jws.WebService;
+import javax.xml.ws.Holder;
+
+
+@WebService(endpointInterface = "org.apache.cxf.jaxws.holder.HolderService")
+public class HolderServiceImpl implements HolderService {
+
+    public String echo(String s1, String s2, @WebParam(mode = Mode.OUT)
+    Holder<String> outS2) {
+        outS2.value = s2;
+        return s1;
+    }
+
+    public String echo2(String s1, @WebParam(mode = Mode.OUT)
+    Holder<String> outS2, String s2) {
+        outS2.value = s2;
+        return s1;
+    }
+
+    public String echo3(Holder<String> header, String s1) {
+        return s1;
+    }
+}

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderServiceImpl.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderTest.java (from r482349, incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HolderTest.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderTest.java?view=diff&rev=488948&p1=incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HolderTest.java&r1=482349&p2=incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderTest.java&r2=488948
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HolderTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/holder/HolderTest.java Wed Dec 20 00:07:54 2006
@@ -16,42 +16,72 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.cxf.jaxws;
+package org.apache.cxf.jaxws.holder;
+
+import javax.xml.ws.Holder;
 
 import org.w3c.dom.Node;
-import org.apache.cxf.Bus;
-import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
-import org.apache.cxf.mtom_xop.TestMtomImpl;
-import org.apache.cxf.service.Service;
-import org.apache.cxf.service.factory.ServerFactoryBean;
+
+import org.apache.cxf.jaxws.AbstractJaxWsTest;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.jaxws.MessageReplayObserver;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.Destination;
 import org.apache.cxf.transport.local.LocalTransportFactory;
 
+public class HolderTest extends AbstractJaxWsTest {
+    private final String address = "http://localhost:9000/HolderService";
 
+    public void testClient() throws Exception {
+        EndpointInfo ei = new EndpointInfo(null, "http://schemas.xmlsoap.org/soap/http");
+        ei.setAddress(address);
+
+        Destination d = localTransport.getDestination(ei);
+        d.setMessageObserver(new MessageReplayObserver("/org/apache/cxf/jaxws/holder/echoResponse.xml"));
+
+        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
+        factory.getClientFactoryBean().setServiceClass(HolderService.class);
+        factory.getClientFactoryBean().setBus(getBus());
+        factory.getClientFactoryBean().setAddress(address);
+
+        HolderService h = (HolderService)factory.create();
+        Holder<String> holder = new Holder<String>();
+        assertEquals("one", h.echo("one", "two", holder));
+        assertEquals("two", holder.value);
+    }
 
-public class HolderTest extends AbstractJaxWsTest {
-    public void testInvocation() throws Exception {
-        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+    public void testServer() throws Exception {
+        JaxWsServerFactoryBean svr = new JaxWsServerFactoryBean();
+        svr.setBus(getBus());
+        svr.setServiceBean(new HolderServiceImpl());
+        svr.setAddress(address);
+        svr.create();
 
-        Bus bus = getBus();
-        bean.setBus(bus);
-        bean.setServiceClass(TestMtomImpl.class);
-        
-        Service service = bean.create();
-        service.setInvoker(new JAXWSMethodInvoker(new TestMtomImpl()));
+        addNamespace("h", "http://holder.jaxws.cxf.apache.org");
+
+        Node response = invoke(address, LocalTransportFactory.TRANSPORT_ID, "echo.xml");
         
-        ServerFactoryBean svr = new ServerFactoryBean();
-        svr.setBus(bus);
-        svr.setServiceFactory(bean);
-        svr.create();
+        assertNotNull(response);
+        assertValid("//h:echoResponse/h:return[text()='one']", response);
+        assertValid("//h:echoResponse/h:outS2[text()='two']", response);
+        assertNoFault(response);
 
-        Node response = invoke("http://localhost:9036/mime-test",
-                               LocalTransportFactory.TRANSPORT_ID, 
-                               "echoData.xml");
-        addNamespace("h", "http://cxf.apache.org/mime/types");        
+        response = invoke(address, LocalTransportFactory.TRANSPORT_ID, "echo2.xml");
+
+        assertNotNull(response);
+        assertNoFault(response);
+        assertValid("//h:echo2Response/h:return[text()='one']", response);
+        assertValid("//h:echo2Response/h:outS2[text()='two']", response);
+        
+        // test holder with in/out header
+        response = invoke(address, LocalTransportFactory.TRANSPORT_ID, "echo3.xml");
         
-        assertValid("//h:name", response);        
-        assertValid("/s:Envelope/s:Body", response); 
         assertNotNull(response);
         assertNoFault(response);
+        assertValid("//h:echo3Response/h:return[text()='one']", response);
+        assertValid("//s:Header/h:header[text()='header']", response);
+
     }
+
 }



Mime
View raw message