Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFaultDetail


    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
        SOAPBody body = soapFactory.createSOAPBody(envelope);
        SOAPFault fault = soapFactory.createSOAPFault(body);
        SOAPFaultDetail soapFaultDetail = soapFactory.createSOAPFaultDetail(fault);
        OMNamespace omNamespace = soapFactory.createOMNamespace("http://www.test.org", "test");
        soapFaultDetail.addDetailEntry(
                soapFactory.createOMElement("DetailEntry1", omNamespace));
        soapFaultDetail.addDetailEntry(
                soapFactory.createOMElement("DetailEntry2", omNamespace));
        StringWriter out = new StringWriter();
        soapFaultDetail.serialize(out);
        String msg = out.toString();
        System.out.println(msg);
        assertTrue(msg.indexOf("DetailEntry1") != -1);
        assertTrue(msg.indexOf("DetailEntry2") != -1);
    }
View Full Code Here


    }

    @Override
    public SoapFaultDetail getFaultDetail() {
        try {
            SOAPFaultDetail axiomFaultDetail = getAxiomFault().getDetail();
            return axiomFaultDetail != null ? new AxiomSoapFaultDetail(axiomFaultDetail, getAxiomFactory()) : null;
        }
        catch (OMException ex) {
            throw new AxiomSoapFaultException(ex);
        }
View Full Code Here

    }

    @Override
    public SoapFaultDetail addFaultDetail() {
        try {
            SOAPFaultDetail axiomFaultDetail = getAxiomFactory().createSOAPFaultDetail(getAxiomFault());
            return new AxiomSoapFaultDetail(axiomFaultDetail, getAxiomFactory());
        }
        catch (OMException ex) {
            throw new AxiomSoapFaultException(ex);
        }
View Full Code Here

   
    SOAPFaultReason reason = factory.createSOAPFaultReason();
    SOAPFaultText reasonText = factory.createSOAPFaultText();
    reasonText.setText(data.getReason());
   
    SOAPFaultDetail detail = factory.createSOAPFaultDetail();
    detail.addDetailEntry(data.getDetail());
   
    String SOAPNamespaceValue = factory.getSoapVersionURI();
   
    if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(SOAPNamespaceValue)) {
      reason.addSOAPText(reasonText);
View Full Code Here

          faultPart.getCode().getSubCode().getValue() != null)
       
        soapFaultSubcode = faultPart.getCode().getSubCode().getValue().getTextAsQName().getLocalPart();
     
      // Get the identifier, if there is one.
      SOAPFaultDetail detail = faultPart.getDetail();
      if (detail != null)
      {
        OMElement identifierOM = detail.getFirstChildWithName(new QName(rmMsgCtx.getRMNamespaceValue(),
          Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
        if (identifierOM != null)
          identifier = identifierOM.getText();
      }
     
View Full Code Here

    }
   
    if (data!=null && data.getReason()!=null)
      faultText.setText(data.getReason());

    SOAPFaultDetail faultDetail = fault.getDetail();

    OMElement detailElement = data.getDetail();

    if (detailElement != null)
      faultDetail.addChild(detailElement);

   
    faultMsgContext.setWSAAction(AddressingConstants.Final.WSA_FAULT_ACTION);
  }
View Full Code Here

    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);
        assertEquals(SOAPConstants.SOAP_FAULT_DETAIL_EXCEPTION_ENTRY, entry.getLocalName());
        assertNull(entry.getNamespace());
View Full Code Here

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

    protected void runTest() throws Throwable {
        SOAPFaultDetail detail = soapFactory.createSOAPFaultDetail();
        assertEquals(spec.getFaultDetailQName(), detail.getQName());
    }
View Full Code Here

        int numDetailBlocks = getNumDetailBlocks();

        Block[] blocks = null;
        if (numDetailBlocks > 0) {
            blocks = new Block[numDetailBlocks];
            SOAPFaultDetail detail = root.getBody().getFault().getDetail();
            for (int i = 0; i < numDetailBlocks; i++) {
                OMElement om = this._getChildOMElement(detail, i);
                blocks[i] = this._getBlockFromOMElement(om, null, obf, false);

            }
View Full Code Here

    }
   
    private static Block[] getDetailBlocks(SOAPFault soapFault) throws WebServiceException {
        try {
            Block[] blocks = null;
            SOAPFaultDetail detail = soapFault.getDetail();
            if (detail != null) {
                // Create a block for each element
                OMBlockFactory bf =
                        (OMBlockFactory) FactoryRegistry.getFactory(OMBlockFactory.class);
                ArrayList<Block> list = new ArrayList<Block>();
                Iterator it = detail.getChildElements();
                while (it.hasNext()) {
                    OMElement om = (OMElement) it.next();
                    Block b = bf.createFrom(om, null, om.getQName());
                    list.add(b);
                }
View Full Code Here

TOP

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

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.