
Before walking through the solution, We will glide through How it started.
Addressing the Integration community, We have a lot of systems to connect and indeed as an integration consultant we will be having POs and CPI systems to access them we will be using bookmarks and find it difficult to remember and open them at first glance.
As an enthusiastic integration consultant, I wanted to access the systems with in single click. I built a webpage with the help of Chat-GPT and wanted to host it but was not sure to host it on the internet and expose the domains.
Discussed the same with teammates and one of the teammates came up with a solution why can’t we do this with CPI, We will host it through CPI.
How to achieve this?
import com.sap.gateway.ip.core.customdev.util.Message
import java.util.HashMap
import java.text.SimpleDateFormat
import java.util.Base64;
def Message processData(Message message) {
def staticContent = message.getProperties().get("HTML_CONTENT");
//Parse static content
Base64.Decoder decoder = Base64.getDecoder();
staticContent = new String(decoder.decode(staticContent));
message.setBody(staticContent.getBytes("UTF-8"));
message.setHeader("Content-Type", "text/html; charset=utf-8");
return message
}
4.Deploy the iflow, copy the HTTPS URL, and hit it from the browser, you can access your webpage. 5. In case you're getting a CORS error, Please use API management to surpass it.
Let me know if you have any queries and please share your interesting findings as well! You can contact me on LinkedIn regarding the same! Until then stay tuned!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |