When calling Web services that return content the body part of the response message, you can set the response structure to be one of the following:
|•||Protocol Buffers files, see Protocol Buffers|
The structure selected here determines the mappable items that appear on the mapping as children of the Body item.
To define the response structure:
|1.||Open the Web Service Call Settings dialog box (see Web Service Call Settings).|
|2.||Under Service Definition, select Manual.|
|3.||Under Structures, click Edit next to Response.|
|Tip:||As a shortcut to display this dialog box, click the button in the request part of the Web service component on the mapping.|
|4.||Select one of the following options:|
a) If the Web service returns no content in the body part, or if you would like to process the raw body (MIME entity) directly from the mapping, select No structure.
b) For XML, obtain the XML or DTD schema of the request from the provider of the Web service. If you select an XML instance file, it must have a valid schema reference. Some XML schemas define elements with global declaration (that is, elements whose parent is the schema element). For such schemas, you can choose what element in the schema should be the root element of the mapping structure in MapForce. To do this, click Choose, and then, in the dialog box that appears, select the desired root element.
c) For JSON, obtain the JSON schema of the request from the provider of the Web service, or generate it from a sample JSON file with a tool such as XMLSpy.
|Tip:||If you have a sample XML or JSON request file but don't have a schema file, you can use XMLSpy to generate the schema file. If necessary, XMLSpy can also convert your instance file from XML to JSON, or vice versa.|
b) For Protocol Buffers files, obtain from the Web service provider the .proto file describing the binary file, and then click Browse to select the file. The Root Message Type field is applicable if the Protocol Buffers file contains multiple message types. Click Choose to select the message type that should be at the structure's root.
Optionally, fill the Content type and HTTP status text boxes if you need to filter a response MIME entity by media (content) type and HTTP status code. This is useful if you need conditional handling depending on the HTTP status code and the content type returned by the Web service call. For an example, see Handling the HTTP Response Conditionally.
By default, the Content type filter is set to */*, which matches all media types. The default HTTP status codes are 200 through 299. If the Web service call returns some other status code that isn't handled explicitly, the mapping execution will fail with an error.
When you save the mapping, any absolute paths on this dialog box will become relative to the mapping design file (.mfd) if the check box Save all file paths relative to mfd is selected in component settings, see Web Service Call Settings.
© 2019 Altova GmbH