Solved

Vb.Net - Get Result From WebService Response

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now