Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Accessing string arrays using classic ASP (vbscript)

Reply
Thread Tools

Accessing string arrays using classic ASP (vbscript)

 
 
ASPfool
Guest
Posts: n/a
 
      04-21-2005
Hello everyone,

Please help me before I throw my computer out of the window:

I'm working on a web application in classic ASP (vbscript), which is making
calls to some webservices. The calls are made using SOAP - i installed the
SOAP3 toolkit on my windows 2k server to enable this. The webservice calls
are returning String Arrays which I can't seem to do anything useful with.

The call shown below returns a string array with two elements (stored in
returnedData):
....

dim returnedData
returnedData=SoapClient3.createCase(param1, param2, param3)
set SoapClient3=nothing

response.write "<br>"&vartype(returnedData) '8200
response.write "<br>"&typename(returnedData) 'String()
response.write "<br>"&ubound(returnedData) '1
....

The call to the webservice works just fine, and my data is successfully sent
to the other system, however I don't seem to be able to do anything with the
returned string array stored in 'returnedData', bar identify the vartype
(8200) and typename (String()), and number of elements (2 as expected).

As soon as I try something like;

response.write returnedData(1) '(line 5

I get the error:

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
/bwc/ordercomplete.asp, line 58

All other attempts to do something useful with the array fail too, e.g.

myString=Join(returnedData)

results in:

Error Type:
Microsoft VBScript runtime (0x800A01CA)
Variable uses an Automation type not supported in VBScript
/bwc/ordercomplete.asp, line 59

I really need to be able to access these array values - and cannot see any
means of doing it. I'd be very grateful for any help,

Regards,
Jon.
 
Reply With Quote
 
 
 
 
Mark Schupp
Guest
Posts: n/a
 
      04-21-2005
Have you tried explicitly casting the array element to a string?

Response.Write CStr(returnedData(1))

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


"ASPfool" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello everyone,
>
> Please help me before I throw my computer out of the window:
>
> I'm working on a web application in classic ASP (vbscript), which is

making
> calls to some webservices. The calls are made using SOAP - i installed

the
> SOAP3 toolkit on my windows 2k server to enable this. The webservice

calls
> are returning String Arrays which I can't seem to do anything useful with.
>
> The call shown below returns a string array with two elements (stored in
> returnedData):
> ...
>
> dim returnedData
> returnedData=SoapClient3.createCase(param1, param2, param3)
> set SoapClient3=nothing
>
> response.write "<br>"&vartype(returnedData) '8200
> response.write "<br>"&typename(returnedData) 'String()
> response.write "<br>"&ubound(returnedData) '1
> ...
>
> The call to the webservice works just fine, and my data is successfully

sent
> to the other system, however I don't seem to be able to do anything with

the
> returned string array stored in 'returnedData', bar identify the vartype
> (8200) and typename (String()), and number of elements (2 as expected).
>
> As soon as I try something like;
>
> response.write returnedData(1) '(line 5
>
> I get the error:
>
> Error Type:
> Microsoft VBScript runtime (0x800A000D)
> Type mismatch
> /bwc/ordercomplete.asp, line 58
>
> All other attempts to do something useful with the array fail too, e.g.
>
> myString=Join(returnedData)
>
> results in:
>
> Error Type:
> Microsoft VBScript runtime (0x800A01CA)
> Variable uses an Automation type not supported in VBScript
> /bwc/ordercomplete.asp, line 59
>
> I really need to be able to access these array values - and cannot see any
> means of doing it. I'd be very grateful for any help,
>
> Regards,
> Jon.



 
Reply With Quote
 
 
 
 
ASPfool
Guest
Posts: n/a
 
      04-22-2005
Thanks for your input Mark.

Response.Write CStr(returnedData(1)) 'line 58

results in....

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
/bwc/ordercomplete.asp, line 58

Any more ideas anyone?

"Mark Schupp" wrote:

> Have you tried explicitly casting the array element to a string?
>
> Response.Write CStr(returnedData(1))
>
> --
> Mark Schupp
> Head of Development
> Integrity eLearning
> www.ielearning.com
>
>
> "ASPfool" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello everyone,
> >
> > Please help me before I throw my computer out of the window:
> >
> > I'm working on a web application in classic ASP (vbscript), which is

> making
> > calls to some webservices. The calls are made using SOAP - i installed

> the
> > SOAP3 toolkit on my windows 2k server to enable this. The webservice

> calls
> > are returning String Arrays which I can't seem to do anything useful with.
> >
> > The call shown below returns a string array with two elements (stored in
> > returnedData):
> > ...
> >
> > dim returnedData
> > returnedData=SoapClient3.createCase(param1, param2, param3)
> > set SoapClient3=nothing
> >
> > response.write "<br>"&vartype(returnedData) '8200
> > response.write "<br>"&typename(returnedData) 'String()
> > response.write "<br>"&ubound(returnedData) '1
> > ...
> >
> > The call to the webservice works just fine, and my data is successfully

> sent
> > to the other system, however I don't seem to be able to do anything with

> the
> > returned string array stored in 'returnedData', bar identify the vartype
> > (8200) and typename (String()), and number of elements (2 as expected).
> >
> > As soon as I try something like;
> >
> > response.write returnedData(1) '(line 5
> >
> > I get the error:
> >
> > Error Type:
> > Microsoft VBScript runtime (0x800A000D)
> > Type mismatch
> > /bwc/ordercomplete.asp, line 58
> >
> > All other attempts to do something useful with the array fail too, e.g.
> >
> > myString=Join(returnedData)
> >
> > results in:
> >
> > Error Type:
> > Microsoft VBScript runtime (0x800A01CA)
> > Variable uses an Automation type not supported in VBScript
> > /bwc/ordercomplete.asp, line 59
> >
> > I really need to be able to access these array values - and cannot see any
> > means of doing it. I'd be very grateful for any help,
> >
> > Regards,
> > Jon.

>
>
>

 
Reply With Quote
 
Mark Schupp
Guest
Posts: n/a
 
      04-22-2005
Unfortunately I have never done anything with SOAP. I just had a quick look
at the help file and it looks like you can modify the "type mapper". That
may be the approach you need to take.

It also appears that there are ways to get the data back as a list of XML
nodes.

First I would try to get the raw XML back and see what it looks like.

--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com

"ASPfool" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks for your input Mark.
>
> Response.Write CStr(returnedData(1)) 'line 58
>
> results in....
>
> Error Type:
> Microsoft VBScript runtime (0x800A000D)
> Type mismatch
> /bwc/ordercomplete.asp, line 58
>
> Any more ideas anyone?
>
> "Mark Schupp" wrote:
>
>> Have you tried explicitly casting the array element to a string?
>>
>> Response.Write CStr(returnedData(1))
>>
>> --
>> Mark Schupp
>> Head of Development
>> Integrity eLearning
>> www.ielearning.com
>>
>>
>> "ASPfool" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > Hello everyone,
>> >
>> > Please help me before I throw my computer out of the window:
>> >
>> > I'm working on a web application in classic ASP (vbscript), which is

>> making
>> > calls to some webservices. The calls are made using SOAP - i installed

>> the
>> > SOAP3 toolkit on my windows 2k server to enable this. The webservice

>> calls
>> > are returning String Arrays which I can't seem to do anything useful
>> > with.
>> >
>> > The call shown below returns a string array with two elements (stored
>> > in
>> > returnedData):
>> > ...
>> >
>> > dim returnedData
>> > returnedData=SoapClient3.createCase(param1, param2, param3)
>> > set SoapClient3=nothing
>> >
>> > response.write "<br>"&vartype(returnedData) '8200
>> > response.write "<br>"&typename(returnedData) 'String()
>> > response.write "<br>"&ubound(returnedData) '1
>> > ...
>> >
>> > The call to the webservice works just fine, and my data is successfully

