(Thanks John)
Appreciate the help. I have a quick question regarding the extraction of data from the response. I was able to parse the results using <@assign request$xpathresult "<@ELEMENTVALUE object=myresult xpath=//soapenv:Envelope/soapenv:Body/getLatestNoonRateResponse/getLatestNoo nRateReturn>"> When I try to parse it further though I get stuck as the problem is that the response is itself another XML doc, but I can't get it to DOM. When I take the last output and re DOM it I get a namespace error. I was able to get to it using @locate but would like to understand why I am having the namespace issue and how to get to the data properly via xml dom. Any thoughts? The full response from the service looks like this: <?xml version = '1.0'?> <UtilityData xsi:schemaLocation="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/messag e http://www.sdmx.org/data/SDMXMessage.xsd http://www.newyorkfed.org/xml/schemas/FX/utility http://www.newyorkfed.org/xml/schemas/FX_Utility.xsd" xmlns:generic="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/generic" xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/message" xmlns:utility="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/utility" xmlns:query="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/query" xmlns:structure="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/structure " xmlns:common="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:compact="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/compact" xmlns:frbny="http://www.newyorkfed.org/xml/schemas/FX/utility" xmlns:cross="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/cross"> <Header> <ID>FX12CA</ID> <Test>false</Test> <Name xml:lang="en">Foreign Exchange Canada Dollar Noon Rates</Name> <Prepared>2007-01-18</Prepared> <Sender id="FRBNY"> <Name xml:lang="en">Federal Reserve Bank of New York</Name> <Contact> <Name xml:lang="en">George Matthes</Name> <Email>[EMAIL PROTECTED]</Email> </Contact> </Sender> <ReportingBegin>1994-01-06</ReportingBegin> </Header> <frbny:DataSet> <frbny:Series AVAILABILITY="A" DECIMALS="4" UNIT_MULT="0" TIME_FORMAT="P1D" UNIT="CAD" FX_METHOD="12" DISCLAIMER="12" AUTHORITY="12"><frbny:Key><frbny:FREQ>D</frbny:FREQ><frbny:CURR>USD</frbny:C URR><frbny:FX_TIME>12</frbny:FX_TIME><frbny:FX_TYPE>S</frbny:FX_TYPE></frbny :Key><frbny:Obs OBS_STATUS="A" OBS_CONF="F"><frbny:TIME_PERIOD>2007-01-18</frbny:TIME_PERIOD><frbny:OBS_VAL UE>1.1752</frbny:OBS_VALUE></frbny:Obs></frbny:Series></frbny:DataSet> </UtilityData> For those of you who are learning and want to see another working example of a basic soap call to a web service .. here is the code that worked: <@ASSIGN request$WebService "http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.cfc"> <@ASSIGN request$SOAPAction "http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.cfc"> <@ASSIGN request$SoapPayload '<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"> <SOAP-ENV:Body> <wsdl:getLatestNoonRate> <wsdl:currency_code>CAD</wsdl:currency_code> </wsdl:getLatestNoonRate> </SOAP-ENV:Body> </SOAP-ENV:Envelope>'> <@ASSIGN request$myResult <@DOM value="<@URL LOCATION='@@request$WebService' WAITFORRESULT='true' USERAGENT='Witango <@VERSION> <@PLATFORM><@CRLF>Content-Type: text/xml<@CRLF>SOAPAction: @@request$SOAPAction' POSTARGS='<?xml version=<@DQ>1.0<@DQ> encoding=<@DQ>UTF-8<@DQ> ?><@CRLF><@VAR request$SoapPayload>'>">> Shane Pearlman 831.345.7033 S <http://www.shaneandpeter.com> &P, Inc. _____ From: John McGowan [mailto:[EMAIL PROTECTED] Sent: Thursday, January 18, 2007 7:17 AM To: [email protected] Subject: Re: Witango-Talk: Making a SOAP Call ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
