Package org.apache.axis2.soap

Examples of org.apache.axis2.soap.SOAPEnvelope.serialize()


//    }


    public void testSerilizationWithDefaultNamespaces() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builderTwo.getDocumentElement();
        env.serialize(writer);
        OMElement balanceElement = env.getBody().getFirstElement();
        assertEquals("Deafualt namespace has not been set properly",
                balanceElement.getNamespace().getName(),
                "http://localhost:8081/axis/services/BankPort/");
View Full Code Here


                createXMLStreamReader(
                        new InputStreamReader(
                                new ByteArrayInputStream(xmlText2.getBytes()))));
        env.getBody().addChild(builder.getDocumentElement());

        env.serialize(System.out);
    }

    public void testSerilizationWithCacheOn() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builderOne.getDocumentElement();
        env.serialize(writer);
View Full Code Here

        env.serialize(System.out);
    }

    public void testSerilizationWithCacheOn() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builderOne.getDocumentElement();
        env.serialize(writer);
        writer.flush();
    }

    public void testSerilizationWithCacheOff() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builderOne.getDocumentElement();
View Full Code Here

        writer.flush();
    }

    public void testSerilizationWithCacheOff() throws Exception {
        SOAPEnvelope env = (SOAPEnvelope) builderOne.getDocumentElement();
        env.serialize(writer);
        writer.flush();
    }
}
View Full Code Here

    ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();
   
    OMOutputFormat outputFormat = new OMOutputFormat();
        outputFormat.setCharSetEncoding(UTF_16);
    envelope.serialize(byteOutStr, outputFormat);
   
    ByteArrayInputStream byteInStr = new ByteArrayInputStream(byteOutStr.toByteArray());
   
    StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(byteInStr, UTF_16),null);
View Full Code Here

            SOAPComparator soapComparator = new SOAPComparator();
            //ignore elements that belong to the addressing namespace
            soapComparator.addIgnorableNamespace("http://schemas.xmlsoap.org/ws/2004/08/addressing");

            System.out.println("######################################################");
            requiredMessageEnvelope.serialize(System.out);
            System.out.println("");
            System.out.println("-------------------------------------------------------");
            replyMessageEnvelope.serialize(System.out);
            System.out.println("");
                   System.out.println("`######################################################");
View Full Code Here

                if (policyElements.size() == 1) {
                    response.addHeader(HTTP.CONTENT_TYPE, "text/xml");
                    if (policyElements.get(0) instanceof Policy) {
                        Policy policy = (Policy) policyElements.get(0);
                        serializer.serialize(policy, outputStream);
                    } else if (policyElements.get(0) instanceof PolicyReference) {
                        String key = ((PolicyReference) policyElements.get(0)).getURI();
                        if (key.startsWith("#")) {
                            key = key.substring(key.indexOf("#") + 1);
                        }
View Full Code Here

                        Policy p = reg.lookup(key);
                        if (p == null) {
                            response.addHeader(HTTP.CONTENT_TYPE, "text/html");
                            outputStream.write("<h4>Policy element not found!</h4>".getBytes());
                        } else {
                            serializer.serialize(p, outputStream);
                        }
                    }
                } else {
                    // for many policies
                    String idParam = request.getParameter("id");
View Full Code Here

                        Object policyObject = policyElements.get(Integer.parseInt(idParam));
                        if (policyObject != null) {
                            response.addHeader(HTTP.CONTENT_TYPE, "text/xml");
                            if (policyObject instanceof Policy) {
                                Policy policy = (Policy) policyObject;
                                serializer.serialize(policy, outputStream);
                            } else if (policyObject instanceof PolicyReference) {
                                String key = ((PolicyReference) policyObject).getURI();
                                if (key.startsWith("#")) {
                                    key = key.substring(key.indexOf("#") + 1);
                                }
View Full Code Here

                                if (p == null) {
                                    response.addHeader(HTTP.CONTENT_TYPE, "text/html");
                                    outputStream
                                            .write("<h4>Policy element not found!</h4>".getBytes());
                                } else {
                                    serializer.serialize(p, outputStream);
                                }
                            }
                        } else {
                            response.addHeader(HTTP.CONTENT_TYPE, "text/html");
                            outputStream.write("<h4>Policy not found!</h4>".getBytes());
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.