Skip Navigation LinksHome > Products > Web Service Catalog > XigniteCurrencies

Web Service Operations GetOfficialCrossRates

Sign up for a free-trial now to test this operation!
CountryType:
Symbols:
AsOfDate:

Web Service Description

Returns an official cross-rate as of a historical date.

Official cross rates are available for the following Countries

  • United States (AM or PM): AUD, BRL, CAD, CHF, CNY, DKK, EUR, GBP, HKD, INR, JPY, KRW, LKR, MXN, MYR, NOK, NZD, SEK, SGD, THB, TWD, VEF(VEB), ZAR
  • Canada: ANG, ARS, AUD, BRL, BSD, CHF, CLP, CNY, COP, CZK, DKK, EUR, FJD, GBP, GTQ, HKD, HNL, HRK, HUF, IDR, ILS, IRD, ISK, JMD, JPY, LKR, MAD, MMK, MXN, MYR, NOK, NZD, PAB, PEN, PHP, PKR, PLN, RUR, SEK, SGD, SIT, SKK, THB, TND, TRY, TTD, TWD, USD, VEB, VND, XAF, XCD, XPF, ZAR
  • Mexico: USD
  • Europe: USD, JPY, BGN, CZK, DKK, EEK, GBP, HUF, LTL, LVL, PLN, RON, SEK, SKK, CHF, ISK, NOK, HRK, RUB, TRY, AUD, BRL, CAD, CNY, HKD, IDR, KRW, MXN, MYR, NZD, PHP, SGD, THB, ZAR
  • Russia: AUD, GBP, BYR, DKK, USD, EUR, ISK, KZT, CAD, CNY, NOK, SGD, TRY, UAH, SEK, CHF, JPY
  • Poland: AUD, BRL, BGN, CAD, CNY, HRK, CZK, DKK, EEK, EUR, HKD, HUF, ISK, IDR, JPY, LVL, LTL, MYR, MXN, NZD, NOK, PHP, GBP, RON, RUB, SGD, SKK, ZAR, KRW, SEK, CHF, THB, TRY, UAH, USD, XDR


Web Service Hits Calculation

Requests against this operation count as one hit.

Inputs and Outputs Parameters for GetOfficialCrossRates

Inputs

NameDescriptionRequiredExample
CountryTypeThe symbol for the cross rate in format SSSDDD where SSS is the symbol for the source currency and DDD is the symbol for the destination currency.YesMexico
SymbolThe symbol of the currency you want an official rate for.YesUSD
AsOfDateThe date you want the official crass rate for.Yes11/19/2009

Outputs

NameDescriptionAlways Present
Array Of OfficialCrossRateReturns an array of official cross rates. 
Instance of OfficialCrossRateEach instance represents ab official cross rate. 
 Instance of OfficialCrossRateEach instance represents an OfficialCrossRate Item. 
  SymbolThe symbol for the cross rate.Yes
  TypeThe type of cross rate (Real-Time, Delayed).Yes
  FromThe source currency.Yes
  SymbolThe symbol for the currency.Yes
  NameThe full name for the currency.Yes
  ToThe target currency.Yes
  SymbolThe symbol for the currency.Yes
  NameThe full name for the currency.Yes
  DateThe date for the cross rate (London Time).Yes
  FirstThe first rate for the cross rate during the day (London Time).Yes
  LastThe last rate for the cross rate during the day (London Time).Yes
  HighThe highest rate for the cross rate during the day (London Time).Yes
  LowThe lowest rate for the cross rate during the day (London Time).Yes
  TextA description of the rate formula.Yes

SOAP Request for GetOfficialCrossRates

Inputs

POST http://www.xignite.com/xCurrencies.asmx HTTP/1.1
Host: www.xignite.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.xignite.com/services/GetOfficialCrossRates"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <Header xmlns="http://www.xignite.com/services/"> <Username>string</Username> <Password>string</Password> <Tracer>string</Tracer> </Header> </soap:Header> <soap:Body> <GetOfficialCrossRates xmlns="http://www.xignite.com/services/"> <CountryType>Mexico or UnitedStatesAM or UnitedStatesPM or Canada
or Europe or Russia or Poland</CountryType> <Symbols>string</Symbols> <AsOfDate>string</AsOfDate> </GetOfficialCrossRates> </soap:Body> </soap:Envelope>

