svc = desc.getServices()[0];
setService(svc.getName());
} else {
throw new DeploymentException("If service is not set, the WSDL must contain a single service definition");
}
Endpoint endpoint;
if (getEndpoint() != null) {
endpoint = svc.getEndpoint(new NCName(getEndpoint()));
if (endpoint == null) {
throw new DeploymentException(
"Could not find endpoint '" + getEndpoint() + "' in wsdl for service '" + getService() + "'");
}
} else if (svc.getEndpoints().length == 1) {
endpoint = svc.getEndpoints()[0];
setEndpoint(endpoint.getName().toString());
} else {
throw new DeploymentException(
"If endpoint is not set, the WSDL service '" + getService() + "' must contain a single port definition");
}
marshaler.setBinding(BindingFactory.createBinding(endpoint));