Re: Enumeration problem

2008-01-03 Thread melix

Two solutions, either :
 - move to CXF 2.0.3 which fixes the problem (easy)
 - edit the stubs to change the namespace

Cedric


Mon wrote:
 
 Hi!
 I'm seeing the same issue. Any ideas how to get round it?
 Thanks,
 Monica
 
 
 melix wrote:
 
 Hi,
 
 Using CXF 2.0.2, I have a problem using CXF with a service which throws
 an exception which contains an enumeration field. The WSDL is generated
 correctly, and I use wsdl2java for generating client stubs. The WSDL
 shows the following :
 
 xs:simpleType name=fultyExceptionType
  xs:restriction base=xs:string
  xs:enumeration value=LILIAN_CONNECTION_FAILURE/
  xs:enumeration value=INTERNAL_ERROR/
  xs:enumeration value=IO_ERROR/
  xs:enumeration value=UNKNOWN_CREATION_TEMPLATE/
  xs:enumeration value=MISSING_PARAMETER/
  xs:enumeration value=UNKNOWN_APPLICATION/
  xs:enumeration value=QUERY_PARSE_ERROR/
  xs:enumeration value=APPLICATION_ALREADY_EXISTS/
  xs:enumeration value=INDEXATION_SESSION_NOT_ENDED/
  xs:enumeration value=UNHANDLED_EXCEPTION/
  xs:enumeration value=JDBC_CONNECTION_FAILURE/
  /xs:restriction
 /xs:simpleType
 xs:complexType final=#all name=fultyExceptionTypeArray
  xs:sequence
  xs:element maxOccurs=unbounded minOccurs=0 name=item
 nillable=true type=tns:fultyExceptionType/
  /xs:sequence
 /xs:complexType
 
 The stubs also seem to be generated correctly, and
 FultyExceptionTypeArray class is also generated. But at runtime, it fails
 with the following error :
 
 Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1
 counts of IllegalAnnotationExceptions
 Two classes have the same XML type name
 {mycompany.com}fultyExceptionTypeArray. Use @XmlType.name and
 @XmlType.namespace to assign different names to them.
  this problem is related to the following location:
  at com.mycompany.ws.FultyExceptionType[]
  this problem is related to the following location:
  at com.mycompany.ws.FultyExceptionTypeArray
 
 There seems to be a conflict with the Array. Can't figure out what's
 happening...
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Enumeration-problem-tp13667022p14597629.html
Sent from the cxf-user mailing list archive at Nabble.com.



Encodings messup

2007-11-13 Thread melix

Hi,

I'm using CXF with JAX-WS, and I do have problems/misunterstandings about
character encodings. Here's my problem. Basically :

1. Server may run on different platforms (Linux, Windows, ...) for which
default charset encodings are different
2. clients are not necessarily written in Java (I do have one for tests, but
also Perl clients)
3. clients run on different platforms with different default encodings
4. @WebMethod String getResult(String aQuestion);
5. both result and question are strings which are actually XML (ex :
questionhow are you/question - answerrobotfine, thank you
!/robot/answer)
6. XML tells its own encoding (through ?xml ... encoding='iso-8859-1'?)
for example

So now :

- at runtime, in which encoding do I get the question ? I use XOM for XML
parsing, but (it's not a problem) it takes an InputStream, so I do have to
create an inputstream from the question. I'm not really sure that :
   InputStream in = new BufferedInputStream(new
ByteArrayInputStream(question.getBytes()));
does the trick because getBytes() will assume that the string is encoded in
the system encoding (which may not be true). Futhermore, will it clash with
the fact that the string *represents* an XML in another encoding (question
may not be expressed in the encoding of the client)
- I use a ByteArrayOutputStream and a XOM Serializer for generating an XML
response, but I do have to convert it to a String in order to return it to
the client. If I do a return out.getBytes(iso-8859-1), the result string
will be, according to my understanding of Java, an UTF-16 encoded string : I
just tell the compiler that my bytearrayoutputstream contains bytes in
iso-8859-1. Then, the server will send the string to the client using the
platform default charset, so either utf-8 (linux) or iso-8859-1 (windows).
This could be ok, but I need to be sure that the actual string returned to
the client will be an ISO-8859-1 string according to what my result XML
header says...

I'm feeling the headache close, so any expert help would really be
appreciated !

-- 
View this message in context: 
http://www.nabble.com/Encodings-messup-tf4797821.html#a13726051
Sent from the cxf-user mailing list archive at Nabble.com.



Enumeration problem

2007-11-09 Thread melix

Hi,

Using CXF 2.0.2, I have a problem using CXF with a service which throws an
exception which contains an enumeration field. The WSDL is generated
correctly, and I use wsdl2java for generating client stubs. The WSDL shows
the following :

xs:simpleType name=fultyExceptionType
xs:restriction base=xs:string
xs:enumeration value=LILIAN_CONNECTION_FAILURE/
xs:enumeration value=INTERNAL_ERROR/
xs:enumeration value=IO_ERROR/
xs:enumeration value=UNKNOWN_CREATION_TEMPLATE/
xs:enumeration value=MISSING_PARAMETER/
xs:enumeration value=UNKNOWN_APPLICATION/
xs:enumeration value=QUERY_PARSE_ERROR/
xs:enumeration value=APPLICATION_ALREADY_EXISTS/
xs:enumeration value=INDEXATION_SESSION_NOT_ENDED/
xs:enumeration value=UNHANDLED_EXCEPTION/
xs:enumeration value=JDBC_CONNECTION_FAILURE/
/xs:restriction
/xs:simpleType
xs:complexType final=#all name=fultyExceptionTypeArray
xs:sequence
xs:element maxOccurs=unbounded minOccurs=0 name=item
nillable=true type=tns:fultyExceptionType/
/xs:sequence
/xs:complexType

The stubs also seem to be generated correctly, and FultyExceptionTypeArray
class is also generated. But at runtime, it fails with the following error :

Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts
of IllegalAnnotationExceptions
Two classes have the same XML type name
{mycompany.com}fultyExceptionTypeArray. Use @XmlType.name and
@XmlType.namespace to assign different names to them.
this problem is related to the following location:
at com.mycompany.ws.FultyExceptionType[]
this problem is related to the following location:
at com.mycompany.ws.FultyExceptionTypeArray

There seems to be a conflict with the Array. Can't figure out what's
happening...

-- 
View this message in context: 
http://www.nabble.com/Enumeration-problem-tf4777694.html#a13667022
Sent from the cxf-user mailing list archive at Nabble.com.