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


Java OMElement.getNamespace方法代码示例

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


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

示例1: deleteEmployeeById

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private void deleteEmployeeById(String employeeNumber) throws AxisFault {
    OMElement result;
    OMElement payload = fac.createOMElement("deleteEmployeeById", omNs);

    OMElement empNo = fac.createOMElement("employeeNumber", omNs);
    empNo.setText(employeeNumber);
    payload.addChild(empNo);

    result = new AxisServiceClient().sendReceive(payload, serviceEndPoint, "deleteEmployeeById");

    Assert.assertTrue(result.toString().contains("SUCCESSFUL"), "Response Not Successful");
    OMNamespace nameSpace = result.getNamespace();
    Assert.assertNotNull(nameSpace.getPrefix(), "Invalid prefix. prefix value null");
    Assert.assertNotSame(nameSpace.getPrefix(), "", "Invalid prefix");
    Assert.assertEquals(nameSpace.getNamespaceURI(), "http://ws.wso2.org/dataservice", "Invalid NamespaceURI");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:17,代码来源:ReturnRequestStatusTest.java

示例2: getStatus

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * Helper method to extract the boolean response
 *
 * @param xmlstring XACML resource as String
 * @return Decision
 * @throws Exception if fails
 */
public static String getStatus(String xmlstring) throws Exception {

    OMElement response = null;
    OMElement result = null;
    OMElement decision = null;
    response = AXIOMUtil.stringToOM(xmlstring);

    OMNamespace nameSpace = response.getNamespace();

    if (nameSpace != null) {
        result = response.getFirstChildWithName(new QName(nameSpace.getNamespaceURI(), "Result"));
    } else {
        result = response.getFirstElement();
    }
    if (result != null) {
        if (nameSpace != null) {
            decision = result.getFirstChildWithName(new QName(nameSpace.getNamespaceURI(), "Decision"));
        } else {
            decision = result.getFirstChildWithName(new QName("Decision"));
        }
        if (decision != null) {
            return decision.getText();
        }
    }

    return "Invalid Status";
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:35,代码来源:ClientUtil.java

示例3: addEmployee

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private void addEmployee(String serviceEndPoint, String employeeNumber) throws AxisFault {
    OMElement result;

    result = new AxisServiceClient().sendReceive(getAddEmployeePayload(employeeNumber), serviceEndPoint, "addEmployee");
    Assert.assertTrue(result.toString().contains("SUCCESSFUL"), "Response Not Successful");
    OMNamespace nameSpace = result.getNamespace();
    Assert.assertNotNull(nameSpace, "Response Message NameSpace not qualified");
    Assert.assertNotNull(nameSpace.getPrefix(), "Invalid prefix. prefix value null");
    Assert.assertNotSame(nameSpace.getPrefix(), "", "Invalid prefix");
    Assert.assertEquals(nameSpace.getNamespaceURI(), "http://ws.wso2.org/dataservice", "Invalid NamespaceURI");


}
 
开发者ID:wso2,项目名称:product-ei,代码行数:14,代码来源:ReturnRequestStatusTest.java


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