Databases Reference
In-Depth Information
Defining a schema for our wrapper elements
When defining an XML Schema for our wrapper elements, we need to import the
relevant parts of our canonical model, and for each imported schema, define its
namespace and corresponding prefix.
For example, we have defined our wrapper elements for the
OrderFulfillment
service in the schema
OrderFulfillmentEBM.xsd
. This imports the
Order.xsd
schema, defined in the namespace '
http://rubiconred.com/obay/xsd/order
',
as highlighted in the following code:
<xsd:schemaxmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://rubiconred.com/obay/ebm/OrderFulfillment"
xmlns="http://rubiconred.com/obay/ebm/OrderFulfillment"
xmlns:ord="http://rubiconred.com/obay/xsd/order"
elementFormDefault="qualified">
<xsd:import namespace="http://rubiconred.com/obay/xsd/order"
schemaLocation="Order_v1_0.xsd" />
<!--WrapperElementsDefinedHere-->
</xsd:schema>
Next, we can define our wrapper elements, so for the
setShippingInstruction
operation within the
OrderFulfillment
service, we have defined the following:
<xsd:elementname="setShippingInstruction"
type="tSetShippingInstruction"/>
<xsd:elementname="setShippingInstructionResponse"
type="tSetShippingInstructionResponse"/>
<xsd:complexTypename="tSetShippingInstruction">
<xsd:sequence>
<xsd:elementref="ord:orderNo"/>
<xsd:elementref="ord:shippingDetail"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexTypename="tSetShippingInstructionResponse">
<xsd:sequence>
<xsd:elementref="ord:order"/>
</xsd:sequence>
</xsd:complexType>