Multipart WSDL best practices

 

+

Search Tips   |   Advanced Search

 

WAS supports deployment of Web services using a multipart WSDL file.

In multipart WSDL files, an implementation WSDL file contains wsdl:service and imports an interface WSDL file, which contains the other WSDL constructs. This supports multiple Web services using the same WSDL interface definition.

The <wsdl:import> element indicates a reference to another WSDL file.

If the <wsdl:import> location attribute does not contain...

...the imported file must be located in the same directory and must not contain a relative path component. For example, if...

META-INF/wsdl/A_Impl.wsdl

...is in your module and contains the import statement...

<wsdl:import="A.wsdl" namespace="..."/>

...the A.wsdl file must also be located in the module directory...

META-INF/wsdl

IBM recommends that you place all WSDL files in...

META-INF/wsdl

...if you are using EJB, or...

WEB-INF/wsdl

...if you are using JavaBeans components, even if relative imports are located within the WSDL files. Otherwise, implications exist with the WSDL publication when you use a path like...

<location="../interfaces/A_Interface.wsdl"namespace="..."/>

...Using a path like this example fails because the presence of the relative path, regardless of whether the file is located at that path or not. If the location is a Web address, it must be readable at both deployment and server startup.

 

WSDL publication

You can publish the files located in...

META-INF/wsdl

...or...

WEB-INF/wsdl

...through either a URL address or file, including WSDL or XSD files.

For example, if the file referenced in the <wsdl-file> element of webservices.xml is located in...

META-INF/wsdl

...or...

WEB-INF/wsdl

...it is publishable. If the files imported by <wsdl-file> are located in the wsdl/ directory or its subdirectory, they are publishable.

If the WSDL file referenced by the <wsdl-file> element is located in a directory other than wsdl, or its subdirectories, the file and its imported files, either WSDL or XSD files, which are in the same directory, are copied to the wsdl directory without modification when the application is installed. These types of files can also be published.

If the <wsdl-file> imports a file located in a different directory (a directory that is not -INF/wsdl or a subdirectory), the file is not copied to the wsdl directory and not available for publishing.


 

Related concepts

WSDL

 

Related tasks

Develop a WSDL file for JAX-RPC applications
Make deployed Web services application available to clients

 

Related Reference

WSDL architecture