Docstoc

Developing and validating XML Web services within distributed

Document Sample
Developing and validating XML Web services within distributed Powered By Docstoc
					             INFORMATION SYSTEMS APLICATIONS AND TECHNOLOGY
                                ISAT 2003

                                            Key words – XML Web Services, SOAP, WSDL, UDDI, .NET and J2EE




Jozef Goetz*, You Feng*



            DEVELOPING AND VALIDATING XML WEB SERVICES
         WITHIN DISTRIBUTED AND HETEROGENEOUS ENVIRONMENT



      XML Web Service is a Web software component accessed through SOAP, described within WSDL files and
      registered in UDDI. Web Service is loosely coupled and remarkably interoperable. We developed XML Web
      Services on two dominant software platforms: Microsoft .NET and SUN J2EE. We also developed an E-
      commerce Website in order to invoke those Web Services as a client application. Therefore, the whole
      distributed and heterogeneous system represents the key advantage of Web Services, which is independent of
      programming language, platform and device. We compare the performance and as well the coding size of the
      above mentioned Web Services platforms. The performance comparison is of a particular interest to the user and
      comparison of the coding size is of interest to the developer.



1.   INTRODUCTION

1.1. XML WEB SERVICES OVERVIEW

      The XML (Extensible Markup Language) Web Service platform is a set of standards
for building interoperable distributed applications. There are four family technologies about
XML Web services: XML, SOAP (Simple Object Access Protocol), WSDL (Web Services
Description Language) and UDDI (Universal Description, Discovery and Integration). [11]
      Web Services have been extensively promoted as the new frontier of application
servers[10]. The Microsoft .NET Framework is a platform for building, deploying, and
running Web Services and applications. It provides a highly productive, standards-based,
multi-language environment for integrating existing investments with XML Web Services,
the next-generation applications.
      Meantime, one of the main components of the J2EE (Java 2 Enterprise Edition)
platform is Java API for XML-based Remote Procedure Call (JAX-RPC), which provides
the core API for developing and deploying Web Services. JAX-RPC is about web services

_________________
* Department of Computer Science, California State University, Fullerton; 800 N. State College Blvd., California
92834, USA
     interoperability across heterogeneous platforms and languages. This makes JAX-RPC
a key technology for Web Services based integration.




                    Fig. 1. An interoperable mechanism needed between .NET and Java

1.2. PROBLEM STATEMENT

      Traditionally, distributed application logic is called for component-object technology
such as the Microsoft Distributed Component Object Model (DCOM), the Object
Management Group's Common Object Request Broker Architecture (CORBA), or Sun's
Remote Method Invocation (RMI). Though these component-based technologies work very
well in an intranet environment, attempting to use them over the Internet presents
interoperable problems. [1]
      Browser-based Web applications are loosely coupled and remarkably interoperable.
Since Web services adapt the traditional Web programming model and rely on industry
standards, including HTTP (HyperText Transfer Protocol), XML, SOAP and WSDL, to
expose application functionality, they are independent of programming language and
platform. [1] Therefore, the mechanism we chose is XML Web Services over HTTP.
      First-Video Subsystem (FVS), developed in Microsoft .NET, is an online store that
performs typical E-commerce site for a virtual video company. When the customer places
an order through FVS, an Inventory-Checking Web Service (ICWS) is invoked, which
verifies the quantities in stock of his/her items. When he/she places an order through FVS,
an Invoice-Generating Web Service (IGWS) is invoked, which generates the associated
Invoice according to his/her Purchase Orders (PO). The Web Services are developed in
.NET and J2EE and the .NET Client is integrated into FVS. FVS with the included .NET
Client and the Web Services are built up as a complete distributed and heterogeneous
system.
      Briefly, there are two criteria for comparison between these two platforms: Execution
Measure (user’s perspective) and Coding Measure (developer’s perspective). FVS makes a
remote SOAP Request to ICWS or IGWS, and gets back a SOAP Response from one of
them. We will measure the execution time for them implemented in both Microsoft .NET
and J2EE environment.
     Coding Measure is the key criterion in software development industry. It provides the
accurate measure of developing efficiency among different developing platforms. We will
measure the code size of ICWS and IGWS in both Microsoft .NET and J2EE environment.


2.   SYSTEM DESIGN

      System Design is a process through which the Requirements are translated and
structured for constructing the software system. We will focus on three modules: the two
Web Services, Inventory-Checking Web Service (ICWS) and Invoice-Generating Web
Service (IGWS), and the First-Video Subsystem (FVS).
      The First-Video Subsystem (FVS) is an online store that performs typical E-commerce
site. The functions of FVS are listing the new release items, searching, ordering and
shipping certain items. Meanwhile, particular Purchase Order generates the invoice
automatically when the customer places his/her order. After checking out, the customer will
receive the confirmation and check the order detail later. [8]

                                           Web Server
                                          (IIS / Tomcat)                    Customer
                                                                              Info.
     …          FVS
                                               ICWS
     .
     .                                                                      Inventory
                                               IGWS                         XML file


                                   Fig. 2. System Architecture

      There are two main Web Services in the system: the Inventory-Checking Web Service
