[
https://issues.apache.org/jira/browse/AXIS2C-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18051405#comment-18051405
]
Robert Lazarski edited comment on AXIS2C-1581 at 1/13/26 1:39 AM:
------------------------------------------------------------------
Add soapAction extraction from WSDL bindings for native codegen (AXIS2C-1581)
Implement AXIS2C-1581 fix for the native WSDL2C code generator. When
soapAction is empty ("") or missing in WSDL bindings, the generated stub
code should NOT set an action, preventing "action=""" in Content-Type
headers.
Changes:
- Add wsdl2c_operation_t struct to header for shared access
- Add parse_wsdl_bindings() to extract soapAction from binding operations
- Update stub generator to conditionally set soapAction only when non-empty
- Add AXIS2C_LOG_DEBUG macro for standalone build mode
- Add comprehensive test suite for empty soapAction handling:
* test_axis2c_1581_empty_soap_action - WSDL generation test
* test_axis2c_1581_content_type_pattern - Logic validation
* test_axis2c_1581_binding_soap_action_extraction - XPath extraction
The fix ensures empty soapAction="" results in NULL (omitted) rather than
generating action="" in HTTP Content-Type headers.
was (Author: robertlazarski):
dd soapAction extraction from WSDL bindings for native codegen (AXIS2C-1581)
Implement AXIS2C-1581 fix for the native WSDL2C code generator. When
soapAction is empty ("") or missing in WSDL bindings, the generated stub
code should NOT set an action, preventing "action=""" in Content-Type
headers.
Changes:
- Add wsdl2c_operation_t struct to header for shared access
- Add parse_wsdl_bindings() to extract soapAction from binding operations
- Update stub generator to conditionally set soapAction only when non-empty
- Add AXIS2C_LOG_DEBUG macro for standalone build mode
- Add comprehensive test suite for empty soapAction handling:
* test_axis2c_1581_empty_soap_action - WSDL generation test
* test_axis2c_1581_content_type_pattern - Logic validation
* test_axis2c_1581_binding_soap_action_extraction - XPath extraction
The fix ensures empty soapAction="" results in NULL (omitted) rather than
generating action="" in HTTP Content-Type headers.
> Generated code creates bad action in multi-parts request
> --------------------------------------------------------
>
> Key: AXIS2C-1581
> URL: https://issues.apache.org/jira/browse/AXIS2C-1581
> Project: Axis2-C
> Issue Type: Bug
> Components: code generation
> Affects Versions: 1.6.0
> Reporter: Hengli Wang
> Priority: Major
> Fix For: 2.0.0
>
>
> I use axis2-1.6.1 to generate client stub and use axis2-1.6.0 with
> curl-7.19.7. The http request has multi-parts message with an invalid action
> item,
> -- Encrypted Boundary
> .Content-Type: application/HTTP-SPNEGO-session-encrypted
> .OriginalContent:
> type=application/soap+xml;charset=UTF-8;action=""";Length=330
> -- Encrypted Boundary
> Below is a patch that I used to get around this issue. After the patch, the
> message is,
> -- Encrypted Boundary
> .Content-Type: application/HTTP-SPNEGO-session-encrypted
> .OriginalContent: type=application/soap+xml;charset=UTF-8;Length=330
> -- Encrypted Boundary
> The patch is,
> ---
> ./modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl
> 2012-01-12 14:06:44.000000000 -0500
> +++
> ./modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl
> 2012-01-12 14:06:38.000000000 -0500
> @@ -356,9 +356,11 @@
> if (NULL == soap_act)
> {
> is_soap_act_set = AXIS2_FALSE;
> + <xsl:if test="$soapAction != '' and $soapAction !=
> '""' and $soapAction != '\"\"'">
> soap_action = "<xsl:value-of select="$soapAction"/>";
> soap_act = axutil_string_create(env, "<xsl:value-of
> select="$soapAction"/>");
> axis2_options_set_soap_action(options, env, soap_act);
> + </xsl:if>
> }
>
> <xsl:choose>
> @@ -1090,9 +1092,11 @@
> if (NULL == soap_act)
> {
> is_soap_act_set = AXIS2_FALSE;
> + <xsl:if test="$soapAction != '' and $soapAction !=
> '""' and $soapAction != '\"\"'">
> soap_action = "<xsl:value-of select="$soapAction"/>";
> soap_act = axutil_string_create(env, "<xsl:value-of
> select="$soapAction"/>");
> axis2_options_set_soap_action(options, env, soap_act);
> + </xsl:if>
> }
> <xsl:choose>
> <xsl:when
> test="$soapVersion='http://www.w3.org/2003/05/soap-envelope'">
> @@ -1246,9 +1250,11 @@
> soap_act = axis2_options_get_soap_action ( options, env );
> if ( NULL == soap_act )
> {
> + <xsl:if test="$soapAction != '' and $soapAction !=
> '""' and $soapAction != '\"\"'">
> soap_action = "<xsl:value-of select="$soapAction"/>";
> soap_act = axutil_string_create(env, "<xsl:value-of
> select="$soapAction"/>");
> axis2_options_set_soap_action(options, env, soap_act);
> + </xsl:if>
> }
> <xsl:choose>
> <xsl:when
> test="$soapVersion='http://www.w3.org/2003/05/soap-envelope'">
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]