/** * Get WS-Addressing To endpoint reference. * * @return endpoint */ public EndpointReference getTo() { if (to == null && parent != null) { return parent.getTo(); } return to; }
/** * @return Returns EndpointReference. */ public EndpointReference getTo() { return options.getTo(); }
/** * @return Returns EndpointReference. */ public EndpointReference getTo() { return options.getTo(); }
/** * Get WS-Addressing To endpoint reference. * * @return endpoint */ public EndpointReference getTo() { if (to == null && parent != null) { return parent.getTo(); } return to; }
/** * sets the epr of the service client to given value * * @param address */ protected void setServiceClientEPR(String address) { EndpointReference toEPRFromServiceClient = _serviceClient.getOptions().getTo(); toEPRFromServiceClient.setAddress(address); }
/** * sets the epr of the service client to given value * * @param address */ protected void setServiceClientEPR(String address) { EndpointReference toEPRFromServiceClient = _serviceClient.getOptions().getTo(); toEPRFromServiceClient.setAddress(address); }
private String getToAddress( Message msg ) throws ServiceRuntimeException { String address = null; // if target endpoint was not specified when this invoker was created, // use dynamically specified target endpoint passed in with the message if (options.getTo() == null) { Endpoint ep = msg.getTo(); if (ep != null && ep.getBinding() != null && ep.getBinding().getURI() != null && ep.getBinding().getURI().length() > 0) { address = ep.getBinding().getURI(); } else { throw new ServiceRuntimeException("[BWS20025] Unable to determine destination endpoint for endpoint reference " + endpointReference); } } else { address = options.getTo().getAddress(); } return address; } // end method getToAddress
private void processToEPR() throws AxisFault { EndpointReference epr = messageContextOptions.getTo(); if (epr != null && !isAddressingHeaderAlreadyAvailable(WSA_TO, false)) { try { processToEPRReferenceInformation(epr.getAllReferenceParameters()); } catch (Exception e) { throw new AxisFault(AddressingMessages.getMessage("referenceParameterError"), e); } String address = epr.getAddress(); if (address != null && address.length()!=0) { if (!includeOptionalHeaders && isFinalAddressingNamespace && epr.isWSAddressingAnonymous()) { return; //Omit the header. } createSOAPHeaderBlock(address, WSA_TO, epr.getAddressAttributes()); } } }
/** * Gets the internal sequence id from the service client instance. * * @param serviceClient * @return * @throws SandeshaException */ private static String getInternalSequenceIdFromServiceClient(ServiceClient serviceClient) throws SandeshaException { Options options = serviceClient.getOptions(); if (options == null) throw new SandeshaException(SandeshaMessageHelper.getMessage( SandeshaMessageKeys.optionsObjectNotSet)); EndpointReference toEPR = options.getTo(); if (toEPR == null) throw new SandeshaException(SandeshaMessageHelper.getMessage( SandeshaMessageKeys.toEPRNotValid, null)); String to = toEPR.getAddress(); String sequenceKey = (String) options.getProperty(SandeshaClientConstants.SEQUENCE_KEY); String internalSequenceID = SandeshaUtil.getInternalSequenceID(to, sequenceKey); return internalSequenceID; }
private ServiceClient createServiceClient(OMElement message) throws AxisFault { Options opts = new Options(); opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setTo(brokerEndPointReference); opts.setAction(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); opts.setTimeOutInMilliSeconds(getTimeoutInMilliSeconds()); opts.setMessageId(UUIDGenerator.getUUID()); ServiceClient client = new ServiceClient(); if (client.getAxisConfiguration().getModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING) != null) { client.engageModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING); } else { SOAPHeaderBlock msgId = soapfactory.createSOAPHeaderBlock("MessageID", NameSpaceConstants.WSA_NS); msgId.setText(UUIDGenerator.getUUID()); SOAPHeaderBlock to = soapfactory.createSOAPHeaderBlock("To", NameSpaceConstants.WSA_NS); to.setText(opts.getTo().getAddress()); SOAPHeaderBlock action = soapfactory.createSOAPHeaderBlock("Action", NameSpaceConstants.WSA_NS); action.setText(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); client.addHeader(action); client.addHeader(msgId); client.addHeader(to); } client.setOptions(opts); return client; }
private ServiceClient createServiceClient(OMElement message) throws AxisFault { Options opts = new Options(); opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setTo(brokerEndPointReference); opts.setAction(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); opts.setTimeOutInMilliSeconds(getTimeoutInMilliSeconds()); opts.setMessageId(UUIDGenerator.getUUID()); ServiceClient client = new ServiceClient(); if (client.getAxisConfiguration().getModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING) != null) { client.engageModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING); } else { SOAPHeaderBlock msgId = soapfactory.createSOAPHeaderBlock("MessageID", NameSpaceConstants.WSA_NS); msgId.setText(UUIDGenerator.getUUID()); SOAPHeaderBlock to = soapfactory.createSOAPHeaderBlock("To", NameSpaceConstants.WSA_NS); to.setText(opts.getTo().getAddress()); SOAPHeaderBlock action = soapfactory.createSOAPHeaderBlock("Action", NameSpaceConstants.WSA_NS); action.setText(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); client.addHeader(action); client.addHeader(msgId); client.addHeader(to); } client.setOptions(opts); return client; }
private ServiceClient createServiceClient(OMElement message) throws AxisFault { ServiceClient client = new ServiceClient(); String uuid = UUIDGenerator.getUUID(); if (client.getAxisConfiguration().getModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING) != null) { client.engageModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING); } else { SOAPHeaderBlock msgId = soapfactory.createSOAPHeaderBlock("MessageID", NameSpaceConstants.WSA_NS); msgId.setText(uuid); SOAPHeaderBlock to = soapfactory.createSOAPHeaderBlock("To", NameSpaceConstants.WSA_NS); to.setText(opts.getTo().getAddress()); SOAPHeaderBlock action = soapfactory.createSOAPHeaderBlock("Action", NameSpaceConstants.WSA_NS); action.setText(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); client.addHeader(action); client.addHeader(msgId); client.addHeader(to); } opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setMessageId(uuid); opts.setAction(message.getNamespace().getNamespaceURI() + "/generateEvent"); opts.setTimeOutInMilliSeconds(getTimeoutInMilliSeconds()); client.setOptions(opts); return client; }
private ServiceClient createServiceClient(OMElement message) throws AxisFault { ServiceClient client = new ServiceClient(); String uuid = UUIDGenerator.getUUID(); if (client.getAxisConfiguration().getModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING) != null) { client.engageModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING); } else { SOAPHeaderBlock msgId = soapfactory.createSOAPHeaderBlock("MessageID", NameSpaceConstants.WSA_NS); msgId.setText(uuid); SOAPHeaderBlock to = soapfactory.createSOAPHeaderBlock("To", NameSpaceConstants.WSA_NS); to.setText(opts.getTo().getAddress()); SOAPHeaderBlock action = soapfactory.createSOAPHeaderBlock("Action", NameSpaceConstants.WSA_NS); action.setText(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); client.addHeader(action); client.addHeader(msgId); client.addHeader(to); } opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setMessageId(uuid); opts.setAction(message.getNamespace().getNamespaceURI() + "/generateEvent"); opts.setTimeOutInMilliSeconds(getTimeoutInMilliSeconds()); client.setOptions(opts); return client; }
private ServiceClient createServiceClient(OMElement message) throws AxisFault { String uuid = UUIDGenerator.getUUID(); ServiceClient client = new ServiceClient(); if (client.getAxisConfiguration().getModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING) != null) { client.engageModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING); } else { SOAPHeaderBlock msgId = soapfactory.createSOAPHeaderBlock("MessageID", NameSpaceConstants.WSA_NS); msgId.setText(uuid); SOAPHeaderBlock to = soapfactory.createSOAPHeaderBlock("To", NameSpaceConstants.WSA_NS); to.setText(opts.getTo().getAddress()); SOAPHeaderBlock action = soapfactory.createSOAPHeaderBlock("Action", NameSpaceConstants.WSA_NS); action.setText(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); client.addHeader(action); client.addHeader(msgId); client.addHeader(to); } opts.setMessageId(uuid); opts.setAction(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setTimeOutInMilliSeconds(getTimeoutInMilliSeconds()); client.setOptions(opts); return client; }
private ServiceClient createServiceClient(OMElement message) throws AxisFault { String uuid = UUIDGenerator.getUUID(); ServiceClient client = new ServiceClient(); if (client.getAxisConfiguration().getModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING) != null) { client.engageModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING); } else { SOAPHeaderBlock msgId = soapfactory.createSOAPHeaderBlock("MessageID", NameSpaceConstants.WSA_NS); msgId.setText(uuid); SOAPHeaderBlock to = soapfactory.createSOAPHeaderBlock("To", NameSpaceConstants.WSA_NS); to.setText(opts.getTo().getAddress()); SOAPHeaderBlock action = soapfactory.createSOAPHeaderBlock("Action", NameSpaceConstants.WSA_NS); action.setText(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); client.addHeader(action); client.addHeader(msgId); client.addHeader(to); } opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setMessageId(uuid); opts.setAction(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); opts.setTimeOutInMilliSeconds(getTimeoutInMilliSeconds()); client.setOptions(opts); return client; }
private ServiceClient createServiceClient(OMElement message) throws AxisFault { String uuid = UUIDGenerator.getUUID(); opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setMessageId(uuid); opts.setAction(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); opts.setTimeOutInMilliSeconds(getTimeoutInMilliSeconds()); ServiceClient client = new ServiceClient(); if (client.getAxisConfiguration().getModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING) != null) { client.engageModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING); } else { SOAPHeaderBlock msgId = soapfactory.createSOAPHeaderBlock("MessageID", NameSpaceConstants.WSA_NS); msgId.setText(uuid); SOAPHeaderBlock to = soapfactory.createSOAPHeaderBlock("To", NameSpaceConstants.WSA_NS); to.setText(opts.getTo().getAddress()); SOAPHeaderBlock action = soapfactory.createSOAPHeaderBlock("Action", NameSpaceConstants.WSA_NS); action.setText(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); client.addHeader(action); client.addHeader(msgId); client.addHeader(to); } client.setOptions(opts); return client; }
private ServiceClient createServiceClient(OMElement message) throws AxisFault { String uuid = UUIDGenerator.getUUID(); opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setMessageId(uuid); opts.setAction(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); opts.setTimeOutInMilliSeconds(getTimeoutInMilliSeconds()); ServiceClient client = new ServiceClient(); if (client.getAxisConfiguration().getModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING) != null) { client.engageModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING); } else { SOAPHeaderBlock msgId = soapfactory.createSOAPHeaderBlock("MessageID", NameSpaceConstants.WSA_NS); msgId.setText(uuid); SOAPHeaderBlock to = soapfactory.createSOAPHeaderBlock("To", NameSpaceConstants.WSA_NS); to.setText(opts.getTo().getAddress()); SOAPHeaderBlock action = soapfactory.createSOAPHeaderBlock("Action", NameSpaceConstants.WSA_NS); action.setText(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); client.addHeader(action); client.addHeader(msgId); client.addHeader(to); } client.setOptions(opts); return client; }
private ServiceClient createServiceClient(OMElement message) throws AxisFault { String uuid = UUIDGenerator.getUUID(); ServiceClient client = new ServiceClient(); if (client.getAxisConfiguration().getModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING) != null) { client.engageModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING); } else { SOAPHeaderBlock msgId = soapfactory.createSOAPHeaderBlock("MessageID", NameSpaceConstants.WSA_NS); msgId.setText(uuid); SOAPHeaderBlock to = soapfactory.createSOAPHeaderBlock("To", NameSpaceConstants.WSA_NS); to.setText(opts.getTo().getAddress()); SOAPHeaderBlock action = soapfactory.createSOAPHeaderBlock("Action", NameSpaceConstants.WSA_NS); action.setText(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); client.addHeader(action); client.addHeader(msgId); client.addHeader(to); } opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setMessageId(uuid); opts.setAction(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); opts.setTimeOutInMilliSeconds(getTimeoutInMilliSeconds()); client.setOptions(opts); return client; }
private MessageContext getNewMessageContextUsingAxis2Info(CreateSequenceMessage createSequenceMessage) throws AxisFault, RMMessageBuildingException { MessageContext messageContext = new MessageContext(); messageContext.setServiceContext(this.axis2Info.getServiceContext()); messageContext.setEnvelope(createSequenceMessage.toSOAPEnvelope()); messageContext.setMessageID(UUIDGenerator.getUUID()); messageContext.setTransportIn(this.axis2Info.getTransportIn()); messageContext.setTransportOut(this.axis2Info.getTransportOut()); messageContext.setReplyTo(this.ackToEpr); messageContext.setProperty(MercuryConstants.PROCESS_RM_CONTROL_MESSAGE, Constants.VALUE_TRUE); messageContext.setOptions(new Options()); // set the correct options messageContext.getOptions().setTo(this.axis2Info.getOptions().getTo()); messageContext.getOptions().setUseSeparateListener(this.axis2Info.getOptions().isUseSeparateListener()); messageContext.setServerSide(this.axis2Info.isServerSide()); return messageContext; }
private ServiceClient createServiceClient(OMElement message) throws AxisFault { String uuid = UUIDGenerator.getUUID(); ServiceClient client = new ServiceClient(); if (client.getAxisConfiguration().getModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING) != null) { client.engageModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING); } else { SOAPHeaderBlock msgId = soapfactory.createSOAPHeaderBlock("MessageID", NameSpaceConstants.WSA_NS); msgId.setText(uuid); SOAPHeaderBlock to = soapfactory.createSOAPHeaderBlock("To", NameSpaceConstants.WSA_NS); to.setText(opts.getTo().getAddress()); SOAPHeaderBlock action = soapfactory.createSOAPHeaderBlock("Action", NameSpaceConstants.WSA_NS); action.setText(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); client.addHeader(action); client.addHeader(msgId); client.addHeader(to); } opts.setMessageId(uuid); opts.setAction(message.getNamespace().getNamespaceURI() + "/" + message.getLocalName()); opts.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); opts.setTimeOutInMilliSeconds(getTimeoutInMilliSeconds()); client.setOptions(opts); return client; }