>> sent
>> > to the other system, however I don't seem to be able to do anything
>> > with

>> the
>> > returned string array stored in 'returnedData', bar identify the
>> > vartype
>> > (8200) and typename (String()), and number of elements (2 as expected).
>> >
>> > As soon as I try something like;
>> >
>> > response.write returnedData(1) '(line 5
>> >
>> > I get the error:
>> >
>> > Error Type:
>> > Microsoft VBScript runtime (0x800A000D)
>> > Type mismatch
>> > /bwc/ordercomplete.asp, line 58
>> >
>> > All other attempts to do something useful with the array fail too, e.g.
>> >
>> > myString=Join(returnedData)
>> >
>> > results in:
>> >
>> > Error Type:
>> > Microsoft VBScript runtime (0x800A01CA)
>> > Variable uses an Automation type not supported in VBScript
>> > /bwc/ordercomplete.asp, line 59
>> >
>> > I really need to be able to access these array values - and cannot see
>> > any
>> > means of doing it. I'd be very grateful for any help,
>> >
>> > Regards,
>> > Jon.

>>
>>
>>




 
Reply With Quote
 
ASPfool
Guest
Posts: n/a
 
      04-25-2005
Hi Mark,

Thanks again for the reply. I'll look into the type mapper options... In
terms of 'getting the raw xml back' - would something like this do the trick?


dim oDOM
Set oDOM = Server.CreateObject("MSXML2.DOMDocument.4.0")
oDOM.loadXML(SoapClient3.createCase(param1, param2, param3))
response.write(oDOM.XML)

Cheers,
Jon.

"Mark Schupp" wrote:

> Unfortunately I have never done anything with SOAP. I just had a quick look
> at the help file and it looks like you can modify the "type mapper". That
> may be the approach you need to take.
>
> It also appears that there are ways to get the data back as a list of XML
> nodes.
>
> First I would try to get the raw XML back and see what it looks like.
>
> --
> --Mark Schupp
> Head of Development
> Integrity eLearning
> www.ielearning.com
>
> "ASPfool" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Thanks for your input Mark.
> >
> > Response.Write CStr(returnedData(1)) 'line 58
> >
> > results in....
> >
> > Error Type:
> > Microsoft VBScript runtime (0x800A000D)
> > Type mismatch
> > /bwc/ordercomplete.asp, line 58
> >
> > Any more ideas anyone?
> >
> > "Mark Schupp" wrote:
> >
> >> Have you tried explicitly casting the array element to a string?
> >>
> >> Response.Write CStr(returnedData(1))
> >>
> >> --
> >> Mark Schupp
> >> Head of Development
> >> Integrity eLearning
> >> www.ielearning.com
> >>
> >>
> >> "ASPfool" <(E-Mail Removed)> wrote in message
> >> news:(E-Mail Removed)...
> >> > Hello everyone,
> >> >
> >> > Please help me before I throw my computer out of the window:
> >> >
> >> > I'm working on a web application in classic ASP (vbscript), which is
> >> making
> >> > calls to some webservices. The calls are made using SOAP - i installed
> >> the
> >> > SOAP3 toolkit on my windows 2k server to enable this. The webservice
> >> calls
> >> > are returning String Arrays which I can't seem to do anything useful
> >> > with.
> >> >
> >> > The call shown below returns a string array with two elements (stored
> >> > in
> >> > returnedData):
> >> > ...
> >> >
> >> > dim returnedData
> >> > returnedData=SoapClient3.createCase(param1, param2, param3)
> >> > set SoapClient3=nothing
> >> >
> >> > response.write "<br>"&vartype(returnedData) '8200
> >> > response.write "<br>"&typename(returnedData) 'String()
> >> > response.write "<br>"&ubound(returnedData) '1
> >> > ...
> >> >
> >> > The call to the webservice works just fine, and my data is successfully
> >> sent
> >> > to the other system, however I don't seem to be able to do anything
> >> > with
> >> the
> >> > returned string array stored in 'returnedData', bar identify the
> >> > vartype
> >> > (8200) and typename (String()), and number of elements (2 as expected).
> >> >
> >> > As soon as I try something like;
> >> >
> >> > response.write returnedData(1) '(line 5
> >> >
> >> > I get the error:
> >> >
> >> > Error Type:
> >> > Microsoft VBScript runtime (0x800A000D)
> >> > Type mismatch
> >> > /bwc/ordercomplete.asp, line 58
> >> >
> >> > All other attempts to do something useful with the array fail too, e.g.
> >> >
> >> > myString=Join(returnedData)
> >> >
> >> > results in:
> >> >
> >> > Error Type:
> >> > Microsoft VBScript runtime (0x800A01CA)
> >> > Variable uses an Automation type not supported in VBScript
> >> > /bwc/ordercomplete.asp, line 59
> >> >
> >> > I really need to be able to access these array values - and cannot see
> >> > any
> >> > means of doing it. I'd be very grateful for any help,
> >> >
> >> > Regards,
> >> > Jon.
> >>
> >>
> >>

