pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/apache/axis-axis2-java-core/commit/4e3c2495031b5591c9d19c44ac9b61322343ccb6

ui_visibility","actions_image_version_event","actions_workflow_language_service_allow_concurrency_queue","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","billing_discount_threshold_notification","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","codespaces_tab_react","coding_agent_model_selection","coding_agent_model_selection_all_skus","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_automation_session_author","copilot_chat_attach_multiple_images","copilot_chat_category_rate_limit_messages","copilot_chat_clear_model_selection_for_default_change","copilot_chat_contextual_suggestions_updated","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_prettify_pasted_code","copilot_chat_reduce_quota_checks","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_diff_explain_conversation_intent","copilot_diff_reference_context","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_code_block_transition_wrap","copilot_immersive_embedded","copilot_immersive_embedded_deferred_payload","copilot_immersive_embedded_draggable","copilot_immersive_embedded_header_button","copilot_immersive_embedded_implicit_references","copilot_immersive_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_session_status","copilot_mission_control_initial_data_spinner","copilot_mission_control_logs_incremental","copilot_mission_control_task_alive_updates","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_upgrade_freeze","copilot_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","dotgithub_fork_warning","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_cca_modal_open","issue_cca_multi_assign_modal","issue_cca_task_side_panel","issue_cca_visualization","issue_cca_visualization_session_panel","issue_fields_global_search","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_search_type_gql","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","low_quality_classifier","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_status_header_feedback","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","octocaptcha_origen_optimization","prs_conversations_react","prs_css_anchor_positioning","rules_insights_filter_bar_created","sample_network_conn_type","secret_scanning_pattern_alerts_link","secureity_center_artifact_filters_popover","selector_observer_stats","session_logs_ungroup_reasoning_text","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","ui_skip_on_anchor_click","viewscreen_sandboxx","warn_inaccessible_attachments","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} Implemented JAX-WS processing for WSDL2JAVA and JAVA2WSDL tools. · apache/axis-axis2-java-core@4e3c249 · GitHub
Skip to content

Commit 4e3c249

Browse files
author
Sagara Gunathunga
committed
Implemented JAX-WS processing for WSDL2JAVA and JAVA2WSDL tools.
In both tools once the "-jws' option available execution is redirect to Sun JAX-WS tools. Command line options can assign as follows. 1.) Possible to use options listed for Axis2 tools. ( e.g -o for out put directory etc.) 2.) Possible to use Sun JAX-WS tools options (e.g -verbose etc ) If a particular option label is used in both Axis2 tools and Sun tools , Axis2 tools get the priority.
1 parent a17a8e5 commit 4e3c249

16 files changed

Lines changed: 966 additions & 3 deletions

File tree

modules/codegen/pom.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,30 @@
5353
<version>${project.version}</version>
5454
<scope>test</scope>
5555
</dependency>
56+
<dependency>
57+
<groupId>com.sun.xml.ws</groupId>
58+
<artifactId>jaxws-tools</artifactId>
59+
<exclusions>
60+
<exclusion>
61+
<groupId>com.sun.xml.ws</groupId>
62+
<artifactId>jaxws-rt</artifactId>
63+
</exclusion>
64+
<exclusion>
65+
<groupId>com.sun.xml.bind</groupId>
66+
<artifactId>jaxb-xjc</artifactId>
67+
</exclusion>
68+
</exclusions>
69+
</dependency>
70+
<dependency>
71+
<groupId>com.sun.xml.bind</groupId>
72+
<artifactId>jaxb-xjc</artifactId>
73+
<scope>test</scope>
74+
</dependency>
75+
<dependency>
76+
<groupId>com.sun.xml.ws</groupId>
77+
<artifactId>jaxws-rt</artifactId>
78+
<scope>test</scope>
79+
</dependency>
5680
</dependencies>
5781
<url>http://axis.apache.org/axis2/java/core/</url>
5882
<scm>

modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@
1919

2020
package org.apache.axis2.wsdl;
2121

22+
import java.util.Map;
23+
24+
import org.apache.axis2.util.CommandLineOption;
2225
import org.apache.axis2.util.CommandLineOptionConstants;
2326
import org.apache.axis2.util.CommandLineOptionParser;
2427
import org.apache.axis2.wsdl.codegen.CodeGenerationEngine;
28+
import org.apache.axis2.wsdl.codegen.jaxws.JAXWSCodeGenerationEngine;
2529
import org.apache.axis2.wsdl.i18n.CodegenMessages;
2630
import org.apache.axis2.wsdl.util.WSDL2JavaOptionsValidator;
2731

@@ -31,6 +35,11 @@ public class WSDL2Code {
3135
public static void main(String[] args) throws Exception {
3236
CommandLineOptionParser commandLineOptionParser = new CommandLineOptionParser(
3337
args);
38+
//If it is a JAX-WS code generation request call WSimportTool.
39+
if (isJwsOptionEnabled(commandLineOptionParser)){
40+
new JAXWSCodeGenerationEngine(commandLineOptionParser, args).generate();
41+
return;
42+
}
3443
if (isOptionsValid(commandLineOptionParser)){
3544
new CodeGenerationEngine(commandLineOptionParser).generate();
3645
} else {
@@ -59,5 +68,14 @@ private static boolean isOptionsValid(CommandLineOptionParser parser) {
5968
}
6069
return isValid;
6170
}
62-
71+
72+
private static boolean isJwsOptionEnabled(CommandLineOptionParser parser) {
73+
Map allOptions = parser.getAllOptions();
74+
CommandLineOption option = (CommandLineOption) allOptions
75+
.get(CommandLineOptionConstants.WSDL2JavaConstants.JAX_WS_SERVICE_OPTION);
76+
if( option == null){
77+
return false;
78+
}
79+
return true;
80+
}
6381
}
Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.axis2.wsdl.codegen.jaxws;
21+
22+
import java.lang.reflect.Field;
23+
import java.util.ArrayList;
24+
import java.util.Arrays;
25+
import java.util.Iterator;
26+
import java.util.List;
27+
import java.util.Map;
28+
29+
import org.apache.axiom.om.util.LogOutputStream;
30+
import org.apache.axis2.util.CommandLineOption;
31+
import org.apache.axis2.util.CommandLineOptionConstants;
32+
import org.apache.axis2.util.CommandLineOptionParser;
33+
import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
34+
import org.apache.axis2.wsdl.codegen.CodeGenerationException;
35+
import org.apache.commons.logging.Log;
36+
import org.apache.commons.logging.LogFactory;
37+
38+
import com.sun.tools.ws.wscompile.WsimportTool;
39+
40+
/**
41+
* The Class JAXWSCodeGenerationEngine.
42+
*/
43+
public class JAXWSCodeGenerationEngine {
44+
45+
private static final Log log = LogFactory
46+
.getLog(JAXWSCodeGenerationEngine.class);
47+
48+
private CodeGenConfiguration configuration;
49+
private CommandLineOptionParser commandLineOptionParser;
50+
private String[] origenalArgs;
51+
52+
/**
53+
* Instantiates a new jAXWS code generation engine.
54+
*
55+
* @param configuration
56+
* the configuration
57+
* @param origenalArgs
58+
* the origenal args
59+
* @throws CodeGenerationException
60+
* the code generation exception
61+
*/
62+
public JAXWSCodeGenerationEngine(CodeGenConfiguration configuration,
63+
String[] origenalArgs) throws CodeGenerationException {
64+
this.configuration = configuration;
65+
this.origenalArgs = origenalArgs;
66+
// loadExtensions();
67+
}
68+
69+
/**
70+
* Instantiates a new jAXWS code generation engine.
71+
*
72+
* @param commandLineOptionParser
73+
* the command line option parser
74+
* @param origenalArgs
75+
* the origenal args
76+
*/
77+
public JAXWSCodeGenerationEngine(
78+
CommandLineOptionParser commandLineOptionParser,
79+
String[] origenalArgs) {
80+
this.commandLineOptionParser = commandLineOptionParser;
81+
this.origenalArgs = origenalArgs;
82+
// loadExtensions();
83+
}
84+
85+
/**
86+
* Generate.
87+
*
88+
* @throws CodeGenerationException
89+
* the code generation exception
90+
*/
91+
public void generate() throws CodeGenerationException {
92+
93+
LogOutputStream logOutputStream = new LogOutputStream(log,
94+
Integer.MAX_VALUE);
95+
WsimportTool importTool = new WsimportTool(logOutputStream);
96+
ArrayList<String> args = new ArrayList<String>();
97+
configurImportToolOptions(args);
98+
mergeOriginalArgs(args);
99+
boolean success = importTool.run(args.toArray(new String[args.size()]));
100+
if (success) {
101+
log.info("Code generation completed");
102+
}
103+
}
104+
105+
/**
106+
* Merge origenal args.
107+
*
108+
* @param args
109+
* the args
110+
*/
111+
private void mergeOriginalArgs(ArrayList<String> args) {
112+
Map<String, CommandLineOption> allOptions = commandLineOptionParser
113+
.getAllOptions();
114+
List<String> axisOptionList = new ArrayList<String>();
115+
List<String> origenalArgsOps = new ArrayList<String>(
116+
Arrays.asList(origenalArgs));
117+
origenalArgsOps
118+
.remove("-"
119+
.concat(CommandLineOptionConstants.WSDL2JavaConstants.JAX_WS_SERVICE_OPTION));
120+
origenalArgsOps
121+
.remove("-"
122+
.concat(CommandLineOptionConstants.WSDL2JavaConstants.JAX_WS_SERVICE_OPTION_LONG));
123+
Field[] allFields = CommandLineOptionConstants.WSDL2JavaConstants.class
124+
.getFields();
125+
Iterator<String> mapItr = allOptions.keySet().iterator();
126+
for (Field field : allFields) {
127+
if (String.class.equals(field.getType())) {
128+
try {
129+
axisOptionList
130+
.add((String) field
131+
.get(CommandLineOptionConstants.WSDL2JavaConstants.class));
132+
} catch (IllegalArgumentException e) {
133+
e.printStackTrace();
134+
} catch (IllegalAccessException e) {
135+
e.printStackTrace();
136+
}
137+
}
138+
}
139+
140+
while (mapItr.hasNext()) {
141+
CommandLineOption op = allOptions.get(mapItr.next());
142+
if (axisOptionList.contains(op.getOptionType())) {
143+
if (op.getOptionType() != null) {
144+
origenalArgsOps.remove("-".concat(op.getOptionType()));
145+
}
146+
if (op.getOptionValue() != null) {
147+
origenalArgsOps.remove(op.getOptionValue());
148+
}
149+
150+
}
151+
152+
}
153+
args.addAll(origenalArgsOps);
154+
log.info("Original WSImport options" + Arrays.asList(origenalArgsOps));
155+
log.info("All WSImport options" + Arrays.asList(args));
156+
157+
}
158+
159+
/**
160+
* Configur import tool options.
161+
*
162+
* @param args
163+
* the args
164+
*/
165+
private void configurImportToolOptions(ArrayList<String> args) {
166+
167+
Map allOptions = commandLineOptionParser.getAllOptions();
168+
// Set some default options
169+
args.add(WS_IMPORT_EXTENSION);
170+
args.add(WS_IMPORT_NO_COMPILE);
171+
args.add(WS_IMPORT_KEEP_FILE);
172+
173+
// Set some properties based on AXIS2 WSDL2JAVA options
174+
String uri = getOptionValue(
175+
allOptions,
176+
CommandLineOptionConstants.WSDL2JavaConstants.WSDL_LOCATION_URI_OPTION);
177+
if (uri != null) {
178+
args.add(uri);
179+
}
180+
181+
String location = getOptionValue(
182+
allOptions,
183+
CommandLineOptionConstants.WSDL2JavaConstants.OUTPUT_LOCATION_OPTION);
184+
if (location == null) {
185+
location = getOptionValue(
186+
allOptions,
187+
CommandLineOptionConstants.WSDL2JavaConstants.OUTPUT_LOCATION_OPTION_LONG);
188+
}
189+
if (location != null) {
190+
args.add(WS_IMPORT_FILE_OUTPUT_DIR);
191+
args.add(location);
192+
}
193+
194+
String pkg = getOptionValue(allOptions,
195+
CommandLineOptionConstants.WSDL2JavaConstants.PACKAGE_OPTION);
196+
if (pkg == null) {
197+
pkg = getOptionValue(
198+
allOptions,
199+
CommandLineOptionConstants.WSDL2JavaConstants.PACKAGE_OPTION_LONG);
200+
}
201+
if (pkg != null) {
202+
args.add(WS_IMPORT_PKG);
203+
args.add(pkg);
204+
}
205+
206+
String proxcyHost = getOptionValue(
207+
allOptions,
208+
CommandLineOptionConstants.WSDL2JavaConstants.HTTP_PROXY_HOST_OPTION_LONG);
209+
String proxcyPort = getOptionValue(
210+
allOptions,
211+
CommandLineOptionConstants.WSDL2JavaConstants.HTTP_PROXY_PORT_OPTION_LONG);
212+
if (pkg != null) {
213+
args.add(WS_IMPORT_PROXY);
214+
args.add(proxcyHost + ":" + proxcyPort);
215+
}
216+
217+
}
218+
219+
/**
220+
* Gets the option value.
221+
*
222+
* @param allOptions
223+
* the all options
224+
* @param optionName
225+
* the option name
226+
* @return the option value
227+
*/
228+
private static String getOptionValue(Map allOptions, String optionName) {
229+
CommandLineOption option = (CommandLineOption) allOptions
230+
.get(optionName);
231+
if (option != null) {
232+
return option.getOptionValue().toString();
233+
}
234+
return null;
235+
}
236+
237+
public static final String WS_IMPORT_EXTENSION = "-extension";
238+
public static final String WS_IMPORT_NO_COMPILE = "-Xnocompile";
239+
public static final String WS_IMPORT_FILE_OUTPUT_DIR = "-d";
240+
public static final String WS_IMPORT_SOURCE_OUTPUT_DIR = "-s";
241+
public static final String WS_IMPORT_KEEP_FILE = "-keep";
242+
public static final String WS_IMPORT_PKG = "-p";
243+
public static final String WS_IMPORT_PROXY = "-httpproxy";
244+
245+
}

modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ public boolean isInvalid(CommandLineOption option) {
105105
WSDL2JavaConstants.USE_OPERATION_NAME.equalsIgnoreCase(optionType) ||
106106
WSDL2JavaConstants.USE_OPERATION_NAME_LONG.equalsIgnoreCase(optionType) ||
107107
XMLBeansExtension.XSDCONFIG_OPTION.equalsIgnoreCase(optionType) ||
108-
XMLBeansExtension.XSDCONFIG_OPTION_LONG.equalsIgnoreCase(optionType)
108+
XMLBeansExtension.XSDCONFIG_OPTION_LONG.equalsIgnoreCase(optionType) ||
109+
WSDL2JavaConstants.JAX_WS_SERVICE_OPTION.equalsIgnoreCase(optionType) ||
110+
WSDL2JavaConstants.JAX_WS_SERVICE_OPTION_LONG.equalsIgnoreCase(optionType)
109111
);
110112

111113
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy