diff --git a/wsclient/utils/wsInterfaceUpdater.py b/wsclient/utils/wsInterfaceUpdater.py index 1123cf5ed..996f673d4 100644 --- a/wsclient/utils/wsInterfaceUpdater.py +++ b/wsclient/utils/wsInterfaceUpdater.py @@ -140,7 +140,7 @@ def main(): build_hpcc4j() print("Done...") - for service_name, ecm_file, wsdl_prefix, service_uri, non_eclwatch_port in services: + for service_name, ecm_file, wsdl_prefix, service_uri, non_eclwatch_port in services: if args.service != "all" and service_name != args.service: continue if ecm_file == None: @@ -183,11 +183,23 @@ def main(): remove_latest_stub(service_name) print(f"Generating latest stub for {wsdl_prefix}-{version}...") generate_stubcode(service_name) - print(f"Rebuilding wsclient...") - build_hpcc4j() + + print(f"Rebuilding wsclient...") + build_hpcc4j() + + wsclient_classpath = get_wsclient_runtime_classpath() + if wsclient_classpath == None: + print("Could not generate wsclient classpath!") + return + else: + for service_name, ecm_file, wsdl_prefix, service_uri, non_eclwatch_port in services: + if args.service != "all" and service_name != args.service: + continue + print(f"Generating latest stub wrappers for {wsdl_prefix}-{version}...") - generate_wrappers(service_name, wsdl_prefix) + generate_wrappers(service_name, wsdl_prefix, wsclient_classpath) print("Done...") + print(f"Building wsclient after WSDL based changes...") build_hpcc4j() print("Done...") @@ -351,28 +363,22 @@ def get_wsclient_runtime_classpath(): return class_path -def generate_wrappers(service_name, wsdl_prefix): +def generate_wrappers(service_name, wsdl_prefix, wsclient_class_path): + wrapper_class_name = "org.hpccsystems.ws.client.utils.Axis2ADBStubWrapperMaker" + wrappers_output_path = f"{os.getcwd()}/wsclient/src/main/java" + wrappers_package = "org.hpccsystems.ws.client.wrappers.gen" + package_to_wrap = f"org.hpccsystems.ws.client.gen.axis2.{service_name}.latest" + working_directory = f"{os.getcwd()}/wsclient" + gen_wrappers_command= f"java -classpath {wsclient_class_path} {wrapper_class_name} outputpackage=org.hpccsystems.ws.client.wrappers.gen targetpackage=org.hpccsystems.ws.client.gen.axis2.{service_name}.latest servicename={wsdl_prefix} outputdir={working_directory}/src/main/java" + logging.debug(f"gen_wrappers_command: {gen_wrappers_command}") - wsclient_classpath = get_wsclient_runtime_classpath() - if wsclient_classpath == None: - print("Could not generate wsclient classpath!") - return - else: - wrapper_class_name = "org.hpccsystems.ws.client.utils.Axis2ADBStubWrapperMaker" - wrappers_output_path = f"{os.getcwd()}/wsclient/src/main/java" - wrappers_package = "org.hpccsystems.ws.client.wrappers.gen" - package_to_wrap = f"org.hpccsystems.ws.client.gen.axis2.{service_name}.latest" - working_directory = f"{os.getcwd()}/wsclient" - gen_wrappers_command= f"java -classpath {wsclient_classpath} {wrapper_class_name} outputpackage=org.hpccsystems.ws.client.wrappers.gen targetpackage=org.hpccsystems.ws.client.gen.axis2.{service_name}.latest servicename={wsdl_prefix} outputdir={working_directory}/src/main/java" - print (f"gen_wrappers_command: {gen_wrappers_command}") - - process = subprocess.Popen(gen_wrappers_command.split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=working_directory) - for line in process.stdout: - message = str(line, 'utf-8') - if message.startswith("Alert!") or message.startswith("Warning:"): - logging.warning(message) - else: - logging.info(message) + process = subprocess.Popen(gen_wrappers_command.split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=working_directory) + for line in process.stdout: + message = str(line, 'utf-8') + if message.startswith("Alert!") or message.startswith("Warning:"): + logging.warning(message) + else: + logging.info(message) #generate-wsdl/hpcc4j$ # java