cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Exception in INOUT parameter
Date Thu, 13 Mar 2008 14:50:47 GMT

Well, the first error is due to a bug in XmlSchema that we're TRYING to 
get a fix from them for:
https://issues.apache.org/jira/browse/CXF-1388

That team hasn't been to responsive with getting us a fix though.  If you 
would like to bug commons-dev@ws.apache.org about it, that would be 
great.   The fix is in place, we just need a release from them.   


A test case for the second would be good.


Dan



On Thursday 13 March 2008, GianCarlo wrote:
> Hi,
>
> I need to expose a service with CXF with an INOUT parameter. The INOUT
> parameter is array of objects (of class NameAndValue_T).
>
> The interface exposed is:
>
> package foo;
>
> import javax.jws.WebParam;
> import javax.jws.WebParam.Mode;
>
>
> @javax.jws.WebService(name="ENDPOINT_NAME",
>                      
> targetNamespace="NAME_SPACE")@javax.jws.soap.SOAPBinding(use=javax.jws
>.soap.SOAPBinding.Use.LITERAL,
> parameterStyle=javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED)
>
> public abstract interface TestInterface {
>
>     @javax.jws.WebMethod(operationName="bar")
>     abstract public boolean bar(@WebParam(name="how_many") int
> how_many, @WebParam(name="nameList", mode=Mode.INOUT) 
> javax.xml.ws.Holder<foo.NameAndValue_T[]> nameList);
>
> }
>
> During the Service creation the following Exception is raised:
>
> INFO: Creating Service {NAME_SPACE}TestInterfaceService from class
> foo.TestInterface Exception in thread "main"
> org.apache.ws.commons.schema.constants.Enum$EnumValueException: Bad
> Enumeration value 'extension restriction' at
> org.apache.ws.commons.schema.constants.Enum.setValue(Enum.java:49) at
> org.apache.ws.commons.schema.constants.Enum.<init>(Enum.java:27) at
> org.apache.ws.commons.schema.XmlSchemaDerivationMethod.<init>(XmlSchem
>aDerivationMethod.java:46) at
> org.apache.ws.commons.schema.SchemaBuilder.handleComplexType(SchemaBui
>lder.java:657) at
> org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(Sche
>maBuilder.java:157) at
> org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:82
>) at
> org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollect
>ion.java:342) at
> org.apache.cxf.common.xmlschema.SchemaCollection.read(SchemaCollection
>.java:111) at
> org.apache.cxf.databinding.source.AbstractDataBinding.addSchemaDocumen
>t(AbstractDataBinding.java:72) at
> org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:26
>5) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServi
>ceFromClass(ReflectionServiceFactoryBean.java:313) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initialize
>ServiceModel(ReflectionServiceFactoryBean.java:362) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Ref
>lectionServiceFactoryBean.java:156) at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServi
>ceFactoryBean.java:89) at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoin
>t(AbstractWSDLBasedEndpointFactory.java:74) at
> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.jav
>a:108) at
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryB
>ean.java:147) at foo.Server.<init>(Server.java:41)
> 	at foo.Server.main(Server.java:46)
>
>
> Moreover if add try to use a two dimensial array as INOUT parameter i
> have a (different) exception: (...same as the other...)
> public abstract interface TestInterface {
>
>     @javax.jws.WebMethod(operationName="bar")
>     abstract public boolean bar(@WebParam(name="how_many") int
> how_many, @WebParam(name="nameList", mode=Mode.INOUT) 
> javax.xml.ws.Holder<foo.NameAndValue_T[][]> nameList);
>
> }
>
>
> The exception is
>
> INFO: Creating Service {NAME_SPACE}TestInterfaceService from class
> foo.TestInterface Exception in thread "main"
> java.lang.ClassCastException:
> sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl cannot be
> cast to java.lang.Class at
> org.apache.cxf.jaxws.support.JaxWsServiceConfiguration.getHolderClass(
>JaxWsServiceConfiguration.java:707) at
> org.apache.cxf.jaxws.support.JaxWsServiceConfiguration.getHolderType(J
>axWsServiceConfiguration.java:697) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.getHolderT
>ype(ReflectionServiceFactoryBean.java:1423) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initialize
>Parameter(ReflectionServiceFactoryBean.java:1325) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createMess
>ageParts(ReflectionServiceFactoryBean.java:1156) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createOper
>ation(ReflectionServiceFactoryBean.java:699) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createInte
>rface(ReflectionServiceFactoryBean.java:683) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServi
>ceFromClass(ReflectionServiceFactoryBean.java:305) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initialize
>ServiceModel(ReflectionServiceFactoryBean.java:362) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Ref
>lectionServiceFactoryBean.java:156) at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServi
>ceFactoryBean.java:89) at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoin
>t(AbstractWSDLBasedEndpointFactory.java:74) at
> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.jav
>a:108) at
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryB
>ean.java:147) at foo.Server.<init>(Server.java:41)
> 	at foo.Server.main(Server.java:46)
>
>
> Anyone can help me?
> If needed, i can sent a Test case to reproduce the problem.
>
> Giancarlo.



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message