Return-Path:
Running your sample
-
+
+Handlers
+
Before you follow this guide, make sure that you have followed the
@@ -277,6 +279,95 @@
-SUCCESS ! If you get the result, you are done.
SUCCESS ! If you get the result, you are done.
+ + + +Handlers are pluggable components in Axis C++. We have included a set of sample handlers for your reference. You could write your own handlers by following the instructions given for the sample Handlers.
+Note: If you are using Client side Handlers you need to enter the following entry in the AXIS_FOLDER/axiscpp.conf configuration file.
+CLIENTWSDDFILEPATH:Axis\conf\client.wsdd
+After entering this entry to your AXIS_FOLDER/axiscpp.conf configuration file will look like:
+AXISLOGPATH:Axis\logs\AxisLog.txt
+
WSDDFILEPATH:Axis\conf\server.wsdd
+
CLIENTWSDDFILEPATH:Axis\conf\client.wsdd
We have included the following sample Handlers for your reference.
+1) echoStringHeaderHandler (A server side handler sample)
+ This sample handler will simply echo (i.e send back) the string which you send in the SOAP request.
+
2)testHandler (A client side handler sample)
This sample handler will simply add a SOAP Header to the generated SOAP request.
+Please note that these are very primitive sample handlers and are presented here to give you an idea about writing your own Handlers.
+echoStringHeaderHandler
+Building the Sample Handlers in VC
+The VC dsw file (ServerHandlers.dsw) is available at AXIS_EXTRACT/vc/samples/server/ ServerHandlers.dsw. Open this file and build the project echoStringHeaderHandler. Once the build is successful you will find the DLL (echoStringHeaderHandler.dll) at AXIS_EXTRACT/bin. If you see this DLL at the above location you are done with the first step.
+Configuring the Handler
+Now edit the AXIS_FOLDER /conf/server.wsdd to include the handler for a particular service.
+<service name="Calculator" provider="CPP:RPC" description="Simple Calculator Axis C++ Service ">
+
+<requestFlow name="CalculatorHandlers">
+
+<handler name="ESHHandler" type=" AXIS_EXTRACT/bin/echoStringHeaderHandler.dll">
+
+</handler>
+
+</requestFlow>
+
+<responseFlow name="CalculatorHandlers">
+
+<handler name="ESHHandler" type=" AXIS_EXTRACT/bin/echoStringHeaderHandler.dll">
+
+</handler>
+
+</responseFlow>
+
+<parameter name="allowedMethods" value="add sub mul div "/>
+
+<parameter name="className" value="Axis\webservices\Calculator.dll" />
+
+</service>
Note: Make sure you specify the correct path of the handler dll in the server.wsdd file.
+Now you are almost done to run your server side handler.
+
+Restart the Apache server and thats it.
Since this Handler is configured to the Calculator web service in the above step, this Handler will be executed when a client send a SOAP request to the Calculator web service.
+testHandler
+Building the Sample Handlers in VC
+Building testHandler (A client side handler sample)
+The VC dsw file (ServerHandlers.dsw) is available at AXIS_EXTRACT/vc/samples/client/ClientHandlers.dsw. Open this file and build the project TestHandler. Once the build is successful you will find the DLL (testHandler.dll) at AXIS_EXTRACT/bin. If you see this DLL at the above location you are done with the first step.
+Configuring the Handler
+Now edit the AXIS_FOLDER /conf/client.wsdd to include the handler for a particular service.
+<service name="Calculator" provider="CPP:DOCUMENT" description="Calculator web service">
+
+<requestFlow name="CalculatorHandlers">
+
+<handler name="TestHandler" type=" AXIS_EXTRACT/bin/testHandler.dll">
+
+</handler>
+
+</requestFlow>
+
+</service>
Note: Make sure you specify the correct path of the handler dll in the client.wsdd file.
+Now you are almost done to run your client side handler.
+Note: If you are using Client side Handlers you need to enter the CLIENTWSDDFILEPATH entry in the AXIS_FOLDER/axiscpp.conf configuration file. (See above)
+Running the Handler
+Since this Handler is configured to the Calculator web service in the above step, this Handler will be executed when you run the calculator web service client. (It is at AXIS_EXTRACT/bin/Calculator.exe)
+Handler Notes:
+1) You can see the Handler behavior through the TCP Monitor. (TCP Monitor is a Axis Java tool)
+
+2) To get an idea of Handlers look at the Handler sample source files.
+
+a. echoStringHeaderHandler (AXIS_EXTRACT/samples/server/echoStringHeaderHandler)
+
+b. testHandler
+(AXIS_EXTRACT/samples/client/testHandler)