OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

sca-c-cpp message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [sca-c-cpp] WSDL extension schema



I found a schema for the JAX-WS WSDL extensions (http://java.sun.com/xml/ns/jaxws/wsdl_customizationschema_2_0.xsd).  Based on that here is an alternate schema for the C WSDL extensions.

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca-c-cpp/c/200901"
        xmlns:sca-c="http://docs.oasis-open.org/ns/opencsa/sca-c-cpp/c/200901"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        elementFormDefault="qualified">

        <element name="bindings" type="sca-c:BindingsType" />
        <complexType name="BindingsType">
                <choice minOccurs="0" maxOccurs="unbounded">
                        <element ref="sca-c:prefix" />
                        <element ref="sca-c:enableWrapperStyle" />
                        <element ref="sca-c:function" />
                        <element ref="sca-c:struct" />
                        <element ref="sca-c:parameter" />
                        <element ref="sca-c:CType" />
                </choice>
        </complexType>

        <element name="prefix" type="sca-c:PrefixType" />
        <complexType name="PrefixType">
                <attribute name="name" type="xsd:string" use="required" />
        </complexType>

        <element name="function" type="sca-c:FunctionType" />
        <complexType name="FunctionType">
                <attribute name="name" type="xsd:string" use="required" />
        </complexType>

        <element name="struct" type="sca-c:StructType" />
        <complexType name="StructType">
                <attribute name="name" type="xsd:string" use="required" />
        </complexType>

        <element name="parameter" type="sca-c:ParameterType" />
        <complexType name="ParameterType">
                <attribute name="part" type="xsd:string" use="required" />
                <attribute name="childElementName" type="xsd:QName"
                        use="required" />
                <attribute name="name" type="xsd:string" use="required" />
        </complexType>

        <element name="enableWrapperStyle" type="xsd:boolean" />

        <element name="CType" type="sca-c:CTypeType" />
        <complexType name="CTypeType">
                <attribute name="name" type="xsd:string" use="required" />
                <attribute name="XMLType" type="xsd:QName" use="required" />
                <attribute name="function" type="xsd:string" use="required" />
                <attribute name="library" type="xsd:string" use="required" />
        </complexType>

</schema>

My only concern with this, and for that matter, the one below, is that it allows  multiple instances of  prefix, enableWrapperStyle, function, and struct, within a bindings element.  We would need a normative statement saying onlyr the first (or last) instance is to be applied.  An another alternative is to have bindings use a sequence and constrain the number of occurrences of each element of the sequence like this (I have a slight preference for the first alternative).  In any case, we will need a normative statement about ignoring extensions elements applied to WSDL elements incorrectly.

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca-c-cpp/c/200901"
        xmlns:sca-c="http://docs.oasis-open.org/ns/opencsa/sca-c-cpp/c/200901"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        elementFormDefault="qualified">

        <element name="bindings" type="sca-c:BindingsType" />
        <complexType name="BindingsType">
                <sequence>
                        <element ref="sca-c:prefix" minOccurs="0" maxOccurs="1" />
                        <element ref="sca-c:enableWrapperStyle" minOccurs="0"
                                maxOccurs="1" />
                        <element ref="sca-c:function" minOccurs="0" maxOccurs="1" />
                        <element ref="sca-c:struct" minOccurs="0" maxOccurs="1" />
                        <element ref="sca-c:parameter" minOccurs="0"
                                maxOccurs="unbounded" />
                        <element ref="sca-c:CType" minOccurs="0"
                                maxOccurs="unbounded" />
                </sequence>
        </complexType>

        <element name="prefix" type="sca-c:PrefixType" />
        <complexType name="PrefixType">
                <attribute name="name" type="xsd:string" use="required" />
        </complexType>

        <element name="function" type="sca-c:FunctionType" />
        <complexType name="FunctionType">
                <attribute name="name" type="xsd:string" use="required" />
        </complexType>

        <element name="struct" type="sca-c:StructType" />
        <complexType name="StructType">
                <attribute name="name" type="xsd:string" use="required" />
        </complexType>

        <element name="parameter" type="sca-c:ParameterType" />
        <complexType name="ParameterType">
                <attribute name="part" type="xsd:string" use="required" />
                <attribute name="childElementName" type="xsd:QName"
                        use="required" />
                <attribute name="name" type="xsd:string" use="required" />
        </complexType>

        <element name="enableWrapperStyle" type="xsd:boolean" />

        <element name="CType" type="sca-c:CTypeType" />
        <complexType name="CTypeType">
                <attribute name="name" type="xsd:string" use="required" />
                <attribute name="XMLType" type="xsd:QName" use="required" />
                <attribute name="function" type="xsd:string" use="required" />
                <attribute name="library" type="xsd:string" use="required" />
        </complexType>

</schema>

Bryan Aupperle, Ph.D.
STSM, WebSphere Enterprise Platform Software Solution Architect

Research Triangle Park,  NC
+1 919-254-7508 (T/L 444-7508)
Internet Address: aupperle@us.ibm.com



Bryan Aupperle/Raleigh/IBM@IBMUS

01/16/2009 04:11 PM

To
sca-c-cpp@lists.oasis-open.org
cc
Subject
[sca-c-cpp] WSDL extension schema






I put the draft schema for C WSDL extensions through a validator and found a problem.  The draft version defines the types for the elements (e.g.PrefixType)  without referencing the base type for the substitution group (ExtensionType).  To fix this, the attribute definition needs to be nexted inside complexContnet and extension elements.


This fixes all but enableWrapperStyle, which right now is of type boolean, which does not derive from ExtensionType.  To make this work I believe we either need to make enableWrapperStyle have a boolean attribute or add enableWrraperStyle to the sequence in BindingsType (with minOccurs="0" and maxOccurs="1").  This latter approach would force enableWrapperStyle to be the last child of a bindings element.  There may be another option, but I am not a schema expert.


I noticed one other thing, the extensions element in the sequence  of BindingsType should have minOccurs="0" maxOccurs="unbounded".


The schema with these changes is:.


<?
xml version="1.0" encoding="UTF-8"?>
<
schema xmlns="http://www.w3.org/2001/XMLSchema"
       
targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca-c-cpp/c/200901"
       
xmlns:sca-c="http://docs.oasis-open.org/ns/opencsa/sca-c-cpp/c/200901"
       
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       
elementFormDefault="qualified">

       
<element name="bindings" type="sca-c:BindingsType" />
       
<complexType name="BindingsType">
               
<sequence>
                       
<element ref="sca-c:extension" minOccurs="0"
                               
maxOccurs="unbounded"/>
               
</sequence>
       
</complexType>

       
<element name="extension" type="sca-c:ExtensionType" />
       
<complexType name="ExtensionType"></complexType>

       
<element name="prefix" type="sca-c:PrefixType"
               
substitutionGroup="sca-c:extension" />
       
<complexType name="PrefixType">
               
<complexContent>
                       
<extension base="sca-c:ExtensionType">
                               
<attribute name="name" type="xsd:string" use="required" />
                       
</extension>
               
</complexContent>
       
</complexType>

       
<element name="function" type="sca-c:FunctionType"
               
substitutionGroup="sca-c:extension" />
       
<complexType name="FunctionType">
               
<complexContent>
                       
<extension base="sca-c:ExtensionType">
                               
<attribute name="name" type="xsd:string" use="required" />
                       
</extension>
               
</complexContent>
       
</complexType>

       
<element name="struct" type="sca-c:StructType"
               
substitutionGroup="sca-c:extension" />
       
<complexType name="StructType">
               
<complexContent>
                       
<extension base="sca-c:ExtensionType">
                               
<attribute name="name" type="xsd:string" use="required" />
                       
</extension>
               
</complexContent>
       
</complexType>

       
<element name="parameter" type="sca-c:ParameterType"
               
substitutionGroup="sca-c:extension" />
       
<complexType name="ParameterType">
               
<complexContent>
                       
<extension base="sca-c:ExtensionType">
                               
<attribute name="part" type="xsd:string" use="required" />
                               
<attribute name="childElementName" type="xsd:QName"
                                       
use="required" />
                               
<attribute name="name" type="xsd:string" use="required" />
                       
</extension>
               
</complexContent>
       
</complexType>

       
<element name="enableWrapperStyle" type="xsd:boolean"
               
substitutionGroup="sca-c:extension" />

       
<element name="CType" type="sca-c:CTypeType"
               
substitutionGroup="sca-c:extension" />
       
<complexType name="CTypeType">
               
<complexContent>
                       
<extension base="sca-c:ExtensionType">
                               
<attribute name="name" type="xsd:string" use="required" />
                               
<attribute name="XMLType" type="xsd:QName"
                                       
use="required" />
                               
<attribute name="function" type="xsd:string"
                                       
use="required" />
                               
<attribute name="library" type="xsd:string"
                                       
use="required" />
                       
</extension>
               
</complexContent>
       
</complexType>
</
schema>

Bryan Aupperle, Ph.D.
STSM, WebSphere Enterprise Platform Software Solution Architect
Master Inventor

Research Triangle Park,  NC
+1 919-254-7508 (T/L 444-7508)
Internet Address: aupperle@us.ibm.com



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]