1 つの方法は、WebGet wcf サービスを作成することです。サービスは adorecordset xml を返します。マクロでは、次のコードを使用してレコードセットを取得できます。
Public Function GetRSFromString(sXML As String) As Object
Dim oStream As Object, oRecordset As Object
Set oStream = CreateObject("ADODB.Stream")
oStream.Open
oStream.WriteText sXML
oStream.Position = 0
Set oRecordset = CreateObject("ADODB.Recordset")
oRecordset.Open oStream
oStream.Close
Set oStream = Nothing
Set GetRSFromString = oRecordset
Set oRecordset = Nothing
End Function
Public Function GetSoapRequest()
Dim strResult As String
Dim xmlhtp As Object, xmlDoc As Object, oRecordSetFromXML As Object
Set xmlhtp = CreateObject("msxml2.xmlhttp.6.0")
With xmlhtp
.Open "get", "http://[server]/ServiceName.svc/FunctionName", False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.Send
Set xmlDoc = CreateObject("msxml2.DOMDocument.6.0")
strResult = .responseText
xmlDoc.loadXML strResult
Set oRecordSetFromXML = AdoFunction .GetRSFromString(xmlDoc.Text)
End With
Set xmlDoc = Nothing
Set xmlhtp = Nothing
End Function