Log in

View Full Version : Soap Action Fails: redux and challenge



stanl
05-21-2009, 08:24 AM
In our last episode, although the thread was marked solved... the epistomological question remained [see attached image].....

So, Aaron we both know we have a node object returned from the SOAP ActiveX.... yet what do so with it.... :dunno :dunno :dunno

Well, we could both go back and write an article for submission, maybe to get some creds {though you certainly don't need any}, but that could take years:banghead: so maybe we both submit some parsing code and put the SOAP back up on the soap holder... are you game? Stan

stanl
05-23-2009, 07:26 AM
I'm serious, and I probably shouldn't have used the word 'challenge'... it is more about coming up with a simple yet elegant parsing solution. So, starting from the standpoint that a SOAP query using SoapClient30 returns an XML nodelist Object (and using the WeatherService wdsl as our basis)....

assume you wrote something like


t=" "
strXml = ''
For Each oNode In oNodeList
strXml = strXml & oNode.NodeName & vbcrlf
If oNode.HasChildnodes
For j=0 To oNode.Childnodes.Length -1
oNode1 = oNode.Childnodes(j)
strXml = strXml & t & oNode1.NodeName & vbcrlf
If oNode1.HasChildnodes
For k=0 To oNode1.Childnodes.Length -1
oNode2 = oNode1.Childnodes(k)
strXml = strXml & t & t & oNode2.NodeName & vbcrlf
Next
Endif
Next
Endif
Next


You could expose strXml as [see attached image]. Therefore, parsing the childnode.text values would be easy, but in a general sense, is there a way to pre-determine the level of childnodes? Would xPath be a better route to follow? I would not so much be interested in parsing the results into Excel, but into a Recordset.

Anyone is welcome to jump in. This is not a boring exercise.