You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ni...@thomsonreuters.com on 2011/07/19 17:29:29 UTC

SoapHeader with Anonymous ComplexType attribute

Hi 

I'm writing a CXF java-first Soap service, and I have soapheader
elements' schemas as the premise.

I generated the Jaxb classes from these schemas and now trying to use
these classes as @WebParam in my SEI.

I'm facing issue for one element which is defined by an anonymous
complex type, then there is a issue in defining the Holder object, since
I don't have the SchemaType class generated for this element.

 

Here is my SEI Definition:

public MyObject foo(@WebParam(name = "x") GenericRequest x,

            @WebParam(mode = Mode.INOUT, header = true, name = "y",
targetNamespace="xxx1") Holder<TypeY> y,

            @WebParam(mode = Mode.INOUT, header = true, name = "z",
targetNamespace="xxx2") Holder<ElementZ> z);

 

Following error occurs on tomcat startup:

SEVERE: Exception sending context initialized event to listener instance
of class org.springframework.web.context.ContextLoaderListener

org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'service': Invocation of init method failed; nested
exception is javax.xml.ws.WebServiceException:
java.lang.ClassCastException:
org.apache.ws.commons.schema.XmlSchemaElement cannot be cast to
org.apache.ws.commons.schema.XmlSchemaType

 

How to define the schematype in such cases?

 

regards

Nitin


Re: SoapHeader with Anonymous ComplexType attribute

Posted by Daniel Kulp <dk...@apache.org>.
Can you package this whole thing up as an example/test case and attach to a 
JIRA?  That definitely looks like a bug.

Dan


On Tuesday, July 19, 2011 4:29:29 PM nitin.tiwari@thomsonreuters.com wrote:
> Hi
> 
> I'm writing a CXF java-first Soap service, and I have soapheader
> elements' schemas as the premise.
> 
> I generated the Jaxb classes from these schemas and now trying to use
> these classes as @WebParam in my SEI.
> 
> I'm facing issue for one element which is defined by an anonymous
> complex type, then there is a issue in defining the Holder object, since
> I don't have the SchemaType class generated for this element.
> 
> 
> 
> Here is my SEI Definition:
> 
> public MyObject foo(@WebParam(name = "x") GenericRequest x,
> 
>             @WebParam(mode = Mode.INOUT, header = true, name = "y",
> targetNamespace="xxx1") Holder<TypeY> y,
> 
>             @WebParam(mode = Mode.INOUT, header = true, name = "z",
> targetNamespace="xxx2") Holder<ElementZ> z);
> 
> 
> 
> Following error occurs on tomcat startup:
> 
> SEVERE: Exception sending context initialized event to listener instance
> of class org.springframework.web.context.ContextLoaderListener
> 
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'service': Invocation of init method failed; nested
> exception is javax.xml.ws.WebServiceException:
> java.lang.ClassCastException:
> org.apache.ws.commons.schema.XmlSchemaElement cannot be cast to
> org.apache.ws.commons.schema.XmlSchemaType
> 
> 
> 
> How to define the schematype in such cases?
> 
> 
> 
> regards
> 
> Nitin
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com