Skip to main content

Controlling Use of the xsi:type Attribute

By default, InterSystems IRIS® data platform SOAP messages include the xsi:type attribute only for the top-level types. For example:

<?xml version="1.0" encoding="UTF-8" ?>
...
<types:GetPersonResponse>
<GetPersonResult href="#id1" />
</types:GetPersonResponse>
<types:Person id="id1" xsi:type="types:Person">
<Name>Yeats,Clint C.</Name>
<DOB>1944-12-04</DOB>
</types:Person>  
...

In these examples, line breaks have been added for readability. To use this attribute for all types in the SOAP messages, do either of the following:

  • Set the OutputTypeAttribute property equal to 1 in the web client instance.

  • Set the OUTPUTTYPEATTRIBUTE parameter equal to 1 in the web client class.

The same output would look like this:

<?xml version="1.0" encoding="UTF-8" ?>
...
<types:GetPersonResponse>
<GetPersonResult href="#id1" />
</types:GetPersonResponse>
<types:Person id="id1" xsi:type="types:Person">
<Name xsi:type="s:string">Yeats,Clint C.</Name>
<DOB xsi:type="s:date">1944-12-04</DOB>
</types:Person> 
...

The property takes precedence over the parameter.

FeedbackOpens in a new tab