cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r747390 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ rt/frontend/jaxrs/src/main/java/org/a...
Date Tue, 24 Feb 2009 14:17:24 GMT
Author: sergeyb
Date: Tue Feb 24 14:17:23 2009
New Revision: 747390

URL: http://svn.apache.org/viewvc?rev=747390&view=rev
Log:
JAXRS: ProviderFactory cleanup, enhancing jaxrs:client

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java
    cxf/trunk/rt/frontend/jaxrs/src/main/resources/schemas/jaxrs.xsd
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
    cxf/trunk/systests/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java?rev=747390&r1=747389&r2=747390&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java Tue Feb 24 14:17:23 2009
@@ -18,6 +18,9 @@
  */
 package org.apache.cxf.jaxrs;
 
+import java.util.Collections;
+import java.util.List;
+
 import org.apache.cxf.BusException;
 import org.apache.cxf.binding.BindingConfiguration;
 import org.apache.cxf.binding.BindingFactory;
@@ -46,7 +49,9 @@
  */
 public class AbstractJAXRSFactoryBean extends AbstractEndpointFactory {
     
+    protected List<String> schemaLocations;
     protected JAXRSServiceFactoryBean serviceFactory;
+    protected List<?> entityProviders;
     
     protected AbstractJAXRSFactoryBean() {
         this(new JAXRSServiceFactoryBean());
@@ -159,5 +164,30 @@
         return ep;
     }
     
+    public void setSchemaLocation(String schema) {
+        setSchemaLocations(Collections.singletonList(schema));    
+    }
+    
+    public void setSchemaLocations(List<String> schemas) {
+        this.schemaLocations = schemas;    
+    }
+    
+    /**
+     * @return the entityProviders
+     */
+    public List<?> getProviders() {
+        return entityProviders;
+    }
+
+    /**
+     * @param entityProviders the entityProviders to set
+     */
+    public void setProviders(List<? extends Object> providers) {
+        this.entityProviders = providers;
+    }
+    
+    public void setProvider(Object provider) {
+        setProviders(Collections.singletonList(provider));
+    }
 
 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java?rev=747390&r1=747389&r2=747390&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java Tue Feb 24 14:17:23 2009
@@ -66,10 +66,8 @@
     private Invoker invoker;
     private boolean start = true;
     private List<Object> serviceBeans;
-    private List<?> entityProviders;
     private Map<Object, Object> languageMappings;
     private Map<Object, Object> extensionMappings;
-    private List<String> schemaLocations;
     
     public JAXRSServerFactoryBean() {
         this(new JAXRSServiceFactoryBean());
@@ -79,10 +77,6 @@
         super(sf);
     }
     
-    public void setSchemaLocations(List<String> schemas) {
-        this.schemaLocations = schemas;    
-    }
-    
     public void setStaticSubresourceResolution(boolean enableStatic) {
         serviceFactory.setEnableStaticResolution(enableStatic);
     }
@@ -112,15 +106,18 @@
             } else {
                 ep.getService().setInvoker(invoker);
             }
+            
             if (entityProviders != null) {
                 ProviderFactory.getInstance(getAddress()).setUserProviders(entityProviders); 
             }
-            ProviderFactory.getInstance(getAddress()).setRequestPreprocessor(
-                new RequestPreprocessor(languageMappings, extensionMappings));
             if (schemaLocations != null) {
                 ProviderFactory.getInstance(getAddress()).setSchemaLocations(schemaLocations);
             }
             
+            ProviderFactory.getInstance(getAddress()).setRequestPreprocessor(
+                new RequestPreprocessor(languageMappings, extensionMappings));
+            
+            
             if (start) {
                 server.start();
             }
@@ -160,14 +157,6 @@
         extensionMappings = extMaps;
     }
     
-    public JAXRSServiceFactoryBean getServiceFactory() {
-        return serviceFactory;
-    }
-
-    public void setServiceFactory(JAXRSServiceFactoryBean serviceFactory) {
-        this.serviceFactory = serviceFactory;
-    }
-    
     public List<Class> getResourceClasses() {
         return serviceFactory.getResourceClasses();
     }
@@ -199,20 +188,6 @@
         resourceProviders.put(c, rp);
     }
 
-    /**
-     * @return the entityProviders
-     */
-    public List<?> getProviders() {
-        return entityProviders;
-    }
-
-    /**
-     * @param entityProviders the entityProviders to set
-     */
-    public void setProviders(List<? extends Object> providers) {
-        this.entityProviders = providers;
-    }
-    
     public void setInvoker(Invoker invoker) {
         this.invoker = invoker;
     }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java?rev=747390&r1=747389&r2=747390&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java Tue Feb 24 14:17:23 2009
@@ -323,7 +323,7 @@
     }
 
     @SuppressWarnings("unchecked")
