Arrays of User-Defined Types w/Web Services Toolkit 3.0

  • Thread starter Database Whiz Consulting
  • Start date
D

Database Whiz Consulting

Hey everybody. Taking a stab that someone might have the answer to this.

I'm using the Web Services Toolkit in Access 2003 to connect to a web
service. One of the functions of the service returns what is supposed to be
an array of a user-defined type.

In the example code below, respMsg.CannedMessage should be an array of
struct_TCannedMessages, but its not. Its only a single object. The one I get
is what should be the last element in the array. Everything I've read in
relation to the Web Services Toolkit seems to either talk about arrays or
complex data types, but never arrays of complex datatypes.

Dim respObj As clsws_XMLGateway
Dim respMsg As struct_TResponse
Dim strMsgs() As Variant
'Dim strMsgs() As struct_TCannedMessages

Set respObj = New clsws_XMLGateway
Set respMsg = respObj.wsm_GetCannedMessages()

strMsgs = Array(respMsg.CannedMessage) ' Returns single CannedMessage
set strMsgs(0) = respMsg.CannedMessage 'Ditto

strMsgs = respMsg.CannedMessage 'Causes Type Mismatch
set strMsgs(0) = respMsg.CannedMessage(0) 'Error because .CannedMessage
is not actually an array.


This is what appears in the declaration of TResponse:

'"CannedMessage" is an array with elements defined as struct_TCannedMessages
'See Complex Types: Arrays in Microsoft Office 2003 Web Services Toolkit Help
'for details on implementing arrays.
Public CannedMessage As Variant


It would seem that it would need to be Public CannedMessage() as Variant,
but that isn't allowed.

Anybody ever encounter this issue?


TIA,


RJ
Database Whiz Consulting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top