Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFault


          MessageContext response = send(mc);
          // check for a fault and return the result
          if (response != null) {
            SOAPEnvelope resEnvelope = response.getEnvelope();
            if (resEnvelope.getBody().hasFault()) {
              SOAPFault soapFault = resEnvelope.getBody()
                  .getFault();

              // we need to call engine.receiveFault
              AxisEngine engine = new AxisEngine(mc
                  .getConfigurationContext());
View Full Code Here


                }

                // if we have a SOAP Fault, log it - irrespective of the mediation logic
                // http://issues.apache.org/jira/browse/SYNAPSE-42
                if (synapseOutMessageContext.getEnvelope().getBody().hasFault()) {
                    SOAPFault fault = synapseOutMessageContext.getEnvelope().getBody().getFault();
                    log.warn("Synapse received a SOAP fault from : " + synapseInMessageContext.getTo() +
                        (fault.getNode() != null ? " Node : " + fault.getNode().getNodeValue() : "") +
                        (fault.getReason() != null ? " Reason : " + fault.getReason().getFirstSOAPText() : "") +
                        (fault.getCode() != null ? " Code : " + fault.getCode().getValue() : ""));
                }

                log.debug("Processing incoming message");

                // sets the out sequence if present to the out MC to mediate the response
View Full Code Here

            Stack faultStack = synapseOutMsgCtx.getFaultStack();
            if (faultStack != null && !faultStack.isEmpty()) {
                SOAPEnvelope envelope = response.getEnvelope();
                if (envelope != null) {
                    SOAPFault fault = envelope.getBody().getFault();
                    if (fault != null) {
                        Exception e = fault.getException();
                        if (e == null) {
                            e = new Exception(fault.toString());
                        }
                        // set an error code to the message context, so that error sequences can
                        // filter using that property to determine the cause of error
                        synapseOutMsgCtx.setProperty(SynapseConstants.ERROR_CODE,
                            SynapseConstants.SENDING_FAULT);
                        SOAPFaultReason faultReason = fault.getReason();
                        if (faultReason != null) {
                            synapseOutMsgCtx.setProperty(SynapseConstants.ERROR_MESSAGE,
                                    faultReason.getText());
                        }
                        ((FaultHandler) faultStack.pop()).handleFault(synapseOutMsgCtx, e);
View Full Code Here

            MessageContext faultContext = MessageContextBuilder.createFaultMessageContext(msgContext, e);
            //Per SOAP 1.1 Fault description, if it is not allowed to use detail elements for carrying information about error information belonging to header entries.
            if (SOAP_1_1_FAULT_DETAIL_COMPATIBLE_WHEN_ADDRESSING_FAULTS && faultContext.isSOAP11()) {
                Map faultInfo = (Map) faultContext.getLocalProperty(Constants.FAULT_INFORMATION_FOR_HEADERS);
                if (faultInfo != null) {
                    SOAPFault soapFault = faultContext.getEnvelope().getBody().getFault();
                    if (soapFault != null && soapFault.getDetail() != null) {
                        soapFault.getDetail().detach();
                    }
                }
            }
            AxisEngine.sendFault(faultContext);
        } catch (Exception ex) {
View Full Code Here

   
    SOAPEnvelope envelope = rmMsgCtx.getSOAPEnvelope();
    if (envelope==null)
      return response;
   
    SOAPFault faultPart = envelope.getBody().getFault();

    if (faultPart != null) {
      Transaction transaction = null;

      try {
View Full Code Here

          SandeshaMessageKeys.soapEnvNotSet));

    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());
   
    //SequenceFault header is added only for SOAP 1.1
    if (isSequenceFault(data))
      addSequenceFaultHeader(faultMsgContext, data, factory, rmNamespaceValue);
View Full Code Here

          SandeshaMessageKeys.soapEnvNotSet));

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

    SOAPFault fault = faultEnvelope.getBody().getFault();
    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
        .createSOAPFaultValue(faultSubCode);
    subCodeValue.setText(data.getSubcode());

    SOAPFaultReason faultReason = fault.getReason();
    SOAPFaultText faultText = faultReason.getSOAPFaultText("en");
   
    if (faultText==null) {
      faultText = factory.createSOAPFaultText();
      faultReason.addSOAPText(faultText);
    }
   
    if (data!=null && data.getReason()!=null)
      faultText.setText(data.getReason());

    SOAPFaultDetail faultDetail = fault.getDetail();

    OMElement detailElement = data.getDetail();

    if (detailElement != null)
      faultDetail.addChild(detailElement);
View Full Code Here

 
  private boolean isSecurityFault(RampartMessageData rmd) {

    SOAPEnvelope soapEnvelope = rmd.getMsgContext().getEnvelope();
    SOAPFault soapFault = soapEnvelope.getBody().getFault();

    // This is not a soap fault
    if (soapFault == null) {
      return false;
    }

    String soapVersionURI = rmd.getMsgContext().getEnvelope().getNamespace().getNamespaceURI();
    SOAPFaultCode faultCode = soapFault.getCode();
    if(faultCode == null){
      //If no fault code is given, then it can't be security fault
      return false;
    }
   
View Full Code Here

   
    return false;
  }
 
  private boolean isFaultEnvelope (SOAPEnvelope envelope) throws SandeshaException {   
    SOAPFault fault = envelope.getBody().getFault();
    if (fault!=null)
      return true;
    else
      return false;
  }
View Full Code Here

    //processing faults.
    //Had to do this before dispatching. A fault message comes with the relatesTo part. So this will
    //fill the opContext of te req/res message. But RM keeps retransmitting. So RM has to report the
    //error and stop this fault being dispatched as the response message.
   
    SOAPFault faultPart = envelope.getBody().getFault();
   
    if (faultPart!=null) {
      RelatesTo relatesTo = msgContext.getRelatesTo();
      if (relatesTo!=null) {
        String relatesToValue = relatesTo.getValue();
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.