Putting java.String[] to IData as String List


I have a flow service that has the following input structure:

  • unformatted_email [DOCUMENT]
    • unformatted_email.sender [StringList]
    • unformatted_email.mailBoxNames [StringList]
    • unformatted_email.subject [String]
    • unformatted_email.recvDate [String]

I’m trying to call this service from a java application, and I’m bulding up its input IData like this:

        IData unformatted_email = IDataFactory.create();
        IDataCursor unformatted_email_cursor = unformatted_email.getCursor();
        String[] sender = {"\"Doe, John\" <John.Doe@t-systems.com>"};
        IDataUtil.put(unformatted_email_cursor, "sender", sender);
        String[] mailbx = {"\"Dane, John\" <John.Doe@t-systems.com>"};
        IDataUtil.put(unformatted_email_cursor, "mailBoxNames", mailbx);
        IDataUtil.put(unformatted_email_cursor, "subject", "ServiceTest");
        IDataUtil.put(unformatted_email_cursor, "recvDate", "Thu Mar 08 09:51:48 MET 2012");
        IDataCursor input_cursor = input.getCursor();
        IDataUtil.put(input_cursor, "unformatted_email", unformatted_email);

Now, one important note. Though “sender” and “mailBoxNames” are StringLists, they can only contain !!ONE!! item, or else the service will throw an error message. I know its poor but I’m unable to change the service, I only have to call it from a java application; and here comes my problem… As you can see my String only contains one single String, but when I try to call the service it throws the error:

Exception: Invalid sender. An email can contain only one "from" address.

like sender would contain more Strings. Am I passing String parameter badly? How can I pass String to StringList?

Just try passing only the email adresss John.Doe@t-systems.com to sender

I think there is some syntax error in below statement…but not sure about it…
{“"Dane, John" John.Doe@t-systems.com”};