Search in sources :

Example 1 with MAPConstants

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);
}
Also used : MAPEndpoint(org.jboss.ws.api.addressing.MAPEndpoint) MAPConstants(org.jboss.ws.api.addressing.MAPConstants) BindingProvider(javax.xml.ws.BindingProvider) IOException(java.io.IOException) MAP(org.jboss.ws.api.addressing.MAP) MAPBuilder(org.jboss.ws.api.addressing.MAPBuilder)

Aggregations

IOException (java.io.IOException)1 BindingProvider (javax.xml.ws.BindingProvider)1 MAP (org.jboss.ws.api.addressing.MAP)1 MAPBuilder (org.jboss.ws.api.addressing.MAPBuilder)1 MAPConstants (org.jboss.ws.api.addressing.MAPConstants)1 MAPEndpoint (org.jboss.ws.api.addressing.MAPEndpoint)1