(ICWS) and the Invoice-Generating Web Service (IGWS), which should be deployed on the
server side. ICWS can check the server-side inventory for certain products and return their
quantities to the client. On the other hand, IGWS can generate the invoice based on the
upcoming Purchase Order. After the invoice’s generation, IGWS returns the Total Cost of
that order to the client.
      Comparing to .NET counterpart classes, some additional Java classes need to be
designed and coded in order to transform between Java Objects and XML files, such as the
Serializer class and the Deserializer class. [3]

2.1. INVENTORY

     All the product information stores in this special XML file instead of a real Database.
The root element of the Inventory XML file is “Products”, which is a complex type. There
is another complex type “Product”, which delegates the real product data type. The
attributes of a product are Id, Name, Category, Description, Price and Quantity in stock.
This is the simplified part of the Inventory XML Schema without closed tag:
       <xs:element name="Products">
           <xs:element name="Product">
               <xs:element name="Id" type="xs:string" />
               <xs:element name="Name" type="xs:string" />
               <xs:element name="Category" type="xs:string" />
               <xs:element name="Desc" type="xs:string" />
               <xs:element name="Price" type="xs:string" />
               <xs:element name="InStock" type="xs:string" />

2.2. PURCHASE ORDER

     The root element of the Purchase Order XML file is “PurchaseOrder”, which is a
complex type. Under the root element, there are three complex types: “ShipTo”, “Items”
and “OrderedItem”, which delegate the shipping address (Name, Address, City, State, etc.)
and the ordered video items. This is simplified part of the Purchase Order XML Schema
without closed tag:
      <xs:element name="PurchaseOrder">
          <xs:element name="OrderID" type="xs:string" />
          <xs:element name="OrderDate" type="xs:string" />
          <xs:element name="ShipTo">
          <xs:element name="Items">
              <xs:element name="OrderedItem">
                  <xs:element name="ItemID" type="xs:string" />
                  <xs:element name="Quantity" type="xs:string" />

2.3. INVOICE

     The root element of the Invoice XML file is “Invoice”, which is a complex type.
Under the root element, there are three complex types: “ShipTo”, “Items” and
“OrderedItemInvoice”, which delegate the shipping address and the ordered video items in
Invoice. This is the simplified part of the Invoice XML Schema without closed tag:
      <xs:element name="Invoice">
          <xs:element name="OrderDate" type="xs:string" />
          <xs:element name="ShipTo">
          <xs:element name="SubTotal" type="xs:string" />
          <xs:element name="Tax" type="xs:string" />
          <xs:element name="ShipCost" type="xs:string" />
          <xs:element name="TotalCost" type="xs:string" />
          <xs:element name="Items">
              <xs:element name="OrderedItemInvoice">
                   <xs:element name="ItemID" type="xs:string" />
                    <xs:element name="Quantity" type="xs:string" />
                    <xs:element name="UnitPrice" type="xs:string" />
                    <xs:element name="LineTotal" type="xs:string" />


3.   COMPARISON [2]

      The goal of the Microsoft .NET Framework is to make it easy to build XML Web
Services and applications. Using its features, developers can simply write their business
logic, and the ASP.NET infrastructure will be responsible for delivering that RPC (Remote
Procedure Call) based service based on XML, SOAP and other technologies. On the other
hand, JAX-RPC provides an easy to develop programming model for development of SOAP
based Web Services. For typical scenarios, developers are not exposed to the complexity of
the underlying runtime mechanisms. A JAX-RPC runtime system (a library) abstracts these
runtime mechanisms. It simplifies Web Service development. [4]
      This paper concentrates on developing Web Services in these developing platforms:
Microsoft .NET and J2EE. Both the Web Services for them are developed in both .NET and
Java. With these two types of Web Services, we will compare them from both user’s
perspective and developer’s perspective.

3.1. EXECUTION MEASURE

     When a customer places his/her order, the Client application in FVS makes a remote
SOAP Request automatically to invoke ICWS/IGWS, and gets back a SOAP Response from
one of them. We design to measure the Start-Time and Stop-Time for them in both
Microsoft .NET and J2EE environment. Then compare their Elapsed Time in one table. We
keep all components on the same server to eliminate the network time.


                        Start-Time


                                       Web Server                       Inventory
           Client                                                       XML file
                                          ICWS
                                          IGWS


                           Stop-Time

                                Fig. 3. Execution Measure Environment
      Since it’s a must to compile and then generate the executable code in .NET and Java,
