Jeff,

Any chance you could log a JIRA and attach a test case for the enum 
problem?   It SOUNDS like Aegis isn't generating the schema for the 
enums correctly.   Or possibly some import namespaces is off or similar.

Dan



On Tuesday 06 November 2007, Segal, Jeffrey wrote:
> Update:
>
> I have verified that this is in fact supported by CXF, just not well
> documented yet.  Here is my Spring configuration, which changes the
> default nillable and minOccurs settings to avoid stubs which wrap
> every Object with JAXBElement:
>
>
>     <bean id="typeMappingRegistryConfiguration"
> class="org.apache.cxf.aegis.type.Configuration">
>         <property name="defaultMinOccurs">
>             <value>1</value>
>         </property>
>         <property name="defaultNillable" value="false"/>
>     </bean>
>
>     <bean id="typeMappingRegistry"
> class="org.apache.cxf.aegis.type.DefaultTypeMappingRegistry">
>         <property name="configuration"
> ref="typeMappingRegistryConfiguration"/>
>     </bean>
>
>     <bean id="aegisBean"
> class="org.apache.cxf.aegis.databinding.AegisDatabinding">
>         <property name="typeMappingRegistry"
> ref="typeMappingRegistry"/> </bean>
>
>     <bean id="jaxws-and-aegis-service-factory"
> class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
>         <property name="properties">
>             <map>
>                 <entry key="writeXsiType">
>                     <value type="java.lang.Boolean">true</value>
>                 </entry>
>                 <entry key="overrideTypesList">
>                     <list>
>                         <value>com.foo.bar.A</value>
>                         <value>com.foo.bar.B</value>
>                         <value>com.foo.bar.C</value>
>                     </list>
>                 </entry>
>             </map>
>         </property>
>
>         <property name="dataBinding" ref="aegisBean"/>
>         <property name="serviceConfigurations">
>             <list>
>                 <bean
> class="org.apache.cxf.jaxws.support.JaxWsServiceConfiguration"/>
>                 <bean
> class="org.apache.cxf.aegis.databinding.AegisServiceConfiguration"/>
>                 <bean
> class="org.apache.cxf.service.factory.DefaultServiceConfiguration"/>
>             </list>
>         </property>
>     </bean>
>
>     <jaxws:endpoint
>             id="fooService"
>             implementor="#myFooServiceBean"
>             implementorClass="com.service.foo.impl"
>             address="/foo">
>         <jaxws:serviceFactory>
>             <ref bean="jaxws-and-aegis-service-factory"/>
>         </jaxws:serviceFactory>
>     </jaxws:endpoint>
>
>
> This all works as advertised, which is great.  However, there are two
> features that appear to be lacking.
>
> First, let's say class A (referenced in the overrideTypesList above)
> has an enum property.  CXF will correctly convert it to an XML
> enumeration. However, when creating stubs, the following error occurs:
>
> WSDLToJava Error : Thrown by JAXB : undefined simple or complex type
> 'ns3:SomeEnumType'
>
> Am I right to assume that CXF does not fully support Java 5 enums?
>
> Second, let's say class A has properties of types D, E and F.  If
> class A was referenced in a service API (e.g., com.foo.bar.A getA(int
> id)), CXF is smart enough to bind D, E and F to XML in the resultant
> WSDL. However, if class A is only added to the WSDL via the
> overrideTypesList, classes D, E and F must also be manually added.  If
> D, E and F in turn each have 3 more POJOs of their own, one can see
> how calling out each dependency out gets very unwieldy.
>
> I think these two features would be a great addition to CXF's
> capabilities.  Thoughts?
>
> Cheers,
> Jeff
>
>
>
> -----Original Message-----
> From: Segal, Jeffrey [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 05, 2007 6:30 PM
> To: cxf-user@incubator.apache.org
> Subject: Java first: Binding classes not exposed in service APIs
>
> I asked a smiliar question a few days ago referencing binding
> subclasses with Aegis
> (http://www.nabble.com/Migrating-XFire-Aegis-inheritance-to-CXF-tf4733
>90 3.html), but I wanted to follow up on the subject and ask a more
> general question.  Is binding arbitrary classes (i.e. those that are
> not necessarily exposed in a service interface) supported in CXF?  If
> so, how is this done using JAXB?  What would the Spring configuration
> look like?
>
> Thanks!
> Jeff



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to