// set service name
serviceMetaData.setServiceName(wsdlEndpoint.getWsdlService().getName());
QName interfaceQName = wsdlEndpoint.getInterface().getName();
Endpoint ep = dep.getService().getEndpointByName(linkName);
ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData, ep, portName, interfaceQName, Type.JAXRPC);
sepMetaData.setPortComponentName(pcMetaData.getPortComponentName());
sepMetaData.setLinkName(linkName);
serviceMetaData.addEndpoint(sepMetaData);
initEndpointEncodingStyle(sepMetaData);
initEndpointAddress(dep, sepMetaData);
initEndpointBinding(wsdlEndpoint, sepMetaData);
EJBArchiveMetaData apMetaData = dep.getAttachment(EJBArchiveMetaData.class);
JSEArchiveMetaData webMetaData = dep.getAttachment(JSEArchiveMetaData.class);
if (apMetaData != null)
{
wsMetaData.setSecurityDomain(apMetaData.getSecurityDomain());
// Copy the wsdl publish location from jboss.xml
String wsdName = serviceMetaData.getWebserviceDescriptionName();
String wsdlPublishLocation = apMetaData.getWsdlPublishLocationByName(wsdName);
serviceMetaData.setWsdlPublishLocation(wsdlPublishLocation);
// Copy <port-component> meta data
EJBMetaData bmd = apMetaData.getBeanByEjbName(linkName);
if (bmd == null)
throw new WSException("Cannot obtain UnifiedBeanMetaData for: " + linkName);
String configName = apMetaData.getConfigName();
String configFile = apMetaData.getConfigFile();
if (configName != null || configFile != null)
sepMetaData.setConfigName(configName, configFile);
EJBSecurityMetaData smd = bmd.getSecurityMetaData();
if (smd != null)
{
String authMethod = smd.getAuthMethod();
sepMetaData.setAuthMethod(authMethod);
String transportGuarantee = smd.getTransportGuarantee();
sepMetaData.setTransportGuarantee(transportGuarantee);
Boolean secureWSDLAccess = smd.getSecureWSDLAccess();
sepMetaData.setSecureWSDLAccess(secureWSDLAccess);
}
}
else if (webMetaData != null)
{
wsMetaData.setSecurityDomain(webMetaData.getSecurityDomain());
String targetBean = webMetaData.getServletClassNames().get(linkName);
sepMetaData.setServiceEndpointImplName(targetBean);
// Copy the wsdl publish location from jboss-web.xml
String wsdName = serviceMetaData.getWebserviceDescriptionName();
String wsdlPublishLocation = webMetaData.getWsdlPublishLocationByName(wsdName);
serviceMetaData.setWsdlPublishLocation(wsdlPublishLocation);
String configName = webMetaData.getConfigName();
String configFile = webMetaData.getConfigFile();
if (configName != null || configFile != null)
sepMetaData.setConfigName(configName, configFile);
initTransportGuaranteeJSE(dep, sepMetaData, linkName);
}
// init service endpoint id
ObjectName sepID = createServiceEndpointID(dep, sepMetaData);
sepMetaData.setServiceEndpointID(sepID);
replaceAddressLocation(sepMetaData);
String seiName = pcMetaData.getServiceEndpointInterface();
sepMetaData.setServiceEndpointInterfaceName(seiName);
ServiceEndpointInterfaceMapping seiMapping = javaWsdlMapping.getServiceEndpointInterfaceMapping(seiName);
if (seiMapping == null)
log.warn("Cannot obtain SEI mapping for: " + seiName);
// process endpoint meta extension
processEndpointMetaDataExtensions(sepMetaData, wsdlDefinitions);
// Setup the endpoint operations
setupOperationsFromWSDL(sepMetaData, wsdlEndpoint, seiMapping);
// Setup the endpoint handlers
for (UnifiedHandlerMetaData uhmd : pcMetaData.getHandlers())
{
Set<String> portNames = uhmd.getPortNames();
if (portNames.size() == 0 || portNames.contains(portName.getLocalPart()))
{
HandlerMetaDataJAXRPC hmd = HandlerMetaDataJAXRPC.newInstance(uhmd, HandlerType.ENDPOINT);
sepMetaData.addHandler(hmd);
}
}
}
}