Outputs

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetOfficialCrossRatesResponse xmlns="http://www.xignite.com/services/"> <GetOfficialCrossRatesResult> <HistoricalCrossRate> <Symbol>string</Symbol> <Type>RealTime or Delayed15Minutes or Delayed20Minutes or NotAvailable
</Type> <From> <Symbol>USD or AED or AFA or AFN or ALL or AMD or ANG or AOA
or ARA or ARE or ARS or ATS or AUD or AUN or AWG or AZM
or BAM or BBD or BDT or BEF or BEL or BGL or BGN or BHD
or BIF or BMD or BND or BOB or BOV or BRC or BRE or BRI
or BRL or BRR or BSD or BTN or BWP or BYR or BZD or CAD
or CDF or CHF or CLF or CHK or CLP or CNY or COP or CRC
or CSD or CUP or CVE or CYP or CZK or DEM or DJF or DKK
or DOP or DOE or DOW or DZD or ECS or EEK or EGP or ERN
or ESP or ETB or EUR or FIM or FJD or FKP or FRF or FRN
or GBP or GEL or GGP or GHC or GHS or GIP or GMD or GNF
or GRD or GTQ or GYD or HKD or HNL or HRD or HRK or HTG
or HUF or IDR or IEP or ILS or IMP or INR or IQD or IRR
or ISK or ITL or JEP or JMD or JOD or JPY or KES or KGS
or KHR or KMF or KPW or KRU or KRW or KWD or KYD or KZT
or LAK or LBP or LKR or LRD or LSL or LTL or LUF or LVL
or LYD or M5P or MAD or MAL or MDL or MFG or MGA or MKD
or MMK or MNT or MOP or MRO or MTL or MTP or MUR or MVR
or MWK or MXN or MXP or MXV or MYR or MZM or MZN or NAD
or NBL or NGN or NIC or NIO or NLG or NOK or NPR or NSO
or NZD or OMR or OSO or PAB or PEI or PEN or PES or PGK
or PHP or PKR or PLN or PLZ or PTE or PYG or QAR or ROL
or RON or RSD or RUB or RUR or RWF or SAR or SBD or SCR
or SDD or SDG or SDP or SDR or SEK or SGD or SHP or SIT
or SKK or SLL or SOS or SPL or SRG or STD or SUR or SVC
or SYP or SZL or THB or TJR or TJS or TMM or TND or TOP
or TRL or TRY or TTD or TVD or TWD or TZS or UAH or UGX
or UNK or UYP or UYU or UZS or VEB or VEF or VND or VRL
or VRN or VUV or WST or XAF or XAG or XAU or XCD or XDR
or XEU or XOF or XPD or XPF or XPT or YER or YUD or YUM
or ZAL or ZAR or ZMK or ZRN or ZRZ or ZWD or BAD or NOCURRENCY
</Symbol> <Name>string</Name> </From> <To> <Symbol>USD or AED or AFA or AFN or ALL or AMD or ANG or AOA
or ARA or ARE or ARS or ATS or AUD or AUN or AWG or AZM
or BAM or BBD or BDT or BEF or BEL or BGL or BGN or BHD
or BIF or BMD or BND or BOB or BOV or BRC or BRE or BRI
or BRL or BRR or BSD or BTN or BWP or BYR or BZD or CAD
or CDF or CHF or CLF or CHK or CLP or CNY or COP or CRC
or CSD or CUP or CVE or CYP or CZK or DEM or DJF or DKK
or DOP or DOE or DOW or DZD or ECS or EEK or EGP or ERN
or ESP or ETB or EUR or FIM or FJD or FKP or FRF or FRN
or GBP or GEL or GGP or GHC or GHS or GIP or GMD or GNF
or GRD or GTQ or GYD or HKD or HNL or HRD or HRK or HTG
or HUF or IDR or IEP or ILS or IMP or INR or IQD or IRR
or ISK or ITL or JEP or JMD or JOD or JPY or KES or KGS
or KHR or KMF or KPW or KRU or KRW or KWD or KYD or KZT
or LAK or LBP or LKR or LRD or LSL or LTL or LUF or LVL
or LYD or M5P or MAD or MAL or MDL or MFG or MGA or MKD
or MMK or MNT or MOP or MRO or MTL or MTP or MUR or MVR
or MWK or MXN or MXP or MXV or MYR or MZM or MZN or NAD
or NBL or NGN or NIC or NIO or NLG or NOK or NPR or NSO
or NZD or OMR or OSO or PAB or PEI or PEN or PES or PGK
or PHP or PKR or PLN or PLZ or PTE or PYG or QAR or ROL
or RON or RSD or RUB or RUR or RWF or SAR or SBD or SCR
or SDD or SDG or SDP or SDR or SEK or SGD or SHP or SIT
or SKK or SLL or SOS or SPL or SRG or STD or SUR or SVC
or SYP or SZL or THB or TJR or TJS or TMM or TND or TOP
or TRL or TRY or TTD or TVD or TWD or TZS or UAH or UGX
or UNK or UYP or UYU or UZS or VEB or VEF or VND or VRL
or VRN or VUV or WST or XAF or XAG or XAU or XCD or XDR
or XEU or XOF or XPD or XPF or XPT or YER or YUD or YUM
or ZAL or ZAR or ZMK or ZRN or ZRZ or ZWD or BAD or NOCURRENCY
</Symbol> <Name>string</Name> </To> <Date>string</Date> <First>double</First> <Last>double</Last> <High>double</High> <Low>double</Low> <Text>string</Text> </HistoricalCrossRate> <HistoricalCrossRate> <Symbol>string</Symbol> <Type>RealTime or Delayed15Minutes or Delayed20Minutes or NotAvailable
</Type> <From> <Symbol>USD or AED or AFA or AFN or ALL or AMD or ANG or AOA
or ARA or ARE or ARS or ATS or AUD or AUN or AWG or AZM
or BAM or BBD or BDT or BEF or BEL or BGL or BGN or BHD
or BIF or BMD or BND or BOB or BOV or BRC or BRE or BRI
or BRL or BRR or BSD or BTN or BWP or BYR or BZD or CAD
or CDF or CHF or CLF or CHK or CLP or CNY or COP or CRC
or CSD or CUP or CVE or CYP or CZK or DEM or DJF or DKK
or DOP or DOE or DOW or DZD or ECS or EEK or EGP or ERN
or ESP or ETB or EUR or FIM or FJD or FKP or FRF or FRN
or GBP or GEL or GGP or GHC or GHS or GIP or GMD or GNF
or GRD or GTQ or GYD or HKD or HNL or HRD or HRK or HTG
or HUF or IDR or IEP or ILS or IMP or INR or IQD or IRR
or ISK or ITL or JEP or JMD or JOD or JPY or KES or KGS
or KHR or KMF or KPW or KRU or KRW or KWD or KYD or KZT
or LAK or LBP or LKR or LRD or LSL or LTL or LUF or LVL
or LYD or M5P or MAD or MAL or MDL or MFG or MGA or MKD
or MMK or MNT or MOP or MRO or MTL or MTP or MUR or MVR
or MWK or MXN or MXP or MXV or MYR or MZM or MZN or NAD
or NBL or NGN or NIC or NIO or NLG or NOK or NPR or NSO
or NZD or OMR or OSO or PAB or PEI or PEN or PES or PGK
or PHP or PKR or PLN or PLZ or PTE or PYG or QAR or ROL
or RON or RSD or RUB or RUR or RWF or SAR or SBD or SCR
or SDD or SDG or SDP or SDR or SEK or SGD or SHP or SIT
or SKK or SLL or SOS or SPL or SRG or STD or SUR or SVC
or SYP or SZL or THB or TJR or TJS or TMM or TND or TOP
or TRL or TRY or TTD or TVD or TWD or TZS or UAH or UGX
or UNK or UYP or UYU or UZS or VEB or VEF or VND or VRL
or VRN or VUV or WST or XAF or XAG or XAU or XCD or XDR
or XEU or XOF or XPD or XPF or XPT or YER or YUD or YUM
or ZAL or ZAR or ZMK or ZRN or ZRZ or ZWD or BAD or NOCURRENCY
</Symbol> <Name>string</Name> </From> <To> <Symbol>USD or AED or AFA or AFN or ALL or AMD or ANG or AOA
or ARA or ARE or ARS or ATS or AUD or AUN or AWG or AZM
or BAM or BBD or BDT or BEF or BEL or BGL or BGN or BHD
or BIF or BMD or BND or BOB or BOV or BRC or BRE or BRI
or BRL or BRR or BSD or BTN or BWP or BYR or BZD or CAD
or CDF or CHF or CLF or CHK or CLP or CNY or COP or CRC
or CSD or CUP or CVE or CYP or CZK or DEM or DJF or DKK
or DOP or DOE or DOW or DZD or ECS or EEK or EGP or ERN
or ESP or ETB or EUR or FIM or FJD or FKP or FRF or FRN
or GBP or GEL or GGP or GHC or GHS or GIP or GMD or GNF
or GRD or GTQ or GYD or HKD or HNL or HRD or HRK or HTG
or HUF or IDR or IEP or ILS or IMP or INR or IQD or IRR
or ISK or ITL or JEP or JMD or JOD or JPY or KES or KGS
or KHR or KMF or KPW or KRU or KRW or KWD or KYD or KZT
or LAK or LBP or LKR or LRD or LSL or LTL or LUF or LVL
or LYD or M5P or MAD or MAL or MDL or MFG or MGA or MKD
or MMK or MNT or MOP or MRO or MTL or MTP or MUR or MVR
or MWK or MXN or MXP or MXV or MYR or MZM or MZN or NAD
or NBL or NGN or NIC or NIO or NLG or NOK or NPR or NSO
or NZD or OMR or OSO or PAB or PEI or PEN or PES or PGK
or PHP or PKR or PLN or PLZ or PTE or PYG or QAR or ROL
or RON or RSD or RUB or RUR or RWF or SAR or SBD or SCR
or SDD or SDG or SDP or SDR or SEK or SGD or SHP or SIT
or SKK or SLL or SOS or SPL or SRG or STD or SUR or SVC
or SYP or SZL or THB or TJR or TJS or TMM or TND or TOP
or TRL or TRY or TTD or TVD or TWD or TZS or UAH or UGX
or UNK or UYP or UYU or UZS or VEB or VEF or VND or VRL
or VRN or VUV or WST or XAF or XAG or XAU or XCD or XDR
or XEU or XOF or XPD or XPF or XPT or YER or YUD or YUM
or ZAL or ZAR or ZMK or ZRN or ZRZ or ZWD or BAD or NOCURRENCY
</Symbol> <Name>string</Name> </To> <Date>string</Date> <First>double</First> <Last>double</Last> <High>double</High> <Low>double</Low> <Text>string</Text> </HistoricalCrossRate> </GetOfficialCrossRatesResult> </GetOfficialCrossRatesResponse> </soap:Body> </soap:Envelope>

