You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "S.Uthaiyashankar (JIRA)" <ji...@apache.org> on 2009/10/15 07:24:31 UTC

[jira] Created: (AXIS2C-1402) AXIS2_PARAM_CHECK overwrite previously set error status

AXIS2_PARAM_CHECK overwrite previously set error status
-------------------------------------------------------

                 Key: AXIS2C-1402
                 URL: https://issues.apache.org/jira/browse/AXIS2C-1402
             Project: Axis2-C
          Issue Type: Bug
    Affects Versions: 1.6.0
            Reporter: S.Uthaiyashankar
            Assignee: S.Uthaiyashankar
             Fix For: Next Version


When checking AXIS2_PARAM_CHECK, if it is success, it overwrites STATUS_CODE by setting AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS); 

check the macro definition:
#define AXIS2_PARAM_CHECK(error, object, error_return)                  \
    if (!object)                                                        \
    {                                                                   \
        AXIS2_ERROR_SET_ERROR_NUMBER(error, AXIS2_ERROR_INVALID_NULL_PARAM); \
        AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE);              \
        return error_return;                                            \
    }                                                                   \
    else                                                                \
    {                                                                   \
        AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS);              \
    }


Ideally, if PARAM_CHECK is success, it should not touch error status code. 

This macro is a problem when sending soap faults from generated code. To send faults from generated code, we have to set the error status inside service logic and it will be checked by the engine to create soap fault. However, after setting error status, there are several generated codes doing AXIS2_PARAM_CHECK and hence overwriting the status code. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AXIS2C-1402) AXIS2_PARAM_CHECK overwrite previously set error status

Posted by "S.Uthaiyashankar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

S.Uthaiyashankar updated AXIS2C-1402:
-------------------------------------

    Component/s: core/engine

> AXIS2_PARAM_CHECK overwrite previously set error status
> -------------------------------------------------------
>
>                 Key: AXIS2C-1402
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1402
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/engine
>    Affects Versions: 1.6.0
>            Reporter: S.Uthaiyashankar
>            Assignee: S.Uthaiyashankar
>             Fix For: Next Version
>
>         Attachments: axis2_param_check.patch
>
>
> When checking AXIS2_PARAM_CHECK, if it is success, it overwrites STATUS_CODE by setting AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS); 
> check the macro definition:
> #define AXIS2_PARAM_CHECK(error, object, error_return)                  \
>     if (!object)                                                        \
>     {                                                                   \
>         AXIS2_ERROR_SET_ERROR_NUMBER(error, AXIS2_ERROR_INVALID_NULL_PARAM); \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE);              \
>         return error_return;                                            \
>     }                                                                   \
>     else                                                                \
>     {                                                                   \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS);              \
>     }
> Ideally, if PARAM_CHECK is success, it should not touch error status code. 
> This macro is a problem when sending soap faults from generated code. To send faults from generated code, we have to set the error status inside service logic and it will be checked by the engine to create soap fault. However, after setting error status, there are several generated codes doing AXIS2_PARAM_CHECK and hence overwriting the status code. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AXIS2C-1402) AXIS2_PARAM_CHECK overwrite previously set error status

Posted by "S.Uthaiyashankar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

S.Uthaiyashankar resolved AXIS2C-1402.
--------------------------------------

    Resolution: Fixed

Fixed in revision 825395

> AXIS2_PARAM_CHECK overwrite previously set error status
> -------------------------------------------------------
>
>                 Key: AXIS2C-1402
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1402
>             Project: Axis2-C
>          Issue Type: Bug
>    Affects Versions: 1.6.0
>            Reporter: S.Uthaiyashankar
>            Assignee: S.Uthaiyashankar
>             Fix For: Next Version
>
>
> When checking AXIS2_PARAM_CHECK, if it is success, it overwrites STATUS_CODE by setting AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS); 
> check the macro definition:
> #define AXIS2_PARAM_CHECK(error, object, error_return)                  \
>     if (!object)                                                        \
>     {                                                                   \
>         AXIS2_ERROR_SET_ERROR_NUMBER(error, AXIS2_ERROR_INVALID_NULL_PARAM); \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE);              \
>         return error_return;                                            \
>     }                                                                   \
>     else                                                                \
>     {                                                                   \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS);              \
>     }
> Ideally, if PARAM_CHECK is success, it should not touch error status code. 
> This macro is a problem when sending soap faults from generated code. To send faults from generated code, we have to set the error status inside service logic and it will be checked by the engine to create soap fault. However, after setting error status, there are several generated codes doing AXIS2_PARAM_CHECK and hence overwriting the status code. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AXIS2C-1402) AXIS2_PARAM_CHECK overwrite previously set error status

Posted by "Francois Mireaux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois Mireaux updated AXIS2C-1402:
-------------------------------------

    Attachment: axis2_param_check.patch

