This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > December 2006 > help, trying to use MSXML instead of MSSoap object!





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author help, trying to use MSXML instead of MSSoap object!
Robert Daley

2006-12-06, 7:31 pm

I am trying to use MSXML to post a request to get exchange rates from http://www.newyorkfed.org/markets/f.../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.responseText


Martin Honnen

2006-12-06, 7:31 pm

Robert Daley wrote:
> I am trying to use MSXML to post a request to get exchange rates from
> http://www.newyorkfed.org/markets/f.../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/f...e/v1_0/FXWS.cfc

> objDAVMethod.setRequestHeader "soapAction", "FXWS:getAllLatestNoonRates"


I think it should be
objDAVMethod.setRequestHeader "SOAPAction",
"""FXWS:getAllLatestNoonRates"""
see <http://www.w3.org/TR/2000/NOTE-SOAP.../#_Toc478383528>



--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Robert Daley

2006-12-06, 7:31 pm

Thank you, with a few modifications to the soap evenlope it worked perfectly!
> Robert Daley wrote:
>
> Try setting the URL to
> http://www.newyorkfed.org/markets/f...e/v1_0/FXWS.cfc
> I think it should be
> objDAVMethod.setRequestHeader "SOAPAction",
> """FXWS:getAllLatestNoonRates"""
> see <http://www.w3.org/TR/2000/NOTE-SOAP.../#_Toc478383528>
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews