Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

does axis 2 automatically create (and save) wsdl file?

I have a web service up and running with eclipse/tomcat/axis2. I want to get it linked to a bpel process, so I need the wsdl file. I can display the wsdl by starting the server and going to

http://localhost:8080/axis2/services/MyService?wsdl

But if I search the directory structure for the project, I can't find the wsdl file. I can of course copy and paste the wsdl from the browser and save it as a text file, then point bpel to that wsdl. But it seems like axis 2 would generate (and save) a wsdl file for me, right?

like image 649
bernie2436 Avatar asked Apr 14 '13 00:04

bernie2436


People also ask

How is a WSDL file generated?

In the main menu, go to Tools | XML WebServices and WSDL | Generate WSDL From Java Code. In the Generate WSDL From Java dialog that opens, specify the following: The name and URL address of the Web service. The protocol and encoding style used when accessing the public operations of the Web service.

What is Axis2 used for?

Axis2 provides the capability to add Web services interfaces to Web applications. It can also function as a standalone application server.


2 Answers

By default, when you add ?wsdl, Axis2 does not retrieve a previously generated WSDL document. It is generated every time. But if you put the WSDL document file and the corresponding XML Schema files inside the META-INF folder in the service archive file, it can be recovered with:

http://localhost:8080/axis2/services/MyService.wsdl

The service name given in the services.xml and the service name defined in the WSDL document should be the same.

In another hand, if you want to save a generated WSDL document, simply run something like the following snippet as a Java Application on some class of your project, using the class org.apache.ws.java2wsdl.Java2WSDL.

public static void main(String[] args) throws Exception {
    Java2WSDL.main("-cn com.abc.MyService".split("\\s+"));
}

Once it has been executed, the generated WSDL document file and the corresponding XML Schema files you can find it in the folder of the project.

enter image description here

To find out more options to use them with this tool, use the following:

public static void main(String[] args) throws Exception {
    Java2WSDL.printUsage();
}
like image 90
Paul Vargas Avatar answered Oct 19 '22 14:10

Paul Vargas


It doesn't keep a wsdl in the file system. You need to save it as .wsdl file and point your BPEL to it. Or else you can follow java2wsdl wizard as mentioned in http://axis.apache.org/axis2/java/core/tools/eclipse/wsdl2java-plugin.html to generate the wsdl from the code.

like image 21
Amila Maharachchi Avatar answered Oct 19 '22 12:10

Amila Maharachchi