How Do I: Use an Apache SOAP Web Service?

You can build a web service that acts as the client of an Apache SOAP web service. You can also call a WebLogic Workshop service from an Apache SOAP web service. This topic describes how to do both.

To Call Your Web Service from an Apache Web Service

In order to call your web service from an Apache web service, you must change your service to use the SOAP-RPC message format. By default, WebLogic Workshop web services use the Document-literal SOAP message format. To configure your web service to use SOAP-RPC format:

  1. In Design View, select your web service.
  2. In the Property Editor, expand the protocol property.
  3. Click the drop-down list for the soap-style attribute and select RPC. This makes all the methods of your web service use the SOAP-RPC message format instead of document-literal.

  4. Note: You may configure the message format on a per-method basis instead of for the service as a whole. To do this, modify the soap-style attribute or the protocol property for each method individually.
  5. Obtain a new WSDL file for your web service for use by the Apache SOAP client. You may obtain the WSDL file in any browser by browsing to the URL of the web service with ?WSDL appended to the URL, as follows:
    http://host:port/application/service.jws?WSDL

To Call an Apache Web Service From Your Service

You can ordinarily use another web service from your WebLogic Workshop service by creating a Web Service control from that service's WSDL file. To learn how to use another web service's WSDL file to create a Web Service control, see How Do I: Call One Web Service from Another?.

Some older Apache WSDL files do not conform to the current WSDL specification. For these files, modifications must be made before the file can be used by WebLogic Workshop. Specifically, the problem is that the children of the root tag <definitions> in the file are sometimes in the wrong order.

To use the Apache SOAP WSDL file, alter it so that the children of the root tag appear in the following order:

  1. <types>
  2. <message>
  3. <portType>
  4. <binding>
  5. <service>

Note that some of these may appear more than once. If the Apache WSDL file contains these elements in an illegal order, then reordering them by hand may fix the problem.

Related Topics

WSDL Files

How Do I: Use a WebLogic Server Web Service?

How Do I: Use a .NET Web Service?