Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 23637 invoked from network); 22 Oct 2004 04:48:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 22 Oct 2004 04:48:21 -0000 Received: (qmail 36488 invoked by uid 500); 22 Oct 2004 04:48:18 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 36435 invoked by uid 500); 22 Oct 2004 04:48:18 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 36422 invoked by uid 99); 22 Oct 2004 04:48:17 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 21 Oct 2004 21:48:17 -0700 Received: (qmail 23582 invoked by uid 1852); 22 Oct 2004 04:48:16 -0000 Date: 22 Oct 2004 04:48:16 -0000 Message-ID: <20041022044816.23581.qmail@minotaur.apache.org> From: samisa@apache.org To: ws-axis-cvs@apache.org Subject: cvs commit: ws-axis/site/src/documentation/content/xdocs/cpp/arch WSDL2Ws.ihtml X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N samisa 2004/10/21 21:48:16 Modified: site/src/documentation/content/xdocs/cpp/arch WSDL2Ws.ihtml Log: Added usage information and did some formatting fixes Revision Changes Path 1.3 +193 -165 ws-axis/site/src/documentation/content/xdocs/cpp/arch/WSDL2Ws.ihtml Index: WSDL2Ws.ihtml =================================================================== RCS file: /home/cvs/ws-axis/site/src/documentation/content/xdocs/cpp/arch/WSDL2Ws.ihtml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- WSDL2Ws.ihtml 9 Aug 2004 04:45:00 -0000 1.2 +++ WSDL2Ws.ihtml 22 Oct 2004 04:48:15 -0000 1.3 @@ -1,246 +1,274 @@ WSDL2Ws Tool - - - - - - - -
- - - - -

-WSDL2Ws -

-
- -
- -Contents - +

Axis C++ WSDL2Ws Tool

+
+

Contents

-1.Functionality +1 Introduction

-

1.1Types Of Classes +

+    1.1 Source Code Generation

-

1.2Programming Languages +

+    1.2 Programming Languages

-

1.3Encoding Style +

+    1.3 Encoding Styles

-

1.4Style Of the Service +

+    1.4 Styles of Services

-

1.5Supports for Making Simple Custom Types +

+    1.5 Support for Complex Types

-

2.Architecture +

+2 Using the Tool

-

2.1 Out Line +

+    2.1 Dependencies on Axis Java tool

-

2.2 Mediator WsContext +

+    2.2 Building the Tool

-

2.3 Generator +

+    2.3 Synopsis

-

2.4 Flow Of Execution +

+    2.4 Setting up CLASSPATH

-

2.5 Sequence Diagram +

+    2.5 Running the Tool

-

3.Dependencies on Axis Java tool +

+3 Architecture

-

- -

1. Functionality

- -

- -

The tool should be able to generate different types of Wrappers and Skeletons for the server side and client�s stubs for the client�s Side.WSDL2Ws tool in Axis C++ is written in Java. - - - - -

      1.1 Types Of Classes

- - - -

The tool should start with a WSDL document and generate following classes.

- - -

-       -WSDL2WS tool is used for building following C/C++ components

-                    o Server side � Skeletons and Wrappers

-                    o Client side � Stubs

-

+    3.1 Outline +

-                        >      > - WSDL2WS tool that generates wrappers which are used to deploy the Service in the Axis C++ engine. (Please refer the Wrapper Specification for more information) +

+    3.2 Mediator WebServiceContext +

-

The generated Wrappers perform the following functions. These wrappers act as RPC Providers.

+

+    3.3 Generator +

-

o Serialization

-

o Deserialization

-

o Method invocation

+

+    3.4 Flow of Execution +

+

+    3.5 Sequence Diagram +

+

+

1 Introduction

+

The WSDL2Ws tool that comes with Axis C++ can be used to generate different types of wrapper classes / skeletons for the server side and wrapper classes / stubs for the client side for a given WSDL file. WSDL2Ws tool is written in Java and is based on the WSDL tools by Axis Java project. + +

+

1.1 Source Code Generation

+

WSDL2WS tool can be used for generating the following C/C++ source files for a given WSDL file :

+

    +
  • Server side skeletons and wrappers
  • +
  • Client side stubs and wrappers
  • +
+ +

The generated Wrappers support the following functions :

+

    +
  • Method invocation
  • +
  • Serialization
  • +
  • Deserialization
  • +
- -

       1.2 Programming Languages

+

+

1.2 Programming Languages

-

The tool should be able to generate classes for -

       � C++

-

       � C

-

- -

The tool should be extensible to support other programming languages if required.

- - - +

The tool is capable of generating source code for both C++ and C

- -

       1.3 encoding style

+

+

1.3 Encoding Styles

-

The tool should be able to support SOAP1.2 encoding style and extensible to support other encoding styles as well. +

