Solved

Vb.Net - Get Result From WebService Response

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

863 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