Package org.apache.axiom.soap

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


        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


                                    Debug.logInfo("Response Message:\n" + resEnv + "\n", module);
                                } catch (Throwable t) {
                                }
                            }

                            resEnv.serialize(response.getOutputStream());
                            response.getOutputStream().flush();
                        }

                    } catch (GenericServiceException e) {
                        //sendError(response, "Problem processing the service"); this causes a not a valid XML response. See https://issues.apache.org/jira/browse/OFBIZ-4207
View Full Code Here

                    Debug.logInfo("Response Message:\n" + resEnv + "\n", module);
                } catch (Throwable t) {
                }
            }

            resEnv.serialize(res.getOutputStream());
            res.getOutputStream().flush();
        } catch (Exception e) {
            throw new EventHandlerException(e.getMessage(), e);
        }
    }
View Full Code Here

                                    Debug.log("Response Message:\n" + resEnv + "\n", module);
                                } catch (Throwable t) {
                                }
                            }

                            resEnv.serialize(response.getOutputStream());
                            response.getOutputStream().flush();
                        }

                    } catch (GenericServiceException e) {
                        sendError(response, "Problem processing the service");
View Full Code Here

                    Debug.log("Response Message:\n" + resEnv + "\n", module);
                } catch (Throwable t) {
                }
            }

            resEnv.serialize(res.getOutputStream());
            res.getOutputStream().flush();
        } catch (Exception e) {
            throw new EventHandlerException(e.getMessage(), e);
        }
    }
View Full Code Here

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

        SOAPEnvelope envelope = builder2.getSOAPEnvelope();
        envelope.build();

        StringWriter writer = new StringWriter();
        envelope.serialize(writer);
        writer.flush();

        String s2 = writer.toString();

        assertXMLEqual(s2, xml);
View Full Code Here

                SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        SOAPEnvelope envelope = builder2.getSOAPEnvelope();
        envelope.build();

        StringWriter writer = new StringWriter();
        envelope.serialize(writer);
        writer.flush();

        XMLStreamReader r = StAXUtils.createXMLStreamReader(new StringReader(writer.toString()));
        PrintEvents.print(r);
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

        assertEquals("iso-8859-1", envelope.getXMLStreamReader().getCharacterEncodingScheme());

        ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();
        OMOutputFormat outputFormat = new OMOutputFormat();
        outputFormat.setCharSetEncoding("iso-8859-1");
        envelope.serialize(byteOutStr, outputFormat);

        assertXMLEqual(new InputStreamReader(new ByteArrayInputStream(xml.getBytes("iso-8859-1")),"iso-8859-1"),
                new InputStreamReader(new ByteArrayInputStream(byteOutStr.toByteArray()),"iso-8859-1"));
    }
}
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.