You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Bozhong Lin (JIRA)" <ji...@apache.org> on 2007/05/17 05:47:16 UTC

[jira] Updated: (CXF-558) JAX-WS Context not injected for RESTful service implementations

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

Bozhong Lin updated CXF-558:
----------------------------

        Fix Version/s:     (was: 2.1)
                       2.0
             Assignee: Jervis Liu
    Affects Version/s: 2.0-RC

> 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
>         Assigned To: 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.