[S22.Imap] GetMessage and GetMessages

[S22.Imap] GetMessage and GetMessages

  
Forge Component
(0)
Published on 14 Apr by Pedro Freire
0 votes
Published on 14 Apr by Pedro Freire

Hi Pedro,


After retrieving the UID's from the Search method / action, when I call the GetMessage (with a single UID), OR the GetMessages with all the list of UID's from Search, I get this 2 errors below repectively:


GetMessage:

"S22_Imap GetMessage action: Object reference not set to an instance of an object."


GetMessages;

"S22_Imap GetMessages action: Specified cast is not valid."


NOTE: Search returns a 

UID Record List


And GetMessages accepts as input also a

UID Record List


So, why the error about cast?


I'm I missing something here?

Cheers

You've stumbled onto an IMAP extension bug! :-)

Someone else has already reported this, and I created a new version for you guys to help me debug this, as I haven't had the time to create a sample application to test all these.

Could you please download the latest version from the Forge? You need to go to the Version tab, as the latest is not marked as the "latest stable". The latest version includes debugging code that will help me pinpoint where that issue comes from.

After installing the latest version, please come back here and let me know what is the error message you get. Also, look at the General log in Service Center, and let me know what are the IMAP extension messages that are there.

Thanks in advance!

Hi Pedro,

I allready had installed the 0.6.2 Version (with the audit).

Logs below.

Best regards



Extension LOG:

Module:Extension metho
Message:S22_Imap GetMessages action: Specified cast is not valid.
Environment InformationeSpaceVer: 9 (Id=1361, PubId=1355, CompiledWith=10.0.702.0)
RequestUrl: https://env2.outsystemscloud.com/IR_EmailModule/Mailbox_List.aspx (Method: POST)
AppDomain: /LM/W3SVC/49/ROOT/IR_EmailModule-1242-131679382908917845
FilePath: C:\OutSystems\Sandboxes\YVWRHP046\Platform Server\running\IR_EmailModule\Mailbox_List.aspx
ClientIp: 83.240.215.118
Locale: en-US
DateFormat: yyyy-MM-dd
PID: 10228 ('w3wp', Started='1/17/2018 3:12:03 AM', Priv=820Mb, Virt=18787Mb)
TID: 77
Thread Name:
.NET: 4.0.30319.42000
Stack:S22_Imap GetMessages action: Specified cast is not valid.
   at OutSystems.NssS22_Imap.CssS22_Imap.MssGetMessages(RLUIDRecordList ssUIDs, Boolean ssSeen, String ssMailbox, RLMailMessageRecordList& ssMailMessages)
   at ssIR_EmailModule.RssExtensionS22_Imap.MssGetMessages(HeContext heContext, RecordList inParamUIDs, Boolean inParamSeen, String inParamMailbox, RecordList& outParamMailMessages)



ERROR LOG:


S22_Imap GetMessages action: Specified cast is not valid.
Environment InformationeSpaceVer: 9 (Id=1361, PubId=1355, CompiledWith=10.0.702.0)
RequestUrl: https://env2.outsystemscloud.com/IR_EmailModule/Mailbox_List.aspx (Method: POST)
AppDomain: /LM/W3SVC/49/ROOT/IR_EmailModule-1242-131679382908917845
FilePath: C:\OutSystems\Sandboxes\YVWRHP046\Platform Server\running\IR_EmailModule\Mailbox_List.aspx
ClientIp: 83.240.215.118
Locale: en-US
DateFormat: yyyy-MM-dd
PID: 10228 ('w3wp', Started='1/17/2018 3:12:03 AM', Priv=821Mb, Virt=18787Mb)
TID: 77
Thread Name:
.NET: 4.0.30319.42000
Stack:S22_Imap GetMessages action: Specified cast is not valid.
   at ssIR_EmailModule.RssExtensionS22_Imap.MssGetMessages(HeContext heContext, RecordList inParamUIDs, Boolean inParamSeen, String inParamMailbox, RecordList& outParamMailMessages)
   at ssIR_EmailModule.Actions.ActionDebuggerStarted(HeContext heContext, String inParamHostname, Int32 inParamPort, Boolean inParamUseSSL, String inParamUsername, String inParamPassword, String inParamMethod, String inParamCriteria, RLMailMessageLongIntegerRecordList& outParamMailMessages)
   at ssIR_EmailModule.Actions.ActionGetAccountMails_IMAP(HeContext heContext, RCEM_Email_AccountRecord inParamMailAccount)



GENERAL LOG:

Dont see nothing there related to this.

I don't have this code on my professional PC. I'll take a look later today. Thanks!

OK, appreciated.

Hello Gonçalo,

Unfortunately your error reports don't help me pinpoint where is the bug in my C# code. I was hoping that there would be additional logs in the General Log to help me, but I must have used some deprecated function, or you have "Activity Logging" option unchecked in the extension module's properties' "Operation" tab (in Service Center).

So... I am building a small email client demo app that will list and open messages. This will take a bit longer. Please bear with me, or, if you have the time, you're welcome to look into my C# code itself. Just le me know if you find anything!


Hello Gonçalo,

I have hopefully squashed all the bugs. Please download the latest stable version of the extension and try again. Please let me know how it goes for you! :-)

Thank you in advance!

Hi Pedro. Thanks for your time.

Just to be sure, I deleted the last version from Service Center, and installed the last one (0.6.3).


After referencing the methods on the espace, and publishing, I did some new tests, but still getting the 2 errors below:


GetMessage 

"S22_Imap GetMessage action: Object reference not set to an instance of an object."


GetMessages
"S22_Imap GetMessages action: Specified cast is not valid."


Question:

On your success tests, do you call directly the GetMessage/s after the Search? Or some king of ToObject() convertion is needed first over the Search output?

(It shouldn't be necessary, since the output of Serch (UID's list) is of the same type of GetMessages input.


cheers


Hello Gonçalo

That's strange... After Search I directly call GetMessagesPartial (to get all message headers for a listing). You shouldn't need to convert any data types in OutSystems, what you see is a C# error internal to the extension.

Truth be said, I have not tested GetMessages itself.

Let me do two things: first I'll publish my demo client in the Forge, and then I'll try and see if there is anything obviously wrong in GetMessages.

Hi Pedro.


This is very strange, because I tested now the GetMessagesPartial and get the error:

"S22_Imap GetMessagesPartial action: Object reference not set to an instance of an object."

I'm using platform 10.


Well, I guess I will wait for your demo to test in this environment, and see the results.

Thank you 


Hello Gonçalo,

Please take a look at my demo app here:

https://www.outsystems.com/forge/component/3585/s22-imap-client/

Let me know how it works for you.

Hi Pedro.

I just tested your demo app. It looks nice.

Method GetMessagesPartial is working fine.


But the GetMessage and GetMessages are throwing the same error I mensioned before:

"S22_Imap GetMessage action: Object reference not set to an instance of an object."

I'm testing with a Outlook IMAP account and a gmail IMAP account. Same error for both.


regards

Gonçalo Barata

You are correct Gonçalo.

I didn't see that bug because my test messages did not have alternate views/attachments. Please download the latest version of S22.Imap and try again.

Let me know if everything is finally fixed!

Hi Pedro.

Sorry about the delay, but I was on Vacations.


It seems everything is working just fine now.


Thanks once again for your time and commitment.


best regards

Great to hear that!

Cheers!