}
}
//extract SOAP-over-JMS 1.0 bindings
if (!map.isEmpty()) {
final JMSEndpointsMetaData endpointsMetaData = new JMSEndpointsMetaData();
final ResourceRoot deploymentRoot = unit.getAttachment(Attachments.DEPLOYMENT_ROOT);
final UnifiedVirtualFile uvf = new VirtualFileAdaptor(deploymentRoot.getRoot());
final boolean trace = LOG.isTraceEnabled();
for (String wsdlLocation : map.keySet()) {
if (trace) {
LOG.tracef("Scanning wsdlLocation: %s", wsdlLocation);
}
try {
URL url = uvf.findChild(wsdlLocation).toURL();
SOAPAddressWSDLParser parser = new SOAPAddressWSDLParser(url);
for (AnnotationInstance ai : map.get(wsdlLocation)) {
String port = ai.value(PORT_NAME).asString();
String service = ai.value(SERVICE_NAME).asString();
AnnotationValue targetNS = ai.value(TARGET_NAMESPACE);
String tns = targetNS != null ? targetNS.asString() : null;
QName serviceName = new QName(tns, service);
QName portName = new QName(tns, port);
if (trace) {
LOG.tracef(" serviceName: %s", serviceName);
LOG.tracef(" portName: %s", portName);
}
String soapAddress = parser.filterSoapAddress(serviceName, portName, SOAPAddressWSDLParser.SOAP_OVER_JMS_NS);
if (soapAddress != null) {
ClassInfo webServiceClassInfo = (ClassInfo) ai.target();
String beanClassName = webServiceClassInfo.name().toString();
//service name ?
JMSEndpointMetaData endpointMetaData = new JMSEndpointMetaData(endpointsMetaData);
endpointMetaData.setEndpointName(port);
endpointMetaData.setImplementor(beanClassName);
//endpointMetaData.setName(name);
endpointMetaData.setSoapAddress(soapAddress);
endpointMetaData.setWsdlLocation(wsdlLocation);
endpointsMetaData.addEndpointMetaData(endpointMetaData);
}
}
} catch (Exception e) {
if (trace) {
LOG.warnf("Could not read WSDL at '%s'", wsdlLocation, e);
} else {
LOG.warnf("Could not read WSDL at '%s'", wsdlLocation);
}
}
}
if (!endpointsMetaData.getEndpointsMetaData().isEmpty()) {
unit.putAttachment(JMS_ENDPOINT_METADATA_KEY, endpointsMetaData);
}
}
}