You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Jean-Sebastien Delfino <js...@apache.org> on 2006/08/31 01:13:36 UTC

An API to configure Axis services?

In the Apache Tuscany/C++ project we are using Axis2C to implement our 
Web Service support. Application developers use Tuscany to create 
components, then our runtime takes care of exposing these components as 
Web Services. Currently each time we create a Web service, we create a 
directory under Axis2/services/ for it, copy a Tuscany shared library 
(containing a generic Axis2 service skeleton) into that directory and 
create a services.xml file declaring the new service to Axis2C. I'd like 
to simplify this process and do the configuration of Axis2C in memory 
without having to create a directory structure and copy files around for 
each new service.

Are there any other ways to declare services to Axis2 than creating a 
directory per service containing a services.xml file? Can a single 
services.xml file declare multiple services?
Is there an API that would allow me to plug into the Axis2C runtime and 
declare and configure Web services? Could you point me to sample code 
that does that or any info that will help me understand how to declare 
services dynamically?

Thanks.

-- 
Jean-Sebastien


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


[Axis2]Re: An API to configure Axis services?

Posted by Samisa Abeysinghe <sa...@gmail.com>.
Jean-Sebastien Delfino wrote:
> Samisa Abeysinghe wrote:
>> Jean-Sebastien Delfino wrote:
>>> In the Apache Tuscany/C++ project we are using Axis2C to implement 
>>> our Web Service support. Application developers use Tuscany to 
>>> create components, then our runtime takes care of exposing these 
>>> components as Web Services. Currently each time we create a Web 
>>> service, we create a directory under Axis2/services/ for it, copy a 
>>> Tuscany shared library (containing a generic Axis2 service skeleton) 
>>> into that directory and create a services.xml file declaring the new 
>>> service to Axis2C. I'd like to simplify this process and do the 
>>> configuration of Axis2C in memory without having to create a 
>>> directory structure and copy files around for each new service.
>>>
>>> Are there any other ways to declare services to Axis2 than creating 
>>> a directory per service containing a services.xml file? 
>> Yes, you can add service to configuration using config API.
>>> Can a single services.xml file declare multiple services?
>> Yes, we have the service group concept - please look at sg_math sample.
>>> Is there an API that would allow me to plug into the Axis2C runtime 
>>> and declare and configure Web services? Could you point me to sample 
>>> code that does that or any info that will help me understand how to 
>>> declare services dynamically?
>> As I mentioned earlier, using config API you can do that. The best 
>> sample that I can think of is PHP Axis2 extentio which is here : 
>> http://pecl.php.net/package/axis2
>>
>> Thanks,
>> Samisa...
>>>
>>> Thanks.
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>>
>>
>
> Thanks for the pointers. I found your PHP integration code and I'm 
> guessing that to configure a new service I should do something similar 
> to what you're doing service.c (at 
> http://cvs.php.net/viewvc.cgi/pecl/axis2/service.c?revision=1.17&view=markup). 
>
Correct that is the code.
>
> However I'm not sure how to plug my code in the Axis2C runtime so to 
> get it executed when the server starts. Can I create new services from 
> inside a module?
When the Axis2/C runtime is loaded, here is what happens: first it reads 
axis2.xml in the repository, then it traverse the services and module 
folders, looks into each sub folders, create services, operations and 
modules based on the services.xml file and module.xml file. After this 
process is completed, you would have conf object created with services, 
operations and modules information. It is at this point that you have to 
add the service programatically, in other words, after the repo is 
traversed and the conf is created.
Now the handlers in a modules are invoked when a request is received 
over a trasnport. So adding a service in a module would not make sence. 
But you rather should do it in the main execution path. I am not sure 
how you are using the Axis2/C runtime, but to give you an example, in 
case of the simple axis server, you can add services manually after the 
line 125 of modules/core/transport/http/receiver/http_server.c. That is 
after the conf is built.
>
> A related question is: Instead of having to create service infos for 
> all the services that I need to dispatch to, can I just declare a 
> single receiver that will see/handle all incoming calls (and then I'll 
> dispatch to the correct Tuscany service myself from there)? Is that 
> possible?
Well receivers are registered inside an operation. So you basically get 
to know the end message receiver only through the operation to invoke. 
So before going to the receiver, you have to know the service and the 
operation.
Again the trick here is to bypass the dispatchers, you can have a single 
service and operation and dispatch all the calls to that operation in 
the service by altering the dispatcher to blindly redirect all the calls 
to that single service and operation. You can implement your handling 
logic against that simple operation. But the engine is not designed to 
do that.

