Dashboard > WSO2 Commons > Home > Signature Model Structure for Different Schema Constructs
  WSO2 Commons Log in | Register   View a printable version of the current page.  
  Signature Model Structure for Different Schema Constructs
Added by Dimuthu Gamage , last edited by Dimuthu Gamage on Jul 28, 2008  (view change) show comment
Labels: 
(None)

For SVN revision: 15321

SimpleTypes

1. Element whose type is a standard schema type

Example:

Schema
            <xs:element name="myDemo" type="xs:int"/>

Corresponding SIG model
         <params>
               <param name="myDemo" token="#in" type="int"
                              type-namespace="http://www.w3.org/2001/XMLSchema"
                              simple="yes" targetNamespace="http://wso2.org/dyn/codegen/demo"/>
          </params>

2. Element whose original type is a derived type from a simple type will have all the facets listed under the corresponding param

Example1:

Schema

            <xs:element name="myDemo">
                <xs:simpleType>
                    <xs:restriction base="xs:int">
                        <xs:maxInclusive value="5"/>
                        <xs:minInclusive value="2"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>

or

            <xs:element name="myDemo" type="tns:derivedType"/>

            <xs:simpleType name="derivedType">
                <xs:restriction base="xs:int">
                    <xs:maxInclusive value="5"/>
                    <xs:minInclusive value="2"/>
                </xs:restriction>
            </xs:simpleType>

Corresponding SIG model

                    <params>
                        <param name="myDemo" token="#in" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" targetNamespace="http://wso2.org/dyn/codegen/demo" simple="yes">
                            <maxInclusive value="5"/>
                            <minInclusive value="2"/>
                        </param>
                    </params>

Example2:

            <!- demonstrating element->
            <xs:element name="myDemo" type="tns:derivedType1"/>

            <!- derivedType1->
            <xs:simpleType name="derivedType1">
                <xs:restriction base="tns:derivedType2">
                    <xs:maxLength value="3"/>
                    <xs:minLength value="2"/>
                </xs:restriction>
            </xs:simpleType>

            <!- derivedType2->
            <xs:simpleType name="derivedType2">
                <xs:restriction base="xs:string">
                    <xs:enumeration value="a"/>
                    <xs:enumeration value="ab"/>
                    <xs:enumeration value="abc"/>
                    <xs:enumeration value="abcd"/>
                </xs:restriction>
            </xs:simpleType>

Corresponding SIG model

                    <params>
                        <param name="myDemo" token="#in" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" targetNamespace="http://wso2.org/dyn/codegen/demo" simple="yes">
                            <enumeration value="a"/>
                            <enumeration value="ab"/>
                            <enumeration value="abc"/>
                            <enumeration value="abcd"/>
                            <maxLength value="3"/>
                            <minLength value="2"/>
                        </param>
                    </params>

3. Simple Type List are represented with the attribute list="yes"

Example1:

Schema

            <xs:element name="myDemo" type="tns:mylist"/>

            <xs:simpleType name="mylist">
                <xs:list itemType="xs:int"/>
            </xs:simpleType>

Corresponding SIG model

                    <params>
                        <param name="myDemo" token="#in" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" targetNamespace="http://wso2.org/dyn/codegen/demo" simple="yes" list="yes"/>
                    </params>

Example2:
            <xs:element name="myDemo" type="tns:mylist"/>

            <xs:simpleType name="mylist">
                <xs:list itemType="tns:derivedType"/>
            </xs:simpleType>

            <xs:simpleType name="derivedType">
                <xs:restriction base="xs:string">
                    <xs:maxLength value="3"/>
                    <xs:minLength value="2"/>
                </xs:restriction>
            </xs:simpleType>

Corresponding SIG model
                    <params>
                        <param name="myDemo" token="#in" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" targetNamespace="http://wso2.org/dyn/codegen/demo" simple="yes" list="yes">
                            <maxLength value="3"/>
                            <minLength value="2"/>
                        </param>
                    </params>