the First Time to run the application is a special case. Here is the comparing table for only
the second time or after, which is the general case. The system is running and measuring on
a Toshiba Notebook (Satellite 1405-S151 model), which includes 1.2 GHz Intel Celeron
Processor, 256 MB SDRAM and 30 GB Hard Drive with Windows XP Operating System.


           0.3

          0.25

           0.2
                                                                     .NET
          0.15
                                                                     JAVA
           0.1

          0.05

            0
                         ICWS                          IGWS



                          Fig. 4. Execution Measure for ICWS/IGWS

         After the First Time                      Elapsed-Time (Sec.)
     Repetition Index      Items           .NET ICWS             Java ICWS
             1                1              00.0343               00.0701
             2                2              00.0458               00.0830
             3                3              00.0532               00.0845
             4                4              00.0494               00.0917
             5                5              00.0534               00.1044
             6               10              00.0576               00.1258
             7               15              00.0627               00.1235
             8               20              00.0686               00.1293
     Average Elapsed-Time (Sec.)             00.0531               00.1015
         After the First Time                      Elapsed-Time (Sec.)
     Repetition Index      Items           .NET IGWS             Java IGWS
             1                1              00.1430               00.2246
             2                2              00.1516               00.2374
             3                3              00.1745               00.2504
             4                4              00.1974               00.2741
             5                5              00.2088               00.2684
             6               10              00.2217               00.2789
             7               15              00.2331               00.2803
             8               20              00.2789               00.3152
     Average Elapsed-Time (Sec.)             00.2011               00.2662
3.2. CODING MEASURE

     We coded .NET Web Services in Microsoft .NET Framework 1.0 (1.0.3705), Internet
Information Services (IIS 5.1), and Microsoft Development Environment 2002 (7.0.9466).
Meantime, we coded Java Web Services in J2EE 1.3.1 [6], Apache Tomcat 4.1.18 [5] and
Axis 1.0 [7], and Eclipse 2.0 [9].


          600

          500

          400
                                                                             .NET
          300
                                                                             JAVA
          200

          100

             0
                           ICWS                           IGWS



                             Fig. 5. Coding Measure for ICWS/IGWS

    Module           Classes / Client Components           Lines of Code   Total lines

                 1        Inventory-Check Class                     45
     .NET        2             Product Class                        30         93
     ICWS        3              .NET Client                         18
                          Inventory-Check Class
     Java        1         and Product DB Class                     56
    ICWS *       2             Product Class                        34        103
                 3           JAX-RPC Client                         13
                 1        Invoice-Generate Class                    22
                 2             Product Class                        30
     .NET        3         Purchase Order Class                     43
     IGWS        4             Invoice Class                        27        227
                 5          PO Processor Class                      82
                 6              .NET Client                         23
                          Invoice-Generate Class
                 1          and Serializer Class                    217
                 2             Product Class                         34
     Java        3         Purchase Order Class                      15
    IGWS *       4             Invoice Class                         31       572
                                   PO Processor Class,
                      5             Product DB Class,                           234
                                  and Deserializer Class
                      6              JAX-RPC Client                              41


CONCLUSION

      XML Web services are the fundamental building block in the move to distributed
computing on the Internet. A XML Web Service is a Web software service accessing
through SOAP, described with WSDL files and registered in UDDI. The paper focus was
mainly on developing and comparing two particular XML Web Services on both Microsoft
.NET and SUN J2EE platforms.
      Two main Web Services were developed in our system: Inventory-Checking Web
Service (ICWS) and Invoice-Generating Web Service (IGWS). Both of the Web Services
were coded in .NET and Java and the .NET Client was integrated into First-Video
Subsystem (FVS), an online store for a virtual video company. Therefore, FVS with the
included .NET Client and ICWS/IGWS were built up as a complete distributed and
heterogeneous system.
      After developing and integrating the system, we tested and compared platforms .NET
vs. J2EE. The comparison was based on our Web Services performance and development
complexity. According to our performance results, .NET is faster than J2EE by 91% for
ICWS and by 32% for IGWS. Moreover, the size of J2EE program is bigger than that of
.NET by 11% for ICWS and by 152% for IGWS.


REFERENCES

[1]     Dhawan P. and Ewald T., ASP.NET Web Services or .NET Remoting: How to Choose, Microsoft Developer
        Network, Sep. 2002
[2]     Feng Y., Developing and Validating XML Web Services with Distributed and Heterogeneous Environment,
        Master’s Project, Department of Computer Science, California State University, Fullerton, May 2003
[3]     Graham S., Building Web Services with Java, Sams publishing, Dec. 2001
[4]     Irani R. and Basha J., Axis: the next generation of Java SOAP, Wrox publishing, May 2002
[5]     jakarta.apache.org/tomcat, Apache Tomcat 4.1.18
[6]     java.sun.com/j2ee, SUN J2EE 1.3
[7]     ws.apache.org/axis, Apache Axis 1.0
[8]     www.asp.net/IBS_Store, A ASP .NET E-Commerce Storefront Application
[9]     www.eclipse.org, Eclipse 2.0
[10]    www.middleware-company.com/j2eedotnetbench, J2EE & .NET Application Server and Web Services
        Benchmark, Middleware Company, Oct. 2002
[11]    www.w3.org, W3C XML, SOAP, WSDL, and UDDI specifications




________________
* In the table, associated Java Classes are combined together in order to match .NET Classes based on their functions.

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:2
posted:11/2/2012
language:Unknown
pages:8