Developers Community

TM Forum Members Only
TM Forum Members Only
The full version of this page is only available to members of the TM Forum. Learn more about becoming a member.

In order to access a TM Forum Member only area of the website you must be a registered user and work for a TM Forum Member Company. If this applies to you please login above.

Not a Registered User? Register Now
Registration is free, quick and simple, and will give you access to a large library of TM Forum member content, industry documents, exclusive articles, commentaries, plus our web discussions and event features.

If you experience any problems logging in, please contact us.


RSS


Group Administrators
Group Experts
Highest ranked members of this group.
41018
Stephen Fratini
Telcordia Technologies
24112
Marc Flauw
Hewlett-Packard
19641
Nigel Davis
Ciena Corporation
18681
Dirk Rejahl
Mediaan/abs bv
18565
Johan Vandenberghe
Alcatel-Lucent
3090
Your Profile
TM Forum

Developer Network

Implementing the SOA OSS-J Inventory Web Service

Share |


This blog is for the developers of OSS TMF applications. It is for you the developers who understood all the specifications (well maybe…) and need to develop some real applications with real code ! This is a developer for developer blog. We will talk about the Java code, JAX-WS, XML , WSDL, JMS , the problems of using JAXB with polymorphism, the beauty of Spring and Hibernate and all the rest ! Please feel free to come up with questions , comments and critiques we will all learn from that.

We will start with a series of articles on the implementation of the Inventory Web Service. I will show you how to implement the Web Service stack on a simple information model. As we go I will also show you how the Inventory API is structured around a couple of OSS Design Patterns. Our first Inventory Web Service implementation will be EJB based and then we will migrate it to Spring.

You will need a basic knowledge of the OSS-J Inventory API, XMLSchema, WSDL and JAX-WS. You will also need NetBeans, an XML Editor of your choice and soapUI (a Web Services Testing tool). The Inventory API specification is available from the TMF OSS-J site.

If you’re not familiar with XML Schema I suggest you read Wrox BeginningXML, 4th Edition. Also the XML Schema Element and Attribute Reference available for free from their site. And for programming JAX-WS the best book for me is SOA Using Java Web Services (this is what I use in my training classes ).

The first thing to know is that the OSS-J Inventory API is information model agnostic. What does that mean? It means that the API is not bound to a particular data model. It does mean that the API MUST be used in a polymorphic way. You have to supply a concrete information model and bind it to the hooks that exist in the API. Polymorphism means that the same basic entity may take multiple forms and the OO software can deal with that. From a Java perspective we use inheritance from a base class and from an XML Schema perspective we extend from a base type by using the complexContent construct. This way the operations relative to the base class can be performed on the extended entities.

Let's define a simple inventory data model. We will do that directly in XML Schema. Keep in mind we’re using a top down approach so we won’t start from Java we start from XML and WSDL. There are very good reasons why SOA architectures should always start from XML and WSDL but that’s anotherdiscussion. For this week blog will start by defining the XML schemas for two very simple data model entities (later on we will use a more sophisticated SID compliant IP-VPN model thanks to John Reilly!).

Our minimal data model will only contain two entity types. They are part of our resource model (no associations or specifications or events for this week!). We will name the two entities: Equipment and PhysicalTerminationPoint. Also we will need something to identify our entities. In OSS-J this identifier is named a key. Keep in mind that this is not a database key ! The Inventory API uses a polymorphic primary key to address the issue of having multiple vendor entity identification mechanisms. Our primary key is named InfoModelEntityPrimaryKey.

Let’s define our Entities and Key in XMLSchema


<schema xmlns:inv="http://osswave.com/xml/inv/v1-5"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:cberes="http://ossj.org/xml/Common-CBEResource/v1-5"
xmlns:cbecore="http://ossj.org/xml/Common-CBECore/v1-5"
targetNamespace="http://osswave.com/xml/inv/v1-5" elementFormDefault="qualified"
attributeFormDefault="unqualified">

<import namespace="http://ossj.org/xml/Common-CBEResource/v1-5"
schemaLocation="http://ossj.org/xml/Common-CBEResource/v1-5/OSSJ-Common-CBEResource-v1-5.xsd"/>

<complexType name="Equipment">
<complexContent>
<extension base="cberes:ResourceValue">
<sequence>
<element name="equipmentType" type="string" minOccurs="0"/>
<element name="numberOnHand" type="int" minOccurs="0"/>
<element name="location" type="string" minOccurs="0"/>
</sequence>
</extension>
</complexContent>
</complexType>

<complexType name="PhysicalTerminationPoint">
<complexContent>
<extension base="cberes:ResourceValue">
<sequence>
<element name="userLabel" type="string" minOccurs="0"/>
<element name="additionalInformation" type="string" minOccurs="0"/>
<element name="location" type="string" minOccurs="0"/>
</sequence>
</extension>
</complexContent>
</complexType>

<complexType name="InfoModelEntityPrimaryKey">
<sequence>
<element name="primaryKey" type="string" minOccurs="0"/>
</sequence>
</complexType>

<element name="equipment" type="inv:Equipment"/>
<element name="ptp" type="inv:PhysicalTerminationPoint"/>
<element name="entityPrimaryKey" type="inv:InfoModelEntityPrimaryKey"/>
</schema>

That’s it for this week ! Next week I will show you how to build the Inventory Web Service with NetBeans and use the Entities and Keys in Inventory SOAP requests and replies.


Posted 02-21-2010 12:15 PM by Pierre Gauthier
We welcome your feedback! To comment on this blog post please either Log-In or Register to the TM Forum Community

Paid Advertisement
About TM Forum
Introduction, History, Board, Management Team...
Membership
How to Join, Benefits, Member List...
Community
Community Home, Groups & Teams, Blogs...
Conferences
Event Calendar, Management World, Supported Events...
Training & Webcasts
Upcoming Training Courses, Upcoming Webinars, Podcasts, On-Demand Webcasts...
Initiatives
Cable, Enabling Cloud Services, Government and Defense...
Best Practices & Standards
Frameworx, Business Process Framework (eTOM), Information Framework (SID)...
Resources
Document Library, Case Studies, White Papers
Research & Publications
Business Benchmarking, Newsletters, Insights Research...
Copyright © 1988-2012, TeleManagement Forum. All Rights Reserved
Contact Us
Careers with TM Forum
News Room
Privacy Policy
Terms of Use
Sitemap