Step 3: Test the response

After the request has been submitted successfully, test the response to the request, which is written to the http.logfile. Look for the following text. (The section that is bolded indicates that this is the response message):

SOAP-ENV (http://schemas.xmlsoap.org/soap/envelope/
<Envelope><Body>http://servicecenter.peregrine.com/PWSÏ cmn,
http://servicecenter.peregrine.com/PWS/CommonÏ xsd¬http:
//www.w3.org/2001/XMLSchemaÏ xsi(http://www.w3.org/2001/
XMLSchema-instanceð=‚ RetrieveIncidentResponsex message No
more) records foundx	returnCode@9x schemaRevisionDate
2008-05-30x schemaRevisionLevel@1x status
FAILURE{„… schemaLocation dhttp://servicecenter.peregrine.
com/PWS http://<server>:<port>/sc62server/ws/Incident.xsdð=‚
model=‚ keys}‚	IncidentIDx typeEStringð’ IM1001ÿ}‚
instancexrecordid  IM1001 - x
uniquequery  number="IM1001"ðE ‚ð ÿÿÿðà
< #document8ÏSOAP-ENV(http://schemas.xmlsoap.org/soap/
envelope/ð?��Envelope?�� BodyxÍ%http://servicecenter.
peregrine.com/PWSÏ cmn,http://servicecenter.peregrine.com/
PWS/CommonÏ xsd¬http://www.w3.org/2001/XMLSchemaÏ xsi(http://
www.w3.org/2001/XMLSchema-instanceð=‚
RetrieveIncidentResponsex message No (more) records foundx
returnCode@9x schemaRevisionDate  2008-05-30x
schemaRevisionLevel@1x status FAILURE{„… schemaLocation
dhttp://servicecenter.peregrine.com/PWS http://geist8440.
americas.hpqcorp.net:13701/sc62server/ws/Incident.xsdð=‚
model=‚ keys}‚	IncidentIDx typeEStringð’ IM1001ÿ}‚
instancexrecordid  IM1001 - x
uniquequery  number="IM1001"ðF ‚ð ÿÿÿÿ

HTTP/1.1 200
Keep-Alive: timeout=1200000, max=1000
Connection: Keep-Alive
Pragma: requestnum="185"
Content-Encoding: gzip
Content-Type: application/fastinfoset;charset=utf-8
Transfer-Encoding: chunked
Date: Wed, 04 Jun 2008 22:09:56 GMT
  1. Copy the section mentioned above from the http.log file into a text file and assign it a name such as responsetest.xml. If you used tcpmon to get the information, you can use the XML response as is. If it came from the http.log, you will need to modify the special characters in the log to correct XML syntax.
  2. Change the calling JavaScript to override the invoke function to read and interpret the contents of the responsetest.xml file. The following is the section of the code needed to do that.
  3. // Temporarily override the "invoke" function to replace it
    with
    // a function which reads an XML response from a file
    <ServiceObject>.invoke = function( ) {
    var resultObj = new Object();
    resultObj.responseObj = null;
    var resultXML = new XML();
    resultXML.setContent( "c:\\<path>\\<responsetest.xml>",
    true );
    try
    {
    lib.SOAP.deserialize( "<name of the generated JavaScript>",
    resultXML.getDocumentElement(), resultObj );
    }
    catch( e )
    {
    print( "Error deserializing response: " + e.toString() );
    return null;
    }
    try
    {
    this.soapEnvelope = resultObj.soap_Envelope;
    this.soapBody = resultObj.soap_Envelope.soap_Body;
    if ( this.soapEnvelope.soap_Header != undefined )
    {
    this.soapHeader = this.soapEnvelope.soap_Header;
    }
    else
    this.soapHeader = null;
    return resultObj.soap_Envelope.soap_Body.getContent();
    }
    catch( e )
    {
    print( "Error extracting Response Object: " + e.toString() );
    return null;
    }
    }
  4. Change the line of the calling JavaScript that invokes the Web Service from <ServiceObject>.invoke to simply invoke to call the invoke function defined within that calling JavaScript.
  5. Click Execute to run this modified JavaScript. If it finishes without errors, the response is deemed successful.

If any of the above tests fail to complete, contact Micro Focus Service Manager Customer Support and provide the WSDL file, the request and response xml text files with any error messages, and the sm.log and http.log files with debughttp turned on.