Hi

Can you please confirm again that the annotation inherirance is not working for 
you ?

Here's my test case which works for me (exactly the same signatures except for 
class/method names)

1. Interface :

@WebService
@Path("/bookstore")
public interface BookStoreJaxrsJaxws {
 @WebMethod
 @GET
 @Path("/{id}")
 Book getBook(@PathParam("id") @WebParam(name = "id") Long id);
}

2. Implementation :

@WebService
public class BookStoreSoapRestImpl implements BookStoreJaxrsJaxws {
 private Map<Long, Book> books = new HashMap<Long, Book>();
 public BookStoreSoapRestImpl() {
     init();
 }
 public Book getBook(Long id) {
     return books.get(id);
 }
 // init()
}

3. beans.xml

<jaxws:endpoint xmlns:s="http://books.com";
     serviceName="s:BookService"
     endpointName="s:BookPort"
     id="soapservice"
     implementor="#bookstore"
     address="http://localhost:9092/soap/bookservice"; />

<jaxrs:server id="restservice"
   address="http://localhost:9092/rest";>
   <jaxrs:serviceBeans>
      <ref bean="bookstore"/>
</jaxrs:serviceBeans> </jaxrs:server>

<bean id="bookstore" class="org.apache.cxf.systest.jaxrs.BookStoreSoapRestImpl">

4. HTTP invocation which goes through JAX-RS server runtime which passes :

String endpointAddress = "http://localhost:9092/rest/bookstore/123";; // do GET on it
// compare the returned vs expected book xml representation - ok


Thanks, Sergey




----- Original Message ----- From: "Priscille Durville" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, October 16, 2008 6:34 PM
Subject: Re: Injection error while using both SOAP and RESTful services



So WebServiceContext is available now at runtime, despite that log message ? If yes then it's good, one less problem to worry about :-)
Yes it's good. :-)
So now I have a single implementation class with :

   private ServletContext servletContext;
public void setServletContext(ServletContext servletContext) {
       this.servletContext = servletContext;
   }

and a beans.xml like this :

<bean id="MyService" class="my.package.MyServiceImpl">
       <property name="servletContext">
<bean class="org.springframework.web.context.support.ServletContextFactoryBean" />
       </property>
</bean>

And tis way, context injection works for both SOAP and REST.


But the JAX-RS anotations are still not inherited... I'll look into it
Thanks.


Reply via email to