// Workaround for [JBWS-2015] Modify addressing handlers to work with the JAXWS-2.1 API
private void initAddressingProperties(BindingProvider bindingProvider, EndpointReference epr)
{
Map<String, Object> reqContext = bindingProvider.getRequestContext();
AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
AddressingProperties addrProps = builder.newAddressingProperties();
reqContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);
if (epr instanceof W3CEndpointReference)
{
try
{
W3CEndpointReference w3cepr = (W3CEndpointReference)epr;
if (w3cepr.getAddress() != null)
addrProps.setTo(builder.newURI(w3cepr.getAddress()));
List<Element> w3cRefParams = w3cepr.getReferenceParameters();
if (w3cRefParams != null)
{
ReferenceParameters refParams = addrProps.getReferenceParameters();