axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject cvs commit: ws-axis/java/test/saaj TestEnvelope.java
Date Fri, 02 Jul 2004 13:32:41 GMT
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();
  
  
  

Mime
View raw message