API Developer
Import the legacy Financing SOAP service WSDL and map it to the RESTful API definition.

Attach a Service WSDL

  1. From the financing 1.0.0 API Design screen, click on the Services option in the left column menu palette.

  2. Click the + icon in the Services section to import web service from WSDL.

  3. Click the Load from URL icon and enter the WSDL URL below and then click Next:

    https://thinkibm-services.mybluemix.net/financing/calculate?wsdl

  4. Click the Show operations to see the available operations in the WSDL end point. Select financingService then click Done.

Build the Financing API Assembly

  1. Click on the Assemble tab to access the assembly editor.

  2. Select the DataPower Gateway policies filter.

  3. In the processing pipeline, mouse over the invoke policy and click the trash icon to delete it.

  4. Scroll down to the bottom of the policy menu, drag and drop the financing web service operations to processing pipeline.

  5. Now you are going to modify the input and output map policy for mapping your REST API into SOAP.

  6. In order to consume a SOAP-based service from your REST-based API, you need to map the query parameter inputs that were defined as part of the GET /calculate operation to a SOAP payload. To do so, click on the financing: input map policy on our pipeline to open the map editor.

  7. Click on the pencil icon in the Input column.

  8. Click on the + parameters for operation... option and select the GET Calculate operation.

    The Map editor will automatically pull in the request parameters that you defined earlier.

  9. Click on the Done button to return to the map editor.

  10. For each of the Input query parameters, map them to their respective SOAP Output elements.

    To map from an input field to an output field, click the circle next to the source element once, then click the circle next to the target element. A line will be drawn between the two, indicating a mapping from the source to the target.

  11. Click the X button in the map editor to return to the policy pipeline.

  12. Click the invoke policy to open its editor.

  13. The SOAP service URL has already been set for you during the service import when we create the API.

  14. Click the X button to return to the policy pipeline.

  15. After the Financing Web Service is invoked, you need to map the SOAP response into a JSON object.

    You already defined the response object called paymentAmount. To do the map, click on the financing: output map policy on our pipeline to open the map editor.

  16. Click on the pencil icon to create a set the output object schema.

  17. Click on the + outputs for operation... option and select the GET /calculate operation.

  18. Set the Content type configuration option to application/json.

  19. Click on the Done button to return to the map editor.

  20. Click the circle next to the paymentAmount source element once, then click the circle next to the target element. A line will be drawn between the two, indicating a mapping from the source to the target.

  21. Click the X button in the map editor to return to the policy pipeline.

  22. Save the API definition.

  23. Click on the <- All APIs link to return to the draft APIs list.

Continue

You are now finished building the financing API. The assembly takes the following actions:

  • Maps the REST query parameters into a SOAP body.
  • Invokes the SOAP service.
  • Transforms the SOAP service’s response into JSON.

Proceed to Import Logistics API.