2008-01-14
easylink webservice(FaxService) test
mstsc.exe
java 代码
- package com.easylink.services.sample;
- import java.io.File;
- import testpackage.SendFaxResponse;
- import com.easylink.services.ELSException;
- import com.easylink.services.ELSFaxManager_test;
- /**
- * SendFax - Send a fax to the specified destination fax
- * @author zhu jiyun
- * @version 1.0
- */
- public class SendFax_test {
- public static void main(String[] args) throws Exception {
- try {
- /**
- * the required variable with '*';
- */
- /**
- * Host*
- * Secured production fax endpoint:faxadmin.easylink.com
- */
- String host = "webservicetest.easylink.com"; //Test system secured fax endpoint
- /**
- * port*
- * The port of the destination service. ie 443 unless using a proxy
- */
- String port = "443";
- /**
- * email*
- * The email address of the registered account
- */
- String emailAddress = "tenn911@163.com";
- /**
- * password*
- * Password for the registered account
- */
- String password = "password";
- /**
- * destination*
- * Destination fax number
- */
- String destination = "8641139778161";
- //trustStorePath*
- String trustStorePath = "c:\\testEasyLink\\easysendfax.keystore";
- // AcctCode
- String accountCode = "";
- // UserCode
- String userCode = "";
- // TSI - Fax Machine Identification String
- String TSI = "";
- // alternateDeliveryNotice - Delivery Notification EMAIL
- String alternateDeliveryNotice = "";
- String deliveryNoticeType = "ALL";
- String faxResolution = "Normal";
- // to - Value for the TO field
- String to = "";
- String from = emailAddress;
- //Setup the attachments*
- String filePath = "c:\\testEasyLink\\testEasyLink.txt";
- File[] attachments = getAttachments(filePath);
- ELSFaxManager_test efm = new ELSFaxManager_test();
- efm.setHost(host);
- efm.setPort(Integer.parseInt(port));
- efm.setEmailAddress(emailAddress);
- efm.setPassword(password);
- // Run in secured mode
- efm.setSecured(true);
- efm.setTrustStoreName(trustStorePath);
- SendFaxResponse rs = efm.sendFax(destination,
- accountCode,
- userCode,
- TSI,
- alternateDeliveryNotice,
- deliveryNoticeType,
- faxResolution,
- to,
- from,
- attachments);
- System.out.println("Transaction Id : " + rs.getTransactionId());
- } catch (ELSException e) {
- System.out.println("Exception message "+e.getMessage());
- e.printStackTrace();
- }
- }
- private static File[] getAttachments(String filePath) {
- String[] filePaths = filePath.split(";");
- File[] files = new File[filePaths.length];
- int cntr=0;
- for(int i=0;i
- String fPath = filePaths[i];
- files[cntr++] = new File(fPath);
- }
- return files;
- }
- }
发表评论
- 浏览: 63527 次
- 性别:

- 来自: Da Lian

- 详细资料
搜索本博客
最新评论
-
Oracle的rownum原理和使用
照这么看来,rownum 就是一个游标,而且只能前进,不能后退的游标啦```~~ ...
-- by lovinchan -
游戏,平时彻底地放弃
深有同感 ,一起勉励自己吧
-- by hyj1254 -
避免在Java中使用Checked ...
的确是这样,在某些情况下,我的确觉得checked Exception用起来很麻 ...
-- by ivonxiao -
Documentum notes accumul ...
最近也在搞Documentum,觉得这个内容管理器的功能确实比较强大,但是界面也 ...
-- by woshifeng9th -
Oracle的rownum原理和使用
order by name 如果name是pk或有index ,查询出来的row ...
-- by seasar






评论排行榜