Presentation is loading. Please wait.

Presentation is loading. Please wait.

5 th CWGM, 07.07.2009, A. Werner-1- Data Access WebService for W7-AS S. Jakob, T. Bluhm, A. Werner.

Similar presentations


Presentation on theme: "5 th CWGM, 07.07.2009, A. Werner-1- Data Access WebService for W7-AS S. Jakob, T. Bluhm, A. Werner."— Presentation transcript:

1 5 th CWGM, , A. Werner-1- Data Access WebService for W7-AS S. Jakob, T. Bluhm, A. Werner

2 5 th CWGM, , A. Werner-2- Services WSDL only WSDL only Ready to use clients Unified Data Access Interface MDS+ MDS+ Service MDS+

3 5 th CWGM, , A. Werner-3- Services WSDL only WSDL only Ready to use clients Service Oriented Architecture (IBMs Redbook on SOA Foundation)

4 5 th CWGM, , A. Werner-4- Services WSDL only WSDL only Ready to use clients WebService Technology Running the client code: Server SideUser 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

5 5 th CWGM, , A. Werner-5- Services WSDL only WSDL only Ready to use clients Self Description: WebService Contract WSDL Data Types Messages Definitions Operations Protocol: typ. SOAP Servicelocation

6 5 th CWGM, , A. Werner-6- Services WSDL only 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: shots 2. These intervals are subdivided into time intervals with constant parameters segments, W7-AS: timer bursts 3. Segments may be split into several data boxes W7-AS: only one data box per segment

7 5 th CWGM, , A. Werner-7- Services WSDL only WSDL only Ready to use clients Client Programming (C#.NET) client = new DataAccessClient.codac.DataAccessPortClient("UDAS"); DataAccessClient.codac.Reference w7asdb = client.open(); 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

8 5 th CWGM, , A. Werner-8- Services WSDL only 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); 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);

9 5 th CWGM, , A. Werner-9- Services WSDL only 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); 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!

10 5 th CWGM, , A. Werner-10- Services WSDL only 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 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; } 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 PC no 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 type Byte array to double array conversion to be coded individually!

11 5 th CWGM, , A. Werner-11- Services WSDL only 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; … 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

12 5 th CWGM, , A. Werner-12- Services WSDL only 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 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 to with IP addresses or subnets for firewall The requestor will be registered as the responsible contact person Any publications that use W7-AS data have to be agreed by IPP Plans Server setup + help pages in DMZ within 1-2 months For access please send an to with IP addresses or subnets for firewall The requestor will be registered as the responsible contact person Any publications that use W7-AS data have to be agreed by IPP


Download ppt "5 th CWGM, 07.07.2009, A. Werner-1- Data Access WebService for W7-AS S. Jakob, T. Bluhm, A. Werner."

Similar presentations


Ads by Google