To customize your arch.wsdl file for
a C# environment, import a web reference into your project. This builds
the object that is required to interface with the Data Management
Server.
////////////////////////////////////////////////////////
// Imports
////////////////////////////////////////////////////////
// Add Web reference using the DataFlux supplied WSDL
////////////////////////////////////////////////////////
// INITIALIZATION
////////////////////////////////////////////////////////
DQISServer.DQISService mService= new DQISServer.DQISService();
mService.Url = "http://MYDISSERVER" + ":" + "PORT";
////////////////////////////////////////////////////////
// 1) Get Object List example
////////////////////////////////////////////////////////
string[] jobs;
jobs=mService.GetObjectList(DQISServer.ObjectType.ARCHSERVICE);
////////////////////////////////////////////////////////
// 2) Post Object example
////////////////////////////////////////////////////////
DQISServer.ObjectDefinition def = new DQISServer.ObjectDefinition();
def.objectName = "VerifyAddress.ddf";
def.objectType = DQISServer.ObjectType.ARCHSERVICE;
// Grab Bytes from a job file
byte[] data = new byte[short.MaxValue];
FileStream fs = File.Open(@"c:\Develop\SoapUser\VerifyAddress.ddf",
FileMode.Open, FileAccess.Read, FileShare.None);
fs.Read(data,0,data.Length);
DQISServer.SendPostObjectRequestType req= new
DQISServer.SendPostObjectRequestType();
req.@object = def;
req.data = data;
mService.PostObject(req);
////////////////////////////////////////////////////////
// 3) Delete Object
////////////////////////////////////////////////////////
DQISServer.SendDeleteObjectRequestType req = new
DQISServer.SendDeleteObjectRequestType();
DQISServer.ObjectDefinition def = new DQISServer.ObjectDefinition();
def.objectName = "VerifyAddress.ddf";
def.objectType = DQISServer.ObjectType.ARCHSERVICE;
req.job = def;
mService.DeleteObject(req);
////////////////////////////////////////////////////////
// 4) Get Data Service Params
////////////////////////////////////////////////////////
DQISServer.GetArchitectServiceParamResponseType resp;
DQISServer.SendArchitectServiceParamRequestType req;
req=new DQISServer.SendArchitectServiceParamRequestType();
req.serviceName="MYJOB";
resp=mService.GetArchitectServiceParams(req);
string val;
int i;
DQISServer.FieldType field;
// loop through this data
val = resp.inFldDefs[0].fieldName;
i = resp.inFldDefs[0].fieldLength;
field = resp.inFldDefs[0].fieldType;
val = resp.outFldDefs[0].fieldName;
i = resp.outFldDefs[0].fieldLength;
field = resp.outFldDefs[0].fieldType;
////////////////////////////////////////////////////////
// 5) Execute Data Service
////////////////////////////////////////////////////////
DQISServer.SendArchitectServiceRequestType req = new
DQISServer.SendArchitectServiceRequestType();
DQISServer.GetArchitectServiceResponseType resp;
////////////////////////////////////////////////////////
DQISServer.GetArchitectServiceParamResponseType respParam;
DQISServer.SendArchitectServiceParamRequestType reqParam;
reqParam=new DQISServer.SendArchitectServiceParamRequestType();
reqParam.serviceName="ServiceName";
respParam=mService.GetArchitectServiceParams(reqParam);
////////////////////////////////////////////////////////
DQISServer.FieldDefinition[] defs;
DQISServer.DataRow[] data_rows;
string[] row;
defs=new DQISServer.FieldDefinition[respParam.inFldDefs.Length];
for(int i=0; i < respParam.inFldDefs.Length; i++)
{
// Fill up the Field Definitions
defs[i] = new DQISServer.FieldDefinition();
defs[i].fieldName = respParam.inFldDefs[i].fieldName;
defs[i].fieldType = respParam.inFldDefs[i].fieldType;
defs[i].fieldLength = respParam.inFldDefs[i].fieldLength;
}
DataTable table = m_InputDataSet.Tables["Data"]; // externally provided data
// Fill up Data matching the definition
data_rows = new DQISServer.DataRow[Number of Rows];
for(int i=0;i < table.Rows.Count;i++)
{
System.Data.DataRow myRow = table.Rows[i];
row=new String[table.Columns.Count];
for(int c=0;c < table.Columns.Count;c++)
{
row[c] = myRow[c].ToString();
}
// Loop and create rows of data to send to the service
data_rows[i] = new DQISServer.DataRow();
data_rows[i].value = new string[table.Columns.Count];
data_rows[i].value = row;
}
req.serviceName = "ServiceName";
req.fieldDefinitions = defs;
req.dataRows = data_rows;
resp=mService.ExecuteArchitectService(req);
////////////////////////////////////////////////////////
// 6) Run Batch Job
////////////////////////////////////////////////////////
DQISServer.SendRunArchitectJobRequest req = new
DQISServer.SendRunArchitectJobRequest();
DQISServer.GetRunArchitectJobResponse resp;
DQISServer.ArchitectVarValueType[] varVal = new
DQISServer.ArchitectVarValueType[1];
varVal[0] = new DQISServer.ArchitectVarValueType();
varVal[0].varName = "TESTVAR";
varVal[0].varValue = "TESTVAL";
req.job = "JOB_NAME";
req.varValue = varVal;
resp = mService.RunArchitectJob(req);
string jobid = resp.jobId;
////////////////////////////////////////////////////////
// 7) Get Job Status
////////////////////////////////////////////////////////
DQISServer.SendJobStatusRequestType req = new
DQISServer.SendJobStatusRequestType();
DQISServer.JobStatusDefinition[] resp;
req.jobId = "";
resp = mService.GetJobStatus(req);
DQISServer.ObjectDefinition def = resp[0].job;
string jobid = resp[0].jobid;
string jobstatus = resp[0].status;
////////////////////////////////////////////////////////
// 8) Get Job Log
////////////////////////////////////////////////////////
DQISServer.SendJobLogRequestType req = new DQISServer.SendJobLogRequestType();
DQISServer.GetJobLogResponseType resp;
req.jobId = "SOMEJOBID";
resp = mService.GetJobLog(req);
string fileName = resp.fileName;
byte []data = resp.data;
////////////////////////////////////////////////////////
// 9) Terminate Job
////////////////////////////////////////////////////////
DQISServer.SendTerminateJobRequestType req = new
DQISServer.SendTerminateJobRequestType();
DQISServer.GetTerminateJobResponseType resp;
req.jobId = "SOMEJOBID";
resp = mService.TerminateJob(req);
string fileName = resp.status;
////////////////////////////////////////////////////////
// 10) Clear Log
////////////////////////////////////////////////////////
DQISServer.SendDeleteJobLogRequestType req = new
DQISServer.SendDeleteJobLogRequestType();
DQISServer.GetDeleteJobLogResponseType resp;
req.jobId = "SOMEJOBID";
resp = mService.DeleteJobLog(req);
string fileName = resp.status;