WEB开发网
开发学院软件开发Java 用 Apache Geronimo 和 Axis2 实现在线银行,第 2... 阅读

用 Apache Geronimo 和 Axis2 实现在线银行,第 2 部分: 服务:填充内容(下)

 2010-03-19 00:00:00 来源:WEB开发网   
核心提示: 创建结构为使您能向 Axis2 Web 服务传递一些内容,并在一些日志中显示某些有用的内容,用 Apache Geronimo 和 Axis2 实现在线银行,第 2 部分: 服务:填充内容(下)(9),我们将定义部分由 WSDL2Java 工具创建的 Java 数据结构,按 清单 30 进行定义

创建结构

为使您能向 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); 
... 

上一页  4 5 6 7 8 9 10  下一页

Tags:Apache Geronimo Axis

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接