HttpGet Request for GetOfficialCrossRates

Inputs

GET http://www.xignite.com/xCurrencies.asmx/GetOfficialCrossRates?
CountryType=string&Symbols=string&AsOfDate=string HTTP/1.1 Host: www.xignite.com

Outputs

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfHistoricalCrossRate xmlns="http://www.xignite.com/services/">
  <HistoricalCrossRate>
    <Symbol>string</Symbol>
    <Type>RealTime or Delayed15Minutes or Delayed20Minutes or NotAvailable
</Type> <From> <Symbol>USD or AED or AFA or AFN or ALL or AMD or ANG or AOA
or ARA or ARE or ARS or ATS or AUD or AUN or AWG or AZM
or BAM or BBD or BDT or BEF or BEL or BGL or BGN or BHD
or BIF or BMD or BND or BOB or BOV or BRC or BRE or BRI
or BRL or BRR or BSD or BTN or BWP or BYR or BZD or CAD
or CDF or CHF or CLF or CHK or CLP or CNY or COP or CRC
or CSD or CUP or CVE or CYP or CZK or DEM or DJF or DKK
or DOP or DOE or DOW or DZD or ECS or EEK or EGP or ERN
or ESP or ETB or EUR or FIM or FJD or FKP or FRF or FRN
or GBP or GEL or GGP or GHC or GHS or GIP or GMD or GNF
or GRD or GTQ or GYD or HKD or HNL or HRD or HRK or HTG
or HUF or IDR or IEP or ILS or IMP or INR or IQD or IRR
or ISK or ITL or JEP or JMD or JOD or JPY or KES or KGS
or KHR or KMF or KPW or KRU or KRW or KWD or KYD or KZT
or LAK or LBP or LKR or LRD or LSL or LTL or LUF or LVL
or LYD or M5P or MAD or MAL or MDL or MFG or MGA or MKD
or MMK or MNT or MOP or MRO or MTL or MTP or MUR or MVR
or MWK or MXN or MXP or MXV or MYR or MZM or MZN or NAD
or NBL or NGN or NIC or NIO or NLG or NOK or NPR or NSO
or NZD or OMR or OSO or PAB or PEI or PEN or PES or PGK
or PHP or PKR or PLN or PLZ or PTE or PYG or QAR or ROL
or RON or RSD or RUB or RUR or RWF or SAR or SBD or SCR
or SDD or SDG or SDP or SDR or SEK or SGD or SHP or SIT
or SKK or SLL or SOS or SPL or SRG or STD or SUR or SVC
or SYP or SZL or THB or TJR or TJS or TMM or TND or TOP
or TRL or TRY or TTD or TVD or TWD or TZS or UAH or UGX
or UNK or UYP or UYU or UZS or VEB or VEF or VND or VRL
or VRN or VUV or WST or XAF or XAG or XAU or XCD or XDR
or XEU or XOF or XPD or XPF or XPT or YER or YUD or YUM
or ZAL or ZAR or ZMK or ZRN or ZRZ or ZWD or BAD or NOCURRENCY
</Symbol> <Name>string</Name> </From> <To> <Symbol>USD or AED or AFA or AFN or ALL or AMD or ANG or AOA
or ARA or ARE or ARS or ATS or AUD or AUN or AWG or AZM
or BAM or BBD or BDT or BEF or BEL or BGL or BGN or BHD
or BIF or BMD or BND or BOB or BOV or BRC or BRE or BRI
or BRL or BRR or BSD or BTN or BWP or BYR or BZD or CAD
or CDF or CHF or CLF or CHK or CLP or CNY or COP or CRC
or CSD or CUP or CVE or CYP or CZK or DEM or DJF or DKK
or DOP or DOE or DOW or DZD or ECS or EEK or EGP or ERN
or ESP or ETB or EUR or FIM or FJD or FKP or FRF or FRN
or GBP or GEL or GGP or GHC or GHS or GIP or GMD or GNF
or GRD or GTQ or GYD or HKD or HNL or HRD or HRK or HTG
or HUF or IDR or IEP or ILS or IMP or INR or IQD or IRR
or ISK or ITL or JEP or JMD or JOD or JPY or KES or KGS
or KHR or KMF or KPW or KRU or KRW or KWD or KYD or KZT
or LAK or LBP or LKR or LRD or LSL or LTL or LUF or LVL
or LYD or M5P or MAD or MAL or MDL or MFG or MGA or MKD
or MMK or MNT or MOP or MRO or MTL or MTP or MUR or MVR
or MWK or MXN or MXP or MXV or MYR or MZM or MZN or NAD
or NBL or NGN or NIC or NIO or NLG or NOK or NPR or NSO
or NZD or OMR or OSO or PAB or PEI or PEN or PES or PGK
or PHP or PKR or PLN or PLZ or PTE or PYG or QAR or ROL
or RON or RSD or RUB or RUR or RWF or SAR or SBD or SCR
or SDD or SDG or SDP or SDR or SEK or SGD or SHP or SIT
or SKK or SLL or SOS or SPL or SRG or STD or SUR or SVC
or SYP or SZL or THB or TJR or TJS or TMM or TND or TOP
or TRL or TRY or TTD or TVD or TWD or TZS or UAH or UGX
or UNK or UYP or UYU or UZS or VEB or VEF or VND or VRL
or VRN or VUV or WST or XAF or XAG or XAU or XCD or XDR
or XEU or XOF or XPD or XPF or XPT or YER or YUD or YUM
or ZAL or ZAR or ZMK or ZRN or ZRZ or ZWD or BAD or NOCURRENCY
</Symbol> <Name>string</Name> </To> <Date>string</Date> <First>double</First> <Last>double</Last> <High>double</High> <Low>double</Low> <Text>string</Text> </HistoricalCrossRate> <HistoricalCrossRate> <Symbol>string</Symbol> <Type>RealTime or Delayed15Minutes or Delayed20Minutes or NotAvailable
</Type> <From> <Symbol>USD or AED or AFA or AFN or ALL or AMD or ANG or AOA
or ARA or ARE or ARS or ATS or AUD or AUN or AWG or AZM
or BAM or BBD or BDT or BEF or BEL or BGL or BGN or BHD
or BIF or BMD or BND or BOB or BOV or BRC or BRE or BRI
or BRL or BRR or BSD or BTN or BWP or BYR or BZD or CAD
or CDF or CHF or CLF or CHK or CLP or CNY or COP or CRC
or CSD or CUP or CVE or CYP or CZK or DEM or DJF or DKK
or DOP or DOE or DOW or DZD or ECS or EEK or EGP or ERN
or ESP or ETB or EUR or FIM or FJD or FKP or FRF or FRN
or GBP or GEL or GGP or GHC or GHS or GIP or GMD or GNF
or GRD or GTQ or GYD or HKD or HNL or HRD or HRK or HTG
or HUF or IDR or IEP or ILS or IMP or INR or IQD or IRR
or ISK or ITL or JEP or JMD or JOD or JPY or KES or KGS
or KHR or KMF or KPW or KRU or KRW or KWD or KYD or KZT
or LAK or LBP or LKR or LRD or LSL or LTL or LUF or LVL
or LYD or M5P or MAD or MAL or MDL or MFG or MGA or MKD
or MMK or MNT or MOP or MRO or MTL or MTP or MUR or MVR
or MWK or MXN or MXP or MXV or MYR or MZM or MZN or NAD
or NBL or NGN or NIC or NIO or NLG or NOK or NPR or NSO
or NZD or OMR or OSO or PAB or PEI or PEN or PES or PGK
or PHP or PKR or PLN or PLZ or PTE or PYG or QAR or ROL
or RON or RSD or RUB or RUR or RWF or SAR or SBD or SCR
or SDD or SDG or SDP or SDR or SEK or SGD or SHP or SIT
or SKK or SLL or SOS or SPL or SRG or STD or SUR or SVC
or SYP or SZL or THB or TJR or TJS or TMM or TND or TOP
or TRL or TRY or TTD or TVD or TWD or TZS or UAH or UGX
or UNK or UYP or UYU or UZS or VEB or VEF or VND or VRL
or VRN or VUV or WST or XAF or XAG or XAU or XCD or XDR
or XEU or XOF or XPD or XPF or XPT or YER or YUD or YUM
or ZAL or ZAR or ZMK or ZRN or ZRZ or ZWD or BAD or NOCURRENCY
</Symbol> <Name>string</Name> </From> <To> <Symbol>USD or AED or AFA or AFN or ALL or AMD or ANG or AOA
or ARA or ARE or ARS or ATS or AUD or AUN or AWG or AZM
or BAM or BBD or BDT or BEF or BEL or BGL or BGN or BHD
or BIF or BMD or BND or BOB or BOV or BRC or BRE or BRI
or BRL or BRR or BSD or BTN or BWP or BYR or BZD or CAD
or CDF or CHF or CLF or CHK or CLP or CNY or COP or CRC
or CSD or CUP or CVE or CYP or CZK or DEM or DJF or DKK
or DOP or DOE or DOW or DZD or ECS or EEK or EGP or ERN
or ESP or ETB or EUR or FIM or FJD or FKP or FRF or FRN
or GBP or GEL or GGP or GHC or GHS or GIP or GMD or GNF
or GRD or GTQ or GYD or HKD or HNL or HRD or HRK or HTG
or HUF or IDR or IEP or ILS or IMP or INR or IQD or IRR
or ISK or ITL or JEP or JMD or JOD or JPY or KES or KGS
or KHR or KMF or KPW or KRU or KRW or KWD or KYD or KZT
or LAK or LBP or LKR or LRD or LSL or LTL or LUF or LVL
or LYD or M5P or MAD or MAL or MDL or MFG or MGA or MKD
or MMK or MNT or MOP or MRO or MTL or MTP or MUR or MVR
or MWK or MXN or MXP or MXV or MYR or MZM or MZN or NAD
or NBL or NGN or NIC or NIO or NLG or NOK or NPR or NSO
or NZD or OMR or OSO or PAB or PEI or PEN or PES or PGK
or PHP or PKR or PLN or PLZ or PTE or PYG or QAR or ROL
or RON or RSD or RUB or RUR or RWF or SAR or SBD or SCR
or SDD or SDG or SDP or SDR or SEK or SGD or SHP or SIT
or SKK or SLL or SOS or SPL or SRG or STD or SUR or SVC
or SYP or SZL or THB or TJR or TJS or TMM or TND or TOP
or TRL or TRY or TTD or TVD or TWD or TZS or UAH or UGX
or UNK or UYP or UYU or UZS or VEB or VEF or VND or VRL
or VRN or VUV or WST or XAF or XAG or XAU or XCD or XDR
or XEU or XOF or XPD or XPF or XPT or YER or YUD or YUM
or ZAL or ZAR or ZMK or ZRN or ZRZ or ZWD or BAD or NOCURRENCY
</Symbol> <Name>string</Name> </To> <Date>string</Date> <First>double</First> <Last>double</Last> <High>double</High> <Low>double</Low> <Text>string</Text> </HistoricalCrossRate> </ArrayOfHistoricalCrossRate>