>
>
>
>

 
Reply With Quote
 
Mark Schupp
Guest
Posts: n/a
 
      04-25-2005
check the soap toolkit help file. There was something about it returning a
nodelist instead of a specific variant type if there was no type mapper
defined in the configuration files.

--
Mark Schupp



"ASPfool" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Mark,
>
> Thanks again for the reply. I'll look into the type mapper options... In
> terms of 'getting the raw xml back' - would something like this do the

trick?
>
>
> dim oDOM
> Set oDOM = Server.CreateObject("MSXML2.DOMDocument.4.0")
> oDOM.loadXML(SoapClient3.createCase(param1, param2, param3))
> response.write(oDOM.XML)
>
> Cheers,
> Jon.
>
> "Mark Schupp" wrote:
>
> > Unfortunately I have never done anything with SOAP. I just had a quick

look
> > at the help file and it looks like you can modify the "type mapper".

That
> > may be the approach you need to take.
> >
> > It also appears that there are ways to get the data back as a list of

XML
> > nodes.
> >
> > First I would try to get the raw XML back and see what it looks like.
> >
> > --
> > --Mark Schupp
> > Head of Development
> > Integrity eLearning
> > www.ielearning.com
> >
> > "ASPfool" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Thanks for your input Mark.
> > >
> > > Response.Write CStr(returnedData(1)) 'line 58
> > >
> > > results in....
> > >
> > > Error Type:
> > > Microsoft VBScript runtime (0x800A000D)
> > > Type mismatch
> > > /bwc/ordercomplete.asp, line 58
> > >
> > > Any more ideas anyone?
> > >
> > > "Mark Schupp" wrote:
> > >
> > >> Have you tried explicitly casting the array element to a string?
> > >>
> > >> Response.Write CStr(returnedData(1))
> > >>
> > >> --
> > >> Mark Schupp
> > >> Head of Development
> > >> Integrity eLearning
> > >> www.ielearning.com
> > >>
> > >>
> > >> "ASPfool" <(E-Mail Removed)> wrote in message
> > >> news:(E-Mail Removed)...
> > >> > Hello everyone,
> > >> >
> > >> > Please help me before I throw my computer out of the window:
> > >> >
> > >> > I'm working on a web application in classic ASP (vbscript), which

is
> > >> making
> > >> > calls to some webservices. The calls are made using SOAP - i

installed
> > >> the
> > >> > SOAP3 toolkit on my windows 2k server to enable this. The

webservice
> > >> calls
> > >> > are returning String Arrays which I can't seem to do anything

useful
> > >> > with.
> > >> >
> > >> > The call shown below returns a string array with two elements

