Hi,

I have a SOAP services working fine, using the servlet transport. The servlet is configured in web.xml, and the end point publishing happens in the init method of the servlet (which is a subclass of CXFServlet:

public void init(ServletConfig servletConfig) throws ServletException {
        super.init(servletConfig);
        Bus bus = this.getBus();
        BusFactory.setDefaultBus(bus);
Endpoint.publish("/review", SpringContext.getComponent("rpcReviewService")); Endpoint e = Endpoint.create(HTTPBinding.HTTP_BINDING, SpringContext.getComponent("restReviewService"));
        e.publish("/rest");
Endpoint.publish("/auth", SpringContext.getComponent("rpcAuthService"));
    }

My RestReviewService class (based on the CustomerService example) looks like:

@Component("restReviewService")
@WebService
@UriTemplate("/review/")
public class RestReviewService {
        @Autowired
        private ReviewService reviewService;

        @HttpContext
        UriInfo uriInfo;

        @HttpMethod("GET")
        @UriTemplate("/all/")
        public List<ReviewData> getAllReviews() {
            return reviewService.getAllReviews();
        }
}

When I start my server the log says:
...
[java] Nov 8, 2007 11:34:53 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass [java] INFO: Creating Service {http://rpc.spi.crucible.atlassian.com/ }RestReviewServiceService from class com.atlassian.crucible.spi.rpc.RestReviewService [java] Nov 8, 2007 11:34:53 AM org.apache.cxf.endpoint.ServerImpl initDestination
     [java] INFO: Setting the server's publish address to be /rest
[java] Nov 8, 2007 11:34:53 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
...

But the service endpoint seems to be another SOAP service, as when I go to http://localhost:6060/foo/services/rest/review/all I get:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/ envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</ faultcode><faultstring>No such operation: review</faultstring></ soap:Fault></soap:Body></soap:Envelope>

Thanks for any tips or pointers to documentation other than 
http://cwiki.apache.org/CXF20DOC/rest-with-jax-ws-provider-and-dispatch.html

I suspect I need to set the JAXRS binding for the endpoint, but I don't know how to do it...

Tom

--
ATLASSIAN - http://www.atlassian.com
Our products help over 8,500 customers in more than 95 countries to collaborate





Reply via email to