Product Lifecycle Management Blogs by SAP
Dive into product lifecycle management news, learn about digitalizing PLM for the digital supply chain, and stay informed with product updates from SAP.
cancel
Showing results for 
Search instead for 
Did you mean: 

There are always uses and questions that come up around the usage of XSDs, especially when working with the MII transaction WSDL interface and trying to capture XML or return XML values using this.  The default behavior of the XML type when displayed in an MII transaction WSDL is to show the type as a String rather than as having a type of XML.  This is because technically there is no difference between an unstructured XML and a String.  If you want to provide a structured XML type you do have the option to define in the transaction properties window an XSD and choose the "Element Name" that represents the structure of the expected XML document as shown here:

Simply press the "Select XSD" button to open up the below configuration dialog to choose your XSD.

From here you have the option to or not to enforce validation of the XML in MII (MII will throw an error if XML doesn't match XSD).

The XSD used in the above is this and this XSD definition is for the standard MII Illuminator XML format (/Rowsets/Columns/Column & /Rowsets/Rowset/Row):


<?xml version="1.0" encoding="utf-8" standalone="no"?>
<s:schema xmlns:s="http://www.w3.org/2001/XMLSchema">
    <!-- definition of complex elements -->
    <s:element name="Messages">
        <s:complexType>
            <s:sequence>
                <s:element maxOccurs="unbounded" minOccurs="0" name="Message" type="s:string" />
            </s:sequence>
        </s:complexType>
    </s:element>
    <s:element name="Column">
        <s:complexType>
    <s:attribute name="MinRange"    type="s:decimal" />
            <s:attribute name="MaxRange"    type="s:decimal" />
            <s:attribute name="SQLDataType"  type="s:integer" />
            <s:attribute name="Name"        type="s:string" />
            <s:attribute name="SourceColumn" type="s:string" />
    <s:attribute name="Description"  type="s:string" />
        </s:complexType>
    </s:element>
    <s:element name="Columns">
        <s:complexType>
            <s:sequence>
                <s:element maxOccurs="132" minOccurs="1" ref="Column" />
            </s:sequence>
        </s:complexType>
    </s:element>
    <s:element name="Row">
        <s:complexType>
            <s:sequence id="RowSequence">
                <s:any maxOccurs="unbounded" minOccurs="0" namespace="##local" processContents="lax" />
            </s:sequence>
        </s:complexType>
    </s:element>
    <s:element name="Rowset">
        <s:complexType>
            <s:sequence>
                <s:element maxOccurs="1" ref="Columns" />
                <s:element maxOccurs="unbounded" minOccurs="0" ref="Row" />
            </s:sequence>
        </s:complexType>
    </s:element>
    <s:element name="Rowsets">
        <s:complexType>
            <s:sequence>
                <s:element maxOccurs="1" minOccurs="0" name="FatalError" type="s:string" />
                <s:element maxOccurs="1" minOccurs="0" ref="Messages" />
                <s:element maxOccurs="unbounded" minOccurs="0" ref="Rowset" />
            </s:sequence>
            <s:attribute name="DateCreated" type="s:dateTime" />
            <s:attribute name="EndDate" type="s:dateTime" />
            <s:attribute name="StartDate" type="s:dateTime" />
            <s:attribute name="Version" type="s:string" />
        </s:complexType>
    </s:element>
</s:schema>

From here when you do call the WSDL generator interface for the MII Transaction engine (Web Service Interface - Content Development - SAP Library) the response now includes a "typed" element and also at the top includes a reference to your XSD:

Hope that this helps,
Sam

3 Comments