Solved

Vb.Net - Get Result From WebService Response

Posted on 2014-03-24
3
207 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
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
String manipulation in Visual Basic 7 62
Copy a row 12 62
vbModal 12 51
How to read File Date Created using VB6 8 39
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

770 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