Example 3:

The following schema also generate a SIG similar to Example 2, but have completely different meaning. Anyway since this is very rare SIG doesn't support differentiate between this,           

            <xs:element name="myDemo" type="tns:derivedType"/>

            <xs:simpleType name="derivedType">
                <xs:restriction base="tns:mylist">
                    <xs:maxLength value="3"/>
                    <xs:minLength value="2"/>
                </xs:restriction>
            </xs:simpleType>

            <xs:simpleType name="mylist">
                <xs:list itemType="xs:string"/>
            </xs:simpleType>

4. Simple Type union are represented with the sub element union

Example1:
Schema
           
            <xs:element name="myDemo" type="tns:myunion"/>

            <xs:simpleType name="myunion">
                <xs:union memberTypes="xs:int xs:string"/>
            </xs:simpleType>

Corresponding SIG
                       <param name="myDemo" token="#in" type="myunion" type-namespace="http://www.w3.org/2001/XMLSchema" targetNamespace="http://wso2.org/dyn/codegen/demo" simple="yes" union="yes">
                            <union type="int"/>
                            <union type="string"/>
                        </param>

Example2:

Schema
           
            <xs:element name="myDemo" type="tns:myunion"/>

            <xs:simpleType name="myunion">
                <xs:union memberTypes="tns:derivedType1 tns:derivedType2"/>
            </xs:simpleType>

            <xs:simpleType name="derivedType1">
                <xs:restriction base="xs:string">
                    <xs:enumeration value="banana"/>
                    <xs:enumeration value="oragne"/>
                </xs:restriction>
            </xs:simpleType>

            <xs:simpleType name="derivedType2">
                <xs:restriction base="xs:string">
                    <xs:enumeration value="ice cream"/>
                    <xs:enumeration value="salad"/>
                </xs:restriction>
            </xs:simpleType>

SIG

                    <params>
                        <param name="myDemo" token="#in" type="myunion" type-namespace="http://www.w3.org/2001/XMLSchema" targetNamespace="http://wso2.org/dyn/codegen/demo" simple="yes" union="yes">
                            <union simple="yes" type="string">
                                <enumeration value="banana"/>
                                <enumeration value="oragne"/>
                            </union>
                            <union simple="yes" type="string">
                                <enumeration value="ice cream"/>
                                <enumeration value="salad"/>
                            </union>
                        </param>
                    </params>

Example3:

Schema
           
            <xs:element name="myDemo" type="tns:derivedType1"/>

            <xs:simpleType name="myunion">
                <xs:union memberTypes="xs:int xs:string"/>
            </xs:simpleType>

            <xs:simpleType name="derivedType1">
                <xs:restriction base="tns:myunion">
                    <xs:minLength value="3"/>
                    <xs:maxLength value="5"/>
                </xs:restriction>
            </xs:simpleType>

SIG
                    <params>
                        <param name="myDemo" token="#in" type="derivedType1" type-namespace="http://www.w3.org/2001/XMLSchema" targetNamespace="http://wso2.org/dyn/codegen/demo" simple="yes" union="yes">
                            <union type="int"/>
                            <union type="string"/>
                            <minLength value="3"/>
                            <maxLength value="5"/>
                        </param>
                    </params>

Complex Types

5. complexType sequences represented by the contentModel="sequence"

Schema
           
            <xs:element name="myDemo">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="demo1" type="xs:int"/>
                        <xs:element name="demo2" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>

SIG
                    <params wrapper-element="myDemo" wrapper-element-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="sequence">
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                     maxOccurs="1" name="demo1" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                     maxOccurs="1" name="demo2" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prifix="xs" simple="yes"/>
                    </params>

Note: wrapper elements present in  immediate  elements withcomplex types

6. Similarly 'all' and 'choice' are represented by contentModel='all' and contentModel='choice'

Example1:

