Hi John
You're probably not using CXF JAXRS implementation at this point ?
restful_http_binding shows CXF-specific HTTP binding in action, and it's
documented here
http://cwiki.apache.org/CXF20DOC/http-binding.html
JAX-RS demos are in the jaxrs subsection of the demos
Cheers, Sergey
Where can I find some more documentation on the Spring configuration file?
John Baker
--
Web SSO
IT Infrastructure
Deutsche Bank London
URL: http://websso.cto.gt.intranet.db.com
Vijay Allam <[EMAIL PROTECTED]>
28/04/2008 14:15
Please respond to
[email protected]
To
<[email protected]>
cc
Subject
Re: CXF 2.1, Rest and Spring configuration
Probably you must be missing 'cxf_tr_frontend_jaxrs' jar in the
classpath.
After adding to classpath. I had the same issue, after adding it to
classpath, it worked with Spring configuration as per the documentation.
--Vijay
On 4/28/08 9:12 AM, "John-M Baker" <[EMAIL PROTECTED]> wrote:
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.createSAXParseExce
ption(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
---
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.
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland