문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top