if (obj instanceof JAXBElement) {
Object jaxbVal = ((JAXBElement<?>)obj).getValue();
if (jaxbVal instanceof ServiceNameType) {
Port port = null;
ServiceNameType snt = (ServiceNameType)jaxbVal;
if (LOG.isLoggable(Level.FINEST)) {
LOG.log(Level.FINEST, "found service name " + snt.getValue().getLocalPart());
}
Service service = def.getService(snt.getValue());
if (service == null) {
LOG.log(Level.WARNING, "can't find the service name ["
+ snt.getValue()
+ "], using the default service name in wsdl");
service = (Service)def.getServices().values().iterator().next();
if (service == null) {
return null;
}
}
String endpoint = snt.getEndpointName();
if ("".equals(endpoint) && service.getPorts().size() == 1) {
port = (Port)service.getPorts().values().iterator().next();
} else {
port = service.getPort(endpoint);
}