我有如下簡化一個CXF Web服務。我的問題是,如果我注入像下面這樣的服務,生成的wsdl也會有setParameterService/getParameterService和getMessageSource/setMessageSource方法。如果我不想將它們暴露爲Web服務,我應該怎麼做?Grails中CXF Web服務注入服務引起的getter/setter產生
@WebService(portName = "OrganizationPort", serviceName = "OrganizationService", name = "OrganizationService", targetNamespace = "http://akum.compugroup.com")
@SOAPBinding(parameterStyle = ParameterStyle.WRAPPED, use = Use.LITERAL, style = Style.DOCUMENT)
class OrganizationWebService {
def parameterService
def messageSource
static expose = EndpointType.JAX_WS
@WebMethod
@WebResult
Organization kurumSorgulama(@WebParam(partName = "KurumSorgulamaTalep", name = "KurumSorgulamaTalep", targetNamespace = "http://akum.compugroup.com") String kurumKodu) {
return organization
}
@WebMethod
@WebResult
Organization authorize(@WebParam(partName = "KurumSorgulamaTalep", name = "KurumSorgulamaTalep", targetNamespace = "http://akum.compugroup.com") String kurumKodu) {
return organization
}
}
您也可以刪除靜態暴露= EndpointType.JAX_WS因爲你對@WebService標註有該做同樣的事情。 – Christian
我說這個例子GitHub的項目在https://github.com/Grails-Plugin-Consortium/grails-cxf/blob/master/grails-app/services/org/grails/cxf/test/OrganizationService.groovy和你可以使用SOAP UI調用它,如果你得到了項目源代碼並對它執行一個運行應用程序並使用localhost:8080/grails-cxf/services/organization?wsdl – Christian