{
String targetNS = epMetaData.getPortTypeName().getNamespaceURI().intern();
if (log.isDebugEnabled())
log.debug("JAXBContext [types=" + javaTypes + ",tns=" + targetNS + "]");
JAXBContextFactory factory = JAXBContextFactory.newInstance();
// JAXBIntros may mofiy the WSDL being generated
// only true for server side invocation, tooling (WSProvide) doesnt support this
BindingCustomization bindingCustomization = null;
if (epMetaData instanceof ServerEndpointMetaData)
{
Endpoint endpoint = ((ServerEndpointMetaData)epMetaData).getEndpoint();
bindingCustomization = endpoint != null ? endpoint.getAttachment(BindingCustomization.class) : null;
}
jaxbCtx = factory.createContext(javaTypes.toArray(new Class[0]), typeRefs, targetNS, false, bindingCustomization);
}
catch (WSException ex)
{
throw new IllegalStateException("Cannot build JAXB context", ex);
}