Tom Philippi · May 18, 2017

ERROR #5002: Cache error in Ensemble Soap Service

I am getting an ERROR #5002 in a soap service defined in ensemble. Odd thing is that I allready have a functioning business service running as a soap service, but we needed another, but that one returns an error:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:xsi="" xmlns:s="">
         <faultstring>Server Application Error</faultstring>
            <error xmlns="">
               <text>ERROR #5002: Cache error: &lt;UNDEFINED>zTestOperation+1^Test.WebService.1 *sc</text>

This is the class I defined and added to my ensemble production:

Class Test.WebService Extends EnsLib.SOAP.Service

Parameter ADAPTER;

Parameter SERVICENAME = "TestWebService";

Parameter LOCATION = "";

Parameter NAMESPACE = "";

Method TestOperation(data As %String) [ WebMethod ]
    if $$$ISERR(sc) do ..ReturnMethodStatusFault(sc)


Where should I look to resolve this?

I am running ensemble 2016.2

4 0 3 2,770
Log in or sign up to continue


Hi Tom,

The clue is in the error message...

 <text>ERROR #5002: Cache error: &lt;UNDEFINED>zTestOperation+1^Test.WebService.1 *sc</text>

You have an undefined variable, and its name is sc, denoted by the *

If you look at your code...

if $$$ISERR(scdo ..ReturnMethodStatusFault(sc)

You can see that you are checking the value of sc which has not yet been set.


Looks like you've copied some example from the documentation. But removed some by your opinion not needed lines.

Original code looked like:

    //create Ensemble request message with given ID
    set request=##class(ESOAP.CustomerRequest).%New()
    set request.CustomerID=ID

    //send Ensemble request message 
    set sc= ..SendRequestSync("GetCustomerInfoBO",request,.response)
    if $$$ISERR(sc) do ..ReturnMethodStatusFault(sc)

You left only the last line. Where checked result from the previous one, in variable sc, as this variable is not defined in your code you got this error in SOAP

<UNDEFINED>zTestOperation+1^Test.WebService.1 *sc

Ow that's pretty stupid smiley

Thanks for the quick feedback!