How to troubleshoot issues related to requests and responses from ws loaded in SM

40 views Asked by At

I am working on an integration between Microfocus Service Manager and Remedy. In order to troubleshoot issues related to requests and responses from SM to Remedy is needed to print or send that information to a log. I have tried using a debug -RTM:3 flag in my testing port configuration, but unfortunately there is a lot of information in my log since it writes every step performed by the tool. After that, I set the -debughttp flag in my port, but it only writes inputs/outputs from external resources. Here is what I have done: Load Remedy customer's endpoint with WSDL2JS utility. Invoke the endpoint with a SL. Perform a request to the endpoint. Get an undefined response. Check logs written by -RTM and -debughttp without success. Is there any way to check what’s happening with my requests or with my customer’s reponses?

1

There are 1 answers

0
Alexis Ruiz On BEST ANSWER

You can get the content of your requests and responses using the sl created by WSDL2JS only adding a piece of code within it. For your requests, look for this part of the code (about line 129):

this.resultXML = doSOAPRequest( this.location, soapOp.SOAPAction, result.xml,
                              this.user, this.password,
                              this.connectTimeOut, this.sendTimeOut, this.recvTimeOut,
                              this.attachments, this.acceptfastinfoset );

Add the following code below:

//Print your request
print(result.xml)
//Send your xml request to a internal log called integration_debug.log in your app server
writeFile("../logs/integration_debug.log","a","\n");
writeFile("../logs/integration_debug.log","a","######### REQUEST INFO XML######\n");
writeFile("../logs/integration_debug.log","a",system.functions.tod()
+ "\n" 
+ result.xml
+ "\n"
+ "\n");

For your customer’s responses, look for this part of the code:

  if ( soapOp.responseObj == "null" )  // one-way MEP ? 
  {
    return null;
  }
  
var resultObj = new Object();
resultObj.responseObj = soapOp.responseObj;

Add the following code below:

//Print your customer response
print(this.resultXML.getDocumentElement())
//Send your xml response to a internal log called integration_debug.log in your app server
writeFile("../logs/integration_debug.log","a","\n");
writeFile("../logs/integration_debug.log","a","######### RESPONSE INFO XML#######\n");
writeFile("../logs/integration_debug.log","a",system.functions.tod()
+ "\n" 
+ this.resultXML.getDocumentElement()
+ "\n"
+ "\n");

As a reference you can check the following picture to identify where inserting your code: enter image description here Hopefully, that can be helpful for your troubleshooting.