IBM Support

Modifying the WSDL generated by the MTDS

Technote (FAQ)


The WSDL automatically generated by the MTDS is not always what you expect or you may want to modify the binding. Since the WSDL is generated automatically at runtime, you cannot modify directly the WSDL in Rule Studio or Eclipse. Then, how to do it?


JRules leverages Java API for XML Web Services Annotations (JAX-WS) to get the WSDL generated from the java XOM


You will have to add annotations in your java XOM. The annotations will be processed when the WSDL generation API (JAX-WS) parse the java XOM.

But first, you will have to upgrade the version of the JAXWS libraries, as the version provided in JRules 7.0.x and 7.1.x (JAX-WS v2.1.1) is not compatible with annotations.

You can download the newer library (v2.1.7) from the JAX-WS reference implementation's web site:

You will thus need to update the build script accordingly, so that it picks up the JAX-WS jar files from the newer version. This means modifying the <path id="jaxws.classpath"> definition in the build.xml file (in the MTDS project).

Then, in your java XOM, add for instance the annotation @XmlElement(required=true) for the attributes that musts have a minoccur="1" in the XSD so that they are no longer tagged as Optional in the WSDL generated.

For xml binding java annotations, refer to the java doc

If you want to have an attribute that is required and not nullable, you will annotate it :

public class Foo {
@XmlElement(nillable=true, required=true)
public int bar;

The XML generated will be :

<xs:complexType name="Foo">
<xs:element name="bar" type="xs:int" nillable="false" minOccurs="1"/>

Document information

More support for: WebSphere ILOG JRules

Software version: 7.0, 7.1

Operating system(s): Platform Independent

Reference #: 1594789

Modified date: 2012-05-15