CTOCIO IT专家网

天极传媒 比特网 | 天极网 | IT专家网 | IT商网 | 52PK游戏网 | 手机天极 | IT分众 |
IT专家网搜索

您现在的位置: IT专家网 > Web服务子站

Web Services的测试模型与代码摘录

作者: 佚名,  出处:中国IT实验室, 责任编辑: 包春林, 
2008-04-10 04:00
  测试Web Services的有效性、性能、可伸缩性、可靠性以及安全性时所面临的主要挑战是 Web Services的分布性。

  测试模式

  对于一个WLS客户和.NET Web Services:

  ·用Microsoft Visual Studio在目录/InetPub/wwwroot/DotNetServices/下创建一个.NET Web Services。

  ·在WLS端,在为DotNetService 提供了WSDL URL后,用WebLlogic clientgen ant task生成一个clientjar。

  ·从testclient,对JAVA Stub进行一次调用。

    WebLogic Server

    .NET Server

    .NET Web Service

    WLS Client

          

// STOCK TRADE WEB SERVICE

           // The Stock Trade web service executes a trade and returns result.

            [WebMethod]

            public bool execute(string action, string symbol, int quantity)

            {

            if(action == null) {

              Console.WriteLine("action null");

         return false;

         }

    if(symbol == null) {

            Console.WriteLine("symbol null");

           return false;

         }

      if(action.Equals("BUY"))

             Console.WriteLine("BUYING quantity: "+ quantity + " of symbol:" + symbol);

     else if(action.Equals("SELL"))

     Console.WriteLine("SELLING quantity: "+ quantity + " of symbol:" + symbol);

              else {

     Console.WriteLine("INVALID action: "+ action);

     return false;

         }

              return true;

                 }

共5页。 9 1 2 3 4 5 :

网友评论

笔名 
请您注意:遵守国家有关法律、法规,尊重网上道德,承担一切因您的行为而直接或间接引起的法律责任。    IT专家网友拥有管理笔名和留言的一切权利。
  • 周排行榜
  • 月排行榜

邮件订阅

       
天极服务 | 关于我们 | 网站律师 | 加入我们 | 联系我们 | 广告业务 | 友情链接 | 我要挑错
All Rights Reserved, Copyright 2004-2008, Ctocio.com.cn
渝ICP证B2-20030003号 如有意见请与我们联系 powered by 天极内容管理平台CMS4i