?
Solved

Vb.Net - Get Result From WebService Response

Posted on 2014-03-24
3
Medium Priority
?
213 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 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

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