[ 
https://issues.apache.org/jira/browse/AXIS2C-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Lazarski resolved AXIS2C-1495.
-------------------------------------
    Fix Version/s: 2.0.0
       Resolution: Fixed

 When processing POST requests with application/x-www-form-urlencoded
    content type, the last character of parameter values was being truncated
    (e.g., "100" became "10").
    
    Root cause: axis2_http_transport_utils_on_data_request() subtracts 1
    from the size parameter to reserve space for null terminator. The callers
    were passing content_length, so only content_length-1 bytes were read.
    
    Fix: Pass content_length + 1 so the full content_length bytes are read. 

    A unit test was added for this issue. 

> An error found while receiving www-form-urlencoded parameter values sent by 
> POST method in REST style.
> ------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2C-1495
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1495
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 1.6.0
>         Environment: Windows 7, Win32
>            Reporter: David Jang
>            Priority: Major
>             Fix For: 2.0.0
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> I have been writing my code using Axis2/c server to apply to my project from 
> about a month ago.
> I found a strange bug, which I don't know whether it was occurred from me or 
> from axis2/c server.
> Could you check this out for me?
>  
> Situation is like this.
>  
> I sent a HTTP request using IE with the code shown below.
>  
>  
> <html>
> <body>
> <form name="testPOST" 
> action="http://localhost:9090/axis2/services/school/writeobject/scd/1"; 
> method="POST">
>      Tag ID <input type="text" name="tagid"/><br/>
>      Transaction ID <input type="text" name="transid"/><br/>
>      Value<input type="text" name="value"/><br/>
>      <input type="submit" value="transdata"><br/>
> </form>
> </body>
> </html>
>  
> Let's assume that I inputted 1, 1, 100 for respective Tag ID, Transaction ID, 
> and Value.
>  
>  
> On server side, when I look into the parameters using the below function in 
> school_skeleton.c  
>  
> axiom_node_t *AXIS2_CALL
> school_invoke(
>     axis2_svc_skeleton_t * svc_skeleton,
>     const axutil_env_t * env,
>     axiom_node_t * node,
>     axis2_msg_ctx_t * msg_ctx)
> {
>    ...
>  
>     axis2_char_t * pStrNode = axiom_node_to_string(node, env);
>  
> }
>  
>  
> It shows like this.
>  
> <...><tagid>1</tagid><transid>1</transid><value>10</value><...>
>  
>  
> Please make notice that <value>10</value> which is not correct, it should be 
> <value>100</value> 
> since I put 100 into Value param as shown above.
>  
> I really don't know why the last character is trancated when params with 
> xxx-form-urlencoded form are sent by POST.
> It does not problem when the GET method is used or xml data is sent to the 
> axis2/c server.
> Only POST method parameters with xxx-form-urlencoded form are sent to Axis2/c 
> server.
>  
> Could you give a hint for me to resolve this problem? It really annoying me 
> from a few days ago.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to