Hello,
I've been looking at the CXF 2.1 restful_http_binding example and I'd like
to run it through Spring. Is there an example of how to do the following
through Spring:
private static void createRestService(Object serviceObj) {
// Build up the server factory bean
JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
sf.setServiceClass(CustomerService.class);
// Use the HTTP Binding which understands the Java Rest
Annotations
sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
sf.setAddress("http://localhost:8080/xml/");
sf.getServiceFactory().setInvoker(new BeanInvoker(serviceObj));
// Turn the "wrapped" style off. This means that CXF won't
generate
// wrapper XML elements and we'll have prettier XML text. This
// means that we need to stick to one request and one response
// parameter though.
sf.getServiceFactory().setWrapped(false);
sf.create();
}
I've looked at this URL:
http://cwiki.apache.org/CXF20DOC/jax-rs-jsr-311.html
Which is great, but a little confusing as the beans.xml file isn't very
well documented and I couldn't make the example work:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 15 in XML document from class path resource [cxf-server-context.xml]
is invalid; nested exception is org.xml.sax.SAXParseException:
cvc-complex-type.2.4.c: The matching wildcard is strict, but no
declaration can be found for element 'jaxrs:server'.
Caused by:
org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
wildcard is strict, but no declaration can be found for element
'jaxrs:server'.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown
Source)
But I suspect the beans.xml file isn't quite what I want to be copying.
So, im summary, can someone give me an example Spring context that will
setup the JaxWsServerFactoryBean
Thanks,
John
--
Web SSO
IT Infrastructure
Deutsche Bank London
URL: http://websso.cto.gt.intranet.db.com
---
This e-mail may contain confidential and/or privileged information. If you are
not the intended recipient (or have received this e-mail in error) please
notify the sender immediately and delete this e-mail. Any unauthorized copying,
disclosure or distribution of the material in this e-mail is strictly forbidden.
Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional
EU corporate and regulatory disclosures.