tags:

views:

259

answers:

1

Situation: jax-ws web service on Weblogic appserver; wsdl first development, jaxb customizations in external binding file.

I would like to get a handle to the actual jaxb context that will process the incoming soap xml message, before it has been unmarshalled into java objects.

Then I would like to get the unmarshaller of this jaxb context - the one that actually will be used during the unmarshalling. And then setup some properties of this unmarshaller (e.g. listener and idresolver).

A: 

The new @UsesJAXBContex annotation JAXBContextFactoryin jaxws 2.1.5 - jaxb 2.2 is probably what I need for that. However weblogic 10.3.1 uses jaxws 2.1.1, jaxb 2.1.3.

Another solution is to use:

@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>

This gives access to the soap xml message. I still have to figure out where the method name can be found.

Instead of:

@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
Gerard