Hi,

In case others encounter the same problem, simply having the
indentation set to false solved the problem.

So in castor.properties, if you don't have it already, add the
following property, and it should be fine:

org.exolab.castor.indent=false

The xml sent over the wire will be on a single line, so it's less
friendly to debug, but at least, when unmarshalling the XML, it won't
remove the new line characters and won't mess up your text.

On 02/09/05, Guillaume Laforge <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> At work, we're using Castor for marshalling / unmarshalling our Java
> objects in some custom SOAP web services stack.
> 
> Castor marshalls long Strings and seems to be word-wrapping them on
> the wire (as I could see by sniffing the wire). So a node containing a
> long enough string can be split across multiple lines and become:
> 
>                    <ns:Text>Castor marshalls long Strings and
>                        seems to be word-wrapping them</ns:Text>
> 
> But when Castor unmarshalls that node and create the string in my Java
> object, it is messing with whitespace and removes both the whitespace
> and the carriage return. So instead of retrieving the original
> sentence like I had specified in my Java object with foo.setText():
> 
> "Castor marshalls long Strings and seems to be word-wrapping them"
> 
> ...through foo.getText() on the other end of the wire I get:
> 
> "Castor marshalls long Strings andseems to be word-wrapping them"
> 
> Notice the "andseems" word. All whitespace is removed! It's not my
> original string!!! :-(
> 
> Is there some Castor configuration I could tweak to avoid
> word-wrapping? Some parameter to set to unmarshall such strings
> correctly?
> 
> I browsed JIRA to look for a similar problem, and I wonder if my issue
> is related to those two bugs I've found:
> 
> Whitespace deleted by Unmarshaller
> http://jira.codehaus.org/browse/CASTOR-1024
> 
> WhiteSpace is not preserved in some cases.
> http://jira.codehaus.org/browse/CASTOR-965

-- 
Guillaume Laforge
http://glaforge.free.fr/blog/groovy

-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to