Hello!
I am creating a Management Pack and a part of it is requesting an URL with Microsoft.SystemCenter.WebApplication.UrlProbe.
One requirement is to set header objects using configuration file. Therefore, in the discovery, I assemble the string according to the HttpHeadersType and store that in the class under the headers setting.
Example: <HttpHeader><name>Accept</Name><Value>/</Value></HttpHeader><HttpHeader><name>Accept-Language</Name><Value>en-us</Value></HttpHeader><HttpHeader><name>Accept-Encoding</Name><Value>GZIP</Value></HttpHeader>.
My Class:
<ClassType ID="MY.TEST.Class"
Accessibility="Public"
Abstract="false"
Base="Windows!Microsoft.Windows.ApplicationComponent"
Hosted="true"
Singleton="false">
<Property ID="ID" Type="string" Key="true" />
<Property ID="Name" Type="string" Key="false" />
<Property ID="URL" Type="string" Key="false" />
<Property ID="Description" Type="string" Key="false" />
<Property ID="HTTPHeaders" Type="string" Key="false" />
...
</ClassType>
</ClassTypes>
</EntityTypes>
</TypeDefinitions>
Now I want to pass this string to the sample:
<Configuration>
<xsd:element minOccurs="0" name="Headers" type="xsd:string"/>
</configuration>
...
<Requests>
<Request>
<RequestID>1</RequestID>
<HttpHeaders>$Config/Headers$</HttpHeaders>
...
</request>
</Requests>
But I will get an error on build:
Schema validation failed.
The element 'HttpHeaders' must not contain any text. Expected list of possible elements: 'HttpHeaders'.
Is it possible to implement the requirement this way, or do I have to store the individual header elements as separate properties in the class. I would like to avoid this.
rg
Hansi