So this is from my beans.xml file:

  <jaxrs:server 
    id="cxf.server.rest.ApplicationConfigurationService" 
    address="/rest">
    <jaxrs:serviceBeans>
      <bean 
class="com.db.websso.rest.server.ApplicationConfigurationServiceImpl" />
    </jaxrs:serviceBeans>
  </jaxrs:server> 

I'm pretty sure it's working, as I've copied it from Sergey's post and I 
can see log output that suggests requests are being passed to jaxrs. 

If my context is called 'test', and the serrvice is called 'configuration' 
(the class [EMAIL PROTECTED]("/configuration/")) with an operation called 'get' 
that accepts a parameter, I'd expect this to work:

http://localhost:8080/test/rest/configuration/get/moo/

But it doesn't - the following is returned to the browser:

<ns1:XMLFault><ns1:faultstring>
.No operation matching request path /configuration/get/moo/ is found, 
ContentType : */*, Accept : 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5.
</ns1:faultstring></ns1:XMLFault>

If I remove rest, the request isn't directed to CXF. Now if I were to call 
/configuration/get/moo/ through the standalone server, it works correctly.

Thoughts?


John Baker
-- 
Web SSO 
IT Infrastructure 
Deutsche Bank London

URL:  http://websso.cto.gt.intranet.db.com




jpurcell <[EMAIL PROTECTED]> 
29/04/2008 15:58
Please respond to
[email protected]


To
[email protected]
cc

Subject
Re: CXF 2.1, Rest and Spring configuration







Can you add this to your request header?

Accept: application/xml


John-M Baker wrote:
> 
> Excellent! Sorry, I should have spotted that.
> 
> As a matter of interest, when I run the standalone server client, 
> responses are in this format:
> 
> {"applicationConfiguration":{"id":"moo","name":"John's application"}}
> 
> But I was expecting XML responses. The server is being created like 
this:
> 
>       JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
>       sf.setResourceClasses(ApplicationConfigurationService.class);
>       sf.setResourceProvider(ApplicationConfigurationService.class, 
>           new SingletonResourceProvider(new 
> ApplicationConfigurationServiceImpl()));
>       sf.setAddress("http://localhost:9000/";);
> 
>       Server svr = sf.create(); 
> 
> Is this correct?
> 
> 
> John Baker
> -- 
> Web SSO 
> IT Infrastructure 
> Deutsche Bank London
> 
> 


-----
Joshua Purcell
-- 
View this message in context: 
http://www.nabble.com/CXF-2.1%2C-Rest-and-Spring-configuration-tp16938704p16962492.html

Sent from the cxf-user mailing list archive at Nabble.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.

Reply via email to