Content :
    1 initialize env status to AXIS_SUCCESS
    2 don't reset env status in AXIS2_PARAM_CHECK
    3 exit from do loop when root_node is closed in om_stax_builder_next
    4 don't set env status to failure when module parent is undefined in axis2_module_desc_is_param_locked
    5 force env status to AXIS2_SUCCESS at axis2_engine_send end (returned status is AXIS2_SUCCESS)

All Axis2c samples which works without patch works with patch (google and mtom_callback don't work out off the box) but it's more likely that there are others problematic use cases.

Patch solve errors I have found in WSF-PHP context (only poor tests righrt now).

Which functionnality is known as broken by the AXIS2_PARAM_CHECK modification ?

> AXIS2_PARAM_CHECK overwrite previously set error status
> -------------------------------------------------------
>
>                 Key: AXIS2C-1402
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1402
>             Project: Axis2-C
>          Issue Type: Bug
>    Affects Versions: 1.6.0
>            Reporter: S.Uthaiyashankar
>            Assignee: S.Uthaiyashankar
>             Fix For: Next Version
>
>         Attachments: axis2_param_check.patch
>
>
> When checking AXIS2_PARAM_CHECK, if it is success, it overwrites STATUS_CODE by setting AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS); 
> check the macro definition:
> #define AXIS2_PARAM_CHECK(error, object, error_return)                  \
>     if (!object)                                                        \
>     {                                                                   \
>         AXIS2_ERROR_SET_ERROR_NUMBER(error, AXIS2_ERROR_INVALID_NULL_PARAM); \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE);              \
>         return error_return;                                            \
>     }                                                                   \
>     else                                                                \
>     {                                                                   \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS);              \
>     }
> Ideally, if PARAM_CHECK is success, it should not touch error status code. 
> This macro is a problem when sending soap faults from generated code. To send faults from generated code, we have to set the error status inside service logic and it will be checked by the engine to create soap fault. However, after setting error status, there are several generated codes doing AXIS2_PARAM_CHECK and hence overwriting the status code. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (AXIS2C-1402) AXIS2_PARAM_CHECK overwrite previously set error status

Posted by "S.Uthaiyashankar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

S.Uthaiyashankar reopened AXIS2C-1402:
--------------------------------------


This fix break some of the functionality. Reverting the changes until all the functionalities are fixed. 

> AXIS2_PARAM_CHECK overwrite previously set error status
> -------------------------------------------------------
>
>                 Key: AXIS2C-1402
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1402
>             Project: Axis2-C
>          Issue Type: Bug
>    Affects Versions: 1.6.0
>            Reporter: S.Uthaiyashankar
>            Assignee: S.Uthaiyashankar
>             Fix For: Next Version
>
>
> When checking AXIS2_PARAM_CHECK, if it is success, it overwrites STATUS_CODE by setting AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS); 
> check the macro definition:
> #define AXIS2_PARAM_CHECK(error, object, error_return)                  \
>     if (!object)                                                        \
>     {                                                                   \
>         AXIS2_ERROR_SET_ERROR_NUMBER(error, AXIS2_ERROR_INVALID_NULL_PARAM); \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE);              \
>         return error_return;                                            \
>     }                                                                   \
>     else                                                                \
>     {                                                                   \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS);              \
>     }
> Ideally, if PARAM_CHECK is success, it should not touch error status code. 
> This macro is a problem when sending soap faults from generated code. To send faults from generated code, we have to set the error status inside service logic and it will be checked by the engine to create soap fault. However, after setting error status, there are several generated codes doing AXIS2_PARAM_CHECK and hence overwriting the status code. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AXIS2C-1402) AXIS2_PARAM_CHECK overwrite previously set error status

Posted by "Francois Mireaux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769134#action_12769134 ] 

Francois Mireaux commented on AXIS2C-1402:
------------------------------------------

Modification 5 in the above patch was made for Axis2c notify sample. 

Digging more deeply, I found that en status was set in axis2_addr_out_handler_invoke (addr_out_handler.c) by the call : 

        axis2_addr_out_handler_add_to_soap_header(env, epr_reply_to, AXIS2_WSA_REPLY_TO, 
            soap_header, addr_ns); 

where "epr_reply_to" was NULL in that case, because the above"if (!epr_reply_to) " don't set epr_reply_to when "none" and "anonymous" are FALSE. 

So either we need to test again epr_reply_to or to allways define it : for the time being, I am not able to decide what to do. 

That shows that, if modification of AXIS2_PARAM_CHECK macro is good for code safety, a significant work must be done to track all problems hidden by the previous macro writing. 


