cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jervis Liu (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (CXF-558) JAX-WS Context not injected for RESTful service implementations
Date Thu, 14 Jun 2007 08:09:26 GMT

     [ https://issues.apache.org/jira/browse/CXF-558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jervis Liu resolved CXF-558.
----------------------------

    Resolution: Fixed

> JAX-WS Context not injected for RESTful service implementations
> ---------------------------------------------------------------
>
>                 Key: CXF-558
>                 URL: https://issues.apache.org/jira/browse/CXF-558
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.0-RC
>         Environment: Not env specific
>            Reporter: Dave Stanley
>            Assignee: Jervis Liu
>             Fix For: 2.0
>
>         Attachments: bare.zip
>
>
> The context is not injected for RESTful services. You can see this by modifying the the
JUnit testcase below: 
> <cxf>/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/bare/CustomerService.java
> Added the @Resource annotation as shown below ..
> import javax.annotation.Resource;
> ...
> import javax.xml.ws.WebServiceContext;
> ...
> // END SNIPPET: service
> @WebService(targetNamespace = "http://cxf.apache.org/jra")
> public class CustomerService {
>     long currentId = 1;
>     Map<Long, Customer> customers = new HashMap<Long, Customer>();
>     @Resource
>     private WebServiceContext context;
>  
>     @Post
>     @HttpResource(location = "/customers")
>     @WebMethod
>     public void addCustomer(@WebParam(name = "customer") Customer c) {
>         long id = ++currentId;
>         c.setId(id);
>         customers.put(id, c);
>         
>         // Context is null .. 
>         MessageContext mc = context.getMessageContext();
>    }      

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message