Enterprise Web Services By Scott Wilson, CETIS
The IMS specification Public draft is out next week - if they fix some bugs we found! Final release of 1.0 in April
The Demonstration Kit Underway at moment - initial release due February Java library to simplify implementation of ES using Apache AXIS Simple application examples in JSP MS may create similar kit for .Net
Implementing Enterprise Services Service providers and consumers alike require: hooks into existing application layer or database SOAP handlers configured according to the Enterprise WSDL XML marshalling/unmarshalling to translate messages into objects for manipulation
Creating the SOAP handlers Implement a HTTP+SOAP server framework, such as a J2EE application server (with AXIS) or products from the .Net server family Provide the Enterprise service handlers: Use the library being developed by CETIS Generate code from the IMS Enterprise WSDL file using WSDL2Java utility or Visual Studio “Import Web Definition” feature Hand-code the handlers based on the WSDL or UML interface specification
Marshalling and unmarshalling XML Use the library being developed by CETIS Use the AXIS javabean mapping facility to automate Use JAXB Use the .Net framework automated C# mapping facility Write custom marshal/unmarshal methods using JDOM or similar
Using the library Implements all Enterprise interfaces, and handles conversion between Java and XML Reports all exceptions using IMS “statusInfo” codes
Lets look at some code!
Implementing consumers with scripting languages Languages like PHP, Python, and AppleScript have some simple SOAP or XML-RPC handling capabilities. Capabilities vary, and tend towards simple RPC support ASP can easily incorporate modules written in C# or Java using COM that can then handle web services JSP can easily incorporate modules written in Java, either called directly within Java or accessed by TagLibs. Possible to implement simple read-only clients very quickly
Extending Enterprise Services There are three main extension approaches: Extending the data models with additional property-value pairs Complex data model additions and modifications Providing additional methods
Adding properties to objects Each main class in the Enterprise bindings can have an extension object This contains an array of extField objects, which comprise a fieldName and a fieldValue attribute. This can be used to create basic extensions to the models without affecting marshalling/unmarshalling and service validation
<group> <sourcedId>bangor.ac.uk:10101</sourcedId> <description><descShort>CY1112</descShort></description> <groupType> <scheme>UK-HE</scheme> <typeValue><type>Module</type><level>2</level></typeValue> </groupType> <extension> <extField> <fieldName>LanguageOfInstruction</fieldName> <fieldValue>Welsh</fieldValue> </extField> </extension> </group>
Complex data model extensions Beyond adding a couple of properties Proprietary developments of enterprise models, typically for “value added” between partner systems
Complex data model extensions NOT supported as part of standard Enterprise Services To use a value-added data model, need to create a new interface that inherits from the IMS ES interfaces This interface should use a separate service binding if it overrides any methods Supporting a value-added interface does NOT qualify as being conformant!
Extending behaviours When you need to perform other operations with Enterprise objects New operations defined in separate interface May use the same service binding as the IMS interface
Limitations No querying functionality - yet No major revisions of data model