Skip to Content

We offer in CPI the possibility to use WebService via HTTP Adapter. I usually use this feature to quickly test an Integration Flow. Especially if I don’t have an SOAP Interface

  • SFTP
  • Timer Event

Of course you could add a Content Modifier and set the payload hardcoded, but I preferred to have more flexibility and testing different use cases without redeploying the IFlow. The first time I used the http Adapter I couldn’t find the Endpoint or any documentation how to find this (documentation is now far better but still the endpoint is not shown as you have it on SOAP Interfaces.

IFLow with HTTP Endpoint:

 

IFlow with SOAP Endpoint:

 

Where to find the HTTP Endpoint?

In the past I couldn’t find this information in the documentation, but when I looked around in the Cloud Cockpit

I could find the following information

I knew that cxf is used for the SOAP Endpoints so I tried if http is working for the HTTP Endpoints.

So I jused used the HTTP URL and added my values from the channel configuration.

To test the IFlow I used Postman

In the use case above I had to implement a quick access to the ARIBA Catalog. The customer already implemented the On-Premise coding to directly access ARIBA via REST Call. Afterwards they had to follow architecture guidelines to use CPI as middleware between. Therefore I created an HTTP Inbound Interface on CPI.

Update: As of the hint of Eng Swee Yeoh and Maximiliano

We can use dynamic endpoints by adding wildmask to it e.g.

<BASE_PATH>/http/AribaCatalog/*

This allows to send requests like: <BASE_PATH>/http/AribaCatalog/catalogs?date=2014-01-01T00:00:00

The Camel server automatically extracts the query and the resource into following header fields:

CamelHttpQuery : date=2014-01-01T00:00:00

CamelHttpPath : catalogs

 

If you don’t remove those Header fields the get automatically added on the HTTP Outbound Adapter.

 

 

I hope this helps to quickly set up an HTTP IFlow.

 

To report this post you need to login first.

8 Comments

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

  1. Eng Swee Yeoh

    Hi Richard

     

    If you read up the online documentation for Sender HTTP adapter, you can find the details below without going through a guessing game:-

    You can invoke the HTTP endpoints using the syntax <Base URI>/http/<Value of address field>. You can get Base URI value from Services tab in Properties view of a worker node

     

    Also, not entirely sure what you mean by “this wasn’t enough since HTTP Adapter can’t handle real REST Calls” – what’s your definition of real REST calls?

     

    Regards

    Eng Swee

    (0) 
    1. Richard Kleibl Post author

      Hello Eng Swee,

       

      thanks for your response. The first time I used the HTTP Adapter there was not such a documentation regarding the endpoint, but took some time until I wrote the blog.

      Why it isn’t a real REST Adapter. Since the Endpoint is hardcoded and you can submit a REST Request

      e.g. the HTTP Endpoint:

      https://e2148-iflmap.hcisbt.eu1.hana.ondemand.com/http/eai/AR/v002/AribaCatalog

      you now can’t call something like

      https://e2148-iflmap.hcisbt.eu1.hana.ondemand.com/http/eai/AR/v002/AribaCatalog/catalogs/1

      https://e2148-iflmap.hcisbt.eu1.hana.ondemand.com/http/eai/AR/v002/AribaCatalog/catalogs?date=2014-01-01T00:00:00&supplierdomain=buyersystemid

      since this endpoint is not available.

       

      For that purpose I added the the resource as an additional HTTP Header and could afterwards generate an ARIBA Catalog Rest Call

      https://eu.openapi.ariba.com/api/catalogcontent/v1/prod/catalogs?date=2014-01-01T00:00:00&supplierdomain=buyersystemid

       

      Kind Regards

      (0) 
        1. Richard Kleibl Post author

          Hello  Eng Swee,

           

          seems my CPI tenant is working different then yours 🙂

           

          When i call something like:

          https://e2148-iflmap.hcisbt.eu1.hana.ondemand.com/http/eai/AR/v002/AribaCatalog/catalogs?date=2014-01-01T00:00:00&supplierdomain=buyersystemid

           

          I get the following response from CPI

          <html>
          <head>
          <title>Error report</title>
          </head>
          <body>
          <h1>HTTP Status 404 – Not Found</h1>
          </body>
          </html>

           

          Means service not found. Maybe you can enlight me how did you set this up?

           

          Kind Regards

          (0) 
          1. Maximiliano Colman

            Hi,

            You need to check the documentation :

             

            So, if you put “/myhttptest/*” as address in sender http cc you can call to CPI with url “<BASE_PATH>/http/myhttptest/<anything>”( I tested it and works 😉 ).

             

            kind Regards.

            Max.

             

            (0) 
          2. Eng Swee Yeoh

            Hi Richard

             

            Have a look at Max’s response above.

             

            Additionally, there is a mistake in my earlier response. The HTTP call details are in Camel headers CamelHttpUrlCamelHttpQuery (refer documentation for more details). Below is an example of a call to an endpoint that is configured with /dyn/*

             

            Regards

            Eng Swee

            (0) 

Leave a Reply