To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
MSDN Subscribers: Download the VS 2010 Release Candidate
MSDN Subscribers: Download the VS 2010 Release Candidate
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management



Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old May 3rd, 2006, 04:16 PM   #1
miry2j
New Member
 
Join Date: Apr 05
Posts: 14
miry2j is an unknown quantity at this point (<10)
Help with XML

I am having a problem trying to parse thrugh my xml response. It does not get all the information in the response. Here is what my xml soap message looks like:

Code:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
	  <ns1:getCardResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://services.com">
      <getCardReturn href="#id0" />
    </ns1:getCardResponse>
    <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:Card" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://www.mccoymyers.com/CardMaint">
      <addrOne xsi:type="xsd:string">6200 Bell</addrOne>
      <addrTwo xsi:type="xsd:string">
      </addrTwo>
      <atmOflLimit xsi:type="xsd:long">200</atmOflLimit>
      <atmOnlLimit xsi:type="xsd:long">300</atmOnlLimit>
      <cardAccounts soapenc:arrayType="ns2:CardAccount[4]" xsi:type="soapenc:Array">
        <cardAccounts href="#id1" />
        <cardAccounts href="#id2" />
        <cardAccounts href="#id3" />
        <cardAccounts href="#id4" />
      </cardAccounts>
      <cardType xsi:type="xsd:string">MD</cardType>
      <chkOflLimit xsi:type="xsd:long">100</chkOflLimit>
      <chkOnlLimit xsi:type="xsd:long">200</chkOnlLimit>
      <city xsi:type="xsd:string">Bumsville</city>
      <custName xsi:type="xsd:string">Test User</custName>
      <expDate xsi:type="xsd:string">1010</expDate>
      <issueDate xsi:type="xsd:string">0605</issueDate>
      <issueStatus xsi:type="xsd:string">1</issueStatus>
      <maxAtmTrans xsi:type="xsd:long">100</maxAtmTrans>
      <maxOflLimit xsi:type="xsd:long">400</maxOflLimit>
      <maxOnlLimit xsi:type="xsd:long">700</maxOnlLimit>
      <maxPosTrans xsi:type="xsd:long">200</maxPosTrans>
      <memberNbr xsi:type="xsd:int">1</memberNbr>
      <nbrIssued xsi:type="xsd:string">1</nbrIssued>
      <orderCard xsi:type="xsd:string">N</orderCard>
      <orderPin xsi:type="xsd:string">N</orderPin>
      <pan xsi:type="xsd:string">9999999999999999999</pan>
      <pinOffset xsi:type="xsd:string">0000</pinOffset>
      <pposOflLimit xsi:type="xsd:long">200</pposOflLimit>
      <pposOnlLimit xsi:type="xsd:long">400</pposOnlLimit>
      <state xsi:type="xsd:string">TX</state>
      <status xsi:type="xsd:string">0</status>
      <waiveSerChg xsi:type="xsd:string">A</waiveSerChg>
      <zip xsi:type="xsd:string">79109</zip>
    </multiRef>
    <multiRef id="id4" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:CardAccount" xmlns:ns3="http://www.mccoymyers.com/CardMaint" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      <acctDesc xsi:type="xsd:string">Savings number two</acctDesc>
      <acctType xsi:type="xsd:string">11</acctType>
      <id xsi:type="xsd:string">4</id>
      <num xsi:type="xsd:string">1234567851</num>
      <status xsi:type="xsd:string">1</status>
    </multiRef>
    <multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:CardAccount" xmlns:ns4="http://www.mccoymyers.com/CardMaint" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      <acctDesc xsi:type="xsd:string">Savings number one</acctDesc>
      <acctType xsi:type="xsd:string">11</acctType>
      <id xsi:type="xsd:string">3</id>
      <num xsi:type="xsd:string">1234567850</num>
      <status xsi:type="xsd:string">1</status>
    </multiRef>
    <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:CardAccount" xmlns:ns5="http://www.mccoymyers.com/CardMaint" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      <acctDesc xsi:type="xsd:string">Checking number two</acctDesc>
      <acctType xsi:type="xsd:string">01</acctType>
      <id xsi:type="xsd:string">2</id>
      <num xsi:type="xsd:string">1234567801</num>
      <status xsi:type="xsd:string">1</status>
    </multiRef>
    <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns6:CardAccount" xmlns:ns6="http://www.mccoymyers.com/CardMaint" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      <acctDesc xsi:type="xsd:string">Checking number one</acctDesc>
      <acctType xsi:type="xsd:string">01</acctType>
      <id xsi:type="xsd:string">1</id>
      <num xsi:type="xsd:string">1234567800</num>
      <status xsi:type="xsd:string">1</status>
    </multiRef>
  </soapenv:Body>