Schema
           
            <xs:element name="myDemo">
                <xs:complexType>
                    <xs:all>
                        <xs:element name="demo1" type="xs:int"/>
                        <xs:element name="demo2" type="xs:string"/>
                    </xs:all>
                </xs:complexType>
            </xs:element>

SIG
                <signature method="inference">
                    <params wrapper-element="myDemo" wrapper-element-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="all">
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                         maxOccurs="1" name="demo1" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                        maxOccurs="1" name="demo2" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                    </params>

Example2:

Schema

           
            <xs:element name="myDemo">
                <xs:complexType>
                    <xs:choice>
                        <xs:element name="demo1" type="xs:int"/>
                        <xs:element name="demo2" type="xs:string"/>
                    </xs:choice>
                </xs:complexType>
            </xs:element>

SIG

                    <params wrapper-element="myDemo" wrapper-element-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="choice">
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                             maxOccurs="1" name="demo1" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo2" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-pr
                    </params>

7. When there are content models defined inside content models they are grouped with the sub-element inner-content

Example:

Schema
            <xs:element name="myDemo">
                <xs:complexType>
                    <xs:sequence>
                        <xs:choice>
                            <xs:element name="demo1" type="xs:int"/>
                            <xs:element name="demo2" type="xs:string"/>
                        </xs:choice>
                        <xs:all>
                            <xs:element name="demo3" type="xs:int"/>
                            <xs:element name="demo4" type="xs:string"/>
                        </xs:all>
                        <xs:element name="demo5" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>

SIG
                   <params wrapper-element="myDemo" wrapper-element-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="sequence">
                        <inner-content contentModel="choice">
                            <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo1" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                            <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo2" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        </inner-content>
                        <inner-content contentModel="all">
                            <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo3" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                            <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo4" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        </inner-content>
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo5" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                    </params>

8. For complexContent extension the inherited elements will be grouped with the sub-element 'inherited-content'.

Example1:
Schema
           <xs:element name="myDemo" type="tns:myType"/>

            <xs:complexType name="myType">
                <xs:complexContent>
                    <xs:extension base="tns:inheritedType">
                        <xs:sequence>
                            <xs:element name="demo1" type="xs:int"/>
                            <xs:element name="demo2" type="xs:string"/>
                        </xs:sequence>
                    </xs:extension>
                </xs:complexContent>
            </xs:complexType>

            <xs:complexType name="inheritedType">
                <xs:sequence>
                    <xs:element name="demo3" type="xs:int"/>
                    <xs:element name="demo4" type="xs:string"/>
                </xs:sequence>
            </xs:complexType>

SIG

                    <params wrapper-element="myDemo" wrapper-element-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="sequence">
                        <inherited-content contentModel="sequence" extension="inheritedType" simple="no">
                            <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo3" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                            <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo4" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        </inherited-content>
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo1" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo2" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                    </params>

Example2:  when the inherited type has a different contentModel

Schema
            <xs:complexType name="myType">
                <xs:complexContent>
                    <xs:extension base="tns:inheritedType">
                        <xs:sequence>
                            <xs:element name="demo1" type="xs:int"/>
                            <xs:element name="demo2" type="xs:string"/>
                        </xs:sequence>
                    </xs:extension>
                </xs:complexContent>
            </xs:complexType>

            <xs:complexType name="inheritedType">
                <xs:choice>
                    <xs:element name="demo3" type="xs:int"/>
                    <xs:element name="demo4" type="xs:string"/>
                </xs:choice>
            </xs:complexType>

SIG
                    <params wrapper-element="myDemo" wrapper-element-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="sequence">
                        <inherited-content contentModel="choice" extension="inheritedType" simple="no">
                            <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo3" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                            <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo4" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        </inherited-content>
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo1" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                                              maxOccurs="1" name="demo2" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                    </params>

