SemanticLayerSourcesAdd

Syntax

ItKey SemanticLayerSourcesAdd(string mon, SemanticLayerSourcesAddArg tArg)

Parameters

mon. Moniker for working with data model sources.

tArg. Operation execution parameters.

Description

The SemanticLayerSourcesAdd operation adds a source to data model.

Comments

To execute the operation, in the mon field specify moniker of opened data model instance with the !Sources postfix. The moniker can be obtained on executing the OpenSemanticLayer operation. It is required to create a source based on template, specify template key in the tArg.itemKey field. One can also set DBMS connection parameters in the tArg.connectionParams field.

The operation results in the key of the created source.

Example

Below is the example of adding a source to data model. The request contains moniker for working with sources and source connection parameters. The response contains key of the created source.

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">
<SemanticLayerSourcesAdd xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns=" ">ECLILKDCBLBDGOAEDKMFIAIDMENFPGPEHLJFNFCLBKCMGDDH!M!S!PHNEOHMDCBLBDGOAECKLPNOCOILIKDEJEJKJAGADEKNADKACB!Sources</mon>
<tArg xmlns=" ">
<connectionParams>
  <user>User</user>
  <pass>Password</pass>
<logonDataExt>
  <driver>MSSQL2012ODBC</driver>
  <server>DBServer</server>
  <database>Repository</database>
  </logonDataExt>
  </connectionParams>
  </tArg>
  </SemanticLayerSourcesAdd>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SemanticLayerSourcesAddResult 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">
  <k xmlns=" ">1</k>
  </SemanticLayerSourcesAddResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
 "SemanticLayerSourcesAdd" :
  {
   "mon" : "ECLILKDCBLBDGOAEDKMFIAIDMENFPGPEHLJFNFCLBKCMGDDH!M!S!PHNEOHMDCBLBDGOAECKLPNOCOILIKDEJEJKJAGADEKNADKACB!Sources",
   "tArg" :
    {
     "connectionParams" :
      {
       "user" : "User",
       "pass" : "Password",
       "logonDataExt" :
        {
         "driver" : "MSSQL2012ODBC",
         "server" : "DBServer",
         "database" : "Repository"
        }
      }
    }
  }
}

JSON response:

{
 "SemanticLayerSourcesAddResult" :
  {
   "k" : "1"
  }
}
public static ItKey SemanticLayerSourcesAdd(string moniker)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tAdd = new SemanticLayerSourcesAdd()
{
tArg = new SemanticLayerSourcesAddArg()
{
connectionParams = new ConnectionParams()
{
logonDataExt = new MbLogonDataExt()
{
database = "p7repository",
driver = "MSSQL2012ODBC",
server = "v-nrspo-mssql.dev.fs.fsight.world"
},
user = "sa",
pass = "Qwerty1"
}
},
// Moniker of opened data model instance
mon = moniker + "!Sources"
};
// Add source to data model
var result = somClient.SemanticLayerSourcesAdd(tAdd);
return result;
}

See also:

Working with Data Models