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);
private static void serializeEndpoints(OMElement definitions, Map<String, Endpoint> endpoints) { for (Endpoint endpoint: endpoints.values()) { definitions.addChild(EndpointSerializer.getElementFromEndpoint(endpoint)); } }
private static void serializeAPIs(OMElement definitions, Collection<API> apiSet) { for (API api : apiSet) { OMElement apiElt = APISerializer.serializeAPI(api); definitions.addChild(apiElt); } }
protected void serializeDBInformation(AbstractDBMediator mediator, OMElement dbParent) { OMElement connElt = fac.createOMElement("connection", synNS); connElt.addChild(createPoolElement(mediator)); dbParent.addChild(connElt); // process statements for (Statement statement : mediator.getStatementList()) { dbParent.addChild(createStatementElement(statement)); } }
/** * @deprecated */ public static void setNewElement(OMElement parent, OMElement myElement, OMElement newElement) { if (myElement != null) { myElement.discard(); } parent.addChild(newElement); }
private void serializeBody(OMElement templateElem, List<Mediator> childMediatorList){ OMElement seqEl = fac.createOMElement("sequence", synNS); templateElem.addChild(seqEl); serializeChildren(seqEl, childMediatorList); }
public void writeDataHandler(DataHandlerProvider dataHandlerProvider, String contentID, boolean optimize) throws IOException, XMLStreamException { parent.addChild(factory.createOMText(contentID, dataHandlerProvider, optimize)); } }
public static void addExtensionElement(OMFactory fac, OMElement element, String name, String att1Name, String att1Value, OMNamespace soapNameSpace) { OMElement extElement = fac.createOMElement(name, soapNameSpace); element.addChild(extElement); extElement.addAttribute(att1Name, att1Value, null); }
public static OMElement generateDocumentationElement(AxisDescription axisDescription, OMFactory omFactory, OMNamespace wsdl) { OMNode documentationNode = axisDescription.getDocumentationNode(); OMElement documentation; if (documentationNode != null) { documentation = omFactory.createOMElement(WSDL2Constants.DOCUMENTATION, wsdl); documentation.addChild(documentationNode); return documentation; } return null; }
public static void addWSDLDocumentationElement(AxisDescription axisDescription, OMElement omElement, OMFactory omFactory, OMNamespace wsdl) { OMElement documentation = generateDocumentationElement(axisDescription, omFactory, wsdl); if (documentation != null) { omElement.addChild(documentation); } }
private OMElement createElement() { OMFactory factory = OMAbstractFactory.getOMFactory(); OMText textNode = factory.createOMText(genericContent, true); OMElement wrapperElement = factory.createOMElement(unknownContentQName); wrapperElement.addChild(textNode); return wrapperElement; } }
public static void serializeResourceMap(OMElement parent, ResourceMap resourceMap) { if (resourceMap != null) { for (Map.Entry<String,String> entry : resourceMap.getResources().entrySet()) { OMElement resource = fac.createOMElement("resource", SynapseConstants.SYNAPSE_OMNAMESPACE); resource.addAttribute("location", (String)entry.getKey(), null); resource.addAttribute("key", (String)entry.getValue(), null); parent.addChild(resource); } } } }
private void addExtensionElement(OMFactory fac, OMElement element, String name, String att1Name, String att1Value, String att2Name, String att2Value, OMNamespace soapNameSpace) { OMElement soapbinding = fac.createOMElement(name, soapNameSpace); element.addChild(soapbinding); soapbinding.addAttribute(att1Name, att1Value, null); if (att2Name != null) { soapbinding.addAttribute(att2Name, att2Value, null); } }
@Override protected OMElement serializeSpecificMediator(Mediator m) { assert m != null : "mediator cannot be null"; assert m instanceof EnrichMediator : "mediator should be of type EnrichMediator"; EnrichMediator mediator = (EnrichMediator) m; OMElement enrichEle = fac.createOMElement("enrich", synNS); OMElement sourceEle = serializeSource(mediator.getSource()); OMElement targetEle = serializeTarget(mediator.getTarget()); enrichEle.addChild(sourceEle); enrichEle.addChild(targetEle); return enrichEle; }
public void writeDataHandler(DataHandler dataHandler, String contentID, boolean optimize) throws IOException, XMLStreamException { OMText child = factory.createOMText(dataHandler, optimize); if (contentID != null) { child.setContentID(contentID); } parent.addChild(child); }
public static OMElement createValidateTargetElement(int version, OMElement parent, OMElement str) throws TrustException { OMElement validateTarget = createOMElement(parent, getWSTNamespace(version), RahasConstants.LocalNames.VALIDATE_TARGET, RahasConstants.WST_PREFIX); validateTarget.addChild(str); return validateTarget; }
private void copyAllAssociations(Registry registry, String newPath, String path, OMElement historyOperation) throws RegistryException { if (copyAllAssociations) { Utils.copyAssociations(registry, newPath, path); historyOperation.addChild(getHistoryInfoElement("All associations copied")); } }
@Override public Object wrap(OMElement template, OMElement os) { OMElement wrapper; if (os != null) { OMNamespace ns = os.declareNamespace(template.getNamespace().getNamespaceURI(), ""); wrapper = factory.createOMElement(template.getLocalName(), ns); wrapper.addChild(os); } else { wrapper = template.cloneOMElement(); } return wrapper; }
public static void setBinaryPayload(SOAPEnvelope envelope, DataHandler dh) { OMFactory fac = envelope.getOMFactory(); OMElement binaryElt = envelope.getOMFactory() .createOMElement(BINARYELT); OMText text = fac.createOMText(dh, true); binaryElt.addChild(text); setXMLPayload(envelope, binaryElt); }
public static void setTextPayload(SOAPEnvelope envelope, String text) { OMFactory fac = envelope.getOMFactory(); OMElement textElt = envelope.getOMFactory().createOMElement(TEXTELT); OMText textNode = fac.createOMText(text); textElt.addChild(textNode); setXMLPayload(envelope, textElt); }