Examples of SOAPFactory


Examples of org.apache.axiom.soap.SOAPFactory

            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

Examples of org.apache.axis2.soap.SOAPFactory

    }
  }

  public static SOAPEnvelope getRequestEnvelope(String operationName,
      int param1, int param2, String groupContextId) {
    SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
    SOAPEnvelope envelope = fac.getDefaultEnvelope();
    OMNamespace namespace = fac.createOMNamespace(
        "http://axis2/test/namespace1", "ns1");

    OMElement params = fac.createOMElement(operationName, namespace);
    OMElement param1OM = fac.createOMElement("param1", namespace);
    OMElement param2OM = fac.createOMElement("param2", namespace);
    param1OM.setText(Integer.toString(param1));
    param2OM.setText(Integer.toString(param2));
    params.addChild(param1OM);
    params.addChild(param2OM);
    envelope.getBody().setFirstChild(params);

    if (groupContextId != null) {
      OMNamespace axis2Namespace = fac.createOMNamespace(
          Constants.AXIS2_NAMESPACE_URI,
          Constants.AXIS2_NAMESPACE_PREFIX);
      SOAPHeaderBlock soapHeaderBlock = envelope.getHeader()
          .addHeaderBlock(Constants.SERVICE_GROUP_ID, axis2Namespace);
      soapHeaderBlock.setText(groupContextId);
View Full Code Here

Examples of org.apache.ws.commons.soap.SOAPFactory

        ConfigurationContext engineContext = new ConfigurationContext(er);

        MessageContext msgctx = new MessageContext();
        msgctx.setConfigurationContext(engineContext);

        SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();

        msgctx.setEnvelope(omFac.getDefaultEnvelope());
        assertNotNull(msgctx.getEnvelope());

        msgctx.setFaultTo(null);
        assertNull(msgctx.getFaultTo());
View Full Code Here

Examples of org.eclipse.wst.wsdl.binding.soap.SOAPFactory

    // We blow away any existing ExtensibilityElements/content before we generate it
    // Is it worth being smarter?  Look for matching content first and create those which aren't found????
    List removeList = new ArrayList(binding.getEExtensibilityElements());
    removeExtensebilityElements(binding.getEExtensibilityElements(), removeList);

    SOAPFactory soapFactory = SOAPFactory.eINSTANCE;
    SOAPBinding soapBinding = soapFactory.createSOAPBinding();
    soapBinding.setStyle((getStyleOption(binding) == STYLE_DOCUMENT) ? "document" : "rpc");
    soapBinding.setTransportURI("http://schemas.xmlsoap.org/soap/http");

    binding.addExtensibilityElement(soapBinding);
  }
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.