Re: Problem when running axis2c ws client in multiple threads

2008-01-06 Thread Manjula Peiris
Hi Zhou,

Please have a look at following thread.
http://marc.info/?l=axis-c-userm=118412516705780w=2

Manjula.


On Fri, 2008-01-04 at 17:59 -0500, Hehe Zhou wrote:
 Hey, 
  
   The following program will crash when the second thread starts up
 [ _beginthread() in main() ]. A unhandled exception error is reported
 and program crashes when 2nd thread starts to run ( 1st thread ends
 already). This test program is just a multi-threaded version from Math
 sample webservice client code of AXIS2. I just excute Math WS client
 twice in different thread. But I don't have this problem if Math WS
 Client is run in the same thread for two times. Any idea about this. I
 checked out the newest AXIS2C code from SVN. Same problem happened.
   
 Platform: WinXP
 Compilor: Visual Studio 2005 Professional
  
 // MathWSClient.cpp : Defines the entry point for the console
 application.
 
 //
 
 #include
 
 axis2_math_stub.h
 
 #include
 
 stdio.h
 
 #include
 
 axiom.h
 
 #include
 
 axis2_util.h
 
 #include
 
 axiom_soap.h
 
 #include
 
 axis2_client.h 
 
 #include
 
 iostream
 
 using
 
 namespace std; 
 
 axiom_node_t *
 
 build_om_programatically(
 
 const axutil_env_t *env, 
 
 const axis2_char_t *operation, 
 
 const axis2_char_t *param1, 
 
 const axis2_char_t *param2);
 
 void
 
 run(void* param) 
 
 {
 
 axis2_stub_t *stub = NULL;
 
 axiom_node_t *node = NULL;
 
 axis2_status_t status = AXIS2_FAILURE;
 
 const axutil_env_t *env = NULL; 
 
 const axis2_char_t *address = NULL; 
 
 const axis2_char_t *client_home = NULL; 
 
 axiom_node_t *ret_node = NULL;
 
 const axis2_char_t *operation = add; 
 
 const axis2_char_t *param1 = 40; 
 
 const axis2_char_t *param2 = 8; 
 
 env = axutil_env_create_all(
 
 math_blocking.log, AXIS2_LOG_LEVEL_TRACE); 
 
 client_home = AXIS2_GETENV(
 
 AXIS2C_HOME); 
 
 if (!client_home || !strcmp (client_home, )) 
 
 client_home = 
 
 ../..; 
 
 address = 
 
 http://localhost:9090/axis2/services/math;; 
 
 printf(
 
 Using endpoint : %s\n, address); 
 
 printf(
 
 \nInvoking operation %s with params %s and %s\n, operation, param1,
 param2); 
 
 node = build_om_programatically(env, operation, param1, param2);
 
 stub =
 
 axis2_math_stub_create_with_endpoint_uri_and_client_home(env, address,
 client_home);
 
 /* create node and invoke math */
 
 if (stub) 
 
 {
 
 ret_node = axis2_math_stub_add(stub, env, node);
 
 }
 
 if (ret_node) 
 
 {
 
 if (axiom_node_get_node_type(ret_node, env) == AXIOM_ELEMENT) 
 
 {
 
 axis2_char_t *result = NULL;
 
 axiom_element_t *result_ele =
 (axiom_element_t*)axiom_node_get_data_element(ret_node, env);
 
 result = axiom_element_get_text(result_ele, env, ret_node);
 
 printf(
 
 \nResult = %s\n, result); 
 
 }
 
 else
 
 {
 
 axiom_xml_writer_t *writer = NULL;
 
 axiom_output_t *om_output = NULL;
 
 axis2_char_t *buffer = NULL;
 
 writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
 
 AXIS2_XML_PARSER_TYPE_BUFFER);
 
 om_output = axiom_output_create(env, writer);
 
 axiom_node_serialize(ret_node, env, om_output);
 
 buffer = (axis2_char_t*)axiom_xml_writer_get_xml(writer, env);
 
 printf(
 
 \nReceived invalid OM as result : %s\n, buffer); 
 
 if (buffer) 
 
 {
 
 AXIS2_FREE(env-allocator, buffer);
 
 buffer = NULL;
 
 }
 
 if (om_output) 
 
 {
 
 axiom_output_free(om_output, env);
 
 om_output = NULL;
 
 }
 
 axiom_xml_writer_free(writer, env);
 
 }
 
 }
 
 else
 
 {
 
 AXIS2_LOG_ERROR(env-log, AXIS2_LOG_SI, 
 
 Stub invoke FAILED: Error code:
 
  %d :: %s, env-error-error_number, 
 
 AXIS2_ERROR_GET_MESSAGE(env-error));
 
 printf(
 
 math stub invoke FAILED!\n); 
 
 }
 
 if (stub) 
 
 {
 
 axis2_stub_free(stub, env);
 
 }
 
 if (env) 
 
 {
 
 axutil_env_free((axutil_env_t *) env);
 
 env = NULL;
 
 } 
 
 _endthread();
 
 }
 
 int
 
 main(int argc, char* argv[]) 
 
 {
 
 _beginthread(run, 0, NULL);
 
 Sleep(5000);
 
 _beginthread(run, 0, NULL);
 
 Sleep(5000);
 
 return 0; 
 
 }
 
 axiom_node_t *
 
 build_om_programatically(
 
 const axutil_env_t *env, 
 
 const axis2_char_t *operation, 
 
 const axis2_char_t *param1, 
 
 const axis2_char_t *param2) 
 
 {
 
 axiom_node_t *math_om_node = NULL;
 
 axiom_element_t* math_om_ele = NULL;
 
 axiom_node_t* text_om_node = NULL;
 
 axiom_element_t * text_om_ele = NULL;
 
 axiom_namespace_t *ns1 = NULL;
 
  
 
 axiom_xml_writer_t *xml_writer = NULL;
 
 axiom_output_t *om_output = NULL;
 
 axis2_char_t *buffer = NULL;
 
 ns1 = axiom_namespace_create(env, 
 
 http://ws.apache.org/axis2/services/math;, ns1); 
 
 math_om_ele = axiom_element_create(env, NULL, operation, ns1,
 math_om_node);
 
 text_om_ele = axiom_element_create(env, math_om_node, 
 
 param1, NULL, text_om_node); 
 
 axiom_element_set_text(text_om_ele, env, param1, text_om_node);
 
 text_om_ele = axiom_element_create(env, math_om_node, 
 
 param2, NULL, text_om_node); 
 
 axiom_element_set_text(text_om_ele, env, param2, text_om_node);
 
 xml_writer = axiom_xml_writer_create_for_memory(env, NULL,
 AXIS2_FALSE, AXIS2_FALSE,
 
 

Re: Problem when running axis2c ws client in multiple threads

2008-01-06 Thread Samisa Abeysinghe

Hi Manjula,
   The mail thread in the archive does not contain the code or the make 
file as attachments.
   If you have the source code and the make file that is mentioned in 
the thread, please create a Jira issue and attach those so that the 
users could have a look.


   And I think, as so many users come time to time asking this 
question, we should add this to the FAQ along with the solution.

Thanks,
Samisa...

Manjula Peiris wrote:

Hi Zhou,

Please have a look at following thread.
http://marc.info/?l=axis-c-userm=118412516705780w=2

Manjula.


On Fri, 2008-01-04 at 17:59 -0500, Hehe Zhou wrote:
  
Hey, 
 
  The following program will crash when the second thread starts up

[ _beginthread() in main() ]. A unhandled exception error is reported
and program crashes when 2nd thread starts to run ( 1st thread ends
already). This test program is just a multi-threaded version from Math
sample webservice client code of AXIS2. I just excute Math WS client
twice in different thread. But I don't have this problem if Math WS
Client is run in the same thread for two times. Any idea about this. I
checked out the newest AXIS2C code from SVN. Same problem happened.
  
Platform: WinXP

Compilor: Visual Studio 2005 Professional
 
// MathWSClient.cpp : Defines the entry point for the console

application.

//

#include

axis2_math_stub.h

#include

stdio.h

#include

axiom.h

#include

axis2_util.h

#include

axiom_soap.h

#include

axis2_client.h 


#include

iostream

using

namespace std; 


axiom_node_t *

build_om_programatically(

const axutil_env_t *env, 

const axis2_char_t *operation, 

const axis2_char_t *param1, 


const axis2_char_t *param2);

void

run(void* param) 


{

axis2_stub_t *stub = NULL;

axiom_node_t *node = NULL;

axis2_status_t status = AXIS2_FAILURE;

const axutil_env_t *env = NULL; 

const axis2_char_t *address = NULL; 

const axis2_char_t *client_home = NULL; 


axiom_node_t *ret_node = NULL;

const axis2_char_t *operation = add; 

const axis2_char_t *param1 = 40; 

const axis2_char_t *param2 = 8; 


env = axutil_env_create_all(

math_blocking.log, AXIS2_LOG_LEVEL_TRACE); 


client_home = AXIS2_GETENV(

AXIS2C_HOME); 

if (!client_home || !strcmp (client_home, )) 

client_home = 

../..; 

address = 

http://localhost:9090/axis2/services/math;; 


printf(

Using endpoint : %s\n, address); 


printf(

\nInvoking operation %s with params %s and %s\n, operation, param1,
param2); 


node = build_om_programatically(env, operation, param1, param2);

stub =

axis2_math_stub_create_with_endpoint_uri_and_client_home(env, address,
client_home);

/* create node and invoke math */

if (stub) 


{

ret_node = axis2_math_stub_add(stub, env, node);

}

if (ret_node) 


{

if (axiom_node_get_node_type(ret_node, env) == AXIOM_ELEMENT) 


{

axis2_char_t *result = NULL;

axiom_element_t *result_ele =
(axiom_element_t*)axiom_node_get_data_element(ret_node, env);

result = axiom_element_get_text(result_ele, env, ret_node);

printf(

\nResult = %s\n, result); 


}

else

{

axiom_xml_writer_t *writer = NULL;

axiom_output_t *om_output = NULL;

axis2_char_t *buffer = NULL;

writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,

AXIS2_XML_PARSER_TYPE_BUFFER);

om_output = axiom_output_create(env, writer);

axiom_node_serialize(ret_node, env, om_output);

buffer = (axis2_char_t*)axiom_xml_writer_get_xml(writer, env);

printf(

\nReceived invalid OM as result : %s\n, buffer); 

if (buffer) 


{

AXIS2_FREE(env-allocator, buffer);

buffer = NULL;

}

if (om_output) 


{

axiom_output_free(om_output, env);

om_output = NULL;

}

axiom_xml_writer_free(writer, env);

}

}

else

{

AXIS2_LOG_ERROR(env-log, AXIS2_LOG_SI, 


Stub invoke FAILED: Error code:

 %d :: %s, env-error-error_number, 


AXIS2_ERROR_GET_MESSAGE(env-error));

printf(

math stub invoke FAILED!\n); 


}

if (stub) 


{

axis2_stub_free(stub, env);

}

if (env) 


{

axutil_env_free((axutil_env_t *) env);

env = NULL;

} 


_endthread();

}

int

main(int argc, char* argv[]) 


{

_beginthread(run, 0, NULL);

Sleep(5000);

_beginthread(run, 0, NULL);

Sleep(5000);

return 0; 


}

axiom_node_t *

build_om_programatically(

const axutil_env_t *env, 

const axis2_char_t *operation, 

const axis2_char_t *param1, 

const axis2_char_t *param2) 


{

axiom_node_t *math_om_node = NULL;

axiom_element_t* math_om_ele = NULL;

axiom_node_t* text_om_node = NULL;

axiom_element_t * text_om_ele = NULL;

axiom_namespace_t *ns1 = NULL;

 


axiom_xml_writer_t *xml_writer = NULL;

axiom_output_t *om_output = NULL;

axis2_char_t *buffer = NULL;

ns1 = axiom_namespace_create(env, 

http://ws.apache.org/axis2/services/math;, ns1); 


math_om_ele = axiom_element_create(env, NULL, operation, ns1,
math_om_node);

text_om_ele = axiom_element_create(env, math_om_node, 

param1, NULL, text_om_node); 


axiom_element_set_text(text_om_ele, env, param1, text_om_node);

text_om_ele = axiom_element_create(env, math_om_node, 

param2, NULL, text_om_node); 



[jira] Created: (AXIS2C-886) Unused Variable in guththila_xml_parser.c

2008-01-06 Thread Lahiru Gunathilake (JIRA)
Unused Variable in guththila_xml_parser.c
-

 Key: AXIS2C-886
 URL: https://issues.apache.org/jira/browse/AXIS2C-886
 Project: Axis2-C
  Issue Type: Bug
 Environment: Ubuntu 7.04
Reporter: Lahiru Gunathilake
 Attachments: diff.txt

There are Warnings in Axis2c when it build with guththila parser.

-- 
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]



[jira] Updated: (AXIS2C-886) Unused Variable in guththila_xml_parser.c

2008-01-06 Thread Lahiru Gunathilake (JIRA)

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

Lahiru Gunathilake updated AXIS2C-886:
--

Attachment: diff.txt

commented those lines.

 Unused Variable in guththila_xml_parser.c
 -

 Key: AXIS2C-886
 URL: https://issues.apache.org/jira/browse/AXIS2C-886
 Project: Axis2-C
  Issue Type: Bug
 Environment: Ubuntu 7.04
Reporter: Lahiru Gunathilake
 Attachments: diff.txt


 There are Warnings in Axis2c when it build with guththila parser.

-- 
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]



Re: [Vote] [Axis2-C] Vote for Apache Axis2/C 1.2.0 Release - Take 4

2008-01-06 Thread Samisa Abeysinghe
It looks like we have the -Werror in the configure script of the Linux 
package. I think it is not a good idea to pack with -Werror as on 
different platforms that would have different implications.


Thanks
Samisa...


Damitha Kumarage wrote:

Hi Devs,

I have re-packaged and uploaded the Apache Axis2/C 1.2.0 release 
artifacts at [1].

The key used to sign the release artifacts can be found at [2].

The only changes  from the previous release artifacts  are
   1. In the documentation regarding the release version update and 
the incomplete developer list.

   2. In axis2.xml removed unneccessary commneted lines.
   3. Updated the NOTICE file for year 2008.

Please test, review and vote on these latest release artifacts for
Apache Axis2/C 1.2.0 release.

I have tested and reviewed them and here is my vote: +1

Thanks,
Damitha

[1]http://people.apache.org/~damitha/release/axis2/1.2.0/
[2]http://people.apache.org/~damitha/release/axis2/1.2.0/KEYS


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






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



[jira] Assigned: (AXIS2C-883) Apache segfaults when running mtom sample with big files

2008-01-06 Thread Sanjaya Ratnaweera (JIRA)

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

Sanjaya Ratnaweera reassigned AXIS2C-883:
-

Assignee: Sanjaya Ratnaweera

 Apache segfaults when running mtom sample with big files
 

 Key: AXIS2C-883
 URL: https://issues.apache.org/jira/browse/AXIS2C-883
 Project: Axis2-C
  Issue Type: Bug
 Environment: Ubuntu 7.04
Reporter: Lahiru Gunathilake
Assignee: Sanjaya Ratnaweera
 Attachments: diff.txt


 I ran apache in - X mode and ran mtom sample with an attachment of 100MB 
 file.Then the thread which handle that request segfaults.

-- 
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]



[jira] Resolved: (AXIS2C-883) Apache segfaults when running mtom sample with big files

2008-01-06 Thread Sanjaya Ratnaweera (JIRA)

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

Sanjaya Ratnaweera resolved AXIS2C-883.
---

   Resolution: Fixed
Fix Version/s: Current (Nightly)

Patch applied. Thanks Lahiru for the patch.

 Apache segfaults when running mtom sample with big files
 

 Key: AXIS2C-883
 URL: https://issues.apache.org/jira/browse/AXIS2C-883
 Project: Axis2-C
  Issue Type: Bug
 Environment: Ubuntu 7.04
Reporter: Lahiru Gunathilake
Assignee: Sanjaya Ratnaweera
 Fix For: Current (Nightly)

 Attachments: diff.txt


 I ran apache in - X mode and ran mtom sample with an attachment of 100MB 
 file.Then the thread which handle that request segfaults.

-- 
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]