P.S. I have lately improved the doc comments in the headers of the 
description hierarchy related structs. You may have a look at the doc 
comments in the headers to get an idea on how services, operations and 
flows are handled.


Samisa...

>
> Thanks
>


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


Re: An API to configure Axis services?

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Samisa Abeysinghe wrote:
> Jean-Sebastien Delfino wrote:
>> In the Apache Tuscany/C++ project we are using Axis2C to implement 
>> our Web Service support. Application developers use Tuscany to create 
>> components, then our runtime takes care of exposing these components 
>> as Web Services. Currently each time we create a Web service, we 
>> create a directory under Axis2/services/ for it, copy a Tuscany 
>> shared library (containing a generic Axis2 service skeleton) into 
>> that directory and create a services.xml file declaring the new 
>> service to Axis2C. I'd like to simplify this process and do the 
>> configuration of Axis2C in memory without having to create a 
>> directory structure and copy files around for each new service.
>>
>> Are there any other ways to declare services to Axis2 than creating a 
>> directory per service containing a services.xml file? 
> Yes, you can add service to configuration using config API.
>> Can a single services.xml file declare multiple services?
> Yes, we have the service group concept - please look at sg_math sample.
>> Is there an API that would allow me to plug into the Axis2C runtime 
>> and declare and configure Web services? Could you point me to sample 
>> code that does that or any info that will help me understand how to 
>> declare services dynamically?
> As I mentioned earlier, using config API you can do that. The best 
> sample that I can think of is PHP Axis2 extentio which is here : 
> http://pecl.php.net/package/axis2
>
> Thanks,
> Samisa...
>>
>> Thanks.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>

Thanks for the pointers. I found your PHP integration code and I'm 
guessing that to configure a new service I should do something similar 
to what you're doing service.c (at 
http://cvs.php.net/viewvc.cgi/pecl/axis2/service.c?revision=1.17&view=markup).

However I'm not sure how to plug my code in the Axis2C runtime so to get 
it executed when the server starts. Can I create new services from 
inside a module?

A related question is: Instead of having to create service infos for all 
the services that I need to dispatch to, can I just declare a single 
receiver that will see/handle all incoming calls (and then I'll dispatch 
to the correct Tuscany service myself from there)? Is that possible?

Thanks

-- 
Jean-Sebastien


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


Re: An API to configure Axis services?

Posted by Samisa Abeysinghe <sa...@wso2.com>.
Jean-Sebastien Delfino wrote:
> In the Apache Tuscany/C++ project we are using Axis2C to implement our 
> Web Service support. Application developers use Tuscany to create 
> components, then our runtime takes care of exposing these components 
> as Web Services. Currently each time we create a Web service, we 
> create a directory under Axis2/services/ for it, copy a Tuscany shared 
> library (containing a generic Axis2 service skeleton) into that 
> directory and create a services.xml file declaring the new service to 
> Axis2C. I'd like to simplify this process and do the configuration of 
> Axis2C in memory without having to create a directory structure and 
> copy files around for each new service.
>
> Are there any other ways to declare services to Axis2 than creating a 
> directory per service containing a services.xml file? 
Yes, you can add service to configuration using config API.
> Can a single services.xml file declare multiple services?
Yes, we have the service group concept - please look at sg_math sample.
> Is there an API that would allow me to plug into the Axis2C runtime 
> and declare and configure Web services? Could you point me to sample 
> code that does that or any info that will help me understand how to 
> declare services dynamically?
As I mentioned earlier, using config API you can do that. The best 
sample that I can think of is PHP Axis2 extentio which is here : 
http://pecl.php.net/package/axis2

Thanks,
Samisa...
>
> Thanks.
>


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