on 08-01-2019 12:30 PM
Dear Experts,
Have a requirement to send URL parameter (https://url.com?invoiceNumber=1760101000) from SAP hybris in REST as Get Request to SAP CPI and then pass only the invoiceNumber "1760101000" as request to RFC and the Response will be Binary code in one field and send back the response to SAP Hybris in REST to get invoice as pdf.
Note: Invoice number "1760101000" will be dynamic for every time
Technical Flow:
SAP Hybris (REST) <-> CPI <-> SAP ECC (RFC) (Synchronous)
Please guide me with the steps or any documents if possible.
Much appreciated!
Thanks a lot.
Best Regards,
Moni
Hi Moni,
As documented under HTTP Sender Adapter, Header CamelHttpQuery stores all the query parameters.
This Mapping script can be used to fetch the value of a given Query Parameter:
import com.sap.it.api.mapping.MappingContext
import java.net.URLDecoder
import java.nio.charset.StandardCharsets
def String fetchQueryParameter(String queryParameter, MappingContext context) {
def queryParams = context.getHeader('CamelHttpQuery')?.split('&')
def queryParamsMap = queryParams.collectEntries { param ->
param.split('=').collect {
URLDecoder.decode(it, StandardCharsets.UTF_8.name())
}
}
return queryParamsMap[queryParameter]
}
Hope this helps,
Bala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.