Hello Stack Exchange community,
I'm trying to make a Equifax API to get credit information (don't worry the data you see is all dummy data). I'm using their XML input. I am receiving the XML response just fine, but for some god awful reason the equifax developers decided to add some 'extra' content at the end of outside of the XML tags.
This essentially makes the xml un-parseable in php. Is there a way to strip out the extra content at the end?
Here is the XML response. Look after the closing EfxTransmit tag
<?xml version="1.0" encoding="UTF-8"?>
<EfxTransmit>
<EfxReport requestNumber="1" reportId="USConsumerCreditReport">
<USDecisionPowerExpressReports>
<USDecisionPowerExpressReport subjectType="Subject" multipleNumber="1">
<USMasterHeader>
<CustomerReferenceNumber>EFX QA</CustomerReferenceNumber>
<CustomerNumber>999KI00553</CustomerNumber>
<ECOAInquiryType>I</ECOAInquiryType>
<DateOfRequest format="MM/DD/CCYY">02/23/2017</DateOfRequest>
<EquifaxReferenceNumber>187388032</EquifaxReferenceNumber>
</USMasterHeader>
<USConsumerCreditReport subjectType="Subject" multipleNumber="1">
<USHeader>
<Request>
<CustomerReferenceNumber>EFX QA</CustomerReferenceNumber>
<CustomerNumber>999KI00553</CustomerNumber>
<ConsumerReferralCode>024</ConsumerReferralCode>
<ECOAInquiryType>I</ECOAInquiryType>
<NumberOfMonthsToCountInquiries>Last 24 Months</NumberOfMonthsToCountInquiries>
<NumberOfMonthsToCountDelinquencies>Last 6 Years, 11 Months</NumberOfMonthsToCountDelinquencies>
</Request>
<CreditFile>
<HitCode code="1" description="Hit"/>
<FileSinceDate format="MM/DD/CCYY">04/16/2003</FileSinceDate>
<DateOfLastActivity format="MM/DD/CCYY">01/24/2017</DateOfLastActivity>
<DateOfRequest format="MM/DD/CCYY">02/23/2017</DateOfRequest>
<Identityscans>
<Identityscan code="8" description="Unable to perform telephone validation due to insufficient telephone input"/>
</Identityscans>
<AddressDiscrepancyIndicator>N</AddressDiscrepancyIndicator>
<CreateCode>2</CreateCode>
<FileStatus1>016</FileStatus1>
<FileStatus2>242</FileStatus2>
<FileStatus3>004</FileStatus3>
<BureauCode>244</BureauCode>
</CreditFile>
<Subject>
<SubjectName>
<LastName>DGNNLXZ</LastName>
<FirstName>CHANITA</FirstName>
<MiddleName>S</MiddleName>
</SubjectName>
<SubjectId>
<SubjectSSN>66639074</SubjectSSN>
<DateOfBirth format="MM/DD/CCYY">08/17/1988</DateOfBirth>
</SubjectId>
</Subject>
</USHeader>
<USAddresses>
<USAddress code="CA" description="Current Address">
<ParsedStreetAddress>
<StreetNumber>4338</StreetNumber>
<StreetName>W POTOMAC</StreetName>
<StreetType>AVE</StreetType>
</ParsedStreetAddress>
<City>CHICAGO</City>
<State>IL</State>
<PostalCode>60651</PostalCode>
<DateAddressFirstReported format="MM/CCYY">07/2015</DateAddressFirstReported>
<AddressSource code="T" description="Tape"/>
<DateAddressLastReported format="MM/CCYY">02/2017</DateAddressLastReported>
</USAddress>
<USAddress code="FA" description="Former Address">
<ParsedStreetAddress>
<StreetNumber>1301</StreetNumber>
<StreetName>BRUMMEL</StreetName>
<StreetType>ST APT 8</StreetType>
</ParsedStreetAddress>
<City>EVANSTON</City>
<State>IL</State>
<PostalCode>60202</PostalCode>
<DateAddressFirstReported format="MM/CCYY">04/2015</DateAddressFirstReported>
<AddressSource code="T" description="Tape"/>
<DateAddressLastReported format="MM/CCYY">04/2015</DateAddressLastReported>
</USAddress>
<USAddress code="F2" description="Second Former Address">
<ParsedStreetAddress>
<StreetNumber>1208</StreetNumber>
<StreetName>W JEFFERSON</StreetName>
<StreetType>ST APT C</StreetType>
</ParsedStreetAddress>
<City>SPRINGFIELD</City>
<State>IL</State>
<PostalCode>62702</PostalCode>
<DateAddressFirstReported format="MM/CCYY">06/2014</DateAddressFirstReported>
<AddressSource code="T" description="Tape"/>
<DateAddressLastReported format="MM/CCYY">06/2014</DateAddressLastReported>
</USAddress>
</USAddresses>
<USEmployments>
<USEmployment code="ES" description="Last Reported Employment">
<Occupation>CORRECTION OFF</Occupation>
<Employer>MACON STATE PRISON</Employer>
</USEmployment>
</USEmployments>
<USFICO>
<FICOScore>00650</FICOScore>
<ScoreReasons>
<ScoreReason code="00038" description="Serious delinquency, and derogatory public record or collection filed" number="1"/>
<ScoreReason code="00010" description="Prop of balances to credit limits is too high on bank rev or other rev accts" number="2"/>
<ScoreReason code="00018" description="Number of accounts with delinquency" number="3"/>
<ScoreReason code="00014" description="Length of time accounts have been established" number="4"/>
</ScoreReasons>
<ScoreIndicator code="J" description="FICO Score 5 based on Equifax Data (NF)"/>
</USFICO>
<USIdentificationSSN>
<MDBSubjectSSN>666390749</MDBSubjectSSN>
<InquirySubjectSSN>666390749</InquirySubjectSSN>
<InquirySSNDateIssued>1992</InquirySSNDateIssued>
<InquirySSNStateIssued>GA</InquirySSNStateIssued>
</USIdentificationSSN>
</USConsumerCreditReport>
<USDecisionPowerExpressSegment>
<ConsumerDisclosureIndicator></ConsumerDisclosureIndicator>
<ReportTextMessage>OFFER C</ReportTextMessage>
<SSNVarianceIndicator></SSNVarianceIndicator>
<DPExpressProducts>
<DPExpressProduct number="1">
<Description>A</Description>
<ApprovalIndicator>N</ApprovalIndicator>
<Limit></Limit>
<Miscellaneous></Miscellaneous>
</DPExpressProduct>
<DPExpressProduct number="2">
<Description>B</Description>
<ApprovalIndicator>N</ApprovalIndicator>
<Limit></Limit>
<Miscellaneous></Miscellaneous>
</DPExpressProduct>
<DPExpressProduct number="3">
<Description>C</Description>
<ApprovalIndicator>Y</ApprovalIndicator>
<Limit></Limit>
<Miscellaneous></Miscellaneous>
</DPExpressProduct>
<DPExpressProduct number="4">
<Description>D</Description>
<ApprovalIndicator>N</ApprovalIndicator>
<Limit></Limit>
<Miscellaneous></Miscellaneous>
</DPExpressProduct>
</DPExpressProducts>
</USDecisionPowerExpressSegment>
</USDecisionPowerExpressReport>
</USDecisionPowerExpressReports>
<USPrintImage><![CDATA[TRANSACTION NUMBER: 187388032
BRANCH NUMBER: EFX QA
NO SUBSTANTIAL DIFFERENCE WAS FOUND BETWEEN INQUIRY ADDRESS(ES) AND
THE EXISTING CREDIT FILE ADDRESS(ES).
Product Approval Limit Misc
Indicator
C Y
OFFER C
**** Credit Report Information ****************************************
Equifax Information Services LLC
P O Box 740241, Atlanta, GA 30374-0241
800/685-1111
Name: CHANITA S DGNNLXZ Since: 04162003 SSN: 66639074
DOB/Age: 08/17/1988 Last Activity: 01242017 Report Date: 02232017
072015 4338 W POTOMAC AVE, CHICAGO IL 60651
042015 1301 BRUMMEL ST APT 8, EVANSTON IL 60202
062014 1208 W JEFFERSON ST APT C, SPRINGFIELD IL 62702
Employment information:
MACON STATE PRISON, CORRECTION OFF
Identity Scan: UNABLE TO PERFORM TELEPHONE VALIDATION DUE TO INSUFFICIENT TELEPHONE INPUT.
Customer Reference: EFX QA
ADI: NO SUBSTANTIAL DIFFERENCE WAS FOUND BETWEEN INQUIRY ADDRESS(ES) AND
THE EXISTING CREDIT FILE ADDRESS(ES).
FICO Score 5-EFX-N: 00650 00038 00010 00018 00014 Reject:
Serious delinquency, and derogatory public record or collection filed
Prop of balances to credit limits is too high on bank rev or other rev accts
Number of accounts with delinquency
Length of time accounts have been established
END OF REPORT
]]>
</USPrintImage>
</EfxReport>
</EfxTransmit>
FULLEFX QA 999KI005530241I02 1041620030124201702232017DGNNLXZ CHANITA S 66639074 08171988 0010101000000010000000000000000000000000000000000000000000000010000000000010000000100000000000000000000000000000000000000N I 2016242004244 8CA4338 W POTOMAC AVE CHICAGO IL60651 072015 T022017 FA1301 BRUMMEL ST APT 8 EVANSTON IL60202 042015 T042015 F21208 W JEFFERSON ST APT C SPRINGFIELD IL62702 062014 T062014 ESCORRECTION OFF MACON STATE PRISON CP0065000038000100001800014 J SS 666390749 6663907491992GA DP A N B N C Y D N
Related
I have tried to import the sale order voucher using XML format from external application by using CURL POST Request (External Application built by using PHP Laravel) in tally prime. I have got following error:.
Stock Item 'TEST 4KG/CM²' does not exist!
When I check tally.imp file I got following error:
ERROR: Voucher: ID:<REMOTEID:SO-2223-00000013>, Voucher Type: Sales Order, Source Voucher Number: SO-2223-00000013, Voucher Number: SO-2223-00000013, Date: 2-Jun-22
Stock Item 'TEST 4KG/CM²' does not exist!
But when I have tried to import same data imported via xml file to tally prime, it worked properly. The stock item exists in ally prime.
My Code (inventory part) looks like follows:
<ALLINVENTORYENTRIES.LIST>
<STOCKITEMNAME>TEST 4KG/CM²</STOCKITEMNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<ISLASTDEEMEDPOSITIVE>No</ISLASTDEEMEDPOSITIVE>
<ISAUTONEGATE>No</ISAUTONEGATE>
<ISCUSTOMSCLEARANCE>No</ISCUSTOMSCLEARANCE>
<ISTRACKCOMPONENT>No</ISTRACKCOMPONENT>
<ISTRACKPRODUCTION>No</ISTRACKPRODUCTION>
<ISPRIMARYITEM>No</ISPRIMARYITEM>
<ISSCRAP>No</ISSCRAP>
<RATE>52.45/MTR</RATE>
<DISCOUNT> 0</DISCOUNT>
<AMOUNT>9441</AMOUNT>
<ACTUALQTY> 180 MTR = 900 NOS</ACTUALQTY>
<BILLEDQTY> 180 MTR = 900 NOS</BILLEDQTY>
<BATCHALLOCATIONS.LIST>
<MFDON></MFDON>
<GODOWNNAME></GODOWNNAME>
<BATCHNAME> Primary Batch</BATCHNAME>
<DESTINATIONGODOWNNAME></DESTINATIONGODOWNNAME>
<INDENTNO/>
<ORDERNO> SO-2223-00000013</ORDERNO>
<TRACKINGNUMBER/>
<DYNAMICCSTISCLEARED>No</DYNAMICCSTISCLEARED>
<AMOUNT>9441</AMOUNT>
<ACTUALQTY> 180 MTR = 900 NOS </ACTUALQTY>
<BILLEDQTY> 180 MTR = 900 NOS</BILLEDQTY>
<ORDERDUEDATE JD="" p=" 20220602"> 20220602</ORDERDUEDATE>
<ADDITIONALDETAILS.LIST></ADDITIONALDETAILS.LIST>
<VOUCHERCOMPONENTLIST.LIST></VOUCHERCOMPONENTLIST.LIST>
</BATCHALLOCATIONS.LIST>
<ACCOUNTINGALLOCATIONS.LIST>
<OLDAUDITENTRYIDS.LIST TYPE="Number">
<OLDAUDITENTRYIDS>-1</OLDAUDITENTRYIDS>
</OLDAUDITENTRYIDS.LIST>
<LEDGERNAME></LEDGERNAME>
<GSTCLASS/>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<LEDGERFROMITEM>No</LEDGERFROMITEM>
<REMOVEZEROENTRIES>No</REMOVEZEROENTRIES>
<ISPARTYLEDGER>No</ISPARTYLEDGER>
<ISLASTDEEMEDPOSITIVE>No</ISLASTDEEMEDPOSITIVE>
<ISCAPVATTAXALTERED>No</ISCAPVATTAXALTERED>
<ISCAPVATNOTCLAIMED>No</ISCAPVATNOTCLAIMED>
<AMOUNT>9441</AMOUNT>
</ACCOUNTINGALLOCATIONS.LIST>
</ALLINVENTORYENTRIES.LIST>
I am trying to get the shipping charges.
Here is my request:
<?xml version="1.0" encoding="utf-8"?>
<p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-req.xsd ">
<GetQuote>
<Request>
<ServiceHeader>
<MessageTime>2017-10-20T11:28:56.000-08:00</MessageTime>
<MessageReference>pukka301934229934707056790226292</MessageReference>
<SiteID>******</SiteID>
<Password>******</Password>
</ServiceHeader>
</Request>
<From>
<CountryCode>DE</CountryCode>
<Postalcode>10717</Postalcode>
<City>BERLIN</City>
</From>
<BkgDetails>
<PaymentCountryCode>DE</PaymentCountryCode>
<Date>2017-10-19</Date>
<ReadyTime>PT9H</ReadyTime>
<DimensionUnit>CM</DimensionUnit>
<WeightUnit>KG</WeightUnit>
<Pieces>
<Piece>
<PieceID>1</PieceID>
<Height>30</Height>
<Depth>30</Depth>
<Width>30</Width>
<Weight>250</Weight>
</Piece>
</Pieces>
<IsDutiable>Y</IsDutiable>
</BkgDetails>
<To>
<CountryCode>US</CountryCode>
<Postalcode>60603</Postalcode>
<City>CHICAGO</City>
</To>
<Dutiable>
<DeclaredCurrency>EUR</DeclaredCurrency>
<DeclaredValue>90</DeclaredValue>
</Dutiable>
</GetQuote>
</p:DCTRequest>
I am getting the error:
The requested Global Product Code and Local Product Code is not available based on origin country DE postal location and destination country US postal location for payment country DE.
Please make sure data entered is valid before proceeding or contact our customer service.
But when I change
<DimensionUnit>CM</DimensionUnit>
<WeightUnit>KG</WeightUnit>
to
<DimensionUnit>IN</DimensionUnit>
<WeightUnit>LB</WeightUnit>
I get the shipping amount. But I need to send the value in CM and KG. Please help me figure out the error.
One of the reasons could be that you are exceeding the maximum weight limit or passing an incorrect value for the CM and KG units.
Add a lower value for the weight, start with 10 KG.
I am new in SOAP API web services in PHP, I have to accept XML input and also return in XML. please suggest some code sample. Actually I am working on channel manager for my hotel.
Input XML...
<ns3:OTA_HotelResNotifRQ ResStatus="Commit" EchoToken="dsh0a"
xmlns:ns2="http://www.example.com/hotels/channelmgr/"
xmlns:ns3="http://www.example.org/OTA/2003/05/beta">
<ns3:POS>
<ns3:Source>
<ns3:BookingChannel>
<ns3:CompanyName CompanyShortName="MMYT" Code="MMYT"
CountryCode="IN">Make My Trip</ns3:CompanyName>
</ns3:BookingChannel>
</ns3:Source>
</ns3:POS>
<ns3:HotelReservations>
<ns3:HotelReservation ResStatus="Commit" CreateDateTime="2014-05-19">
<ns3:UniqueID ID="AB123456789012"/>
<ns3:RoomStays>
<ns3:RoomStay>
<ns3:RoomTypes>
<ns3:RoomType NumberOfUnits="1" RoomTypeCode="Float"/>
</ns3:RoomTypes>
<ns3:RatePlans>
<ns3:RatePlan>
Make My Trip CONFIDENTIAL 7
<ns3:MealsIncluded MealPlanCodes="CP"/>
</ns3:RatePlan>
</ns3:RatePlans>
<ns3:RoomRates>
<ns3:RoomRate EffectiveDate="2014-05-20" ExpireDate="2014-05-21"
RatePlanCode="1234567891234"/>
<ns3:RoomRate EffectiveDate="2014-05-21" ExpireDate="2014-05-22"
RatePlanCode="98765437291739"/>
</ns3:RoomRates>
</ns3:RoomStay>
<ns3:RoomStay>
<ns3:RoomTypes>
<ns3:RoomType NumberOfUnits="1" RoomTypeCode="Float"/>
</ns3:RoomTypes>
<ns3:RatePlans>
<ns3:RatePlan>
<ns3:MealsIncluded MealPlanCodes="CP"/>
</ns3:RatePlan>
</ns3:RatePlans>
<ns3:RoomRates>
<ns3:RoomRate EffectiveDate="2014-05-20" ExpireDate="2014-05-21"
RatePlanCode="1234567891234"/>
Make My Trip CONFIDENTIAL 8
<ns3:RoomRate EffectiveDate="2014-05-21" ExpireDate="2014-05-22"
RatePlanCode="98765437291739"/>
</ns3:RoomRates>
</ns3:RoomStay>
<ns3:RoomStay>
<ns3:RoomTypes>
<ns3:RoomType NumberOfUnits="1" RoomTypeCode="Float"/>
</ns3:RoomTypes>
<ns3:RatePlans>
<ns3:RatePlan>
<ns3:MealsIncluded MealPlanCodes="CP"/>
</ns3:RatePlan>
</ns3:RatePlans>
<ns3:RoomRates>
<ns3:RoomRate EffectiveDate="2014-05-20" ExpireDate="2014-05-21"
RatePlanCode="1234567891234"/>
<ns3:RoomRate EffectiveDate="2014-05-21" ExpireDate="2014-05-22"
RatePlanCode="98765437291739"/>
</ns3:RoomRates>
</ns3:RoomStay>
</ns3:RoomStays>
<ns3:Services>
<ns3:Service>
<ns3:Price>
Make My Trip CONFIDENTIAL 9
<ns3:AdditionalGuestAmounts AmountBeforeTax="362.00"
CurrencyCode="INR" DecimalPlaces="2"/>
<ns3:Total AmountAfterTax="4249.98" CurrencyCode="INR"
DecimalPlaces="2">
<ns3:Taxes>
<ns3:Tax Amount="947.98" CurrencyCode="INR" DecimalPlaces="2">
<ns3:TaxDescription Name="Hotelier Tax"/>
</ns3:Tax>
<ns3:Tax Amount="126.00" CurrencyCode="INR" DecimalPlaces="2">
<ns3:TaxDescription Name="TDS"/>
</ns3:Tax>
</ns3:Taxes>
</ns3:Total>
</ns3:Price>
<ns3:ServiceDetails>
<ns3:GuestCounts>
<ns3:GuestCount AgeQualifyingCode="10" Count="6"/>
<ns3:GuestCount AgeQualifyingCode="8" Count="2"/>
</ns3:GuestCounts>
</ns3:ServiceDetails>
</ns3:Service>
</ns3:Services>
<ns3:ResGuests>
<ns3:ResGuest PrimaryIndicator="true">
Make My Trip CONFIDENTIAL 10
<ns3:Profiles>
<ns3:ProfileInfo>
<ns3:Profile>
<ns3:Customer>
<ns3:PersonName>
<ns3:GivenName>Test</ns3:GivenName>
</ns3:PersonName>
</ns3:Customer>
</ns3:Profile>
</ns3:ProfileInfo>
</ns3:Profiles>
</ns3:ResGuest>
</ns3:ResGuests>
<ns3:ResGlobalInfo>
<ns3:TimeSpan Start="2014-05-20" End="2014-05-22"/>
<ns3:CancelPenalties>
<ns3:CancelPenalty>
<ns3:PenaltyDescription>
<ns3:Text># More than 2 days before check-in date: FREE CANCELLATION; 2
days before check-in date: 1 night cost will be charged as
cancellation fee; In case of no show: no refund; An additional
MakeMyTrip service charge of INR 250 will apply
</ns3:Text>
</ns3:PenaltyDescription>
Make My Trip CONFIDENTIAL 11
</ns3:CancelPenalty>
</ns3:CancelPenalties>
<ns3:HotelReservationIDs>
<ns3:HotelReservationID ResID_Type="14" ResID_Value="AB123456789012"
ResID_Date="2014-05-19"/>
</ns3:HotelReservationIDs>
<ns3:BasicPropertyInfo HotelCode="987654321987654321" HotelName="The
test test"/>
</ns3:ResGlobalInfo>
</ns3:HotelReservation>
</ns3:HotelReservations>
</ns3:OTA_HotelResNotifRQ>
Output XML...
<OTA_HotelResNotifRS
xmlns="http://www.opentravel.org/OTA/2003/05/beta" Version="1.0"
TimeStamp="2012-04-27T10:56:34" EchoToken="UUicg">
<Success />
<HotelReservations>
<HotelReservation>
<UniqueID Type="14" ID="AB123456789" />
<ResGlobalInfo>
<HotelReservationIDs>
<HotelReservationID ResID_Type="14"
ResID_Value=" YourConfirmationNo " />
</HotelReservationIDs>
</ResGlobalInfo>
</HotelReservation>
</HotelReservations>
</OTA_HotelResNotifRS>
I have a data set which looks like this:
701 B STREET
SUITE C
SAN DIEGO,CA 92101
¥************CAR INFO******************
¥ZE CD-1337966
¥ZI CD-D515000 FOR MONTHLY RATES PLS CALL
¥AVIS MINI LEASE PLS CALL 800-524-9000 EXT 3034
¥CONTACT EMAIL CANDACE.GREER.AT.CENDANT.COM
¥ANY OTHER CAR COMPANY USED OTHER THAN THE ABOVE
¥WILL NOT REIMBURSED FOR THE COST OF INSURANCE
I want to replace the Yen symbol.
I tried this :
$data_result=str_replace(chr(0xC2).chr(0xA5),"",$data);
Still could not replace the expression.
Thank you guys in advance.
How about:
$str = '701 B STREET
SUITE C
SAN DIEGO,CA 92101
¥************CAR INFO******************
¥ZE CD-1337966
¥ZI CD-D515000 FOR MONTHLY RATES PLS CALL
¥AVIS MINI LEASE PLS CALL 800-524-9000 EXT 3034
¥CONTACT EMAIL CANDACE.GREER.AT.CENDANT.COM
¥ANY OTHER CAR COMPANY USED OTHER THAN THE ABOVE
¥WILL NOT REIMBURSED FOR THE COST OF INSURANCE';
$str = preg_replace('/¥/u', '', $str);
echo $str;
output:
701 B STREET
SUITE C
SAN DIEGO,CA 92101
************CAR INFO******************
ZE CD-1337966
ZI CD-D515000 FOR MONTHLY RATES PLS CALL
AVIS MINI LEASE PLS CALL 800-524-9000 EXT 3034
CONTACT EMAIL CANDACE.GREER.AT.CENDANT.COM
ANY OTHER CAR COMPANY USED OTHER THAN THE ABOVE
WILL NOT REIMBURSED FOR THE COST OF INSURANCE
I'm dealing with a SOAP client response for a flight booking application, I successfully got the response, See the response below:
<arzoo__response>
<Response__Depart>
<OriginDestinationOptions>
<OriginDestinationOption>
<FareDetails>
<ChargeableFares>
<ActualBaseFare>4850</ActualBaseFare>
<Tax>4267</Tax>
<STax>31</STax>
<SCharge>0</SCharge>
<TDiscount>0</TDiscount>
<TPartnerCommission>0</TPartnerCommission>
</ChargeableFares>
<NonchargeableFares>
<TCharge>0</TCharge>
<TMarkup>0</TMarkup>
<TSdiscount>0</TSdiscount>
</NonchargeableFares>
</FareDetails>
<FlightSegments>
<FlightSegment>
<AirEquipType>321</AirEquipType>
<ArrivalAirportCode>DEL</ArrivalAirportCode>
<ArrivalDateTime>2013-05-20T08:00:00</ArrivalDateTime>
<DepartureAirportCode>BOM</DepartureAirportCode>
<DepartureDateTime>2013-05-20T06:00:00</DepartureDateTime>
<FlightNumber>601</FlightNumber>
<OperatingAirlineCode>AI</OperatingAirlineCode>
<OperatingAirlineFlightNumber>601</OperatingAirlineFlightNumber>
<RPH></RPH>
<StopQuantity>0</StopQuantity>
<airLineName>Air India</airLineName>
<airportTax>4267</airportTax>
<imageFileName>http://live.arzoo.com/FlightWS/image/AirIndia.gif</imageFileName>
<viaFlight></viaFlight>
<BookingClass>
<Availability>4</Availability>
<ResBookDesigCode>U</ResBookDesigCode>
</BookingClass>
<BookingClassFare>
<adultFare>4850</adultFare>
<bookingclass>U</bookingclass>
<classType>Economy</classType>
<farebasiscode>fjyS3YyUlEusLfJ4bwgPvQ==</farebasiscode>
<Rule>This fare is Refundable <br> Baggage : 25K<br>Booking Class : U|Re-Schedule Charges: Rs. 750 per sector + Fare difference (If any) +admin fee 500 + Service Fee of Rs. 250 Sector .|Cancellation Charges : Basic fare +Airline administration fee 500 + Service Charges 250 Per Passenger Per Sector . |</Rule>
<adultCommission>0</adultCommission>
<childCommission>0</childCommission>
<commissionOnTCharge>0</commissionOnTCharge>
</BookingClassFare>
<Discount>0</Discount>
<airportTaxChild>0</airportTaxChild>
<airportTaxInfant>0</airportTaxInfant>
<adultTaxBreakup>2800,147,1320</adultTaxBreakup>
<childTaxBreakup>0,0,0</childTaxBreakup>
<infantTaxBreakup>0,0,0</infantTaxBreakup>
<octax>0</octax>
</FlightSegment>
</FlightSegments>
<id>arzoo11</id>
<key>wtZcSVMY/gphWFSOTFWg8oKRnosq3p9wt7R4SjMB0EUK8sDjVS91GicTJzH+TWN+pNURIyTJYKOW O8yH8+0tzpA4t8aEEvzaOE6ZnTtBotFDwLtSiN0xXqMsaDl8diV51l7d9ata/3rxTgfh9d8ZSmFY VI5MVaDywdHNcjAR1vwnEycx/k1jftlsnmWWqYGnJxMnMf5NY36YIq2FtLkfcHtsd+IDEhxpxJuT v4YyS+QnEycx/k1jftlsnmWWqYGnJxMnMf5NY37ZbJ5llqmBpycTJzH+TWN+GlZsae+KA6L3dlms eLkXZFKXPvd5FAnBXnTfRGc5sz+UC8CsZNzDV2FYVI5MVaDyFiThuG7WKPhzqWDbQb1E1IqUKT5I FtF6OaCYjb6EFGhDwLtSiN0xXt7N3OmPGVH2v18OFlhFoI+A/uAfnTovYr9fDhZYRaCPgP7gH506 L2K/Xw4WWEWgj4D+4B+dOi9iv18OFlhFoI+A/uAfnTovYr9fDhZYRaCPgP7gH506L2K/Xw4WWEWg j4D+4B+dOi9iv18OFlhFoI/87KPqwdBsCm4nF4DlZwRNQ/zni8QE42g8S0GV1z3SJXaOdoTFisn9 v18OFlhFoI+ThOYsjNAbXEP854vEBONoPEtBldc90iVD/OeLxATjaAwTg0ygCEBmEgnKEhG4Md1D /OeLxATjaDxLQZXXPdIlQ/zni8QE42jXGTnbB/ydvR4daAuN34kWYVhUjkxVoPJtRWbi6bZrXL9f DhZYRaCPgP7gH506L2K/Xw4WWEWgj4D+4B+dOi9iv18OFlhFoI8KriAmVoEyR3OpYNtBvUTUp1Mf I240+obPusGaAOeuxg==</key>
</OriginDestinationOption>
</OriginDestinationOptions>
</Response__Depart>
</arzoo__response>
Now i have to display them as :
Base Price: 4850
Tax: 31
STax: 31
SCharge: 0
TDiscount: 0
TPartnerCommission: 0
.....................
Arrival Airport Code: DEL
.....................
I tried several methods using foreach():
$result = $client->__call('getAvailability',array($test));
$xml = simplexml_load_string($result);
foreach($xml->OriginDestinationOption as $od){
foreach($od->FareDetails as $fd){
foreach($fd->ChargeableFares as $cf){
echo $cf->ActualBaseFare;
}
}
}
but never sot it out. Can any one please help me out on this ?
Your help must appreciated. Thanks in advance
You are trying to access OriginDestinationOption as though it is a direct child of the XML response, but the structure is actually like this:
<arzoo__response>
<Response__Depart>
<OriginDestinationOptions>
<OriginDestinationOption>
So, since your $xml will represent the arzoo__response element, you need to traverse the other elements in between:
foreach($xml->Response__Depart->OriginDestinationOptions->OriginDestinationOption as $od)