Skip to content

Commit

Permalink
Adding support to read from env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ChinthakaJ98 committed Nov 30, 2023
1 parent ce6c782 commit e142b18
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,13 @@ public static ProxyService createProxy(OMElement elem, Properties properties) {
proxy.setPreservePolicy(preservePolicy.getAttributeValue());
}
if (wsdlEndpoint != null) {
proxy.setPublishWSDLEndpoint(wsdlEndpoint.getAttributeValue());
String resolvedWsdlEndpoint = ResolverFactory.getInstance()
.getResolver(wsdlEndpoint.getAttributeValue()).resolve();
proxy.setPublishWSDLEndpoint(resolvedWsdlEndpoint);
} else if (wsdlKey != null) {
proxy.setWSDLKey(wsdlKey.getAttributeValue());
String resolvedWsdlKey = ResolverFactory.getInstance()
.getResolver(wsdlKey.getAttributeValue()).resolve();
proxy.setWSDLKey(resolvedWsdlKey);
} else {
OMAttribute wsdlURI = wsdl.getAttribute(
new QName(XMLConfigConstants.NULL_NAMESPACE, "uri"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public Endpoint createEndpoint(OMElement endpointElement, boolean a, Properties
OMAttribute endpointTemplateAttribute = endpointElement.getAttribute(
new QName(XMLConfigConstants.NULL_NAMESPACE, "template"));
if (endpointTemplateAttribute != null) {
templateEndpoint.setTemplate(endpointTemplateAttribute.getAttributeValue());
String resolvedTemplate = ResolverFactory.getInstance()
.getResolver(endpointTemplateAttribute.getAttributeValue()).resolve();
templateEndpoint.setTemplate(resolvedTemplate);
} else {
handleException("Error loading the configuration from endpoint group, " +
templateEndpoint.getName() +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,16 @@ protected Endpoint createEndpoint(OMElement epConfig, boolean anonymousEndpoint,

// get the service name and port name. at this point we should not worry about
// the presence of those parameters. they are handled by corresponding WSDL builders.
String serviceName = wsdlElement.getAttributeValue(new QName("service"));
String portName = wsdlElement.getAttributeValue(new QName("port"));
String resolvedServiceName = ResolverFactory.getInstance()
.getResolver(wsdlElement.getAttributeValue(new QName("service"))).resolve();;
String resolvedPortName = ResolverFactory.getInstance()
.getResolver(wsdlElement.getAttributeValue(new QName("port"))).resolve();
// check if wsdl is supplied as a URI
String wsdlURI = wsdlElement.getAttributeValue(new QName("uri"));
// set serviceName and portName in the endpoint. it does not matter if these are
// null at this point. we are setting them only for serialization purpose.
wsdlEndpoint.setServiceName(serviceName);
wsdlEndpoint.setPortName(portName);
wsdlEndpoint.setServiceName(resolvedServiceName);
wsdlEndpoint.setPortName(resolvedPortName);

String noParsing = properties.getProperty(SKIP_WSDL_PARSING);

Expand All @@ -142,7 +144,7 @@ protected Endpoint createEndpoint(OMElement epConfig, boolean anonymousEndpoint,

new WSDL11EndpointBuilder().
populateEndpointDefinitionFromWSDL(endpoint,
wsdlURI.trim(), omElement, serviceName, portName);
wsdlURI.trim(), omElement, resolvedServiceName, resolvedPortName);

} else if (WSDL2Constants.WSDL_NAMESPACE.equals(nsUri)) {
//endpoint = new WSDL20EndpointBuilder().
Expand Down Expand Up @@ -181,7 +183,7 @@ protected Endpoint createEndpoint(OMElement epConfig, boolean anonymousEndpoint,
baseUri = baseUri + File.separator;
}
new WSDL11EndpointBuilder().populateEndpointDefinitionFromWSDL(endpoint,
baseUri, definitionElement, serviceName, portName);
baseUri, definitionElement, resolvedServiceName, resolvedPortName);
} else {
endpoint = new EndpointDefinition();
}
Expand Down

0 comments on commit e142b18

Please sign in to comment.