Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFaultReason


        SOAPEnvelope defaultEnvelope = getDefaultEnvelope();
        SOAPFault fault = createSOAPFault(defaultEnvelope.getBody());

        SOAPFaultCode faultCode = createSOAPFaultCode(fault);

        SOAPFaultReason reason = createSOAPFaultReason(fault);
        //createSOAPFaultText(reason);

        createSOAPFaultDetail(fault);

        return defaultEnvelope;
View Full Code Here


     * @param sourceReason
     */
    private static void copySOAPFaultReason(SOAPFactory factory,
                                            SOAPFault targetFault,
                                            SOAPFaultReason sourceReason) {
        SOAPFaultReason targetReason = factory.createSOAPFaultReason(targetFault);
        copyTagData(sourceReason, targetReason);
        Iterator i = sourceReason.getChildren();
        while (i.hasNext()) {
            OMNode node = (OMNode) i.next();
            if (node instanceof SOAPFaultText) {
View Full Code Here

        OMSerializerUtil.serializeStartpart(this, writer);
        SOAPFaultCode faultCode = getCode();
        if (faultCode != null) {
            ((OMNodeEx) faultCode).internalSerialize(writer, true);
        }
        SOAPFaultReason faultReason = getReason();
        if (faultReason != null) {
            ((OMNodeEx) faultReason).internalSerialize(writer, true);
        }

        serializeFaultNode(writer);
View Full Code Here

        SOAPFault fault = createSOAPFault(defaultEnvelope.getBody());

        SOAPFaultCode faultCode = createSOAPFaultCode(fault);
        createSOAPFaultValue(faultCode);

        SOAPFaultReason reason = createSOAPFaultReason(fault);
        createSOAPFaultText(reason);

        createSOAPFaultNode(fault);
        createSOAPFaultRole(fault);
        createSOAPFaultDetail(fault);
View Full Code Here

        OMSerializerUtil.serializeStartpart(this, writer);
        SOAPFaultCode faultCode = getCode();
        if (faultCode != null) {
            (faultCode).serialize(writer);
        }
        SOAPFaultReason faultReason = getReason();
        if (faultReason != null) {
            (faultReason).serialize(writer);
        }

        serializeFaultNode(writer);
View Full Code Here

   
    faultSubcodeValue.setText(data.getSubcode());

    faultCode.setSubCode(faultSubCode);
   
    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);
      reason.addSOAPText(reasonText);
      referenceRMMsgContext.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, faultCode);
      referenceRMMsgContext.setProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME, reason);
      referenceRMMsgContext.setProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, detail);
      faultColdValue.setText(data.getCode());
     
    } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals (SOAPNamespaceValue)) {
      reason.setText(data.getReason());
      referenceRMMsgContext.setProperty(SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME, faultCode);
      referenceRMMsgContext.setProperty(SOAP11Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, detail);
      referenceRMMsgContext.setProperty(SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME, reason);
      faultColdValue.setText(data.getSubcode());
     
View Full Code Here

   
    faultSubcodeValue.setText(data.getSubcode());

    faultCode.setSubCode(faultSubCode);
   
    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))
    {
            reasonText.setLang(Sandesha2Constants.LANG_EN);
      reason.addSOAPText(reasonText);
      referenceRMMsgContext.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, faultCode);
      referenceRMMsgContext.setProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME, reason);
      referenceRMMsgContext.setProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, detail);
     
      AxisFault fault = new AxisFault(faultColdValue.getTextAsQName(), data.getReason(), "", "", data.getDetail());
      fault.setFaultAction(SpecSpecificConstants.getAddressingFaultAction(referenceRMMsgContext.getRMSpecVersion()));
     
      //if this is throwable throwing it out, else we will log here.
     
      if (throwable)
      {
              if (referenceRMMsgContext.getMessageContext().isServerSide()) {
              if (log.isDebugEnabled())
                log.debug("Exit: FaultManager::getOrSendFault: " + fault);
                  throw fault;
              }
      }
      else
        log.error("Sandesha2 got a fault when processing the message " + referenceRMMsgContext.getMessageId(), fault);
    }
    else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals (SOAPNamespaceValue))
    {
     
        reason.setText(data.getReason());
        referenceRMMsgContext.setProperty(SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME, faultCode);
        referenceRMMsgContext.setProperty(SOAP11Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, detail);
        referenceRMMsgContext.setProperty(SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME, reason);
        // Need to send this message as the Axis Layer doesn't set the "SequenceFault" header
        MessageContext faultMessageContext =
View Full Code Here

        private SOAPFault toSoapFault(Exception e, SOAPFactory soapFactory) {
            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(e.toString());
   
                OMElement detail = soapFactory
                        .createOMElement(new QName(Namespaces.ODE_PMAPI, e.getClass().getSimpleName()));
            StringWriter stack = new StringWriter();
            e.printStackTrace(new PrintWriter(stack));
View Full Code Here

        OMElement detail = buildSoapDetail(message, faultName, op);

        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

        OMSerializerUtil.serializeStartpart(this, writer);
        SOAPFaultCode faultCode = getCode();
        if (faultCode != null) {
            (faultCode).serialize(writer);
        }
        SOAPFaultReason faultReason = getReason();
        if (faultReason != null) {
            (faultReason).serialize(writer);
        }

        serializeFaultNode(writer);
View Full Code Here

TOP

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

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.