Getting Query Execution Result

Below is the example of using the GetDbCommand operation to get a data set obtained on executing the Query repository object. The request contains moniker of opened object instance and the pattern indicating whether to get the output data set. The response contains requested information.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetDbCommand xmlns="http://www.fsight.ru/PP.SOM.Som">
<tDbCommand xmlns="">
  <id>S1!M!S!M1</id>
  </tDbCommand>
<tArg xmlns="">
<pattern>
  <obInst>true</obInst>
  <rows>true</rows>
  </pattern>
  </tArg>
  </GetDbCommand>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetDbCommandResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>S1!M!S!M1</id>
  </id>
<meta xmlns="">
<obInst>
<obDesc ds="" isShortcut="0" isLink="0" ver="8" hf="0">
  <i>T_QUERY</i>
  <n>Query</n>
  <k>9051</k>
  <c>770</c>
  <p>9050</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <isPermanent>1</isPermanent>
  <isTemp>0</isTemp>
  </obDesc>
  </obInst>
  <dirty>0</dirty>
  <type>Query</type>
<rows>
<its>
<r>
  <it>RU</it>
  <it>Russia</it>
  <it>143666931</it>
  <it>17125187</it>
  <it>Russian ruble (RUB)</it>
  </r>
<r>
  <it>US</it>
  <it>United States of America</it>
  <it>320194478</it>
  <it>9519431</it>
  <it>United States dollar ($) (USD)</it>
  </r>
  </its>
  </rows>
  </meta>
  </GetDbCommandResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetDbCommand" :
{
"tDbCommand" :
{
"id" : "S1!M!S!M1"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"rows" : "true"
}
}
}
}

JSON response:

{
"GetDbCommandResult" :
{
"id" :
{
"id" : "S1!M!S!M1"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "8",
"@hf" : "0",
"i" : "T_QUERY",
"n" : "Query",
"k" : "9051",
"c" : "770",
"p" : "9050",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "0",
"type" : "Query",
"rows" :
{
"its" :
{
"r" :
[
{
"it" :
[
"RU",
"Russia",
"143666931",
"17125187",
"Russian ruble (RUB)"
]
},
{
"it" :
[
"US",
"United States of America",
"320194478",
"9519431",
"United States dollar ($) (USD)"
]
}
]
}
}
}
}
}
public static GetDbCommandResult GetQueryResult(DbCommandId moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tGet = new GetDbCommand()
{
tArg = new GetDbCommandArg()
{
pattern = new DbCommandMdPattern()
{
rows = true
}
},
tDbCommand = moniker
};
//Get data
var tResult = somClient.GetDbCommand(tGet);
return tResult;
}

See also:

GetDbCommand