HttpPost Request for GetOfficialCrossRates

Inputs

POST http://www.xignite.com/xCurrencies.asmx/GetOfficialCrossRates HTTP/1.1
Host: www.xignite.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

CountryType=string&Symbols=string&AsOfDate=string

Outputs

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfHistoricalCrossRate xmlns="http://www.xignite.com/services/">
  <HistoricalCrossRate>
    <Symbol>string</Symbol>
    <Type>RealTime or Delayed15Minutes or Delayed20Minutes or NotAvailable
</Type> <From> <Symbol>USD or AED or AFA or AFN or ALL or AMD or ANG or AOA
or ARA or ARE or ARS or ATS or AUD or AUN or AWG or AZM
or BAM or BBD or BDT or BEF or BEL or BGL or BGN or BHD
or BIF or BMD or BND or BOB or BOV or BRC or BRE or BRI
or BRL or BRR or BSD or BTN or BWP or BYR or BZD or CAD
or CDF or CHF or CLF or CHK or CLP or CNY or COP or CRC
or CSD or CUP or CVE or CYP or CZK or DEM or DJF or DKK
or DOP or DOE or DOW or DZD or ECS or EEK or EGP or ERN
or ESP or ETB or EUR or FIM or FJD or FKP or FRF or FRN
or GBP or GEL or GGP or GHC or GHS or GIP or GMD or GNF
or GRD or GTQ or GYD or HKD or HNL or HRD or HRK or HTG
or HUF or IDR or IEP or ILS or IMP or INR or IQD or IRR
or ISK or ITL or JEP or JMD or JOD or JPY or KES or KGS
or KHR or KMF or KPW or KRU or KRW or KWD or KYD or KZT
or LAK or LBP or LKR or LRD or LSL or LTL or LUF or LVL
or LYD or M5P or MAD or MAL or MDL or MFG or MGA or MKD
or MMK or MNT or MOP or MRO or MTL or MTP or MUR or MVR
or MWK or MXN or MXP or MXV or MYR or MZM or MZN or NAD
or NBL or NGN or NIC or NIO or NLG or NOK or NPR or NSO
or NZD or OMR or OSO or PAB or PEI or PEN or PES or PGK
or PHP or PKR or PLN or PLZ or PTE or PYG or QAR or ROL
or RON or RSD or RUB or RUR or RWF or SAR or SBD or SCR
or SDD or SDG or SDP or SDR or SEK or SGD or SHP or SIT
or SKK or SLL or SOS or SPL or SRG or STD or SUR or SVC
or SYP or SZL or THB or TJR or TJS or TMM or TND or TOP
or TRL or TRY or TTD or TVD or TWD or TZS or UAH or UGX
or UNK or UYP or UYU or UZS or VEB or VEF or VND or VRL
or VRN or VUV or WST or XAF or XAG or XAU or XCD or XDR
or XEU or XOF or XPD or XPF or XPT or YER or YUD or YUM
or ZAL or ZAR or ZMK or ZRN or ZRZ or ZWD or BAD or NOCURRENCY
</Symbol> <Name>string</Name> </From> <To> <Symbol>USD or AED or AFA or AFN or ALL or AMD or ANG or AOA
or ARA or ARE or ARS or ATS or AUD or AUN or AWG or AZM
or BAM or BBD or BDT or BEF or BEL or BGL or BGN or BHD
or BIF or BMD or BND or BOB or BOV or BRC or BRE or BRI
or BRL or BRR or BSD or BTN or BWP or BYR or BZD or CAD
or CDF or CHF or CLF or CHK or CLP or CNY or COP or CRC
or CSD or CUP or CVE or CYP or CZK or DEM or DJF or DKK
or DOP or DOE or DOW or DZD or ECS or EEK or EGP or ERN
or ESP or ETB or EUR or FIM or FJD or FKP or FRF or FRN
or GBP or GEL or GGP or GHC or GHS or GIP or GMD or GNF
or GRD or GTQ or GYD or HKD or HNL or HRD or HRK or HTG
or HUF or IDR or IEP or ILS or IMP or INR or IQD or IRR
or ISK or ITL or JEP or JMD or JOD or JPY or KES or KGS
or KHR or KMF or KPW or KRU or KRW or KWD or KYD or KZT
or LAK or LBP or LKR or LRD or LSL or LTL or LUF or LVL
or LYD or M5P or MAD or MAL or MDL or MFG or MGA or MKD
or MMK or MNT or MOP or MRO or MTL or MTP or MUR or MVR
or MWK or MXN or MXP or MXV or MYR or MZM or MZN or NAD
or NBL or NGN or NIC or NIO or NLG or NOK or NPR or NSO
or NZD or OMR or OSO or PAB or PEI or PEN or PES or PGK
or PHP or PKR or PLN or PLZ or PTE or PYG or QAR or ROL
or RON or RSD or RUB or RUR or RWF or SAR or SBD or SCR
or SDD or SDG or SDP or SDR or SEK or SGD or SHP or SIT
or SKK or SLL or SOS or SPL or SRG or STD or SUR or SVC
or SYP or SZL or THB or TJR or TJS or TMM or TND or TOP
or TRL or TRY or TTD or TVD or TWD or TZS or UAH or UGX
or UNK or UYP or UYU or UZS or VEB or VEF or VND or VRL
or VRN or VUV or WST or XAF or XAG or XAU or XCD or XDR
or XEU or XOF or XPD or XPF or XPT or YER or YUD or YUM
or ZAL or ZAR or ZMK or ZRN or ZRZ or ZWD or BAD or NOCURRENCY
</Symbol> <Name>string</Name> </To> <Date>string</Date> <First>double</First> <Last>double</Last> <High>double</High> <Low>double</Low> <Text>string</Text> </HistoricalCrossRate> <HistoricalCrossRate> <Symbol>string</Symbol> <Type>RealTime or Delayed15Minutes or Delayed20Minutes or NotAvailable
</Type> <From> <Symbol>USD or AED or AFA or AFN or ALL or AMD or ANG or AOA
or ARA or ARE or ARS or ATS or AUD or AUN or AWG or AZM
or BAM or BBD or BDT or BEF or BEL or BGL or BGN or BHD
or BIF or BMD or BND or BOB or BOV or BRC or BRE or BRI
or BRL or BRR or BSD or BTN or BWP or BYR or BZD or CAD
or CDF or CHF or CLF or CHK or CLP or CNY or COP or CRC
or CSD or CUP or CVE or CYP or CZK or DEM or DJF or DKK
or DOP or DOE or DOW or DZD or ECS or EEK or EGP or ERN
or ESP or ETB or EUR or FIM or FJD or FKP or FRF or FRN
or GBP or GEL or GGP or GHC or GHS or GIP or GMD or GNF
or GRD or GTQ or GYD or HKD or HNL or HRD or HRK or HTG
or HUF or IDR or IEP or ILS or IMP or INR or IQD or IRR
or ISK or ITL or JEP or JMD or JOD or JPY or KES or KGS
or KHR or KMF or KPW or KRU or KRW or KWD or KYD or KZT
or LAK or LBP or LKR or LRD or LSL or LTL or LUF or LVL
or LYD or M5P or MAD or MAL or MDL or MFG or MGA or MKD
or MMK or MNT or MOP or MRO or MTL or MTP or MUR or MVR
or MWK or MXN or MXP or MXV or MYR or MZM or MZN or NAD
or NBL or NGN or NIC or NIO or NLG or NOK or NPR or NSO
or NZD or OMR or OSO or PAB or PEI or PEN or PES or PGK
or PHP or PKR or PLN or PLZ or PTE or PYG or QAR or ROL
or RON or RSD or RUB or RUR or RWF or SAR or SBD or SCR
or SDD or SDG or SDP or SDR or SEK or SGD or SHP or SIT
or SKK or SLL or SOS or SPL or SRG or STD or SUR or SVC
or SYP or SZL or THB or TJR or TJS or TMM or TND or TOP
or TRL or TRY or TTD or TVD or TWD or TZS or UAH or UGX
or UNK or UYP or UYU or UZS or VEB or VEF or VND or VRL
or VRN or VUV or WST or XAF or XAG or XAU or XCD or XDR
or XEU or XOF or XPD or XPF or XPT or YER or YUD or YUM
or ZAL or ZAR or ZMK or ZRN or ZRZ or ZWD or BAD or NOCURRENCY
</Symbol> <Name>string</Name> </From> <To> <Symbol>USD or AED or AFA or AFN or ALL or AMD or ANG or AOA
or ARA or ARE or ARS or ATS or AUD or AUN or AWG or AZM
or BAM or BBD or BDT or BEF or BEL or BGL or BGN or BHD
or BIF or BMD or BND or BOB or BOV or BRC or BRE or BRI
or BRL or BRR or BSD or BTN or BWP or BYR or BZD or CAD
or CDF or CHF or CLF or CHK or CLP or CNY or COP or CRC
or CSD or CUP or CVE or CYP or CZK or DEM or DJF or DKK
or DOP or DOE or DOW or DZD or ECS or EEK or EGP or ERN
or ESP or ETB or EUR or FIM or FJD or FKP or FRF or FRN
or GBP or GEL or GGP or GHC or GHS or GIP or GMD or GNF
or GRD or GTQ or GYD or HKD or HNL or HRD or HRK or HTG
or HUF or IDR or IEP or ILS or IMP or INR or IQD or IRR
or ISK or ITL or JEP or JMD or JOD or JPY or KES or KGS
or KHR or KMF or KPW or KRU or KRW or KWD or KYD or KZT
or LAK or LBP or LKR or LRD or LSL or LTL or LUF or LVL
or LYD or M5P or MAD or MAL or MDL or MFG or MGA or MKD
or MMK or MNT or MOP or MRO or MTL or MTP or MUR or MVR
or MWK or MXN or MXP or MXV or MYR or MZM or MZN or NAD
or NBL or NGN or NIC or NIO or NLG or NOK or NPR or NSO
or NZD or OMR or OSO or PAB or PEI or PEN or PES or PGK
or PHP or PKR or PLN or PLZ or PTE or PYG or QAR or ROL
or RON or RSD or RUB or RUR or RWF or SAR or SBD or SCR
or SDD or SDG or SDP or SDR or SEK or SGD or SHP or SIT
or SKK or SLL or SOS or SPL or SRG or STD or SUR or SVC
or SYP or SZL or THB or TJR or TJS or TMM or TND or TOP
or TRL or TRY or TTD or TVD or TWD or TZS or UAH or UGX
or UNK or UYP or UYU or UZS or VEB or VEF or VND or VRL
or VRN or VUV or WST or XAF or XAG or XAU or XCD or XDR
or XEU or XOF or XPD or XPF or XPT or YER or YUD or YUM
or ZAL or ZAR or ZMK or ZRN or ZRZ or ZWD or BAD or NOCURRENCY
</Symbol> <Name>string</Name> </To> <Date>string</Date> <First>double</First> <Last>double</Last> <High>double</High> <Low>double</Low> <Text>string</Text> </HistoricalCrossRate> </ArrayOfHistoricalCrossRate>

