Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFaultCode


   
   
   
    SOAPFactory factory = (SOAPFactory) referenceRMMsgContext.getSOAPEnvelope().getOMFactory();
   
    SOAPFaultCode faultCode = factory.createSOAPFaultCode();
    SOAPFaultSubCode faultSubCode = factory.createSOAPFaultSubCode(faultCode);
   
    SOAPFaultValue faultColdValue = factory.createSOAPFaultValue(faultCode);
    SOAPFaultValue faultSubcodeValue = factory.createSOAPFaultValue(faultSubCode);
   
    faultColdValue.setText(data.getCode());
   
    faultSubcodeValue.setText(data.getSubcode());

    faultCode.setSubCode(faultSubCode);
   
    SOAPFaultReason reason = factory.createSOAPFaultReason();
    SOAPFaultText reasonText = factory.createSOAPFaultText();
    reasonText.setText(data.getReason());
   
View Full Code Here


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

        //figureout the soap version
        boolean isSoap11 = soapFault.getNamespace().getNamespaceURI().equals(
                SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);

        SOAPFaultCode soapCode = soapFault.getCode();
        QName codeQName = null;
        if (isSoap11) {
            codeQName = soapCode.getTextAsQName();
        } else {
            codeQName = soapCode.getValue().getTextAsQName();
        }
        XMLFaultCode code = XMLFaultCode.fromQName(codeQName);

        // Get the primary reason text
        // TODO what if this fails
        SOAPFaultReason soapReason = soapFault.getReason();
        String text = null;
        String lang = null;
        List soapTexts = null;
        if (isSoap11) {
            text = soapReason.getText();
        } else {
            soapTexts = soapReason.getAllSoapTexts();
            SOAPFaultText reasonText = (SOAPFaultText)soapTexts.get(0);
            text = reasonText.getText();
            lang = reasonText.getLang();
        }
        XMLFaultReason reason = new XMLFaultReason(text, lang);

        // Construct the XMLFault from the required information (code, reason, detail blocks)
        XMLFault xmlFault = new XMLFault(code, reason, detailBlocks);

        // Add the secondary fault information

        // Get the SubCodes
        SOAPFaultSubCode soapSubCode = soapCode.getSubCode();
        if (soapSubCode != null) {
            List<QName> list = new ArrayList<QName>();

            // Walk the nested sub codes and collect the qnames
            while (soapSubCode != null) {
View Full Code Here

        boolean isSoap11 = soapFault.getNamespace().getNamespaceURI()
                .equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);

        // Set the primary Code Value
        SOAPFaultCode soapCode = factory.createSOAPFaultCode(soapFault);
        QName soapValueQName = xmlFault.getCode().toQName(ns.getNamespaceURI());
        if (isSoap11) {
            soapCode.setText(soapValueQName);
        } else {
            SOAPFaultValue soapValue = factory.createSOAPFaultValue(soapCode);
            soapValue.setText(soapValueQName);
        }
View Full Code Here

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

    SOAPFault fault = faultMsgEnvelope.getBody().getFault();
    SOAPFaultCode faultCode = fault.getCode();

    if (isSequenceFault(data)) {
      faultCode.setText(data.getCode());
    } else {
      faultCode.setText(data.getSubcode());
    }

    SOAPFaultReason faultReason = fault.getReason();

    OMNamespace namespace = factory.createOMNamespace(
        OMConstants.XMLNS_URI, OMConstants.XMLNS_PREFIX);

    faultReason.setText(data.getReason());
    faultCode.getValue().setText(data.getSubcode());
    SOAPFaultText faultText = faultReason.getSOAPFaultText("en");
    if (faultText==null)
    {
      faultText = factory.createSOAPFaultText();
      // Add the SOAP text
View Full Code Here

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

        return subcodes.iterator();
    }

    @Override
    public void addFaultSubcode(QName subcode) {
        SOAPFaultCode faultCode = getAxiomFault().getCode();
        SOAPFaultSubCode faultSubCode = null;
        if (faultCode.getSubCode() == null) {
            faultSubCode = getAxiomFactory().createSOAPFaultSubCode(faultCode);
        }
        else {
            faultSubCode = faultCode.getSubCode();
            while (true) {
                if (faultSubCode.getSubCode() != null) {
                    faultSubCode = faultSubCode.getSubCode();
                }
                else {
View Full Code Here

   
   
   
    SOAPFactory factory = (SOAPFactory) referenceRMMsgContext.getSOAPEnvelope().getOMFactory();
   
    SOAPFaultCode faultCode = factory.createSOAPFaultCode();
    SOAPFaultSubCode faultSubCode = factory.createSOAPFaultSubCode(faultCode);
   
    SOAPFaultValue faultColdValue = factory.createSOAPFaultValue(faultCode);
    SOAPFaultValue faultSubcodeValue = factory.createSOAPFaultValue(faultSubCode);
   
    faultColdValue.setText(data.getCode());
   
    faultSubcodeValue.setText(data.getSubcode());

    faultCode.setSubCode(faultSubCode);
   
    SOAPFaultReason reason = factory.createSOAPFaultReason();
    SOAPFaultText reasonText = factory.createSOAPFaultText();
    reasonText.setText(data.getReason());
   
View Full Code Here

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

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

        SOAPFaultCode code = fault.getCode();
        if (data.getCode()!=null) {
            code.setText(data.getCode());
        }

        if (data.getExceptionString() != null)
      fault.getDetail().setText(data.getExceptionString());
   
View Full Code Here

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

TOP

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

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.