on 2023 Sep 29 12:17 PM
Dear community members,
I'm quite new to the SAP CPI world and learning many new things with the time.
As per my requirement I need to use external parameters using content modifier to the HTTP adapter for making a dynamic query API call to the Microsoft Graph. With my current implementation I'm able to do so only for the integer value parameters successfully (without using any script). But when it comes to the parameter value with alphanumeric including special characters then I'm facing an issue. (Example-'ABC_12345_XYZ')
For this reason, I tried to use Groovy script for implementing a query encoding (in UTF-8) due to special characters, also tried inline query encoding, but unable to get desired result.
Could you please guide me, what else I can do in this case?
Below is an used Groovy script for the reference,
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
import org.apache.http.client.utils.URIBuilder
def mailNickname = exchange.getProperty("mailNickname")
if (mailNickname) {
def encodedMailNickname = new URIBuilder().setParameter("param", mailNickname).build().getQuery()
exchange.setProperty("mailNickname", encodedMailNickname)
} else {
throw new Exception("mailNickname property not found.")
}
/*
if (mailNickname) {
def encodedMailNickname = URLEncoder.encode(mailNickname, 'UTF-8')
message.setProperty("mailNickname", encodedMailNickname)
} else {
throw new Exception("mailNickname property not found.")
}
*/
Thank you in advance and appreaciate your answers.
Request clarification before answering.
But when it comes to the parameter value with alphanumeric including special characters then I'm facing an issue. (Example-'ABC_12345_XYZ')
What is the issue? As far as I know, it should not matter if there an alpha char or a special character in the externalized parameter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.