ws-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Ausianik <Pavel_Ausia...@epam.com>
Subject RE: Extra line appearing in Apache Response
Date Mon, 30 Sep 2002 11:39:43 GMT
Hello,

Sorry, I didn't catch exactly where new line is inserted, but I have the
problem similar to described.
While testing  my SOAP client against SOAP server created with SUN's SOAP
toolkit I got the following error:

java.lang.RuntimeException: Text nodes can't be immediate children of SOAP
Body
	at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:524)
	at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
	at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
	at org.dom4j.io.SAXReader.read(SAXReader.java:302)
	at org.dom4j.io.SAXReader.read(SAXReader.java:229)
	at
com.sun.xml.messaging.soap.dom4j.EnvelopeFactoryImpl.createEnvelope(Envelope
FactoryImpl.java:70)
	at
com.sun.xml.messaging.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:92)

As you see the SAX parser for the SOAP body in SUN's implementation can not
handle newline characters. This maybe a limitation in Sun's implementation,
but in the world of software you often just can't say - it is not my
problem, especially if you have to insert newly software into existing
system.

In order to fix the problem for myself, I had to download Apache SOAP
sources and edit class org.apache.soap.util.StringUtils, replacing   

  public static final String lineSeparator =
    System.getProperty("line.separator", "\n");

with an easy

public static final String lineSeparator = "";

Then I had to recomplie SOAP lib, and use custom buit jar. This solved my
problem completely. Now I wonder, what is the specific  reason to insert new
lines? 

Best regards,
Pavel

> -----Original Message-----
> From: SoumenS@Atoga.com [mailto:SoumenS@Atoga.com]
> Sent: Monday, September 30, 2002 6:47 AM
> To: damiana@objectconsulting.com.au; soap-dev@xml.apache.org
> Subject: RE: Extra line appearing in Apache Response
> 
> 
> I beleive this is not a a Apache SOAP bug. White space and
> lines between tags should not matter in XML parsing. Please
> refer to XML specification as shown below:
> =============================================================
> http://www.xml.com/axml/testaxml.htm
> 
> 2.10 White Space Handling
> 
> In editing XML documents, it is often convenient to use "white space"
> (spaces, tabs, and blank lines, denoted by the nonterminal S in this
> specification) to set apart the markup for greater 
> readability. Such white
> space is typically not intended for inclusion in the 
> delivered version of
> the document. On the other hand, "significant" white space 
> that should be
> preserved in the delivered version is common, for example in 
> poetry and
> source code.
> 
> 
> 2.11 End-of-Line Handling
> =============================================================
> 
> This is a flaw in client, IMHO. It will be "nice"
> on part of Apache SOAP to avoid that empty line but it is
> NOT a requirement.
> 
> On a related note, I am surprised and apalled by this kind of
> " SOAP interop" problems. SOAP/XML has been there for quite
> some time and still some commercial stacks has such trivial issues.
> 
> Soumen Sarkar.
> 
> -----Original Message-----
> From: Damian Alonso
> To: 'soap-dev@xml.apache.org'
> Sent: 9/29/2002 7:38 PM
> Subject: Extra line appearing in Apache Response
> 
> I'm wondering if anyone has seen this problem before. 
> 
> We currently have an Apache SOAP 2.2 Service running, which 
> is returning
> a http response that looks like this: 
> 
> <SOAP-ENV:Envelope
>   xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/
> <http://schemas.xmlsoap.org/soap/envelope/> ">
>    <SOAP-ENV:Body>
>        <ns1:someResponse> 
>         ... 
>        </ns1:someResponse> 
> 
>    </SOAP-ENV:Body>
> </SOAP-ENV:Envelope> 
> 
> The problem we have found is that some clients (e.g SilkPerformer for
> .NET) are having problems handling the extra carriage return 
> between the
> 'response' closing tag and the 'body' closing tag.  On all 
> the examples
> I have looked at, there normally is no carriage return between the
> 'response' closing tag and the 'body' closing tag.  
> 
> E.g 
> <SOAP-ENV:Envelope
>   xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/
> <http://schemas.xmlsoap.org/soap/envelope/> ">
>    <SOAP-ENV:Body>
>        <ns1:someResponse> 
>         ... 
>        </ns1:someResponse>
>    </SOAP-ENV:Body>
> </SOAP-ENV:Envelope> 
> 
> We have found that this extra carriage return is in all our 
> Apache SOAP
> responses (no matter what service we are offering).  My 
> question's are:
> 
> - Is that allowed (i.e the extra carriage return) as part of the SOAP
> 1.1 specification?? 
> - Is that a bug with Apache's way of encoding the response?? 
> - Does anyone know why this extra carriage return is being inserted
> (i.e what part of the Apache SOAP code does this serialization of the
> resonse)??
> 
> - Is it a flaw in the client because it cannot handle the 
> extra carriage
> return??? 
> 
> Any information on this or similar problems would be greatly
> appreciated. 
> 
> Thanks in advance, 
> 
> Damian. 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:soap-dev-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <mailto:soap-dev-help@xml.apache.org>
> 
> 

Mime
View raw message