IBM Support

Unexpected element (possibly unknownElement) in transparent decision service SOAP response

Troubleshooting


Problem

Why do my transparent decision services (HTDS or MTDS) generate a response with a tag that does not match the WSDL definition (possibly an unknownElement)?

Symptom

You get an unexpected element (possibly an unknownElement) tag in the soap response of your transparent decision service:

    <DecisionServiceResponse xmlns="http://www.ilog.com/rules/DecisionService">
       <ilog.rules.outputString> ... </ilog.rules.outputString>
       <ilog.rules.firedRulesCount> ... </ilog.rules.firedRulesCount>
       <yourResponse xmlns="http://www.ilog.com/rules/param">
             <unnownElement xmlns="">
              ...
             </unknownElement>
       </yourResponse>
    </DecisionServiceResponse>

The mismatch may cause client applications to fail when consuming the web service. For example, IBM Business Process Management (BPM) will show the following error:

com.lombardisoftware.core.TeamWorksRuntimeException: Property X in class Y is not declared. It must be declared to be used.
at com.lombardisoftware.core.TWObject.getDeclaredPropertyByName(TWObject.java:554)
at com.lombardisoftware.core.TWObject.setTWClass(TWObject.java:350)
at com.lombardisoftware.core.TWObject.cast(TWObject.java:323)
at com.lombardisoftware.server.core.SymbolTable.set(SymbolTable.java:369)
at com.lombardisoftware.core.script.js.AbstractTWSymbolTableScriptable.put(AbstractTWSymbolTableScriptable.java:176)
at org.mozilla.javascript.ScriptableObject.putProperty(ScriptableObject.java:1729)
at org.mozilla.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1557)

Cause

This issue has been seen in cases where ruleset parameter type was defined by an XML schema (XSD) XOM which does not declare a global element of that type.

For example, if the type of the parameter, NewComplexType, is defined as the following in your XSD XOM:

 <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.example.org/model/" targetNamespace="http://www.example.org/model/">
        <complexType name="NewComplexType">
         <attribute name="NewAttribute" type="string"></attribute>
        </complexType>
    </schema>


Also the issue may occur if you have more than one global element of the same parameter type declared in the XSD XOM, for example:

  <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.example.org/model/" targetNamespace="http://www.example.org/model/">
        <element name="NewElement" type="tns:NewComplexType"></element>
        <element name="NewElement1" type="tns:NewComplexType"></element>

        <complexType name="NewComplexType">
         <attribute name="NewAttribute" type="string"></attribute>
        </complexType>
    </schema>


In this last scenario, the response may not show an unknownElement, but rather an element name not matching the WSDL definition.

Resolving The Problem

In the case where the XSD does not declare any global element of the parameter type, add a global element for that type in the XSD. In the example mentioned above, the XSD would then look like:

 <schema xmlns="http://www.w3.org/2001/XMLSchema[http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.example.org/model/http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/model/http://www.w3.org/2001/XMLSchema">
        <element name="NewElement" type="tns:NewComplexType"></element>

        <complexType name="NewComplexType">
         <attribute name="NewAttribute" type="string"></attribute>
        </complexType>
    </schema>

You will need to regenerate the WSDL.


In the case where the XSD declares more than one global element of the same parameter type, the solution is to write the following in the final action of your ruleflow for the corresponding out or in/out XML ruleset parameter:

    myParam.setAsRootElement("myParam", <yourNamespace>, <yourSchemaLocation>);

where 'myParam' is the name of your out or in/out XML ruleset parameter. You will need to redeploy the corresponding RuleApp/ruleset and regenerate the WSDL.

You can use null values for default namespace and default schema location:
    myParam.setAsRootElement("myParam", null, null);


This second solution (assigning the root element name of an XML object) works also in the first scenario where XSD does not declare any global element of the parameter type.

[{"Product":{"code":"SS6MTS","label":"WebSphere ILOG JRules"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Modules:Execution Server (BRES \/ RES)","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.1;7.0;6.7;6.6","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSQP76","label":"IBM Operational Decision Manager"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Modules:Execution Server","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.0;7.5","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21426013