Consulting

Results 1 to 2 of 2

Thread: Soap Action Fails: redux and challenge

  1. #1
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location

    Soap Action Fails: redux and challenge

    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....

    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 so maybe we both submit some parsing code and put the SOAP back up on the soap holder... are you game? Stan

  2. #2
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location
    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

    [vba]
    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
    [/vba]

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •