Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFactory


      data.setCode(SOAP12Constants.FAULT_CODE_SENDER);

    data.setSubcode(SpecSpecificConstants.getFaultSubcode(rmMessageContext.getRMNamespaceValue(),
        Sandesha2Constants.SOAPFaults.FaultType.CREATE_SEQUENCE_REFUSED ));

    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);
    OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER,
        rmMessageContext.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
    identifierElement.setText(detail);
    data.setDetail(identifierElement);
    data.setDetailString(detail);
View Full Code Here


      data.setSubcode(SpecSpecificConstants.getFaultSubcode(referenceRMMessage.getRMNamespaceValue(),
          Sandesha2Constants.SOAPFaults.FaultType.SEQUENCE_TERMINATED ));
      data.setReason(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.sequenceTerminatedFault, sequenceID));
      data.setType(Sandesha2Constants.SOAPFaults.FaultType.SEQUENCE_TERMINATED);
     
      SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);
      String rmNamespaceValue = referenceRMMessage.getRMNamespaceValue();
      OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER,
          rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
      identifierElement.setText(sequenceID);
     
      data.setDetail(identifierElement);
View Full Code Here

      data.setSubcode(SpecSpecificConstants.getFaultSubcode(referenceRMMessage.getRMNamespaceValue(),
          Sandesha2Constants.SOAPFaults.FaultType.SEQUENCE_CLOSED ));
      data.setReason(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotAcceptMsgAsSequenceClosedFault));
      data.setType(Sandesha2Constants.SOAPFaults.FaultType.SEQUENCE_CLOSED);
     
      SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);
      String rmNamespaceValue = referenceRMMessage.getRMNamespaceValue();
      OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER,
          rmNamespaceValue, Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
      identifierElement.setText(sequenceID);
     
      data.setDetail(identifierElement);
View Full Code Here

  public static void getOrSendFault(RMMsgContext referenceRMMsgContext, FaultData data, boolean throwable) throws AxisFault {

   
   
   
    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());
   
    SOAPFaultDetail detail = factory.createSOAPFaultDetail();
    detail.addDetailEntry(data.getDetail());
   
    String SOAPNamespaceValue = factory.getSoapVersionURI();
   
    if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(SOAPNamespaceValue)) {
      reason.addSOAPText(reasonText);
      referenceRMMsgContext.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, faultCode);
      referenceRMMsgContext.setProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME, reason);
View Full Code Here

    SandeshaListener listner = (SandeshaListener) rmMsgCtx.getProperty(SandeshaClientConstants.SANDESHA_LISTENER);
    if (listner!=null)
      listner.onError(fault);
   
    // Get the SOAPVersion
    SOAPFactory factory = (SOAPFactory) rmMsgCtx.getSOAPEnvelope().getOMFactory();   
    String SOAPNamespaceValue = factory.getSoapVersionURI();
   
    String soapFaultSubcode = null;
    String identifier = null;
    if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(SOAPNamespaceValue)) {
      // Log the fault
View Full Code Here

      FaultData data = new FaultData();
      data.setCode(SOAP11Constants.FAULT_CODE_SENDER);
      data.setSubcode(SpecSpecificConstants.getFaultSubcode(rmMessageContext.getRMNamespaceValue(),
          Sandesha2Constants.SOAPFaults.FaultType.MESSAGE_NUMBER_ROLLOVER ));

      SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);
      OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER,
          rmMessageContext.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
      identifierElement.setText(sequenceId);
     
      OMElement maxMsgNumber = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.MAX_MSG_NUMBER,
          rmMessageContext.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
      maxMsgNumber.setText(Long.toString(msgNo));
     
      data.setDetail(identifierElement);
      data.setDetail2(maxMsgNumber);
View Full Code Here

   
    String soapNamespaceURI = options.getSoapVersionURI();
    if (soapNamespaceURI == null)
      soapNamespaceURI = getSOAPNamespaceURI(storageManager, internalSequenceID);
   
    SOAPFactory factory = null;
    SOAPEnvelope dummyEnvelope = null;
    if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapNamespaceURI)) {
      factory = new SOAP12Factory();
      dummyEnvelope = factory.getDefaultEnvelope();
    } else {
      factory = new SOAP11Factory();
      dummyEnvelope = factory.getDefaultEnvelope();
    }

    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmSpecVersion);

    AckRequested ackRequested = new AckRequested(rmNamespaceValue);
View Full Code Here

    if (!SpecSpecificConstants.isSequenceClosingAllowed(rmSpecVersion))
      throw new SandeshaException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.closeSequenceSpecLevel, rmSpecVersion));

    SOAPEnvelope dummyEnvelope = null;
    SOAPFactory factory = null;
    String soapNamespaceURI = options.getSoapVersionURI();
    if (soapNamespaceURI == null)
      soapNamespaceURI = getSOAPNamespaceURI(storageManager, internalSequenceID);

    if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapNamespaceURI)) {
      factory = new SOAP12Factory();
      dummyEnvelope = factory.getDefaultEnvelope();
    } else {
      factory = new SOAP11Factory();
      dummyEnvelope = factory.getDefaultEnvelope();
    }

    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmSpecVersion);

    CloseSequence closeSequence = new CloseSequence(rmNamespaceValue);
View Full Code Here

    if (rmSpecVersion == null)
      rmSpecVersion = SpecSpecificConstants.getDefaultSpecVersion();

    options.setAction(SpecSpecificConstants.getTerminateSequenceAction(rmSpecVersion));
    SOAPEnvelope dummyEnvelope = null;
    SOAPFactory factory = null;
    String soapNamespaceURI = options.getSoapVersionURI();
    if (soapNamespaceURI == null)
      soapNamespaceURI = getSOAPNamespaceURI(storageManager, internalSequenceID);
    if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapNamespaceURI)) {
      factory = new SOAP12Factory();
      dummyEnvelope = factory.getDefaultEnvelope();
    } else {
      factory = new SOAP11Factory();
      dummyEnvelope = factory.getDefaultEnvelope();
    }

    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmSpecVersion);
    TerminateSequence terminateSequence = new TerminateSequence(rmNamespaceValue);
    Identifier identifier = new Identifier(rmNamespaceValue);
View Full Code Here

    RMMsgContext ackRMMsgCtx = MsgInitializer.initializeMessage(ackMsgCtx);
    ackRMMsgCtx.setRMNamespaceValue(rmMsgCtx.getRMNamespaceValue());

    ackMsgCtx.setMessageID(SandeshaUtil.getUUID());

    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil.getSOAPVersion(msgContext.getEnvelope()));

    // Setting new envelope
    SOAPEnvelope envelope = factory.getDefaultEnvelope();
    try {
      ackMsgCtx.setEnvelope(envelope);
    } catch (AxisFault e3) {
      throw new SandeshaException(e3.getMessage());
    }
View Full Code Here

TOP

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

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.