Sample Code for GetOfficialCrossRates

ASPX

<%@ Page Language="vb" %>
<%@ Import Namespace="System.Net" %>
<!-- here, XigniteCurrencies is the name of this assembly-->
<%@ Import Namespace="XigniteCurrencies" %>
<HTML>
<HEAD>
<script language="vb" runat="server">
' declare the return object globally so that you can reuse it around the page
Dim objHistoricalCrossRate() As HistoricalCrossRate
' call the service inside the Page_Load routine
Sub Page_Load(obj as object, e as eventargs)
' create an instance of the web service
Dim objCurrenciesService As New XigniteCurrencies()
' call the operation and load the return object
objHistoricalCrossRate =
objCurrenciesService.
GetOfficialCrossRates("Mexico", "USD", "11/19/2009")
If Not objHistoricalCrossRate Is Nothing Then
Select Case objHistoricalCrossRate(0).Outcome
Case OutcomeTypes.RegistrationError
' add processing for handling subscription problems, e.g.
Response.Write("Our subscription to this service has expired.")
Case OutcomeTypes.RequestError
' add processing for handling request problems, e.g.
' you could pass back the info message received from the service
Response.Write(objHistoricalCrossRate(0).Message)
Case OutcomeTypes.SystemError
' add processing for handling system problems, e.g.
Response.Write("Service is unavailable at this time.")
End Select
Else
' add error processing here
' this condition could be caused by an HTTP error (404,500...)
Response.Write("Service is unavailable at this time.")
End If
End Sub
</script>
</HEAD>
<BODY>
<TABLE>
<TR>
<TD>
<!-- add processing for displaying the results, e.g. -->
<!-- since the return class contains an array-->
<!-- we just display its count-->
<!-- each instance and its values can be easily accessed-->
<%Response.Write(objHistoricalCrossRate.GetUpperBound(0)) %>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