(stored
> > >> > in
> > >> > returnedData):
> > >> > ...
> > >> >
> > >> > dim returnedData
> > >> > returnedData=SoapClient3.createCase(param1, param2, param3)
> > >> > set SoapClient3=nothing
> > >> >
> > >> > response.write "<br>"&vartype(returnedData) '8200
> > >> > response.write "<br>"&typename(returnedData) 'String()
> > >> > response.write "<br>"&ubound(returnedData) '1
> > >> > ...
> > >> >
> > >> > The call to the webservice works just fine, and my data is

successfully
> > >> sent
> > >> > to the other system, however I don't seem to be able to do anything
> > >> > with
> > >> the
> > >> > returned string array stored in 'returnedData', bar identify the
> > >> > vartype
> > >> > (8200) and typename (String()), and number of elements (2 as

expected).
> > >> >
> > >> > As soon as I try something like;
> > >> >
> > >> > response.write returnedData(1) '(line 5
> > >> >
> > >> > I get the error:
> > >> >
> > >> > Error Type:
> > >> > Microsoft VBScript runtime (0x800A000D)
> > >> > Type mismatch
> > >> > /bwc/ordercomplete.asp, line 58
> > >> >
> > >> > All other attempts to do something useful with the array fail too,

e.g.
> > >> >
> > >> > myString=Join(returnedData)
> > >> >
> > >> > results in:
> > >> >
> > >> > Error Type:
> > >> > Microsoft VBScript runtime (0x800A01CA)
> > >> > Variable uses an Automation type not supported in VBScript
> > >> > /bwc/ordercomplete.asp, line 59
> > >> >
> > >> > I really need to be able to access these array values - and cannot

see
> > >> > any
> > >> > means of doing it. I'd be very grateful for any help,
> > >> >
> > >> > Regards,
> > >> > Jon.
> > >>
> > >>
> > >>

> >
> >
> >
> >



 
Reply With Quote
 
ASPfool
Guest
Posts: n/a
 
      04-25-2005
Thanks Mark. In the end I felt that it was too difficult to sort this within
classic asp, so with some wonderful fudging, I've sent the data to an
intermediary asp.net file, made by web service call, and forwarded the
returned values to my classic asp app. In future, I think i'll write
everything in .net.... I guess its time to abandon the classic asp ship!

Thanks again for all your input,
regards,
Jon.

"Mark Schupp" wrote:

> check the soap toolkit help file. There was something about it returning a
> nodelist instead of a specific variant type if there was no type mapper
> defined in the configuration files.
>
> --
> Mark Schupp
>
>
>
> "ASPfool" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi Mark,
> >
> > Thanks again for the reply. I'll look into the type mapper options... In
> > terms of 'getting the raw xml back' - would something like this do the

> trick?
> >
> >
> > dim oDOM
> > Set oDOM = Server.CreateObject("MSXML2.DOMDocument.4.0")
> > oDOM.loadXML(SoapClient3.createCase(param1, param2, param3))
> > response.write(oDOM.XML)
> >
> > Cheers,
> > Jon.
> >
> > "Mark Schupp" wrote:
> >
> > > Unfortunately I have never done anything with SOAP. I just had a quick

> look
> > > at the help file and it looks like you can modify the "type mapper".

> That
> > > may be the approach you need to take.
> > >
> > > It also appears that there are ways to get the data back as a list of

