Re: Help needed with Axiom Navigator

2008-11-09 Thread Nandika Jayawardana
As you said, axiom_navigator is not used in the rest of the code. I think it
is best to use the methods in axiom_node.h and the iterators available in
axiom, if your want to traverse an axiom tree.

Regards
Nandika



On Thu, Nov 6, 2008 at 11:52 AM, Gupta, Shivam [EMAIL PROTECTED] wrote:

  Hi,

I have an issue where I need to use the Axiom Navigator class in
 Axis2/C. I have read the Axiom Tutorial but still am not very comfortable
 using the Navigator. I also found that the Axis2/C does not use the same
 anywhere in the project.

So if someone could give me some sample code that may guide me in how to
 use this class to travesrse an Om node in a C program would really be
 useful.

 Thanks,
 Shivam.



Re: Help needed with Axiom Navigator

2008-11-09 Thread Damitha Kumarage

Hi,
Shivam must be referring to include/axiom_navigator.h. Does this api 
supposed to provide Axiom/Java like navigation functionality?. If it is 
not working and if we don't need the use of it let's remove it from code 
base so as to avoid confusion.


thanks
Damitha.
Nandika Jayawardana wrote:
As you said, axiom_navigator is not used in the rest of the code. I 
think it is best to use the methods in axiom_node.h and the iterators 
available in axiom, if your want to traverse an axiom tree.
 
Regards

Nandika
 

 
On Thu, Nov 6, 2008 at 11:52 AM, Gupta, Shivam [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Hi,
 
   I have an issue where I need to use the Axiom Navigator class

in Axis2/C. I have read the Axiom Tutorial but still am not very
comfortable using the Navigator. I also found that the Axis2/C
does not use the same anywhere in the project.
 
   So if someone could give me some sample code that may guide me

in how to use this class to travesrse an Om node in a C program
would really be useful.
 
Thanks,

Shivam.




--
__

Damitha Kumarage
http://people.apache.org/
__

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: changes to the axutil log functions

2008-11-09 Thread Damitha Kumarage

HI Dmitry,
   I am interested in  reviewing the patch you mentioned on axutil log. 
Please send it as an jira attachment.

thanks,
Damitha
Dmitry Goncharov wrote:

Hi,

You can make axis to do logging the way you need w/o making changes in 
the axis code.
Have a look at util/src/log.c. Function 
axutil_log_impl_write_to_file() is used to do logging.
All you need to do is to make your own shared library with only one 
function: axutil_log_impl_write_to_file().

The function has to have the same signature as the one in util/src/log.c.
Then use LD_PRELOAD to preload this new library when starting you 
application.
That's it. The axis code will invoke you implementation of 
axutil_log_impl_write_to_file().



Your proposed fix to pass a FILE* instead of a filename has the same 
restrictions as the current code. It makes the client do logging the 
way library wants.
The library already provides the interface to do logging the way the 
client needs.
You can  allocate an instance of axutil_log_t and set ops.free and 
ops.write to your own functions.
The you can replace the log object in your env struct with your 
customized log object.

Unfortunately, axis doesn't use ops.write.
The correct fix would be to change util/src/log.c to use ops.write() 
and ops.free().
I considered providing a patch, but finally decided not to (because 
the library maintainers dont seem to be willing to apply patches) and 
used the LD_PRELOAD method described above.


BR, Dmitry


Haszlakiewicz, Eric wrote:

I have a need to use axis within an existing system that has it's own
ways of opening/closing/rotating logs and I've found the existing axis
log interfaces to be a bit lacking.  I have some patches, but before I
submit a issue in jira I wanted to run the changes past some people to
see if what I'm doing makes sense.

There are two issues that I'm fixing:
  1) the log functions don't keep track of whether the filedescriptor
was opened by axis, so if you create a env using axutil_env_create() it
ends up closing stderr when you try to set a new log file.

  2) There's no way to tell axis to log to a filedescriptor rather than
to a named file.

I added two functions to axutil_log_default.h:

One to create a axutil_log_t using an existing FILE * as returned from
fopen:
AXIS2_EXTERN axutil_log_t *AXIS2_CALL
axutil_log_create_fp(
axutil_allocator_t *allocator,
axutil_log_ops_t *ops,
void *stream,
int close_stream);
I also factored out a static axutil_log_create_common() function, which
is used by both axutil_log_create_fp() and the original
axutil_log_create().

And, one to switch the FILE pointer on an existing log structure:
AXIS2_EXTERN void AXIS2_CALL
axutil_log_set_stream(
axutil_allocator_t *allocator,
axutil_log_t *log,
void *stream,
int close_stream);

In both of these, the close_stream flag indicates whether axis is
allowed to close the stream when a new one is set or when the log
structure is cleaned up.  That is stored in a new field in the
axutil_log_impl structure.

Does this seem reasonable?  Should I send the full patch to the list?

eric

(btw, I created a couple of other jira issues (AXIS2C-1271, AXIS2C-1280)
w/ patches attached.  About how long can I expect before they are
applied?)

-
To unsubscribe, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]

  



--
__

Damitha Kumarage
http://people.apache.org/
__

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]