C# (CSharp)

RemoteCurrencies.XigniteCurrencies objCurrenciesService;
objCurrenciesService = new RemoteCurrencies.XigniteCurrencies();
RemoteCurrencies.HistoricalCrossRate[] objHistoricalCrossRate;
objHistoricalCrossRate =
objCurrenciesService.
GetOfficialCrossRates("Mexico", "USD", "11/19/2009");
if (objHistoricalCrossRate == null)
{
/// add error processing here
/// this condition could be caused by an HTTP error (404,500...)
Console.Write("Service is unavailable at this time.");
}
else
{
switch(objHistoricalCrossRate[0].Outcome)
{
case RemoteCurrencies.OutcomeTypes.Success:
/// add processing for displaying the results, e.g.
/// since the return class contains an array
/// we just display its count
/// each instance and its values can be easily accessed
Console.Write(objHistoricalCrossRate.Length);
break;
default:
/// add processing for handling request problems, e.g.
/// you could pass back the info message received from the service
Console.Write(objHistoricalCrossRate[0].Message);
break;
}
}

Classic ASP

This code requires the Microsoft SOAP Toolkit 3.0 and MSXML 4.0. You can download these from the Microsoft site.

Dim objSOAPClient
Set objSOAPClient = Server.CreateObject("MSSOAP.SoapClient30")
' the node list is of type MSXML2.IXMLDOMNodeList
Dim objXMLNodeList
' the node is of type MSXML2.IXMLDOMNode
Dim objXMLNode

' initialize the soap engine
objSOAPClient.ClientProperty("ServerHTTPRequest") = True
objSOAPClient.MSSoapInit("http://www.xignite.com/xCurrencies.asmx?WSDL")

' load the node list with the records received from the service
Set objXMLNodeList = objSOAPClient.GetOfficialCrossRates("Mexico", "USD", "11/19/2009")

' loop through the index records and load in the document
For Each objXMLNode In objXMLNodeList
' your can print out the content of each node
Response.Write objXMLNode.xml
Next

Java/Axis

This section assumes that you have Axis installed on your machine and that you are fairly familiar with it.

Because all our web services return complex types, the best way to use Axis is to first generate a proxy class using the 'WSDL2Java' tool'. By default, the tool will put all generated classes into the package "com.xignite.www.services".

You should then compile the classes:


C:\axis>java org.apache.axis.wsdl.WSDL2Java http://www.xignite.com/xCurrencies.asmx?WSDL
C:\axis>javac com\xignite\*.java
C:\axis>

You can then create your source file.


