Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFactory


   *
   * @return
   */
  private byte[] getAppMessageAsBytes(String uuid) throws Exception
  {
    SOAPFactory factory = new SOAP11Factory();
    SOAPEnvelope dummyEnvelope = factory.getDefaultEnvelope();
   
    // Create a "new" application message
    MessageContext messageContext = new MessageContext();
    messageContext.setConfigurationContext(serverConfigContext);
    messageContext.setAxisService(serverConfigContext.getAxisConfiguration().getService("RMSampleService"));   
View Full Code Here


   *
   * @return
   */
  private byte[] getAppMessageAsBytes(String sequenceId) throws Exception
  {
    SOAPFactory factory = new SOAP11Factory();
    SOAPEnvelope dummyEnvelope = factory.getDefaultEnvelope();
   
    // Create a "new" application message
    MessageContext messageContext = new MessageContext();
    messageContext.setConfigurationContext(serverConfigContext);
    messageContext.setAxisService(serverConfigContext.getAxisConfiguration().getService("RMSampleService"));   
View Full Code Here

            XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xmlResults));
            StAXOMBuilder resultsBuilder = new StAXOMBuilder(reader);
            OMElement resultSer = resultsBuilder.getDocumentElement();

            // create the response soap
            SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
            SOAPEnvelope resEnv = factory.createSOAPEnvelope();
            SOAPBody resBody = factory.createSOAPBody();
            OMElement resService = factory.createOMElement(new QName(serviceName + "Response"));
            resService.addChild(resultSer.getFirstElement());
            resBody.addChild(resService);
            resEnv.addChild(resBody);

            // The declareDefaultNamespace method doesn't work see (https://issues.apache.org/jira/browse/AXIS2-3156)
            // so the following doesn't work:
            // resService.declareDefaultNamespace(ModelService.TNS);
            // instead, create the xmlns attribute directly:
            OMAttribute defaultNS = factory.createOMAttribute("xmlns", null, ModelService.TNS);
            resService.addAttribute(defaultNS);

            // log the response message
            if (Debug.verboseOn()) {
                try {
View Full Code Here

            XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xmlResults));
            StAXOMBuilder resultsBuilder = new StAXOMBuilder(xmlReader);
            OMElement resultSer = resultsBuilder.getDocumentElement();

            // create the response soap
            SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
            SOAPEnvelope resEnv = factory.createSOAPEnvelope();
            SOAPBody resBody = factory.createSOAPBody();
            OMElement errMsg = factory.createOMElement(new QName((serviceName != null ? serviceName : "") + "Response"));
            errMsg.addChild(resultSer.getFirstElement());
            resBody.addChild(errMsg);
            resEnv.addChild(resBody);

            // The declareDefaultNamespace method doesn't work see (https://issues.apache.org/jira/browse/AXIS2-3156)
            // so the following doesn't work:
            // resService.declareDefaultNamespace(ModelService.TNS);
            // instead, create the xmlns attribute directly:
            OMAttribute defaultNS = factory.createOMAttribute("xmlns", null, ModelService.TNS);
            errMsg.addAttribute(defaultNS);

            // log the response message
            if (Debug.verboseOn()) {
                try {
View Full Code Here

    /**
     * Create and configure an Axis2OperationInvoker for each operation in the externalService
     */
    protected Map<String, Axis2OperationInvoker> createOperationInvokers(Class sc, TypeHelper typeHelper, ClassLoader cl, WebServicePortMetaData wsPortMetaData) {
        SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
        String portTypeNS = wsPortMetaData.getPortTypeName().getNamespaceURI();
        Map<String, Axis2OperationInvoker> invokers = new HashMap<String, Axis2OperationInvoker>();

        for (Method m : sc.getMethods()) {
            String methodName = m.getName();
View Full Code Here

      OperationContext operationContext = new OperationContext(operation, newMessageContext.getServiceContext());
      newMessageContext.setOperationContext(operationContext);
      operationContext.addMessageContext(newMessageContext);

      // adding a blank envelope
      SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil.getSOAPVersion(referenceMessage
          .getEnvelope()));
      newMessageContext.setEnvelope(factory.getDefaultEnvelope());

      newMessageContext.setTransportIn(referenceMessage.getTransportIn());
      newMessageContext.setTransportOut(referenceMessage.getTransportOut());

      // copying transport info.
View Full Code Here

  public void toSOAPEnvelope(SOAPEnvelope envelope) {
    SOAPHeader header = envelope.getHeader();

    if (header==null) {
      SOAPFactory factory = (SOAPFactory)envelope.getOMFactory();
      header = factory.createSOAPHeader(envelope);
    }
   
    //detach if already exist.
    OMElement elem = header.getFirstChildWithName(new QName(
        namespaceValue, Sandesha2Constants.WSRM_COMMON.USES_SEQUENCE_STR));
View Full Code Here

      outMessageContext.setTransportOut(msgContext.getTransportOut());
      outMessageContext.setProperty (Constants.OUT_TRANSPORT_INFO, msgContext.getProperty(Constants.OUT_TRANSPORT_INFO));
      outMessageContext.setProperty (MessageContext.TRANSPORT_OUT, msgContext.getProperty(MessageContext.TRANSPORT_OUT));

      //add the SOAP envelope with body null
      SOAPFactory factory = (SOAPFactory) msgContext.getEnvelope().getOMFactory();
      SOAPEnvelope envelope = factory.getDefaultEnvelope();
      outMessageContext.setEnvelope(envelope);
     
      //set the LastMessageAction and the property
      if (outMessageContext.getOptions()==null)
        outMessageContext.setOptions(new Options ());
View Full Code Here

        data.setCode(SOAP12Constants.FAULT_CODE_SENDER);

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

      SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);

      OMElement identifierElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.IDENTIFIER,
          rmMessageContext.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
      identifierElement.setText(sequenceID);
     
      data.setDetail(identifierElement);
View Full Code Here

    data.setType(Sandesha2Constants.SOAPFaults.FaultType.INVALID_ACKNOWLEDGEMENT);
    data.setSubcode(SpecSpecificConstants.getFaultSubcode(rmMsgCtx.getRMNamespaceValue(),
        Sandesha2Constants.SOAPFaults.FaultType.INVALID_ACKNOWLEDGEMENT ));
    data.setReason(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.invalidAckFault));

    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SOAPVersion);

    OMElement seqAckElement = factory.createOMElement(Sandesha2Constants.WSRM_COMMON.SEQUENCE_ACK,
        rmMsgCtx.getRMNamespaceValue(), Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
 
    // Set the sequence Id
    sequenceAcknowledgement.getIdentifier().toOMElement(seqAckElement);
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.