Create Web services with the Apache Axis run-time environment
Overview
This run-time environment is for users who prefer to develop for the open Apache Axis platform. It is for non-production use only. Axis is the third generation of the Apache SOAP implementation. It evolved from Apache SOAP (which began at IBM as SOAP4J) to make the SOAP engine more flexible, configurable, and able to handle both SOAP and the upcoming XML Protocol specification from the W3C open-source effort.
Axis is based on JSR 101 Java APIs for XML based RPC (also known as JAX-RPC). JSR 101 provides a single interface to any XML-based RPC mechanism, including SOAP.
Web services application server uses Axis within a servlet to process the incoming message, extract information from the message headers, and payloads, as well as conforming to the particular RPC semantics.
The level of Axis currently supported by Rational Developer products is 1.0.
The User's Guide available on this site provides more in-depth information about using Web services with Apache Axis. The Reading Guide lists several documents to further your understanding of Axis.
Limitations
Limitations of using the Apache Axis run-time environment with Web services are listed below. For a complete list of limitations, refer to Limitations.
- The messages:
- Additional JARs have been added: webserviceutils.jar
- Compile failed
may appear in the server console log when generating Web service clients with Sample JSPs on Apache Tomcat servers. These messages can be safely ignored.
- After going through a Java bean Web service creation scenario with an existing client Web project which has not already been added to a running Tomcat server, you will see an Error 404 appear in the Web browser. This is because the Tomcat server was not restarted after the client project was added to the server. To resolve this restart the Tomcat server. If you are running a JSP sample client, refresh the Web browser.
- Creating Web services using the Apache Axis 1.0 run-time environment relies on the Java2WSDL and WSDL2Java emitters provided in Axis 1.0. Support for document/literal and document/literal (wrapped) is problematic in Axis 1.0, therefore the user should use RPC/encoded when creating Web services using the Apache Axis 1.0 run-time environment.
- The file overwrite, folder creation and automatic file checkout preference are not observed when creating Web services using the Axis run-time environment. Folder creation is always allowed and automatic file checkout is never enabled.
- When using the Apache Axis 1.0 run-time environment, the Axis emitters re-generate every time all the server/client Java files, deploy.wsdd and undeploy.wsdd. WSDL2Java for the service generation scenario will only generate the skeleton implementation file if it does not already exist. If this implementation already exists, it will not be overwritten.
- The Axis run-time environment has a limitation in its ability to handle Java classes with non-conventionally named identifiers. After the WSDL is generated from the original bean, the operation names in the WSDL are correct. However, after Axis generates the bean from the WSDL file, the method name is changed to lowercase to support Java conventions. The Web services wizards discard the generated skeleton and use the original bean. This causes a mismatch between the bean name and the WSDL file.
For example, if the bean method name is BodyMassIndex, the Axis deployment descriptor operation name would be bodyMassIndex (where 'b' is lowercase) to make it follow standard Java naming conventions.
There are two possible solutions:
- Change the original bean's method name.
- Modify deploy.wsdd and redeploy the service. This is not a recommended solution unless you are familiar with the Axis deployment tools.
- When creating a Web service from a Java bean or EJB, if the Java or EJB implementation has references to Java classes that are located in different packages, then the generated WSDL, more specifically, the <schema> sections of the WSDL file, may have missing <import> statements.
- A Web service created with the Axis run-time environment may not be interoperable. Axis does not respect the XSD schema definition in WSDL files, therefore the responses generated by the Web service may not match what is defined in the WSDL file. For example, if you have complex types that contain a sequence of elements, the order of the elements in the response message does not match the order defined in the WSDL file.
- When generating a Java or EJB skeleton from a WSDL file, if the WSDL file you use contains an XML type that does not have a standard JAX-RPC mapping (for example, a <choice> group), the generated skeleton implementation does not create the corresponding javax.xml.soap.SOAPElement correctly. As a result, the Web service may return malformed SOAP responses.
The following may fix this problem:
- Open the implementation class.
- Go to the line where the SOAPElement is instantiated (should look similar to the following:createSOAPElement("http://schems.ibm.com/wswrapper",">D"
- Remove the > character.
- Save the it and restart the EAR project.
- If creating a Web services client using the Axis run-time environment, the client proxy's JNDI lookup does not work in the Universal Test Client. As a result, client configurations defined in the client's deployment descriptions (these include: webservicesclient.xml, ibm-webservicesclient-ext.xmi, and ibm-webservicesclient-bnd.xmi) will not be picked up. An example of such client configuration is security. Use the sample JSPs instead of the Universal Test Client to test the proxy.
Creating a Web service from a Java bean using the Apache Axis run-time environment
The Web Service wizard assists you in creating a new Web service, configuring it for deployment, and deploying the Web service to a server. Once your Web service is deployed, the wizard assists you in generating the client proxy and sample application to test the Web service. When you have completed testing, you can publish your Web service to a UDDI Business Registry using the Export wizard.Creating a Java bean skeleton from a WSDL document using the Apache Axis run-time environment
The Web Service wizard assists you in creating a skeleton bean from an existing WSDL document. The skeleton bean contains a set of methods that correspond to the operations described in the WSDL document. When the bean is created, each method has a trivial implementation that you replace by editing the bean.Generating a Java client proxy and a sample application from a WSDL document using the Axis run-time environment
The Web Service Client wizard assists you in generating a Java bean proxy and a sample application. The sample Web application demonstrates how to code a proxy file.
Related Concepts
Web services
Tools for Web services development
JAX-RPC
Related Tasks
Developing Web services