The very recently added feature: the inherited types keeps references of inherited types, see this.

             <!- demonstrating element->
            <xs:element name="myDemo" type="tns:parentType"/>

            <xs:complexType name="parentType">
                <xs:sequence>
                    <xs:element name="demo3" type="xs:int"/>
                    <xs:element name="demo4" type="xs:string"/>
                </xs:sequence>
            </xs:complexType>

            <xs:complexType name="childType">
                <xs:complexContent>
                    <xs:extension base="tns:parentType">
                        <xs:sequence>
                            <xs:element name="demo1" type="xs:int"/>
                            <xs:element name="demo2" type="xs:string"/>
                        </xs:sequence>
                    </xs:extension>
                </xs:complexContent>
            </xs:complexType>

             <xs:complexType name="nextLevelChildType">
                <xs:complexContent>
                    <xs:extension base="tns:childType">
                        <xs:sequence>
                            <xs:element name="demo5" type="xs:int"/>
                            <xs:element name="demo6" type="xs:string"/>
                        </xs:sequence>
                    </xs:extension>
                </xs:complexContent>
            </xs:complexType>

The sig model is 

                     <params wrapper-element="myDemo" wrapper-element-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="sequence">
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo3" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefi
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo4" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-pr
                        <inheriting-types xsi-type="childType" xsi-type-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="sequence">
                            <inherited-content contentModel="sequence" extension="parentType" simple="no">
                                <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo3" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" ty
                                <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo4" type="string" type-namespace="http://www.w3.org/2001/XMLSchema"
                            </inherited-content>
                            <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo1" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-p
                            <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo2" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" typ
                        </inheriting-types>
                        <inheriting-types xsi-type="nextLevelChildType" xsi-type-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="sequence">
                            <inherited-content contentModel="sequence" extension="childType" simple="no">
                                <inherited-content contentModel="sequence" extension="parentType" simple="no">
                                    <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo3" type="int" type-namespace="http://www.w3.org/2001/XMLSchema
                                    <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo4" type="string" type-namespace="http://www.w3.org/2001/XMLSch
                                </inherited-content>
                                <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo1" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" ty
                                <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo2" type="string" type-namespace="http://www.w3.org/2001/XMLSchema"
                            </inherited-content>
                            <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo5" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-p
                            <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo6" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" typ
                        </inheriting-types>

                     </params

 The parent type keeps all the types it can be replaced by using xsi:type attribute.

9. For complexContent restriction it only shows the elements with updated parameters, this does assumes WSDL is correct.

Schema

            <xs:complexType name="myType">
                <xs:complexContent>
                    <xs:restriction base="tns:inheritedType">
                        <xs:sequence>
                            <xs:element name="demo1" minOccurs="8" maxOccurs="10" type="xs:int"/>
                            <xs:element name="demo2" minOccurs="8" maxOccurs="10" ttype="xs:string"/>
                        </xs:sequence>
                    </xs:restriction>
                </xs:complexContent>
            </xs:complexType>

            <xs:complexType name="inheritedType">
                <xs:sequence>
                    <xs:element name="demo1" minOccurs="3" maxOccurs="10" type="xs:int"/>
                    <xs:element name="demo2" minOccurs="3" maxOccurs="10" ttype="xs:string"/>
                </xs:sequence>
            </xs:complexType>

SIG
                    <params wrapper-element="myDemo" wrapper-element-ns="http://wso2.org/dyn/codegen/demo" simple="no" restriction-of="inheritedType" restriction-namespace="http://wso2.org/dyn/codegen/demo"
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="8"
                             maxOccurs="10" name="demo1" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="8"
                              maxOccurs="10" name="demo2"/>
                    </params>

Attributes

10. Attributes are represented with attribute=yes

Example1:

Schema
            <xs:complexType name="myType">
                <xs:sequence>
                    <xs:element name="demo1" type="xs:string"/>
                    <xs:element name="demo2" type="xs:string"/>
                </xs:sequence>
                <xs:attribute name="demo3" type="xs:string"/>
            </xs:complexType>

