Return-Path:
Apache Web Server
Download the Apache web server from www.apache.org. Currently Axis supports apache 1.3.x and 2.X. This documentation was tested with Apache 1.3.28 and Apache 2.0.44. 1)Copy [EXPAT_EXTRACT]\source\lib\expat.h from expat binary distribution to [CHECKOUT_HOME]\c\include\expat\ directory 1) Copy [EXPAT_EXTRACT]\source\lib\expat.h from expat binary distribution to [CHECKOUT_HOME]\c\include\expat\ directory 3)Copy libexpat.dll file from [EXPAT_EXTRACT]\Libs to %AXIS_HOME%/libs/ 3) Copy libexpat.dll file from [EXPAT_EXTRACT]\Libs to %AXIS_HOME%/libs/
For apache 1.3.X:
1)Copy the include files in "[APACHE_HOME]\include" directory to "[CHECKOUT_HOME] \c\include\apache1_3\" 1) Copy the include files in "[APACHE_HOME]\include" directory to "[CHECKOUT_HOME] \c\include\apache1_3\"
For apache 2.X:
1)Copy the include files in "[APACHE_HOME]\include" directory to "[CHECKOUT_HOME]\c\include\apache2_0\" 1) Copy the include files in "[APACHE_HOME]\include" directory to "[CHECKOUT_HOME]\c\include\apache2_0\"
Building the AxisServer and AxisClient dlls
Build the AxisServer and AxisClient projects.(Click on file in Visual C++ ,open Visual C++ Distribution workspace (Distribution.dsw) at [CHECKOUT_HOME]\c\vc\. In the workspace window, File View, right click on the AxisServer project and AxisClient project ).Which will build the AxisServer.dll and AxisClient.dll
Building Apache Modules (Apache 1.3.X and Apache 2.X)
In Visual C++ (The version used for this documentation was Visual C++ 6.0) click on file ,open Visual C++ Distribution workspace (Distribution.dsw) at [CHECKOUT_HOME]\c\vc\. In the workspace window, File View, right click on either the project "Apache1_3Module files" or "Apache2_0Module files" and click on the "Set as Active Project" to make it the Active Project.
Setting up the build environment and building Axis
+
+
2) Copy [EXPAT_EXTRACT]\lib\libexpat.lib to [CHECKOUT_HOME]\c\lib\expat\ directory.
+
+
2) Copy the ApacheCore.lib file from [APACHE_HOME]\libexec to [CHECKOUT_HOME]\c\lib\apache1_3.
+
2) Copy the following lib files libapr.lib, libhttpd.lib files from "[APACHE_HOME]\lib" to "[CHECKOUT_HOME]\c\lib\apache2_0".
-
Again in Visual C++ right click on either the project "Apache1_3Module" or "Apache2_0Module" in the workspace window, File View, and then click on Settings on the popup menu. Select the link tab. Select General from the Category drop down list. In the Output file name text box put the value [APACHE_HOME]\modules\mod_axis.dll and click OK.(To build a Apache Module, AxisServer.lib should be in the settings Link tab )
Again in Visual C++ right click on either the project "Apache1_3Module" or "Apache2_0Module" in the workspace window, File View, and then click on Settings in the popup menu. Select the link tab. Select General from the Category drop down list. In the Output file name text box put the value [APACHE_HOME]\modules\mod_axis.dll and click OK.(To build a Apache Module, AxisServer.lib should be in the settings Link tab )
Build either Apache1_3Module or Apache2_0Module project. In Visual C++ right click on either the project "Apache1_3Module" or "Apache2_0Module" in the workspace window, File View and click "build (selection only)" to build mod_axis.dll for Apache1_3Module or mod_axis2.dll for Apache2_0Module.
(From here onwards we refer to these modules as APACHE_MODULE. Replace it with the correct module for the Apache server version that you have installed). Then build SimpleAxisServer.
Axis Transport Library
In VC++ distribution workspace build AxisTransport project.Then AxisTransport.dll will be built.
+Xerces Parser Library and Expat Parser Library
In VC++ distribution workspace build either AxisXMLParserXerces project or AxisXMLParserExpat project. Then AxisXMLParser.dll will be built.
+
Building AxisTransport.dll and AxisXMLParser.dll
Build the AxisTransport and AxisXMLParser projects. Which will build the AxisTransport.dll and AxisXMLParser.dll in [CHECKOUT_HOME]\c\bin.
1) Create a directory structure called "Axis" inside [APACHE_HOME] as follows.
(Instead, you can copy the folder [CHECKOUT_HOME]\c\deploy to [APACHE_HOME] and rename it to "Axis" and you will find some of the files that you are asked to create in this guide, already existing in that folder)
Axis
|__ libs ( Copy [EXPAT_EXTRACT]\Libs\libexpat.dll and paste it inside)
|__ logs (log files are located here)
|__ conf (server.wsdd file is located here)
|__ webservices (The place to put webservice dlls)
|__ wsdls (The directory for the wsdl files of the deployed web services)
-
2)Set an environment variable named AXIS_HOME and give [APACHE_HOME]\Axis as the value.
+
2) Set an environment variable named AXIS_HOME and give [APACHE_HOME]\Axis as the value.
i)You will find AxisServer.dll and APACHE_MODULE in [CHECKOUT_HOME]\c\bin directory.
ii)Copy APACHE_MODULE to [APACHE_HOME]\modules directory of your apache installation.
Copy AxisServer.dll ,AxisTransport.dll and AxisXMLParser.dll to [AXIS_HOME]\libs\ directory and add that directory to your PATH environment variable.Or to any location specified by your PATH environment variable.
2) Set the "PATH" environment variable to the following directories.
[APACHE_HOME]
[APACHE_HOME]\Axis\libs
-
3)Include the following lines at the bottom of the apache configuration file [APACHE_HOME]\conf\httpd.conf
+
3) Set the "PATH" environment variable to the following directories.
[APACHE_HOME]
[APACHE_HOME]\Axis\libs
+
4) Include the following lines at the bottom of the apache configuration file [APACHE_HOME]\conf\httpd.conf
LoadModule axis_module modules/APACHE_MODULE
<Location /axis>
SetHandler axis
</Location>
-
4)create a file in [APACHE_HOME]\Axis named "axiscpp.conf" which should contain the following lines.
+
5) Create a file in [APACHE_HOME]\Axis named "axiscpp.conf" which should contain the following lines.
LogPath:XXXX
WSDDFilePath:YYYY
Transport_http:ZZZZ (Not necessary)
XMLParser:WWWW
Where XXXX will be the path to a file named AxisLog (The log file)and YYYY will be the path to the server.wsdd file.ZZZZ will be the path to AxisTransport.dll if it's a HTTP(if the selected transport is SMTP then should give that path.WWWW will be the path to AxisXMLParser.dll
i.e.
LogPath:[APACHE_HOME]\Axis\logs\AxisLog.log
WSDDFilePath:[APACHE_HOME]\Axis\conf\server.wsdd
Transport_http:[APACHE_HOME]\Axis\libs\AxisTransport.dll
XMLParser:[APACHE_HOME]\Axis\libs\AxisXMLParser.dll
6)Select start->programs->Apache HTTP server->Control Apache Server->stop to stop the apache server
(This is because apache will be started automatically by the installation program)
+
6) Select start->programs->Apache HTTP server->Control Apache Server->stop to stop the apache server
(This is because apache will be started automatically by the installation program)
Open up a DOS terminal and give the command "apache -k start" to start apache (If Apache 2.0 server does not respond when started this way, try "apache -X").
open a browser and verify whether you can browse http://localhost/ (or give the machines ip as http://xxx.xxx.xxx.xxx/). If apache is running you will see the Apache start page in the browser.
In the checked out source code there is a "wsdl2ws" (i.e. wsdl-to-web services) written in java that generates server side Skeletons/wrappers and client side stubs using a given WSDL file. This Section describes how this is done.
To build and run the java tool this section uses the eclipse platform. For this documentation eclipse 2.1.0 was used and the jdk version used was j2sdk1.4.1_01. You will not be able to build the java tool with jdk versions below 1.4.0.
-
1)Start the eclipse platform IDE.
Go to File->New->Project.
+
1) Start the eclipse platform IDE.
Go to File->New->Project.
Select java in the "New Project" dialog and click "Next".
In the "New" dialog that appears give a project Name (e.g. test). In the "New dialog" keep the "use default" Tick Box checked.
Note down the path in the "Directory" Text Box. This location will be referred as [SKELSTUB_HOME] from this point onwards. Click "Next".
Another dialog named "New” will appear. Select the “Source” tab. Select the project that you created (i.e. test).
Click on “Add Folder…”. In the “Source Folder Selection” dialog that appears select the project that you created (i.e. test) and click “Create New Folder…”. In the “New Folder” dialog that appears give a folder name as “src” and click “OK”. Click “OK” in the “Source Folder Selection” dialog. Click “Yes” on the confirmation message box that pops up.
@@ -479,7 +490,9 @@
“Calculator.wsdl -o./ServerOut -lc++ -sserver”.
-
NOTE: These are the arguments for the java tool WSDL2Ws. The usage of the WSDL2Ws is as follows.
Java org.apache.axis.wsdl.wsdl2ws.WSDL2Ws <wsdl file> -o<output directory>
-l<c|c++> -s<(server|client)>.
Also note that there cannot be any spaces after a switch (i.e. -o, -l).
+
+NOTE: These are the arguments for the java tool WSDL2Ws. The usage of the WSDL2Ws is as follows.
+
Java org.apache.axis.wsdl.wsdl2ws.WSDL2Ws <wsdl file> -o<output directory>
-l<c|c++> -s<(server|client)>.
Also note that there cannot be any spaces after a switch (i.e. -o, -l).
Click “Run”.
Now the Skeletons/Wrappers will be generated and you will see messages in the eclipse console displaying the generated files. The generated Skeletons/Wrappers will be created in a folder named [SKELSTUB_HOME]\ServerOut as given in the arguments when you run the tool.
Similarly to generate the client stubs use the following arguments in eclipse and run.
“Calculator.wsdl -o./ClientOut -lc++ -sclient”.
The generated Stubs will be created in a folder named [SKELSTUB_HOME]\ClientOut.
@@ -491,13 +504,18 @@
For building WSDL2Ws java tool on the command line you require jdk1.4 or above.
To build WSDL2Ws java tool set the CLASSPATH Environment Variable to point to the following jar files.Create a New Folder called wsdl2wsTool\lib and put the above mentioned jars in it. You can find these jars in [CHECKOUT_HOME]\lib\axisjava.
axis.jar
commons-discovery.jar
commons-logging.jar
jaxrpc.jar
saaj.jar
wsdl4j.jar
xml-apis.jar
-
Open a command window.
Change directory to [CHECKOUT_HOME]\c\src\wsdl.
We will refer to this directory as [SKELSTUB_HOME] as we did during generating Skeletons/Wrappers and Stubs with eclipse.
Run the following command to build the java tool.
+
Open a command window.
+
Change directory to [CHECKOUT_HOME]\c\src\wsdl.
We will refer to this directory as [SKELSTUB_HOME] as we did during generating Skeletons/Wrappers and Stubs with eclipse.
+
Run the following command to build the java tool.
javac -sourcepath . org\apache\axis\wsdl\wsdl2ws\WSDL2Ws*.java
-
NOTE: Notice the spaces between the "dot" after the -sourcepath switch
If the command finishes without any output then the java tool has been built.
+
+
+NOTE: Notice the spaces between the "dot" after the -sourcepath switch
+
If the command finishes without any output then the java tool has been built.
Now copy the Calculator.wsdl file in [CHECKOUT_HOME]\c\samples\server\simple, which we use in this example to [SKELSTUB_HOME]
Now run the following command to generate the server side skeletons and wrappers in the same [SKELSTUB_HOME].
Java -classpath .;%classpath% org.apache.axis.wsdl.wsdl2ws.WSDL2Ws Calculator.wsdl -o./ServerOut -lc++ -sserver
-
Give the class path exactly in the same order as given above.
+
Give the class path exactly the same order as given above.
If the tool is successful the tool will display the files it has generated. The skeletons and stubs will be generated in [SKELSTUB_HOME]\ServerOut.
Run the following command to generate the client stubs.
Java -classpath %classpath%;. org.apache.axis.wsdl.wsdl2ws.WSDL2Ws Calculator.wsdl -o./ClientOut -lc++ -sclient
@@ -518,7 +536,7 @@
7) In the dialog that appears select “An empty DLL project” click “Finish” and then “OK”.
8) Right click on the project that you created (i.e. ws1) and click “Add Files to Project…” on the menu that appears. In the “Insert Files into Project” dialog select the generated .cpp and .h files in [SKELSTUB_HOME]\ServerOut and click “OK”.
9) Right click on the project (i.e. ws1)again and click on “Settings…” on the menu that appears. Click the C/C++ tab and select “Preprocessor” from the “Category” Drop down list. Add Axis include directory [CHECKOUT_HOME]c\include\ to the project In the “Additional include directories”
-
10)Now add the business logic to the generated Skeletons. The Skeletons in this case are Calculator.h and Calculator.cpp
+
10) Now add the business logic to the generated Skeletons. The Skeletons in this case are Calculator.h and Calculator.cpp
11) We will implement two methods that are in Calculator.cpp as follows.
int Calculator::add(int Value0, int Value1)
{
return Value0+Value1; //business logic
}
int Calculator::subtract(int Value0, int Value1)
{
return Value0-Value1; //business logic
}
12) Right click on the project (i.e. ws1) and click “Build” on the menu that appears. Visual C++ should be able to build the project without any errors now.
13) The ws1.dll will be built in "ws1\Debug" by Visual C++
@@ -539,6 +557,7 @@
The service element specifies the service name.
<service name="Calculator">
In this parameter element we specify the parameter className and it’s value, the location of the webservice dll.
<parameter name="className" value="C:\Program Files\Apache Group\Apache\Axis\webservices\ws1.dll"/>
In this parameter element we specify the parameter allowedMethods and its value, the methods exposed by the web service (i.e. subtract and add).
+
Note: A trailing space should be put after every allowed method.
<parameter name="allowedMethods" value="subtract add "/>
16) Now start the Apache web server by typing “apache -k start”. If the Apache server is running type “apache -k restart”
@@ -555,9 +574,16 @@
1) If you have followed the above instructions you would have been able to generate the Server side Skeletons and Wrappers for the Calculator.wsdl.
2) Start Visual C++.
3) Go to File->New…
4) Select the “Projects” tab
5) Select “Win 32 Console Application”
6) Give a project name (e.g. calclient) and click “OK”. Give a project name (e.g. calclient), give a folder ( For e.g: "wsclient") as the "location" of the project, select the "create new workspace" radio button, and click “OK”.When this procedure is followed the "calclient" project files are created in a folder named "calclient" inside the "wsclient" folder.
-
7) In the dialog that appears select “An empty project” click “Finish” and then “OK”.
8) Right click on the project that you created (i.e. ws1) and click “Add Files to Project…” on the menu that appears.Then Add the generated .cpp and .h files from the [SKELSTUB_HOME]\ClientOut to the project and click “OK”.
9) Right click on the project (i.e. calclient) again and click on “Settings…” on the menu that appears. Click the “C/C++” tab and select “Preprocessor” from the “Category” Drop down list.
In the “Additional include directories” give [CHECKOUT_HOME]c\include as the include path.
+
1) If you have followed the above instructions you would have been able to generate the Server side Skeletons and Wrappers for the Calculator.wsdl.
+
2) Start Visual C++.
+
3) Go to File->New…
+
4) Select the “Projects” tab
+
5) Select “Win 32 Console Application”
+
6) Give a project name (e.g. calclient) and click “OK”. Give a project name (e.g. calclient), give a folder ( For e.g: "wsclient") as the "location" of the project, select the "create new workspace" radio button, and click “OK”.When this procedure is followed the "calclient" project files are created in a folder named "calclient" inside the "wsclient" folder.
+
7) In the dialog that appears select “An empty project” click “Finish” and then “OK”.
+
8) Right click on the project that you created (i.e. ws1) and click “Add Files to Project…” on the menu that appears.Then Add the generated .cpp and .h files from the [SKELSTUB_HOME]\ClientOut to the project and click “OK”.
+
9) Right click on the project (i.e. calclient) again and click on “Settings…” on the menu that appears. Click the “C/C++” tab and select “Preprocessor” from the “Category” Drop down list.
In the “Additional include directories” give [CHECKOUT_HOME]c\include as the include path.
10) Click the “Link” tab and select “Input” from the “Category” Drop down list.
Add AxisClient.lib to the “Object/library modules” and in the “Additional library path” give the path. AxisClient.lib can be found in [CHECKOUT_HOME]\c\bin once you build the AxisClient,AxisTransport,AxisXMLParserXerces or AxisXMLParserExpat projects of the "Distribution" VC workspace.
Right click on the project and click “Build” on the menu that appears.
When the XMLParser is running these steps would occur.
1. Locate Parser dll.
2. Create Parser instance by CreateInstance() method.
3. Give the stream to parser by setInputStream() method.
4. Call next() method multiple times.
5. getStatus() to see if the streams are properly passed.
6. Destroy parser object by DestroyInstance().
If Visual C++ complains about missing libs go to Build->Rebuild All (Please make sure that the apache server is stopped). Now the client exe is built.
Start the Apache server by typing apache -k start and run the exe from Visual C++ by going to Build->Execute calclient.exe. If all goes well, now you would see the SOAP Request, SOAP Response and the result printed by calclient.exe.
If Visual C++ complains about missing libs go to Build->Rebuild All (Please make sure that the apache server is stopped). Now the client exe is built.
+
Start the Apache server by typing apache -k start and run the exe from Visual C++ by going to Build->Execute calclient.exe. If all goes well, now you would see the SOAP Request, SOAP Response and the result printed by calclient.exe.
-
1) Open the Visual C++ workspace (interoptests.dsw) at [CHECKOUT_HOME]\c\vc\samples\server\interoptests\ and do a batch build of all projects.
2) You will find the built dynamic libraries at [CHECKOUT_HOME]\c\bin directory. Following are the built DLLs.
base.dll
cbase.dll
cGroupB.dll
doclitbase.dll
doclitgroupB.dll
groupB.dll
3)copy these dlls to [APACHE_HOME]\Axis\webservices
4)Add the required entries to the server.wsdd file in [APACHE_HOME]\Axis\conf to deploy these interop services. You can find the required entries in the [CHECKOUT_HOME]\c\deploy\conf\server.wsdd_win file. You will need to modify the "value" of the "classname" parameter of each service to point to the relevant web service dll given above in [APACHE_HOME]\Axis\webservices.
-
1) Open the Visual C++ workspace (interoptests.dsw) at [CHECKOUT_HOME]\c\vc\samples\client\interoptests\ and do a batch build of all projects.
2) You need to build the AxisClient project in the "Distribution" workspace at [CHECKOUT_HOME]\c\vc\, because you need the AxisClient.lib to compile client applications and AxisClient.dll to run them.
3) You will find the built console applications and AxisClient.dll at [CHECKOUT_HOME]\c\bin directory. Following are the built .exe files. base.exe cbase.exe cgroupB.exe doclitbase.exe doclitgroupB.exe groupB.exe
4) In order to run these samples you should have AxisClient.dll in the PATH environment variable or in the same directory where the .exe is.