on 10-18-2007 1:11 PM
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
Is the attachment name in UTF-8? If not, use a Java routine to convert the name to UTF-8.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.