SIG
                    <params wrapper-element="myDemo" wrapper-element-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="sequence">
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                              maxOccurs="1" name="demo1" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                              maxOccurs="1" name="demo2" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        <param attribute="yes" token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" name="demo3" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" simple="yes"/>
                    </params>

Example2:

Schema
            <xs:complexType name="myType">
                <xs:sequence>
                    <xs:element name="demo1" type="xs:string"/>
                    <xs:element name="demo2" type="xs:string"/>
                </xs:sequence>
                <xs:attribute name="demo3" type="tns:derivedType"/>
            </xs:complexType>

            <xs:simpleType name="derivedType">
                <xs:restriction base="xs:int">
                    <xs:maxInclusive value="5"/>
                    <xs:minInclusive value="2"/>
                </xs:restriction>
            </xs:simpleType>

SIG
                   <params wrapper-element="myDemo" wrapper-element-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="sequence">
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                              maxOccurs="1" name="demo1" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                              maxOccurs="1" name="demo2" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        <param attribute="yes" token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" name="demo3" type="int" type-namespace="http://wso2.org/dyn/codegen/demo" simple="yes">
                            <maxInclusive value="5"/>
                            <minInclusive value="2"/>
                        </param>
                    </params>

11. For SimpleContent extension , the information on simple type is wrapped in the sub element 'inherited-content'

Schema
            <xs:complexType name="myType">
                <xs:simpleContent>
                    <xs:extension base="xs:int">
                        <xs:attribute name="demo1" type="xs:string"/>
                    </xs:extension>
                </xs:simpleContent>
            </xs:complexType>

SIG

                     <params>
                        <param name="myDemo" token="#in" type="myType" type-namespace="http://www.w3.org/2001/XMLSchema" targetNamespace="http://wso2.org/dyn/codegen/demo" simple="yes" contentModel="simpleContent" extension="int">
                            <param attribute="yes" token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" name="demo1" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" simple="yes"/>
                        </param>
                    </params>

12. SIG model doesn't keep the information on attributeGroup, rather it extract out the attributes from the group.

Schema

            <xs:complexType name="myType">
                <xs:sequence>
                    <xs:element name="demo1" type="xs:string"/>
                    <xs:element name="demo2" type="xs:string"/>
                </xs:sequence>
                <xs:attributeGroup ref="tns:attriGroup"/>
            </xs:complexType>

            <xs:attributeGroup name="attriGroup">
                <xs:attribute name="demo3" type="xs:string"/>
                <xs:attribute name="demo4" type="xs:string"/>
            </xs:attributeGroup>

SIG
                    <params wrapper-element="myDemo" wrapper-element-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="sequence">
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                             maxOccurs="1" name="demo1" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                              maxOccurs="1" name="demo2" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        <param attribute="yes" token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" name="demo3" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" simple="yes"/>
                        <param attribute="yes" token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" name="demo4" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" simple="yes"/>
                    </params>

13. attribute and element who are referring some other  are replaced with the referred attribute/element (Similar to attributeGroup)

Schema

            <xs:element name="myDemo">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element ref="tns:myReffered"/>
                    </xs:sequence>
                    <xs:attribute ref="tns:myReffered"/>
                </xs:complexType>
            </xs:element>

            <xs:element name="myReffered" type="xs:int"/>
            <xs:attribute name="myReffered" type="xs:string"/>

SIG

                    <params wrapper-element="myDemo" wrapper-element-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="sequence">
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1"
                         maxOccurs="1" name="myReffered" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="xs" simple="yes"/>
                        <param attribute="yes" token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" name="myReffered" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" simple="yes"/>
                    </params>

14. anyAttribute is represented with the type="anyType"