Re: Problem when running axis2c ws client in multiple threads

2008-01-06 Thread Uthaiyashankar

Hehe Zhou wrote:

Hey,
 
  The following program will crash when the second thread starts up [ 
_beginthread() in main() ]. A unhandled exception error is reported 
and program crashes when 2nd thread starts to run ( 1st thread ends 
already). This test program is just a multi-threaded version from Math 
sample webservice client code of AXIS2. I just excute Math WS client 
twice in different thread. But I don't have this problem if Math WS 
Client is run in the same thread for two times. Any idea about this. I 
checked out the newest AXIS2C code from SVN. Same problem happened.
 
Platform: WinXP

Compilor: Visual Studio 2005 Professional
 

Hi Zhou,

The crashing is due to libxml in multi threaded environment. when using 
libxml in multithreaded environment,
(1) you have to call xmlInitParser() in the main thread before using 
any of the libxml2 API. (Refer http://xmlsoft.org/threads.html)
(2) should not call xmlCleanupParser() from individual threads. It can 
be called from main thread at the end.


By default, when destroying axis2_stub, it will call xmlCleanupParser(). 
To disable it, after creating axis2_stub, the option xml_parser_reset 
should be set to false.


so, the modified code should be as given below.

Regards,
Shankar.

/*
MathWSClient.cpp : Defines the entry point for the console application.
*/

#include axis2_math_stub.h
#include stdio.h
#include axiom.h
#include axis2_util.h
#include axiom_soap.h
#include axis2_client.h
/*#include iostream*/

/*using namespace std;*/

axiom_node_t *
build_om_programatically(
   const axutil_env_t *env,
   const axis2_char_t *operation,
   const axis2_char_t *param1,
   const axis2_char_t *param2);

void
run(void* param)

{
   axis2_stub_t *stub = NULL;
   axiom_node_t *node = NULL;
   axis2_status_t status = AXIS2_FAILURE;
   const axutil_env_t *env = NULL;
   const axis2_char_t *address = NULL;
   const axis2_char_t *client_home = NULL;
   axiom_node_t *ret_node = NULL;
   const axis2_char_t *operation = add;
   const axis2_char_t *param1 = 40;
   const axis2_char_t *param2 = 8;
*axis2_options_t* options = NULL;*

   env = axutil_env_create_all(
   math_blocking.log, AXIS2_LOG_LEVEL_TRACE);

   client_home = AXIS2_GETENV(
   AXIS2C_HOME);

   if (!client_home || !strcmp (client_home, ))

   client_home =
   ../..;

   address =
   http://localhost:9090/axis2/services/math;;

   printf(
   Using endpoint : %s\n, address);

   printf(
   \nInvoking operation %s with params %s and %s\n, operation, 
param1, param2);

   node = build_om_programatically(env, operation, param1, param2);

   stub =axis2_math_stub_create_with_endpoint_uri_and_client_home(env, 
address, client_home);


   /* create node and invoke math */

   if (stub)
   {
   *options = axis2_stub_get_options(stub, env);
   if (options)
   {
   axis2_options_set_xml_parser_reset(options, env, AXIS2_FALSE);
   }*
   ret_node = axis2_math_stub_add(stub, env, node);
   }

   if (ret_node)
   {
   if (axiom_node_get_node_type(ret_node, env) == AXIOM_ELEMENT)
   {
   axis2_char_t *result = NULL;
   axiom_element_t *result_ele = 
(axiom_element_t*)axiom_node_get_data_element(ret_node, env);

   result = axiom_element_get_text(result_ele, env, ret_node);
   printf(
   \nResult = %s\n, result);
   }
   else
   {
   axiom_xml_writer_t *writer = NULL;
   axiom_output_t *om_output = NULL;
   axis2_char_t *buffer = NULL;
   writer = axiom_xml_writer_create_for_memory(env, NULL, 
AXIS2_TRUE, 0,

   AXIS2_XML_PARSER_TYPE_BUFFER);
   om_output = axiom_output_create(env, writer);
   axiom_node_serialize(ret_node, env, om_output);
   buffer = (axis2_char_t*)axiom_xml_writer_get_xml(writer, env);
   printf(
   \nReceived invalid OM as result : %s\n, buffer);

   if (buffer)
   {
   AXIS2_FREE(env-allocator, buffer);
   buffer = NULL;
   }

   if (om_output)
   {
   axiom_output_free(om_output, env);
   om_output = NULL;
   }

   axiom_xml_writer_free(writer, env);

   }
   }
   else
   {
   AXIS2_LOG_ERROR(env-log, AXIS2_LOG_SI,
   Stub invoke FAILED: Error code:
%d :: %s, env-error-error_number,
   AXIS2_ERROR_GET_MESSAGE(env-error));
   printf(
   math stub invoke FAILED!\n);
   }

   if (stub)
   {
   axis2_stub_free(stub, env);
   }

   if (env)
   {
   axutil_env_free((axutil_env_t *) env);
   env = NULL;
   }

   _endthread();
}

int
main(int argc, char* argv[])
{
   *axiom_xml_reader_init();*
   _beginthread(run, 0, NULL);
   Sleep(5000);
   _beginthread(run, 0, NULL);
   Sleep(5000);
   *axiom_xml_reader_cleanup();*
   return 0;
}

axiom_node_t *
build_om_programatically(
const axutil_env_t *env,
const axis2_char_t *operation,
const axis2_char_t *param1,
const axis2_char_t *param2)
{
   

Re: Problem when running axis2c ws client in multiple threads

2008-01-06 Thread Uthaiyashankar
formatting of modified code is shown as *modified code* in the previous 
listing. so, please use the code listing given here.


Uthaiyashankar wrote:

Hehe Zhou wrote:

Hey,
 
  The following program will crash when the second thread starts up [ 
_beginthread() in main() ]. A unhandled exception error is reported 
and program crashes when 2nd thread starts to run ( 1st thread ends 
already). This test program is just a multi-threaded version from 
Math sample webservice client code of AXIS2. I just excute Math WS 
client twice in different thread. But I don't have this problem if 
Math WS Client is run in the same thread for two times. Any idea 
about this. I checked out the newest AXIS2C code from SVN. Same 
problem happened.
 
Platform: WinXP

Compilor: Visual Studio 2005 Professional
 

Hi Zhou,

The crashing is due to libxml in multi threaded environment. when 
using libxml in multithreaded environment,
(1) you have to call xmlInitParser() in the main thread before using 
any of the libxml2 API. (Refer http://xmlsoft.org/threads.html)
(2) should not call xmlCleanupParser() from individual threads. It can 
be called from main thread at the end.


By default, when destroying axis2_stub, it will call 
xmlCleanupParser(). To disable it, after creating axis2_stub, the 
option xml_parser_reset should be set to false.


so, the modified code should be as given below.

Regards,
Shankar.


/*
MathWSClient.cpp : Defines the entry point for the console application.
*/

#include axis2_math_stub.h
#include stdio.h
#include axiom.h
#include axis2_util.h
#include axiom_soap.h
#include axis2_client.h
/*#include iostream*/

/*using namespace std;*/

axiom_node_t *
build_om_programatically(
  const axutil_env_t *env,
  const axis2_char_t *operation,
  const axis2_char_t *param1,
  const axis2_char_t *param2);

void
run(void* param)

{
  axis2_stub_t *stub = NULL;
  axiom_node_t *node = NULL;
  axis2_status_t status = AXIS2_FAILURE;
  const axutil_env_t *env = NULL;
  const axis2_char_t *address = NULL;
  const axis2_char_t *client_home = NULL;
  axiom_node_t *ret_node = NULL;
  const axis2_char_t *operation = add;
  const axis2_char_t *param1 = 40;
  const axis2_char_t *param2 = 8;
  axis2_options_t* options = NULL;

  env = axutil_env_create_all(
  math_blocking.log, AXIS2_LOG_LEVEL_TRACE);

  client_home = AXIS2_GETENV(
  AXIS2C_HOME);

  if (!client_home || !strcmp (client_home, ))

  client_home =
  ../..;

  address =
  http://localhost:9090/axis2/services/math;;

  printf(
  Using endpoint : %s\n, address);

  printf(
  \nInvoking operation %s with params %s and %s\n, operation, param1, 
param2);

  node = build_om_programatically(env, operation, param1, param2);

  stub =axis2_math_stub_create_with_endpoint_uri_and_client_home(env, 
address, client_home);


  /* create node and invoke math */

  if (stub)
  {
  options = axis2_stub_get_options(stub, env);
  if (options)
  {
  axis2_options_set_xml_parser_reset(options, env, AXIS2_FALSE);
  }
  ret_node = axis2_math_stub_add(stub, env, node);
  }

  if (ret_node)
  {
  if (axiom_node_get_node_type(ret_node, env) == AXIOM_ELEMENT)
  {
  axis2_char_t *result = NULL;
  axiom_element_t *result_ele = 
(axiom_element_t*)axiom_node_get_data_element(ret_node, env);

  result = axiom_element_get_text(result_ele, env, ret_node);
  printf(
  \nResult = %s\n, result);
  }
  else
  {
  axiom_xml_writer_t *writer = NULL;
  axiom_output_t *om_output = NULL;
  axis2_char_t *buffer = NULL;
  writer = axiom_xml_writer_create_for_memory(env, NULL, 
AXIS2_TRUE, 0,

  AXIS2_XML_PARSER_TYPE_BUFFER);
  om_output = axiom_output_create(env, writer);
  axiom_node_serialize(ret_node, env, om_output);
  buffer = (axis2_char_t*)axiom_xml_writer_get_xml(writer, env);
  printf(
  \nReceived invalid OM as result : %s\n, buffer);

  if (buffer)
  {
  AXIS2_FREE(env-allocator, buffer);
  buffer = NULL;
  }

  if (om_output)
  {
  axiom_output_free(om_output, env);
  om_output = NULL;
  }

  axiom_xml_writer_free(writer, env);

  }
  }
  else
  {
  AXIS2_LOG_ERROR(env-log, AXIS2_LOG_SI,
  Stub invoke FAILED: Error code:
   %d :: %s, env-error-error_number,
  AXIS2_ERROR_GET_MESSAGE(env-error));
  printf(
  math stub invoke FAILED!\n);
  }

  if (stub)
  {
  axis2_stub_free(stub, env);
  }

  if (env)
  {
  axutil_env_free((axutil_env_t *) env);
  env = NULL;
  }

  _endthread();
}

int
main(int argc, char* argv[])
{
  axiom_xml_reader_init();
  _beginthread(run, 0, NULL);
  Sleep(5000);
  _beginthread(run, 0, NULL);
  Sleep(5000);
  axiom_xml_reader_cleanup();
  return 0;
}

axiom_node_t *
build_om_programatically(
const axutil_env_t *env,
const axis2_char_t *operation,
const axis2_char_t 

Re: [Vote] [Axis2-C] Vote for Apache Axis2/C 1.2.0 Release - Take 4

2008-01-06 Thread Damitha Kumarage

OK, I'll repack and upload with this change
thanks,
Damitha
Samisa Abeysinghe wrote:

It looks like we have the -Werror in the configure script of the Linux 
package. I think it is not a good idea to pack with -Werror as on 
different platforms that would have different implications.


Thanks
Samisa...


Damitha Kumarage wrote:


Hi Devs,

I have re-packaged and uploaded the Apache Axis2/C 1.2.0 release 
artifacts at [1].

The key used to sign the release artifacts can be found at [2].

The only changes  from the previous release artifacts  are
   1. In the documentation regarding the release version update and 
the incomplete developer list.

   2. In axis2.xml removed unneccessary commneted lines.
   3. Updated the NOTICE file for year 2008.

Please test, review and vote on these latest release artifacts for
Apache Axis2/C 1.2.0 release.

I have tested and reviewed them and here is my vote: +1

Thanks,
Damitha

[1]http://people.apache.org/~damitha/release/axis2/1.2.0/
[2]http://people.apache.org/~damitha/release/axis2/1.2.0/KEYS


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






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





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