Click to See Complete Forum and Search --> : access webservice


jrthor2
08-16-2004, 01:41 PM
I am trying to acces an internal webservice using the below code and I am not getting anything back and no errors. Anyone have any ideas? The only thing I get back is the response.write("before call") line.

[code]
<%
'Option Explicit
response.write("before call")
Response.Buffer = True
if Request.Cookies("gotdata") <> "yes" Then
response.write("after cookie check")
Dim xmlDoc, ReturnValue, xmlDocError, root
Dim data
Set xmlDoc = Server.CreateObject("MSXML2.DOMDocument")
xmlDoc.async = False
xmlDoc.setProperty "ServerHTTPRequest", true
ReturnValue = xmlDoc.Load ("http://itcol01.itc.xxx.com/RA/RATickerWS/RAWS0001.asmx/GetTickerMessage?")
If ReturnValue = False Then
Set xmlDocError = xmlDoc.ParseError
Response.Write "&#xa0;&#xa0;" & xmlDocError.ErrorCode & " - " & xmlDocError.Reason & " URL=" & xmlDocError.URL & "<br>"
Set xmlDocError = Nothing
Else

'Response.Write xmldoc.parseError.reason
Set root = xmlDoc.documentElement

//data = root.selectNodes("//dnam").Item(0).text
data = root.selectNodes("//string").Item(0).text
response.write("before cookie")
Response.Cookies("gotdata") = "yes"
Response.Cookies("gotdata").Expires = DateAdd("h",1,Now) 'expires in 1 hour
response.write("after cookie")
End If

Set xmlDoc = Nothing
End If
%>
[\code]

UPDATE...
I got this working, but the data comes back like this:

Stock: 4.51.....Change: +0.04.....Todays High: 4.60.....Todays Low: 4.42......Yesterday we filled 220,294 Prescriptions. (142,951 new prescriptions and 77,343 refills).

How can I break this up into the following variables:

stock
change
high
low
rx_filled

GOT EVERYTHING WORKING