AMT Help Files

Web Services and Lists

Provided Web Services for a list

Provided Web Service Routine

 

A Provided Web Service always uses a routine defined in a Web Service enabled Form, this is no different for lists. For example:

routine list_test (var input_list : list (alpha 20), var output_list : list (alpha 20)) : string
begin_routine

    output_list.add('Artist: '      + input_list[1])
    output_list.add('Song: '        + input_list[2])
    output_list.add('Album: '       + input_list[3])
    output_list.add('Tracknumber: ' + input_list[4])

    result := output_list[2] + '-'  + input_list[1]

end_routine

 

Until AMT 84 'classes' and 'lists' as a routine result parameter were not supported for use with Provided Web Services.
Only 'classes' and 'lists' as var defined parameters were supported for use with Provided Web Services.

With the release of AMT 84 both 'lists' and 'classes' are supported as routine results including for use with Provided Web Services.

 

Creating the Provided Web Service

From this routine a new Provided Web Service can be created using the normal procedure as shown in the Web Services help pages.

It is important that the options in the Provided web service are set to the following values when using lists in web services:

SOAP

Default style: Document

Default use:   Literal

 

 

 The resulting Operations view will look like the example below.

The returned type shows what type of List was used and the correct Length is displayed. The Provided Web Service can now be generated and configured in the Provided Web Services web.config and the appropriate <PortType>.ini file.

 

Consumable Web Service for a List

Creating the Consumable Web Service

To use the provided web service we have just created in Lion, we need to create a consumable web service. This can be done using the normal procedure as shown in the Web Services help pages with one important note:

The WSDL that you load into the consumable web service should be the singlewsdl option of the provided web service ( http://Server/Lion/Provided/Example.svc?singlewsdl ).

In the case of the provided web service example above this is: http://nb1128/Lion/List.svc?singlewsdl

After importing the wsdl the Operations will look like the following screenshot.

 Please note that the XML schema type string was mapped to the type RealString. Numeric lists will be mapped to the type Integer.

 With the consumable web service created, it can be used in Lion as the following example routine will show.

ROUTINE LIST_TEST_WS
VAR
entry_list : list (realstring)
return_list : list (realstring)
result_music : realstring
BEGIN_ROUTINE

entry_list.add('Pink Floyd')
entry_list.add('Eclipse')
entry_list.add('The Dark Side Of The Moon')
entry_list.add('10')

list_cws.BASICHTTPBINDING_ILIST.LIST_TEST(entry_listreturn_listresult_music)
GD_music := result_music

END_ROUTINE