cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnson, Eric" <Eric.John...@iona.com>
Subject RE: Newby REST question
Date Fri, 25 May 2007 11:33:48 GMT

excellent!! Thanks.

-----Original Message-----
From: Freeman Fang [mailto:freeman.fang@iona.com]
Sent: Thu 5/24/2007 9:30 PM
To: cxf-dev@incubator.apache.org
Subject: Re: Newby REST question
 
Hi Eric,

You need add @HttpResource in WidgetCatalog interface, like we do in 
CustomerService of restful demo.

Thanks very much

Freeman


Johnson, Eric wrote:
> I've got a class:
> package com.acme.customer;
>  
> public interface WidgetCatalog
> {
>   Widgets getWidgets();
>  
>   Widget getWidget(long id);
>  
>   void addWidget(Widget widget);
>  
>   void updateWidget(Widget w);
>   
>   int removeWidgets(String type, int num);
>   
>   void deleteWidget(Widget widget);
> }
>
> That I want to get working using the convention based REST stuff, so I
> publish it like this:
>
>        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
>         sf.setServiceClass(WidgetCatalog.class);
>  
>         sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
>         sf.setAddress("http://localhost:9000/xml/");
>  
>         WidgetCatalogImpl bs = new WidgetCatalogImpl();
>         sf.getServiceFactory().setInvoker(new BeanInvoker(bs));
>  
>         sf.getServiceFactory().setWrapped(true);
>  
>         sf.create();
>
> When I try to access the getWidgets() method by going to
> http://localhost:9000/xml/widgets I get "Invalid URL/Verb combination.
> Verb: GET Path: /widgets."
>
> What did I do wrong? I basically copied most of the restfull_http demo
> and removed the annotations.
>
>   



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message