Please help to resolve the below error for the XSD as i'm a newbie to xsd
Sample SOAP response XML
<ACCOUNTDETAILS>
<STATUS></STATUS>
<RESPONSE></RESPONSE>
<ACCOUNTID>
<DETAILS>
<NAME></NAME>
<CATEGORY></CATEGORY>
<LASTMODIFIED></LASTMODIFIED>
</DETAILS>
</ACCOUNTID>
</ACCOUNTDETAILS>
XSD generated
<xsd:element name="AccountDetailsResponse">
<xsd:element name="ACCOUNTDETAILS" type="account:Account">
<xsd:complexType>
<xsd:sequence>
<xsd:element type="xsd:string" name="STATUS"/>
<xsd:element type="xsd:string" name="RESPONSE"/>
<xsd:element name="ACCOUNTID">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DETAILS">
<xsd:complexType>
<xsd:sequence>
<xsd:element type="xsd:string" name="NAME"/>
<xsd:element type="xsd:string" name="CATEGORY"/>
<xsd:element type="xsd:string" name="LASTMODIFIED"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:element>
XSD ERROR:
s4s-elt-must-match.1: The content of 'AccountDetailsResponse' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: element.
Thanks in advance
Most likely you did not provided us with the entire input. From your schema, I would expect an element
AccountDetailsResponse
around the excerpt you posted.As you figured out for the other elements, you cannot have an
xs:element
as a direct child of anotherxs:element
. Most likely, using the same as you did for the other elements (an ordered sequence of children) would do what you want:This will not work either, as you cannot have both a
type
attribute, and an embeddedxs:complexType
at the same time. So probably you will want to get rid of that onetype
attribute. So the following should work: