Hello Experts,
I have come across a weird issue in my oscript code. I have a code which uses Java object to call a instance method which in turn supposed to call a exchange EWS api function to send calendar invite.
Problem is as soon as it come across ExchangeService object it throws an error “could not invoke the method”. My java code runs fine in eclipse and as an runnable jar as well.
Below is the code snippet.
public boolean execute()
{
System.out.println("inside execute");
ExchangeService exservice = new ExchangeService();
ExchangeCredentials credentials = new WebCredentials("user@company.com", "Password");
exservice.setCredentials(credentials);
try {
exservice.setUrl(new URI("https://outlook.office365.com/EWS/Exchange.asmx"));
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return true;
}
// Oscript Code
JavaObject JO = JavaObject.New( "com.opentext.mail.SendMailAPI", {} )
Dynamic check1 = JO.InvokeMethod("execute",{})
I get a echo of "inside execute" when call goes inside execute method but afterwards it throws an error
CS Environment: 16.2.4
JRE: 1.8
Please let me know if anyone has come across same kind of issue.
Thanks and Regards,
Utsav