> XML
> > > nodes.
> > >
> > > First I would try to get the raw XML back and see what it looks like.
> > >
> > > --
> > > --Mark Schupp
> > > Head of Development
> > > Integrity eLearning
> > > www.ielearning.com
> > >
> > > "ASPfool" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > Thanks for your input Mark.
> > > >
> > > > Response.Write CStr(returnedData(1)) 'line 58
> > > >
> > > > results in....
> > > >
> > > > Error Type:
> > > > Microsoft VBScript runtime (0x800A000D)
> > > > Type mismatch
> > > > /bwc/ordercomplete.asp, line 58
> > > >
> > > > Any more ideas anyone?
> > > >
> > > > "Mark Schupp" wrote:
> > > >
> > > >> Have you tried explicitly casting the array element to a string?
> > > >>
> > > >> Response.Write CStr(returnedData(1))
> > > >>
> > > >> --
> > > >> Mark Schupp
> > > >> Head of Development
> > > >> Integrity eLearning
> > > >> www.ielearning.com
> > > >>
> > > >>
> > > >> "ASPfool" <(E-Mail Removed)> wrote in message
> > > >> news:(E-Mail Removed)...
> > > >> > Hello everyone,
> > > >> >
> > > >> > Please help me before I throw my computer out of the window:
> > > >> >
> > > >> > I'm working on a web application in classic ASP (vbscript), which

> is
> > > >> making
> > > >> > calls to some webservices. The calls are made using SOAP - i

> installed
> > > >> the
> > > >> > SOAP3 toolkit on my windows 2k server to enable this. The

> webservice
> > > >> calls
> > > >> > are returning String Arrays which I can't seem to do anything

> useful
> > > >> > with.
> > > >> >
> > > >> > The call shown below returns a string array with two elements

> (stored
> > > >> > in
> > > >> > returnedData):
> > > >> > ...
> > > >> >
> > > >> > dim returnedData
> > > >> > returnedData=SoapClient3.createCase(param1, param2, param3)
> > > >> > set SoapClient3=nothing
> > > >> >
> > > >> > response.write "<br>"&vartype(returnedData) '8200
> > > >> > response.write "<br>"&typename(returnedData) 'String()
> > > >> > response.write "<br>"&ubound(returnedData) '1
> > > >> > ...
> > > >> >
> > > >> > The call to the webservice works just fine, and my data is

> successfully
> > > >> sent
> > > >> > to the other system, however I don't seem to be able to do anything
> > > >> > with
> > > >> the
> > > >> > returned string array stored in 'returnedData', bar identify the
> > > >> > vartype
> > > >> > (8200) and typename (String()), and number of elements (2 as

> expected).
> > > >> >
> > > >> > As soon as I try something like;
> > > >> >
> > > >> > response.write returnedData(1) '(line 5
> > > >> >
> > > >> > I get the error:
> > > >> >
> > > >> > Error Type:
> > > >> > Microsoft VBScript runtime (0x800A000D)
> > > >> > Type mismatch
> > > >> > /bwc/ordercomplete.asp, line 58
> > > >> >
> > > >> > All other attempts to do something useful with the array fail too,

> e.g.
> > > >> >
> > > >> > myString=Join(returnedData)
> > > >> >
> > > >> > results in:
> > > >> >
> > > >> > Error Type:
> > > >> > Microsoft VBScript runtime (0x800A01CA)
> > > >> > Variable uses an Automation type not supported in VBScript
> > > >> > /bwc/ordercomplete.asp, line 59
> > > >> >
> > > >> > I really need to be able to access these array values - and cannot

> see
> > > >> > any
> > > >> > means of doing it. I'd be very grateful for any help,
> > > >> >
> > > >> > Regards,
> > > >> > Jon.
> > > >>
> > > >>
> > > >>
> > >
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multidimensional arrays and arrays of arrays Philipp Java 21 01-20-2009 08:33 AM
descript string using classic asp ? bitshift ASP .Net 1 11-30-2007 02:16 AM
Difference between accessing arrays and associative arrays using a int index shashi Perl Misc 17 04-13-2006 03:48 PM
Passing arrays from Classic ASP to .NET components - How do you do this transparently? Mark ASP .Net 3 12-10-2003 02:30 PM
RE: Accessing ADO.NET data provider from ASP "classic" page MSFT ASP .Net 0 08-12-2003 08:47 AM



Advertisments