HI list,
I'm currently trying to get familiar with cxf/camel/servicemix and maybe
someone here has some input on this:
I have a web service that I'm trying to consume with camel-cxf. The web
service works fine, but I'm having trouble with the 
Service Endpoint Interface. I set up the cxfEndpoint via spring as follows:
        <cxf:cxfEndpoint id="cxfEndpoint
                address="http://localhost:8080/MyServlet/services/MyService";
                serviceClass="my.package.MyInterface"
                serviceName="s:MyService" 
        
wsdlURL="http://localhost:8080/MyServlet/services/MyService?wsdl";
                endpointName="s:MyService" xmlns:s="http://my.package";>
        </cxf:cxfEndpoint>

The tricky thing is, MyInterface resp. the webservice itself extends a
generic interface:
public interface MyInterface extends MyGenericInterface<A,B> { ..}
and
public MyGenericInterface<U,V>{
        U foo(V bar);
}

This will generate the following error:
javax.xml.bind.UnmarshalException: unexpected element
(uri:"http://my.package";, local:"fooReturn"). Expected elements are (none)
        at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handl
eEvent(UnmarshallingContext.java:647)[:1.7.0_21]

Now, if I either change MyInterface to 

MyInterface {
        A foor(B bar);
}
or make MyGenericInterface non-generic:

public interface MyInterface extends MyGenericInterface{ ..}
and
public MyGenericInterface{
        A foo(B bar);
}

everything works fine. I guess, I could inspect the Interface myself, deal
with generic parameters, omit it from the endpoint definition, set the
endpoint to PAYLOAD and deal with the cxfPayload/SOAP envelopes myself, but
I'd rather not re-invent the wheel if possible.

Am I missing something? Any comments appreciated.

Tobias

Reply via email to