Troubleshooting - Creating Service Description XML

This page is dedicated to helping you learn how to successfully create a service description file that connects to a web service.  Troubleshooting is an art, but hopefully I can teach you a few techniques by looking at actual problems that were brought to me.

The first step to any troubleshooting is to enable the trace logging.

1. Open WebSphere Admin Console

2. Troubleshooting...Logs and Trace...select the server (i.e. server1)

3. Select Diagnostic Trace...Click Runtime tab...Change Log Detail Level

4. Add the trace string: com.ibm.form.*=finest ( delimiter is a colon ":" )

5. Click OK and then OK again.


Now you can try executing the service and there will now be a trace.log in the WebSphere logs directory (i.e. ibm/websphere/appserver/profiles/appsrv01/logs/server1).

Within the logs you will see how the URL is built up (with whatever parameters you supply)

[17/04/14 13:49:12:534 EDT] 00001884 HTTPServiceTr 1 com.ibm.form.nitro.service.services.example.HTTPServiceTransport run Request URL is https://server:port/context

the resolution of all the parameters/constants:

Take this declaration in the XML:

<constant>
        <id>Content-Type</id>
        <value><![CDATA[text/xml; charset=utf-8]]></value>
 </constant>

You would then see this in the trace.log:

[17/04/14 13:49:12:503 EDT] 00001884 Mapper        3 com.ibm.form.nitro.service.services.impl.mapping.Mapper visit Looking up source value with scheme constant:Content-Type
[17/04/14 13:49:12:503 EDT] 00001884 Mapper        3 com.ibm.form.nitro.service.services.impl.mapping.Mapper visit Source value is not a list, performing simple mapping
[17/04/14 13:49:12:504 EDT] 00001884 Mapper        1 com.ibm.form.nitro.service.services.impl.mapping.Mapper visit Target value is com.ibm.form.nitro.service.services.impl.mapping.MapValue@5adb4933
[17/04/14 13:49:12:504 EDT] 00001884 Mapper        3 com.ibm.form.nitro.service.services.impl.mapping.Mapper visit Resolving target transport:request-header-Content-Type
[17/04/14 13:49:12:504 EDT] 00001884 Mapper        1 com.ibm.form.nitro.service.services.impl.mapping.Mapper visit Source value is text/xml; charset=utf-8
[17/04/14 13:49:12:505 EDT] 00001884 Mapper        3 com.ibm.form.nitro.service.services.impl.mapping.Mapper visit Target value is not a string, or xml
[17/04/14 13:49:12:505 EDT] 00001884 Mapper        3 com.ibm.form.nitro.service.services.impl.mapping.Mapper visit Setting reference null to text/xml; charset=utf-8

and what content gets posted to the server:

[17/04/14 13:49:12:514 EDT] 00001884 Mapper        1 com.ibm.form.nitro.service.services.impl.mapping.Mapper visit Source value is <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><tns:UpdateListItems xmlns:tns="http://namespace/soap/"><tns:listName/><tns:updates><Batch OnError="Continue" ListVersion="1"><Method ID="1" Cmd="New"><Field Name="Title">223456</Field></Method></Batch></tns:updates></tns:UpdateListItems></SOAP-ENV:Body></SOAP-ENV:Envelope>


In the trace.log you see something like this:

[17/04/14 13:49:12:539 EDT] 00001884 StandardExcep E com.ibm.form.nitro.platform.StandardExceptionMapper toResponse 4ef795f1-8929-44ab-a7b9-366453cc2401
                                 com.ibm.form.nitro.service.exception.AppAdminUserException: Unable to successfully execute service call. Reason: java.util.ArrayList incompatible with java.lang.String

This means that the service description has a string variable and it is trying to be assigned to a "list" or vice versa.  What I found when I inspected the xml file is that there was an error in the servicemapping.  The following was the line in error

<mapping source="parameter:listName" sourceType="NOOP" target="transport:request-entity" targetRef="SOAP-ENV:Envelope/SOAP-ENV:Body/tns:UpdateListItems/tns:listName" targetType="STRING" >  

This mapping did not have a closing tag - therefore it was assumed to be a list object (rather then a string).  I fixed it by adding a trailing slash:

<mapping source="parameter:listName" sourceType="NOOP" target="transport:request-entity" targetRef="SOAP-ENV:Envelope/SOAP-ENV:Body/tns:UpdateListItems/tns:listName" targetType="STRING" />