cancel
Showing results for 
Search instead for 
Did you mean: 

SOAPFault from Integration Server because of attachment name

Former Member
0 Kudos

Hello everyone,

I'm currently building the attachment function into our adapter for IBM Lotus Notes and SAP XI.

In the Sender part, the adapter must add the attachment from Lotus Notes to the XI Message as a payload.

The following source code show how to do this:

*******************************************************************************

/Create a payload from a XI Message/

Payload attachment = xiMessage.createPayLoad();

/Set the attachment name with the file name of the Notes attachment/

/I have problem with this method/

attachment.setName(notesAttachment.getFileName());

/Set the content (byte array) of the attachment/

attachment.setContent(notesAttachment.getBytesContents());

********************************************************************************

This works well unless no special file name like ("Ättachment") is entered in the method Payload.setName().

Errors will be shown in the Audit Log:

1. SOAPFault received from Integration Server. ErrorCode/Category: XIProtocol/SAP_CODEPAGE_CONVERSION_ERROR; Params: ; AdditionalText: ; ApplicationFaultMessage: ; ErrorStack: Error when converting the code page for character set UTF-8 (code page 4110): Cannot convert character sets for one or more characters.

2. Transmitting the message to endpoint http://kit-was:8000/sap/xi/engine?type=entry using connection AFW failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Received HTTP response code 500 : Error during creation of multipart mime object.

and in the Logviewer:

1. enrichMessageData(): Error during retrieving the end-to-end-monitoring information

Thrown:com.sap.aii.rwb.endtoendmonitoring.util.Sxmb_Get_Pmi_Info_Fault_Exception: at sun.reflect.GeneratedConstructorAccessor553.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274)

But in the "Message content --> SOAP Document", the attachment name can be showed correctly:

- <sap:Payload xlink:type="simple" xlink:href="cid:payload-b98435927cb011dcbb950013d47ba0c5@sap.com">

<sap:Name>Ättachment</sap:Name>

<sap:Description>üüüäää</sap:Description>

<sap:Type>ApplicationAttachment</sap:Type>

</sap:Payload>

I've no idea, what should I do. Apparently I did every correctly, but why SAP Integration Server didn't work?

The ABAP stack of the XI server should also support Unicode. Our XI server is 04 SP 19.

Please give me some help.

with regards

Xiang

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

Is the attachment name in UTF-8? If not, use a Java routine to convert the name to UTF-8.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

thanks for your reply.

The problem is that String is unicode in Java. The method from SAP is

void setName(java.lang.String name) .

In Java it is only necessary to define charset when create a string based on a bytes array.

String(byte[] bytes, String charsetName)

Constructs a new String by decoding the specified array of bytes using the specified charset.

I got the file name from Lotus Notes as a String and just gave it to the SAP method. Then the Integration Server gave an error message about the name.

Regards

Xiang

stefan_grube
Active Contributor
0 Kudos

So transfer the file name to byte array and then transfer back to string and here you apply the charset.

Regards

Stefan

Answers (0)