Skip to Content

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.



/wp-content/uploads/2016/04/2016_04_15_14_08_17_930697.jpg

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. /wp-content/uploads/2016/04/2016_04_15_14_17_16_930752.jpg
  • Next, click on Create. /wp-content/uploads/2016/04/2016_04_15_14_18_51_930753.jpg
  • Provide a name to your package, then click on Add button, and choose OData Service. /wp-content/uploads/2016/04/2016_04_15_14_21_39_930764.jpg
  • Provide a name to your OData Artifact and click OK. /wp-content/uploads/2016/04/2016_04_15_14_28_07_930765.jpg
  • On the new view, click on Import Model Wizard icon. /wp-content/uploads/2016/04/2016_04_15_14_30_54_930766.jpg
  • Choose Data Source Type as SOAP and browse the SOAP WSDL file. /wp-content/uploads/2016/04/2016_04_15_14_33_35_930778.jpg
  • Click on Step 2. /wp-content/uploads/2016/04/2016_04_15_14_39_12_930799.jpg
  • Choose SOAP operation, then choose Step 3. /wp-content/uploads/2016/04/2016_04_15_14_40_19_930809.jpg
  • 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./wp-content/uploads/2016/04/2016_04_15_14_40_46_930811.jpg
  • You should now have returned to the Define and Provision an OData Service view. Click create binding in the Query row./wp-content/uploads/2016/04/2016_04_15_15_03_25_930824.jpg
  • In the popup, select the getCustomers Operation. The end point will be generated automatically. Click OK./wp-content/uploads/2016/04/2016_04_15_15_08_49_930825.jpg
  • Navigate to Integration Flow Editor. /wp-content/uploads/2016/04/2016_04_15_15_16_32_930853.jpg/wp-content/uploads/2016/04/2016_04_15_15_22_13_930860.jpg
    • Click on the white area of Integration flow, then click on Runtime Configuration. Provide Namespace Mapping value. Note: you can find the namespace value from WSDL. /wp-content/uploads/2016/04/2016_01_25_13_22_28_930940.png
  • Replace Content Modifier with Mapping. /wp-content/uploads/2016/04/2016_04_15_15_57_53_930896.jpg
  • And, define a source source and target mapping. /wp-content/uploads/2016/04/2016_04_15_16_00_11_930897.jpg
  • 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. /wp-content/uploads/2016/04/2016_04_15_16_18_00_930904.jpg
  • 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. /wp-content/uploads/2016/04/2016_04_15_16_25_01_930920.jpg
  • 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. mapping connection.png
  • 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.

      /wp-content/uploads/2016/04/2016_01_27_11_41_11_930968.png

  • Click on Response_Mapping1 to view its properties and then click the name to open the mapping. /wp-content/uploads/2016/04/responsemapping_930970.png
  • 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.  /wp-content/uploads/2016/04/2016_01_25_13_21_17_930974.png
  • Click OK.
  • Click Save. Then deploy your OData service. /wp-content/uploads/2016/04/2016_01_27_11_48_44_930975.png
  • 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. /wp-content/uploads/2016/04/2016_01_25_13_27_25_930976.png/wp-content/uploads/2016/04/2016_01_27_13_52_12_930977.png

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)

Regards, Midhun

SAP Technology RIG

To report this post you need to login first.

13 Comments

You must be Logged on to comment or reply to a post.

  1. Bhavesh Kantilal

    Hello Midhun,

    I have followed all steps exactly as in your blog and I get the error in my Integration Flow which does not start. The error I get is : The CamelContext did not start. Please check the tail log for details.”

    The tail log provides the error as “2016 04 22 08:24:03#+00#ERROR#org.apache.camel.blueprint.BlueprintCamelContext##anonymous#Blueprint Extender: 1#na#avrhcin#p0208iflmap#web##Error occurred during starting Camel: CamelContext(CustomersListDemo_SAP_1) due Failed to create Producer for endpoint: Endpoint[cxf://bean:Receiver_m10_]. Reason: org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for port {“http://webservice.SalesOrder.test.org“}ServiceImplementation.org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[cxf://bean:Receiver_m10_]. Reason: org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for port {“http://webservice.SalesOrder.test.org“}ServiceImplementation.

    Have done this for both the WSDL in your Blog and for another WSDL ( CurrencyConvertor ) and the error is the same. Any idea what could be wrong?

    Regards

    Bhavesh

    (0) 
  2. Vinothkumar T

    Hi,

    While login to HCI I am getting only Discover option in the dashboard, How to enable Design , monitor and other option .. as i am not able to view the same.

    Regards,

    Vinoth

    (0) 
  3. Venkat Nimmagadda

    Hi Midhun,

    Eventhough I click on Create binding in query row in Define and Provision an OData Service” view ,I’m not getting popup to select my service .

    I’m wondering is there a way to add it(binding) manually ,may be by entering binding piece of code in “ODATA Model Editor”.

    Thanks

    Venkat

    (0) 
    1. Kumar Amar

      Hello Bing,

      Not sure if you already got response. Anyways still thought to reply you.

      ODate Service on Cloud Integration is not enabled by default. Its is still a Beta feature and you can go through https://websmp201.sap-ag.de/public/beta to get it enabled for your tenant application and proceed.

       

      Thanks,

      Amar

      (0) 
  4. Ankit Soni

    Hi @Midhun
    I don’t see option to create ODATA service in integration package. Is there anything required to get that option ?

    Thanks
    Ankit

    (1) 
    1. Kumar Amar

       

      Hello Ankit,

      Not sure if you already got response. Anyways still thought to reply you.

      ODate Service on Cloud Integration is not enabled by default. Its is still a Beta feature and you can go through https://websmp201.sap-ag.de/public/beta to get it enabled for your tenant application and proceed.

      Thanks,

      Amar

      (0) 

Leave a Reply