<I am trying to find the exact path in XML to input/set the new value for KARATE API validation

29 views Asked by At

I am using the below XML and I need to set the value for below tag 10 times in XML.

  1. Polnumber

And also I want to print the new XML with the 10 updated new PolNumber. What should I write in feature file for this SOAP XML?

I have written below code, but the newly updated value is not getting print.

  • def Info = read('data.xml')
  • set Info/Policy[@CarrierPartyID='Party_Carrier']/PolNumber = 'P123456'
  • print Info

XML:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.iwa.dtcc.com/" xmlns:ns="http://ACORD.org/Standards/Life/2">
    <soapenv:Header>
        <ser:MessageHeader>
            <MessageName>VI</MessageName>
            <RouteInfo>
                <FromParticipant>0057</FromParticipant>
                <ToParticipant>4516</ToParticipant>
                <Sender>0057</Sender>
                <TransmissionDate>2020-10-08</TransmissionDate>
                <TransmissionTime>13:32:35</TransmissionTime>
            </RouteInfo>
        </ser:MessageHeader>
    </soapenv:Header>
    <soapenv:Body>
        <ser:processValueInquiry xmlns="http://service.iwa.dtcc.com/">
            <VI_Msg xmlns="http://ACORD.org/Standards/Life/2">
                <TXLife xmlns="http://ACORD.org/Standards/Life/2" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                    <TXLifeRequest PrimaryObjectID="AnnuityOrder27995">
                        <TransRefGUID>SOAPUI-21207-2019030611</TransRefGUID>
                        <TransType tc="212">212</TransType>
                        <TransSubType tc="21207">21207</TransSubType>
                        <TransExeDate>2019-06-06</TransExeDate>
                        <TransExeTime>13:32:35</TransExeTime>
                        <PendingResponseOK tc="0">False</PendingResponseOK>
                        <OLifE>
                            <Holding id="AnnuityOrder27995">
                                <HoldingTypeCode tc="2">Policy</HoldingTypeCode>
                                <DistributorClientAcctNum>8888</DistributorClientAcctNum>
                                <Policy CarrierPartyID="Party_Carrier">
                                    <PolNumber>A235689</PolNumber>
                                    <CarrierCode>5544</CarrierCode>
                                    <CusipNum>5555</CusipNum>
                                </Policy>
                            </Holding>
                        </OLifE>
                    </TXLifeRequest>
                </TXLife>
            </VI_Msg>
        </ser:processValueInquiry>
    </soapenv:Body>
</soapenv:Envelope>
0

There are 0 answers