[ 
https://issues.apache.org/jira/browse/AXIS2C-1355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12680766#action_12680766
 ] 

Damitha Kumarage commented on AXIS2C-1355:
------------------------------------------

The best thing is take the options struct from svc_client in your subsequence 
uses of svc_client and set the new options there. Also there there is a 
function you can try called svc_client_set_override_options(). However I 
haven't used that and don't know whether it work.

I could reproduce the problem you mentioned. Yes there is a bug there. After 
options struct is freed from the service client it tries to access an option 
from within the same options struct set to op_client.

> Changing service client options between messages
> ------------------------------------------------
>
>                 Key: AXIS2C-1355
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1355
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/clientapi
>    Affects Versions: 1.6.0
>         Environment: Axis2/C from svn (26 Feb 2009)
> Linux 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 i686 i386 
> GNU/Linux
>            Reporter: Rutger van Eerd
>
> I want to use a single service client to send multiple messages, with 
> different options (i.e. SOAP action). Basicly I do the following.
> 1. Create service client object.
> 2. Create options object and set options.
> 3. Set options to service client (axis2_svc_client_set_options).
> 4. Execute message (axis2_svc_client_send_receive).
> 5. Create new options object and set new options.
> 6. Set new options to service client (axis2_svc_client_set_options).
> 7. Execute new message (axis2_svc_client_send_receive).
> When doing step 7, I get the following message when running under Valgrind.
> ==3630== Invalid read of size 4
> ==3630==    at 0x40954A2: axis2_options_get_xml_parser_reset (options.c:883)
> ==3630==    by 0x4095E02: axis2_op_client_free (op_client.c:655)
> ==3630==    by 0x4097D2E: axis2_svc_client_create_op_client 
> (svc_client.c:1072)
> ==3630==    by 0x4099735: axis2_svc_client_send_receive_with_op_qname 
> (svc_client.c:835)
> ==3630==    by 0x4099A1C: axis2_svc_client_send_receive (svc_client.c:939)
> ==3630==    by 0x80496BA: main (client.cpp:273)
> ==3630==  Address 0x427CD4C is 60 bytes inside a block of size 64 free'd
> ==3630==    at 0x4004EFA: free (vg_replace_malloc.c:235)
> ==3630==    by 0x4010E82: axutil_allocator_free_impl (allocator.c:92)
> ==3630==    by 0x40951D8: axis2_options_free (options.c:787)
> ==3630==    by 0x409785D: axis2_svc_client_set_options (svc_client.c:376)
> ==3630==    by 0x804961F: main (client.cpp:261)
> My guess is that the op_client tries to access the old options object from 
> step 2/3. This is no longer valid as it has been freed when setting the new 
> options (step 6).
> Or is svc_client not designed to send multiple messages with different 
> options?

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

Reply via email to