Hello,

To get in context, I'm building a "Generic Server" () (in fact, I've developed 
a RESTful generic server https://issues.apache.org/jira/browse/CXF-3022). Now, 
I'd like to extend it with JAX-WS web services (that's why I chose CXF :) ) but 
I'm having some problems related to generic types.

I'm trying to add my model classes to the JAX-WS server via extraClasses 
property in the JAXB Databinding, but It seems they aren't recognized by the 
marshaller.

Sample code:

<bean id="genericService" 
class="com.grupoica.test.jaxwsproject.service.ServiceImpl" abstract="true">
<!--        <property name="daoFactory" ref="daoFactory" />-->
    </bean>

    <bean id="priorityService" parent="genericService">
        <constructor-arg value="com.grupoica.test.jaxwsproject.Priority"/>
    </bean>

    <jaxws:endpoint id="priorityEndpoint"  implementor="#priorityService" 
address="/priorityEndpoint">
        <jaxws:inInterceptors>
            <bean id="loggingInInterceptor" 
class="org.apache.cxf.interceptor.LoggingInInterceptor" />
        </jaxws:inInterceptors>
        <jaxws:outInterceptors>
            <bean id="loggingOutInterceptor" 
class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
        </jaxws:outInterceptors>
        <jaxws:dataBinding>
            <bean class="org.apache.cxf.jaxb.JAXBDataBinding">
              <property name="extraClass">
                    <list>
                       <!-Priority extends from GenericBean -->
                        
<value>com.grupoica.test.jaxwsproject.GenericBean</value>
                        <value>com.grupoica.test.jaxwsproject.Priority</value>
                    </list>
                </property>
            </bean>
        </jaxws:dataBinding>
    </jaxws:endpoint>

@WebService
public interface IService<T> {

       T get(Long id);
}

@WebService(endpointInterface = 
"com.grupoica.test.jaxwsproject.service.IService",
targetNamespace = "http://cxf.apache.org";,
portName = "PortName",
serviceName = "ServiceName")
public class ServiceImpl<T extends GenericBean> implements IService<T>
{
    private Class<T> type;

    public ServiceImpl(Class<T> type)
    {
        this.type = type;
    }

  @Override
    public T get(Long id)
    {
//omitted
    }
}


25-oct-2011 10:19:41 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean 
fillInSchemaCrossreferences
SEVERE: Schema element {http://service.jaxwsproject.test.grupoica.com/}priority 
references undefined type priority for service 
{http://cxf.apache.org}ServiceName.
25-oct-2011 10:19:41 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean 
fillInSchemaCrossreferences
SEVERE: Schema element 
{http://service.jaxwsproject.test.grupoica.com/}genericBean references 
undefined type genericBean for service {http://cxf.apache.org}ServiceName.


Any ideas?

Thanks in advance!

Ivan


Reply via email to