Search in sources :

Example 6 with SOAPFaultReason

use of org.apache.axiom.soap.SOAPFaultReason in project webservices-axiom by apache.

the class TestAddSOAPTextMultiple method runTest.

@Override
protected void runTest() throws Throwable {
    SOAPFaultReason reason = soapFactory.createSOAPFaultReason();
    SOAPFaultText text1 = soapFactory.createSOAPFaultText();
    text1.setLang("en");
    text1.setText("System error");
    reason.addSOAPText(text1);
    SOAPFaultText text2 = soapFactory.createSOAPFaultText();
    text2.setLang("de");
    text2.setText("Systemfehler");
    reason.addSOAPText(text2);
    OMNode child = reason.getFirstOMChild();
    assertThat(child).isSameAs(text1);
    child = child.getNextOMSibling();
    assertThat(child).isSameAs(text2);
}
Also used : OMNode(org.apache.axiom.om.OMNode) SOAPFaultReason(org.apache.axiom.soap.SOAPFaultReason) SOAPFaultText(org.apache.axiom.soap.SOAPFaultText)

Example 7 with SOAPFaultReason

use of org.apache.axiom.soap.SOAPFaultReason in project webservices-axiom by apache.

the class TestAddSOAPTextWithSOAPVersionMismatch method runTest.

@Override
protected void runTest() throws Throwable {
    SOAPFault soap12Fault = soapFactory.createSOAPFault();
    SOAPFaultReason soap12FaultReason = soapFactory.createSOAPFaultReason(soap12Fault);
    SOAPFault soap11Fault = altSoapFactory.createSOAPFault();
    SOAPFaultReason soap11FaultReason = altSoapFactory.createSOAPFaultReason(soap11Fault);
    try {
        soap12FaultReason.addSOAPText(altSoapFactory.createSOAPFaultText(soap11FaultReason));
        fail("SOAP11FaultText should not be added to SOAP12FaultReason");
    } catch (Exception e) {
        assertTrue(true);
    }
}
Also used : SOAPFaultReason(org.apache.axiom.soap.SOAPFaultReason) SOAPFault(org.apache.axiom.soap.SOAPFault)

Example 8 with SOAPFaultReason

use of org.apache.axiom.soap.SOAPFaultReason in project webservices-axiom by apache.

the class TestGetFaultReasonTextCaseSensitivity method runTest.

@Override
protected void runTest() throws Throwable {
    SOAPFaultReason reason = soapFactory.createSOAPFaultReason();
    SOAPFaultText text = soapFactory.createSOAPFaultText(reason);
    text.setLang("EN-US");
    text.setText("Some reason");
    assertThat(reason.getFaultReasonText(Locale.ENGLISH)).isEqualTo("Some reason");
}
Also used : SOAPFaultReason(org.apache.axiom.soap.SOAPFaultReason) SOAPFaultText(org.apache.axiom.soap.SOAPFaultText)

Example 9 with SOAPFaultReason

use of org.apache.axiom.soap.SOAPFaultReason 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);
    assertTrue("SOAP 1.2 FaultReason Test : - After creating SOAP12FaultReason, it has a SOAPFaultText", faultReason.getFirstSOAPText() == null);
    faultReason.addSOAPText(soapFactory.createSOAPFaultText(faultReason));
    assertFalse("SOAP 1.2 FaultReason Test : - After calling addSOAPText, getFirstSOAPText returns null", faultReason.getFirstSOAPText() == null);
}
Also used : SOAPFaultReason(org.apache.axiom.soap.SOAPFaultReason) SOAPFault(org.apache.axiom.soap.SOAPFault)

Example 10 with SOAPFaultReason

use of org.apache.axiom.soap.SOAPFaultReason in project webservices-axiom by apache.

the class TestGetFirstSOAPTextWithParser method runTest.

@Override
protected void runTest(SOAPEnvelope envelope) throws Throwable {
    SOAPFaultReason faultReason = envelope.getBody().getFault().getReason();
    assertFalse("SOAP 1.2 FaultReason Test With Parser : - getFirstSOAPText method returns null", faultReason.getFirstSOAPText() == null);
}
Also used : SOAPFaultReason(org.apache.axiom.soap.SOAPFaultReason)

Aggregations

SOAPFaultReason (org.apache.axiom.soap.SOAPFaultReason)16 SOAPFault (org.apache.axiom.soap.SOAPFault)10 SOAPEnvelope (org.apache.axiom.soap.SOAPEnvelope)5 SOAPFaultText (org.apache.axiom.soap.SOAPFaultText)5 OMElement (org.apache.axiom.om.OMElement)4 SOAPFaultCode (org.apache.axiom.soap.SOAPFaultCode)4 StringReader (java.io.StringReader)3 OMNode (org.apache.axiom.om.OMNode)3 SOAPBody (org.apache.axiom.soap.SOAPBody)3 SOAPFaultDetail (org.apache.axiom.soap.SOAPFaultDetail)3 SOAPFaultRole (org.apache.axiom.soap.SOAPFaultRole)3 QName (javax.xml.namespace.QName)2 OMAttribute (org.apache.axiom.om.OMAttribute)2 OMXMLParserWrapper (org.apache.axiom.om.OMXMLParserWrapper)2 SOAPFaultNode (org.apache.axiom.soap.SOAPFaultNode)2 SOAPFaultSubCode (org.apache.axiom.soap.SOAPFaultSubCode)2 SOAPFaultValue (org.apache.axiom.soap.SOAPFaultValue)2 SOAPHeader (org.apache.axiom.soap.SOAPHeader)2 SOAPHeaderBlock (org.apache.axiom.soap.SOAPHeaderBlock)2 XMLStreamReader (javax.xml.stream.XMLStreamReader)1