Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMElement.serialize()


        //No subscription available. so create a new subscription
        try {
            Resource resource = registry.newResource();
            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
            OMElement subElem = subscriptionToRegStorage(subscription, resource, true);
            subElem.serialize(outStream);
            resource.setContent(outStream.toByteArray());
            resource.setMediaType(EPR_TYPE);
            String topic = subscription.getFilterDesc().getFilterValue();
            if (!topic.startsWith("/")) {
                topic = "/" + topic;
View Full Code Here


                Resource resource = registry.get(regPath);
                subscriptionOrig.setExpires(subscription.getExpires());
                // set the new content
                OMElement subElem = subscriptionToRegStorage(subscriptionOrig, resource, false);
                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
                subElem.serialize(outStream);
                resource.setContent(outStream.toByteArray());
                resource.setMediaType(EPR_TYPE);
                registry.put(regPath, resource);
            } catch (RegistryException e) {
                log.error("Unable to update the registry", e);
View Full Code Here

      AxisService2WSDL11 g = new AxisService2WSDL11(axisService);
      g.setStyle(this.style);
      g.setUse(this.use);
      OMElement wsdlElement = g.generateOM();
      if (!isPretty()) {
        wsdlElement.serialize(out);
      } else {
        XMLPrettyPrinter.prettify(wsdlElement, out);
      }
    } else {
      AxisService2WSDL20 g = new AxisService2WSDL20(axisService);
View Full Code Here

      }
    } else {
      AxisService2WSDL20 g = new AxisService2WSDL20(axisService);
      OMElement wsdlElement = g.generateOM();
      if (!isPretty()) {
        wsdlElement.serialize(out);
      } else {
        XMLPrettyPrinter.prettify(wsdlElement, out);
      }
    }
   
View Full Code Here

            if (documentElementNS != null) {
                WSDL11ToAxisServiceBuilder wsdl11ToAxisServiceBuilder;
                if (Constants.NS_URI_WSDL11.
                        equals(documentElementNS.getNamespaceURI())) {
                    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                    documentElement.serialize(outputStream);
                    InputStream inStream = new ByteArrayInputStream(outputStream.toByteArray());
                    wsdl11ToAxisServiceBuilder = new WSDL11ToAllAxisServicesBuilder(inStream);
                    (wsdl11ToAxisServiceBuilder).setBaseUri(uri);
                    wsdl11ToAxisServiceBuilder.setAllPorts(true);
                    AxisService service = wsdl11ToAxisServiceBuilder.populateService();
View Full Code Here

                            messageContext.getConfigurationContext().getAxisConfiguration());
                    service.setParent(axisServiceGroup);
                    service.printWSDL2(outStream);
                } else if (WSDL2Constants.WSDL_NAMESPACE
                        .equals(documentElementNS.getNamespaceURI())) {
                    documentElement.serialize(outStream);
                } else {
                    throw new CarbonException("Invalid WSDL");
                }
            } else {
                throw new CarbonException("Invalid WSDL");
View Full Code Here

    try {
      if (requestIP != null) {
        axisService2WSDL2.setEPRs(calculateEPRs(requestIP));
      }
      OMElement wsdlElement = axisService2WSDL2.generateOM();
      wsdlElement.serialize(out);
      out.flush();
    } catch (Exception e) {
      throw AxisFault.makeFault(e);
    }
  }
View Full Code Here

            absoluteFile.createNewFile();

            OutputStream os = new FileOutputStream(file);
            OMElement servicesXML = createServicesXML(data);
            servicesXML.build();
            servicesXML.serialize(os);
        } catch (DuplicateServiceException e) {
            throw e;
        } catch (Exception e) {
            String msg = "Cannot write services XML";
            log.error(msg, e);
View Full Code Here

        ServiceClient sender = new ServiceClient(configContext, clientService);
        sender.setOptions(options);
        OMElement result = sender.sendReceive(operationName, payload);

        result.serialize(StAXUtils.createXMLStreamWriter(
                System.out));
        sender.cleanup();
    }

    public void testEchoXMLCompleteSync() throws Exception {
View Full Code Here

        ServiceClient sender = new ServiceClient(configContext, clientService);
        sender.setOptions(options);
        OMElement result = sender.sendReceive(operationName, payloadElement);

        result.serialize(StAXUtils.createXMLStreamWriter(
                System.out));
        sender.cleanup();

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