0
public void updateSignature(ExchangeService exchange, String signature) {
try {
FolderId f = new FolderId(WellKnownFolderName.Root);
UserConfiguration user = UserConfiguration.bind(exchange,
"OWA.UserOptions", f, UserConfigurationProperties.All);
if (user.getDictionary().containsKey("signaturetext"))
user.getDictionary().setElements("signaturetext", signature);
else
user.getDictionary().addElement("signaturetext", signature);
user.update();
} catch (Exception e) {
e.printStackTrace();
}
}
我得到user.update()的空指針異常;我可以在設置新的設置之前在控制檯中打印舊的簽名,也可以在字典中設置新的簽名。但是,我無法永久更新這些更改。在此先感謝 。EWS簽名更新錯誤