OMFactory omFactory = OMAbstractFactory.getOMFactory(); OMElement omSecurityElement = omFactory.createOMElement(new QName( "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security", "wsse"), null); OMElement omusertoken = omFactory.createOMElement(new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", "UsernameToken", "wsu"), null); OMElement omuserName = omFactory.createOMElement(new QName("", "Username", "wsse"), null); omuserName.setText("myusername"); OMElement omPassword = omFactory.createOMElement(new QName("", "Password", "wsse"), null); omPassword.addAttribute("Type","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText",null ); omPassword.setText("mypassword"); omusertoken.addChild(omuserName); omusertoken.addChild(omPassword); omSecurityElement.addChild(omusertoken); stub._getServiceClient().addHeader(omSecurityElement);
public static OMElement getHistoryInfoElement(String text){ try { String template = "<info></info>"; OMElement infoElement = AXIOMUtil.stringToOM(template); infoElement.setText(text); return infoElement; } catch (XMLStreamException e) { log.error("Unable to build the lifecycle history info element"); } return null; }
private static OMElement getPingOMBlock(String text) { OMFactory fac = OMAbstractFactory.getOMFactory(); OMNamespace namespace = fac.createOMNamespace(applicationNamespaceName,"ns1"); OMElement pingElem = fac.createOMElement(ping, namespace); OMElement textElem = fac.createOMElement(Text, namespace); textElem.setText(text); pingElem.addChild(textElem); return pingElem; }
public static OMElement getParameter(String name, String value, boolean locked) { OMFactory fac = OMAbstractFactory.getOMFactory(); OMElement parameter = fac.createOMElement("parameter", null); parameter.addAttribute("name", name, null); parameter.addAttribute("locked", Boolean.toString(locked), null); parameter.setText(value); return parameter; }
@Override protected XMLMessage prepareRequest() throws Exception { OMFactory factory = OMAbstractFactory.getOMFactory(); OMElement orgElement = factory.createOMElement(new QName("root")); orgElement.setText(data.getText()); return new XMLMessage(orgElement, xmlMessageType); }
private static OMElement getSerializedDescription(MessageProcessor processor) { OMElement descriptionElem = fac.createOMElement( new QName(SynapseConstants.SYNAPSE_NAMESPACE, "description")); if (processor.getDescription() != null) { descriptionElem.setText(processor.getDescription()); return descriptionElem; } else { return null; } }
private static OMElement getSerializedDescription(MessageStore messageStore) { OMElement descriptionElem = fac.createOMElement( new QName(SynapseConstants.SYNAPSE_NAMESPACE, "description")); if (messageStore.getDescription() != null) { descriptionElem.setText(messageStore.getDescription()); return descriptionElem; } else { return null; } }
private OMElement createMessageEl(String msgboxid) throws AxisFault { OMElement message = factory.createOMElement("destroyMsgBox", NameSpaceConstants.MSG_BOX); OMElement msgBoxId = factory.createOMElement("MsgBoxId", NameSpaceConstants.MSG_BOX); msgBoxId.setText(msgboxid); message.addChild(msgBoxId); message.declareNamespace(NameSpaceConstants.MSG_BOX); return message; }
public void addDummyElements(long numElements) { OMElement dummies = fac.createOMElement("Dummies", null); msg.addChild(dummies); for (long i = 0; i < numElements; i++) { OMElement dummy = fac.createOMElement("Dummy", null); dummy.setText("This is the dummy element " + i); dummies.addChild(dummy); } }
private OMElement getSerializedDescription(Endpoint endpoint) { OMElement descriptionElem = fac.createOMElement( "description", SynapseConstants.SYNAPSE_OMNAMESPACE); if (endpoint.getDescription() != null) { descriptionElem.setText(endpoint.getDescription()); return descriptionElem; } else { return null; } }
private OMElement getDataElement(DataDTO data, String elementName) { OMFactory fac = OMAbstractFactory.getOMFactory(); OMElement dataElement = fac.createOMElement(new QName(elementName)); dataElement.addAttribute(ID, data.getFieldId(), null); OMElement table = fac.createOMElement(new QName(TABLE)); table.setText(data.getDsTableName()); dataElement.addChild(table); OMElement field = fac.createOMElement(new QName(COLUMN)); field.setText(data.getDsColumnName()); dataElement.addChild(field); return dataElement; }
public void addText(String text) { try { getAxiomElement().setText(text); } catch (OMException ex) { throw new AxiomSoapFaultException(ex); } }
@Override public void addText(String text) { try { getAxiomElement().setText(text); } catch (OMException ex) { throw new AxiomSoapFaultException(ex); } }
@Override public void addText(String text) { try { getAxiomElement().setText(text); } catch (OMException ex) { throw new AxiomSoapFaultException(ex); } }
@Override public void setPayload(OMElement bodyContent) throws XMLStreamException { OMFactory factory = bodyContent.getOMFactory(); OMElement returnElement = factory.createOMElement(new QName(bodyContent.getNamespace().getPrefix() + ":return")); returnElement.setText(String.valueOf(succeed)); bodyContent.addChild(returnElement); }
public OMElement toOMElement(OMElement element, OMNamespace rmNamespace) throws OMException { if (messageNumber <= 0 ){ throw new OMException(SandeshaMessageHelper.getMessage( SandeshaMessageKeys.setAValidMsgNumber, Long.toString(messageNumber))); } OMFactory factory = element.getOMFactory(); OMElement messageNoElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.LAST_MSG_NUMBER,rmNamespace); messageNoElement.setText(Long.toString(messageNumber)); element.addChild(messageNoElement); return element; }
public OMElement toOMElement(OMElement element, OMNamespace wsrmNamespace) throws OMException { if (identifier == null || identifier == "") { throw new OMException(SandeshaMessageHelper.getMessage( SandeshaMessageKeys.invalidIdentifier, element.toString())); } OMFactory factory = element.getOMFactory(); OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER, wsrmNamespace); identifierElement.setText(identifier); element.addChild(identifierElement); return element; }
private static void serializeSQLQueryProps(SQLQuery sqlQuery, OMElement queryEl, OMFactory fac) { OMElement sqlEl = fac.createOMElement(new QName(DBSFields.SQL)); sqlEl.setText(sqlQuery.getQuery()); queryEl.addChild(sqlEl); if (sqlQuery.isReturnGeneratedKeys()) { queryEl.addAttribute(DBSFields.RETURN_GENERATED_KEYS, Boolean.TRUE.toString(), null); } else if (sqlQuery.isReturnUpdatedRowCount()) { queryEl.addAttribute(DBSFields.RETURN_UPDATED_ROW_COUNT, Boolean.TRUE.toString(), null); } }
@Override public void rewrite(List<IdentityToken> credentials, OMElement output) { OMFactory factory = output.getOMFactory(); for (IdentityToken ik: credentials) { OMElement e = factory.createOMElement(ik.getName(), output.getNamespace()); e.setText(ik.getValue()); output.addChild(e); } }
private void updateSubReportParamName(OMElement subReportElement, String paramName) throws JaxenException { AXIOMXPath xpathExpression = new AXIOMXPath("//a:subreportParameter//a:subreportParameterExpression"); xpathExpression.addNamespace("a", "http://jasperreports.sourceforge.net/jasperreports"); List nodeList = xpathExpression.selectNodes(subReportElement); OMElement repExp = (OMElement) nodeList.get(0); repExp.setText(""); OMFactory factory = document.getOMFactory(); OMText cdataField = factory.createOMText(repExp, "$P{" + paramName + "}", OMText.CDATA_SECTION_NODE); repExp.addChild(cdataField); }