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


   
    SOAPFaultReason reason = factory.createSOAPFaultReason();
    SOAPFaultText reasonText = factory.createSOAPFaultText();
    reasonText.setText(data.getReason());
   
    SOAPFaultDetail detail = factory.createSOAPFaultDetail();
    if (data.getDetail() != null)
      detail.addDetailEntry(data.getDetail());
   
    String SOAPNamespaceValue = factory.getSoapVersionURI();
   
    if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(SOAPNamespaceValue)) {
                        reasonText.setLang(Sandesha2Constants.LANG_EN);
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))
    {
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 && !isSOAP11SequenceUnknownFault)
    {
      // At this point we may not know what RM NS is in use.
      OMElement identifierOM = detail.getFirstChildWithName(new QName(Sandesha2Constants.SPEC_2005_02.NS_URI,
              Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
      if (identifierOM != null){
        identifier = identifierOM.getText();
      }else{
        identifierOM = detail.getFirstChildWithName(new QName(Sandesha2Constants.SPEC_2007_02.NS_URI,
            Sandesha2Constants.WSRM_COMMON.IDENTIFIER));
        if (identifierOM != null){
          identifier = identifierOM.getText();
        }
      }
View Full Code Here

                OMElement detail = soapFactory
                        .createOMElement(new QName(Namespaces.ODE_PMAPI, e.getClass().getSimpleName()));
            StringWriter stack = new StringWriter();
            e.printStackTrace(new PrintWriter(stack));
            detail.setText(stack.toString());
            SOAPFaultDetail soapDetail = soapFactory.createSOAPFaultDetail(fault);
            soapDetail.addDetailEntry(detail);
            return fault;
        }
View Full Code Here

        SOAPFault fault = _soapFactory.createSOAPFault();
        SOAPFaultCode code = _soapFactory.createSOAPFaultCode(fault);
        code.setText(new QName(Namespaces.SOAP_ENV_NS, "Server"));
        SOAPFaultReason reason = _soapFactory.createSOAPFaultReason(fault);
        reason.setText(faultName);
        SOAPFaultDetail soapDetail = _soapFactory.createSOAPFaultDetail(fault);
        if (detail != null)
            soapDetail.addDetailEntry(detail);
        return fault;
    }
View Full Code Here

        return "";
    }
   
    public Fault parseSoapFault(Element odeMsgEl, SOAPEnvelope envelope, Operation operation) throws AxisFault {
        SOAPFault flt = envelope.getBody().getFault();
        SOAPFaultDetail detail = flt.getDetail();
        Fault fdef = inferFault(operation, flt);
        if (fdef == null)
            return null;

        Part pdef = (Part)fdef.getMessage().getParts().values().iterator().next();
        Element partel = odeMsgEl.getOwnerDocument().createElementNS(null,pdef.getName());
        odeMsgEl.appendChild(partel);

        if (detail.getFirstChildWithName(pdef.getElementName()) != null) {
            partel.appendChild(odeMsgEl.getOwnerDocument().importNode(
                    OMUtils.toDOM(detail.getFirstChildWithName(pdef.getElementName())), true));
        } else {
            partel.appendChild(odeMsgEl.getOwnerDocument().importNode(OMUtils.toDOM(detail),true));
        }

        return fdef;
View Full Code Here

        setNewElement(getDetail(), detail);
    }

    /** If exception detailElement is not there we will return null */
    public Exception getException() throws OMException {
        SOAPFaultDetail detail = getDetail();
        if (detail == null) {
            return null;
        }

        OMElement exceptionElement = getDetail().getFirstChildWithName(
View Full Code Here

        SOAPFaultRole faultRole = getRole();
        if (faultRole != null) {
            (faultRole).serialize(writer);
        }

        SOAPFaultDetail faultDetail = getDetail();
        if (faultDetail != null) {
            (faultDetail).serialize(writer);
        }

        OMSerializerUtil.serializeEndpart(writer);
View Full Code Here

        setNewElement(getDetail(), detail);
    }

    /** If exception detailElement is not there we will return null */
    public Exception getException() throws OMException {
        SOAPFaultDetail detail = getDetail();
        if (detail == null) {
            return null;
        }

        OMElement exceptionElement = getDetail().getFirstChildWithName(
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.