Trying to parse an Errors array which is part of an xml document froman xml service Options

B

Bob Alston

I am sending an XML request to a server and successfully getting back
an XML document. This document has two pieces one of which is an
IXMLDOMNodeList and the other is an array containing error messages.
These structures are defined in classes created by using the Web
Services References Toolkit. The definition for the response is
class
module struct_WSDownloadResult:

Option Compare Database


'*****************************************************************
'This class was created by the Microsoft Office 2003 Web Services
Toolkit.
'
'Created: 10/30/2009 06:39:41 PM
'
'Description:
'This class is a Visual Basic for Applications class representation
of
the user-defined
'type as defined by http://cmbhstrn.dshs.state.tx.us/cmbhswebservice/service/downloadserv....
'
'This class only contains the WSDownloadResult,
'as defined in the WSDL.
'
'Changes to the code in this class may result in incorrect behavior.
'
'*****************************************************************


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


The struct further defining the Errors array is named
struct_ServiceError


Option Compare Database


'*****************************************************************
'This class was created by the Microsoft Office 2003 Web Services
Toolkit.
'
'Created: 10/30/2009 06:39:41 PM
'
'Description:
'This class is a Visual Basic for Applications class representation
of
the user-defined
'type as defined by http://cmbhstrn.dshs.state.tx.us/cmbhswebservice/service/downloadserv....
'
'This class only contains the ServiceError,
'as defined in the WSDL.
'
'Changes to the code in this class may result in incorrect behavior.
'
'*****************************************************************


Public Id As String
Public Message As String


I need to know how I can access the contents of the Errors array?
I am using Access/VBA as my platform.


Bob
 
B

Bob Alston

I am sending an XML request to a server and successfully getting back
an XML document.  This document has two pieces one of which is an
IXMLDOMNodeList and the other is an array containing error messages.
These structures are defined in classes created by using the Web
Services References Toolkit.  The definition for the response is
class
module  struct_WSDownloadResult:

Option Compare Database

'*****************************************************************
'This class was created by the Microsoft Office 2003 Web Services
Toolkit.
'
'Created: 10/30/2009 06:39:41 PM
'
'Description:
'This class is a Visual Basic for Applications class representation
of
the user-defined
'type as defined byhttp://cmbhstrn.dshs.state.tx.us/cmbhswebservice/service/downloadserv....
'
'This class only contains the WSDownloadResult,
'as defined in the WSDL.
'
'Changes to the code in this class may result in incorrect behavior.
'
'*****************************************************************

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

The struct further defining the Errors array is named
struct_ServiceError

Option Compare Database

'*****************************************************************
'This class was created by the Microsoft Office 2003 Web Services
Toolkit.
'
'Created: 10/30/2009 06:39:41 PM
'
'Description:
'This class is a Visual Basic for Applications class representation
of
the user-defined
'type as defined byhttp://cmbhstrn.dshs.state.tx.us/cmbhswebservice/service/downloadserv....
'
'This class only contains the ServiceError,
'as defined in the WSDL.
'
'Changes to the code in this class may result in incorrect behavior.
'
'*****************************************************************

Public Id As String
Public Message As String

I need to know how I can access the contents of the Errors array?
I am using Access/VBA as my platform.

Bob

Got the solution from the Microsoft Partner forum

This is the code for the retrieval of the XML data:

Set dwserviceresult2 = dwservice.wsm_DownloadDocument
(dwserviceParameter)

This is the code to access the errors array:
Dim count As Integer
count = UBound(dwserviceresult2.Errors)
For Index = 0 To count
MsgBox (dwserviceresult2.Errors(Index).Message)
Next Index
 

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