1

I need to deserialize an XML which appers like

`

<?xml version="1.0" encoding="UTF-8" ?>
<air-search-result xmlns="http://www.cleartrip.com/air/">
    <onward-solutions>
        <solution>
            <pricing-summary>
                <base-fare>2000.00</base-fare>
                <taxes>2887.40</taxes>
                <total-fare>4887.40</total-fare>
            </pricing-summary>
            <flights>
                <flight>
                    <segments>
                        <segment>
                            <index>1</index>
                            <departure-airport>BOM</departure-airport>
                            <arrival-airport>CCU</arrival-airport>
                            <departure-date-time>2008-11-01T09:20:00</departure-date-time>
                            <arrival-date-time>2008-11-01T12:00:00</arrival-date-time>
                            <airline>6E</airline>
                            <flight-number>321</flight-number>
                            <operating-airline>6E</operating-airline>
                            <stops>0</stops>
                            <equipment>320</equipment>
                            <duration>9600</duration>
                        </segment>
                    </segments>
                </flight>
            </flights>
            <pax-pricing-info-list>
                <pax-pricing-info>
                    <pax-type>ADT</pax-type>
                    <pricing-info-list>
                        <pricing-info>
                            <index>1</index>
                            <fare-basis-code>H0BOMCCU</fare-basis-code>
                            <fare-key>SomeGUIDKEY</fare-key>
                            <pricing-elements>
                                <pricing-element>
                                    <category>TAX</category>
                                    <code>CLEARTRIP-SVC</code>
                                    <amount>12.40</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>BF</category>
                                    <amount>2000.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>TAX</category>
                                    <code>PSF</code>
                                    <amount>225.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>TAX</category>
                                    <code>YQ</code>
                                    <amount>2350.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>TAX</category>
                                    <code>YR</code>
                                    <amount>150.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>TAX</category>
                                    <code>TF</code>
                                    <amount>100.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>TAX</category>
                                    <code>AIRLINE-MSC</code>
                                    <amount>50.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>MKP</category>
                                    <amount>0.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>DIS</category>
                                    <amount>0.00</amount>
                                </pricing-element>
                            </pricing-elements>
                        </pricing-info>
                    </pricing-info-list>
                    <booking-info-list>
                        <booking-info>
                            <index>1</index>
                            <segment-index>1</segment-index>
                            <pricing-info-index>1</pricing-info-index>
                            <booking-class>R</booking-class>
                            <cabin-type>E</cabin-type>
                            <ticket-type>E</ticket-type>
                        </booking-info>
                    </booking-info-list>
                </pax-pricing-info>
            </pax-pricing-info-list>
        </solution>
    </onward-solutions>
    <return-solutions>
        <solution>
            <pricing-summary>
                <base-fare>1500.00</base-fare>
                <taxes>2884.30</taxes>
                <total-fare>4384.30</total-fare>
            </pricing-summary>
            <flights>
                <flight>
                    <segments>
                        <segment>
                            <index>1</index>
                            <departure-airport>CCU</departure-airport>
                            <arrival-airport>BOM</arrival-airport>
                            <departure-date-time>2008-11-10T05:50:00</departure-date-time>
                            <arrival-date-time>2008-11-10T08:30:00</arrival-date-time>
                            <airline>6E</airline>
                            <flight-number>320</flight-number>
                            <operating-airline>6E</operating-airline>
                            <stops>0</stops>
                            <equipment>320</equipment>
                            <duration>9600</duration>
                        </segment>
                    </segments>
                </flight>
            </flights>
            <pax-pricing-info-list>
                <pax-pricing-info>
                    <pax-type>ADT</pax-type>
                    <pricing-info-list>
                        <pricing-info>
                            <index>1</index>
                            <fare-basis-code>K0BOMCCU</fare-basis-code>
                            <fare-key>SomeGUIDKEY</fare-key>
                            <pricing-elements>
                                <pricing-element>
                                    <category>TAX</category>
                                    <code>CLEARTRIP-SVC</code>
                                    <amount>9.30</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>BF</category>
                                    <amount>1500.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>TAX</category>
                                    <code>PSF</code>
                                    <amount>225.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>TAX</category>
                                    <code>YQ</code>
                                    <amount>2350.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>TAX</category>
                                    <code>YR</code>
                                    <amount>150.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>TAX</category>
                                    <code>TF</code>
                                    <amount>100.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>TAX</category>
                                    <code>AIRLINE-MSC</code>
                                    <amount>50.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>MKP</category>
                                    <amount>0.00</amount>
                                </pricing-element>
                                <pricing-element>
                                    <category>DIS</category>
                                    <amount>0.00</amount>
                                </pricing-element>
                            </pricing-elements>
                        </pricing-info>
                    </pricing-info-list>
                    <booking-info-list>
                        <booking-info>
                            <index>1</index>
                            <segment-index>1</segment-index>
                            <pricing-info-index>1</pricing-info-index>
                            <booking-class>R</booking-class>
                            <cabin-type>E</cabin-type>
                            <ticket-type>E</ticket-type>
                        </booking-info>
                    </booking-info-list>
                </pax-pricing-info>
            </pax-pricing-info-list>
        </solution>
    </return-solutions>
</air-search-result>

`

I have a Service that would make a call to an external service and the external service would return an object like this. I need to mock the service for an instance to see that I have everything in Place. But unfortunately I have got no classes containing the above information and hence I cannot deserialize it. Can Somebody help?

4

0 回答 0