use of org.apache.axiom.soap.SOAPFault in project webservices-axiom by apache.
the class TestAddSOAPText method runTest.
@Override
protected void runTest() throws Throwable {
SOAPFault fault = soapFactory.createSOAPFault();
SOAPFaultReason faultReason = soapFactory.createSOAPFaultReason(fault);
boolean gotFault = false;
try {
faultReason.addSOAPText(soapFactory.createSOAPFaultText(faultReason));
} catch (UnsupportedOperationException e) {
// Cool, continue.
gotFault = true;
}
assertTrue("Didn't get expected Exception for addSOAPText()!", gotFault);
}
use of org.apache.axiom.soap.SOAPFault in project webservices-axiom by apache.
the class TestGetTextWithCDATA method runTest.
@Override
protected void runTest() throws Throwable {
String soap11Fault = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<SOAP-ENV:Body>" + "<SOAP-ENV:Fault>" + "<faultcode>SOAP-ENV:Server</faultcode>" + "<faultstring xml:lang=\"en\"><![CDATA[handleMessage throws SOAPFaultException for ThrowsSOAPFaultToClientHandlersTest]]></faultstring>" + "<detail>" + "<somefaultentry/>" + "</detail>" + "<faultactor>faultActor</faultactor>" + "</SOAP-ENV:Fault>" + "</SOAP-ENV:Body>" + "</SOAP-ENV:Envelope>";
XMLStreamReader soap11Parser = StAXUtils.createXMLStreamReader(TEST_PARSER_CONFIGURATION, new StringReader(soap11Fault));
SOAPModelBuilder soap11Builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(metaFactory, soap11Parser);
OMElement element = soap11Builder.getDocumentElement();
element.build();
assertTrue(element instanceof SOAPEnvelope);
SOAPEnvelope se = (SOAPEnvelope) element;
SOAPFault fault = se.getBody().getFault();
SOAPFaultReason reason = fault.getReason();
assertTrue(reason.getText().equals("handleMessage throws SOAPFaultException for ThrowsSOAPFaultToClientHandlersTest"));
soap11Parser.close();
}
use of org.apache.axiom.soap.SOAPFault in project webservices-axiom by apache.
the class TestGetFirstSOAPText method runTest.
@Override
protected void runTest() throws Throwable {
SOAPFault fault = soapFactory.createSOAPFault();
SOAPFaultReason faultReason = soapFactory.createSOAPFaultReason(fault);
try {
faultReason.getFirstSOAPText();
} catch (UnsupportedOperationException e) {
// Cool, continue.
return;
}
fail("Didn't get expected Exception for getFirstSOAPText()!");
}
use of org.apache.axiom.soap.SOAPFault in project webservices-axiom by apache.
the class TestWrongParent2 method runTest.
@Override
protected void runTest() throws Throwable {
SOAPFault parent = soapFactory.createSOAPFault();
OMElement child1 = soapFactory.createSOAPFaultCode(parent);
SOAPHeaderBlock hb = soapFactory.createSOAPHeaderBlock("MyHeader", soapFactory.createOMNamespace("urn:test", "p"));
try {
child1.insertSiblingAfter(hb);
fail("Expected SOAPProcessingException");
} catch (SOAPProcessingException ex) {
// Expected
}
}
use of org.apache.axiom.soap.SOAPFault in project webservices-axiom by apache.
the class TestSetNode method runTest.
@Override
protected void runTest() throws Throwable {
SOAPFault soapFault = soapFactory.createSOAPFault();
try {
soapFault.setNode(soapFactory.createSOAPFaultNode(soapFault));
} catch (UnsupportedOperationException e) {
// Exactly!
return;
}
fail("Didn't get UnsupportedOperationException");
}
Aggregations