Solved

Vb.Net - Get Result From WebService Response

Posted on 2014-03-24
3
209 Views
Last Modified: 2014-03-25
Good Day Experts!

Recently GuyHengel helped me execute a WebService in VB6 and return the response.  

Unfortunately I am not well-versed in VB6 so I am not sure how to parse out the result from the response:

<?xml version="1.0" encoding="utf-8"?>
<double xmlns="http://www.webserviceX.NET/">0.8914</double>

What is the best way to retrieve .8914?

Thanks,
jimbo99999
0
Comment
Question by:Jimbo99999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39950767
try:
text0=<double xmlns="http://www.webserviceX.NET/">0.8914</double>

Text2 = Mid(Text0, InStr(1, Text0, ">") + 1, InStr(1, Text0, "<") - (InStr(1, Text0, ">") + 1))
0
 

Author Comment

by:Jimbo99999
ID: 39950778
Thanks for responding.

How do I get the second line of the reponse like is shown in your repsonse?

Thanks,
jimbo99999
0
 
LVL 7

Accepted Solution

by:
COACHMAN99 earned 500 total points
ID: 39950786
There is probably a more elegant way of getting the 'value' from the field in the xml file.
If you don't get a good answer, try this (It uses '.NET' as the 'locator' for your value)

If InStr(1, Text0, ".NET/") > 0 Then
  Dim tmppos As Long
  tmppos = InStr(1, Text0, ".NET/")
  Text2 = Mid(Text0, tmppos+ 7, InStr(tmppos, Text0, "<") - (tmppos+ 7))
End If
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question