Click or drag to resize
XmlIntegrationService

[This is preliminary documentation and is subject to change.]

The XmlIntegrationService web service contains web methods that can be used for retrieving XML formatted data and the corresponding XML schemas from a specific TOPICA configuration. Data can be retrieved from both the dynamically defined data structures as well as the static TOPICA data structures.

GetXmlSchema method

Given an array of record keys the GetXmlSchema method returns an XML schema that defines the layout of the XML data that will be returned from the GetXmlDocument method given the same array of record keys.

C#
public string GetXmlSchema(string config, Guid sessionGuid, RecordKey[] recordKeys)
GetXmlDocument method

Given an array of record keys the GetXmlDocument method returns an XML document with data from the specified rows and tables.

C#
public XmlDocument GetXmlDocument(string config, Guid sessionGuid, RecordKey[] recordKeys)
GetXmlDocumentTransformed method

Given an array of record keys the GetXmlDocumentTransformed method returns an XML document. But instead of returning XML in the internal format this method transforms the internal XML to an external format using the XSLT transformation defined by the transformation key.

C#
public XmlDocument GetXmlDocumentTransformed(string config, Guid sessionGuid, RecordKey[] recordKeys, string transformationKeyName)
GetXmlDocumentTransformedAndValidated method

The GetXmlDocumentTransformedAndValidated method works the same as GetXmlDocumentTransformed except it only returns a document if the XML that is transformed to can be validated using a specified XML schema.

C#
public XmlDocument GetXmlDocumentTransformedAndValidated(string config, Guid sessionGuid, RecordKey[] recordKeys, string transformationKeyName)
Using XmlIntegrationService web service - GetXmlSchema method

This example demonstrates retrieving an xml schema describing the data structure of the xml that will retunred by GetXmlDocument for the given record keys.

C#
// GetXmlSchema method example

string config = "Test";                            // name of configuration
string domain = "";                                // domain for the user we login with
string username = "test";                        // username for the user we login with
string password = "secret";                        // password for the user we login with

//first we login with a user that has permissions to use the XmlIntegrationService web service
LoginService loginService = new LoginService();
LogOnInfo logOnInfo = loginService.LogInPlainPassword(config, domain, username, password, false);

var service = new XmlIntegrationService();
var recordKeys = new List<RecordKey>();

recordKeys.Add(new RecordKey { RecordId = -1, TableName = "PatientExtraInfo", TableAlias = "PATIENT" });
recordKeys.Add(new RecordKey { RecordId = -1, TableName = "ClassificationCurrent", TableAlias = "Diagnose" +i });
recordKeys.Add(new RecordKey { RecordId = -1, TableName = "OrgUnitCurrent", TableAlias = "Sender" });
recordKeys.Add(new RecordKey { RecordId = -1, TableName = "OrgUnitCurrent", TableAlias = "Receiver" });

var schema = service.GetXmlSchema(logOnInfo.ConfigName, logOnInfo.SessionGuid, recordKeys.ToArray());
Using XmlIntegrationService web service - GetXmlDocument method

This example demonstrates retrieving an xml document containing information about the given record keys.

C#
// GetXmlDocument method example

string config = "Test";                            // name of configuration
string domain = "";                                // domain for the user we login with
string username = "test";                        // username for the user we login with
string password = "secret";                        // password for the user we login with

//first we login with a user that has permissions to use the XmlIntegrationService web service
LoginService loginService = new LoginService();
LogOnInfo logOnInfo = loginService.LogInPlainPassword(config, domain, username, password, false);

var service = new XmlIntegrationService();
var recordKeys = new List<RecordKey>();

recordKeys.Add(new RecordKey { RecordId = -1, TableName = "PatientExtraInfo", TableAlias = "PATIENT" });
recordKeys.Add(new RecordKey { RecordId = -1, TableName = "ClassificationCurrent", TableAlias = "Diagnose" +i });
recordKeys.Add(new RecordKey { RecordId = -1, TableName = "OrgUnitCurrent", TableAlias = "Sender" });
recordKeys.Add(new RecordKey { RecordId = -1, TableName = "OrgUnitCurrent", TableAlias = "Receiver" });

var document = service.GetXmlDocument(logOnInfo.ConfigName, logOnInfo.SessionGuid, recordKeys.ToArray());
Using XmlIntegrationService web service - GetXmlDocumentTransformed method

This example demonstrates retrieving an xml document containing information about the given record keys. The XML document is transformed using a XSLT transformation defined by the transformation key.

C#
// GetXmlDocumentTransformed method example

//first we login with a user that has permissions to use the XmlIntegrationService web service
LoginService loginService = new LoginService();
LogOnInfo logOnInfo = loginService.LogInPlainPassword(config, domain, username, password, false);

var service = new XmlIntegrationService();
var recordKeys = new List<RecordKey>();

// add data to xml document from...
// ...row 1 from the PatientExtraInfo view will be retrieved in an XML element called PATIENT
recordKeys.Add(new RecordKey { RecordId = 1, TableName = "PatientExtraInfo", TableAlias = "PATIENT" });
// ...row 2 from the ClassificationCurrent view will be retrieved in an XML element called Diagnose
recordKeys.Add(new RecordKey { RecordId = 2, TableName = "ClassificationCurrent", TableAlias = "Diagnose" });
// ...row 10101 from the OrgUnitCurrent view will be retrieved in an XML element called Sender
recordKeys.Add(new RecordKey { RecordId = 10101, TableName = "OrgUnitCurrent", TableAlias = "Sender" });
// ...row 10102 from the OrgUnitCurrent view will be retrieved in an XML element called Receiver
recordKeys.Add(new RecordKey { RecordId = 10102, TableName = "OrgUnitCurrent", TableAlias = "Receiver" });

string transformationKey = "InternalToExternal";
var document = service.GetXmlDocumentTransformed(logOnInfo.ConfigName, logOnInfo.SessionGuid, recordKeys.ToArray(), transformationKey);