Domanda

We are working on AX webservices which return some datacontract (obviously).

The datacontract returned has a field (we will call him "endDate") which, sometimes, can be considering "unkwnown". Is there a way to avoid having the element corresponding to this field in the generated XML in this case.

Exemples

endDate known

<datacontract>
    <field1>value</field1>
    <endDate>2010-10-10</endDate>
</datacontract>

endDate unknwown

<datacontract>
    <field1>value</field1>
</datacontract>

I would like to avoid having two type of datacontract, of course.

È stato utile?

Soluzione

The easy option is to remove the unwanted fields from the service query.

Also in the setup of the outbound port you can configure which fields to expose (under "Data policies". You cannot when configuring inbound ports.

On output AIF always emits the elements whether or not it contains data. For example:

</endDate>

if the endData is not set.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top