2009-11-27 70 views
2

現狀/結束:應用服務器的JAX-WS Web服務Weblogic上;首先開發wsdl,在外部綁定文件中進行jaxb自定義。JAX-WS:如何得到一個處理開始處理傳入的SOAP消息

我想得到一個處理實際的jaxb上下文,它將處理傳入的soap xml消息,之前它已被解組到java對象中。

然後我想得到這個jaxb上下文的解組器 - 實際上將在解組過程中使用的解組器。然後設置此unmarshaller的一些性質(例如,聽衆和idresolver)。

回答

0

@UsesJAXBContex註釋JAXBContextFactoryin JAXWS 2.1.5 - JAXB 2.2大概是什麼,我需要爲。 不過的WebLogic 10.3.1使用JAXWS 2.1.1,2.1.3 JAXB。

另一種解決方案是使用:

@WebServiceProvider(portName = "Port", serviceName = "Service", targetNamespace = "tns",                          wsdlLocation = "/wsdls/x.wsdl") 
@BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http") 
@ServiceMode(value = javax.xml.ws.Service.Mode.MESSAGE) 
public class ServiceProvider implements Provider<SOAPMessage> 

這給出了訪問SOAP XML消息。我仍然需要找出方法名稱的位置。

相反的:

@WebService(portName = "Port", serviceName = "Service", targetNamespace = "tns", 
wsdlLocation = "/wsdls/x.wsdl", endpointInterface = "tns.PortType") 
@BindingType("http://schemas.xmlsoap.org/wsdl/soap/http") 
public class ServicePort implements PortType