Add the following code after service deployment and then try ?wsdl

AxisConfiguration axisConfig = context.getAxisConfiguration();
AxisService service = axisConfig.getService("service-name");
..
javax.wsdl.Definition definition = <definition of your custom wsdl>;
..

service.addParameter(org.apache.axis2.wsdl.WSDLConstants.WSDL_4_J_DEFINITION,
definition);
service.addParameter("useOriginalwsdl", "true");


HTH

Sanka


On Thu, Mar 10, 2011 at 10:28 AM, Nikolaus Krismer <[email protected]> wrote:
> Hi!
>
> are there best practices on how to deploy services programatically?
> I tried different approaches, but i can't figure out how to deploy my own 
> wsdl file (so it can be retrived by ?wsdl in the web browser) when deploying 
> programatically.
>
> Here are some of my tries:
>  1.) DeploymentEngine.buildService(new FileInputStream(serviceXmlFile), 
> context);
>  2.) Build an aar file in code (using ZipOutputStream) and pass the generated 
> zip to:
>        
> axisConfig.addServiceGroup(DeploymentEngine.loadServiceGroup(aarZipFile, 
> context))
>  3.) Using DeploymentFileData.deploy (also using a generated aar zip file, 
> which is generated in code)
>
> All of these approches seem to work (personally i prefer #1), but i can't get 
> my original wsdl file (which for #2 and #3 is included in the generated aar 
> file) to be used when calling my service in a webbrowser using ?wsdl. 
> However, i can deliver my custom wsdl files when deploying aar files to the 
> service directory before starting up axis, but since i want to simplify the 
> build of the application i would prefer to deploy services at runtime when 
> starting the application, and not at buildtime.
>
> Is there a way to deliver a custom wsdl file when deploying services 
> programatically?
>
> Regards,
> Niko
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>



-- 
Sanka Samaranayake

PMC Member, Committer, Apache Software Foundation, http://www.apache.org/

Telephone: +34 677 864358
Email: sanka AT apache DOT org
Blog: http://sankas.blogspot.com/
Linked-in: http://lk.linkedin.com/pub/sanka-samaranayake/4/b2b/3b3

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to