I'm new to XSD and I'm confused about current behavior and I'm sure what I'm missing. I am trying to make some elements alternatively in the creation of the WCF service in VBF. I have 2 elements that I want to be optional, either they are part of the webservice request or not, I do not care. Although I get those errors which are both essential, are I clearly missing something? Sequence and all should be properly cured minOccurrs as well as references.
In my research I know that I am using minOccurs = "0" as given below from w3Schools
The "minOccurs" indicator indicates the minimum element can be an element.
& lt; Xs: element name = "person" & gt; & Lt; XS: complexType & gt; & Lt; XS: Sequence & gt; & Lt; Xs: element name = "full_name" type = "x: string" /> & Lt; Xs: element name = "child_name" type = "xs: string" maxOccurs = "10" minOccurs = "0" /> & Lt; / XS: sequence & gt; & Lt; / XS: complexType & gt; & Lt; / XS: element & gt;
The above example indicates that the "child_name" element can be at least zero and up to ten times in element "person" element.
With this I have defined my third party item layout as follows: ExternalID and SecondID (with no control over name)
Lt; Xs: element name = "thirdpartymessage" & gt; & Lt; XS: complexType & gt; & Lt; XS: All & gt; & Lt; Xs: element riff = "topic" /> & Lt; Xs: element riff = "message" /> & Lt; Xs: element ref = "requestType" /> & Lt; Xs: element ref = "external id" minOccurs = "0" /> & Lt; Xs: element ref = "second id" minOccurs = "0" /> & Lt; / XS: All & gt; & Lt; / XS: complexType & gt; & Lt; / XS: element & gt;
Also
& lt; Xs: complex type name = "messageHeaderType" & gt; & Lt; XS: Sequence & gt; & Lt; Xs: element name = "RqUID" type = "UUID" /> & Lt; Xs: element name = "asyncrryceuid" type = "uuid" min octar = "0" /> & Lt; Xs: element name = "partner" type = "identifier" minOccurs = "0" /> & Lt; Xs: element ref = "external id" minOccurs = "0" maxOccurs = "1" /> & Lt; Xs: element ref = "secondId" minOccurs = "0" maxOccurs = "1" /> & Lt; / XS: sequence & gt; & Lt; / XS: complexType & gt;
defined as
& lt; Xs: element name = "externalID" & gt; & Lt; XS: simpleType & gt; & Lt; Xs: restriction base = "xs: string" & gt; & Lt; Xs: minLength value = "0" /> & Lt; Xs: max lump value = "15" /> & Lt; / XS: Ban & gt; & Lt; / XS: simpleType & gt; & Lt; / XS: element & gt; & Lt; Xs: element name = "second id" & gt; & Lt; XS: simpleType & gt; & Lt; Xs: restriction base = "integer" & gt; & Lt; / XS: Ban & gt; & Lt; / XS: simpleType & gt; & Lt; / XS: element & gt;
Global announcements attribute can not be used minOccurs, maxOccurs, or You may want to refer to this link.
Comments
Post a Comment