> AXIS2_PARAM_CHECK overwrite previously set error status
> -------------------------------------------------------
>
>                 Key: AXIS2C-1402
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1402
>             Project: Axis2-C
>          Issue Type: Bug
>    Affects Versions: 1.6.0
>            Reporter: S.Uthaiyashankar
>            Assignee: S.Uthaiyashankar
>             Fix For: Next Version
>
>         Attachments: axis2_param_check.patch
>
>
> When checking AXIS2_PARAM_CHECK, if it is success, it overwrites STATUS_CODE by setting AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS); 
> check the macro definition:
> #define AXIS2_PARAM_CHECK(error, object, error_return)                  \
>     if (!object)                                                        \
>     {                                                                   \
>         AXIS2_ERROR_SET_ERROR_NUMBER(error, AXIS2_ERROR_INVALID_NULL_PARAM); \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE);              \
>         return error_return;                                            \
>     }                                                                   \
>     else                                                                \
>     {                                                                   \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS);              \
>     }
> Ideally, if PARAM_CHECK is success, it should not touch error status code. 
> This macro is a problem when sending soap faults from generated code. To send faults from generated code, we have to set the error status inside service logic and it will be checked by the engine to create soap fault. However, after setting error status, there are several generated codes doing AXIS2_PARAM_CHECK and hence overwriting the status code. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (AXIS2C-1402) AXIS2_PARAM_CHECK overwrite previously set error status

Posted by "Francois Mireaux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769231#action_12769231 ] 

Francois Mireaux edited comment on AXIS2C-1402 at 10/23/09 2:30 PM:
--------------------------------------------------------------------

Wanting to make some more testing, I look in Axis2c tests but :
    - there are not many tests
    - they are not automated like with JUnit in Java
    - often, test says SUCCESS with env status set to FAILURE
    -....

So It's seems we need a test framework which allows us to write more tests more easily. 

Which framework choose ? CUnit, Check , WSF_unit ... ? Does somebody has an idea ?

      was (Author: mireaux):
    Wanting to make some more testing, I look in Axis2c tests but :
    - there are not many tests
    - they are not automated like with JUnit in Java
    - often, test says SUCCESS with env status to FAILURE
    -....

So It's seems we need a test framework which allows us to write more tests more easily. 

Which framework choose ? CUnit, Check , WSF_unit ... ? Does somebody has an idea ?
  
> AXIS2_PARAM_CHECK overwrite previously set error status
> -------------------------------------------------------
>
>                 Key: AXIS2C-1402
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1402
>             Project: Axis2-C
>          Issue Type: Bug
>    Affects Versions: 1.6.0
>            Reporter: S.Uthaiyashankar
>            Assignee: S.Uthaiyashankar
>             Fix For: Next Version
>
>         Attachments: axis2_param_check.patch
>
>
> When checking AXIS2_PARAM_CHECK, if it is success, it overwrites STATUS_CODE by setting AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS); 
> check the macro definition:
> #define AXIS2_PARAM_CHECK(error, object, error_return)                  \
>     if (!object)                                                        \
>     {                                                                   \
>         AXIS2_ERROR_SET_ERROR_NUMBER(error, AXIS2_ERROR_INVALID_NULL_PARAM); \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE);              \
>         return error_return;                                            \
>     }                                                                   \
>     else                                                                \
>     {                                                                   \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS);              \
>     }
> Ideally, if PARAM_CHECK is success, it should not touch error status code. 
> This macro is a problem when sending soap faults from generated code. To send faults from generated code, we have to set the error status inside service logic and it will be checked by the engine to create soap fault. However, after setting error status, there are several generated codes doing AXIS2_PARAM_CHECK and hence overwriting the status code. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AXIS2C-1402) AXIS2_PARAM_CHECK overwrite previously set error status

Posted by "Francois Mireaux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2C-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769231#action_12769231 ] 

Francois Mireaux commented on AXIS2C-1402:
------------------------------------------

Wanting to make some more testing, I look in Axis2c tests but :
    - there are not many tests
    - they are not automated like with JUnit in Java
    - often, test says SUCCESS with env status to FAILURE
    -....

So It's seems we need a test framework which allows us to write more tests more easily. 

Which framework choose ? CUnit, Check , WSF_unit ... ? Does somebody has an idea ?

> AXIS2_PARAM_CHECK overwrite previously set error status
> -------------------------------------------------------
>
>                 Key: AXIS2C-1402
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1402
>             Project: Axis2-C
>          Issue Type: Bug
>    Affects Versions: 1.6.0
>            Reporter: S.Uthaiyashankar
>            Assignee: S.Uthaiyashankar
>             Fix For: Next Version
>
>         Attachments: axis2_param_check.patch
>
>
> When checking AXIS2_PARAM_CHECK, if it is success, it overwrites STATUS_CODE by setting AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS); 
> check the macro definition:
> #define AXIS2_PARAM_CHECK(error, object, error_return)                  \
>     if (!object)                                                        \
>     {                                                                   \
>         AXIS2_ERROR_SET_ERROR_NUMBER(error, AXIS2_ERROR_INVALID_NULL_PARAM); \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE);              \
>         return error_return;                                            \
>     }                                                                   \
>     else                                                                \
>     {                                                                   \
>         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS);              \
>     }
> Ideally, if PARAM_CHECK is success, it should not touch error status code. 
> This macro is a problem when sending soap faults from generated code. To send faults from generated code, we have to set the error status inside service logic and it will be checked by the engine to create soap fault. However, after setting error status, there are several generated codes doing AXIS2_PARAM_CHECK and hence overwriting the status code. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.