cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP to RFC (PDF generate) invalid XML character

Former Member
0 Kudos

Hi Experts,

I developed SOAP to RFC scenario (Sync), where RFC function generate PDF format in variable type table of "TLINE".

Then it send back to Web service by SOAP Adapter. Everything work fine except one thing, I'm facing this error...

"Runtime exception occurred during application mapping com/sap/xi/tf/_Z_MM_PETTY_PRINT_RES_;com.sap.aii.utilxi.misc.api.BaseRuntimeException:Character reference "&#20" is an invalid XML character."

Also, I did some search and try to solve it, the error is related to "invalid XML character" which are some of Character not supported by XML

My question is, Are there any way to Set for Ignore this error in PI, or!!!, I have to replace it by myself....

Actually I got the solution, I converted into XString format, it work fine through PI interface... But really want to share this error in case anyone know how to solve it... I will very appreciate!

Cheers,

terry

Accepted Solutions (0)

Answers (3)

Answers (3)

PeterJonker
Active Contributor
0 Kudos

Does anybody got a solution for this problem ? I have the same problem.

My scenario is Synchronous SOAP-PI-ECC(RFC) over AAE (advanced Adapter Engine, java only) I am on PI 7.11.

The response message contains an xml tag with pdf converted into string data (via binary -> xstring-> string). Some pdf's go without problem, where others give a server error: Invalid character. First I thought it had to do with size, but that's no issue, since from the 4 documents I tried, the smallest and the biggest in size had no problem and were send through to the SOAP adapter and to the requester of the document.

Besides this "invalid character" issue I also had to use an operation mapping in the ICO (integrated Configuration object) while the message is the same at both sides. However if I don't use the mapping the message contains only empty XML tags.

I used the example as described in Link: [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c0a39881-80c0-2c10-509d-c8129b39424f]. In this example also no operation mapping is used, but in my case it doesn't work (empty tags). I thought that maybe this invalid character would not occur when there is no mapping, but like I said I am forced to use operation mapping.

I have no idea how to continue.

Does anybody have some advice how I can taggle the invalid character in the response from the RFC call ?

Kind regards,

Peter Jonker

PeterJonker
Active Contributor
0 Kudos

SOLVED by using base64 encoding.

RameshGulipall
Active Participant
0 Kudos

Hi Terry,

I have same requirement of SOAP to Proxy have to send the soap message with attachment JPGE or PDF from Source system to target CRM system. Can you guide me how achieve.

Regards,

Ramesh

Former Member
0 Kudos

Hi Ramesh,

As my understand (not sure if I wrong), you can attach file in Payload only with Proxy... please see this thread

But in my case, I send data from SOAP to RFC and I want to return PDF in format of Variable type "TLINE" but some of character is not valid by XML...

In your case, I think you can use Proxy.

stefan_grube
Active Contributor
0 Kudos

You cannot send binary data with RFC adapter.

XString could help, but I recommend using a base64 encoding which is internet standard.

Look for a base64 encoding function in ABAP and encode your PDF.

Former Member
0 Kudos

Hi Stefan Grube ,

Thanks for your suggestion, Actually I solve it by using Xstring, but now facing problem in Receiver site, not sure they can figure out how to decode into PDF format or not. But really thanks for you suggestion I will try to use it...

Cheers,

terry

former_member181985
Active Contributor
0 Kudos

Hi,

Check My WIKI Section @[How to Send Binary Data to RFC from XI(or)PI |http://wiki.sdn.sap.com/wiki/display/XI/HowtoSendBinaryDatatoRFCfromXI%28or%29PI]

Former Member
0 Kudos

Oh Thanks for great Contents!!!!

former_member200962
Active Contributor
0 Kudos
Are there any way to Set for Ignore this error in PI, or!!!, I have to replace it by myself

You have to either ensure that the payload coming into XI does not contain these characters

OR

You have to enclose these characters using a JAVA mapping so that the parser does not cause any invalid-error.

Regards,

Abhishek.

Former Member
0 Kudos

Hi Abhishek,

Thanks for your advice, It is same as my thought. But I really rare knowledge in Java programming... But will find the way to solve it.. Thanks again.

Terry