Getting it from java.net.URL:
URL url = new URL(http://www.host.com/ws);
bkDoc = BooksDocument.Factory.parse(url);
The data in that file just contains the text "no data".
Thanks,
Steven
On Nov 16, 2007, at 5:42 PM, Jacob Danner wrote:
How are you getting the content? Is it a stream. There may be some
extra characters prepended to the value and thats causing this.
On Nov 16, 2007 1:58 PM, Steven Crosley < [EMAIL PROTECTED]>
wrote:
2007-11-16 10:03:35,830 ERROR
[com.x.xc.books.service.BookServiceImpl ]
- <org.apache.xmlbeans.XmlException: http://192.168.0.1/Books:1:1:
error: Unexpected element: CDATA>
The thing is, when there is no data, there is no CDATA element at all,
it's not providing any xml, just a plain text message saying that
there is no data.
Thanks,
Steven
On Nov 16, 2007, at 3:45 PM, Jacob Danner wrote:
> I'm not sure why it's happening. What is the error message you are
> getting.
>
> To handle errors in validation, I do something with XmlOptions and
the
> error listener.
> List errors = new LinkedList();
> XmlOptions xo //...
> xo.setErrorListener(errors);
> Document.Factory.parse(instance, xo);
> if errors.size() > 0
> /do something with the errors.
>
> Best of luck
> -jacobd
> ====================
> sent from my nokia 9500
>
> On 11/16/07, Steven Crosley <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I'm curious as to why this is happening and if it's possible to
turn
>> it off. I'm not really sure the best way to explain what is going
>> on.
>>
>> When I make a call to my webservice and load into my
>> Document.Factory.parse method, if the xml data is valid it will
load
>> no problem.
>>
>> Later in the day, when the xml data is not valid, I'll get an error
>> in
>> my catalina.out log that the data is not valid, but instead of
>> displaying no data, it instead displays the data from the last
>> successful call, so it appears that the data has loaded, but just
>> hasn't been updated. What I would like it to do instead is for
it to
>> handle the failure. The code looks something like this for
>> generating
>> the array of xml elements:
>>
>> bkDoc = BooksDocument.Factory.parse(url);
>> books = bkDoc.getBooks();
>> Book[] book = books.getBookArray();
>>
>> Thanks,
>> Steven
>>
>>
---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]