ClassLoader runtimeClassLoader = dep.getRuntimeClassLoader();
if(null == runtimeClassLoader)
throw new IllegalArgumentException("Runtime loader cannot be null");
resetMetaDataBuilder(runtimeClassLoader);
ServerEndpointMetaData sepMetaData = result.sepMetaData;
ServiceMetaData serviceMetaData = result.serviceMetaData;
serviceMetaData.setWsdlLocation(result.wsdlLocation);
Class<?> seiClass = result.epClass;
sepMetaData.setLinkName(linkName);
sepMetaData.setServiceEndpointImplName(sepClass.getName());
sepMetaData.setServiceEndpointInterfaceName(seiClass.getName());
// Assign the WS-Security configuration,
WSSecurityConfigFactory wsseConfFactory = WSSecurityConfigFactory.newInstance();
WSSecurityConfiguration securityConfiguration = wsseConfFactory.createConfiguration(wsMetaData.getRootFile(), WSSecurityOMFactory.SERVER_RESOURCE_NAME);
serviceMetaData.setSecurityConfiguration(securityConfiguration);
// Process an optional @SOAPBinding annotation
processSOAPBinding(sepMetaData, seiClass);
// Process an optional @BindingType annotation
processBindingType(sepMetaData, sepClass);
// process config
processEndpointConfig(sepClass, linkName, sepMetaData);
// Process web methods
processWebMethods(sepMetaData, seiClass);
// Init the transport guarantee
initTransportGuaranteeJSE(dep, sepMetaData, linkName);
// Initialize types
createJAXBContext(sepMetaData);
populateXmlTypes(sepMetaData);
//Process an optional @PolicyAttachment annotation
if (sepClass.isAnnotationPresent(PolicyAttachment.class))
{
PolicyMetaDataBuilder policyBuilder = PolicyMetaDataBuilder.getServerSidePolicyMetaDataBuilder(toolMode);
policyBuilder.processPolicyAnnotations(sepMetaData, sepClass);
}
// The server must always generate WSDL
if (generateWsdl || !toolMode)
processOrGenerateWSDL(seiClass, serviceMetaData, result.wsdlLocation, sepMetaData);
// No need to process endpoint items if we are in tool mode
if (toolMode)
return sepMetaData;
// Sanity check: read the generated WSDL and initialize the schema model
// Note, this should no longer be needed, look into removing it
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);
// Note, that @WebContext needs to be defined on the endpoint not the SEI
processWebContext(dep, sepClass, linkName, sepMetaData);
// setup handler chain from config
sepMetaData.initEndpointConfig();
// Process an optional @HandlerChain annotation
if (sepClass.isAnnotationPresent(HandlerChain.class))
processHandlerChain(sepMetaData, sepClass);
else if (seiClass.isAnnotationPresent(HandlerChain.class))
processHandlerChain(sepMetaData, seiClass);
// process webservices.xml contributions
processWSDDContribution(sepMetaData);
// Init the endpoint address
initEndpointAddress(dep, sepMetaData);
// Process an optional @SOAPMessageHandlers annotation
if (sepClass.isAnnotationPresent(SOAPMessageHandlers.class) || seiClass.isAnnotationPresent(SOAPMessageHandlers.class))
log.warn("@SOAPMessageHandlers is deprecated as of JAX-WS 2.0 with no replacement.");
MetaDataBuilder.replaceAddressLocation(sepMetaData);
processEndpointMetaDataExtensions(sepMetaData, wsdlDefinitions);
// init service endpoint id
ObjectName sepID = MetaDataBuilder.createServiceEndpointID(dep, sepMetaData);
sepMetaData.setServiceEndpointID(sepID);
return sepMetaData;
}
catch (RuntimeException rte)
{