[
https://issues.apache.org/jira/browse/CXF-3722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13402747#comment-13402747
]
Greg Holmberg commented on CXF-3722:
------------------------------------
Hmm. I'm a little confused by your example code.
As an interface, NamedObject shouldn't know about its implementations (MyPOJO
in my example code, Book in yours).
Yet, in your code NamedObject knows about NamedObjectAdapter, which in turn
knows about Book.
So it appears that each implementation of NamedObject has to add an
@XmlJavaTypeAdapter line to NamedObject.java.
This would make it difficult to re-use the code in NamedObjectService. Which
was the whole point.
I'm looking for a way to have many independent implementations of NamedObject,
without having modify the source code of NamedObject or NamedObjectService, but
only writing MyPOJO and MyService.
The code I show above would achieve this, and does compile, but fails at
run-time because the client proxy can't marshall MyPOJO as an argument to
create().
Sorry if I'm being dense, as I'm new to CXF, JAX-RS, and JAXB. Maybe I need a
more complete example...
Greg
> Generic interface and Implementation
> ------------------------------------
>
> Key: CXF-3722
> URL: https://issues.apache.org/jira/browse/CXF-3722
> Project: CXF
> Issue Type: Bug
> Affects Versions: 2.2
> Environment: CXF 2.2.6
> JAVA 6
> Windows XP
> Tomcat 6
> Code First
> Reporter: Deboschère Tony
> Assignee: Daniel Kulp
> Priority: Minor
> Fix For: Invalid
>
>
> I ve createad a Generic interface, let say IGenericInterface<TYPE extends
> MyAbstracTypeOne, TYPE2 extends MyAbstractTypeTwo>
> In this interface are some méthode like :
> public TYPE getTypeFromType2(TYPE2);
> In another interface I extends IGenericInterface
> and add some specific methods
> ex :
> @WebService
> ISpecificInterface extends IgenericInterface<MySubTypeOne, MySubTypeTwo> {
> @WebMethod
> public MySubTypeOne getTest();
> }
> When I implement ISpecificInterface in an implementation class, then add the
> @Webservice @WebResult and other @WebParam and launch my server
> I do see a web service with two methods in the wsdl
> getTest and getTypeFromType2.
> But the second method returns xml corresponding to the abstractType
> MyAbstracTypeOne and not MySubTypeOne
> PS : I launch the webservice serverside via :
> Object webServiceImpl = webServiceClass.newInstance();
> Endpoint endpoint = Endpoint.create(webServiceImpl);
> endpoint.publish("/" + name);
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira