Package org.apache.axiom.soap

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


    SOAPEnvelope envelope = createSeqRMMessage.getMessageContext().getEnvelope();
   
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
   
    envelope.serialize(outputStream);
   
    return outputStream.toByteArray();
  }
}
View Full Code Here


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

            resEnv.serialize(response.getOutputStream());
            response.getOutputStream().flush();
        } catch (Exception e) {
            Debug.logError(e, module);
            throw new EventHandlerException(e.getMessage(), e);
        }
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

        writer.close();
    }

    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().getNamespaceURI(),
                     "http://localhost:8081/axis/services/BankPort/");
View Full Code Here

        connection.addRequestProperty("Content-Type", "text/xml; charset=UTF-8");
        OutputStream out = connection.getOutputStream();
        // Send the request
        OMOutputFormat format = new OMOutputFormat();
        format.setCharSetEncoding("UTF-8");
        request.serialize(out, format);
        out.close();
       
        // Get the SOAP response
        InputStream in = connection.getInputStream();
        Attachments attachments = new Attachments(in, connection.getContentType());
View Full Code Here

        SOAPEnvelope orgEnvelope = soapFactory.getDefaultEnvelope();
        soapFactory.createOMElement("echo", soapFactory.createOMNamespace("urn:test", null)).setText("test");
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        OMOutputFormat format = new OMOutputFormat();
        format.setCharSetEncoding(encoding);
        orgEnvelope.serialize(baos, format);
        SOAPMessage message = (SOAPMessage)OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory,
                new ByteArrayInputStream(baos.toByteArray()), encoding).getDocument();
        assertEquals(encoding, message.getCharsetEncoding());
    }
}
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"); this causes a not a valid XML response. See https://issues.apache.org/jira/browse/OFBIZ-4207
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

        DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
        Document document = documentBuilder.parse(SaxUtils.createInputSource(resource));

        SOAPEnvelope envelope = AxiomUtils.toEnvelope(document);
        StringWriter writer = new StringWriter();
        envelope.serialize(writer);
        String result = writer.toString();

        assertXMLEqual("Invalid SOAPEnvelope generated from document", expected, result);
    }
}
View Full Code Here

    SOAPEnvelope envelope = createSeqRMMessage.getMessageContext().getEnvelope();
   
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
   
    envelope.serialize(outputStream);
   
    return outputStream.toByteArray();
  }
}
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.