本文整理汇总了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");
}
示例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";
}
示例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");
}