I would like to provide the brief idea of handling the ODATA adapter in HCI. Below is the IFlow used for query C4C ODATA service.
- Using SOAP adapter process a SOAP message, content really does not matter, as there ODATA query is not dependent on the input.
- Request- Reply : using this step, calling C4C synchronously using ODATA adapter.
- ODATA communication channel :
- In the address, make sure you are providing the URL till ODATA service, if you try to mention the entity set of OData also.. you may get the below error while executing the interface.
com.sap.gateway.core.ip.component.odata.exception.OsciException: Not Found : 404 Service with name ‘&codpeople&’ does not exist
- Provide query details in the model operation
- Here also make sure you are providing the same address what was mentioned in connection details.
- Select one of the entity set in the drop down.
- Select the operation that you wanted to perform and fields that you wanted to extract, here I am using query as I need some account details from C4C.
- If you want to extract only few number of records, please mention the number as shown below.
- Once you finish, it will ask you to save the .xsd file which contains your query details that were done as part of above steps, you can reuse it later on..
- Some of the ODATA providers does not require content type to be sent from the sender as C4C, in this case please select the content type as None,
Otherwise you may see below error.
com.sap.gateway.core.ip.component.odata.exception.OsciException: Not Acceptable : 406 : HTTP/1.1 <?xml version=”1.0″ encoding=”utf-8″?><error xmlns=”http://schemas.microsoft.com/ado/2007/08/dataservices/metadata“><code>00145E5B1CC71EE19AA7192A1CD80294</code><message xml:lang=”en”>The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request</message></error>
- Configure a File adapter in the receiver side and deploy your iFlow.
- Process SOAP message from SOAP UI.
- Below is the file that has been created in file system.
Usually In the real time, you are required to query ODATA service provider dynamically.. Not a static URL. In this case use content modifier to dynamically pass the value to ODATA query that you get from the SOAP message.
For eg: below is my SOAP input.
In highlighted tag, I am providing the input value that I would like to query ODATA.
Extract the value from this tag using XPATH condition in Content modifier.
Same has to be called while forming the ODATA URL in communication channel.
execute this interface, you will get only data for this account number.
Note: in case if you want to use the existing EDMX file which was already created in the system previously, make sure you are changing address in connection details also.. else you may get 404 error as below..
Fault:Not Found : 404 : HTTP/1.1 “Resource not found for the segment ”.”