The tool should be able to support SOAP 1.2 encoding style and extensible to support other encoding styles as well. However verifying the compliance with SOAP 1.1 / SOAP 1.2 and WS-I Basic Profile remains a TODO.

+

+

1.4 Styles of Services

- -

      1.4 Style Of the Service

- -

The tool should be able to generate classes for following styles

-

� RPC

-

� Document

-

� Messaging

+

The tool is able to generate code for RPC (encoded) and Document Literal style WSDLs

+

+

1.5 Support for Complex Types

+

The tool generates wrapper classes / structs / functions for complex types. The generated source include:

+
    +
  • Wrapper classes for complex types with data members and constructors/destructors
  • +
  • Helper functions for serializing/deserializing complex types
  • +
  • Wrapper structs to handle arrays of complex types
  • +
+ +

+

2 Using the Tool

+ +

+

2.1 Dependencies on Axis Java tool

+ +

Apache Axis C++ uses WSDL processing tools from Axis Java project and extends those for C/C++ code generation.

+

The following jar files that comes with (or used by) Axis Java are required to run Axis C++ WSDL2Ws tool:

+
    +
  • axis.jar
  • +
  • wsdl4j.jar
  • +
  • commons-discovery.jar
  • +
  • commons-logging.jar
  • +
  • log4j-1.2.8.jar
  • +
  • jaxrpc.jar
  • +
  • saaj.jar
  • +
+ +

"SchemaUtils" (SchemaUtils.java) and "ElementDecl" (ElementDecl.java) classes of Axis Java tools have been overridden by Axis C++ WSDL2Ws implementation.

+ +

Other than the two classes mentioned above, no other class from Axis Java WSDL tool implementation has been overridden or extended at present by Axis C++ WSDL2Ws tool; hence all other classes in Axis Java tool are used as they are.

+ +

Except for "SchemaUtils" and "ElementDecl" classes, the rest of the classes of Axis C++ WSDL2Ws are unique to Axis C++ and they use functionality form Axis Java jars.

+ +

+

2.2 Building the Tool

+

If you want to build the WSDL2Ws tool form source, there is an Apache Ant build script to help you. +Assuming that you have installed Ant properly, what you have to do is to set the CLASSPATH to include Axis Java jar files mentioned in the previous section and run ant command in $AXISCPP_HOME/src/wsdl folder. Once you build the tool the generated wsdl2ws.jar file would be placed in $AXISCPP_HOME/lib/axis/ folder. +

- - -

       1.5 Supports for making simple custom types

- - - - -

Tool generates Wrappers for custom types in following conditions

-

� Generates the method signatures of the types (serialize(), deserialize()) so that developer    can write serialize desirialize code in most efficient way.

-

� Generates the complete wrappers for WSDL types like struts -

- -

� Generates the complete wrappers for Array of any simple or WSDL types like struts

- +

+

2.3 Synopsis

+

+java WSDL2Ws [options] wsdl-file +

+

Options

- +
  +-help, -h              print a short help message
+-o(folder) target output folder - default is current folder
+-l(c++|c) target language (c++|c) - default is c++
+-s(server|client) generate server skeletons or client stubs? (serve|client) - default is server
+-w(wrapped|nonwrapped) wrapping style of the WSDL (wrapped|nonwrapped) - default is wrapped
+-verbose, -v be verbose
+-m(none|gnu) generate make files (none|gnu) - default is none
+
+ +

+

2.4 Setting up CLASSPATH

+

Make sure that your CLASSPATH environment variable has all the jar files mentioned in section 2.1 above. +Then modify your CLASSPATH to include the wsdl2ws.jar file from Axis C++: +

+ +

On Linux:

+
  +CLASSPATH=$AXISCPP_HOME/lib/axis/wsdl2ws.jar:$CLASSPATH
  +export CLASSPATH
  +
+ +

On Windows:

+
  +set CLASSPATH=%AXISCPP_HOME%\lib\axis\wsdl2ws.jar;%CLASSPATH%
  +
+

Alternatively, you can use the -classpath option of java command to specify the CLASSPATH.

+ +

NOTE: It is a MUST that that you have wsdl2ws.jar from Axis C++ appearing before all the jar files form Axis Java on the CLASSPATH. If not you will run into trouble when generating code. This is a known problem and happens because the two classes, "SchemaUtils" and "ElementDecl", of Axis C++ that overides Axis Java classes with the same name have identical package names to that of Axis Java classes. +

+ +

+

2.5 Running the Tool

+ +

You could run the tool as shown in the following example. Assuming you have not included wsdl2ws.jar in your class path:

+ +
  +java -classpath $AXISCPP_HOME/lib/axis/wsdl2ws.jar:$CLASSPATH org.apache.axis.wsdl.wsdl2ws.WSDL2Ws \
  +     -obaseServerOut $AXISCPP_DEPLOY/wsdls/base.wsdl
  +
