Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Debugging IP IVR script

I have a script that we use to automate activating gift cards.  The caller calls in presses 1 to activate the gift card, collects the digits, makes a SOAP call out to activate the card, a balance is returned and the call ends.  This process works for our test gift card but does not work for any other gift cards.  My initial thought was that the card umber was hard coded, but its not.


I do not get a response at all when trying to activate a newer gift card.  My test gift card starts with 6074 and the new ones start with 6097.  The soapResonseString stays "null"


My developer would like me to debug the service call and see what the full http response is, but I do not know how to o this.

Everyone's tags (3)

Hi.Er... this is a bit vague.


Er... this is a bit vague. Can you tell me the way you are contacting the SOAP server? Could you please post your SOAP client code?


New Member

Kind of new to some of this..

Kind of new to some of this...


Is this what you are looking for?


{ baos = new;
String content = soapRequest;
int readTimeout = 12000;
try { url = new; urlCon = ( url.openConnection();
 urlCon.setFixedLengthStreamingMode(content.length() );
 urlCon.setReadTimeout (readTimeout);
 urlCon.setDoInput (true);
 urlCon.setDoOutput (true);
 urlCon.setUseCaches (false);
 urlCon.setRequestProperty("SOAPAction",""); output = new );
 output.close(); input = new );
 int bufSize = 4096;
 byte[] bytesRead = new byte[bufSize];
 int bytesReadLength = 0;
 while(( bytesReadLength = bytesRead )) > 0 ) {
 } catch (Exception e) {
 return null;
return baos.toString();


I was able to resolve my issue with the script, but I would like to know how to better debug in the future.


For this instance where it says " e.printStackTrace();" I walk told to change it to "return e.getMessage();" ran a reactive debug and was returned a time out error instead of just null.


From there I was able to change "int readTimeout =" to 12000 instead of the 5000 it was set to.


My question from here is moving forward what traces and log levels would I need to get this information from within RTMT?  I had no way to know what that null result was.  It says e.printStackTrace but I do not know where it would have written to.

Hi,actually, the author of


actually, the author of the above code block is me and I believe returning null when an exception happens is better than returning the error message (the return value of e.getMessage()). the printStackTrace method gives you all the details, not just the top line.

It's very important to notice that printStackTrace sends the error message including the stack trace to stderr, which is in case of UCCX directed to MIVR/stdout.log (I guess via log4j). In Plain English, the only file you need to watch here is MIVR/stdout.log for the messages printed by printStackTrace().

Let me demonstrate:

I simply created a new script with one Do step, containing the following code block:

try {
throw new RuntimeException("Boooo!");
} catch (Exception e) {

This basically throws and catches an exception.

I also ssh'd to the UCCX and issued the following command:

file tail activelog uccx/log/MIVR/stdout.log

I don't even need to call in, debugging the script from the CCX Editor is sufficient.

Now, what I can see is a bit chatty but I can see all the details:

Nov 12 11:57:01.597 CET: *** keepalive is called...
java.lang.RuntimeException: Boooo!
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
        at java.lang.reflect.Constructor.newInstance(
        at sun.reflect.GeneratedMethodAccessor219.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at sun.rmi.server.UnicastServerRef.dispatch(
        at sun.rmi.transport.Transport$
        at Method)
        at sun.rmi.transport.Transport.serviceCall(
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(
        at sun.rmi.transport.tcp.TCPTransport$
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
        at java.util.concurrent.ThreadPoolExecutor$

I see the type (class) of the Exception - RuntimeException (the exception I threw).

I see that very professional message (Boooo!)

I see that the exception happened within a Do step (c.c.wfframework.steps.core.StepDo.execute) evaluating the value of an expression.

Okay, now let's take a look what e.getMessage() gives me. I changed the code block to this:

{ try { throw new RuntimeException("Boooo!"); } catch (Exception e) { s = e.getMessage(); } }

s being a simple String variable, of course. 

Now when debugging the script, the value of s became "Boooo!". That's it. I don't know anything about the exception itself. I can see only the error message the programmer decided to give to me. Which is, between us, not helpful at all.


New Member

Gergely, Thank you for taking



Thank you for taking the time to explain this to me.  I did happen to change the code back to it's original state and now that I know which log to watch I should have no issues in the future.



CreatePlease login to create content