Web Services

What is a Web Service?

A Web service is a platform independent way of exchanging information. The basics which make up a Web service XML (eXtensible Markup Language), HTTP (Hypertext Transfer Protocol) and SOAP (Simple Object Access Protocol).
Simply put, an XML message is sent over HTTP via SOAP where SOAP provides a message and envelope capability with XML being

the message and the envelope being the capabilities it should adhere to.

The fact that all communication is in XML means that they are not tied to any one language or system. The BDA Web Services provide the means to exchange/share and importantly, preserve BDA objects in the BDA model.

Babel Fish Example

Babel is language translation tool provided by Yahoo. It has the ability to translate from one language to another. This is done using a Web service which is embedded into the users browser (and therefore the user doesn’t see any of the actions the Web service undertakes).

Having pasted in some text to be translated the translate button can be hit. Code within the page submits a web services call with the text and the chosen translation as the “payload”. The Web Services call returns text as a similar “payload”; both payloads are encoded as XML.

../../../_images/babelfish.png

Yahoo Babelfish

A key difference between Babelfish and the Web Services being developed for CRESCENDO is that Babelfish does not remember the data that has been translated where as the Web services for CRESCENDO does.

Services for CRESCENDO

Yes, there is a WSDL(Web Service Definition Language) for the current BDA Web Services which can be found at the link provided below:

  • BDA Services

Unlike Babelfish, we need more complex XML schemas which are defined as a separate file; these can be found at the above URL.

WSDLs are not design to be especially human friendly to read but they are lots of developer tools that will understand it and make it easy to call the specified services.

Clients and Servers

The software calling the services is called the client were as the software receiving the service and doing what it promises is called the server. Many clients may make a call to the server whilst the same services may also be available on a number of different servers. These calls from client to server are usually performed over the internet.

../../../_images/clienttoserver.jpg

Client to server interactions

This is a ‘request-response’ style of message which Babelfish performs each time the user wishes to make a translation. Something that is important to note and is a key difference between Babelfish and the BDA Web Services is that the Babelfish server does not remember the strings it translates.

BDA Web Services

../../../_images/clienttoserverexample.jpg

Client to server interaction example

The above image illustrates a typical scenario of multiple clients accessing a server and manipulating the same piece of data. Firstly, client 1 adds some information to the server and receives feedback stating whether it has been added successfully or not. At this point client 2 is able to query the server for the item that has been added by client 1 and receives the servers identifier for the item (this is assuming the information was successfully added). Lastly, client 2 then adds more information to the server relating to the item that was uploaded by client 1.

Note

IMPORTANT: The server remembers these actions and is ready for the next client!

The BDA Object Model

The BDA Object Model describes the meta-data and allowed connectivity between modelling & simulation objects. This section will focus on the objects associated with simulations; the BDA Object Model is characterised by a heirachy as seen below:

  • Aircraft Programme
  • Study
  • Associative Model Network
  • Model Instances
  • Key Value Instances
  • Model Types and Key Value Types (... With more to come)
  • There can be many tracing relationships between these objects

At the end of a study we expect to have a collection of interrelated BDA objects. A collection of such objects under an Aircraft Programme will comprise a Behavioural Digital Aircraft.

Model-Based Interoperability

  • The BDA model provides the ‘language’ of collaboration.
  • Web Services and the Collaborative Hub provide the means to communicate.
  • The BDA Web Services provide the means to exchange and/or share and preserve the BDA Objects
  • The BDA Web Services strongly reflect the BDA Object Model.
  • There is a WSDL document declaring the services against Share-A-Space; the BDA Collaborative Hub.

For M26 a subset of BDA Services has been implemented. It is our intention to extend the scope of these services for the final demonstration.

../../../_images/construction.png

Page currently under construction

../../../_images/collaborativehub.jpg

The Collaborative Hub

../../../_images/shareaspace.jpg

Share-A-Space BDA Overview

Java Test Client

The Java clients mentioned in this section can be found on the CRESCENDO Collaborative Workspace where a number of self contained executable classes that can be used to Register, Read and Update various BDA Objects.

../../../_images/javatestclient.jpg

Java Test Client

TestCommon.java acts as a utility class which contains the common methods needed for any client, for example:

  • initStub(): Set the end point of the Web Services.
  • login(): Login to the server.
  • logout(): Logout of the server
  • search(): Search for a BDA Object Reference.
  • registerXXX(): Register a BDA Object.

Each of the test clients listed extend the TestCommon class so that they can re-use its methods. Some of the functions that can be used are Register, Read, Update and Search.

What do they mean?

  • Register: Create a BDA Object on the BDA Collaborative Hub when using the Web Services this will return you an object reference.
  • Read: Given an object reference the read method will load the attribute of that object (ID, name, description, relationship types)
  • Update: Update a BDA object - the stauts of an Associative Model Network or ModelInstance for example.
  • Search: The search feature of the BDA Web Services will return one or more object references. It is possible to search by the ID, name, description or the type of BDA Object.

When a new object is registered there are two possibilities:

I have one of these in my system and I want to tell others about it.

  • I add it to the Collaborative Hub
  • I may then attach more data to it.

I know you will be creating of these in your system and you will be telling me about it and may attach more data in due course.

  • So I register it so I know where you will attach more data.
  • It may or may not exist in your system when I register it.

Both of these are valid.

In order to use the BDA Web Services you need to log into the BDACollaboration Hub.

  • If you haven’t got a login to the Collaboration Hub you can request one by email.
  • You will need to add your username and password to the login method in TestCommon.java
../../../_images/testcommon.jpg

TestCommon.java

Once you have logged in you will receive an authentication header from the server.

  • This is used to authenticate your session and is passed as an input parameter to nearly all of the test client methods.
  • All of the example clients will call login() routine at some point.

A simple client that require no modification is TestGetMyNotifications.java. Running this will check for notifications on the server.

../../../_images/testgetmynotifications.jpg

TestGetMyNotifications.java

How To Attach Results To Documents

Results documents are attached to ModelInstances. In this example we will register a new model instance with some results documents.

../../../_images/resultstodocument.jpg

Adding results to a document

The following has been highlighted in the image above:

  • Register a document.
  • Upload a digital filed to the document.
  • Register Model Instance and provide the pointer to the document

Conclusions

  • Web Services are a natural way to fit for working with the BDA Object Model.

  • Yes, you need some software to use them but it is:
    • Established technology.

    • Supported by tools.

    • Examples are available to copy.

    • Language independent.

    • The vendors are all familiar with calling application programming interfaces (APIs) from software
      • In this case the API is across the network and accesses a data set rather than a program.
  • A BDA Web Services allow the creation of a BDA

  • The BDA Web Services can be implemented against any suitable repository as a server - it is NOT restricted to Share-A-Space.

References

For a username and password email:

Judith Crockford

The WSDL and XSD definitions are located on the Eurostep server which includes a viewer for the BDA Services. An example client can be found on the CRESCENDO Collaborative Workspace.