2013-08-30 37 views
0

我知道之前已經有人問過,但沒有一個解決方案適用於我。可能是因爲他們大多使用符合EE標準的應用程序服務器,這是我的情況,即不是WebServiceContext不是使用@Resource注入的

我在jetty(通過Eclipse)上運行我的Web服務僅用於開發。但即使部署,我也會使用Tomcat 7.因此,無論是開發還是生產,我都不會使用符合JavaEE的服務器。

  • 那麼,它仍然可能注入WebServiceContext到我的網頁 服務?

我試過以下,但它沒有工作

@WebService 
@BindingType(SOAPBinding.SOAP12HTTP_BINDING) 
public class IxProIntegration { 
    // Tried this, didn't work 
    @Resource 
    private WebServiceContext wsContext; 

    // After commenting the @Resource annotation on the wsContext field 
    // And adding the annotation here, this still didn't work. 
    @Resource 
    @WebMethod(exclude = true) 
    public void setContext(WebServiceContext context) { 
     this.wsContext = context; 
    } 
  • 當有人親切地給出了一個答案,我很想從那裏 他纔得到這個問題的答案就知道了?

回答

0

我正在使用名爲Tapestry的依賴注入框架。掛毯管理服務instantiatiion。但是Web服務不是由JAX-WS管理的。這就是爲什麼上下文始終是null。我需要asked a new question related to the subject,以防有人需要答案。

相關問題