用 Apache Geronimo 和 Axis2 实现在线银行,第 2 部分: 服务:填充内容(下)
2010-03-19 00:00:00 来源:WEB开发网创建结构
为使您能向 Axis2 Web 服务传递一些内容,并在一些日志中显示某些有用的内容,我们将定义部分由 WSDL2Java 工具创建的 Java 数据结构。按 清单 30 进行定义。
清单 30. 创建并初始化测试数据结构
...
stub = new OnlineBankingPortTypeStub(null,
"http://localhost:8080/axis2/services/OnlineBankingService");
// Initializing Calendar (xsd:date) Objects
GregorianCalendar date1 =
Util.convertStringDate("02012006");
GregorianCalendar date2 = (GregorianCalendar)date1.clone();
date2.set(Calendar.DATE, 28);
GregorianCalendar date = (GregorianCalendar)date1.clone();
// Initializing a Payee (xsd1:Payee) Object
Payee payee = Payee.Factory.newInstance();
payee.setName("bankIBM2");
payee.setAddress1("1 IBM way");
payee.setCity("Houston");
payee.setState("TX");
payee.setZip("32345");
payee.setPhoneAreaCode(555);
payee.setPhonePrefix(555);
payee.setPhoneSuffix(5555);
payee.setAccountToPay("1234567890123456");
payee.setNameOnBill("John Doe");
payee.setAlias("My IBM Credit Card22");
// Initializing another Payee (xsd1:Payee) Object
Payee payee2 = Payee.Factory.newInstance();
payee2.setName("bankIBM2");
payee2.setAddress1("1 IBM way");
payee2.setCity("LA");
payee2.setState("CA");
payee2.setZip("32345");
payee2.setPhoneAreaCode(555);
payee2.setPhonePrefix(555);
payee2.setPhoneSuffix(5555);
payee2.setAccountToPay("6564654");
payee2.setNameOnBill("John Doe");
payee2.setAlias("My IBM Credit Card22");
// Initializing a BillPayment (xsd1:BillPayment) Object
BillPayment payment = BillPayment.Factory.newInstance();
payment.setPayeeName("bankIBM2");
payment.setAccount(1);
payment.setAmount((float)101);
payment.setDate(date);
payment.setNotes("Recurring");
payment.setRecurring(true);
// Initializing a RecurringBillPayment
// (xsd1:RecurringBillPayment) Object
RecurringBillPayment rec = payment.addNewRecurringData();
rec.setFinalPayment((float)43.40);
rec.setFrequency("monthly");
rec.setTotalNumberOfPayments(60);
rec.setRecurringType("Fixed");
// Initializing another BillPayment (xsd1:BillPayment) Object
BillPayment payment2 = BillPayment.Factory.newInstance();
payment2.setPayeeName("bankIBM2");
payment2.setAccount(1);
payment2.setAmount((float)101);
payment2.setDate(date);
payment2.setNotes("Not recurring");
payment2.setRecurring(false);
// Initializing a LoanApplication (xsd1:LoanApplication) object
LoanApplication loanApp =
LoanApplication.Factory.newInstance();
loanApp.setLoanType("Auto loan");
loanApp.setAmount((float)20000);
loanApp.setTermMonths(60);
loanApp.setJoint(true);
loanApp.setPercentFinanced(90);
...
- ››apache设置域名绑定 以及绑定不起作用的排查
- ››apache rewrite将指定URL转向指定的几个服务器
- ››apache配置文件httpd.comf部分参数说明
- ››Apache+Mysql+PHP+phpMyAdmin+Mac OS X 10.7 Lion...
- ››apache+tomcat负载均衡_项目实例
- ››apache mysql php 源码编译使用
- ››Apache添加mod_aspdotnet.so支持ASP.NET配置指南
- ››Apache中改变php.ini的路径
- ››Apache2.2与Tomcat6整合及虚拟主机配置
- ››Apache+php+mysql在windows下的安装与配置图解
- ››Apache+Subversion完美结合,CentOS下实现版本控制...
- ››Apache HTTPServer2.2.16 发布
更多精彩
赞助商链接