Marshalling Error:[Ljava.lang.String; is not known to this context
------------------------------------------------------------------
Key: CXF-2859
URL: https://issues.apache.org/jira/browse/CXF-2859
Project: CXF
Issue Type: Bug
Affects Versions: 2.2.9
Reporter: Bin Chen
Priority: Blocker
I made a client using cxf to call a dotNet webservice.
the wsdl define a method, and this method need a parameter that defined like
that: (sorry , I can't provide the whole wsdl file)
<xs:simpleType name="Children">
<xs:list>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="None">
<xs:annotation>
<xs:appinfo>
<EnumerationValue
xmlns="http://schemas.microsoft.com/2003/10/Serialization/">0
</EnumerationValue>
</xs:appinfo>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="AAA">
<xs:annotation>
<xs:appinfo>
<EnumerationValue
xmlns="http://schemas.microsoft.com/2003/10/Serialization/">1
</EnumerationValue>
</xs:appinfo>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="BBB">
<xs:annotation>
<xs:appinfo>
<EnumerationValue
xmlns="http://schemas.microsoft.com/2003/10/Serialization/">2
</EnumerationValue>
</xs:appinfo>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:list>
</xs:simpleType>
the code in client:
Object[] params = new Object[] { new String[] { "AAA", "BBB" } };
retParams = client.invoke(operation.getName(), params);
then I got this error:
2010-6-24 13:39:04 org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
Warnning: Interceptor for
{http://tempuri.org/}ConnectApiService#{http://tempuri.org/}GetIndividual has
thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: [Ljava.lang.String; is not
known to this context
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:247)
at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169)
at
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:111)
at
org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:487)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:285)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:271)
at test.Test.main(Test.java:952)
Caused by: javax.xml.bind.MarshalException
- with linked exception:
[javax.xml.bind.JAXBException: [Ljava.lang.String; is not known to this context]
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:318)
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:244)
at
javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:532)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:213)
... 13 more
Caused by: javax.xml.bind.JAXBException: [Ljava.lang.String; is not known to
this context
at
com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:246)
at
com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:261)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:144)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:189)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:316)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:323)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:72)
at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494)
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:315)
... 17 more
Caused by: javax.xml.bind.JAXBException: [Ljava.lang.String; is not known to
this context
at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:625)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:141)
... 23 more
org.apache.cxf.interceptor.Fault: Marshalling Error: [Ljava.lang.String; is not
known to this context
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:247)
at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169)
at
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:111)
at
org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:487)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:285)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:271)
at test.Test.main(Test.java:952)
Caused by: javax.xml.bind.MarshalException
- with linked exception:
[javax.xml.bind.JAXBException: [Ljava.lang.String; is not known to this context]
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:318)
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:244)
at
javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:532)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:213)
... 13 more
Caused by: javax.xml.bind.JAXBException: [Ljava.lang.String; is not known to
this context
at
com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:246)
at
com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:261)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:144)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:189)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:316)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:323)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:72)
at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494)
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:315)
... 17 more
Caused by: javax.xml.bind.JAXBException: [Ljava.lang.String; is not known to
this context
at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:625)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:141)
... 23 more
I think it's related to <xs:list>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.