You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Santoso Nugroho <sa...@gmail.com> on 2006/08/28 03:48:14 UTC

[Axis2]How to deploy/undeploy service programmatically?

Hi,

How to deploy a service programmatically given that I have the service 
class, services.xml and the WSDL?
The problem I have is that I must be able to create and deploy the 
service during runtime and the information (i.e. service name and the 
WSDL) only availables at runtime.


Thanks,

Santoso

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


Re: [Axis2]How to deploy/undeploy service programmatically?

Posted by Santoso Nugroho <sa...@gmail.com>.
Hi,

Thanks for the answer, however how do I specify my wsdl so that axis2 
can use my wsdl instead of using the generated wsdl?

Thanks,

santoso

Eran Chinthaka wrote:
> Santoso Nugroho wrote:
>   
>> Hi,
>>
>> How to deploy a service programmatically given that I have the service
>> class, services.xml and the WSDL?
>> The problem I have is that I must be able to create and deploy the
>> service during runtime and the information (i.e. service name and the
>> WSDL) only availables at runtime.
>>     
>
>
>
> AxisService myService =
> org.apache.axis2.util.Utils.createSimpleService(serviceName,
>                 new RawXMLINOutMessageReceiver(),
>                 MyService.class.getName(),
>                 operationName);
> // The above is to deploy a service with an IN-OUT operation. Change the
> // message receiver accordingly.
>
> getConfigurationContext().getAxisConfiguration().addService(
>                 service);
>
> BTW, from where do you wanna do this? Inside a handler, service.
> If (insideHandler)
> 	// get access to the config context thru the message context passed in
>
> else if (insideServiceImplClass)
>  	// get access to config context through the message context passed in
> thru message context injection (refer http://www.wso2.net/kb/106 or
> implement Service interface to your service class )
>
> -- Chinthaka
>
>   


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


Re: [Axis2]How to deploy/undeploy service programmatically?

Posted by Eran Chinthaka <ch...@opensource.lk>.
Santoso Nugroho wrote:
> Hi,
> 
> How to deploy a service programmatically given that I have the service
> class, services.xml and the WSDL?
> The problem I have is that I must be able to create and deploy the
> service during runtime and the information (i.e. service name and the
> WSDL) only availables at runtime.



AxisService myService =
org.apache.axis2.util.Utils.createSimpleService(serviceName,
                new RawXMLINOutMessageReceiver(),
                MyService.class.getName(),
                operationName);
// The above is to deploy a service with an IN-OUT operation. Change the
// message receiver accordingly.

getConfigurationContext().getAxisConfiguration().addService(
                service);

BTW, from where do you wanna do this? Inside a handler, service.
If (insideHandler)
	// get access to the config context thru the message context passed in

else if (insideServiceImplClass)
 	// get access to config context through the message context passed in
thru message context injection (refer http://www.wso2.net/kb/106 or
implement Service interface to your service class )

-- Chinthaka