}
String serviceUrl = getUrl();
if (serviceUrl != null)
{
return new XFireProxyFactory().create(serviceModel, serviceUrl);
}
if (_endpointName == null)
{
_endpointName = findFirstSoapEndpoint(serviceModel.getEndpoints());
}
if (_endpointName != null)
{
Endpoint ep = serviceModel.getEndpoint(_endpointName);
if (ep == null)
throw new IllegalStateException("Could not find endpoint with name " + _endpointName + " on service.");
return new XFireProxyFactory().create(ep);
}
else
throw new IllegalStateException("A WSDL URL or service URL must be supplied.");
}