2 Replies Latest reply: Jun 2, 2013 10:36 PM by kpchong RSS

    XML Body Approach

    kpchong
      Hi All,

      Just wondering, if my schema data type given like this below. What is the possible input should be in order to match with the W3C Standard?
           
      <xs:complexType name="sampleInput">
                <xs:annotation>
                     <xs:documentation>Input Details for Perform Contingency Analysis</xs:documentation>
                </xs:annotation>
                <xs:sequence>
      <xs:element name="abc" type="x:abc" nillable="false"/>
      <xs:element name="xyz" type="x:xyz" nillable="false"/>
                </xs:sequence>
           </xs:complexType>

      <xs:simpleType name="abc">
                <xs:annotation>
                     <xs:documentation>this is a sample element</xs:documentation>
                </xs:annotation>
                <xs:restriction base="xs:base64Binary"/>
           </xs:simpleType>
      <xs:simpleType name="xyz">
                <xs:annotation>
                     <xs:documentation>this is a sample element</xs:documentation>
                </xs:annotation>
                <xs:restriction base="xs:float"/>
           </xs:simpleType>
        • 1. Re: XML Body Approach
          shuttle
          I've modified a little bit the original schema. There was no root element and the referred abc and xyz types had wrong namespaces.

          <?xml version="1.0" encoding="UTF-8"?>
          <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
               targetNamespace="http://www.example.org/SoaSuiteForumTest" xmlns:tns="http://www.example.org/SoaSuiteForumTest"
               elementFormDefault="qualified">
               <xs:element name="root" type="tns:sampleInput"/>
               <xs:complexType name="sampleInput">
                    <xs:annotation>
                         <xs:documentation>Input Details for Perform Contingency Analysis
                         </xs:documentation>
                    </xs:annotation>
                    <xs:sequence>
                         <xs:element name="abc" type="tns:abc" nillable="false" />
                         <xs:element name="xyz" type="tns:xyz" nillable="false" />
                    </xs:sequence>
               </xs:complexType>

               <xs:simpleType name="abc">
                    <xs:annotation>
                         <xs:documentation>this is a sample element</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:base64Binary" />
               </xs:simpleType>
               <xs:simpleType name="xyz">
                    <xs:annotation>
                         <xs:documentation>this is a sample element</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:float" />
               </xs:simpleType>


          </xs:schema>

          Generated xml:

          <?xml version="1.0" encoding="UTF-8"?>
          <tns:root xmlns:tns="http://www.example.org/SoaSuiteForumTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/SoaSuiteForumTest SoaSuiteForumTest.xsd ">
          <tns:abc>MA==</tns:abc>
          <tns:xyz>0.0</tns:xyz>
          </tns:root>
          • 2. Re: XML Body Approach
            kpchong
            Sorry by not including with the root element and the namespaces where the root element i am defining in the WSDL file instead of xsd please do ignore the default prerequisite of defining a xsd and wsdl. Anyway what i want to get verify here is the possible value that can be accepted by the W3C validation standard in OSB validation function.

            since shuttle already help me for the completeness of the format will use it as the sample..

            Valid with value:
            <tns:root >
            <tns:abc>MA==</tns:abc>
            <tns:xyz>0.0</tns:xyz>
            </tns:root>

            Valid with empty element:
            <tns:root >
            </tns:root>

            how about the formats below?

            1.
            <tns:root >
            <tns:abc></tns:abc>
            <tns:xyz></tns:xyz>
            </tns:root>
            2.
            <tns:root >
            <tns:abc></tns:abc>
            <tns:xyz>0.0</tns:xyz>
            </tns:root>
            3.
            <tns:root >
            <tns:abc>MA==</tns:abc>
            <tns:xyz></tns:xyz>
            </tns:root>
            4.
            <tns:root >
            <tns:abc>MA==</tns:abc>
            </tns:root>
            5.
            <tns:root >
            <tns:xyz>0.0</tns:xyz>
            </tns:root>
            6.
            <tns:root >
            <tns:abc></tns:abc>
            </tns:root>
            7.
            <tns:root >
            <tns:xyz></tns:xyz>
            </tns:root>