Johnson, Eric wrote:
> I was looking over the system test for adding extra JAXB classes to the
> JAXB context and noticed that it relied on ClassArrayFactoryBean.
> ClassArrayFactoryBean is a system test specific class.
>  
> Is there an equivalent class in the regular CXF APIs? Or is there
> another class I could use in its place?

I do it like this:

  <jaxws:server id="serviceEndpoint"
                  serviceBean="#serviceImpl"
                  serviceClass="my.service.ServiceImpl"
                  address="/some-service">
    <jaxws:dataBinding>
      <bean class="org.apache.cxf.jaxb.JAXBDataBinding">
        <property name="extraClass">
          <list>
            <value>my.service.ExtraClass1</value>
            <value>my.service.ExtraClass2</value>
          </list>
        </property>
      </bean>
    </jaxws:dataBinding>
  </jaxws:server>


This works because the JAXBDataBinding.extraClass property is strongly
typed as a Class[], so Spring handles the type conversion from the
<list> value without needing a FactoryBean to do the work.

Note this doesn't work with <jaxws:endpoint>, but <jaxws:server> has
exactly the same effect, it just works slightly differently under the
covers.

Ian

-- 
Ian Roberts               | Department of Computer Science
[EMAIL PROTECTED]  | University of Sheffield, UK

Reply via email to