File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes problem cxf with Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "problem cxf with "& " caracter" Watch "problem cxf with "& " caracter" New topic

problem cxf with "& " caracter

camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
Hi guys,

I do not understand why I am having this problem when I try to search some data in my api using & as string in field:

In soapui, I have this values:

There is a owner with "&" in string. But when I try to search, my response is:

Mon Jan 30 13:37:52 BRST 2012:ERROR:An error occured [The entity name must immediately follow the '&' in the entity reference.], see error log for details

do someone have passed by this problem? any idea how to fix?


Brazil - Sun Certified Java Programmer - SCJP 5 About Java - Update every Week.
Guide SCJP - tips that you need know
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 632
<serviceFilterValue>Admin&strator </serviceFilterValue>

Ampersand in text node should be written in escaped form (no hyphen below):
<serviceFilterValue>Admin&-a-m-p;strator </serviceFilterValue>
Or, in cdata section, it can be in unescaped form.
<serviceFilterValue><![CDATA[Admin&strator ]]></serviceFilterValue>
camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
hi g tsuji
I got it . I used Admin&-a-m-p;strator. Now it is working.


I agree. Here's the link:
subject: problem cxf with "& " caracter
It's not a secret anymore!