</soapenv:Envelope>
Here is what my vb code looks like:

VB Code:
  1. Option Explicit
  2. Dim oChild As IXMLDOMNode
  3. Dim Nodes As IXMLDOMNodeList
  4. Dim str As String
  5. Private Sub cmdGetTestCard_Click()
  6.    
  7.    
  8.     Dim maintClient As SoapClient30
  9.     Set maintClient = New SoapClient30
  10.     maintClient.MSSoapInit "http://zeus:8080/Portal/services/CardMaint?wsdl", "CardMaintService", "CardMaint"
  11.    
  12.     Dim valTok As String
  13.    
  14.    
  15.     frmKeyMgr.Visible = False
  16.     valTok = frmKeyMgr.crypt(txtVersion.Text)
  17.     Dim map As New Dictionary
  18.    
  19.    
  20.     'this doesn't work... the server receives the message and sends a response, but the response needs
  21.     'to be mapped.
  22.    
  23.    
  24.     Set Nodes = maintClient.getCard(valTok, "REED01", "000", "7001", "9999999999999999999")
  25.    
  26.   Dim cnt as integer
  27.    
  28.     For Each oChild In Nodes
  29.         cnt = cnt + 1
  30.         If cnt > 4 Then
  31.             rtbCardInfo.Text = rtbCardInfo.Text & vbCrLf & oChild.Text
  32.          
  33.         End If
  34.     Next oChild
  35.    
  36.     If Err <> 0 Then
  37.         MsgBox Err.Description & vbCrLf & _
  38.                "faultCode=" & maintClient.FaultCode & vbCrLf & _
  39.                "faultString=" & maintClient.FaultString & vbCrLf & _
  40.                "faultActor=" & maintClient.FaultActor & vbCrLf & _
  41.                "detail=" & maintClient.Detail
  42.     End If
  43. End Sub

This is what I get in my textbox:

Code:
6200 Bell

200
300

MD
100
200
Amarillo
Test User
1010
0605
1
100
400
700
200
1
1
N
N
9999999999999999999
0000
200
400
TX
0
A
79109
I am missing all my cardAccount info. I have tried to load it into an DOM Document but not able to also tried putting my response in a string but I keep getting an error "Invalid property assignment". I get a "type mismatch " when I try to put it in a DOM document. Any help would be appreciated.
miry2j is offline   Reply With Quote
Old May 3rd, 2006, 07:47 PM   #2
Merri
VB6, XHTML & CSS hobbyist
 
Merri's Avatar
 
Join Date: Oct 02
Location: Finland
Posts: 5,948
Merri is a splendid one to behold (700+)Merri is a splendid one to behold (700+)Merri is a splendid one to behold (700+)Merri is a splendid one to behold (700+)Merri is a splendid one to behold (700+)Merri is a splendid one to behold (700+)Merri is a splendid one to behold (700+)Merri is a splendid one to behold (700+)
Re: Help with XML

Take a look into attributes. Basically the same kind of array stuff you've done with the nodes, just that you need to work out the attributes for each node. If you're not sure how to access attributes, open up Object Browser and look from there what you need, the naming convention is similar (IXMLDOMAttributes or something).
__________________
VB6 in occasional use. I'm all HTML, CSS & JavaScript these days.
« Antec Sonata II: Core 2 Duo E7400, ASRock P45TS, Asus EN9600GT 512 MB, 4 GB, 1.25 TB »
« OS: Windows 7 | Laptop: Amilo Pi 2530-12P| Netbook: Asus EEE 901 »
Merri is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:56 AM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.