Default Result Checkers are built-in result checkers that are applied automatically on MBO operations by Unwired Server. They can be replaced by implementing and deploying a Custom Result Checker. This is the default result checker used to check results in SOAP Web service data sources.
package com.sybase.sup.ws;
import java.util.AbstractMap;
import java.util.Map.Entry;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFault;
import com.sybase.sup.ws.soap.WSResultChecker;
public class DefaultWSResultCheck implements WSResultChecker
{// CR593001 WSSOAPResults Checker
/**
*
* @param response the SOAP Envelope response from a web service execute.
* Use the SOAP API to retrieve values and determine if the SOAP request
* has executed successfully.
* @return a single Map.Entry. The boolean "key" value should be set to true.
*/
@Override
public Entry<Boolean, String> checkReturn(SOAPEnvelope response)
{
SOAPFault fault = null;
try
{
fault = response.getBody().getFault();
}
catch (Exception e)
{
//If we're in here, no fault was found.
}
if ( fault == null )
{
return new AbstractMap.SimpleEntry<Boolean, String>( true, "" );
}
else
{
return new AbstractMap.SimpleEntry<Boolean, String>( false, fault.getFaultString() );
}
}
}