Skip to main content

wsgen : expose webmethod with interfaces as result and parameter types

2 replies [Last post]
prisca
Offline
Joined: 2006-03-30

Hi,

I would like to expose an existing ejb as a Web Service. I am using wsgen to generate the needed artifacts.
The Web Method header is the following :

@WebMethod
public TroubleTicketKey createTroubleTicketByValue(TroubleTicketValue value)

where the return type, TroubleTicketKey is an interface AND the parameter type, TroubleTicketValue is also an interface.

Looking throughout the forum, I've found many topics relating to this issue :
http://forums.java.net/jive/thread.jspa?forumID=46&threadID=14105&messag...
http://forums.java.net/jive/thread.jspa?forumID=46&threadID=1124&message...

So, I have tried many solutions but in each case, I could not handle with the two interfaces at the same time. In fact :


@WebMethod
@XmlJavaTypeAdapter(value=TroubleTicketValueImplAdapter.class)
public TroubleTicketKey createTroubleTicketByValue(TroubleTicketValue value) throws ...

The "XmlJavaTypeAdapter" can only be added once, so I can solve the problem of the parameter but not the one of the return value.

I have also tried with @XmlElement(type=TroubleTicketKeyImpl.class) whitout result...

I do not see tha right solution to such a problem, I would appreciate to have any help on it.

Thanks in advance,
Prisca

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
prisca
Offline
Joined: 2006-03-30

Yes, I was about to put the link...

But my solution involves the modification of the Java Interface, what I finally was able to do. I still have no solution when the Interface is part of a package you can't access... Not really a problem in my work but just curiosity !

Thanks Kohsuke.

kohsuke
Offline
Joined: 2003-06-09

I believe you found a solution in http://forums.java.net/jive/thread.jspa?threadID=15234