Robert Daley
2006-11-30 20:59:12 UTC
I am trying to use MSXML to post a request to get exchange rates from http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.wsdl
without using the MSSoap object (I don't want to have to distribute the Soap
Toolkit files). I ran a trace when I sent the request using soap and formulated
the soap envelope (see code below) based on the captured data. Every time
I run my non MSSoap version it only returns the WSDL file instead of my result
set (exchange data).
Can anybody help? The method I need returned is the getAllLatestNoonRates.
VB6 code:
Dim sURL As String
Dim sData As String
Dim sResult As String
sData = "<SOAP-ENV:Envelope xmlns:SOAPSDK1=""http://www.w3.org/2001/XMLSchema""
xmlns:SOAPSDK2=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:SOAPSDK3=""http://schemas.xmlsoap.org/soap/encoding/""
xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/""><SOAP-ENV:Body
SOAP-ENV:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""><SOAPSDK4:getAllLatestNoonRates
xmlns:SOAPSDK4=""http://v1_0.WebService.fxrates.markets""/></SOAP-ENV:Body></SOAP-ENV:Envelope>"
sURL = "http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.wsdl"
Dim objDAVMethod As New MSXML.XMLHTTPRequest
Dim objXMLBody As New MSXML.DOMDocument
objXMLBody.loadXML sData
objDAVMethod.open "POST", sURL, False
objDAVMethod.setRequestHeader "Content-Type", "text/xml"
objDAVMethod.setRequestHeader "Content-Length", Len(sData)
objDAVMethod.setRequestHeader "soapAction", "FXWS:getAllLatestNoonRates"
objDAVMethod.send objXMLBody.documentElement.xml
sResult = "HTTP/1.1" & objDAVMethod.Status & " " & _
objDAVMethod.StatusText & vbNewLine & vbNewLine & _
objDAVMethod.getAllResponseHeaders & _
objDAVMethod.responseTex
without using the MSSoap object (I don't want to have to distribute the Soap
Toolkit files). I ran a trace when I sent the request using soap and formulated
the soap envelope (see code below) based on the captured data. Every time
I run my non MSSoap version it only returns the WSDL file instead of my result
set (exchange data).
Can anybody help? The method I need returned is the getAllLatestNoonRates.
VB6 code:
Dim sURL As String
Dim sData As String
Dim sResult As String
sData = "<SOAP-ENV:Envelope xmlns:SOAPSDK1=""http://www.w3.org/2001/XMLSchema""
xmlns:SOAPSDK2=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:SOAPSDK3=""http://schemas.xmlsoap.org/soap/encoding/""
xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/""><SOAP-ENV:Body
SOAP-ENV:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""><SOAPSDK4:getAllLatestNoonRates
xmlns:SOAPSDK4=""http://v1_0.WebService.fxrates.markets""/></SOAP-ENV:Body></SOAP-ENV:Envelope>"
sURL = "http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.wsdl"
Dim objDAVMethod As New MSXML.XMLHTTPRequest
Dim objXMLBody As New MSXML.DOMDocument
objXMLBody.loadXML sData
objDAVMethod.open "POST", sURL, False
objDAVMethod.setRequestHeader "Content-Type", "text/xml"
objDAVMethod.setRequestHeader "Content-Length", Len(sData)
objDAVMethod.setRequestHeader "soapAction", "FXWS:getAllLatestNoonRates"
objDAVMethod.send objXMLBody.documentElement.xml
sResult = "HTTP/1.1" & objDAVMethod.Status & " " & _
objDAVMethod.StatusText & vbNewLine & vbNewLine & _
objDAVMethod.getAllResponseHeaders & _
objDAVMethod.responseTex