-    protected static void writeBody(Object o, Class<?> cls, Type type, Annotation[] anns, 
+    protected void writeBody(Object o, Message m, Class<?> cls, Type type, Annotation[] anns, 
         MultivaluedMap<String, String> headers, OutputStream os) {
         
         if (o == null) {
@@ -332,11 +332,15 @@
         
         MediaType contentType = MediaType.valueOf(headers.getFirst("Content-Type")); 
         
-        MessageBodyWriter mbr = ProviderFactory.getInstance().createMessageBodyWriter(
-            cls, type, anns, contentType, new MessageImpl());
-        if (mbr != null) {
+        MessageBodyWriter mbw = ProviderFactory.getInstance(baseURI.getPath()).createMessageBodyWriter(
+            cls, type, anns, contentType, m);
+        if (mbw == null) {
+            mbw = ProviderFactory.getInstance().createMessageBodyWriter(
+                      cls, type, anns, contentType, m);
+        }
+        if (mbw != null) {
             try {
-                mbr.writeTo(o, cls, type, anns, contentType, headers, os);
+                mbw.writeTo(o, cls, type, anns, contentType, headers, os);
                 os.flush();
             } catch (Exception ex) {
                 throw new WebApplicationException();
@@ -349,8 +353,8 @@
     }
     
     @SuppressWarnings("unchecked")
-    protected static Object readBody(Response r, HttpURLConnection conn, Class<?> cls, Type type, 
-                                     Annotation[] anns) {
+    protected Object readBody(Response r, HttpURLConnection conn, Message inMessage, 
+                              Class<?> cls, Type type, Annotation[] anns) {
 
         try {
             int status = conn.getResponseCode();
@@ -363,8 +367,12 @@
         
         MediaType contentType = getResponseContentType(r);
         
-        MessageBodyReader mbr = ProviderFactory.getInstance().createMessageBodyReader(
-            cls, type, anns, contentType, new MessageImpl());
+        MessageBodyReader mbr = ProviderFactory.getInstance(baseURI.getPath()).createMessageBodyReader(
+            cls, type, anns, contentType, inMessage);
+        if (mbr == null) {
+            ProviderFactory.getInstance().createMessageBodyReader(
+                cls, type, anns, contentType, inMessage);
+        }
         if (mbr != null) {
             try {
                 return mbr.readFrom(cls, type, anns, contentType, r.getMetadata(), conn.getInputStream());
@@ -441,6 +449,12 @@
         return new PhaseChainCache().get(pm.getInPhases(), i1, i2, i3);
     }
     
+    protected Message createSimpleMessage() {
+        Message m = new MessageImpl();
+        m.put(Message.PROTOCOL_HEADERS, getHeaders());
+        return m;
+    }
+    
     protected Message createMessage(String httpMethod, 
                                     MultivaluedMap<String, String> headers,
                                     String address) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java?rev=747390&r1=747389&r2=747390&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java Tue Feb 24 14:17:23 2009
@@ -175,20 +175,20 @@
         return index;
     }
     
-    private static void checkResponse(Method m, Response r) throws Throwable {
+    private static void checkResponse(String basePath, Method m, Response r) throws Throwable {
         
         int status = r.getStatus();
         
         if (status >= 400) {
             
-            ProviderFactory pf = ProviderFactory.getInstance();
-            for (Class<?> exType : m.getExceptionTypes()) {
-                ResponseExceptionMapper<?> mapper = pf.createResponseExceptionMapper(exType);
-                if (mapper != null) {
-                    Throwable t = mapper.fromResponse(r);
-                    if (t != null) {
-                        throw t;
-                    }
+            ResponseExceptionMapper<?> mapper = findExceptionMapper(m, basePath);
+            if (mapper == null) {
+                mapper = findExceptionMapper(m, "/");
+            }
+            if (mapper != null) {
+                Throwable t = mapper.fromResponse(r);
+                if (t != null) {
+                    throw t;
                 }
             }
             
@@ -196,6 +196,16 @@
         }
     }
     
+    private static ResponseExceptionMapper<?> findExceptionMapper(Method m, String base) {
+        ProviderFactory pf = ProviderFactory.getInstance(base);
+        for (Class<?> exType : m.getExceptionTypes()) {
+            ResponseExceptionMapper<?> mapper = pf.createResponseExceptionMapper(exType);
+            if (mapper != null) {
+                return mapper;
+            }
+        }
+        return null;
+    }
     
     private MultivaluedMap<String, String> setRequestHeaders(MultivaluedMap<String, String> headers,          
                                                              OperationResourceInfo ori,
@@ -355,22 +365,24 @@
 
         // TODO : we need to refactor bits of HTTPConduit such that it can be reused
         
+        Message message = createSimpleMessage();
+        
         HttpURLConnection connect = createHttpConnection(uri, ori.getHttpMethod());
         setAllHeaders(headers, connect);
         Method m = ori.getMethodToInvoke();
         if (bodyIndex != -1 || types.containsKey(ParameterType.FORM)) {
             if (bodyIndex != -1) {
-                writeBody(params[bodyIndex], params[bodyIndex].getClass(), 
+                writeBody(params[bodyIndex], message, params[bodyIndex].getClass(), 
                           m.getGenericParameterTypes()[bodyIndex],
                           m.getParameterAnnotations()[bodyIndex], headers, connect.getOutputStream());
             } else {
                 MultivaluedMap<String, String> form = handleForm(types, params);
-                writeBody(form, form.getClass(), form.getClass(), m.getDeclaredAnnotations(),
+                writeBody(form, message, form.getClass(), form.getClass(), m.getDeclaredAnnotations(),
                           headers, connect.getOutputStream());
             }
         }
         
-        return handleResponse(connect, ori);
+        return handleResponse(connect, message, ori);
         
     }
     
@@ -378,7 +390,7 @@
                           OperationResourceInfo ori, Object[] params, int bodyIndex, 
                           MultivaluedMap<ParameterType, Parameter> types) throws Throwable {
         Message m = createMessage(ori.getHttpMethod(), headers, uri.toString());
-        
+
         if (bodyIndex != -1 || types.containsKey(ParameterType.FORM)) {
             m.setContent(OperationResourceInfo.class, ori);
             m.put("BODY_INDEX", bodyIndex);
@@ -397,21 +409,20 @@
         
         // TODO : this needs to be done in an inbound chain instead
         HttpURLConnection connect = (HttpURLConnection)m.get(HTTPConduit.KEY_HTTP_CONNECTION);
-        
-        return handleResponse(connect, ori);
+        return handleResponse(connect, m, ori);
         
     }
     
-    protected Object handleResponse(HttpURLConnection connect, OperationResourceInfo ori) 
+    protected Object handleResponse(HttpURLConnection connect, Message inMessage, OperationResourceInfo ori) 
         throws Throwable {
         Response r = setResponseBuilder(connect).clone().build();
         Method method = ori.getMethodToInvoke();
-        checkResponse(method, r);
+        checkResponse(getBaseURI().getPath(), method, r);
         if (method.getReturnType() == Void.class) { 
             return null;
         }
         
-        return readBody(r, connect, method.getReturnType(), 
+        return readBody(r, connect, inMessage, method.getReturnType(), 
                         method.getGenericReturnType(), method.getDeclaredAnnotations());
     }
     
@@ -474,12 +485,12 @@
             Object body = objs.get(0);
             try {
                 if (bodyIndex != -1) {
-                    writeBody(body, body.getClass(), 
+                    writeBody(body, m, body.getClass(), 
                           method.getGenericParameterTypes()[bodyIndex],
                           method.getParameterAnnotations()[bodyIndex], headers, os);
                 } else {
-                    writeBody(body, body.getClass(), body.getClass(), method.getDeclaredAnnotations(),
-                            headers, os);
+                    writeBody(body, m, body.getClass(), body.getClass(), 
+                              method.getDeclaredAnnotations(), headers, os);
                 }
                 os.flush();
             } catch (Exception ex) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java?rev=747390&r1=747389&r2=747390&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java Tue Feb 24 14:17:23 2009
@@ -20,8 +20,10 @@
 
 import java.net.URI;
 import java.util.List;
+import java.util.Map;
 
 import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MultivaluedMap;
 
 import org.apache.cxf.common.util.ProxyHelper;
 import org.apache.cxf.endpoint.ConduitSelector;
@@ -30,12 +32,15 @@
 import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean;
 import org.apache.cxf.jaxrs.JAXRSServiceFactoryBean;
 import org.apache.cxf.jaxrs.JAXRSServiceImpl;
+import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.jaxrs.model.ClassResourceInfo;
+import org.apache.cxf.jaxrs.provider.ProviderFactory;
 import org.apache.cxf.service.Service;
 
 public class JAXRSClientFactoryBean extends AbstractJAXRSFactoryBean {
     
     private boolean inheritHeaders; 
+    private MultivaluedMap<String, String> headers;
     
     public JAXRSClientFactoryBean() {
         this(new JAXRSServiceFactoryBean());
@@ -59,6 +64,18 @@
         serviceFactory.setResourceClass(cls);
     }
     
+    public void setHeaders(Map<String, String> map) {
+        headers = new MetadataMap<String, String>();
+        for (Map.Entry<String, String> entry : map.entrySet()) {
+            String[] values = entry.getValue().split(",");
+            for (String v : values) {
+                if (v.length() != 0) {
+                    headers.add(entry.getKey(), v);
+                }
+            }
+        }
+    }
+    
     public WebClient createWebClient() {
         
         Service service = new JAXRSServiceImpl(getAddress());
@@ -67,10 +84,7 @@
         try {
             Endpoint ep = createEndpoint();
             WebClient client = new WebClient(getAddress());
-            client.setConduitSelector(getConduitSelector(ep));
-            client.setBus(getBus());
-            client.setOutInterceptors(getOutInterceptors());
-            client.setInInterceptors(getInInterceptors());
+            initClient(client, ep);
             
             return client;
         } catch (Exception ex) {
@@ -82,8 +96,6 @@
         return cls.cast(create());
     }
     
-    
-    
     public Client create() {
         List<ClassResourceInfo> list = serviceFactory.getClassResourceInfo();
         if (list.isEmpty()) {
@@ -96,10 +108,7 @@
             ClassResourceInfo cri = list.get(0);
             
             ClientProxyImpl proxyImpl = new ClientProxyImpl(baseURI, baseURI, cri, inheritHeaders);
-            proxyImpl.setConduitSelector(getConduitSelector(ep));
-            proxyImpl.setBus(getBus());
-            proxyImpl.setOutInterceptors(getOutInterceptors());
-            proxyImpl.setInInterceptors(getInInterceptors());
+            initClient(proxyImpl, ep);    
             
             return (Client)ProxyHelper.getProxy(cri.getServiceClass().getClassLoader(),
                                         new Class[]{cri.getServiceClass(), Client.class}, 
@@ -118,4 +127,19 @@
         return cs;
     }
     
+    protected void initClient(AbstractClient client, Endpoint ep) {
+        client.setConduitSelector(getConduitSelector(ep));
+        client.setBus(getBus());
+        client.setOutInterceptors(getOutInterceptors());
+        client.setInInterceptors(getInInterceptors());
+        if (headers != null) {
+            client.headers(headers);
+        }
+        if (entityProviders != null) {
+            ProviderFactory.getInstance().setUserProviders(entityProviders); 
+        }
+        if (schemaLocations != null) {
+            ProviderFactory.getInstance().setSchemaLocations(schemaLocations);
+        }
+    }
 } 

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java?rev=747390&r1=747389&r2=747390&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java Tue Feb 24 14:17:23 2009
@@ -391,15 +391,16 @@
         HttpURLConnection conn = getConnection(httpMethod);
         
         setAllHeaders(headers, conn);
+        Message message = createSimpleMessage();
         if (body != null) {
             try {
-                writeBody(body, body.getClass(), body.getClass(), 
+                writeBody(body, message, body.getClass(), body.getClass(), 
                       new Annotation[]{}, headers, conn.getOutputStream());
             } catch (IOException ex) {
                 throw new WebApplicationException(ex);
             }
         }
-        return handleResponse(conn, responseClass);
+        return handleResponse(conn, message, responseClass);
     }
     
     protected Response doChainedInvocation(String httpMethod, 
@@ -421,14 +422,14 @@
         
         // TODO : this needs to be done in an inbound chain instead
         HttpURLConnection connect = (HttpURLConnection)m.get(HTTPConduit.KEY_HTTP_CONNECTION);
-        return handleResponse(connect, responseClass);
+        return handleResponse(connect, m, responseClass);
     }
     
-    protected Response handleResponse(HttpURLConnection conn, Class<?> responseClass) {
+    protected Response handleResponse(HttpURLConnection conn, Message m, Class<?> responseClass) {
         try {
             ResponseBuilder rb = setResponseBuilder(conn).clone();
             Response currentResponse = rb.clone().build();
-            Object entity = readBody(currentResponse, conn, responseClass, responseClass,
+            Object entity = readBody(currentResponse, conn, m, responseClass, responseClass,
                                      new Annotation[]{});
             rb.entity(entity);
             
@@ -462,7 +463,7 @@
             MultivaluedMap<String, String> headers = (MultivaluedMap)m.get(Message.PROTOCOL_HEADERS);
             Object body = objs.get(0);
             try {
-                writeBody(body, body.getClass(), body.getClass(), new Annotation[]{}, headers, os);
+                writeBody(body, m, body.getClass(), body.getClass(), new Annotation[]{}, headers, os);
                 os.flush();
             } catch (Exception ex) {
                 throw new Fault(ex);

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java?rev=747390&r1=747389&r2=747390&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java Tue Feb 24 14:17:23 2009
@@ -53,57 +53,41 @@
     
     private static final Map<String, ProviderFactory> FACTORIES = 
         new HashMap<String, ProviderFactory>();
+    private static final ProviderFactory SHARED_FACTORY = new ProviderFactory();
     private static final ProviderFactory DEFAULT_FACTORY = new ProviderFactory(); 
     private static final String SLASH = "/"; 
     
-    private List<ProviderInfo<MessageBodyReader>> defaultMessageReaders = 
+    static {
+        SHARED_FACTORY.setProviders(new JAXBElementProvider(),
+                                    new JSONProvider(),
+                                    new BinaryDataProvider(),
+                                    new SourceProvider(),
+                                    new FormEncodingProvider(),
+                                    new PrimitiveTextProvider(),
+                                    new ActivationProvider(),
+                                    new WebApplicationExceptionMapper(),
+                                    new MappingsHandler());
+    }
+    
+    private List<ProviderInfo<MessageBodyReader>> messageReaders = 
         new ArrayList<ProviderInfo<MessageBodyReader>>();
-    private List<ProviderInfo<MessageBodyWriter>> defaultMessageWriters = 
+    private List<ProviderInfo<MessageBodyWriter>> messageWriters = 
         new ArrayList<ProviderInfo<MessageBodyWriter>>();
-    private List<ProviderInfo<MessageBodyReader>> userMessageReaders = 
-        new ArrayList<ProviderInfo<MessageBodyReader>>(1);
-    private List<ProviderInfo<MessageBodyWriter>> userMessageWriters = 
-        new ArrayList<ProviderInfo<MessageBodyWriter>>(1);
-    private List<ProviderInfo<ContextResolver>> userContextResolvers = 
+    private List<ProviderInfo<ContextResolver>> contextResolvers = 
         new ArrayList<ProviderInfo<ContextResolver>>(1);
-    private List<ProviderInfo<ExceptionMapper>> defaultExceptionMappers = 
-        new ArrayList<ProviderInfo<ExceptionMapper>>(1);
-    private List<ProviderInfo<ExceptionMapper>> userExceptionMappers = 
+    private List<ProviderInfo<ExceptionMapper>> exceptionMappers = 
         new ArrayList<ProviderInfo<ExceptionMapper>>(1);
     private List<ProviderInfo<RequestHandler>> requestHandlers = 
         new ArrayList<ProviderInfo<RequestHandler>>(1);
     private List<ProviderInfo<ResponseHandler>> responseHandlers = 
         new ArrayList<ProviderInfo<ResponseHandler>>(1);
-    private List<ProviderInfo<ParameterHandler>> jaxrsParamHandlers = 
+    private List<ProviderInfo<ParameterHandler>> paramHandlers = 
         new ArrayList<ProviderInfo<ParameterHandler>>(1);
-    private List<ProviderInfo<ResponseExceptionMapper>> userResponseExceptionMappers = 
+    private List<ProviderInfo<ResponseExceptionMapper>> responseExceptionMappers = 
         new ArrayList<ProviderInfo<ResponseExceptionMapper>>(1);
     private RequestPreprocessor requestPreprocessor;
     
     private ProviderFactory() {
-        // TODO : this needs to be done differently,
-        // we need to use cxf-jaxrs-extensions
-        
-        // TODO : make sure the default providers are shared between multiple
-        // factories
-        
-        setProviders(defaultMessageReaders,
-                     defaultMessageWriters,
-                     userContextResolvers,
-                     requestHandlers,
-                     responseHandlers,
-                     defaultExceptionMappers,
-                     jaxrsParamHandlers,
-                     userResponseExceptionMappers,
-                     new JAXBElementProvider(),
-                     new JSONProvider(),
-                     new BinaryDataProvider(),
-                     new SourceProvider(),
-                     new FormEncodingProvider(),
-                     new PrimitiveTextProvider(),
-                     new ActivationProvider(),
-                     new WebApplicationExceptionMapper(),
-                     new MappingsHandler());
     }
     
     public static ProviderFactory getInstance() {
@@ -126,10 +110,15 @@
         return pf;
     }
 
+    public static ProviderFactory getSharedInstance() {
+        return SHARED_FACTORY;
+    }
+    
     public <T> ContextResolver<T> createContextResolver(Type contextType, 
                                                         Message m) {
-        // TODO : get media type from message  
-        return createContextResolver(contextType, m, null);
+        Object mt = m.get(Message.CONTENT_TYPE);
+        return createContextResolver(contextType, m,
+               mt == null ? MediaType.valueOf("*/*") : MediaType.valueOf(mt.toString()));
         
     }
     
@@ -137,7 +126,7 @@
     public <T> ContextResolver<T> createContextResolver(Type contextType, 
                                                         Message m,
                                                         MediaType type) {
-        for (ProviderInfo<ContextResolver> cr : userContextResolvers) {
+        for (ProviderInfo<ContextResolver> cr : contextResolvers) {
             Type[] types = cr.getProvider().getClass().getGenericInterfaces();
             for (Type t : types) {
                 if (t instanceof ParameterizedType) {
@@ -160,25 +149,21 @@
     
     public <T extends Throwable> ExceptionMapper<T> createExceptionMapper(Class<?> exceptionType, Message m) {
         
-        ExceptionMapper<T> mapper = doCreateExceptionMapper(userExceptionMappers,
-                                                            exceptionType,
-                                                            m);
-        if (mapper != null) {
+        ExceptionMapper<T> mapper = doCreateExceptionMapper(exceptionType, m);
+        if (mapper != null || this == SHARED_FACTORY) {
             return mapper;
         }
         
-        return doCreateExceptionMapper(defaultExceptionMappers,
-                                       exceptionType,
-                                       m);
+        return SHARED_FACTORY.createExceptionMapper(exceptionType, m);
     }
     
     @SuppressWarnings("unchecked")
-    private static <T extends Throwable> ExceptionMapper<T> doCreateExceptionMapper(
-        List<ProviderInfo<ExceptionMapper>> mappers, Class<?> exceptionType, Message m) {
+    private <T extends Throwable> ExceptionMapper<T> doCreateExceptionMapper(
+        Class<?> exceptionType, Message m) {
         
         List<ExceptionMapper<T>> candidates = new LinkedList<ExceptionMapper<T>>();
         
-        for (ProviderInfo<ExceptionMapper> em : mappers) {
+        for (ProviderInfo<ExceptionMapper> em : exceptionMappers) {
             handleMapper((List)candidates, em, exceptionType, m);
         }
         if (candidates.size() == 0) {
@@ -193,7 +178,7 @@
         
         List<ParameterHandler<T>> candidates = new LinkedList<ParameterHandler<T>>();
         
-        for (ProviderInfo<ParameterHandler> em : jaxrsParamHandlers) {
+        for (ProviderInfo<ParameterHandler> em : paramHandlers) {
             handleMapper((List)candidates, em, paramType, null);
         }
         if (candidates.size() == 0) {
@@ -209,7 +194,7 @@
         
         List<ResponseExceptionMapper<T>> candidates = new LinkedList<ResponseExceptionMapper<T>>();
         
-        for (ProviderInfo<ResponseExceptionMapper> em : userResponseExceptionMappers) {
+        for (ProviderInfo<ResponseExceptionMapper> em : responseExceptionMappers) {
             handleMapper((List)candidates, em, paramType, null);
         }
         if (candidates.size() == 0) {
@@ -247,31 +232,31 @@
                                                             MediaType mediaType,
                                                             Message m) {
         // Try user provided providers
-        MessageBodyReader<T> mr = chooseMessageReader(userMessageReaders, 
-                                                      bodyType,
+        MessageBodyReader<T> mr = chooseMessageReader(bodyType,
                                                       parameterType,
                                                       parameterAnnotations,
                                                       mediaType,
                                                       m);
         
         //If none found try the default ones
-        if (mr == null) {
-            mr = chooseMessageReader(defaultMessageReaders,
-                                     bodyType,
-                                     parameterType,
-                                     parameterAnnotations,
-                                     mediaType,
-                                     m);
-        }     
-        
-        return mr;
+        if (mr != null ||  this == SHARED_FACTORY) {
+            return mr;
+        }
+        return SHARED_FACTORY.createMessageBodyReader(bodyType, parameterType, 
+                                                        parameterAnnotations, mediaType, m);
     }
     
     
     
     public List<ProviderInfo<RequestHandler>> getRequestHandlers() {
-        
-        return Collections.unmodifiableList(requestHandlers);
+        if (requestHandlers.size() == 0) {
+            return Collections.unmodifiableList(SHARED_FACTORY.requestHandlers);
+        } else {
+            List<ProviderInfo<RequestHandler>> handlers = 
+                new ArrayList<ProviderInfo<RequestHandler>>(SHARED_FACTORY.requestHandlers);
+            handlers.addAll(requestHandlers);
+            return handlers;
+        }
     }
     
     public List<ProviderInfo<ResponseHandler>> getResponseHandlers() {
@@ -285,64 +270,50 @@
                                                             MediaType mediaType,
                                                             Message m) {
         // Try user provided providers
-        MessageBodyWriter<T> mw = chooseMessageWriter(userMessageWriters,
-                                                      bodyType,
+        MessageBodyWriter<T> mw = chooseMessageWriter(bodyType,
                                                       parameterType,
                                                       parameterAnnotations,
                                                       mediaType,
                                                       m);
         
         //If none found try the default ones
-        if (mw == null) {
-            mw = chooseMessageWriter(defaultMessageWriters,
-                                     bodyType,
-                                     parameterType,
-                                     parameterAnnotations,
-                                     mediaType,
-                                     m);
-        }     
-        
-        return mw;
+        if (mw != null || this == SHARED_FACTORY) {
+            return mw;
+        }
+        return SHARED_FACTORY.createMessageBodyWriter(bodyType, parameterType, 
+                                                        parameterAnnotations, mediaType, m);
     }
     
 //CHECKSTYLE:OFF       
-    private void setProviders(List<ProviderInfo<MessageBodyReader>> readers, 
-                              List<ProviderInfo<MessageBodyWriter>> writers,
-                              List<ProviderInfo<ContextResolver>> resolvers,
-                              List<ProviderInfo<RequestHandler>> requestFilters,
-                              List<ProviderInfo<ResponseHandler>> responseFilters,
-                              List<ProviderInfo<ExceptionMapper>> excMappers,
-                              List<ProviderInfo<ParameterHandler>> paramHandlers,
-                              List<ProviderInfo<ResponseExceptionMapper>> responseExcMappers,
-                              Object... providers) {
+    private void setProviders(Object... providers) {
         
         for (Object o : providers) {
             if (MessageBodyReader.class.isAssignableFrom(o.getClass())) {
-                readers.add(new ProviderInfo<MessageBodyReader>((MessageBodyReader)o)); 
+                messageReaders.add(new ProviderInfo<MessageBodyReader>((MessageBodyReader)o)); 
             }
             
             if (MessageBodyWriter.class.isAssignableFrom(o.getClass())) {
-                writers.add(new ProviderInfo<MessageBodyWriter>((MessageBodyWriter)o)); 
+                messageWriters.add(new ProviderInfo<MessageBodyWriter>((MessageBodyWriter)o)); 
             }
             
             if (ContextResolver.class.isAssignableFrom(o.getClass())) {
-                resolvers.add(new ProviderInfo<ContextResolver>((ContextResolver)o)); 
+                contextResolvers.add(new ProviderInfo<ContextResolver>((ContextResolver)o)); 
             }
             
             if (RequestHandler.class.isAssignableFrom(o.getClass())) {
-                requestFilters.add(new ProviderInfo<RequestHandler>((RequestHandler)o)); 
+                requestHandlers.add(new ProviderInfo<RequestHandler>((RequestHandler)o)); 
             }
             
             if (ResponseHandler.class.isAssignableFrom(o.getClass())) {
-                responseFilters.add(new ProviderInfo<ResponseHandler>((ResponseHandler)o)); 
+                responseHandlers.add(new ProviderInfo<ResponseHandler>((ResponseHandler)o)); 
             }
             
             if (ExceptionMapper.class.isAssignableFrom(o.getClass())) {
-                excMappers.add(new ProviderInfo<ExceptionMapper>((ExceptionMapper)o)); 
+                exceptionMappers.add(new ProviderInfo<ExceptionMapper>((ExceptionMapper)o)); 
             }
             
             if (ResponseExceptionMapper.class.isAssignableFrom(o.getClass())) {
-                responseExcMappers.add(new ProviderInfo<ResponseExceptionMapper>((ResponseExceptionMapper)o)); 
+                responseExceptionMappers.add(new ProviderInfo<ResponseExceptionMapper>((ResponseExceptionMapper)o)); 
             }
             
             if (ParameterHandler.class.isAssignableFrom(o.getClass())) {
@@ -350,10 +321,11 @@
             }
         }
         
-        sortReaders(readers);
-        sortWriters(writers);
+        sortReaders();
+        sortWriters();
         
-        injectContexts(readers, writers, resolvers, requestFilters, responseFilters, excMappers);
+        injectContexts(messageReaders, messageWriters, contextResolvers, requestHandlers, responseHandlers,
+                       exceptionMappers);
     }
 //CHECKSTYLE:ON
     
@@ -373,12 +345,12 @@
      * provider that lists *. Quality parameter values are also used such that
      * x/y;q=1.0 < x/y;q=0.7.
      */    
-    private void sortReaders(List<ProviderInfo<MessageBodyReader>> entityProviders) {
-        Collections.sort(entityProviders, new MessageBodyReaderComparator());
+    private void sortReaders() {
+        Collections.sort(messageReaders, new MessageBodyReaderComparator());
     }
     
-    private void sortWriters(List<ProviderInfo<MessageBodyWriter>> entityProviders) {
-        Collections.sort(entityProviders, new MessageBodyWriterComparator());
+    private void sortWriters() {
+        Collections.sort(messageWriters, new MessageBodyWriterComparator());
     }
     
         
@@ -394,14 +366,12 @@
      * @return
      */
     @SuppressWarnings("unchecked")
-    private <T> MessageBodyReader<T> chooseMessageReader(
-                                 List<ProviderInfo<MessageBodyReader>> readers, 
-                                                         Class<T> type,
+    private <T> MessageBodyReader<T> chooseMessageReader(Class<T> type,
                                                          Type genericType,
                                                          Annotation[] annotations,
                                                          MediaType mediaType,
                                                          Message m) {
-        for (ProviderInfo<MessageBodyReader> ep : readers) {
+        for (ProviderInfo<MessageBodyReader> ep : messageReaders) {
             
             if (matchesReaderCriterias(ep.getProvider(), type, genericType, annotations, mediaType)) {
                 InjectionUtils.injectContextFields(ep.getProvider(), ep, m);
@@ -443,14 +413,12 @@
      * @return
      */
     @SuppressWarnings("unchecked")
-    private <T> MessageBodyWriter<T> chooseMessageWriter(
-                          List<ProviderInfo<MessageBodyWriter>> writers, 
-                                                         Class<T> type,
+    private <T> MessageBodyWriter<T> chooseMessageWriter(Class<T> type,
                                                          Type genericType,
                                                          Annotation[] annotations,
                                                          MediaType mediaType,
                                                          Message m) {
-        for (ProviderInfo<MessageBodyWriter> ep : writers) {
+        for (ProviderInfo<MessageBodyWriter> ep : messageWriters) {
             if (matchesWriterCriterias(ep.getProvider(), type, genericType, annotations, mediaType)) {
                 InjectionUtils.injectContextFields(ep.getProvider(), ep, m);
                 InjectionUtils.injectContextMethods(ep.getProvider(), ep, m);
@@ -481,24 +449,16 @@
         
     }
     
-    List<ProviderInfo<MessageBodyReader>> getDefaultMessageReaders() {
-        return Collections.unmodifiableList(defaultMessageReaders);
+    List<ProviderInfo<MessageBodyReader>> getMessageReaders() {
+        return Collections.unmodifiableList(messageReaders);
     }
 
-    List<ProviderInfo<MessageBodyWriter>> getDefaultMessageWriters() {
-        return Collections.unmodifiableList(defaultMessageWriters);
-    }
-    
-    List<ProviderInfo<MessageBodyReader>> getUserMessageReaders() {
-        return Collections.unmodifiableList(userMessageReaders);
+    List<ProviderInfo<MessageBodyWriter>> getMessageWriters() {
+        return Collections.unmodifiableList(messageWriters);
     }
     
-    List<ProviderInfo<MessageBodyWriter>> getUserMessageWriters() {
-        return Collections.unmodifiableList(userMessageWriters);
-    }
-    
-    List<ProviderInfo<ContextResolver>> getUserContextResolvers() {
-        return Collections.unmodifiableList(userContextResolvers);
+    List<ProviderInfo<ContextResolver>> getContextResolvers() {
+        return Collections.unmodifiableList(contextResolvers);
     }
     
      
@@ -510,15 +470,7 @@
      * @param entityProviders the entityProviders to set
      */
     public void setUserProviders(List<?> userProviders) {
-        setProviders(userMessageReaders,
-                     userMessageWriters,
-                     userContextResolvers,
-                     requestHandlers,
-                     responseHandlers,
-                     userExceptionMappers,
-                     jaxrsParamHandlers,
-                     userResponseExceptionMappers,
-                     userProviders.toArray());
+        setProviders(userProviders.toArray());
     }
 
     private static class MessageBodyReaderComparator 
@@ -565,14 +517,12 @@
     }
     
     public void clearThreadLocalProxies() {
-        clearProxies(defaultMessageReaders,
-                     defaultMessageWriters,
-                     userMessageReaders,
-                     userMessageWriters,
-                     userContextResolvers,
+        clearProxies(messageReaders,
+                     messageWriters,
+                     contextResolvers,
                      requestHandlers,
                      responseHandlers,
-                     userExceptionMappers);
+                     exceptionMappers);
     }
     
     void clearProxies(List<?> ...lists) {
@@ -585,23 +535,18 @@
     }
     
     void clearProviders() {
-        userMessageReaders.clear();
-        userMessageWriters.clear();
-        userContextResolvers.clear();
-        userExceptionMappers.clear();
+        messageReaders.clear();
+        messageWriters.clear();
+        contextResolvers.clear();
+        exceptionMappers.clear();
         requestHandlers.clear();
         responseHandlers.clear();
-        jaxrsParamHandlers.clear();
+        paramHandlers.clear();
+        responseExceptionMappers.clear();
     }
     
     public void setSchemaLocations(List<String> schemas) {
-        setSchemasOnProviders(userMessageReaders, schemas);
-        setSchemasOnProviders(defaultMessageReaders, schemas);
-    }
-    
-    private void setSchemasOnProviders(List<ProviderInfo<MessageBodyReader>> providers,
-                                       List<String> schemas) {
-        for (ProviderInfo<MessageBodyReader> r : providers) {
+        for (ProviderInfo<MessageBodyReader> r : messageReaders) {
             try {
                 Method m = r.getProvider().getClass().getMethod("setSchemas", 
                                                      new Class[]{List.class});

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java?rev=747390&r1=747389&r2=747390&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java Tue Feb 24 14:17:23 2009
@@ -66,7 +66,7 @@
 
     @Override
     protected void mapElement(ParserContext ctx, BeanDefinitionBuilder bean, Element el, String name) {
-        if ("properties".equals(name)) {
+        if ("properties".equals(name) || "headers".equals(name)) {
             Map map = ctx.getDelegate().parseMapElement(el, bean.getBeanDefinition());
             bean.addPropertyValue(name, map);
         } else if ("executor".equals(name)) {
@@ -79,7 +79,8 @@
             || "outInterceptors".equals(name) || "outFaultInterceptors".equals(name)) {
             List list = ctx.getDelegate().parseListElement(el, bean.getBeanDefinition());
             bean.addPropertyValue(name, list);
-        } else if ("features".equals(name) || "providers".equals(name)) {
+        } else if ("features".equals(name) || "providers".equals(name)
+                   || "schemaLocations".equals(name)) {
             List list = ctx.getDelegate().parseListElement(el, bean.getBeanDefinition());
             bean.addPropertyValue(name, list);
         } else {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/resources/schemas/jaxrs.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/resources/schemas/jaxrs.xsd?rev=747390&r1=747389&r2=747390&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/resources/schemas/jaxrs.xsd (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/resources/schemas/jaxrs.xsd Tue Feb 24 14:17:23 2009
@@ -70,7 +70,6 @@
       <xsd:complexContent>
         <xsd:extension base="beans:identifiedType">
           <xsd:all>
-            <xsd:element name="binding" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="executor" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="features" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0"/>
@@ -80,10 +79,13 @@
             <xsd:element name="outFaultInterceptors" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="properties" type="beans:mapType" minOccurs="0"/>
             <xsd:element name="providers" type="xsd:anyType" minOccurs="0"/>
+            <xsd:element name="headers" type="xsd:anyType" minOccurs="0"/> 
+            <xsd:element name="schemaLocations" type="schemasType" minOccurs="0"/>
           </xsd:all>
           <xsd:attributeGroup ref="cxf-beans:beanAttributes"/>
           <xsd:attribute name="address" type="xsd:string" />
           <xsd:attribute name="serviceClass" type="xsd:string"/>
+          <xsd:attribute name="inheritHeaders" type="xsd:boolean"/>
           <xsd:attribute name="bus" type="xsd:string" />
         </xsd:extension>
       </xsd:complexContent>

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java?rev=747390&r1=747389&r2=747390&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java Tue Feb 24 14:17:23 2009
@@ -123,12 +123,12 @@
         pf.registerUserProvider(new TestStringProvider());
         pf.registerUserProvider(new PrimitiveTextProvider());
         
-        List<ProviderInfo<MessageBodyReader>> readers = pf.getUserMessageReaders();
+        List<ProviderInfo<MessageBodyReader>> readers = pf.getMessageReaders();
 
         assertTrue(indexOf(readers, TestStringProvider.class) 
                    < indexOf(readers, PrimitiveTextProvider.class));
         
-        List<ProviderInfo<MessageBodyWriter>> writers = pf.getUserMessageWriters();
+        List<ProviderInfo<MessageBodyWriter>> writers = pf.getMessageWriters();
 
         assertTrue(indexOf(writers, TestStringProvider.class) 
                    < indexOf(writers, PrimitiveTextProvider.class));
@@ -156,12 +156,12 @@
         json2.setProduceMediaTypes(Collections.singletonList("application/sbc"));
         pf.registerUserProvider(json2);
         
-        List<ProviderInfo<MessageBodyReader>> readers = pf.getUserMessageReaders();
+        List<ProviderInfo<MessageBodyReader>> readers = pf.getMessageReaders();
 
         assertTrue(indexOf(readers, json2) 
                    < indexOf(readers, json1));
         
-        List<ProviderInfo<MessageBodyWriter>> writers = pf.getUserMessageWriters();
+        List<ProviderInfo<MessageBodyWriter>> writers = pf.getMessageWriters();
 
         assertTrue(indexOf(writers, json1) 
                    < indexOf(writers, json2));

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java?rev=747390&r1=747389&r2=747390&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java Tue Feb 24 14:17:23 2009
@@ -49,6 +49,7 @@
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class JAXRSSoapBookTest extends AbstractBusClientServerTestBase {
@@ -56,7 +57,7 @@
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly", 
-                   launchServer(BookServerRestSoap.class));
+                   launchServer(BookServerRestSoap.class, true));
     }
     
     @Test
@@ -358,6 +359,7 @@
         return (Book)u.unmarshal(is);
     }
     
+    @Ignore
     public static class TestResponseExceptionMapper implements ResponseExceptionMapper<BookNotFoundFault> {
         
         public TestResponseExceptionMapper() {

Modified: cxf/trunk/systests/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml?rev=747390&r1=747389&r2=747390&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml (original)
+++ cxf/trunk/systests/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml Tue Feb 24 14:17:23 2009
@@ -37,7 +37,12 @@
 
   <jaxrs:client id="restClient"
          address="http://localhost:9092/test/services/rest"
-         serviceClass="org.apache.cxf.systest.jaxrs.BookStoreJaxrsJaxws"/>
+         serviceClass="org.apache.cxf.systest.jaxrs.BookStoreJaxrsJaxws"
+         inheritHeaders="true">
+         <jaxrs:headers>
+             <entry key="Accept" value="text/xml"/>
+         </jaxrs:headers>
+  </jaxrs:client>       
          
   <bean id="bookstore" class="org.apache.cxf.systest.jaxrs.BookStoreSoapRestImpl"/>
 



Mime
View raw message