新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - Web开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 软件开发 > JAVA > 正文:Web Services的测试模型与代码摘录

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

新客网 XKER.COM 2008-04-11 来源:新客网整理转载 收藏本文

 测试模式

  对于一个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;

                 }

收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
阅读排行
随机推荐
实用信息推荐