Specifying a Display Name for a Custom Site created by the REST API

Hi guys,

Not sure, but I think I may have stumbled across a bug here - maybe you can tell me if I’m using this correctly or not?

According to the BESAPI.xsd, you can define a “<DisplayName>” as well as a “<Name>” for a custom site:

<xs:element name="CustomSite">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="Name" type="xs:normalizedString"/>
            <xs:element name="DisplayName" type="xs:normalizedString" minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="Resource" type="xs:string" use="required"/>  
        <xs:attribute name="LastModified" type="xs:normalizedString"/>
    </xs:complexType>
 </xs:element>

However, when I attempt to use it:

<?xml version="1.0" encoding="UTF-8"?>
<BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BES.xsd">
    <CustomSite>
        <Name>Superman</Name>
        <DisplayName>Clark Kent</DisplayName>
        <Description>Something, something, something, dark side ...</Description>
        <Domain>BESC</Domain>
        <GlobalReadPermission>true</GlobalReadPermission>
        <Subscription>
            <Mode>None</Mode>
        </Subscription>
    </CustomSite>
</BES>

I get an error:

Status: 500 Internal Server Error

XML Parsing error: 
 no declaration found for element 'DisplayName'
 Line 5, Character 5

Am I looking at the wrong thing? Or should this work?

This may well be a bug, as creating a custom site using this method without the tag works as expected. Please open a PMR to have it validated and addressed as necessary!

@Damien have you seen this before?

I believe there is a mix-up between the two XML schemas that the IEM platform provides, BES.xsd and BESAPI.xsd. The XML you are using is BES XML [1]. The XML contains a /BES/CustomSite/DisplayName node. However, BES.xsd does not contain a declaration for /BES/CustomSite/DisplayName. Thus there is an error.

You are correct in noting that BESAPI.xsd contains a declaration for /BES/CustomSite/DisplayName. However, this doesn’t affect your usage because you are using BES XML.

I am not sure what your usage is, but I suggest you try using BESAPI XML.

[1] I use the term “BES XML” to refer to XML that is intended to validate against BES.xsd. I know that the XML you are using is BES XML from examining the XML: The second line of the XML is copied below.

<BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BES.xsd">

This is the root node of the XML. Notice how it has the attribute xsi:noNamespaceSchemaLocation="BES.xsd". This attribute specifies the schema that the XML is intended to validate against. Thus the XML is BES XML.

1 Like

Thanks for the detailed explanation Damien - I failed to notice that and it explains everything.

Thanks guys.