當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。