donderdag 8 oktober 2015

XML Schema Top level Element

When it comes to modelling XML schema's (also called XSD's) some good practices will help you to keep track of content in your library and how to (predictably) use it.
Modelling of your XSD's is related to Data Modelling and follows may of the rules defined there. How many XSD's will be in your library. What will each of them contain (to what level of detail), how are they related to each other (in terms of parent/child or master/slave)?
One characteristic is very important when it comes to the use of XSD's in a Service Oriented Architecture based on a WSDL approach. That is the necessity to differentiate between namespaces used for different kinds of XML messages. The XSD (containing the real object) should exist in a namespace that stands for the Message. The WSDL (containing the encapsulated object) should exist in a namespace that stands for the Service. An example of both forms could be "http://someurl/Object/Message/v1.0" versus "http://someurl/Object/Service/v1.0". Now, to achieve that in the WSDL both namespace are used properly one would rather reference the element that stands for the real object. This can only be achieved when there is a top level element defined and not only a type that stands for that element. A type forges the element in the WSDL to be created in the Service namespace and not in the Message namespace where it should exist.

So, besides type-definitions and maybe more element-definitions, create also an element-definition for the top-level-element!

Current date SF

OracleBlogs