use of org.apache.axiom.soap.SOAPFaultCode in project webservices-axiom by apache.
the class TestSetValueFromQName method runTest.
@Override
protected void runTest() throws Throwable {
SOAPFaultCode code = soapFactory.getDefaultFaultEnvelope().getBody().getFault().getCode();
code.setValue(new QName("urn:test", "MyFaultCode", "p"));
assertEquals("p:MyFaultCode", code.getText());
Iterator<OMNamespace> it = code.getAllDeclaredNamespaces();
assertTrue(it.hasNext());
OMNamespace ns = it.next();
assertEquals("p", ns.getPrefix());
assertEquals("urn:test", ns.getNamespaceURI());
}
use of org.apache.axiom.soap.SOAPFaultCode in project webservices-axiom by apache.
the class TestMoreChildrenAddition method runTest.
@Override
protected void runTest() throws Throwable {
SOAPEnvelope envelope = soapFactory.getDefaultFaultEnvelope();
SOAPEnvelope soapEnvelope = soapFactory.getDefaultFaultEnvelope();
String errorCodeString = "Some Error occurred !!";
soapEnvelope.getBody().getFault().getCode().getValue().setText(errorCodeString);
SOAPFaultCode code = soapEnvelope.getBody().getFault().getCode();
envelope.getBody().getFault().setCode(code);
assertTrue("Parent Value of Code has not been set to new fault", code.getParent() == envelope.getBody().getFault());
assertTrue("Parent Value of Code is still pointing to old fault", code.getParent() != soapEnvelope.getBody().getFault());
assertNull("Old fault must not have a fault code", soapEnvelope.getBody().getFault().getCode());
assertEquals("The SOAP Code value must be " + errorCodeString, errorCodeString, envelope.getBody().getFault().getCode().getValue().getText());
}
use of org.apache.axiom.soap.SOAPFaultCode in project webservices-axiom by apache.
the class TestGetValueWithParser method runTest.
@Override
protected void runTest(SOAPEnvelope envelope) throws Throwable {
SOAPFaultCode faultCode = envelope.getBody().getFault().getCode();
assertNotNull("SOAP 1.2 Fault Code Test with parser : - getValue method returns null", faultCode.getValue());
assertEquals("SOAP 1.2 Fault Code Test with parser : - Value local name mismatch", SOAP12Constants.SOAP_FAULT_VALUE_LOCAL_NAME, faultCode.getValue().getLocalName());
}
use of org.apache.axiom.soap.SOAPFaultCode in project webservices-axiom by apache.
the class SOAP12Factory method getDefaultFaultEnvelope.
@Override
public final SOAPEnvelope getDefaultFaultEnvelope() {
SOAPEnvelope defaultEnvelope = getDefaultEnvelope();
SOAPFault fault = createSOAPFault(defaultEnvelope.getBody());
SOAPFaultCode faultCode = createSOAPFaultCode(fault);
createSOAPFaultValue(faultCode);
SOAPFaultReason reason = createSOAPFaultReason(fault);
createSOAPFaultText(reason);
createSOAPFaultDetail(fault);
return defaultEnvelope;
}
use of org.apache.axiom.soap.SOAPFaultCode in project webservices-axiom by apache.
the class TestGetValueAsQNameWithParser method runTest.
@Override
protected void runTest(SOAPEnvelope envelope) throws Throwable {
SOAPFaultCode faultCode = envelope.getBody().getFault().getCode();
assertEquals(spec.getReceiverFaultCode(), faultCode.getValueAsQName());
}
Aggregations