Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFault


    private SOAPFault addStandardFault(String localName, String faultString, Locale locale) {
        Assert.notNull(faultString, "No faultString given");
        try {
            AxiomUtils.removeContents(getAxiomBody());
            SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody());
            SOAPFaultCode faultCode = getAxiomFactory().createSOAPFaultCode(fault);
          faultCode.setText(new QName(fault.getNamespace().getNamespaceURI(), localName,
              fault.getNamespace().getPrefix()));
            SOAPFaultReason faultReason = getAxiomFactory().createSOAPFaultReason(fault);
            if (locale != null) {
                addLangAttribute(locale, faultReason);
            }
            faultReason.setText(faultString);
View Full Code Here


        faultReason.addAttribute(langAttribute);
    }

    @Override
    public Soap11Fault getFault() {
        SOAPFault axiomFault = getAxiomBody().getFault();
        return axiomFault != null ? new AxiomSoap11Fault(axiomFault, getAxiomFactory()) : null;
    }
View Full Code Here

    }

    @Override
    public Soap12Fault addMustUnderstandFault(String reason, Locale locale) {
        Assert.notNull(locale, "No locale given");
        SOAPFault fault = addStandardFault(SOAP12Constants.FAULT_CODE_MUST_UNDERSTAND, reason, locale);
        return new AxiomSoap12Fault(fault, getAxiomFactory());
    }
View Full Code Here

    }

    @Override
    public Soap12Fault addClientOrSenderFault(String reason, Locale locale) {
        Assert.notNull(locale, "No locale given");
        SOAPFault fault = addStandardFault(SOAP12Constants.FAULT_CODE_SENDER, reason, locale);
        return new AxiomSoap12Fault(fault, getAxiomFactory());
    }
View Full Code Here

    }

    @Override
    public Soap12Fault addServerOrReceiverFault(String reason, Locale locale) {
        Assert.notNull(locale, "No locale given");
        SOAPFault fault = addStandardFault(SOAP12Constants.FAULT_CODE_RECEIVER, reason, locale);
        return new AxiomSoap12Fault(fault, getAxiomFactory());
    }
View Full Code Here

    }

    @Override
    public Soap12Fault addVersionMismatchFault(String reason, Locale locale) {
        Assert.notNull(locale, "No locale given");
        SOAPFault fault = addStandardFault(SOAP12Constants.FAULT_CODE_VERSION_MISMATCH, reason, locale);
        return new AxiomSoap12Fault(fault, getAxiomFactory());
    }
View Full Code Here

    }

    @Override
    public Soap12Fault addDataEncodingUnknownFault(QName[] subcodes, String reason, Locale locale) {
        Assert.notNull(locale, "No locale given");
        SOAPFault fault = addStandardFault(SOAP12Constants.FAULT_CODE_DATA_ENCODING_UNKNOWN, reason, locale);
        return new AxiomSoap12Fault(fault, getAxiomFactory());
    }
View Full Code Here

    private SOAPFault addStandardFault(String localName, String faultStringOrReason, Locale locale) {
        Assert.notNull(faultStringOrReason, "No faultStringOrReason given");
        try {
            AxiomUtils.removeContents(getAxiomBody());
            SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody());
            SOAPFaultCode code = getAxiomFactory().createSOAPFaultCode(fault);
            SOAPFaultValue value = getAxiomFactory().createSOAPFaultValue(code);
            value.setText(fault.getNamespace().getPrefix() + ":" + localName);
            SOAPFaultReason reason = getAxiomFactory().createSOAPFaultReason(fault);
            SOAPFaultText text = getAxiomFactory().createSOAPFaultText(reason);
            if (locale != null) {
                text.setLang(AxiomUtils.toLanguage(locale));
            }
View Full Code Here

        }
    }

    @Override
    public Soap12Fault getFault() {
        SOAPFault axiomFault = getAxiomBody().getFault();
        return axiomFault != null ? new AxiomSoap12Fault(axiomFault, getAxiomFactory()) : null;
    }
View Full Code Here

  }
 
  private boolean isFaultEnvelope(SOAPEnvelope envelope) {
    if (log.isDebugEnabled())
      log.debug("Enter: SenderWorker::isFaultEnvelope, " + envelope.getBody().getFault());
    SOAPFault fault = envelope.getBody().getFault();
    if (fault != null) {
      if (log.isDebugEnabled())
        log.debug("Exit: SenderWorker::isFaultEnvelope, TRUE");
      return true;
    }
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.