Hi there,

 

I am stuck with a binding problem.

This is my mapping file:

 

<binding>

   

    <mapping class="co.za.easypay.billpayment.message.VagasFinancialRepRequest" name="VagasFinancialRepRequest" ordered="false">

        <structure field="billPaymentAdviceRequest" usage="optional" />

    </mapping>

    <mapping name="billPaymentAdviceRequest" class="co.za.easypay.billpayment.message.BillPaymentAdviceRequest" >

        <structure name="originalRequest" field="originalRequest" >

            <value  name="reference" field="reference" />

            <value  name="date" field="date" />

            <value  name="time" field="time" />

        </structure>

        <collection field="tenders" />

        <value  name="reversalReason" field="reversalReason" />  

    </mapping>

    <mapping name="tender" class="co.za.easypay.billpayment.message.Tender" >

        <value  name="amount" field="amount" />

        <value  name="tenderRef" field="tenderRef" />

        <value  name="tenderPan" field="tenderPan" />

        <value  name="linkSequence" field="linkSequence" />

        <value  name="type" field="type" style="attribute" />

    </mapping> 

</binding>

 

This is my xml

 

<VagasFinancialRepRequest>

    <billPaymentAdviceRequest>

        <originalRequest>

            <reference>asd223</reference>

            <date>19850201</date>

            <time>123512</time>

        </originalRequest>

        <tender type="creditCard">

            <amount>7545</amount>

            <tenderRef>45745723</tenderRef>

            <tenderPan>8889977776000</tenderPan>

            <linkSequence>1</linkSequence>

        </tender>

        <reversalReason>Can I get a wud wud</reversalReason>

    </billPaymentAdviceRequest>

</VagasFinancialRepRequest>

 

When I run this I get this error:

Exception in thread "main" org.jibx.runtime.JiBXException: No unmarshaller for element "reversalReason" (line 15, col 25)

      at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unknown Source)

      at co.za.easypay.billpayment.message.JiBX_MungeAdapter.JiBX_binding_unmarshal_1_0()

      at co.za.easypay.billpayment.message.BillPaymentAdviceRequest.JiBX_binding_unmarshal_1_2(BillPaymentAdviceRequest.java)

      at co.za.easypay.billpayment.message.JiBX_bindingBillPaymentAdviceRequest_access.unmarshal()

      at co.za.easypay.billpayment.message.VagasFinancialRepRequest.JiBX_binding_unmarshal_1_2(VagasFinancialRepRequest.java)

      at co.za.easypay.billpayment.message.JiBX_bindingVagasFinancialRepRequest_access.unmarshal()

      at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unknown Source)

      at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(Unknown Source)

      at co.za.easypay.billpayment.message.Run_Test.main(Run_Test.java:23)

 

When I put reversalReason before originalRequest, it works. But it cant be like that, it has to be after tenders.

Reply via email to