xsd - What will be a valid sample xml for this schema using <any> -
i received schema vendor , trying make heads or tails of can go inside it.
<schema targetnamespace="http://abc.com:9080/product/services/12webservice/types/" xmlns="http://www.w3.org/2001/xmlschema"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <element name="message"> <complextype> <sequence> <any minoccurs="0"/> </sequence> </complextype> </element> </schema> what can legally put inside <types:message> element in below sample.
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:types="http://abc.com:9080/product/services/12webservice/types/"> <soapenv:header/> <soapenv:body> <types:message> <!-- can go here --> </types:message> </soapenv:body> </soapenv:envelope>
inside message can put 1 arbitrary element - i.e. element name in namespace:
<message xmlns="http://abc.com:9080/product/services/12webservice/types/"> <something xmlns="some namespace" . . more attributes here . . .> . . . more sub-elements here . . </something> </message> an empty message valid (due minoccurs="0"):
<message xmlns="http://abc.com:9080/product/services/12webservice/types/"> </message> what cannot put inside message multiple elements - invalid:
<message xmlns="http://abc.com:9080/product/services/12webservice/types/"> <something1 xmlns="some namespace"> </something1> <something2 xmlns="some namespace"> </something2> </message> note though because processcontents attribute of any not specified, defaults strict - means validation fails if there no schema some namespace - or if something element not match schema.
see documentation of any here.
Comments
Post a Comment