[
https://issues.apache.org/jira/browse/CXF-2859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12885551#action_12885551
]
Glen Mazza commented on CXF-2859:
---------------------------------
We need more information--a very simple WSDL that reproduces the problem, a
simple client class as well perhaps. Your enumeration type accepts only values
1,2,3 but you're feeding it either "AAA" or "BBB" -- why are you not expecting
an error under such circumstances?
Does the same thing happen with a Metro client[1]--if so, the bug may be with
JAXB[2] or something you're doing strangely in your client code. That XSD
snippet is very simple and common--I'm reluctant to believe the problem is with
CXF, rather, perhaps you just need to ask some questions on the CXF or Metro's
users lists for more help.
[1] http://www.jroller.com/gmazza/entry/soap_client_tutorial
[2] https://jaxb.dev.java.net/issues/
> 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.