Customize the WSDL File for Java

To customize arch.wsdl for Java, use a mapping tool, such as wscompile, to generate stubs and build classes that wrap the DataFlux Data Management Server interface. In the examples below, using wscompile, the WSDL file is imported and the stubs are generated using information from the WSDL file. To use a stub, it must be configured with the service endpoint or server address.
//////////////////////////////////////////////////////// 
// Imports 
//////////////////////////////////////////////////////// 
import arch.*; 
//////////////////////////////////////////////////////// 
// INITIALIZATION 
//////////////////////////////////////////////////////// 
ArchitectServicePortType_Stub stub; 
// get the stub 
stub =(ArchitectServicePortType_Stub)new 
DQISService_Impl()).getDQISService(); 
// optionally set to point to a different end point 
stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY, 
"http://MY_SERVER:PORT"); 
 
//////////////////////////////////////////////////////// 
// 1) Get Object List example 
//////////////////////////////////////////////////////// 
String[] res; 
res=stub.getObjectList(ObjectType.ARCHSERVICE); 
 
//////////////////////////////////////////////////////// 
// 2) Post Object example 
//////////////////////////////////////////////////////// 
byte[] myData; ObjectDefinition obj = new ObjectDefinition(); 
obj.setObjectName("NAME"); 
obj.setObjectType(ObjectType.fromString("ARCHSERVICE")); 
// read the job file in from the h/d 
myData = getBytesFromFile(new File(filename)); 
// post the job to the server 
String res=stub.postObject(obj, myData); 
 
//////////////////////////////////////////////////////// 
// 3) Delete Object 
//////////////////////////////////////////////////////// 
ObjectDefinition obj = new ObjectDefinition(); 
obj.setObjectName("MYJOB.ddf"); 
obj.setObjectType(ObjectType.fromString("ARCHSERVICE")); 
String res = stub.deleteObject(obj); 
 
//////////////////////////////////////////////////////// 
// 4) Get Data Service Params 
//////////////////////////////////////////////////////// 
GetArchitectServiceParamResponse resp; 
FieldDefinition[] defs; 
resp=stub.getArchitectServiceParams("MYJOB.ddf",""); 
// Get Definitions for Either Input or Output 
defs=resp.getInFldDefs(); 
defs=resp.getOutFldDefs(); 
//Loop through Defs 
defs[i].getFieldName(); 
defs[i].getFieldType(); 
defs[i].getFieldLength(); 
 
//////////////////////////////////////////////////////// 
// 5) Execute Data Service 
//////////////////////////////////////////////////////// 
FieldDefinition[] defs; 
DataRow[] rows; 
String[] row; 
GetArchitectServiceResponse resp; 
// Fill up the Field Definitions 
defs=new FieldDefinition[1]; 
defs[0] = new FieldDefinition(); 
defs[0].setFieldName("NAME"); 
defs[0].setFieldType(FieldType.STRING); 
defs[0].setFieldLength(15); 
// Fill up Data matching the definition 
rows = new DataRow[3]; 
row=new String[1]; 
row[0] ="Test Data"; 
 
rows[i] = new DataRow(); 
rows[i].setValue(row[0]); 
 
resp=stub.executeArchitectService("MYJOB.ddf", defs, rows, ""); 
// Get the Status, Output Fields and Data returned from the Execute Call 
String res = resp.getStatus(); 
defs=resp.getFieldDefinitions(); 
rows=resp.getDataRows(); 
// Output Field Definitions 
defs[i].getFieldName(); 
defs[i].getFieldType(); 
defs[i].getFieldLength(); 
// Output Data 
row=rows[i].getValue(); 
res=row[j]; 
 
//////////////////////////////////////////////////////// 
// 6) Run Batch Job 
//////////////////////////////////////////////////////// 
ArchitectVarValueType[] vals; 
vals=new ArchitectVarValueType[1]; 
vals[0]=new ArchitectVarValueType(); 
vals[0].setVarName("TESTVAR"); 
vals[0].setVarValue("TESTVAL"); 
// Returns JOBID 
String res=stub.runArchitectJob("MYJOB.ddf", vals, ""); 

//////////////////////////////////////////////////////// 
// 7) Get Job Status 
//////////////////////////////////////////////////////// 
JobStatusDefinition[] defs; 
// if you wanted the status for a single job, you would 
// pass the jobid returned from runArchitectJob or runProfileJob 
defs=stub.getJobStatus(""); 
 
ObjectDefinition obj; 
obj=defs[i].getJob(); 
defs[i].getJobid(); 
defs[i].getStatus(); 
obj.getObjectName() 
obj.getObjectType() 

//////////////////////////////////////////////////////// 
// 8) Get Job Log 
//////////////////////////////////////////////////////// 
GetJobLogResponseType resp; 
FileOutputStream fo; 
resp=stub.getJobLog(jobId,0); 
// write it to a file 
fo = new FileOutputStream (resp.getFileName()); 
fo.write(resp.getData()); 
fo.close(); 

//////////////////////////////////////////////////////// 
// 9) Terminate Job 
//////////////////////////////////////////////////////// 
String res=stub.terminateJob(jobId); 

//////////////////////////////////////////////////////// 
// 10) Clear Log 
//////////////////////////////////////////////////////// 
String res=stub.deleteJobLog(jobId); 
Last updated: June 16, 2017