/** * @param qname * @param value - the text of the OMElement. Remember that this is a convenient method for the user, * which has limited capability. If you want more power use @See EndpointReference#addReferenceParameter(OMElement) */ public void addReferenceParameter(QName qname, String value) { if (qname == null) { return; } OMElement omElement = OMAbstractFactory.getOMFactory().createOMElement(qname, null); omElement.setText(value); addReferenceParameter(omElement); }
/** * @param qname * @param value - the text of the OMElement. Remember that this is a convenient method for the user, * which has limited capability. If you want more power use @See EndpointReference#addReferenceParameter(OMElement) */ public void addReferenceParameter(QName qname, String value) { if (qname == null) { return; } OMElement omElement = OMAbstractFactory.getOMFactory().createOMElement(qname, null); omElement.setText(value); addReferenceParameter(omElement); }
public static EndpointReference cloneEPR (EndpointReference epr) { EndpointReference newEPR = new EndpointReference (epr.getAddress()); Map<QName, OMElement> referenceParams = epr.getAllReferenceParameters(); if (referenceParams != null) { for (Iterator<Entry<QName, OMElement>> entries = referenceParams.entrySet().iterator(); entries .hasNext();) { Entry<QName, OMElement> entry = entries.next(); Object referenceParam = entry.getValue(); if (referenceParam instanceof OMElement) { OMElement clonedElement = ((OMElement) referenceParam) .cloneOMElement(); clonedElement.setText("false"); newEPR.addReferenceParameter(clonedElement); } } } return newEPR; }
private void extractToEprReferenceParameters(EndpointReference toEPR, SOAPHeader header, String namespace) { if (Final.WSA_NAMESPACE.equals(namespace)) { Iterator headerBlocks = header.getChildElements(); while (headerBlocks.hasNext()) { OMElement headerElement = (OMElement)headerBlocks.next(); OMAttribute isRefParamAttr = headerElement.getAttribute(new QName(namespace, "IsReferenceParameter")); if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { log.trace("extractToEprReferenceParameters: Checking header: " + headerElement.getQName()); } if (isRefParamAttr != null && "true".equals(isRefParamAttr.getAttributeValue())) { toEPR.addReferenceParameter(headerElement); if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) { log.trace("extractToEprReferenceParameters: Header: " + headerElement.getQName() + " has IsReferenceParameter attribute. Adding to toEPR."); } } } } else { // there is no exact way to identify ref parameters for Submission version. So let's have a handler // at the end of the flow, which puts all the handlers (which are of course mustUnderstand=false) // as reference parameters // TODO : Chinthaka } }
while (iterator.hasNext()) { OMElement element = (OMElement) iterator.next(); epr.addReferenceParameter(element); while (iterator.hasNext()) { OMElement element = (OMElement) iterator.next(); epr.addReferenceParameter(element);
while (iterator.hasNext()) { OMElement element = (OMElement) iterator.next(); epr.addReferenceParameter(element); while (iterator.hasNext()) { OMElement element = (OMElement) iterator.next(); epr.addReferenceParameter(element);
protected void addReferenceParameters(MessageContext msgctx) { EndpointReference to = msgctx.getTo(); if (options.isManageSession() || (options.getParent() != null && options.getParent().isManageSession())) { EndpointReference tepr = sc.getTargetEPR(); if (tepr != null) { Map<QName, OMElement> map = tepr.getAllReferenceParameters(); if (map != null) { Iterator<OMElement> valuse = map.values().iterator(); while (valuse.hasNext()) { Object refparaelement = valuse.next(); if (refparaelement instanceof OMElement) { to.addReferenceParameter((OMElement) refparaelement); } } } } } }
protected void addReferenceParameters(MessageContext msgctx) { EndpointReference to = msgctx.getTo(); if (options.isManageSession() || (options.getParent() != null && options.getParent().isManageSession())) { EndpointReference tepr = sc.getTargetEPR(); if (tepr != null) { Map<QName, OMElement> map = tepr.getAllReferenceParameters(); if (map != null) { Iterator<OMElement> valuse = map.values().iterator(); while (valuse.hasNext()) { Object refparaelement = valuse.next(); if (refparaelement instanceof OMElement) { to.addReferenceParameter((OMElement) refparaelement); } } } } } }
public void createSubscribeResponse(ProcessingContext ctx, String subId) throws AxisFault { OMFactory factory = OMAbstractFactory.getOMFactory(); ctx.addResponseMsgNameSpaces(NameSpaceConstants.WSNT_NS); OMElement responseMessage = factory.createOMElement("SubscribeResponse", NameSpaceConstants.WSNT_NS); OMElement identifier = factory.createOMElement(WsmgCommonConstants.SUBSCRIPTION_ID, responseMessage.getNamespace()); identifier.setText(subId); EndpointReference serviceLocationEndpointReference = new EndpointReference(ctx.getMessageContext() .getAxisService().getEndpointURL()); serviceLocationEndpointReference.addReferenceParameter(identifier); OMElement subscriptionReference = null; try { subscriptionReference = EndpointReferenceHelper.toOM(factory, serviceLocationEndpointReference, new QName( "SubscriptionReference"), NameSpaceConstants.WSA_NS.getNamespaceURI()); responseMessage.addChild(subscriptionReference); subscriptionReference.setNamespace(responseMessage.getNamespace()); } catch (AxisFault e) { log.error("unable to resolve EPR from OM", e); throw e; } ctx.setRespMessage(responseMessage); }
public void createSubscribeResponse(ProcessingContext ctx, String subId) throws AxisFault { OMFactory factory = OMAbstractFactory.getOMFactory(); ctx.addResponseMsgNameSpaces(NameSpaceConstants.WSNT_NS); OMElement responseMessage = factory.createOMElement("SubscribeResponse", NameSpaceConstants.WSNT_NS); OMElement identifier = factory.createOMElement(WsmgCommonConstants.SUBSCRIPTION_ID, responseMessage.getNamespace()); identifier.setText(subId); EndpointReference serviceLocationEndpointReference = new EndpointReference(ctx.getMessageContext() .getAxisService().getEndpointURL()); serviceLocationEndpointReference.addReferenceParameter(identifier); OMElement subscriptionReference = null; try { subscriptionReference = EndpointReferenceHelper.toOM(factory, serviceLocationEndpointReference, new QName( "SubscriptionReference"), NameSpaceConstants.WSA_NS.getNamespaceURI()); responseMessage.addChild(subscriptionReference); subscriptionReference.setNamespace(responseMessage.getNamespace()); } catch (AxisFault e) { log.error("unable to resolve EPR from OM", e); throw e; } ctx.setRespMessage(responseMessage); }
public void createSubscribeResponse(ProcessingContext ctx, String subId) throws AxisFault { OMFactory factory = OMAbstractFactory.getOMFactory(); ctx.addResponseMsgNameSpaces(NameSpaceConstants.WSE_NS); OMElement responseMessage = factory.createOMElement("SubscribeResponse", NameSpaceConstants.WSE_NS); OMElement identifier = factory.createOMElement(WsmgCommonConstants.SUBSCRIPTION_ID, responseMessage.getNamespace()); identifier.setText(subId); EndpointReference serviceLocationEndpointReference = new EndpointReference(ctx.getMessageContext() .getAxisService().getEndpointURL()); serviceLocationEndpointReference.addReferenceParameter(identifier); OMElement expiresEl = factory.createOMElement("Expires", responseMessage.getNamespace(), responseMessage); Date expiration = getFutureExpirationDate(); String dateString = CommonRoutines.getXsdDateTime(expiration); expiresEl.setText(dateString); OMElement subscriptionManagerEpr = null; try { subscriptionManagerEpr = EndpointReferenceHelper.toOM(factory, serviceLocationEndpointReference, new QName( NameSpaceConstants.WSE_NS.getNamespaceURI(), "SubscriptionManager"), NameSpaceConstants.WSA_NS .getNamespaceURI()); responseMessage.addChild(subscriptionManagerEpr); subscriptionManagerEpr.setNamespace(responseMessage.getNamespace()); } catch (AxisFault e) { log.error("unable to resolve EPR from OM", e); throw e; } ctx.setRespMessage(responseMessage); }
public void createSubscribeResponse(ProcessingContext ctx, String subId) throws AxisFault { OMFactory factory = OMAbstractFactory.getOMFactory(); ctx.addResponseMsgNameSpaces(NameSpaceConstants.WSE_NS); OMElement responseMessage = factory.createOMElement("SubscribeResponse", NameSpaceConstants.WSE_NS); OMElement identifier = factory.createOMElement(WsmgCommonConstants.SUBSCRIPTION_ID, responseMessage.getNamespace()); identifier.setText(subId); EndpointReference serviceLocationEndpointReference = new EndpointReference(ctx.getMessageContext() .getAxisService().getEndpointURL()); serviceLocationEndpointReference.addReferenceParameter(identifier); OMElement expiresEl = factory.createOMElement("Expires", responseMessage.getNamespace(), responseMessage); Date expiration = getFutureExpirationDate(); String dateString = CommonRoutines.getXsdDateTime(expiration); expiresEl.setText(dateString); OMElement subscriptionManagerEpr = null; try { subscriptionManagerEpr = EndpointReferenceHelper.toOM(factory, serviceLocationEndpointReference, new QName( NameSpaceConstants.WSE_NS.getNamespaceURI(), "SubscriptionManager"), NameSpaceConstants.WSA_NS .getNamespaceURI()); responseMessage.addChild(subscriptionManagerEpr); subscriptionManagerEpr.setNamespace(responseMessage.getNamespace()); } catch (AxisFault e) { log.error("unable to resolve EPR from OM", e); throw e; } ctx.setRespMessage(responseMessage); }
EndpointReference subscriptionManagerEPR = new EndpointReference(subscription.getSubManUrl()); subscriptionManagerEPR.addReferenceParameter(new QName(EventingConstants.WSE_EVENTING_NS, EventingConstants.WSE_EN_IDENTIFIER, EventingConstants.WSE_EVENTING_PREFIX), subscription.getId());
EndpointReference subscriptionManagerEPR = new EndpointReference(subscription.getSubManUrl()); subscriptionManagerEPR.addReferenceParameter(new QName(EventingConstants.WSE_EVENTING_NS, EventingConstants.WSE_EN_IDENTIFIER, EventingConstants.WSE_EVENTING_PREFIX), subscription.getId());
brokerLocationEPR.addReferenceParameter(topicExpressionEl); client.engageModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING); } else {
brokerLocationEPR.addReferenceParameter(topicExpressionEl); client.engageModule(WsmgCommonConstants.AXIS_MODULE_NAME_ADDRESSING); } else {
EndpointReference subscriptionManagerEPR = new EndpointReference(subscription.getEventSinkURL()); subscriptionManagerEPR.addReferenceParameter(new QName(EventingConstants.WSE_EVENTING_NS, EventingConstants.WSE_EN_IDENTIFIER, EventingConstants.WSE_EVENTING_PREFIX), subscription.getId());
EndpointReference subscriptionManagerEPR = new EndpointReference(subscription.getEventSinkURL()); subscriptionManagerEPR.addReferenceParameter(new QName(EventingConstants.WSE_EVENTING_NS, EventingConstants.WSE_EN_IDENTIFIER, EventingConstants.WSE_EVENTING_PREFIX), subscription.getId());
if (serviceGroupContextId != null && !"".equals(serviceGroupContextId)) { EndpointReference replyToEPR = newmsgCtx.getReplyTo(); replyToEPR.addReferenceParameter(new QName(Constants.AXIS2_NAMESPACE_URI, Constants.SERVICE_GROUP_ID, Constants.AXIS2_NAMESPACE_PREFIX),
toEpr.addReferenceParameter(RoutingInput.createElement(mc.getEnvelope(), routingInputUsrMsg));