5 th cwgm, 07.07.2009, a. werner-1- data access webservice for w7-as s. jakob, t. bluhm, a. werner
TRANSCRIPT
5th CWGM , 07.07.2009, A. Werner -1-
Data Access WebServicefor W7-AS
S. Jakob , T. Bluhm, A. Werner
5th CWGM , 07.07.2009, A. Werner -2-
Services
WSDL only
Ready to use clients
Unified Data Access Interface
MDS+
MDS+ Service
MDS+
5th CWGM , 07.07.2009, A. Werner -3-
Services
WSDL only
Ready to use clients
Service Oriented Architecture(IBM‘s Redbook on SOA Foundation)
5th CWGM , 07.07.2009, A. Werner -4-
Services
WSDL only
Ready to use clients
WebService Technology
Running the client code:
Server Side User Side
Building the client code: WSDL file
Stub Compiler:WSDL -> Source Code
Compiler:Source Code -> Executable
Executable: Run
Service request: SOAP Message
Service response: SOAP Message
Server Function: Run
5th CWGM , 07.07.2009, A. Werner -5-
Services
WSDL only
Ready to use clients
Self Description: WebService Contract WSDL<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions name="w7x"
<wsdl:types><xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="CoilInfo"><xsd:sequence>
<xsd:element name="name" type="xsd:string"></xsd:element><xsd:element name="Units" type="xsd:string"></xsd:element><xsd:element name="minCurrent" type="xsd:double"></xsd:element><xsd:element name="maxCurrent" type="xsd:double"></xsd:element><xsd:element name="Windings" type="xsd:int"></xsd:element>
</xsd:sequence></xsd:complexType>...
</wsdl:types>
<wsdl:message name="getCoilDescriptionResponse"><wsdl:part name="parameters" element="tns:CoilDescription"></wsdl:part>
</wsdl:message>
<wsdl:portType name="FunctionsW7XPortType"><wsdl:operation name="getCoilDescription">
<wsdl:input message="tns:getCoilDescriptionRequest"></wsdl:input><wsdl:output message="tns:getCoilDescriptionResponse"></wsdl:output>
</wsdl:operation>...
</wsdl:portType>
<wsdl:binding name="FunctionsW7X" type="tns:FunctionsW7XPortType"><binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /><wsdl:operation name="getCoilDescription">
<wsdl:input> <soap:body use="literal" /> </wsdl:input><wsdl:output> <soap:body use="literal" /> </wsdl:output>
</wsdl:operation> ...
</wsdl:binding>
<wsdl:service name="PlainW7XService"><wsdl:port name="IppHgwPort" binding="tns:FunctionsW7X">
<soap:addresslocation="http://validator1.ipp-hgw.mpg.de:30000/ipp/w7x/mhd">
</soap:address></wsdl:port>
</wsdl:service>
</wsdl:definitions>
Data Types
Messages
Definitions
Operations
Protocol:typ. SOAP
Servicelocation
5th CWGM , 07.07.2009, A. Werner -6-
Services
WSDL only
Ready to use clients
Data Access
Generic scheme for data retrieval:
1. Data set is divided in time intervals with constant configuration W7-AS: shots2. These intervals are subdivided into time intervals with constant parameters segments, W7-AS: timer bursts3. Segments may be split into several data boxes W7-AS: only one data box per segment
5th CWGM , 07.07.2009, A. Werner -7-
Services
WSDL only
Ready to use clients
Client Programming (C#.NET)
client = new DataAccessClient.codac.DataAccessPortClient("UDAS");
DataAccessClient.codac.Reference w7asdb = client.open();
1. Add service reference(menu entry)
2. Retrieve WSDL
3. Generate stubs
4. Use stub functions
5th CWGM , 07.07.2009, A. Werner -8-
Services
WSDL only
Ready to use clients
Diagnostic/Module Selection
codac.ParameterSet[] selectors = new DataAccessClient.codac.ParameterSet[1];selectors[0] = new codac.ParameterSet();selectors[0].name = "dataset";
codac.Parameter[] parms = new DataAccessClient.codac.Parameter[3];
parms[0] = new codac.Parameter();parms[0].name = "diagnostic";parms[0].value = "BDOK";
parms[1] = new codac.Parameter();parms[1].name = "module";parms[1].value = "MIR-354";
parms[2] = new codac.Parameter();parms[2].name = "channels";parms[2].value = "1,3";
selectors[0].parameter = parms;
client.select(w7asdb, selectors);
5th CWGM , 07.07.2009, A. Werner -9-
Services
WSDL only
Ready to use clients
Time/Shot Selection & Data Retrieval
long from = client.tagToInterval("56358");long to = from + (long)1e9;
DataAccessClient.codac.ConfigurationInterval[] shots = client.getConfigurationIntervals(w7asdb, from, to);
foreach (codac.ConfigurationInterval shot in shots){
DataAccessClient.codac.SegmentInterval[] segments = client.getSegmentIntervals(w7asdb, shot.ID, 0);
foreach (codac.SegmentInterval segment in segments) {
for (int i = 0; i < segment.nslices; i++) {
DataAccessClient.codac.TimeBasedData data = client.accessData(w7asdb, i, shot.ID, segment.ID, selectors[0],true); System.Console.WriteLine("Data length = " + data.data.Length);
}
}
}
client.close(w7asdb); Important, only 5 services running simultaneously!
5th CWGM , 07.07.2009, A. Werner -10-
Services
WSDL only
Ready to use clients
Structure of TimeBasedData
public partial class TimeBasedData {
public byte[] timestamps;public byte[] data;public string[] channelunit;public string[] channelname;
public DataDescriptor dataDescriptor; }
public partial class DataDescriptor {
public bool littleEndian;public int[] dimension;public DataDescriptorBaseType baseType;
public int baseTypeSize;}
Time vector(to be converted from byte to int64)
Data vectors
Units are empty for W7-AS
Names are just channel numbers
Endianess, on standard PCno conversion required
Dimensions: number of samples number of channels
Base type of data to be converted to(double, short, …) W7-AS uses double
Size of base typeByte array to double array conversionto be coded individually!
5th CWGM , 07.07.2009, A. Werner -11-
Services
WSDL only
Ready to use clients
MatLab and IDL via Java
MatLab
%% -------------------------- Define imports -------------------------------import de.mpg.ipp.codac.services.commondataaccess.client.*;import de.mpg.ipp.codac.services.commondataaccess.client.selector.*;import de.mpg.ipp.codac.services.datatypes.*;import de.mpg.ipp.codac.util.converter.NanoTime;
%% ---------- Initialisation of the webservice connection ------------------service = DataAccess('UDAS');service.open;
…
Example before has been built using the WSDL solely
Java client is available for direct use in Java codes,MatLab and IDL
5th CWGM , 07.07.2009, A. Werner -12-
Services
WSDL only
Ready to use clients
Status
• Generic WS interface works now for W7-X, W7-AS and NetCDF
• Interface to MDS+ is under development
• Service is running with acceptable transfer rates: > 4 MB/s
• It is not accessible from outside yet
Plans
• Server setup + help pages in DMZ within 1-2 months
• For access please send an email to [email protected] with IP addresses or subnets for firewall configuration
• The requestor will be registered as the responsible contact person
• Any publications that use W7-AS data have to be agreed by IPP