Discussion:
help, trying to use MSXML instead of MSSoap object!
(too old to reply)
Robert Daley
2006-11-30 20:59:12 UTC
Permalink
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
Martin Honnen
2006-12-01 13:31:53 UTC
Permalink
Post by Robert Daley
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).
sURL =
"http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.wsdl"
Try setting the URL to
http://www.newyorkfed.org/markets/fxrates/WebService/v1_0/FXWS.cfc
Post by Robert Daley
objDAVMethod.setRequestHeader "soapAction", "FXWS:getAllLatestNoonRates"
I think it should be
objDAVMethod.setRequestHeader "SOAPAction",
"""FXWS:getAllLatestNoonRates"""
see <http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Loading...