Repeating elements/groups in the SOAP response

Verrouillé Repeating elements/groups in the SOAP response

  • jeudi 3 mai 2012 12:32
     
     

    Hi all,

       We have repeating elements/groups in the SOAP response so We want to filter out the duplicates.How should We filter them?Plz find attached Source.xml which has current SOAPMessage.We want to filter them as Destination.xml.

    Source.xml

    Source.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dp="http://www.datapower.com/extensions" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://Test/v1/">
        <soapenv:Header/>
        <soapenv:Body>
            <v1:GetTestWSResponse>      
                <v1:CardNumber>12345</v1:CardNumber>
                <v1:ProgramInfoList>
                    <v1:ProgramInfo>
                        <v1:PartnerInformationGrp>
                            <v1:PartnerId>H</v1:PartnerId>
                            <v1:ProgId>H00002</v1:ProgId>                 
                        </v1:PartnerInformationGrp>
                        <v1:AmtInformationGrp>                
                            <v1:HighAmt>19999.00</v1:HighAmt>
                            <v1:LowAmt>0.00</v1:LowAmt>
                        </v1:AmtInformationGrp>
                    </v1:ProgramInfo>
                    <v1:ProgramInfo>
                        <v1:PartnerInformationGrp>
                            <v1:PartnerId>H</v1:PartnerId>
                            <v1:ProgId>H00001</v1:ProgId>                 
                        </v1:PartnerInformationGrp>
                        <v1:AmtInformationGrp>                
                            <v1:HighAmt>24.00</v1:HighAmt>
                            <v1:LowAmt>2.00</v1:LowAmt>
                        </v1:AmtInformationGrp>
                    </v1:ProgramInfo>
                    <v1:ProgramInfo>
                        <v1:PartnerInformationGrp>
                            <v1:PartnerId>H</v1:PartnerId>
                            <v1:ProgId>H00002</v1:ProgId>                 
                        </v1:PartnerInformationGrp>
                        <v1:AmtInformationGrp>                
                            <v1:HighAmt>19.00</v1:HighAmt>
                            <v1:LowAmt>12.00</v1:LowAmt>
                        </v1:AmtInformationGrp>
                    </v1:ProgramInfo>
                    <v1:ProgramInfo>
                        <v1:PartnerInformationGrp>
                            <v1:PartnerId>H</v1:PartnerId>
                            <v1:ProgId>H00001</v1:ProgId>                 
                        </v1:PartnerInformationGrp>
                        <v1:AmtInformationGrp>                
                            <v1:HighAmt>1744.00</v1:HighAmt>
                            <v1:LowAmt>99.00</v1:LowAmt>
                        </v1:AmtInformationGrp>
                    </v1:ProgramInfo>
                    <v1:ProgramInfo>
                        <v1:PartnerInformationGrp>
                            <v1:PartnerId>H</v1:PartnerId>
                            <v1:ProgId>H00002</v1:ProgId>                 
                        </v1:PartnerInformationGrp>
                        <v1:AmtInformationGrp>                
                            <v1:HighAmt>147.00</v1:HighAmt>
                            <v1:LowAmt>72.00</v1:LowAmt>
                        </v1:AmtInformationGrp>
                    </v1:ProgramInfo>
                </v1:ProgramInfoList>
            </v1:GetTestWSResponse>
        </soapenv:Body>
    </soapenv:Envelope>

    Destintion.xml: This type of output we are expecting.

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dp="http://www.datapower.com/extensions" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://Test/v1/">
        <soapenv:Header/>
        <soapenv:Body>
            <v1:GetTestWSResponse>      
                <v1:CardNumber>12345</v1:CardNumber>
                <v1:ProgramInfoList>
                    <v1:ProgramInfo>
                        <v1:PartnerInformationGrp>
                            <v1:PartnerId>H</v1:PartnerId>
                            <v1:ProgId>H00002</v1:ProgId>                 
                        </v1:PartnerInformationGrp>
                        <v1:AmtInformationGrp>                
                            <v1:HighAmt>19999.00</v1:HighAmt>
                            <v1:LowAmt>0.00</v1:LowAmt>
                        </v1:AmtInformationGrp>
                        <v1:AmtInformationGrp>                
                            <v1:HighAmt>19.00</v1:HighAmt>
                            <v1:LowAmt>12.00</v1:LowAmt>
                        </v1:AmtInformationGrp>
                        <v1:AmtInformationGrp>                
                            <v1:HighAmt>147.00</v1:HighAmt>
                            <v1:LowAmt>72.00</v1:LowAmt>
                        </v1:AmtInformationGrp>
                    </v1:ProgramInfo>
                    <v1:ProgramInfo>
                        <v1:PartnerInformationGrp>
                            <v1:PartnerId>H</v1:PartnerId>
                            <v1:ProgId>H00001</v1:ProgId>                 
                        </v1:PartnerInformationGrp>
                        <v1:AmtInformationGrp>                
                            <v1:HighAmt>24.00</v1:HighAmt>
                            <v1:LowAmt>2.00</v1:LowAmt>
                        </v1:AmtInformationGrp>
                        <v1:AmtInformationGrp>                
                            <v1:HighAmt>1744.00</v1:HighAmt>
                            <v1:LowAmt>99.00</v1:LowAmt>
                        </v1:AmtInformationGrp>
                    </v1:ProgramInfo>                      
                </v1:ProgramInfoList>
            </v1:GetTestWSResponse>
        </soapenv:Body>
    </soapenv:Envelope>

    Thanks