2013-05-16 58 views
0

我有一個服務類,我使用Grails Cxf插件公開爲jaxws。在我的服務中,我必須注入另一個服務類,我在我的Web服務中使用它。如果我讓服務領域公共我得到像下面產生的不必要的服務方式:Grails注入的服務在cxf中顯示爲web方法

retrieveLastRecordUpdateDate 
setPricingContractService 
retrieveRecordsUpdatedFromDate 
retrieveAllRecordsByInsurance 
getPricingContractService 

如果我讓外地私人我不能注入的服務類。我怎樣才能注入服務,而不是將其作爲Web服務公開?下面簡化代碼:

class PricingContractWebService { 

static expose = EndpointType.JAX_WS 

def pricingContractService // private? 

@WebMethod(operationName="retrieveAllRecordsByInsurance") 
@WebResult(name="pricingContractList") 
@XmlElement(name="healthCareCompany", required=true) 
List<PricingContractDTO> retrieveAllRecordsByInsurance(@WebParam(partName = "HealthCareCompany", name = "healthCareCompany",) final HealthCareCompany healthCareCompany) { 

    def pricingContractDTOList = [] 

    pricingContractDTOList 
} 

@WebMethod(operationName="retrieveLastRecordUpdateDate") 
@WebResult(name="lastUpdateDate") 
Date retrieveLastRecordUpdateDate() { 

} 

@WebMethod(operationName="retrieveRecordsUpdatedFromDate") 
@WebResult(name="pricingContractList") 
@XmlElement(name="updateDate", required=true) 
List<PricingContractDTO> retrieveRecordsUpdatedFromDate(@WebParam(name = "updateDate") final Date date) { 

    def pricingContractDTOList = [] 

    pricingContractDTOList 
} 

}

回答

0

你應該讓服務端點私人和端點聲明之前添加@Autowired:

@Autowired 
private PricingContractService pricingContractService