Как определить несколько вхождений в XML - PullRequest
0 голосов
/ 22 января 2019

Я пытаюсь интегрировать FedEx в свое приложение.В одном модуле я должен был определить один элемент как несколько вхождений.пожалуйста, проверьте изображение ниже enter image description here

Как мне определить элемент СОБЫТИЯ?Я попробовал следующие методы

1
<ON_DELIVER type="EVENTS"/>
2
<EVENTS>ON_DELIVER</EVENTS>
3
<EVENTS>[ON_DELIVER]</EVENTS>
4
<EVENTS>
  <ON_DELIVER>TRUE</ON_DELIVER>
</EVENTS>

Я получил ошибку ниже Element 'Events' is a simple type, so it must have no element information item [children] Я хочу знать, как я могу определить элемент EVENTS с этими 5 значениями.

1 Ответ

0 голосов
/ 30 января 2019

Приведенный ниже XML должен помочь вам настроить несколько уведомлений. Один для клиента и один для вашей команды обслуживания клиентов

<SpecialServicesRequested>
    <SpecialServiceTypes>EVENT_NOTIFICATION</SpecialServiceTypes>
    <EventNotificationDetail>
        <AggregationType>PER_SHIPMENT</AggregationType>
        <PersonalMessage>This is a notification sent by Fedex, for your order: XXXX-XXXX</PersonalMessage>
        <EventNotifications>
            <Role>RECIPIENT</Role>
            <Events>ON_SHIPMENT</Events>
            <Events>ON_EXCEPTION</Events>
            <Events>ON_ESTIMATED_DELIVERY</Events>
            <Events>ON_DELIVERY</Events>
            <NotificationDetail>
                <NotificationType>EMAIL</NotificationType>
                <EmailDetail>
                    <EmailAddress>XXXX@hotmail.com</EmailAddress>
                    <Name>Claire Pounder</Name>
                </EmailDetail>
                <Localization>
                    <LanguageCode>EN</LanguageCode>
                </Localization>
            </NotificationDetail>
            <FormatSpecification>
                <Type>HTML</Type>
            </FormatSpecification>
        </EventNotifications>
        <EventNotifications>
            <Role>SHIPPER</Role>
            <Events>ON_SHIPMENT</Events>
            <Events>ON_EXCEPTION</Events>
            <Events>ON_ESTIMATED_DELIVERY</Events>
            <Events>ON_DELIVERY</Events>
            <NotificationDetail>
                <NotificationType>EMAIL</NotificationType>
                <EmailDetail>
                    <EmailAddress>XXXX@YOUREMAIL.com</EmailAddress>
                    <Name>MANAGER Email</Name>
                </EmailDetail>
                <Localization>
                    <LanguageCode>EN</LanguageCode>
                </Localization>
            </NotificationDetail>
            <FormatSpecification>
                <Type>HTML</Type>
            </FormatSpecification>
        </EventNotifications>
    </EventNotificationDetail>
</SpecialServicesRequested>
...