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. |
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.
The following activity and deployment diagram shows a Service which gets data from http://www.e2ebridge.com/bridgeFiles/address.xml and sends back the following data structure:
<address id="120"> <street>Lautengartenstr. 12</street> <city>Basel</city> </address> |
The following rules are valid:
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
Figure: Component Diagram for Getting XMLData |
For more information on setting the parameters of the URL adapter dynamically refer to URL. |
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. |
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. |
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.