Hi,
In your provider you can have a auto-injected resource like
@Resource
private WebServiceContext context;
and from this context you can get soap version
MessageContext messageContext = context.getMessageContext();
SoapVersion soapVersion =
(SoapVersion)messageContext.get(SoapVersion.class.getName());
SoapFault fault;
if (soapVersion.getVersion() == 1.1 && faultCode != null) {
fault = new SoapFault(faultString, faultCode);
} else {
fault = new SoapFault(faultString, soapVersion.getSender());
if (soapVersion.getVersion() != 1.1 && faultCode != null) {
fault.setSubCode(faultCode);
}
}
-------------
Freeman(Yue) Fang
Red Hat, Inc.
FuseSource is now part of Red Hat
On 2014-6-24, at 上午10:21, zsolt.szloboda wrote:
> Is there a way to get the SOAP version (1.1 / 1.2) of a request, in a JAX-WS
> Provider?
>
> Let's say my service supports both SOAP 1.1 and 1.2. When I assemble a SOAP
> Fault in my Provider, I have to know the SOAP version (because the SOAP
> Fault's structure is dependent on the SOAP version). However I have found no
> way to get this information.
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/getting-the-SOAP-version-in-a-JAX-WS-Provider-tp5745503.html
> Sent from the cxf-user mailing list archive at Nabble.com.