ClassMethod OnPage() As %Status [ ServerOnly = 1 ]
    //just the query string...
    set qs=%request.CgiEnvs("QUERY_STRING")
    //SOLUTION 1: $piece only
    set externalCenterCode=$p(qs,":")	
    set startDateRange=$p($p(qs,":authoredOn=le",2),":")
    set endDataRange=$p($p(qs,":authoredOn=ge",2),":")

    //SOLUTION 2: generic solution if params grow	
    for i=1:1:$l(qs,":") {
        set nvp=$p(qs,":",i),name=$p(nvp,"=",1),value=$p(nvp,"=",2)
        //fix the quirks
        if value="" set value="name",name="ecc"
        if name="authoredOn" set name=$e(value,1,2),value=$e(value,3,*)
        set params(name)=value

    //SOLUTION 3: regex(ish) solution
    set code=$p(qs,":")
    set loc=$locate(qs,"le\d{4}-\d{2}-\d{2}")
    set start=$e(qs,loc+2,loc+11)
    set loc=$locate(qs,"ge\d{4}-\d{2}-\d{2}")
    set end=$e(qs,loc+2,loc+11)

    //some helper code to dump the variables into the CSP page
    write !,"<pre>"
    //use this to take a good look at the request object...
    zwrite %request
    write !,"</pre>"
    quit $$$OK

Here are three solutions and a couple of inline tips, including your request for regex example

I wouldn't worry too much about using $piece, its very common to use it in this way

Eduards comment above also has a fourth suggestion to use $lfs (list from string) which is also commonly used as a way of piecing out data

I think you might have missed my point about the adapter being non standard.

E.g. what if the adapter has code like this...

Method OnTask() As %Status
    //Set tSC = ..BusinessHost.ProcessInput($$$NULLOREF)
    Set tSC = ..BusinessHost.General($$$NULLOREF)
    Set ..BusinessHost.%WaitForNextCallInterval=1
    Quit tSC

The normal sequence of

OnTask() → ProcessInput() → OnProcessInput()


OnTask() → General()

Of course this then raises the question, how does the interval then work as it would most likely only run once.

Main point is to check if the adapter has hard wired it in directly. It's the only logical explanation outside of this being an observer error.

The solution is to add the parameter STUDIO=1


Hi Scott,

My understanding is that search table classes are maintained in Ens.DocClassMap. When you do a purge the Ens.MessageHeader appears to have the responsibility for calling RemoveSearchTableEntries() on the Ens.SearchTableBase which uses indirection to call RemoveIndex() on the class name maintained in the DocClassMap.

The docs briefly mention DocClassMap...

The Ensemble classes use this class to remove search table entries when message bodies are deleted.

Short answer, purges will automatically include new search tables even if you scheduled the purge before creating the search table.

Hi Kurro,

Some random suggestions without being able to see the implementation details...

1. Enable the SOAP log and compare the request and response headers to SOAP UI to see what is different

2. Does changing the SOAP version make any difference

3. The error is probably raised in this block of code, might be worth working backwards from there, its at the end of DoSOAPRequest in %SOAP.WebClient

    Set responseContentType=$zcvt($piece(response.ContentType,";",1),"L")
    If ..SoapBinary {
        If (responseContentType'="application/octet-stream") Quit $$$ERROR($$$SOAPUnexpectedType,response.ContentType)
    } Else {
        If (responseContentType'="text/xml") && 
           (responseContentType'="application/soap+xml") &&
           (responseContentType'="multipart/related") {
            Quit $$$ERROR($$$SOAPUnexpectedType,response.ContentType)

4. If your running out of ideas then maybe reinstall / restart the server code (is it .NET by any chance)?

>  this is a very serious that I can't wait to resolve... 

Hi Thomas, if this is serious then you should raise a WRC with InterSystems.

It depends what you really need.


There are existing global flags that are available through various classes. For instance SystemMode() will provide system wide constants for Live, Test and Dev...

The SystemMode() is admin configured via the Memory and Startup screen on the management portal.


For some global settings, particularly business related, it would be good practice to use lookup tables and not a global...


Also, if you are not aware of them yet, you should take a look at creating your own Ens util functions which are automatically inherited into routers and DTL's and provide a good place to stash various levels of global and business value / logic...