// By default, all of the classes auto-generated by the Axis 
// "WSDL2Java" tool are placed into the package "com.xignite.www.services" 
// for our Xignite WSDL, so we need an import.
import com.xignite.www.services.*;
public class XigniteCurrenciesDemo  {
     public static void main(String[] args) throws Exception {
     // Instantiate the XigniteCurrencies proxy 
     // proxy object using the Helper class.
     // This class was autogenerated by the WSDL2Java tool
try { XigniteCurrencies objCurrenciesService = new XigniteCurrenciesLocator(); XigniteCurrenciesSoap objCurrenciesPort = objCurrenciesService.getXigniteCurrenciesSoap();
// Instantiate the return class from the operation // This class was autogenerated by the WSDL2Java tool HistoricalCrossRate[] objHistoricalCrossRate = objCurrenciesPort.getOfficialCrossRates("Mexico", "USD", "11/19/2009"); // objHistoricalCrossRate is pointing to the result of the operation if (objHistoricalCrossRate[0].getOutcome() == OutcomeTypes.RegistrationError) { // code to handle registration errors System.out.println(OutcomeTypes.RegistrationError.toString() + ": " + objHistoricalCrossRate[0].getMessage()); } else if (objHistoricalCrossRate[0].getOutcome() == OutcomeTypes.RequestError) { // code to handle request errors System.out.println(OutcomeTypes.RequestError.toString() + ": " + objHistoricalCrossRate[0].getMessage()); } else if (objHistoricalCrossRate[0].getOutcome() == OutcomeTypes.SystemError) { // code to handle system errors System.out.println(OutcomeTypes.SystemError.toString() + ": " + objHistoricalCrossRate[0].getMessage()); } else // Success { for(int i = 0; i < objHistoricalCrossRate.length; i++) { System.out.println(objHistoricalCrossRate[i].getRate()); } } } catch (Exception ex) { // add exception handling code here
} } }

Apache Axis2 1.4+
C:\axis>wsdl2java.bat -ap -uri http://www.xignite.com/xCurrencies.asmx?WSDL
C:\axis>javac com\xignite\*.java
C:\axis>

You can then create your source file.

// By default, all of the classes auto-generated by the Axis2 
// "WSDL2Java" tool are placed into the package "com.xignite.www.services" 
// for our Xignite WSDL, so we need an import.
import com.xignite.www.services.XigniteCurrenciesXigniteCurrenciesSoapStub;
import com.xignite.www.services.XigniteCurrenciesXigniteCurrenciesSoapStub.*;
public class XigniteCurrenciesDemo {
public static void main(String[] args) throws Exception { // Instantiate the XigniteCurrencies proxy // proxy object using the Helper class. // This class was autogenerated by the WSDL2Java tool
try { XigniteCurrenciesXigniteCurrenciesSoapStub stub = new XigniteCurrenciesXigniteCurrenciesSoapStub(); // Instantiate the return class from the operation // This class was autogenerated by the WSDL2Java tool GetOfficialCrossRates getOfficialCrossRatesArguments = new GetOfficialCrossRates(); getOfficialCrossRatesArguments.setCountryType("Mexico"); getOfficialCrossRatesArguments.setSymbol("USD"); getOfficialCrossRatesArguments.setAsOfDate("11/19/2009"); GetOfficialCrossRatesResponse response = stub.GetOfficialCrossRates(getOfficialCrossRatesArguments, null); HistoricalCrossRate[] objHistoricalCrossRate = response.getGetOfficialCrossRatesResult().getHistoricalCrossRate(); // objHistoricalCrossRate is pointing to the result of the operation if (objHistoricalCrossRate[0].getOutcome() == OutcomeTypes.RegistrationError) { // code to handle registration errors System.out.println(OutcomeTypes.RegistrationError.toString() + ": " + objHistoricalCrossRate[0].getMessage()); } else if (objHistoricalCrossRate[0].getOutcome() == OutcomeTypes.RequestError) { // code to handle request errors System.out.println(OutcomeTypes.RequestError.toString() + ": " + objHistoricalCrossRate[0].getMessage()); } else if (objHistoricalCrossRate[0].getOutcome() == OutcomeTypes.SystemError) { // code to handle system errors System.out.println(OutcomeTypes.SystemError.toString() + ": " + objHistoricalCrossRate[0].getMessage()); } else // Success { for(int i = 0; i < objHistoricalCrossRate.length; i++) { System.out.println(objHistoricalCrossRate[i].getRate()); } } } catch (Exception ex) { // add exception handling code here
} } }

PHP/NuSoap

NuSoap is one of the three major SOAP implementations for PHP: PEAR::SOAP, NuSOAP, and PHP-SOAP.

If you use PHP, we recommend you use NuSoap to access our web services. NuSoap uses our web services for demonstration in their own documentation and it works well.

This section assumes that you have PHP installed on your machine and that you are fairly familiar with it. We have tested this implementation for PHP 4.2.1 on Windows 2000. It should also work with more recent versions on more recent platforms. Note that PHP 5.0 supports SOAP natively (without extension), please follow their documentation for upgrade or code changes required.

To install NuSoap, download the latest package from this location. You can unzip the package in your PHP application directory. The package includes libraries (/lib) and samples (/samples). The sample code below is based on the wsdlclient1.php sample.

If you use one of the older version or PHP (i.e. 4.2.1) , you will need to comment out one line in the /lib/nusoap.php file. That section is not supported in earlier version. The line to comment out is line 1877 as shown below.


1876 // set response timeout
1877 //socket_set_timeout( $this->fp, $response_timeout);

You can then create your source file.


<?php
// need to use the NuSoap extension require_once('../lib/nusoap.php');

// if you access the internet through a proxy server $proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';

// define the SOAP client using the url for the service $client = new soapclient('http://www.xignite.com/xCurrencies.asmx?WSDL',
true, $proxyhost, $proxyport, $proxyusername, $proxypassword);

// assess the results $err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}

// create an array of parameters $param = array(
'CountryType' => "Mexico",
'Symbol' => "USD",
'AsOfDate' => "11/19/2009");


// call the service, passing the parameters and the name of the operation $result = $client->call('GetOfficialCrossRates', array('parameters' => $param), '', '', false, true);
// assess the results if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
$err = $client->getError();
if ($err) {
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// display the results echo '<h2>Result</h2><pre>';
// this function exposes the complete structure of the return class print_r($result);
echo '</pre>';
}
}
// print the SOAP request echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
// print the SOAP response echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
// print the PHP debugging trace echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
?>

PHP5

PHP-SOAP is one of the three major SOAP implementations for PHP: PEAR::SOAP, NuSOAP, and PHP-SOAP.

This section assumes that you have PHP5.0 installed on your machine and that you are fairly familiar with it.

Note that PHP 5.0 supports SOAP, please follow their documentation for code changes required.

Here is a sample source for this operation.

<?php
// define the SOAP client using the url for the service
$client = new soapclient('http://www.xignite.com/xCurrencies.asmx?WSDL', array('trace' => 1));
// create an array of parameters $param = array( 'CountryType' => "Mexico",
'Symbol' => "USD",
'AsOfDate' => "11/19/2009");

// call the service, passing the parameters and the name of the operation $result = $client->GetOfficialCrossRates($param); // assess the results if (is_soap_fault($result)) { echo '<h2>Fault</h2><pre>'; print_r($result); echo '</pre>'; } else { echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>'; } // print the SOAP request echo '<h2>Request</h2><pre>' . htmlspecialchars($client->__getLastRequest(), ENT_QUOTES) . '</pre>'; // print the SOAP request Headers echo '<h2>Request Headers</h2><pre>' . htmlspecialchars($client->__getLastRequestHeaders(), ENT_QUOTES) . '</pre>'; // print the SOAP response echo '<h2>Response</h2><pre>' . htmlspecialchars($client->__getLastResponse(), ENT_QUOTES) . '</pre>'; ?>

