This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes javax.xml.ws.AsyncHandler is an interface, and JAXB can't handle interfaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "javax.xml.ws.AsyncHandler is an interface, and JAXB can Watch "javax.xml.ws.AsyncHandler is an interface, and JAXB can New topic
Author

javax.xml.ws.AsyncHandler is an interface, and JAXB can't handle interfaces

sachin baveja
Greenhorn

Joined: May 16, 2011
Posts: 3
Hi
I am trying to implement a JAX-WS web service as asynchronous.
I have implemented the client side code as follows:

/*-------------------------------------------------------------------------------
CallbackHandler callbackHandler = new CallbackHandler ();
Future<?> resp = serverProxy.validateAsAsync(request, callbackHandler);
response = callbackHandler.getResponse();
//*--------------------------------------------------------------------------------

class CallbackHandler implements AsyncHandler<MyResponse> {
private MyResponse output;
public void handleResponse(Response<MyResponse> response) {
try {
output = response.get();
}catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}

MyResponsegetResponse() {
return output;
}
}

The SEI looks like below
@WebMethod
public Future<?> validateAsAsync(
@WebParam(name = "MyRequest", targetNamespace = "", partName = "parameter")
MyRequest parameter,
@WebParam(name = "callbackhandler", targetNamespace = "", partName = "asyncHandler")
AsyncHandler<MyResponse> asyncHandler);

I am getting the following error:
Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 4 counts of IllegalAnnotationExceptions
javax.xml.ws.AsyncHandler is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at javax.xml.ws.AsyncHandler
at private javax.xml.ws.AsyncHandler jaxws.ValidateAsAsync.callbackhandler

Looks like Jax-WS is not able to create the Jax-B object for ASyncHandler since it is an interface, how to get around this issue?
I really appreciate your help.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax.xml.ws.AsyncHandler is an interface, and JAXB can't handle interfaces
 
Similar Threads
How come there's no exceptions when use JAX-WS?
Callback Client in Webservice
Service for Asynchronous Client calls (polling, callback)
Asynchronous web service client
Passing Files in Web Services