You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ia...@apache.org on 2004/07/02 15:32:41 UTC
cvs commit: ws-axis/java/test/saaj TestEnvelope.java
ias 2004/07/02 06:32:41
Modified: java/test/saaj TestEnvelope.java
Log:
Add a test case for http://marc.theaimsgroup.com/?l=axis-dev&m=108486748914915&w=2 .
Revision Changes Path
1.8 +21 -0 ws-axis/java/test/saaj/TestEnvelope.java
Index: TestEnvelope.java
===================================================================
RCS file: /home/cvs/ws-axis/java/test/saaj/TestEnvelope.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TestEnvelope.java 14 Jun 2004 15:47:22 -0000 1.7
+++ TestEnvelope.java 2 Jul 2004 13:32:41 -0000 1.8
@@ -69,6 +69,27 @@
assertTrue(body != null);
}
+ public void testEnvelopeWithLeadingComment() throws Exception {
+ String soapMessageWithLeadingComment =
+ "<?xml version='1.0' encoding='UTF-8'?>" +
+ "<!-- Comment -->" +
+ "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ "<env:Body><echo><arg0>Hello</arg0></echo></env:Body>" +
+ "</env:Envelope>";
+
+ SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
+ SOAPConnection con = scFactory.createConnection();
+
+ MessageFactory factory = MessageFactory.newInstance();
+ SOAPMessage message =
+ factory.createMessage(new MimeHeaders(),
+ new ByteArrayInputStream(soapMessageWithLeadingComment.getBytes()));
+ SOAPPart part = message.getSOAPPart();
+ SOAPEnvelope envelope = (SOAPEnvelope) part.getEnvelope();
+ //message.writeTo(System.out);
+ assertTrue(envelope != null);
+ }
+
private SOAPEnvelope getSOAPEnvelope() throws Exception {
SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
SOAPConnection con = scFactory.createConnection();