Just for the record, I solve the problem creating the Addressing header by
hand and the added to the request context
DynamicClientFactory dcf =
DynamicClientFactory.newInstance();
Client client = dcf.createClient(wsdl);
Map<String, Object> requestContext =
client.getRequestContext();
List<Header> headers = new ArrayList<Header>();
String AddressingNS = "http://www.w3.org/2005/08/addressing";
//The endpoint variable is related to the
*callback*endpoint
W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
builder.address(endpoint.getAddress());
builder.serviceName(endpoint.getServiceName());
builder.endpointName(endpoint.getEndpointName());
W3CEndpointReference callbackReference = builder.build();
Header replyTo = new Header(new QName(AddressingNS, "ReplyTo"),
callbackReference, new JAXBDataBinding(
W3CEndpointReference.class));
Header action = new Header(new QName(AddressingNS, "Action"),
responseType, new JAXBDataBinding(String.class));
String messageId = "urn:uuid:" + System.currentTimeMillis();
Header messageIdHeader = new Header(
new QName(AddressingNS, "MessageID"), messageId,
new JAXBDataBinding(String.class));
String to = client.getEndpoint().getEndpointInfo().getAddress();
Header toHeader = new Header(new QName(AddressingNS, "To"), to,
new JAXBDataBinding(String.class));
headers.add(action);
headers.add(messageIdHeader);
headers.add(toHeader);
headers.add(replyTo);
requestContext.put(Header.HEADER_LIST, headers);
Leandro
On Tue, Oct 26, 2010 at 7:47 PM, Daniel Kulp <[email protected]> wrote:
> On Tuesday 26 October 2010 5:25:13 am Leandro Sales wrote:
> > Dear all,
> >
> > I'm trying to invoke an WS-Addressing Web service with a dynamic client.
> I
> > have already tried all the possibilities in found to set
> > the CLIENT_ADDRESSING_PROPERTIES property to the request context but I
> > always get the "A required header representing a Message Addressing
> > Property is not present" exception.
> >
> > Any idea about a solution? I'm using the latest cxf version.
>
> It really should be just putting the CLIENT_ADDRESSING_PROPERTIES object
> into
> the dispatches request context, PROVIDING the WS-Addressing interceptors
> are
> configured in. When you create the Dispatch, I think you can pass
> AddressingFeature JAX-WS feature in to turn it on.
>
> Dan
>
>
>
> >
> > Thank,
> >
> > Leandro
>
> --
> Daniel Kulp
> [email protected]
> http://dankulp.com/blog
>