+

+The above command will generate C++ server side skeleton and wrapper classes and place the generated source files in a folder named baseServerOut. You could have also used -sserver and -lc++ options to generate the same. To generate client side C++ code for the same WSDL file and place the generated code in baseClientOut folder, you could run: +

+
  +java -classpath $AXISCPP_HOME/lib/axis/wsdl2ws.jar:$CLASSPATH org.apache.axis.wsdl.wsdl2ws.WSDL2Ws \
  +     -obaseClientOut -sclient -lc++ $AXISCPP_DEPLOY/wsdls/base.wsdl
  +
- -

2.Architecture

+

+

3 Architecture

-
-

      2.1 Outline

+

+

3.1 Outline

-

The tool takes a top down approach. It starts with a wsdl document and generates all the classes necessary to deploy the web service. It generates

-

� Skeleton (wrapper class)

- -

� Wrapper classes for complex types

-

� Server side and client Side stubs -
-The tool can be extensible to generate Service classes to be published -For more information about the generated classes please refer to the architecture documentation. +

The tool takes a top down approach. It starts with a WSDL document and generates all the classes (skeletons, wrapper classes for complex types and stubs) necessary to deploy (server side) and consume (client side) the web service. For more information about the generated classes please refer to the architecture documentation.

+ +

The following figure shows the high level architecture of the WSDL2Ws tool

+

+

3.2 Mediator WebServiceContext

- -

  2.1 Mediator WsContext

- - - -

The WSDL file and the user options are processed by the WSDLWs. The WSDL creates a class called wsContext(WebServiceContext) which is the runtime representation of the processed data. This wsContext passes to the generators. The generators extract the information from the wsContext and creates the files.The wsContext acts as a mediator and creates a loosely coupled system.

- -

wsContext has following components

- -

1. ServiceInfo � information about service

-

2. WrapperInfo � information about wrapper options

-

3. TypeMap � information about custom types

- - - - -

   2.2 Genarator -

- -

Generator generates a class which depends on the options, It contains a class called SourceWriter and the concrete implementation of the SourceWriter decides what the Genarator generates. The SourceWriter factory creates a correct type of generator which depends on the options.

+

The WSDL file and the user options are processed by the WSDL2Ws class. Then WSDL2Ws creates an instance of WebServiceContext class (wscontext), which is the runtime representation of the processed data. This WebServiceContext instance selects the Generator to be used. The Generators extract the information from the WebServiceContext instance and creates the files. The WebServiceContext instance acts as a mediator and creates a loosely coupled system.

+

+WebServiceContext has the following components +

+
    +
  1. ServiceInfo - information about service
  2. +
  3. WrapperInfo - information about wrapper options
  4. +
  5. TypeMap - information about custom types
  6. +
- -

   2.4 flow of execution +

+

3.2 Generator

-

1.WSDL file and user options are processed by the WSDL2Ws and WSContext object is created.

-

2. WebServiceGenaratorFactory will create WebServiceGenarator which depends on the service style

-

3. Then the WebServiceGenarator will create a right set of Generators to create the set of files

-

4.Each generator will invoke SourceWriter which is capable of writing each type of file. -Rest of the logic is upto the developer to decide (He has all the needed info as WsContext). +

Generator generates a class based on the options passed by user. It contains a class called SourceWriter and the concrete implementation of the SourceWriter decides what the Generator generates.

+

+

3.4 flow of Execution

+

+

    +
  1. WSDL file and user options are processed by the WSDL2Ws and WebServiceContext object is created
  2. +
  3. WebServiceGenaratorFactory will create WebServiceGenerator based on the service style
  4. +
  5. Then the WebServiceGenarator will create the right set of Generators that will take care of generating C/C++ source files
  6. +
  7. Each Generator will invoke SourceWriter which is capable of writing the given type of file
  8. +

- -

   2.5 Sequence Diagram +

+

3.5 Sequence Diagram

-
-

Dependencies on Axis Java tool

- -

The document below describes the areas where Apache Axis C++ is dependant upon the Axis Java tool.

-

The Axis jars given below are used as they are in the Axis Java tool:

-
-

    axis.jar
-    commons-discovery.jar
-    commons-logging.jar
-    jaxrpc.jar
-    saaj.jar
-    wsdl4j.jar
-    xml-apis.jar

-

"SchemaUtils.java" and "ElementDecl.java" files have been overridden and their original implementations are no longer used even though they exist in the above mentioned jars.

- -

No classes have been extended at the present time.

- -

Except for "SchemaUtils.java" and "ElementDecl.java" the rest of the code has been developed for the Axis C++ tool and is not present in the current Axis Java tool.

- -
+