jmckay123 Absent Member.
Absent Member.
417 views

Created email comes up as Sticky Note

I am trying to use the SOAP API to add messages to a folder (either one created by my application, or the GW client). A sample of my XML input code is below. Whatever I do, the created message shows up in the GW client as a Sticky Note, not a regular email. Am I missing some critical property? I have not added in yet message text or attachments, but I can't believe that is it. What is the secret?

<m:createItemRequest>
<item type="Mail">
<container>5CB0956C.Transend.PO.100.16E7773.1.16F.1@13</container>
<gwt:delivered>2003-02-25T23:55:16T</gwt:delivered>
<gwt:source>received</gwt:source>
<gwt:created>2003-02-25T23:55:16T</gwt:created>
<subject>Heidelberg (Coleman) Site Survey Attachment 2;Heidelberg (Coleman) Site Survery</subject>
<gwt:status>
<gwt:read>1</gwt:read>
</gwt:status>
<gwt:distribution>
<gwt:from>
<gwt:displayName>Diane Buckshnis</gwt:displayName>
<gwt:email>dianeb@transend.com</gwt:email>
</gwt:from>
<gwt:to>Gary Stringer</gwt:to>
<gwt:recipients>
<gwt:recipient>
<gwt:displayName>Gary Stringer</gwt:displayName>
<gwt:email>stringer@coastalenvironmental.com</gwt:email>
<gwt:distType>TO</gwt:distType>
</gwt:recipient>
</gwt:recipients>
</gwt:distribution>
</item>
</m:createItemRequest>
Labels (1)
0 Likes
7 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Created email comes up as Sticky Note

You need to use sendItemRequest.
createItemRequest is used for restoring an item, such as from
an archive.
You use sendItemRequest even to create posted / personal items.
createItemRequest will bypass most of the business logic.
(Such as rule processing.)
Your <source> element would be "sent", "personal" or "draft".
You would use "received" in restoring a received archived item.

I'm a little unclear on what you mean by "add messages to a folder".
Items are sent to a user. The items appear in the user's Mailbox
folder. After that they can be moved to another folder.
The sender has a sent item. The recipients (including possibly the
sender) receive a received item.

