<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[CLAIMATE Tech - Medium]]></title>
        <description><![CDATA[SAP + MS oriented cloud and technology enthusiasts - Medium]]></description>
        <link>https://medium.com/claimate-tech?source=rss----28d3a8ba9b99---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>CLAIMATE Tech - Medium</title>
            <link>https://medium.com/claimate-tech?source=rss----28d3a8ba9b99---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 11:09:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/claimate-tech" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Follow an HTTP Redirect in SAP CPI]]></title>
            <link>https://medium.com/claimate-tech/how-to-follow-an-http-redirect-in-sap-cpi-9c4293b63232?source=rss----28d3a8ba9b99---4</link>
            <guid isPermaLink="false">https://medium.com/p/9c4293b63232</guid>
            <category><![CDATA[sap-integration-suite]]></category>
            <category><![CDATA[presigned-url]]></category>
            <category><![CDATA[apache-camel]]></category>
            <category><![CDATA[sap-cpi]]></category>
            <category><![CDATA[http-redirect]]></category>
            <dc:creator><![CDATA[Vladimir Balko]]></dc:creator>
            <pubDate>Thu, 16 Jul 2026 17:07:57 GMT</pubDate>
            <atom:updated>2026-07-16T17:07:58.893Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ivPguKDOt7I8nSEK9RKQow.jpeg" /></figure><h4>The HTTP adapter does not follow redirects. Here is how to handle a 302 — and a trap that gives you a 403 on pre-signed URLs.</h4><p>Many APIs answer a request with <strong>302 Moved Temporarily</strong> and a Location header, instead of returning the data directly. The SAP CPI HTTP adapter does <strong>not</strong> follow that redirect automatically. This post shows how to handle it, and one trap that costs a lot of time when the redirect points to an AWS pre-signed URL.</p><blockquote><strong><em>TL;DR</em></strong><em> — CPI does not follow redirects. Read the </em><em>Location header and call it again. But if that URL is a pre-signed URL (AWS S3/CloudFront, Azure SAS, ...), the HTTP adapter re-encodes it and you get a 403. The safe fix is to make that second call from a Groovy script with </em><em>java.net.URL, which sends the URL exactly as it is.</em></blockquote><h3>Step 1: handle the redirect</h3><p>The CPI HTTP adapter has no “follow redirects” option. By default it even throws an exception on a 3xx response. The standard way to handle it:</p><ol><li>On the first HTTP call, set <strong>Throw Exception on Failure = OFF</strong>.</li><li>Copy the Location response header into a property (for example TargetLocation).</li><li>Make a second HTTP call to that URL.</li></ol><p>For most APIs this is enough. The problems start when the Location is a <strong>pre-signed URL</strong>.</p><h3>The trap: a 403 on the second call</h3><p>Here is a real example. The <strong>Basware API</strong> (public API behaviour, nothing customer-specific) returns the invoice attachment as a redirect:</p><pre>GET /v1/accountingDocuments/{id}/attachments/{attachmentId}<br>-&gt; 302, Location: https://api.us.basware.com/cfsecure/.../INVOICE%20%28copy%202%29%202026.pdf<br>   ?Expires=...&amp;Signature=W-4m2LqUesX~Bxpzq6CfZ~Upf87...&amp;Key-Pair-Id=...</pre><p>The second call to that pre-signed URL fails with <strong>403 Forbidden</strong>. But the same URL works in Postman or Bruno with “follow redirects” on. Why?</p><p>Turn on the trace and compare the Location you received with the URL CPI really sent (RealDestinationUrl). They are different:</p><pre>Path:    received  ...INVOICE%20%28copy%202%29%202026.pdf<br>         CPI sent   ...INVOICE%20(copy%202)%202026.pdf      (%28/%29 decoded to &quot;(&quot; &quot;)&quot;)</pre><pre>Query:   received  ...W-4m2LqUesX~Bxpzq6CfZ~Upf87...<br>         CPI sent   ...W-4m2LqUesX%7EBxpzq6CfZ%7EUpf87...   (every &quot;~&quot; encoded to %7E)</pre><p>A pre-signed URL is signed over the <strong>exact bytes</strong> of the URL. If one character changes its encoding, the signature no longer matches, and you get a 403. Postman sends the URL exactly as it is. CPI changes it.</p><p>Note: this is <strong>not an AWS problem</strong>. It happens with any URL where the exact encoding must stay the same — AWS S3/CloudFront, Azure SAS tokens, Google Cloud signed URLs, and others.</p><h3>Why CPI changes the URL</h3><p>The answer is not in the SAP Help Portal — it is in the <strong>Apache Camel source code</strong>, which the HTTP adapter is built on. Two layers change the URL:</p><ul><li><strong>Camel </strong><strong>UnsafeUriCharactersEncoder.</strong> Camel keeps a list (&quot;BitSet&quot;) of characters it treats as unsafe and encodes them. The tilde is on that list (unsafeCharactersHttp.set(&#39;~&#39;) in the source), so every ~ becomes %7E.</li><li><strong>Apache HttpClient.</strong> It normalizes the URI following RFC 3986. Parentheses are allowed in a path, so HttpClient <strong>decodes</strong> %28/%29 back to ( ).</li></ul><p>Neither layer can be turned off in the adapter. If you want to check it yourself:</p><ul><li>UnsafeUriCharactersEncoder: <a href="https://github.com/apache/camel/blob/main/core/camel-util/src/main/java/org/apache/camel/util/UnsafeUriCharactersEncoder.java">https://github.com/apache/camel/blob/main/core/camel-util/src/main/java/org/apache/camel/util/UnsafeUriCharactersEncoder.java</a></li><li>HttpProducer: <a href="https://github.com/apache/camel/blob/main/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java">https://github.com/apache/camel/blob/main/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java</a></li></ul><p>Reading the Camel source is a good habit — it answers questions the docs leave open.</p><h3>What does not fix it</h3><ul><li><strong>CamelHttpUri / </strong><strong>CamelHttpQuery headers.</strong> They only change which URL goes into the adapter. The adapter still runs the same encoder. (I confirmed this with a trace: still 403.)</li><li><strong>Adapter settings.</strong> There is no “raw URL” or “disable encoding” option.</li><li><strong>The </strong><strong>%25 escaping trick</strong> (SAP <strong>KBA 3131448</strong>, which I also described in an earlier post, <em>&quot;</em><a href="https://medium.com/@vbalko/sap-cloud-integration-url-escaping-hack-34a45f5a1f37"><em>SAP Cloud Integration — URL escaping hack</em></a><em>&quot;</em>). It helps with characters the adapter <em>decodes</em> (the parentheses): send %2528, and it stays %28. But it cannot help with the tilde, because the adapter always <em>encodes</em> ~ to %7E and there is no input that keeps a plain ~. So a configuration-only fix is not possible here.</li></ul><h3>The fix: call the URL from Groovy</h3><p>Since no setting stops the encoding, make the second call <strong>outside</strong> the adapter — from a Groovy script with java.net.URL. new URL(str) sends the URL exactly as it is, like a browser or Postman.</p><p>Replace the second HTTP call (the Request-Reply step and its receiver channel) with one Groovy script step that reads the pre-signed URL from the property and downloads the file:</p><pre>import com.sap.gateway.ip.core.customdev.util.Message<br>import java.net.HttpURLConnection<br>import java.net.URL<br><br>/**<br> * Downloads a file from a pre-signed URL captured from the 302 &quot;Location&quot; header<br> * (stored in property TargetLocation).<br> *<br> * Why Groovy and not the HTTP adapter:<br> * The CPI HTTP adapter (Apache Camel + HttpClient) always re-encodes the URL - it<br> * turns &#39;~&#39; into &#39;%7E&#39; and decodes &#39;%28&#39;/&#39;%29&#39; to &#39;(&#39; &#39;)&#39;. A pre-signed URL is<br> * signed over the exact bytes, so any change -&gt; 403. java.net.URL sends the URL<br> * exactly as it is.<br> */<br>def Message processData(Message message) {<br><br>    def messageLog = messageLogFactory.getMessageLog(message)<br>    def rawUrl = message.getProperty(&quot;TargetLocation&quot;)?.toString()<br><br>    // Guard: nothing to download<br>    if (rawUrl == null || rawUrl.trim().isEmpty()) {<br>        if (messageLog != null) {<br>            messageLog.addCustomHeaderProperty(&quot;Termination_Reason&quot;, &quot;Missing_TargetLocation&quot;)<br>        }<br>        throw new IllegalStateException(&quot;TargetLocation is empty - no URL to download&quot;)<br>    }<br><br>    HttpURLConnection conn = null<br>    try {<br>        URL url = new URL(rawUrl)                    // keeps the URL byte-for-byte<br>        conn = (HttpURLConnection) url.openConnection()<br>        conn.setRequestMethod(&quot;GET&quot;)<br>        conn.setInstanceFollowRedirects(true)<br>        conn.setConnectTimeout(60000)<br>        conn.setReadTimeout(60000)<br>        // Pre-signed URL is self-authenticating -&gt; no Authorization header.<br><br>        int rc = conn.getResponseCode()<br>        if (messageLog != null) {<br>            messageLog.addCustomHeaderProperty(&quot;Attachment_HTTP_Status&quot;, String.valueOf(rc))<br>        }<br><br>        if (rc &gt;= 200 &amp;&amp; rc &lt; 300) {<br>            // Read the body in 8 KB chunks. Fine for normal documents;<br>            // for very large files, use a streaming pattern to avoid OOM.<br>            def buffer = new ByteArrayOutputStream()<br>            conn.getInputStream().withStream { input -&gt;<br>                byte[] chunk = new byte[8192]<br>                int n<br>                while ((n = input.read(chunk)) != -1) {<br>                    buffer.write(chunk, 0, n)<br>                }<br>            }<br>            byte[] data = buffer.toByteArray()<br><br>            message.setBody(data)<br>            def ct = conn.getContentType()<br>            if (ct != null) { message.setHeader(&quot;Content-Type&quot;, ct) }<br>            message.setHeader(&quot;CamelHttpResponseCode&quot;, rc)<br><br>            if (messageLog != null) {<br>                messageLog.addCustomHeaderProperty(&quot;Attachment_Size_Bytes&quot;, String.valueOf(data.length))<br>            }<br>        } else {<br>            def err = &quot;&quot;<br>            try {<br>                def es = conn.getErrorStream()<br>                if (es != null) { es.withStream { err = it.getText(&quot;UTF-8&quot;) } }<br>            } catch (ignored) { }<br>            if (messageLog != null) {<br>                messageLog.addCustomHeaderProperty(&quot;Termination_Reason&quot;, &quot;Download_Failed&quot;)<br>                messageLog.addCustomHeaderProperty(&quot;Error_Detail&quot;, &quot;HTTP &quot; + rc + &quot;: &quot; + err)<br>            }<br>            throw new RuntimeException(&quot;Download failed, HTTP &quot; + rc + &quot;: &quot; + err)<br>        }<br>    } finally {<br>        if (conn != null) { conn.disconnect() }<br>    }<br><br>    return message<br>}</pre><h3>A note on using Groovy for HTTP</h3><p>SAP recommends the HTTP adapter by default, and that is a good rule. But for a public pre-signed URL, the usual reasons against Groovy do not apply: no Cloud Connector, no client certificate, no proxy needed on Cloud Foundry. Two things still matter, and the script handles both: add MPL log entries so the call is visible in monitoring, and be careful with memory for very large files (stream instead of loading the full body).</p><h3>Summary</h3><ul><li>The CPI HTTP adapter does not follow redirects — read the Location header and call again.</li><li>A 403 on a pre-signed URL is usually <strong>URL re-encoding</strong>, not authentication, and it is not AWS-specific.</li><li>The adapter re-encodes the URL in two layers (~ → %7E and %28 → (), and this cannot be turned off. When unsure, read the Camel source.</li><li>The %25 trick (KBA 3131448) fixes the parentheses but not the tilde.</li><li>To send the URL exactly as it is, use a <strong>Groovy script with </strong><strong>java.net</strong>, and add MPL logs.</li></ul><h3>References</h3><ul><li>SAP KBA 3131448 — <em>HTTP Receiver adapter discards encoding of special characters in address</em></li><li><em>SAP Cloud Integration — URL escaping hack</em> (my earlier post): <a href="https://medium.com/@vbalko/sap-cloud-integration-url-escaping-hack-34a45f5a1f37">https://medium.com/@vbalko/sap-cloud-integration-url-escaping-hack-34a45f5a1f37</a></li><li>Apache Camel UnsafeUriCharactersEncoder: <a href="https://github.com/apache/camel/blob/main/core/camel-util/src/main/java/org/apache/camel/util/UnsafeUriCharactersEncoder.java">https://github.com/apache/camel/blob/main/core/camel-util/src/main/java/org/apache/camel/util/UnsafeUriCharactersEncoder.java</a></li><li>Apache Camel HttpProducer: <a href="https://github.com/apache/camel/blob/main/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java">https://github.com/apache/camel/blob/main/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c4293b63232" width="1" height="1" alt=""><hr><p><a href="https://medium.com/claimate-tech/how-to-follow-an-http-redirect-in-sap-cpi-9c4293b63232">How to Follow an HTTP Redirect in SAP CPI</a> was originally published in <a href="https://medium.com/claimate-tech">CLAIMATE Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Practical Guide to Naming iFlows in SAP Cloud Integration (SCI)]]></title>
            <link>https://medium.com/claimate-tech/a-practical-guide-to-naming-iflows-in-sap-cloud-integration-sci-b177a669adc0?source=rss----28d3a8ba9b99---4</link>
            <guid isPermaLink="false">https://medium.com/p/b177a669adc0</guid>
            <category><![CDATA[sap-cloud-integration]]></category>
            <category><![CDATA[gui̇de]]></category>
            <category><![CDATA[naming-conventions]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Vladimir Balko]]></dc:creator>
            <pubDate>Wed, 23 Oct 2024 17:24:42 GMT</pubDate>
            <atom:updated>2026-09-10T13:14:23.241Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ONWM3E2-rP0LyVt27RV4TQ.png" /></figure><blockquote><strong>Update:</strong> An updated version of this guide is available — <a href="https://medium.com/@vbalko/naming-iflows-in-sap-cloud-integration-what-two-years-of-production-taught-us-10dfe6dc0f0f">Naming iFlows in SAP Cloud Integration: What Two Years of Production Taught Us.</a> Two years of running this convention across real customer landscapes bent and polished it: a landscape marker, project-based numbering, separate source and target, and an explicit perspective anchor for IN/OUT. The article below is kept unchanged as the original.</blockquote><p>In SAP Cloud Integration (SCI), naming iflows clearly and consistently is crucial for maintainability and support. A structured naming convention helps teams quickly understand an iflow’s purpose, its integration partners, and its data flow. At <a href="https://claimate.tech/"><strong>CLAIMATE Tech</strong></a>, we follow a well-defined approach to naming our iflows, and here’s our guide to making it work for you.</p><h4>Our Naming Template</h4><p>We use the following format for naming iflows in SCI:</p><pre>SCI&lt;iflowid&gt;_&lt;direction&gt;_&lt;iflowdesc&gt;</pre><p>Each part of this structure serves a specific purpose. Let’s break it down:</p><p><strong>SCI&lt;iflowid&gt;</strong></p><p>The unique identifier of the iflow. It can be broken down to the pattern</p><pre>SCI&lt;class&gt;XXXYY</pre><ul><li><strong>&lt;class&gt;</strong> A 3-digit code representing the message class (e.g., 000 for utility messages or 002 for partner integrations).</li><li><strong>XXX</strong> Our internal partner ID for easy identification (e.g., 001 for LumixTech, 002 for VeloCorp).</li><li><strong>YY</strong> Sequence number for the message, usually incremented in steps of 10 or 5 (e.g., 10 for order submission, 20 for acknowledgment).</li></ul><p><strong>&lt;direction&gt;</strong></p><p>The data flow direction.</p><ul><li>IN: Inbound</li><li>OUT: Outbound</li><li>INT: Internal (non-partner-related utility iflow)</li></ul><p><strong>&lt;iflowdesc&gt;</strong></p><p>A flexible description of the iflow, typically used for partner integrations.</p><p>It usually follows the structure:</p><ul><li>&lt;partner&gt;_&lt;senderAdapter&gt;_&lt;receiverAdapter&gt;_&lt;msgName&gt;</li></ul><p>where</p><ul><li><strong>&lt;partner&gt;</strong> A human-readable name for the partner (e.g., LumixTech, VeloCorp).</li><li><strong>&lt;senderAdapter&gt;</strong> and <strong>&lt;receiverAdapter&gt;</strong> The adapters used (e.g., HTTP, SFTP, ProcessDirect).</li><li><strong>&lt;msgName&gt;</strong> The message or process name (e.g., OrderRequest, InvoiceSubmission).</li></ul><h3>Example iFlows</h3><p>Here are two examples of well-named iflows:</p><p><strong>SCI00200150_IN_VeloCorp_HTTP_SFTP_OrderRequest</strong></p><p><strong>Explanation</strong>: This iflow handles an inbound (IN) integration for partner <strong>VeloCorp</strong>, using <strong>HTTP</strong> as the sender adapter and <strong>SFTP</strong> as the receiver adapter, with the message type <strong>OrderRequest</strong>. Message is from class <strong>002</strong> which can be eg. Partner integration and is <strong>001 </strong>is lookup id for partner VeloCorp. This message has its id <strong>50 </strong>so orderRequests from VeloCorp and its utility iflow starts with digit 5.</p><p><strong>SCI00200151_INT_VeloCorp_HTTP_SFTP_OrderRequest_PostProcess</strong></p><p><strong>Explanation</strong>: This is an internal iflow that serves as a first (5<strong><em>1</em></strong>)helper for the <strong>OrderRequests (<em>5</em></strong>1<strong>) </strong>integration with <strong>VeloCorp</strong>, handling <strong>PostProcess</strong> logic for the <strong>OrderRequest</strong> message, also using <strong>HTTP</strong> and <strong>SFTP</strong> adapters.</p><h4>Why Naming Conventions Matter</h4><p>Having a consistent naming convention allows for:</p><ul><li><strong>Easier troubleshooting</strong>: Issues can be quickly traced to specific iflows.</li><li><strong>Improved supportability</strong>: The team can easily understand each iflow without needing extensive documentation.</li><li><strong>Enhanced collaboration</strong>: Clear naming rules allow different teams to work on the same integration projects more efficiently.</li></ul><h4>Standardizing Naming for New Projects</h4><p>Each project or purpose or team should have its own class number. That class number must be <strong>unique</strong>. Also ID for partners must be unique for class and ID of message must be unique per partner.</p><p>Maintaining a shared list of these IDs and their purposes in a central knowledge base—like Excel, Notion, or Azure DevOps—would ensure clarity and prevent duplication.</p><h3>Conclusion</h3><p>Following these naming guidelines will make your iflows easier to manage, support, and collaborate on within SAP Cloud Integration. Remember: a little consistency goes a long way!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b177a669adc0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/claimate-tech/a-practical-guide-to-naming-iflows-in-sap-cloud-integration-sci-b177a669adc0">A Practical Guide to Naming iFlows in SAP Cloud Integration (SCI)</a> was originally published in <a href="https://medium.com/claimate-tech">CLAIMATE Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>