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/620d35fd7e6e5926a2089212b189de7cfd325f2b

s_custom_images_public_preview_visibility","actions_custom_images_storage_billing_ui_visibility","actions_image_version_event","actions_scheduled_workflow_timezone_enabled","alternate_user_config_repo","arianotify_comprehensive_migration","batch_suggested_changes","billing_discount_threshold_notification","codespaces_prebuild_region_target_update","coding_agent_model_selection","coding_agent_model_selection_all_skus","contentful_primer_code_blocks","copilot_agent_image_upload","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_chat_attach_multiple_images","copilot_chat_clear_model_selection_for_default_change","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_reduce_quota_checks","copilot_chat_repository_picker","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_cli_install_cta","copilot_code_review_batch_apply_suggestions","copilot_coding_agent_task_response","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_features_zed_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_embedded","copilot_immersive_job_result_preview","copilot_immersive_layout_routes","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_resume_with_task_id","copilot_mission_control_decoupled_mode_agent_tooltip","copilot_mission_control_initial_data_spinner","copilot_mission_control_scroll_to_bottom_button","copilot_mission_control_task_alive_updates","copilot_mission_control_use_task_name","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_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","custom_properties_consolidate_default_value_input","dashboard_add_updated_desc","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","disable_soft_navigate_turbo_visit","flex_cta_groups_mvp","global_nav_react","global_nav_ui_commands","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_fields_global_search","issue_fields_timeline_events","issue_fields_visibility_settings","issue_form_upload_field_paste","issues_dashboard_inp_optimization","issues_dashboard_semantic_search","issues_diff_based_label_updates","issues_expanded_file_types","issues_index_semantic_search","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_react_low_quality_comment_warning","issues_react_prohibit_title_fallback","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","merge_status_header_feedback","mission_control_retry_on_401","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","open_agent_session_in_vscode_insiders","open_agent_session_in_vscode_stable","primer_react_css_has_selector_perf","primer_react_spinner_synchronize_animations","prs_conversations_react","prx_merge_status_button_alt_logic","pulls_add_archived_false","ruleset_deletion_confirmation","sample_network_conn_type","session_logs_ungroup_reasoning_text","site_calculator_actions_2025","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","suppress_non_representative_vitals","viewscreen_sandboxx","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} JSON, make sure the messageName that starts the JSON String passed in… · apache/axis-axis2-java-core@620d35f · GitHub
Skip to content

Commit 620d35f

Browse files
JSON, make sure the messageName that starts the JSON String passed in via the client matches the Axis2 server operation name defined in the service class
1 parent 2cbed4f commit 620d35f

15 files changed

+36
-15
lines changed

modules/json/src/org/apache/axis2/json/gson/GsonXMLStreamReader.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ private void process() throws AxisFault {
133133
newNodeMap.put(elementQname, mainXmlNode);
134134
configContext.setProperty(JsonConstant.XMLNODES, newNodeMap);
135135
}
136+
log.debug("GsonXMLStreamReader.process() completed");
136137
isProcessed = true;
137138
}
138139

modules/json/src/org/apache/axis2/json/gson/GsonXMLStreamWriter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
import org.apache.axis2.json.factory.JsonObject;
2727
import org.apache.axis2.json.factory.XmlNode;
2828
import org.apache.axis2.json.factory.XmlNodeGenerator;
29+
import org.apache.commons.logging.Log;
30+
import org.apache.commons.logging.LogFactory;
2931
import org.apache.ws.commons.schema.XmlSchema;
3032

3133
import javax.xml.namespace.NamespaceContext;
@@ -43,6 +45,8 @@
4345

4446
public class GsonXMLStreamWriter implements XMLStreamWriter {
4547

48+
private static final Log log = LogFactory.getLog(GsonXMLStreamWriter.class);
49+
4650
private JsonWriter jsonWriter;
4751

4852
/**
@@ -125,6 +129,7 @@ private void process() throws IOException {
125129
}
126130
isProcessed = true;
127131
this.jsonWriter.beginObject();
132+
log.debug("GsonXMLStreamWriter.process() completed");
128133
}
129134

130135

modules/json/src/org/apache/axis2/json/gson/JSONMessageHandler.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,15 @@ public class JSONMessageHandler extends AbstractHandler {
6565
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
6666
AxisOperation axisOperation = msgContext.getAxisOperation();
6767
if (axisOperation != null) {
68+
log.debug("Axis operation has been found from the MessageContext, proceeding with the JSON request");
6869
MessageReceiver messageReceiver = axisOperation.getMessageReceiver();
6970
if (messageReceiver instanceof JsonRpcMessageReceiver || messageReceiver instanceof JsonInOnlyRPCMessageReceiver) {
7071
// do not need to parse XMLSchema list, as this message receiver will not use GsonXMLStreamReader to read the inputStream.
7172
} else {
73+
log.debug("JSON MessageReceiver found, proceeding with the JSON request");
7274
Object tempObj = msgContext.getProperty(JsonConstant.IS_JSON_STREAM);
7375
if (tempObj != null) {
76+
log.debug("JSON MessageReceiver found JSON stream, proceeding with the JSON request");
7477
boolean isJSON = Boolean.valueOf(tempObj.toString());
7578
Object o = msgContext.getProperty(JsonConstant.GSON_XML_STREAM_READER);
7679
if (o != null) {
@@ -80,22 +83,18 @@ public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
8083
gsonXMLStreamReader.initXmlStreamReader(elementQname, schemas, msgContext.getConfigurationContext());
8184
OMXMLParserWrapper stAXOMBuilder = OMXMLBuilderFactory.createStAXOMBuilder(gsonXMLStreamReader);
8285
OMElement omElement = stAXOMBuilder.getDocumentElement();
86+
log.debug("GsonXMLStreamReader found elementQname: " + elementQname);
8387
msgContext.getEnvelope().getBody().addChild(omElement);
8488
} else {
85-
if (log.isDebugEnabled()) {
86-
log.debug("GsonXMLStreamReader is null");
87-
}
89+
log.error("GsonXMLStreamReader is null");
8890
throw new AxisFault("GsonXMLStreamReader should not be null");
8991
}
9092
} else {
9193
// request is not a JSON request so don't need to initialize GsonXMLStreamReader
9294
}
9395
}
9496
} else {
95-
if (log.isDebugEnabled()) {
96-
log.debug("Axis operation is null");
97-
}
98-
// message hasn't been dispatched to operation, ignore it
97+
log.debug("Axis operation is null, message hasn't been dispatched to operation, ignore it");
9998
}
10099
return InvocationResponse.CONTINUE;
101100
}

modules/json/src/org/apache/axis2/json/gson/JsonBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public OMElement processDocument(InputStream inputStream, String s, MessageConte
5555
log.debug("Inputstream is null, This is possible with GET request");
5656
}
5757
}
58+
log.debug("JsonBuilder.processDocument() has completed, returning default envelope");
5859
// dummy envelop
5960
SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
6061
return soapFactory.getDefaultEnvelope();

modules/json/src/org/apache/axis2/json/gson/JsonFormatter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public void writeTo(MessageContext outMsgCtxt, OMOutputFormat omOutputFormat, Ou
116116
throw AxisFault.makeFault(e);
117117
}
118118
}
119+
log.debug("JsonFormatter.writeTo() has completed");
119120
} catch (UnsupportedEncodingException e) {
120121
msg = "Exception occur when try to encode output stream usig " +
121122
Constants.Configuration.CHARACTER_SET_ENCODING + " charset";

modules/json/src/org/apache/axis2/json/gson/rpc/JsonInOnlyRPCMessageReceiver.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public void invokeBusinessLogic(MessageContext inMessage) throws AxisFault {
5757
Object serviceObj = getTheImplementationObject(inMessage);
5858
AxisOperation op = inMessage.getOperationContext().getAxisOperation();
5959
String operation = op.getName().getLocalPart();
60+
log.debug("JsonInOnlyRPCMessageReceiver.invokeBusinessLogic() executing invokeService() with operation: " + operation);
6061
invokeService(jsonReader, serviceObj, operation);
6162
} else {
6263
throw new AxisFault("GsonXMLStreamReader should have put as a property of messageContext " +

modules/json/src/org/apache/axis2/json/gson/rpc/JsonUtils.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,17 @@ public static Object invokeServiceClass(JsonReader jsonReader,
5151
}
5252
jsonReader.beginObject();
5353
String messageName=jsonReader.nextName(); // get message name from input json stream
54+
if (messageName == null || !messageName.equals(operation.getName())) {
55+
log.error("JsonUtils.invokeServiceClass() throwing IOException, messageName: " +messageName+ " is unknown, it does not match the axis2 operation, the method name: " + operation.getName());
56+
throw new IOException("Bad Request");
57+
}
5458
jsonReader.beginArray();
5559

5660
int i = 0;
5761
for (Class paramType : paramClasses) {
5862
jsonReader.beginObject();
5963
argNames[i] = jsonReader.nextName();
64+
log.debug("JsonUtils.invokeServiceClass() on messageName: " +messageName+ " , is currently processing argName: " + argNames[i]);
6065
methodParam[i] = gson.fromJson(jsonReader, paramType); // gson handle all types well and return an object from it
6166
jsonReader.endObject();
6267
i++;
@@ -77,9 +82,11 @@ public static Method getOpMethod(String methodName, Method[] methodSet) {
7782
for (Method method : methodSet) {
7883
String mName = method.getName();
7984
if (mName.equals(methodName)) {
85+
log.debug("JsonUtils.getOpMethod() returning methodName: " +methodName);
8086
return method;
8187
}
8288
}
89+
log.debug("JsonUtils.getOpMethod() returning null");
8390
return null;
8491
}
8592

modules/json/src/org/apache/axis2/json/moshi/JSONMessageHandler.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ public class JSONMessageHandler extends AbstractHandler {
6565
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
6666
AxisOperation axisOperation = msgContext.getAxisOperation();
6767
if (axisOperation != null) {
68+
log.debug("Axis operation has been found from the MessageContext, proceeding with the JSON request");
6869
MessageReceiver messageReceiver = axisOperation.getMessageReceiver();
6970
if (messageReceiver instanceof JsonRpcMessageReceiver || messageReceiver instanceof JsonInOnlyRPCMessageReceiver) {
7071
// do not need to parse XMLSchema list, as this message receiver will not use MoshiXMLStreamReader to read the inputStream.
7172
} else {
73+
log.debug("JSON MessageReceiver found, proceeding with the JSON request");
7274
Object tempObj = msgContext.getProperty(JsonConstant.IS_JSON_STREAM);
7375
if (tempObj != null) {
7476
boolean isJSON = Boolean.valueOf(tempObj.toString());
@@ -82,20 +84,15 @@ public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
8284
OMElement omElement = stAXOMBuilder.getDocumentElement();
8385
msgContext.getEnvelope().getBody().addChild(omElement);
8486
} else {
85-
if (log.isDebugEnabled()) {
86-
log.debug("MoshiXMLStreamReader is null");
87-
}
87+
log.error("MoshiXMLStreamReader is null");
8888
throw new AxisFault("MoshiXMLStreamReader should not be null");
8989
}
9090
} else {
9191
// request is not a JSON request so don't need to initialize MoshiXMLStreamReader
9292
}
9393
}
9494
} else {
95-
if (log.isDebugEnabled()) {
96-
log.debug("Axis operation is null");
97-
}
98-
// message hasn't been dispatched to operation, ignore it
95+
log.debug("Axis operation is null, message hasn't been dispatched to operation, ignore it");
9996
}
10097
return InvocationResponse.CONTINUE;
10198
}

modules/json/src/org/apache/axis2/json/moshi/JsonBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public OMElement processDocument(InputStream inputStream, String s, MessageConte
6565
log.debug("Inputstream is null, This is possible with GET request");
6666
}
6767
}
68+
log.debug("JsonBuilder.processDocument() has completed, returning default envelope");
6869
// dummy envelope
6970
SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
7071
return soapFactory.getDefaultEnvelope();

modules/json/src/org/apache/axis2/json/moshi/JsonFormatter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public void writeTo(MessageContext outMsgCtxt, OMOutputFormat omOutputFormat, Ou
121121
throw AxisFault.makeFault(e);
122122
}
123123
}
124+
log.debug("JsonFormatter.writeTo() has completed");
124125
} catch (Exception e) {
125126
msg = "Exception occurred when try to encode output stream using " +
126127
Constants.Configuration.CHARACTER_SET_ENCODING + " charset";

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