You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Dan Peder Eriksen <da...@stud.cs.uit.no> on 2006/07/03 12:30:29 UTC

Re: Services

Hi Robert,

Thanks for your quick reply. What you answered to my first problem seems to
be what I'm looking for, so you udnerstood me correctly :) Since in JMX the
MBean server does the instancing of classes for you ServiceObjectSupplier
will work great. The problem is, as you say, that you have to define the
ServiceObject in the services.xml file. What I would like to do is to
deploy using code. So when our middleware discovers a a new component in
its deploy folder it will load it as a MBean and then create a soap service
pointing to that mbean. Creating a new service in the way axis deployes its
services will be problematic. Creating a way to dynamically deploy soap
services is what's needed for us.

Since I'm not to familiar with the codebase of axis 2 I would appreicate it
greately if anyone could tell me how to deploy services from code or could
point me to the correct files so I could found out for myself.

Dan

On Fri, 30 Jun 2006 20:05:50 +0200, robert lazarski  
<ro...@gmail.com> wrote:

> Hi Dan,
>
> I'm interested in what you're doing with JMX, as I do a lot of axis2
> programming with JBoss / EJB which as you may know is a very heavily
> user of JMX. See my comments inline:
>
> On 6/30/06, Dan Peder Eriksen <da...@stud.cs.uit.no> wrote:
>> Hello,
>>
>> I'm a master degree student from the university of Tromsø working on
>> a middlware platform for context sensitive services. The middlware is
>> built by using MBeans (JMX http://java.sun.com/products/JavaManagement)
>> and Axis 2 has been installed on an embedded installation of Jetty
>> 5.1.11RC0.
>>
>> We want to make it possible for components deployed in the middleware
>> to expose certain methods as web services using axis 2. When trying to
>> use the API some problems have arisen.
>>
>> The two problems I encounter when trying to do this is:
>> 1. A way to register already created objects as a service, so I supply
>> the instance of the object (the component) instead of axis 2 creating
>> the instance for me.
>
> You happen to be lucky and this issue was just implemented in recent
> days - if I understand you correctly ;-) . In my case I did the Spring
> support that does its own loading of objects, but ran into the same
> issue. The Spring classes haven't been updated yet, but hope to do
> that in the next few days.
>
> In the latest svn take a look at
> modules/core/src/org/apache/axis2/receivers/AbstractMessageReceiver.java
>
> You can now define ServiceObjectSupplier as you would ServiceClass in
> your services.xml, and return your object as you see fit.
>
>> 2. A way to programmatically register services. This most also be  
>> possible
>> at runtime as the middleware supports hot deployment.
>>
>> So what I'm looking at creating (if it doesnt already exists) for our
>> middleware is something like this, pseudocode:
>>
>> //My component I want to register
>> Component comp = Middleware.getComponent("Component Name");
>>
>> //Methods the service should expose, everything
>> Method[] methods = comp.getClass().getMethods();
>>
>> //Singelton pattern
>> Axis axis = Axis.getInstance();
>>
>> //Deploy Service
>> axis.deployService("Service Name", comp, methods);
>>
>>
>> If does not exist already it's something I would like to create. I'm  
>> sure
>> it
>> would be usefull for others aswell. Where would one start to create
>> something
>> like this?
>
> This is not the area I typically work on, though I'll take an educated
> guess. Others may be able to give better advice.
>
> You either need an axis2.xml or you can create one programatically via
> AxisConfiguration . From there you can go with the exploded dir
> options as this tutorial explains:
>
> http://www.wso2.net/kb/90
>
> AFAIK, however, the exploded dir option is not hot deploy. To do that,
> my possibly completely wrong thoughts, based on entirely too much
> world cup fever, would be:
>
> 1) First get the axisConfiguration as descibed above.
> 2) Then get the AxisService corresponding to the service to create from
> axisConfiguration.
> 3)  AxisService createService(String implClass, AxisConfiguration
> axisConfig) throws org.apache.axis2.AxisFault;
> 4) To invoke:
>
> new ServiceClient(ConfigurationContext configContext, AxisService  
> axisService);
> serviceClient.sendReceive(OMElement);
>
> HTH,
> Robert
> http://www.braziloutsource.com/
>
>
> HTH,
> Robert
> http://www.braziloutsource.com/
>
>>
>> Sincerely Dan Peder Eriksen


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


Re: Services

Posted by Ruchith Fernando <ru...@gmail.com>.
Hi Dan,

On 7/3/06, Dan Peder Eriksen <da...@stud.cs.uit.no> wrote:
>
> Since I'm not to familiar with the codebase of axis 2 I would appreicate it
> greately if anyone could tell me how to deploy services from code or could
> point me to the correct files so I could found out for myself.

If you are looking for a simple tutorial on Axis2 check this out :
http://www.wso2.net/tutorials/axis2/java/2006/05/29/hello-world

Also you can have a look at the axis2 user guide:
http://ws.apache.org/axis2/1_0/userguide.html

Thanks,
Ruchith

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