Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFactory.createOMElement()


        // Build the SOAP request
        SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope request = soapFactory.getDefaultEnvelope();
        OMElement retrieveContent = soapFactory.createOMElement(
                new QName("urn:test", "retrieveContent"), request.getBody());
        OMElement fileId = soapFactory.createOMElement(new QName("fileId"), retrieveContent);
        fileId.setText(id);
       
        // Use the java.net.URL API to connect to the service
        URLConnection connection = serviceURL.openConnection();
        connection.setDoOutput(true);
View Full Code Here


        // Construct the original message
        DocumentBean orgObject = new DocumentBean();
        orgObject.setId("123456");
        orgObject.setContent(new DataHandler("some content", "text/plain; charset=utf-8"));
        SOAPEnvelope orgEnvelope = factory.getDefaultEnvelope();
        OMSourcedElement element = factory.createOMElement(new JAXBOMDataSource(context, orgObject));
        orgEnvelope.getBody().addChild(element);
       
        // Serialize the message
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        orgEnvelope.serialize(out);
View Full Code Here

        // Construct the original message
        DocumentBean object = new DocumentBean();
        object.setId("123456");
        object.setContent(new DataHandler("some content", "text/plain; charset=utf-8"));
        SOAPEnvelope orgEnvelope = factory.getDefaultEnvelope();
        OMSourcedElement element = factory.createOMElement(new JAXBOMDataSource(context, object));
        orgEnvelope.getBody().addChild(element);
       
        // Serialize the message
        OMOutputFormat format = new OMOutputFormat();
        format.setDoOptimize(true);
View Full Code Here

            if (!ignoreDetailBlocks) {
                for (int i = 0; i < blocks.length; i++) {
                    // A Block implements OMDataSource.  So create OMSourcedElements
                    // for each of the Blocks.
                    OMSourcedElement element =
                            factory.createOMElement(blocks[i], blocks[i].getQName());
                    detail.addChild(element);
                }
            }
        }
View Full Code Here

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

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

            // log the response message
View Full Code Here

      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

        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

    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.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

TOP
Copyright © 2018 www.massapi.com. 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.