Thanks a lot CRANGV. Yes, this part works fine.
Another question, In the Gateway side, the BADI /IWPGW/IF_TGW_USER_DETAIL~GET_USER_PICTURE_STREAM has been called only once. Inside it_key_tab, there is only 1 line with WF-BATCH as user name . I think we should apply OSS note 2108489 - Replacing WF-BATCH as work item initiator with user?
I will try and let you know.
Thanks again.