当前位置: 首页>>代码示例>>Java>>正文


Java XMLUtils.toOM方法代码示例

本文整理汇总了Java中org.apache.axis2.util.XMLUtils.toOM方法的典型用法代码示例。如果您正苦于以下问题:Java XMLUtils.toOM方法的具体用法?Java XMLUtils.toOM怎么用?Java XMLUtils.toOM使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis2.util.XMLUtils的用法示例。


在下文中一共展示了XMLUtils.toOM方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPropertyFromAxisConf

import org.apache.axis2.util.XMLUtils; //导入方法依赖的package包/类
private static String getPropertyFromAxisConf(String parameter) throws IOException, XMLStreamException {
    try (InputStream file = new FileInputStream(Paths.get(CarbonBaseUtils.getCarbonConfigDirPath(), "axis2",
            "axis2.xml").toString())) {
       if(axis2Config == null) {
           OMElement element = (OMElement) XMLUtils.toOM(file);
           element.build();
           axis2Config = element;
       }
        Iterator parameters = axis2Config.getChildrenWithName(new QName("parameter"));
        while (parameters.hasNext()) {
            OMElement parameterElement = (OMElement) parameters.next();
            if (parameter.equals(parameterElement.getAttribute(new QName("name")).getAttributeValue())) {
                return parameterElement.getText();
            }
        }
        return null;
    } catch (IOException | XMLStreamException e) {
        throw e;
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:21,代码来源:Utils.java

示例2: processEmbeddedEPR

import org.apache.axis2.util.XMLUtils; //导入方法依赖的package包/类
private void processEmbeddedEPR(List extensibilityElements, AxisEndpoint axisEndpoint) {
	Iterator eelts = extensibilityElements.iterator();
	while(eelts.hasNext()){
		ExtensibilityElement ee = (ExtensibilityElement)eelts.next();
		if(AddressingConstants.Final.WSA_ENDPOINT_REFERENCE.equals(ee.getElementType())){
			try {
				Element elt = ((UnknownExtensibilityElement)ee).getElement();
				OMElement eprOMElement = XMLUtils.toOM(elt);
				EndpointReference epr = EndpointReferenceHelper.fromOM(eprOMElement);
				Map referenceParameters = epr.getAllReferenceParameters();
				if(referenceParameters != null){
					axisEndpoint.addParameter(AddressingConstants.REFERENCE_PARAMETER_PARAMETER, new ArrayList(referenceParameters.values()));
				}
			} catch (Exception e) {
				if(log.isDebugEnabled()){
					log.debug("Exception encountered processing embedded wsa:EndpointReference", e);
				}
			}
		}
	}
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:WSDL11ToAxisServiceBuilder.java

示例3: convertToAxis2

import org.apache.axis2.util.XMLUtils; //导入方法依赖的package包/类
/**
 * Convert from a {@link javax.xml.ws.EndpointReference} to a an instance of
 * {@link EndpointReference}.
 * 
 * @param axis2EPR
 * @param jaxwsEPR
 * @return the WS-Addressing namespace of the <code>javax.xml.ws.EndpointReference</code>.
 * @throws Exception
 */
public static String convertToAxis2(EndpointReference axis2EPR, javax.xml.ws.EndpointReference jaxwsEPR)
throws Exception {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    jaxwsEPR.writeTo(new StreamResult(baos));
    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    OMElement eprElement = (OMElement) XMLUtils.toOM(bais);
    
    return EndpointReferenceHelper.fromOM(axis2EPR, eprElement);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:EndpointReferenceUtils.java

示例4: addReferenceParameters

import org.apache.axis2.util.XMLUtils; //导入方法依赖的package包/类
/**
 * 
 * @param axis2EPR
 * @param referenceParameters
 * @throws Exception
 */
public static void addReferenceParameters(EndpointReference axis2EPR, Element...referenceParameters)
throws Exception {
    if (referenceParameters != null) {
        for (Element element : referenceParameters) {
            OMElement omElement = XMLUtils.toOM(element);
            axis2EPR.addReferenceParameter(omElement);
        }            
    }    	
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:16,代码来源:EndpointReferenceUtils.java

示例5: addExtensibleElements

import org.apache.axis2.util.XMLUtils; //导入方法依赖的package包/类
/**
 * 
 * @param axis2EPR
 * @param elements
 * @throws Exception
 */
public static void addExtensibleElements(EndpointReference axis2EPR, Element... elements)
throws Exception {
    if (elements != null) {
        for (Element element : elements) {
            OMElement omElement = XMLUtils.toOM(element);
            axis2EPR.addExtensibleElement(omElement);
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:16,代码来源:EndpointReferenceUtils.java

示例6: addMetadata

import org.apache.axis2.util.XMLUtils; //导入方法依赖的package包/类
/**
 * 
 * @param axis2EPR
 * @param metadata
 * @throws Exception
 */
public static void addMetadata(EndpointReference axis2EPR, Element...metadata)
throws Exception {
    if (metadata != null) {
        for (Element element : metadata) {
            OMElement omElement = XMLUtils.toOM(element);
            axis2EPR.addMetaData(omElement);
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:16,代码来源:EndpointReferenceUtils.java

示例7: deploy

import org.apache.axis2.util.XMLUtils; //导入方法依赖的package包/类
public void deploy(DeploymentFileData deploymentFileData) throws DeploymentException {
    boolean isDirectory = deploymentFileData.getFile().isDirectory();
    ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
    try {
        deploymentFileData.setClassLoader(isDirectory,
                axisConfig.getModuleClassLoader(),
                (File) axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR),
                axisConfig.isChildFirstClassLoading());

        ClassLoader loader = deploymentFileData.getClassLoader();
        Thread.currentThread().setContextClassLoader(loader);
        InputStream xmlStream = loader.getResourceAsStream("META-INF/transport.xml");
        OMElement element = (OMElement) XMLUtils.toOM(xmlStream);
        element.build();
        AxisConfigBuilder builder = new AxisConfigBuilder(axisConfig);
        // Processing Transport Receivers
        Iterator trs_Reivers =
                element.getChildrenWithName(new QName(DeploymentConstants.TAG_TRANSPORT_RECEIVER));
        ArrayList transportReceivers = builder.processTransportReceivers(trs_Reivers);
        for (int i = 0; i < transportReceivers.size(); i++) {
            TransportInDescription transportInDescription = (TransportInDescription) transportReceivers.get(i);
            Parameter paramter = transportInDescription.getParameter("AutoStart");
            if (paramter != null) {
                configCtx.getListenerManager().addListener(transportInDescription, false);
                log.info("starting the transport : " + transportInDescription.getName());
            }
        }

        // Processing Transport Senders
        Iterator trs_senders =
                element.getChildrenWithName(new QName(DeploymentConstants.TAG_TRANSPORT_SENDER));

        builder.processTransportSenders(trs_senders);
        super.deploy(deploymentFileData);
    } catch (Exception e) {
        log.error(e.getMessage());
    } finally {
        Thread.currentThread().setContextClassLoader(contextClassLoader);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:41,代码来源:TransportDeployer.java

示例8: convertToOM

import org.apache.axis2.util.XMLUtils; //导入方法依赖的package包/类
private OMNode convertToOM(XmlSchema schema) throws DataRetrievalException {
    StringWriter writer = new StringWriter();
    schema.write(writer);

    StringReader reader = new StringReader(writer.toString());
    try {
        return XMLUtils.toOM(reader);
    } catch (XMLStreamException e) {
        throw new DataRetrievalException(
                "Can't convert XmlSchema object to an OMElement", e);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:13,代码来源:SchemaDataLocator.java

示例9: populateItems

import org.apache.axis2.util.XMLUtils; //导入方法依赖的package包/类
private void populateItems() throws Exception {
    Map stateList = scxml.getChildren();

    for (Object stateObject : stateList.entrySet()) {

        Map.Entry state = (Map.Entry) stateObject;

        String currentStateName = (String) state.getKey();
        State currentState = (State) state.getValue();
        Datamodel model = currentState.getDatamodel();

        states.add(currentStateName);
        if (model != null) {
            List dataList = model.getData();
            for (Object dataObject : dataList) {
                Data data = (Data) dataObject;
                OMElement node = XMLUtils.toOM((Element) data.getNode());
                /*
                * when associating we will map the custom data model to a set of beans.
                * These will be used for further actions.
                * */
                populateCheckItems(currentStateName, node,checkListItems);
                populateTransitionValidations(currentStateName, node,transitionValidations);
                populateTransitionPermissions(currentStateName, node,transitionPermission);
                populateTransitionScripts(currentStateName, node,scriptElements);
                populateTransitionUIs(currentStateName, node,transitionUIs);
                populateTransitionExecutors(currentStateName, node,transitionExecution);
                populateTransitionApprovals(currentStateName,node,transitionApproval);
                populateTransitionInputs(currentStateName,node,transitionInputs);
            }
        }

        List<String> events = new ArrayList<String>();
        for (Object t : currentState.getTransitionsList()) {
            Transition transition = (Transition) t;
            events.add(transition.getEvent());
        }
        stateEvents.put(currentStateName, events);
    }
}
 
开发者ID:wso2,项目名称:carbon-governance,代码行数:41,代码来源:DefaultLifeCycle.java

示例10: getElementString

import org.apache.axis2.util.XMLUtils; //导入方法依赖的package包/类
public static String getElementString(Element element) throws Exception {
	OMElement om = XMLUtils.toOM(element);
	return XMLUtil.prettify(om);
}
 
开发者ID:wso2,项目名称:developer-studio,代码行数:5,代码来源:XMLUtil.java

示例11: getAxisServiceFromWsdl

import org.apache.axis2.util.XMLUtils; //导入方法依赖的package包/类
public List<AxisService> getAxisServiceFromWsdl(InputStream in,
                                       ClassLoader loader, String wsdlUrl) throws Exception {
//         ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());

        // now the question is which version of WSDL file this archive contains.
        // lets check the namespace of the root element and decide. But since we are
        // using axiom (dude, you are becoming handy here :)), we will not build the
        // whole thing.
        OMElement element = (OMElement) XMLUtils.toOM(in);
        OMNamespace documentElementNS = element.getNamespace();
        if (documentElementNS != null) {
            WSDLToAxisServiceBuilder wsdlToAxisServiceBuilder;
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            element.serialize(out);
            if (Constants.NS_URI_WSDL11.
                    equals(documentElementNS.getNamespaceURI())) {
                wsdlToAxisServiceBuilder = new WSDL11ToAllAxisServicesBuilder(
                        new ByteArrayInputStream(out.toByteArray()));
                ((WSDL11ToAllAxisServicesBuilder)wsdlToAxisServiceBuilder).setCustomWSDLResolver(new WarBasedWSDLLocator(wsdlUrl,
                                                                                         loader,
                                                                                         new ByteArrayInputStream(
                                                                                                 out.toByteArray())));
                wsdlToAxisServiceBuilder.setCustomResolver(
                        new WarFileBasedURIResolver(loader));
                return ((WSDL11ToAllAxisServicesBuilder)wsdlToAxisServiceBuilder).populateAllServices();
            } else if (WSDL2Constants.WSDL_NAMESPACE.
                    equals(documentElementNS.getNamespaceURI())){
                wsdlToAxisServiceBuilder = new WSDL20ToAllAxisServicesBuilder(
                        new ByteArrayInputStream(out.toByteArray()));
                ((WSDL20ToAllAxisServicesBuilder)wsdlToAxisServiceBuilder).setCustomWSDLResolver(new WarBasedWSDLLocator(wsdlUrl,
                                                                                         loader,
                                                                                         new ByteArrayInputStream(
                                                                                                 out.toByteArray())));
                wsdlToAxisServiceBuilder.setCustomResolver(
                        new WarFileBasedURIResolver(loader));
                return ((WSDL20ToAllAxisServicesBuilder)wsdlToAxisServiceBuilder).populateAllServices();
            }
            else {
                throw new DeploymentException(Messages.getMessage("invalidWSDLFound"));
            }
        }
        return null;
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:44,代码来源:ArchiveReader.java

示例12: buildOM

import org.apache.axis2.util.XMLUtils; //导入方法依赖的package包/类
/**
 * Creates OMElement for a given description document (axis2.xml ,
 * services.xml and module.xml).
 *
 * @return Returns <code>OMElement</code> .
 * @throws javax.xml.stream.XMLStreamException
 *
 */
public OMElement buildOM() throws XMLStreamException {
    OMElement element = (OMElement) XMLUtils.toOM(descriptionStream);
    element.build();
    return element;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:14,代码来源:DescriptionBuilder.java


注:本文中的org.apache.axis2.util.XMLUtils.toOM方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。