Re: Importing XML through .NET Web Service with VBA
- From: brazilnut <brazilnut.1zoz5a_1133995802.9343@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 7 Dec 2005 16:49:49 -0600
For those who may find it useful, I have figured it out. Here is the
algorithm:
Code:
--------------------
Public Sub GetXML()
Dim objSClient As MSSOAPLib30.SoapClient30 ' soap object to access and expose web service interface
Dim oXML As MSXML2.DOMDocument40 ' xml document object
Dim rst As New ADODB.Recordset ' ADODB recordset
Dim str As New ADODB.Stream ' ADODB stream
' create new soap client
Set objSClient = New SoapClient30
'create new empty XML document
Set oXML = New DOMDocument40
' Point the SOAP API to the web service that we want to call...
' the wsdl file contains the scheme for the webservice
Call objSClient.mssoapinit(par_WSDLFile:="http://localhost/WebService.wsdl")
' Call the web service and load requested XML document in to MSXML DOM document structure
Call oXML.LoadXml(objSClient.GetXMLString())
' open sream
str.Open
' save xml document from web service to stream
oXML.Save str
' set starting position to beginning of stream
str.Position = 0
' open recordset from stream
rst.Open str
' copy recordset to range of cells
Range("A1").CopyFromRecordset rst
Set oXML = Nothing
Set objSClient = Nothing
Set rst = Nothing
Set stream = Nothing
End Sub
--------------------
My next step is to figure out how to get the field names from the XML
file.
--
brazilnut
------------------------------------------------------------------------
brazilnut's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=29411
View this thread: http://www.excelforum.com/showthread.php?threadid=491228
.
- References:
- Importing XML through .NET Web Service with VBA
- From: brazilnut
- Re: Importing XML through .NET Web Service with VBA
- From: Tim Williams
- Re: Importing XML through .NET Web Service with VBA
- From: brazilnut
- Re: Importing XML through .NET Web Service with VBA
- From: Tim Williams
- Re: Importing XML through .NET Web Service with VBA
- From: brazilnut
- Re: Importing XML through .NET Web Service with VBA
- From: brazilnut
- Importing XML through .NET Web Service with VBA
- Prev by Date: Re: How do you cut a paste a macro or VB language in Excel and mak
- Next by Date: Re: VBA error 438 - Object not supporting this property or method
- Previous by thread: Re: Importing XML through .NET Web Service with VBA
- Next by thread: Re: How to get value of variable when single stepping through code?
- Index(es):
Relevant Pages
|