Creating OData Service from SOAP using HCI (beta)
OData provisioning in HCI allows you to create OData from SOAP service. So you could consume it in applications such as Fiori and Mobile.
In this blog I am describing how to create OData service from an existing SOAP service exposed from an on-premise backend system.
Creating OData Model from SOAP WSDL
From the above diagram you note that I am using HANA Cloud Connector to link between HCI and existing on-premise system.
OData model can be created by importing the WSDL file to HCI web tooling. You can download the WSDL file from here. You will be able to create the OData model using this WSDL but you will not be able to test the service since this SOAP service is exposed from an SAP internal system.
- Login to HCI cockpit and choose Design.
- Next, click on Create.
- Provide a name to your package, then click on Add button, and choose OData Service.
- Provide a name to your OData Artifact and click OK.
- On the new view, click on Import Model Wizard icon.
- Choose Data Source Type as SOAP and browse the SOAP WSDL file.
- Click on Step 2.
- Choose SOAP operation, then choose Step 3.
- Choose a primary key for the OData collection (It is mandatory to have at least one primary key in one OData collection). Next, click Finish.
- You should now have returned to the Define and Provision an OData Service view. Click create binding in the Query row.
- In the popup, select the getCustomers Operation. The end point will be generated automatically. Click OK.
- Navigate to Integration Flow Editor.
- Replace Content Modifier with Mapping.
- And, define a source source and target mapping.
- Right click on each property under Target and choose Assign Constant. The constant value should be null as given below (remove the text “Enter Value”). Click Ok.
- Note: Mapping was added to pass a payload with empty data with it. This step is required for this specific SOAP service used. A screenshot of the SOAP service from SOAPUI is given for your understanding.
- Join Mapping1 with Start and Request-Reply. For example if you hover the cursor above the Start, a Connector appears, click on it and connect it with Mapping1. Do the same from Mapping1 to Request-Reply.
- Click on Receiver channel. Then, click on Adapter Specific and provide the below details. Note: the values provided are taken from the WSDL. Also you can note that when choosing On-Premise as Proxy Type the address represents HCC virtual host and port. Under Adapter Specific you need to choose No Client Authentication.
- Click on Response_Mapping1 to view its properties and then click the name to open the mapping.
- Complete the mapping by dragging the source node to the target node. For example drag ns1:getCustomers to the node getCustomersSet. The mapping should look like the following and click OK.
- Click OK.
- Click Save. Then deploy your OData service.
- You have now successfully deployed an integration flow that will provide an OData Service backed by a SOAP Web Service, congratulations!
- Construct the endpoint URL. The format of the URL is <IFLMAP URL>/gw/odata/<OData Service Namespace>/<OData Service Name>;v=1. (More details)
- Finally, test your OData end point URL in a web browser.
You are free to use this OData service in any other applications like Fiori and mobile apps.
To know how to use this OData service in HCPMS mobile app read this blog: How To Create HCPMS Apps With Non OData Backend (beta)
SAP Technology RIG