Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFault


   
    SOAPEnvelope envelope = rmMsgCtx.getSOAPEnvelope();
    if (envelope==null)
      return response;
   
    SOAPFault faultPart = envelope.getBody().getFault();

    if (faultPart != null) {
      Transaction transaction = null;

      try {
View Full Code Here


          SandeshaMessageKeys.soapEnvNotSet));

    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil
        .getSOAPVersion(faultMsgEnvelope));

    SOAPFault fault = faultMsgEnvelope.getBody().getFault();

    if (data.getExceptionString() != null)
      fault.getDetail().setText(data.getExceptionString());
   
    //SequenceFault header is added only for SOAP 1.1
    if (isSequenceFault(data))
      addSequenceFaultHeader(faultMsgContext, data, factory, rmNamespaceValue);
View Full Code Here

          SandeshaMessageKeys.soapEnvNotSet));

    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil
        .getSOAPVersion(faultEnvelope));

    SOAPFault fault = faultEnvelope.getBody().getFault();
    if (fault == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.noFaultCode,
          faultEnvelope.toString()));

    SOAPFaultCode faultCode = fault.getCode();
    SOAPFaultValue codeValue = faultCode.getValue();
    codeValue.setText(data.getCode());

    SOAPFaultSubCode faultSubCode = factory
        .createSOAPFaultSubCode(faultCode);
    SOAPFaultValue subCodeValue = factory
        .createSOAPFaultValue(faultSubCode);
    subCodeValue.setText(data.getSubcode());

    SOAPFaultReason faultReason = fault.getReason();
    SOAPFaultText faultText = faultReason.getSOAPFaultText("en");
   
    if (faultText==null) {
      faultText = factory.createSOAPFaultText();
      faultReason.addSOAPText(faultText);
    }
   
    if (data!=null && data.getReason()!=null)
      faultText.setText(data.getReason());

    SOAPFaultDetail faultDetail = fault.getDetail();

    OMElement detailElement = data.getDetail();

    if (detailElement != null)
      faultDetail.addChild(detailElement);
View Full Code Here

    public TestSetNode(OMMetaFactory metaFactory) {
        super(metaFactory, SOAPSpec.SOAP11);
    }

    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");
View Full Code Here

    public TestGetNode(OMMetaFactory metaFactory) {
        super(metaFactory, SOAPSpec.SOAP11);
    }

    protected void runTest() throws Throwable {
        SOAPFault soapFault = soapFactory.createSOAPFault();
        // TODO: LLOM returns null while DOM throws UnsupportedOperationException
        try {
            assertNull(
                    "SOAP 1.1 Fault Test:- After creating a SOAP11Fault, it has a node",
                    soapFault.getNode());
        } catch (UnsupportedOperationException ex) {
            // This is also fine.
        }
    }
View Full Code Here

    public TestGetRoleWithParser(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFault soapFaultWithParser = getTestMessage(MESSAGE).getBody().getFault();
        assertNotNull(
                "Fault Test with parser: - getRole method returns null",
                soapFaultWithParser.getRole());
        assertEquals(
                "Fault Test with parser: - Fault role local name mismatch",
                spec.getFaultRoleQName(), soapFaultWithParser.getRole().getQName());
    }
View Full Code Here

    public TestSetRole(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFault soapFault = soapFactory.createSOAPFault();
        soapFault.setRole(soapFactory.createSOAPFaultRole(soapFault));
        assertNotNull(
                "Fault Test:- After calling setRole method, Fault has no role",
                soapFault.getRole());
        assertEquals("Fault Test:- Fault role local name mismatch",
                spec.getFaultRoleQName(), soapFault.getRole().getQName());
        try {
            soapFault.setRole(altSoapFactory.createSOAPFaultRole());
            fail("SOAPFaultRole should not be set in to a SOAPFault for a different SOAP version");
        } catch (Exception e) {
            assertTrue(true);
        }
    }
View Full Code Here

    public TestSetCode(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFault soapFault = soapFactory.createSOAPFault();
        soapFault.setCode(soapFactory.createSOAPFaultCode(soapFault));
        assertNotNull(
                "Fault Test:- After calling setCode method, Fault has no code",
                soapFault.getCode());
        assertEquals("Fault Test:- Code local name mismatch",
                spec.getFaultCodeQName(), soapFault.getCode().getQName());
        try {
            soapFault.setCode(altSoapFactory.createSOAPFaultCode());
            fail("SOAPFaultCode should not be set in to a SOAPFault for a different SOAP version");
        } catch (Exception e) {
            // Expected
        }
    }
View Full Code Here

    public TestSetException(OMMetaFactory metaFactory, SOAPSpec spec) {
        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPFault fault = soapFactory.createSOAPFault();
        Exception exception = new Exception("Test exception message");
        fault.setException(exception);
        SOAPFaultDetail detail = fault.getDetail();
        assertNotNull(detail);
        Iterator it = detail.getAllDetailEntries();
        assertTrue(it.hasNext());
        OMElement entry = (OMElement)it.next();
        assertNotNull(entry);
View Full Code Here

    }

    protected void runTest() throws Throwable {
        OMElement parent = soapFactory.createOMElement("parent", null);
        OMElement child1 = soapFactory.createOMElement("child1", null, parent);
        SOAPFault fault = soapFactory.createSOAPFault();
        try {
            child1.insertSiblingBefore(fault);
            fail("Expected SOAPProcessingException");
        } catch (SOAPProcessingException ex) {
            // Expected
View Full Code Here

TOP

Related Classes of org.apache.axiom.soap.SOAPFault

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.