Skip to Content

Soap Receiver - Illegal base64 character a

Hello Gurus,

I have RFC - SOAP synchronous scenario, in which one of the fields in RFC will get IDoc in tabular (line by line) format in multiple fields.

I am using UDF to concatenate all of the lines into single string and line by line and then followed by UDF for base64 encode.

When we are triggering RFC, getting error saying "Illegabl base64 character a".

Input:

-<item> <ARG0/> <ARG1/> <ARG2>EDI_DC40 030000000000114905146C 3012 EXPINV04 ZEXPIN04 ZEXPINV ZEXPINSAPD01 LS P210 MEXINV LS ZMEXIDOCS 20171113094955 20171102041330</ARG2> </item> -<item>

<ARG0/> <ARG1/> <ARG2>E2EDK01005 030000000000114905100000100000001 MXN 1.00000 DM30 VAT000192 CRME0090082323 21.000 21.350 KGMLG 0001505146 L</ARG2> </item> -<item> <ARG0/> <ARG1/> <ARG2>ZE1EDK01000 030000000000114905100000200000102Guadalajara Jal F009008231720090416NOTA DE CREDITO: Requested Ship Date Dentro de los 30 dias 05/16/2009 0 0 21.000 21.3509999999999999</ARG2> </item> -<item>

<ARG0/> <ARG1/> <ARG2>ZLOGINV000 0300000000001149051000003000000002030201700900823178FD2B967-2836-4812-9860-7D2FAB96 1026.62 G01</ARG2> </item> -<item> <ARG0/> <ARG1/> <ARG2>E2EDKA1003 030000000000114905100000400000000RS 0001505146 Ferro Mexicana, S.A DE C.V. Ceramica, Recubrimiento y Colores Oriente 171 #450, Col. Prol. AragonCol. Prol. Aragon-Inguaran Mexico 07490 MX 50-90-72-00 57-60-51-54 S DIF MXM.OHERRERI 2031</ARG2> </item> -<item>

<ARG0/> <ARG1/> <ARG2>E2EDKA1003 030000000000114905100000500000000AG 0001505146 Cliente de Prueba segundo renglon de clientes Calle 01 49494 Ciudad 33166 56565 MX S la alemana NL ES</ARG2> </item> -<item>

<ARG0/> <ARG1/> <ARG2>E2EDKA1003 030000000000114905100000600000000RE 0001505146 Cliente de Prueba segundo renglon de clientes Calle 01 49494 Ciudad 33166 56565 MX S la alemana NL ES</ARG2>

Concat UDF:

String target = null; for(int i = 0; i < input.length; i++) { if(target==null) { target = input[i]; } else { target = target+'\n'+input[i]; } } result.addValue(target);

base64 encode UDF:

BASE64Encoder encoder = new BASE64Encoder(); String encoded = encoder.encode(var1.getBytes()); return encoded;

Error:

com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Illegal base64 character a

Please provide your valuable inputs to resolve the issue.

Ravi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Nov 16, 2017 at 11:05 AM

    Hi,

    Don't use Sun's Base64 class it is deprecated due to some flaws.

    Try to use : DatatypeConverter.printBase64Binary(buffer.toByteArray())

    Br,

    Manoj

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 16, 2017 at 11:02 AM

    Instead of concatenating try "return as XML" and check.

    Add comment
    10|10000 characters needed characters exceeded