You can create posted / personal items (which don't have a recipient).
You can create them in a particular folder. If you don't specify a
folder, the item is created in the Mailbox folder. In some cases,
calendar items will be placed in the Calendar folder.

Let me know if you still have a problem or questions.

Preston


>>>


> I am trying to use the SOAP API to add messages to a folder (either one
> created by my application, or the GW client). A sample of my XML input
> code is below. Whatever I do, the created message shows up in the GW
> client as a Sticky Note, not a regular email. Am I missing some
> critical property? I have not added in yet message text or attachments,
> but I can't believe that is it. What is the secret?
>
> <m:createItemRequest>
> <item type="Mail">
> <container>5CB0956C.Transend.PO.100.16E7773.1.16F.1@13</container>
> <gwt:delivered>2003‑02‑25T23:55:16T</gwt:delivered>
> <gwt:source>received</gwt:source>
> <gwt:created>2003‑02‑25T23:55:16T</gwt:created>
> <subject>Heidelberg (Coleman) Site Survey Attachment 2;Heidelberg
> (Coleman) Site Survery</subject>
> <gwt:status>
> <gwt:read>1</gwt:read>
> </gwt:status>
> <gwt:distribution>
> <gwt:from>
> <gwt:displayName>Diane Buckshnis</gwt:displayName>
> <gwt:email>dianeb@transend.com</gwt:email>
> </gwt:from>
> <gwt:to>Gary Stringer</gwt:to>
> <gwt:recipients>
> <gwt:recipient>
> <gwt:displayName>Gary Stringer</gwt:displayName>
> <gwt:email>stringer@coastalenvironmental.com</gwt:email>
> <gwt:distType>TO</gwt:distType>
> </gwt:recipient>
> </gwt:recipients>
> </gwt:distribution>
> </item>
> </m:createItemRequest>


0 Likes
jmckay123 Absent Member.
Absent Member.

Re: Created email comes up as Sticky Note

I am not seeing any difference if I call sendItemRequest or createItemRequest. The item gets created in the folder that I specify with <container> as a sticky note. All of the properties are ignored except for the subject. The specific application I am working on is email migration. The goal is to create emails in various folders that replicate the user's source system. I don't want to send new messages. The messages that I create need to look like they were received at a date in the past, then moved to the folder in question.

Below is the full data that I am sending to the GW server. (I have tried various values for "source". The text/rtf content is shortened here for formatting). The response I get back is http 200, along with a new item id, and code of 0.

-------------------------
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.novell.com/2005/01/GroupWise/types"
xmlns:m="http://schemas.novell.com/2005/01/GroupWise/methods">
<soap:Header soap:encodingStyle="">
<session>FRS6vpYaVSseL5W5</session>
</soap:Header>
<soap:Body>
<m:sendItemRequest>
<item type="Mail">
<container>5CB0956C.Transend.PO.100.16E7773.1.16F.1@13</container>
<gwt:delivered>2003-02-25T23:55:16T</gwt:delivered>
<gwt:source>draft</gwt:source>
<gwt:created>2003-02-25T23:55:16T</gwt:created>
<subject>Heidelberg (Coleman) Site Survey Attachment 2;Heidelberg (Coleman) Site Survery</subject>
<gwt:status>
<gwt:read>1</gwt:read>
</gwt:status>
<gwt:distribution>
<gwt:from>
<gwt:displayName>Diane Buckshnis</gwt:displayName>
<gwt:email>dianeb@transend.com</gwt:email>
</gwt:from>
<gwt:to>Gary Stringer</gwt:to>
<gwt:recipients>
<gwt:recipient>
<gwt:displayName>Gary Stringer</gwt:displayName>
<gwt:email>stringer@coastalenvironmental.com</gwt:email>
<gwt:distType>TO</gwt:distType>
</gwt:recipient>
</gwt:recipients>
</gwt:distribution>
<gwt:message>
<gwt:part contentType="text/rtf" length="220">
ICAgICAgDQogDQogSGVpZGVsYmVyZyAoQ29sZW1hbikgU2l0ZSBTdXJ2ZXkgQXR0YWNobWVudCAyO0hlaWRlbGJlcmcgKENvbGVtYW4p...==
</gwt:part>
</gwt:message>
<gwt:viewName dt="NgwFieldArray" xs="GWMessaging">
Mail
</gwt:viewName>
</item>
</m:sendItemRequest>
</soap:Body>
</soap:Envelope>
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Created email comes up as Sticky Note

If you are just sticking the messages in, you would use
createItemRequest.
I noticed that you have a mismatch of namespace prefixes.
You define "t:" and "m:", but you use "gwt:" and "gwm:".
It sounds like the elements that are being recognized
(item, container and subject) are because they don't have
a prefix specified.
Fix up your prefixes and try again.
(It would be better to specify the correct prefix than
to not use a prefix (unless you are using the correct
default namespace).)

Preston


>>>


> I am not seeing any difference if I call sendItemRequest or
> createItemRequest. The item gets created in the folder that I specify
> with <container> as a sticky note. All of the properties are ignored
> except for the subject. The specific application I am working on is
> email migration. The goal is to create emails in various folders that
> replicate the user's source system. I don't want to send new messages.
> The messages that I create need to look like they were received at a
> date in the past, then moved to the folder in question.
>
> Below is the full data that I am sending to the GW server. (I have
> tried various values for "source". The text/rtf content is shortened
> here for formatting). The response I get back is http 200, along with a
> new item id, and code of 0.
>
>

‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
> <?xml version="1.0" encoding="utf‑8"?>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:t="http://schemas.novell.com/2005/01/GroupWise/types"
> xmlns:m="http://schemas.novell.com/2005/01/GroupWise/methods">
> <soap:Header soap:encodingStyle="">
> <session>FRS6vpYaVSseL5W5</session>
> </soap:Header>
> <soap:Body>
> <m:sendItemRequest>
> <item type="Mail">
> <container>5CB0956C.Transend.PO.100.16E7773.1.16F.1@13</container>
> <gwt:delivered>2003‑02‑25T23:55:16T</gwt:delivered>
> <gwt:source>draft</gwt:source>
> <gwt:created>2003‑02‑25T23:55:16T</gwt:created>
> <subject>Heidelberg (Coleman) Site Survey Attachment 2;Heidelberg
> (Coleman) Site Survery</subject>
> <gwt:status>
> <gwt:read>1</gwt:read>
> </gwt:status>
> <gwt:distribution>
> <gwt:from>
> <gwt:displayName>Diane Buckshnis</gwt:displayName>
> <gwt:email>dianeb@transend.com</gwt:email>
> </gwt:from>
> <gwt:to>Gary Stringer</gwt:to>
> <gwt:recipients>
> <gwt:recipient>
> <gwt:displayName>Gary Stringer</gwt:displayName>
> <gwt:email>stringer@coastalenvironmental.com</gwt:email>
> <gwt:distType>TO</gwt:distType>
> </gwt:recipient>
> </gwt:recipients>
> </gwt:distribution>
> <gwt:message>
> <gwt:part contentType="text/rtf" length="220">
> ICAgICAgDQogDQogSGVpZGVsYmVyZyAoQ29sZW1hbikgU2l0ZSBTdXJ2ZXkgQXR0YWNobWVu
> dCAyO0hlaWRlbGJlcmcgKENvbGVtYW4p...==
> </gwt:part>
> </gwt:message>
> <gwt:viewName dt="NgwFieldArray" xs="GWMessaging">
> Mail
> </gwt:viewName>
> </item>
> </m:sendItemRequest>
> </soap:Body>
> </soap:Envelope>


0 Likes
jmckay123 Absent Member.
Absent Member.

Re: Created email comes up as Sticky Note

Thanks, I should have seen that. I've got a mail entry being created now. I need to double check that I can set all the properties I need, but I should be close.

If I could hit you up with one more question, I need to figure out how to add attachments. Based on what I see exported by the API, I presume I need something like below.
My question is, how do I create the item that is referenced in the id property? Another createItemRequest? What container would I specify? And how do I specify the bytes that
go into the file?

-------------------------
<gwt:attachment>
<gwt:id>
5CA73E72.Transend.PO.200.200007B.1.45C.1@45:5CA73E73.Transend.PO.100.16E7773.1.115.1@1:7.Transend.PO.100.0.1.0.1@16
</gwt:id>
<gwt:name>
TEXT.htm
</gwt:name>
<gwt:charset>
UTF-8
</gwt:charset>
<gwt:contentType>
TEXT/HTML
</gwt:contentType>
<gwt:size>
511
</gwt:size>
<gwt:date>
2019-04-05T11:39:30Z
</gwt:date>
<gwt:hidden>
1
</gwt:hidden>
</gwt:attachment>
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Created email comes up as Sticky Note

You have to put in the data.
The data is base64 encoded.
Depending on what SOAP package you use, the code might
do the conversion to base64.
Here is an example from Java:

private void testSendAttachment()
{
AttachmentInfo attach = new AttachmentInfo();
AttachmentItemInfo info = new AttachmentItemInfo();
byte[] b;
Distribution dist = new Distribution();
File file;
FileInputStream is = null;
From from = new From();
Mail mail = new Mail();
MessageBody mb = new MessageBody();
MessagePart mp = new MessagePart();
Recipient recip = new Recipient();
RecipientList list = new RecipientList();
SendItemRequest request = new SendItemRequest();

file = new File("c:\\test\\demo.pdf");
try
{
is = new FileInputStream(file);
ByteArrayOutputStream os = new ByteArrayOutputStream();
int len = 16384;
b = new byte[16384];
while (len == 16384)
{
len = is.read(b, 0, 16384);
if (0 == len)
{
break;
}
os.write(b, 0, len);
}
is.close();
info.setData(os.toByteArray());
info.setSize((long) ((((os.size() + 1) * 4) + 2) / 3));

info.setName("\\demo:demo.pdf");
info.setContentType("application/pdf");
}
catch (java.io.IOException e)
{
e.printStackTrace();
}
attach.getAttachment().add(info);
mail.setAttachments(attach);

b = "demo\n".getBytes();
mp.setValue(b);
mb.getPart().add(mp);
mail.setMessage(mb);
from.setDisplayName("Preston Stephenson");
from.setEmail("preston.stephenson@prestons.provo.novell.com");
dist.setFrom(from);
recip.setDisplayName("Preston Stephenson");
recip.setEmail("pstephenson@prestons.provo.novell.com");
list.getRecipient().add(recip);
dist.setRecipients(list);
mail.setDistribution(dist);
mail.setSubject("demo");

request.setItem(mail);
port.sendItemRequest(request);
}

It is also possible to stream the data into an attachment
using HTTP PUT. The performance is a lot better, but there
are some restrictions.

Preston

>>>


> Thanks, I should have seen that. I've got a mail entry being created
> now. I need to double check that I can set all the properties I need,
> but I should be close.
>
> If I could hit you up with one more question, I need to figure out how
> to add attachments. Based on what I see exported by the API, I presume
> I need something like below.
> My question is, how do I create the item that is referenced in the id
> property? Another createItemRequest? What container would I specify?
> And how do I specify the bytes that
> go into the file?
>
>

‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
> <gwt:attachment>
> <gwt:id>
> 5CA73E72.Transend.PO.200.200007B.1.45C.1@45:5CA73E73.Transend.PO.100.16E
> 7773.1.115.1@1:7.Transend.PO.100.0.1.0.1@16
> </gwt:id>
> <gwt:name>
> TEXT.htm
> </gwt:name>
> <gwt:charset>
> UTF‑8
> </gwt:charset>
> <gwt:contentType>
> TEXT/HTML
> </gwt:contentType>
> <gwt:size>
> 511
> </gwt:size>
> <gwt:date>
> 2019‑04‑05T11:39:30Z
> </gwt:date>
> <gwt:hidden>
> 1
> </gwt:hidden>
> </gwt:attachment>

0 Likes
jmckay123 Absent Member.
Absent Member.

Re: Created email comes up as Sticky Note

I am not using a SOAP package, just building the raw xml data and doing a http PUT to the GW server. So the Java example doesn't do me
much good. I have no problem creating base64 data, I'm just not sure where it would go. Could I do something like below, where I would
add the data inside the <attachment> tag?

<part contentType="application/octet-stream" length="220">
ICAgICAgDQogDQogSGVpZGVsYmVyZyAoQ29sZW1hbikgU2...
</part>
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Created email comes up as Sticky Note

Here is the soap trace (with most of the data removed) of the previous code
example:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope
xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header>
<session
xmlns="http://schemas.novell.com/2005/01/GroupWise/types">nyZInUzcoLv5JUWa</
session>
</S:Header>
<S:Body>
<ns2:sendItemRequest
xmlns="http://schemas.novell.com/2005/01/GroupWise/types"
xmlns:ns2="http://schemas.novell.com/2005/01/GroupWise/methods"
xmlns:ns3="http://schemas.novell.com/2005/01/GroupWise/events">
<ns2:item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="Mail">
<subject>demo</subject>
<distribution>
<from>
<displayName>Preston Stephenson</displayName>
<email>preston.stephenson@prestons.provo.novell.com</email>
</from>
<recipients>
<recipient>
<displayName>Preston Stephenson</displayName>
<email>pstephenson@prestons.provo.novell.com</email>
</recipient>
</recipients>
</distribution>
<message>
<part>ZGVtbwo=</part>
</message>
<attachments>
<attachment>
<name>\demo:demo.pdf</name>
<contentType>application/pdf</contentType>
<size>108055</size>
<data>JVBERi0xLjUNC .... IolJUVPRg==</data>
</attachment>
</attachments>
</ns2:item>
</ns2:sendItemRequest>
</S:Body>
</S:Envelope>

Let me know if you need more information.
Preston

>>>


> I am not using a SOAP package, just building the raw xml data and doing
> a http PUT to the GW server. So the Java example doesn't do me
> much good. I have no problem creating base64 data, I'm just not sure
> where it would go. Could I do something like below, where I would
> add the data inside the <attachment> tag?
>
> <part contentType="application/octet‑stream" length="220">
> ICAgICAgDQogDQogSGVpZGVsYmVyZyAoQ29sZW1hbikgU2...
> </part>

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.