You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Chen LC Li <li...@cn.ibm.com> on 2006/08/22 17:12:00 UTC

Axis2c client doesn't work when I built it into library

Hello friends,

I worked out a Axis2c client on linux that can successfully invoke a web 
service implemented by Java ... I've been trying to build it into a 
library file (.so) so that it can be called from other C program ....but 
it failed to call the web service anymore. I added a bunch of debugging 
statements printing out infomation so that I could see which step it was 
stuck on. Finally I found out that every time it gets trouble on calling 
the function axis2_stub_create_with_endpoint_ref_and_client_home in the 
client stub. I am just wondering why it only got problem on calling this 
function when I build it into a shared library? (.so) It used to work well 
when I build it into a stand alone C application... Was there any wrong 
with my linking? Any suggestion please? Thanks a lot.

My compiling and linking command:

gcc -fPIC -shared -o libmy.so *.c -I. -laxis2_axiom -laxis2_engine 
-laxis2_libxml2 -laxis2_parser -laxis2_util -laxis2_wsdl -laxis2_minizip 
-xml2 -ldl -L/opt/axis2c-bin-0.92-linux/lib


The function in stub that I had problem with:

axis2_stub_create_with_endpoint_ref_and_client_home (
    const axis2_env_t *env,
    axis2_endpoint_ref_t *endpoint_ref,
    const axis2_char_t *client_home)


Aaron Li

Re: Axis2c client doesn't work when I built it into library

Posted by Samisa Abeysinghe <sa...@gmail.com>.
Chen LC Li wrote:
>
> Hello Mr.Samisa,
>
> This is Aaron from IBM China Software Development Lab. Thanks for your 
> reply.
>
> I did have /opt/axis2c-bin-0.92-linux/lib on my LD_LIBRARY_PATH. I set 
> it in my system profile even in my C program as well. Now we are 
> facing with a case that needs to integrate C legacy with Java 
> programs. I bet Axis2/c would be the best solution ... However, since 
> the tight timeline, we have to give up this solution at this point. 
> Its such a pity for me when my developer lead told me that we have to 
> move on using another solution. But I am kind of stubborn, I decide to 
> keep on following this solution on my own and probably some day I 
> could convince him of our C web service client.
Well we have some proved case studies for embedding Axis2/C in other 
applications.
PHP Axis2 is one: http://pecl.php.net/package/axis2
The Firefox extention is another: 
http://dist.wso2.net/products/tungsten/ajax/xpi/
Both of them uses Axis2/C as their base. So I bet that when it comes to 
integrating legacy systems, Axis2/C would be a good choice.
I also did a presentation on how to embed Axis2/C in ApacheCon Asia, The 
presentation is here: http://people.apache.org/~samisa/ . You may pick 
some information from that as well.
>
> Could you please give me some demo of 'easy to use service client 
> API'?  Isn't it the easy way to create C web service consumer using 
> stub that is generated from WSDL? I am sorry about bothering you so 
> much, because I am new about this :P  I am learning anyway.
To understand the service client API, please have a look into the user 
guide. Also you can get an idea by following the samples in 
samples/user_guide/clients/ folder.

We have the code generation support for WSDLs using Java tool. There are 
some bugs in this, which we are looking into fixing.
But it partially works. For an example please have a look at 
samples/codegen/client/calculator/readme

HTH.

Thanks,
Samisa...

>
> Thanks for your help.
>
>
> Aaron Li
>
>
> *Samisa Abeysinghe <sa...@gmail.com>*
>
> 2006-08-23 00:20
> Please respond to
> "Apache AXIS C User List" <ax...@ws.apache.org>
>
>
> 	
> To
> 	Apache AXIS C User List <ax...@ws.apache.org>
> cc
> 	
> Subject
> 	Re: Axis2c client doesn't work when I built it into library
>
>
>
> 	
>
>
>
>
>
> Do you have the Axis2/C libs on you library path, so that the program
> that loads your library file with client logic can locate the required
> Axis2/C libs? (As far as I can tell form your compile command, you
> should have /opt/axis2c-bin-0.92-linux/lib on your LD_LIBRARY_PATH)
>
> BTW, you could use the easy to use service client API rather than the
> stub API for consuming services.
>
> Thanks,
> Samisa...
>
> Chen LC Li wrote:
> >
> > Hello friends,
> >
> > I worked out a Axis2c client on linux that can successfully invoke a
> > web service implemented by Java ... I've been trying to build it into
> > a library file (.so) so that it can be called from other C program
> > ....but it failed to call the web service anymore. I added a bunch of
> > debugging statements printing out infomation so that I could see which
> > step it was stuck on. Finally I found out that every time it gets
> > trouble on calling the function
> > axis2_stub_create_with_endpoint_ref_and_client_home in the client
> > stub. I am just wondering why it only got problem on calling this
> > function when I build it into a shared library? (.so) It used to work
> > well when I build it into a stand alone C application... Was there any
> > wrong with my linking? Any suggestion please? Thanks a lot.
> >
> > My compiling and linking command:
> >
> > gcc -fPIC -shared -o libmy.so *.c -I. -laxis2_axiom -laxis2_engine
> > -laxis2_libxml2 -laxis2_parser -laxis2_util -laxis2_wsdl
> > -laxis2_minizip -xml2 -ldl -L/opt/axis2c-bin-0.92-linux/lib
> >
> >
> > The function in stub that I had problem with:
> >
> > axis2_stub_create_with_endpoint_ref_and_client_home (
> > const axis2_env_t *env,
> > axis2_endpoint_ref_t *endpoint_ref,
> > const axis2_char_t *client_home)
> >
> >
> > Aaron Li
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: Axis2c client doesn't work when I built it into library

Posted by Chen LC Li <li...@cn.ibm.com>.
Hello Mr.Samisa,

This is Aaron from IBM China Software Development Lab. Thanks for your 
reply. 

I did have /opt/axis2c-bin-0.92-linux/lib on my LD_LIBRARY_PATH. I set it 
in my system profile even in my C program as well. Now we are facing with 
a case that needs to integrate C legacy with Java programs. I bet Axis2/c 
would be the best solution ... However, since the tight timeline, we have 
to give up this solution at this point. Its such a pity for me when my 
developer lead told me that we have to move on using another solution. But 
I am kind of stubborn, I decide to keep on following this solution on my 
own and probably some day I could convince him of our C web service 
client.


Could you please give me some demo of 'easy to use service client API'? 
Isn't it the easy way to create C web service consumer using stub that is 
generated from WSDL? I am sorry about bothering you so much, because I am 
new about this :P  I am learning anyway.

Thanks for your help.


Aaron Li 



Samisa Abeysinghe <sa...@gmail.com> 
2006-08-23 00:20
Please respond to
"Apache AXIS C User List" <ax...@ws.apache.org>


To
Apache AXIS C User List <ax...@ws.apache.org>
cc

Subject
Re: Axis2c client doesn't work when I built it into library






Do you have the Axis2/C libs on you library path, so that the program
that loads your library file with client logic can locate the required
Axis2/C libs? (As far as I can tell form your compile command, you
should have /opt/axis2c-bin-0.92-linux/lib on your LD_LIBRARY_PATH)

BTW, you could use the easy to use service client API rather than the
stub API for consuming services.

Thanks,
Samisa...

Chen LC Li wrote:
>
> Hello friends,
>
> I worked out a Axis2c client on linux that can successfully invoke a
> web service implemented by Java ... I've been trying to build it into
> a library file (.so) so that it can be called from other C program
> ....but it failed to call the web service anymore. I added a bunch of
> debugging statements printing out infomation so that I could see which
> step it was stuck on. Finally I found out that every time it gets
> trouble on calling the function
> axis2_stub_create_with_endpoint_ref_and_client_home in the client
> stub. I am just wondering why it only got problem on calling this
> function when I build it into a shared library? (.so) It used to work
> well when I build it into a stand alone C application... Was there any
> wrong with my linking? Any suggestion please? Thanks a lot.
>
> My compiling and linking command:
>
> gcc -fPIC -shared -o libmy.so *.c -I. -laxis2_axiom -laxis2_engine
> -laxis2_libxml2 -laxis2_parser -laxis2_util -laxis2_wsdl
> -laxis2_minizip -xml2 -ldl -L/opt/axis2c-bin-0.92-linux/lib
>
>
> The function in stub that I had problem with:
>
> axis2_stub_create_with_endpoint_ref_and_client_home (
> const axis2_env_t *env,
> axis2_endpoint_ref_t *endpoint_ref,
> const axis2_char_t *client_home)
>
>
> Aaron Li 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org



Re: Axis2c client doesn't work when I built it into library

Posted by Samisa Abeysinghe <sa...@gmail.com>.
Do you have the Axis2/C libs on you library path, so that the program
that loads your library file with client logic can locate the required
Axis2/C libs? (As far as I can tell form your compile command, you
should have /opt/axis2c-bin-0.92-linux/lib on your LD_LIBRARY_PATH)

BTW, you could use the easy to use service client API rather than the
stub API for consuming services.

Thanks,
Samisa...

Chen LC Li wrote:
>
> Hello friends,
>
> I worked out a Axis2c client on linux that can successfully invoke a
> web service implemented by Java ... I've been trying to build it into
> a library file (.so) so that it can be called from other C program
> ....but it failed to call the web service anymore. I added a bunch of
> debugging statements printing out infomation so that I could see which
> step it was stuck on. Finally I found out that every time it gets
> trouble on calling the function
> axis2_stub_create_with_endpoint_ref_and_client_home in the client
> stub. I am just wondering why it only got problem on calling this
> function when I build it into a shared library? (.so) It used to work
> well when I build it into a stand alone C application... Was there any
> wrong with my linking? Any suggestion please? Thanks a lot.
>
> My compiling and linking command:
>
> gcc -fPIC -shared -o libmy.so *.c -I. -laxis2_axiom -laxis2_engine
> -laxis2_libxml2 -laxis2_parser -laxis2_util -laxis2_wsdl
> -laxis2_minizip -xml2 -ldl -L/opt/axis2c-bin-0.92-linux/lib
>
>
> The function in stub that I had problem with:
>
> axis2_stub_create_with_endpoint_ref_and_client_home (
> const axis2_env_t *env,
> axis2_endpoint_ref_t *endpoint_ref,
> const axis2_char_t *client_home)
>
>
> Aaron Li 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org