[ 
https://issues.apache.org/jira/browse/AXIS2-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862090#action_12862090
 ] 

William Headrick commented on AXIS2-4615:
-----------------------------------------

I looked at the source code for:

org.apache.axis2.databinding.utils.BeanUtil

It does not appear to have been changed.

Line 306 in reversion 924637 needs the attention I believe. See the referenced 
bugs, they have proposed solutions. I have not tried them out.

I will attach a POJO service java files. You should be able to generate a test 
client with them using the Axis2 utilities.

I am going from memory on the rest of my comments here...

There will be 2 fields in the "TestMessage1" class.
String able = null;
byte[] baker = null;

The problem is that you can't get the value of "baker" because Line 306 blindly 
tries to get the first element (which will be "able"). It appears that the 
elements are sorted lexically by their name (thus "able" comes before "baker").

To make the example work, swap the types of "able" and "baker":
byte [] able =null;
String baker = null;

The "TestMessage2" class has the fields as such.

The only reason this works is because "able" is the first sorted element. It 
shouldn't matter what order they fields are defined.

The "TestService" class is the POJO Service. It defines 2 methods "doTest1" and 
"doTest2". "doTest1" will not have the byte array. "doTest2" will have the byte 
array. You will have to set values for "able" and "baker" in the client code to 
test.



> BeanUtil.deserialize byte array (still) blindly attempts to decode the first 
> element in the doc
> -----------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-4615
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4615
>             Project: Axis2
>          Issue Type: Sub-task
>          Components: adb, databinding, om
>    Affects Versions: 1.5.1
>            Reporter: William Headrick
>            Priority: Blocker
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> This bug still exists in the 1.5.1 source code.
> If there is a byte array defined, the name of the element isn't used to look 
> up the element from the "beanElement".  The OMElementImpl#getFirstElement() 
> method is used.  There is a good chance that the byte array won't be first.
> These are the original issues that I can find:
> AXIS2-3538,AXIS2-3765
> Both 3538 and 3765 have proposed solutions.

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


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

Reply via email to