Schema 

             <!- demonstrating element->
            <xs:element name="myDemo">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="demo1" type="xs:int"/>
                        <xs:element name="demo2" type="xs:string"/>
                    </xs:sequence>
                    <xs:attribute name="test" type="xs:int"/>
                    <xs:anyAttribute/>
                </xs:complexType>
            </xs:element>

 SIG

                     <params wrapper-element="myDemo" wrapper-element-ns="http://wso2.org/dyn/codegen/demo" simple="no" contentModel="sequence">
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo1" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefi
                        <param token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" minOccurs="1" maxOccurs="1" name="demo2" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-pr
                        <param attribute="yes" token="#in" targetNamespace="http://wso2.org/dyn/codegen/demo" name="test" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" simple="yes"/>
                        <param attribute="yes" token="#in" type="anyType" simple="no"/>
                    </params>

Headers 

15. Headers associated to complex Schema are represented with the same param structure as Body 

                 <binding-details soapaction="http://soapinterop.org/">
                    <soapheader for="input" required="true" type="Header1" type-namespace="http://soapinterop.org/xsd">
                        <param token="input" targetNamespace="http://soapinterop.org/xsd" minOccurs="1" maxOccurs="1" name="Header1" type="Header1" type-namespace="http://soapinterop.org/xsd" type-prefix="types" simple="no" contentModel="sequence">
                            <param token="input" targetNamespace="http://soapinterop.org/xsd" minOccurs="1" maxOccurs="1" name="string" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="s" simple="yes"/>
                            <param token="input" targetNamespace="http://soapinterop.org/xsd" minOccurs="1" maxOccurs="1" name="int" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="s" simple="yes"/>
                        </param>
                    </soapheader>
                    <soapheader for="input" required="true" type="Header2" type-namespace="http://soapinterop.org/xsd">
                        <param token="input" targetNamespace="http://soapinterop.org/xsd" minOccurs="1" maxOccurs="1" name="Header2" type="Header2" type-namespace="http://soapinterop.org/xsd" type-prefix="types" simple="no" contentModel="sequence">
                            <param token="input" targetNamespace="http://soapinterop.org/xsd" minOccurs="1" maxOccurs="1" name="int" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="s" simple="yes"/>
                            <param token="input" targetNamespace="http://soapinterop.org/xsd" minOccurs="1" maxOccurs="1" name="string" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="s" simple="yes"/>
                        </param>
                    </soapheader>
                    <soapheader for="output" required="true" type="Header1" type-namespace="http://soapinterop.org/xsd">
                        <param token="output" targetNamespace="http://soapinterop.org/xsd" minOccurs="1" maxOccurs="1" name="Header1" type="Header1" type-namespace="http://soapinterop.org/xsd" type-prefix="types" simple="no" contentModel="sequence">
                            <param token="output" targetNamespace="http://soapinterop.org/xsd" minOccurs="1" maxOccurs="1" name="string" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="s" simple="yes"/>
                            <param token="output" targetNamespace="http://soapinterop.org/xsd" minOccurs="1" maxOccurs="1" name="int" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="s" simple="yes"/>
                        </param>
                    </soapheader>
                    <soapheader for="output" required="true" type="Header2" type-namespace="http://soapinterop.org/xsd">
                        <param token="output" targetNamespace="http://soapinterop.org/xsd" minOccurs="1" maxOccurs="1" name="Header2" type="Header2" type-namespace="http://soapinterop.org/xsd" type-prefix="types" simple="no" contentModel="sequence">
                            <param token="output" targetNamespace="http://soapinterop.org/xsd" minOccurs="1" maxOccurs="1" name="int" type="int" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="s" simple="yes"/>
                            <param token="output" targetNamespace="http://soapinterop.org/xsd" minOccurs="1" maxOccurs="1" name="string" type="string" type-namespace="http://www.w3.org/2001/XMLSchema" type-prefix="s" simple="yes"/>
                        </param>
                    </soapheader>
                </binding-details>

Powered by a free Atlassian Confluence Open Source Project License granted to WSO2 Inc.. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators