十一 07

[codes=java]
package Example6;
/**  
* @author Jock  
*  
*/  
public final class TestClient {  
 
 /**  
  * @param args  
  */  
 public static void main(String[] args) {  
   //获得一个locator对象  
   WidgetPriceServiceLocator locator = new WidgetPriceServiceLocator();  
   locator.setMaintainSession(true);  
   try{  
     WidgetPrice s = locator.getWidgetPrice();  
     s.setWidgetPrice(“1″,”10.67″);
     s.setWidgetPrice(“2″,”12.45″);
     s.setWidgetPrice(“3″,”11.37″);
     s.setWidgetPrice(“4″,”13.29″);
     System.out.println(s.getWidgetPrice(“4″));  
     System.out.println(s.getWidgetPrice(“3″));  
     System.out.println(s.getWidgetPrice(“2″));  
     System.out.println(s.getWidgetPrice(“1″));  
   }catch(Exception e){  
     e.printStackTrace();  
   }  
 
 }  
 
}
[/codes]

执行java Example6.TestClient

输出:
13.29
11.37
12.45
10.67


Tags:

作者:Jock

One Response to “WidgetPrice客户端测试”

  1. wenqiyu Says:

    我顶

Leave a Reply

You must be logged in to post a comment.

Switch to our mobile site