This page explains the URL Adapter in Bridge context. If you were looking for the same information regarding the PAS Designer, refer to URL Adapter in the Designer guide.
GET Resource
With the <<URLAdapter>> it is also possible to access URL resources. Getting e.g. an XML file follows the same rules as a "normal" GET request. The output is an object called "response" of type blob. The value of response is the XML data encoded in a base64 string. If these XML data should be provided as a SOAP message to the client we have to use the xmlToClass() operation. The mapping between the XML data and SOAP classes is defined in a class diagram.
XML attributes to class are mapped to class attributes.
XML elements are mapped to class associations.
For the above XML data structure this class diagram has to be defined.
Figure: Get XML Data Via HTTP/GET
Figure: <<URLALias>> for Getting XMLData
Click here to see the component diagram used in Builder up to version 6 ...
Figure: Component Diagram for Getting XMLData
For more information on setting the parameters of the URL adapter dynamically refer to URL Adapter Reference.
POST Resource
The following activity diagram shows how to create e.g. a .xml file with the URL adapter. Analogous to creating this file a HTTP/POST of xml data would be possible. The corresponding component diagram is shown above (refer to the component diagram above).
Figure: Posting (Writing) an XML File
The first step creates the two strings street and city which are used in the next step to associate it to the address class. With these two steps the data is ready for the serialization to a xml data structure which is done in the third step serialize class to XML.
The operation classToXML() returns a blob and expects as input parameter a class defining the xml data structure.
For more information on setting the parameters of the URL adapter dynamically refer to URL Adapter Reference.
Tagged Values
Find below a list of relevant tagged values, if the URL adapter is used with the HTTP protocol. Default values used when an option is not explicitly set are written in bold.
Tagged Value
Description
Values
protocol
Transport protocol.
http, https
method
HTTP method.
get, post, put
port
Machine port number the service is binding to. This port number can be given at service level only.