Perl/SoapLite

This section assumes that you have SOAP::Lite for Perl installed on your machine and that you are fairly familiar with it. But just in case your are not:

You can then use a text editor to create the source code below. You can execute it by running:


C:\perl\perl demo.pl

Note that there are some unique steps to follow to use SOAP::Lite with .Net web Services. For detailed info, check this article on MSDN.

Here is a sample source for this operation.
# the maptype instruction is critical for compatibility 
use SOAP::Lite maptype => {};

# this is our namespace
my $namespace = 'http://www.xignite.com/services/';

# declare the service using the namespace, the SOAP action and the uri
my $service = SOAP::Lite
-> uri($namespace)
-> on_action( sub { join '/', 'http://www.xignite.com/services', $_[1] } )
-> proxy('http://www.xignite.com/xCurrencies.asmx');

# .Net requires the method, header, and attributes to be fully qualified
my $method = SOAP::Data->name('GetOfficialCrossRates')
->attr({xmlns => $namespace});

# this section is required for authentication
# you can skip it if you use IP-based authentication
my $header = SOAP::Header->name(Header => {
Username => '<your username here>'})->uri($namespace)->prefix('');

# same here, you can omit $header if you use IP-based authentication

my @params = ( $header,
SOAP::Data->name(CountryType => 'Mexico')->uri($namespace),
SOAP::Data->name(Symbol => 'USD')->uri($namespace),
SOAP::Data->name(AsOfDate => '11/19/2009')->uri($namespace));

# you can now call the service
my $result = $service->call($method => @params);
if ($result->fault)
{
print $result->faultstring;
}
else
{
# here we parse the output using the main return class
# and one of its attributes
# check here for the output structure
# since the output is an array, we must loop through the returned instances
foreach my $instance ($result->valueof('//HistoricalCrossRate'))
{
print $instance->{'Rate'}, "\n";
}
}

VB.NET

Dim objCurrenciesService As New RemoteCurrencies.XigniteCurrencies()
Dim objHistoricalCrossRate() As RemoteCurrencies.HistoricalCrossRate _
= objCurrenciesService.GetOfficialCrossRates("Mexico", "USD", "11/19/2009")
If Not objHistoricalCrossRate Is Nothing Then
Select Case objHistoricalCrossRate(0).Outcome
Case RemoteCurrencies.OutcomeTypes.RegistrationError
' display the error to facilitate diagnostics, e.g.
Console.WriteLine(objHistoricalCrossRate(0).Message)
Case RemoteCurrencies.OutcomeTypes.RequestError
' add processing for handling request problems, e.g.
' you could pass back the info message received from the service
Console.WriteLine(objHistoricalCrossRate(0).Message)
Case RemoteCurrencies.OutcomeTypes.SystemError
' add processing for handling system problems, e.g.
Console.WriteLine("Service is unavailable at this time.")
Case Else
' add processing for displaying the results, e.g.
' since the return class contains an array
' we just display its count
' each instance and its values can be easily accessed
Console.WriteLine(objHistoricalCrossRate.GetUpperBound(0).ToString)
End Select
Else
' add error processing here
' this condition could be caused by an HTTP error (404,500...)
Console.WriteLine("Service is unavailable at this time.")
End If

VB6

' this DOM object will contain the result of the call
Dim objResult As IXMLDOMSelection
' create an instance of the soap toolkit
Dim objService As New MSSOAPLib30.SoapClient30
' if your network uses a proxy server, add this line
objService.ConnectorProperty("ProxyServer") = "ip of your proxy server"
' SOAP headers are not supported in the toolkit, so we will fake it with this handler
Dim objHeader As ClientHeaderHandler
Set objHeader = New ClientHeaderHandler
' set the username and passwords to your values
objHeader.Username = "myusername"
objHeader.Password = "mypassword"
Set objService.HeaderHandler = objHeader

' point the the toolkit to the WSDL
objService.mssoapinit "http://www.xignite.com/xCurrencies.asmx?WSDL"

' load the result into the DOM object
Set objResult = objService.GetOfficialCrossRates("Mexico",
"USD",
"11/19/2009")


' you can access the properties this way:
' where objResult(5).nodeName is the name of the 5th field of the instance returned
' and objResult(5).Text is the value
MsgBox objResult(5).nodeName & " = " & objResult(5).Text


' you must also add this class to your code.
' it will create the SOAP header to pass with your request
Class Module "ClientHeaderHandler"
Option Explicit
Implements IHeaderHandler

Private m_uid As String
Private m_pwd As String
Private m_tracer As String

Property Let Username(ByVal value As String)
m_uid = value
End Property

Property Let Password(ByVal value As String)
m_pwd = value
End Property

Property Let Tracer(ByVal value As String)
m_tracer = value
End Property

Private Function iHeaderHandler_ReadHeader( _
ByVal par_reader As MSSOAPLib30.ISoapReader, _
ByVal par_HeaderNode As MSXML2.IXMLDOMNode, _
ByVal par_object As Object) As Boolean
iHeaderHandler_ReadHeader = False
End Function

Private Function iHeaderhandler_willWriteHeaders() As Boolean
iHeaderhandler_willWriteHeaders = True
End Function

Private Sub iHeaderHandler_WriteHeaders( _
ByVal par_serializer As MSSOAPLib30.ISoapSerializer, _
ByVal par_object As Object)

Dim XigniteHeaderString As String

XigniteHeaderString = "<Header xmlns="http://www.xignite.com/services/"> " & _
"<Username>" & m_uid & "</Username>" & _
"<Password>" & m_pwd & "</Password>" & _
"<Tracer>" & m_tracer & "</Tracer>" & _
"</Header>"

par_serializer.WriteXml XigniteHeaderString
End Sub

XSLT

When working with XSL, you only need to worry about properly dealing with namespaces.

The general principle in working with XSL is to apply the stylesheet (the XSL document) to the output of the web service (XML document). The code required to accomplish this varies based on your envirobment. For instance, using VB.Net it would be:

Dim objSOAPClient
Dim objTemplate As New System.Xml.Xsl.XslTransform()
objTemplate.Load(<url_of_XSL_template>)
objTemplate.Transform(<url_of_input_document>,<url_of_output_document>)

In the code above, you want to replace the <url_of_input_document> with the following URL.

http://www.xignite.com/xCurrencies.asmx/GetOfficialCrossRates?CountryType=Mexico&Symbol=USD&AsOfDate=11/19/2009


And this is how you could write the XSL stylesheet. Note that all node names are prefixed.

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xi="http://www.xignite.com/services/"
version="1.0" exclude-result-prefixes="xi">
<table>
<xsl:for-each select="xi:HistoricalCrossRate>
<tr>
<td>
<xsl:value-of select="xi:Rate/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:stylesheet>

 
Copyright © 2009 Xignite, Inc. All Rights Reserved.




Hostname: xignite19