Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
22.2. Adding data units to a contract
Depending on how you choose to create your WSDL contract, creating new data definitions requires varying amounts of knowledge. The Apache CXF GUI tools provide a number of aids for describing data types using XML Schema. Other XML editors offer different levels of assistance. Regardless of the editor you choose, it is a good idea to have some knowledge about what the resulting contract should look like.
Procedure Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
Defining the data used in a WSDL contract involves the following steps:
- Determine all the data units used in the interface described by the contract.
- Create a
typeselement in your contract. - Create a
schemaelement, shown in Example 22.1, “Schema entry for a WSDL contract”, as a child of thetypeelement.ThetargetNamespaceattribute specifies the namespace under which new data types are defined. The remaining entries should not be changed.Example 22.1. Schema entry for a WSDL contract
<schema targetNamespace="http://schemas.iona.com/bank.idl" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> - For each complex type that is a collection of elements, define the data type using a
complexTypeelement. See Section 22.4.1, “Defining data structures”. - For each array, define the data type using a
complexTypeelement. See Section 22.4.2, “Defining arrays”. - For each complex type that is derived from a simple type, define the data type using a
simpleTypeelement. See Section 22.4.4, “Defining types by restriction”. - For each enumerated type, define the data type using a
simpleTypeelement. See Section 22.4.5, “Defining enumerated types”. - For each element, define it using an
elementelement. See Section 22.5, “Defining elements”.