Wednesday 21 June 2017

How to create a SOAP Fault in ESQL

A SOAP Fault is used to carry error information in a SOAP message.

A SOAP Fault has the following elements:

  • <faultcode> - mandatory element which provides information about the fault in a form that can be processed by the software. The values are:-
    • SOAP-ENV:VersionMismatch - invalid namespace for SOAP envelope.  
    • SOAP-ENV:MustUnderstand - a header was received that was targeted at the receiving node, marked mustUnderstand="true", and was not understood.
    • SOAP-ENV:Client - something went wrong on the receiver while processing the message, The message was incorrectly formed or contained incorrect. e..g the message could lack the proper authentication or payment information.The message was incorrectly formed or contained incorrect information.
    • SOAP-ENV:Server - There was a problem with the server, so the message could not proceed.The message could not be processed for reasons attributable to the processing of the message rather than to the contents of the message itself.
  • <faultstring> - mandatory element that provides information about the fault in a form intended for a human reader. 
  • <faultactor> - this element is intended to provide information about who caused the fault to happen within the message path. It is similar to the SOAP actor attribute but instead of indicating the destination of the header entry, it indicates the source of the fault. The value of the faultactor attribute is a URI identifying the source. Applications that do not act as the ultimate destination of the SOAP message MUST include the faultactor element in a SOAP Fault element. The ultimate destination of a message MAY use the faultactor element to indicate explicitly that it generated the fault 
  • <detail> - the element carries application-specific error information related to the <Body> element. It must be present if the contents of the <Body> element were not successfully processed.

Add the following code to a Compute node and then wire the SOAPInput node's catch terminal to the Compute node's in terminal.

DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/'; 
SET OutputRoot.XMLNSC.soapenv:Envelope.(XMLNSC.DoubleNamespaceDecl)xmlns:soap = soapenv; SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.soapenv:Fault.faultcode = faultCode
SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.soapenv:Fault.faultstring = faultString
SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.soapenv:Fault.detail = detail;








Monday 19 June 2017

Debugging a Java Compute Node

Run in IBM Integration console
mqsichangeproperties integration ode -e integration server -o ComIbmJVMManager -n jvmDebugPort -v port

To disable the java debug just type the same command and replace the debugging port with 0 (number zero).

Do the same when you get an error that a port is being used.

User or Service Trace

Run in IBM Integration Console
Delete old trace logs
mqsichangetrace integration node -u -e integration server -r
e.g. mqsichangetrace IB10NODE -u -e default -r

User Trace
Start trace
mqsichangetrace integration node -u -e integration server -l debug –r
This will start user trace on an integration server.
e.g. mqsichangetrace IB10NODE -u -e default-l debug –r

mqsichangetrace integration node -u -e integration server -f message flow -l debug –r
This will start user trace on a message flow.

(remove –r when running for 1st time otherwise the command fails)

Retrieve the trace log for the specified component.
mqsireadlog integration node -u -e integration server -o C:\Temp\Trace.xml
e.g. mqsireadlog IB10NODE -u -e default-o C:\Temp\Trace.xml
This command will read the log and generate an xml file with all the details, to get a more readable log file we need to use.

Stop user trace
mqsichangetrace integration node -u -e integration server -l none mqsichangetrace -u -e integration server -f message flow -l none
e.g. 
mqsichangetrace IB10NODE -u -e default-l none

Format XML tracefile
mqsiformatlog -i inputfilename -o outputfilename
e.g mqsiformatlog -i C:\Temp\trace.xml -o C:\Temp\formattrace.log
The mqsiformatlog command interprets an input log file that has been created on any system in a platform-independent code page, utf-8. Use this command to produce formatted output from input log files transferred from other systems to the system on which you issue the command. If you use this facility, ensure that you use a file transfer program that does not convert the data (for example, by specifying a binary transfer option).


Service Trace

Start trace
mqsichangetrace integration node -t -e integration server -l debug -r -c 100000

Initiate process that cause the failure to occur.

Stop trace
mqsichangetrace integration node -t -e integration server -l none

Retrieve the trace log for the specified component
mqsireadlog integration node  -t -e integration server -f -o C:\Temp\flowtrace.xml

Format the XML trace file
mqsiformatlog -i C:\Temp\flowtrace.xml -o C:\Temp\serviceflowtrace.txt