}
private WSDLService generateService(
WSDLComponentFactory wsdlComponentFactory, WSDLBinding binding,
String ServiceName, String [] URL) {
WSDLService service = wsdlComponentFactory.createService();
service.setName(new QName(ServiceName));
/*
* Adding policies defined in services.xml
*/
ArrayList policyElementList;
PolicyInclude include;
// Policies defined in Axis2.xml
AxisDescription axisConfiguration = null;
AxisDescription serviceGroup = axisService.getParent();
if (serviceGroup != null) {
axisConfiguration = serviceGroup.getParent();
}
if (axisConfiguration != null) {
include = axisConfiguration.getPolicyInclude();
policyElementList = include
.getPolicyElements(PolicyInclude.AXIS_POLICY);
addPolicyAsExtElements(womDescription, policyElementList, service,
include);
}
for (int i = 0; i < URL.length; i++) {
String epr = URL[i];
WSDLEndpoint endpoints = wsdlComponentFactory.createEndpoint();
endpoints.setBinding(binding);
endpoints.setName(new QName(ServiceName + "PortType" + i));
SOAPAddressImpl address = new SOAPAddressImpl();
address.setLocationURI(epr);
endpoints.addExtensibilityElement(address);
service.setEndpoint(endpoints);
}
return service;
}