JAXBContextImpl jaxbContext =
new JAXBContextImpl(jaxbClassArray, properties);
Marshaller marshaller = jaxbContext.createMarshaller();
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
DirectSkeleton skel =
new DirectSkeleton(type, api, jaxbContext, wsdlLocation, namespace, wsdl);
Method[] methods = type.getMethods();
boolean excludeIfNoWebMethod = false;
for (int i = 0; i < methods.length; i++) {
WebMethod webMethod = methods[i].getAnnotation(WebMethod.class);
if (webMethod != null && ! webMethod.exclude()) {
excludeIfNoWebMethod = true;
break;
}
}
for (int i = 0; i < methods.length; i++) {
if ((methods[i].getModifiers() & Modifier.PUBLIC) == 0)
continue;
WebMethod webMethod = methods[i].getAnnotation(WebMethod.class);
if (api != type) {
/* XXX: needed for demo
if (webMethod != null)
throw new WebServiceException(L.l("Cannot use WebMethod with WebService.endpointInterface: {0}", type));
*/
try {
api.getDeclaredMethod(methods[i].getName(),
methods[i].getParameterTypes());
}
catch (NoSuchMethodException e) {
// ignore methods not declared in the endpoint interface
continue;
}
}
if (excludeIfNoWebMethod && webMethod == null)
continue;
if (webService == null && webMethod == null && ! isInterface)
continue;
if (webMethod == null && methods[i].getDeclaringClass() != type)
continue;
if (webMethod != null && webMethod.exclude())
continue;
AbstractAction action =
AbstractAction.createAction(methods[i], jaxbContext, namespace, wsdl,
marshaller, unmarshaller);
skel.addAction(methods[i], action);
}
return skel;
}