Scott Kricho
asked on
Parsing XML data in VB6
Hello.
I am trying to access XML data in a VB6 application. The XML data is being returned from API calls to a cloud based service.
License.GetActivationKeyFr omUserData and License.ActivateLicense are both API calls that return XML data to keyResponse and licenseResponse.
Dim ActivationKey As String
Dim newLicense As String
Dim keyResponse As String
Dim licenseResponse As String
ActivationKey = License.GetActivationKeyFr omUserData ("", "test", keyResponse)
newLicense = License.ActivateLicense("" , ActivationKey, Environ("computername"), Environ("computername"), "5.0.00", "", licenseResponse)
After the License.GetActivationKeyFr omUserData call, keyResponse returns:
<?xml version="1.0" encoding="utf-8"?> <QuickLicenseManager><resu lt>BNR4060 200G1HJKM8 P9Q115DC95 TCZFDPEDSV F6</result > <avkey>BNR4060200G1HJKM8P9 Q115DC95TC ZFDPEDSVF6 </avkey> </QuickLicenseManager>
And ActivationKey equals 'BNR4060200G1HJKM8P9Q115DC 95TCZFDPED SVF6'
After the License.ActivateLicense call, licenseResponse returns:
<?xml version="1.0" encoding="utf-8"?> <QuickLicenseManager><avke y>BNR40602 00G1HJKM8P 9Q115DC95T CZFDPEDSVF 6</avkey> <pckey>VNR6020200G2HJKM8P9 Q115ERSU8A S8KYV2PS7D </pckey> <computerID>WIN-BES33JO9GB 9</compute rID> <computerName>WIN-BES33JO9 GB9</compu terName> <features>0:2;</features> <userCompany>Krihos International</userCompany > <userFullName>Scott Kricho</userFullName> <userEmail>scott@axlms.com </userEmai l> <licenseModel>subscription </licenseM odel> </QuickLicenseManager>
And newLicense equals an empty string.
What is the proper way for handling XML data in VB6?
I am trying to access XML data in a VB6 application. The XML data is being returned from API calls to a cloud based service.
License.GetActivationKeyFr
Dim ActivationKey As String
Dim newLicense As String
Dim keyResponse As String
Dim licenseResponse As String
ActivationKey = License.GetActivationKeyFr
newLicense = License.ActivateLicense(""
After the License.GetActivationKeyFr
<?xml version="1.0" encoding="utf-8"?> <QuickLicenseManager><resu
And ActivationKey equals 'BNR4060200G1HJKM8P9Q115DC
After the License.ActivateLicense call, licenseResponse returns:
<?xml version="1.0" encoding="utf-8"?> <QuickLicenseManager><avke
And newLicense equals an empty string.
What is the proper way for handling XML data in VB6?
ASKER
Thank you zc2, But the statement doc.LoadXML keyResponse throws error 438: Object doesn't support this property or method. Here's my code:
Dim ActivationKey As String
Dim newLicense As String
Dim keyResponse As String
Dim licenseResponse As String
ActivationKey = License.GetActivationKeyFr omUserData ("", "test", keyResponse)
Dim doc As XMLDocument
Set doc = New XMLDocument
doc.loadXML keyResponse
Dim ActivationKey As String
Dim newLicense As String
Dim keyResponse As String
Dim licenseResponse As String
ActivationKey = License.GetActivationKeyFr
Dim doc As XMLDocument
Set doc = New XMLDocument
doc.loadXML keyResponse
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks zc2! That did the trick.
You are welcome!
Open in new window
Then you can query for a node, like the following:Open in new window