use of org.jboss.ws.api.addressing.MAPConstants in project jbossws-cxf by jbossws.
the class AddressingPort method setClientID.
/**
* This installs the ID for this client in the outbound messages
*/
private void setClientID() {
BindingProvider bindingProvider = (BindingProvider) port;
Map<String, Object> msgContext = bindingProvider.getRequestContext();
MAPBuilder builder = MAPBuilderFactory.getInstance().getBuilderInstance();
MAPConstants ADDR = builder.newConstants();
MAP outProps = builder.newMap();
MAPEndpoint replyTo = builder.newEndpoint(ADDR.getAnonymousURI());
outProps.setReplyTo(replyTo);
outProps.setMessageID("urn:uuid:" + UUIDGenerator.generateRandomUUIDString());
// Assign a new clientid
if (clientID == null) {
clientID = "clientid-" + (++maxClientId);
log.info("New clientid: " + clientID);
}
try {
replyTo.addReferenceParameter(DOMUtils.parse(getClientIdElement(clientID), getDocumentBuilder()));
} catch (IOException e) {
throw new RuntimeException(e);
}
outProps.installOutboundMapOnClientSide(msgContext, outProps);
}
Aggregations