To develop a client side handler, you first create the required
files, which you can do using any text editor, and then build the client library.
Why and when to perform this task
To create a handler, you first create a client handler header
file, a client handler file and client handler factory file. You can then
use these files to build your handler library in the same way as you would
any other library.
If you are writing more than one handler, you must
remember to ensure that the handler names are unique.
To create and
build a handler, complete the following steps, which use the example of the
myclientHandler library.
Steps for this task
- Change the current working directory to where the project myClientHandler
is to be built (for example, <inst_dir>/samples/handlers).
- Create the three basic files required for the handler:
- Using any text editor, create three new files named myClientHandler.cpp,
myClientHandler.hpp and myClientHandlerFactory.cpp (see Required handler files).
- Into each file, copy the sample code described in Sample client handler code.
- Save the new files in the current directory.
- Build the handler library:
- On Linux,
type the following build command:
gcc -I <inst_dir>/include/ *.cpp -L <inst_dir>/lib/ -l axis_client –shared
-o myClientHandler.so
- On Windows,
type the following build command:
cl /MT /D "WIN32" /I<inst_dir>\include *.cpp /link<inst_dir>
\lib\AxisClient.lib /dll /out:"myClientHandler.dll"
- Check that the client handler library file has been created.
- Create or amend the WSDD file
to include a definition for each handler that you create. For further
information about handler definitions, see Handler definitions in WSDD file.
- Make sure that the axiscpp.conf file
includes a line defining the path for the WSDD file. For further information about the file path definition, see WSDD file path definition in axiscpp.conf file.
What to do next
After you have finished developing your handlers, you are ready to
deploy your application as described in
Deploying web service client applications with handlers.