本文整理匯總了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");
}