This document is intendedto be a referencemanual forApacheAxis2/C. Thismanual details how Axis2/C can be used to provide and consume Webservices.
Please send your feedbackto the Apache Axis2/Cdeveloper mailing list (c-dev@axis.apache.org).Subscriptiondetails are available on theApacheAxis2/C website.
This document uses the following conventions:
This section is aimed to help you get a Web service running ina shorttime using Axis2/C, and consume that service using an Axis2/C client.
First,downloadthe latest binary release from Apache Axis2/C. Once you download thecorrectbinary that suits your platform, all that you require to get it runningis toextract the package to a folder of your choice, and set the AXIS2C_HOMEenvironment variable to point to this extracted folder. For Linux, youmayhave to set the LD_LIBRARY_PATH environment variable to include the libfolder (e.g. add $AXIS2C_HOME/lib). For MS Windows, you will have toadd thelib folder to your PATH variable to include the Axis2/C DLLs to yourpath.
Now you should be able to change the directory to the binfolder of theextracted folder, and run the simple axis server in one command shell.Thenchange the directory to samples/bin in another command shell and runany ofthe samples there (you may have to set the environment variables inthis newshell as well). Please see theinstallationguide for more details.
Once you have Axis2/C up and running successfully, you canstart writingyour own services and clients. The following sections explain how towriteyour first service and client with Axis2/C.
Let's see how you can write your first Web service withAxis2/C and how todeploy it.
The first service that we are going to write is named "hello"with asingle operation named "greet" in the service. This "greet" operation,wheninvoked by the client, will expect the client to send a greeting in therequest, and in turn send a greeting in the response. Following areexamplesof XML payloads exchanged between the client and the service:
Request:
<greet>
Hello Service!
<greet>
Response:
<greetResponse>
Hello Client!
<greetResponse>
The steps to be followed when implementing a service withAxis2/Cinclude:
axis2_hello_greet
.axis2_svc_skeleton
interfaceaxis2_svc_skeleton
interface expects thefunctionsinit
,invoke
,on_fault
andfree
to be implemented by our service.hello_init
,hello_invoke
,hello_on_fault
andhello_free
respectively.Look for theaxis2_hello_greet
function in thehello_svc.csource file.
This function implements the business logic for the greetoperation. Wewill be calling this function from our implementation of the invokefunction.Basically, this function receives the request payload as anaxiom_node
, process it to understand therequest logic, andprepares the response as anaxiom_node
andreturns that.
Look for theaxis2_hello_create
function in thehello_svc.csource file.
The create function creates and returns a newaxis2_svc_skeleton
instance. The mostimportant aspect to noteabout this function is the function pointer assignments. They are usedto mapthe interface operations to the corresponding functions of theimplementation. This is done by assigning the ops member of the serviceskeleton to the address of the ops struct variable.
The invoke method of the service skeleton is the point ofentry forinvoking the operations. Hence in our implementation of the invokefunction,we have to define how the operations are to be called.
Look for thehello_invoke
functionin thehello_svc.csource file.
In our implementation of thehello_invoke
,we call thefunction implementing the greet operation. As we have only oneoperation, thetask is simple here. If we had multiple operations, we will have tolook intothe information in the message context to map it to the exactoperation.
The Axis2/C engine will call the invoke method with anaxiom_node
, containing the request payload,andaxis2_msg_ctx
instance, containing the messagecontextinformation, in addition to the service skeleton and the environmentpointers. We can use the message context to extract whateverinformation wedeem necessary that is related to the incoming message. The Axis2/Cengineexpects the invoke method to return a pointer to anaxiom_node
,representing the response payload.
The services.xml file contains details on the service thatwould be readby the Axis2/C deployment engine during server start up time. Thefollowingshows the contents for the services.xml file for the hello service.
<service name="hello">
<parameter name="ServiceClass" locked="xsd:false">hello</parameter>
<description>
Quick start guide hello service sample.
</description>
<operation name="greet"/>
</service>
The service configuration shown above specifies that the nameof theservice is hello.
The value of the "ServiceClass", "hello" in this case, will be mappedto theservice implementation by the deployment engine as libhello.so on Linuxorhello.dll on MS Windows. The description element contains a briefdescriptionof the service.
There can be one or more operation elements. For this sample, we onlyhaveone operation, with the name "greet".
You can compile the service sample as shown below.
On Linux:
gcc -shared -olibhello.so -I$AXIS2C_HOME/include/axis2-1.6.0/ -L$AXIS2C_HOME/lib -laxutil -laxis2_axiom -laxis2_parser -laxis2_engine -lpthread -laxis2_http_sender -laxis2_http_receiver hello_svc.c
On MS Windows:
to compile,
cl.exe /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "AXIS2_DECLARE_EXPORT" /D "AXIS2_SVR_MULTI_THREADED" /w /nologo /I %AXIS2C_HOME%\include /c hello_svc.c
to link,
link.exe /nologo /LIBPATH:%AXIS2C_HOME%\lib axutil.lib axiom.lib axis2_parser.lib axis2_engine.lib /DLL /OUT:hello.dll *.obj
To make the service available to be consumed by the clients,we have todeploy the service. To deploy the service, you have to create a foldernamed'hello' in the AXIS2C_HOME/services folder, and copy the services.xmlfileand the shared library file (libhello.so on Linux or hello.dll on MSWindows)into that folder.
To verify that your service has been correctly deployed, youcan start thesimple axis server and then browse the list of deployed services usinga Webbrowser. To start the simple axis server, you can go to theAXIS2C_HOME/binfolder and run the executable axis2_http_server. The default URL thatyou cantest the service list with ishttp://localhost:9090/axis2/services.You should get an entry for the hello service on the page that isdisplayed.
Axis2/C does not support dynamic WSDL generation. However, itis possible to attach the contract you used to generate the serviceskeleton, to the respective service. This can be done in two ways.
If you choose the first option, you will have to copy the WSDLfile to the folder in which the service DLL is found. The name of theWSDL file should be the name of the service. And, if you choose thesecond option, you will have to make use of thewsdl_path
parameter in the services.xml file. More info on how this can be doneis found under theservices.xmlsection.
An example of the second option can be found the services.xmlof theecho sample service, which is commented. Anexample of the first option in use is seen in theCalculatorsample service.
The static WSDL file can be accessed by appending?wsdl
to the service end-point. You can view the WSDL provided for theCalculator sample, by pointing tohttp://localhost:9090/axis2/services/Calculator?wsdl.
Now that you know how to write a service with Axis2/C, let'ssee how towrite a client to consume that service. The request payload that theclientwill be sending to the service was described in the previous section.Theclient has to prepare the payload, send it to the service, and thenreceiveand process the response.
The steps to be followed when implementing a client withAxis2/C:
axutil_env_create_all
method can be used to create a default, ready to use environmentinstance. axis2_options
struct can be used to setthe client side options. For example, we can use options to set theendpoint address of the service to be consumed by the client. axis2_svc_client
struct is meant to beused by the users to consume Web services. It provides an easy to useAPI. Service client create method takes the location of the repositoryas a parameter. For the purpose of our sample, you can use theAXIS2C_HOME as the repository. The concept ofrepositoryis explained in detail in a later section.axis2_svc_client_send_receive
method can be used to invoke the send receive operation on the serviceclient instance.axiom_node
and returns the response payload as anaxiom_node
.options = axis2_options_create(env);
address = "http://localhost:9090/axis2/services/hello";
endpoint_ref = axis2_endpoint_ref_create(env, address);
axis2_options_set_to(options, env, endpoint_ref);
In the above section of code, anaxis2_options
instance iscreated first. Then an endpoint reference instance is created with theaddress of the location of the service. Finally, the created endpointis setas the "to" address of the options. The "to" address indicates wheretherequest should be sent to.
svc_client = axis2_svc_client_create(env, client_home);
axis2_svc_client_set_options(svc_client, env, options);
payload = build_om_request(env);
ret_node = axis2_svc_client_send_receive(svc_client, env, payload);
After creating and preparing the options, the next step is tocreate aservice client instance and use it to send the request and receive theresponse. The code fragment given above shows how options can be set ontopof the service client and how to invoke the send receive operation witharequest payload. Once the response is received, the response payloadwill bestored in theret_node
, which is a pointer toanaxiom_node
that can be used to process theresponse further.
You can compile the client sample as shown below.
On Linux:
gcc -o hello -I$AXIS2C_HOME/include/axis2-1.6.0/ -L$AXIS2C_HOME/lib -laxutil -laxis2_axiom -laxis2_parser -laxis2_engine -lpthread -laxis2_http_sender -laxis2_http_receiver hello.c -ldl -Wl,--rpath -Wl,$AXIS2C_HOME/lib
On MS Windows:
to compile,
cl.exe /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /I %AXIS2C_HOME%\include /c hello.c
to link,
link.exe /LIBPATH:%AXIS2C_HOME%\lib axutil.lib axiom.lib axis2_parser.lib axis2_engine.lib /OUT:hello.exe *.obj
Repository is a folder where all Axis2/C relatedconfigurations as well asservices and modules are located. The following shows the folderstructure ofthe repository:
Here the name of the repository folder is axis2c_repo. In yoursystem, youcan specify any folder name of your choice. There are three sub foldersavailable in the repository. In addition to that, the axis2.xmlconfigurationfile is also located in the repository. The following table describesthepurpose of the repository contents.
Folder/File Name | Description |
---|---|
lib | The lib folder contains the libraries required to runthe Axis2/C engine. While you can afford to have the shared libs ofAxis2/C in a location of your choice, the dynamically loaded sharedlibs, parser, transport receiver and transport sender has to be in therepository lib folder. |
modules [optional] | The modules folder contains the modules deployed withAxis2/C. Each module deployed will have its own sub folder inside themodules folder. For example, if the addressing module is deployed, thenthere will be a sub folder named addressing inside the modules folderof the repository. |
services [optional] | The services folder contains the services deployed withAxis2/C. Each service deployed will have its own sub folder inside theservices folder, or live inside one of the sub folders. |
axis2.xml | The axis2.xml file is the configuration file of Axis2/C. |
Both clients as well as the services written using Axis2/C canuse thesame repository. However you can use one repository for the server sideandanother one for the client side. The services folder is used only whentherepository is used by the server side. When the repository is used bytheclient, the services folder, if present, will not be used.
The Axis2/C binary distribution, when extracted, can beconsidered asready for use as your repository folder. If you are building Axis2/Cfrom thesource distribution, when you build the source, including the samples,theinstallation destination will be ready for use as your repositoryfolder.
The simple axis server (that is axis2_http_server binary), theclientsamples, and the HTTPD module (Axis2 Apache2 module) require therepositoryfolder to be specified in order to run correctly.
As described earlier, all the modules are placed inside themodules folderof the repository, and each module will have its own sub folder withinthemodules folder.
The folder in which a module is placed must have the same name as themodulename. For example, the addressing module will be placed in a sub foldernamedaddressing.
Inside the folder corresponding to a module, the sharedlibraryimplementing the module and the module configuration file, module.xml,isplaced. It is a must that these two files are present inside eachfolderrepresenting a module. The module.xml file will be processed by thedeployment engine to find out module specific information such as themodulename, set of handlers, the flows into which those handlers are to beadded,etc.
All the services are placed inside the services folder of therepository,and each service will be in one of the sub folders within the servicesfolder. Axis2/C has a concept called service groups, where there can beoneor more services inside a service group. A single stand alone serviceisassigned a service group with the same name as that of the service bytheAxis2/C engine for the purpose of easy handling. Therefore the subfolders inthe services folder correspond to the service groups.
A service, if deployed as a stand alone service, will resideinside afolder with the same name as that of the service. For example, the echoservice will be placed in a sub folder named echo. The shared libraryimplementing the service and the service configuration file, theservices.xml, will be placed inside the folder corresponding to aservice.Given the fact that the engine treats the folders to represent servicegroupsand not a single service, the configuration file is calledservices.xml.However, you can always place a single service inside a single folder,whichis the most common use case.
Each sub folder within the services folder should have atleast one sharedlib implementing a service and a services.xml file. If it is a realservicegroup, there will be multiple shared libs, yet there is only oneservices.xmlfile configuring all those services. The services.xml file is processedbythe deployment engine to find out the service group and the servicespecificinformation such as the service group name, service name, the set ofoperations for each service, etc.
We have already seen how to write a service in the Quick StartGuidesection of this manual. This section covers the service API of Axis2/Cinmore detail.
axis2_svc_skeleton
is an interface.Axis2/C does not provideany concrete implementation of this interface. It is the responsibilityofthe service implementer to implement this interface. To implement theinterface, you should implement the functions adhering to the functionpointer signatures of the members of theaxis2_svc_skeleton_ops
struct. Then, a create function should be written to create anaxis2_svc_skeleton
instance, and assign theimplementingfunctions to the members of the ops member of service skeleton.
The following table details the signatures of the functionpointer membersof theaxis2_svc_skeleton
struct implementedby a service.
Function Signature | Description |
---|---|
int (AXIS2_CALL * | Initializes the service skeleton object instance. TheAxis2/C engine initializes a service skeleton instance once perdeployed service, during the first request made to the service. |
axiom_node_t *(AXIS2_CALL* | Invokes the service implementation. You have toimplement the logic to call the correct functions in this method basedon the name of the operation being invoked. |
axiom_node_t *(AXIS2_CALL* | This method is called by the engine if a fault isdetected. |
axis2_status_t (AXIS2_CALL * | Frees the service implementation instance. |
There are two more methods that a service should implement.Once a serviceis deployed, the message receiver of the Axis2/C engine has to create aservice instance at run time for the purpose of invoking it. For this,itlooks for a method namedaxis2_create_instance
and calls it onthe service shared library. The engine also looks for a function namedaxis2_remove_instance
in the shared libraryfor clean uppurposes.
Function Signature | Description |
---|---|
AXIS2_EXPORT int | Creates an instance of the service. You have toimplement the logic of creating the service object, allocating memoryetc. in this method. |
AXIS2_EXPORT int | Removes the instance of the service. Do any cleaning-upand deallocations here. |
Note that service object instantiation happens once perservice. When thefirst request is received by the service, a service skeleton instanceiscreated and initialized. The same object instance will be re-used bythesubsequent requests.
You can find an example on how to implement the serviceskeleton interfacein thehello_svc.csource file,which is the example used in theQuickStartGuide. More advanced samples can be found in the samplesfolder of theAxis2/C distribution.
The primary client API to be used with Axis2/C isaxis2_svc_client
, the service client API. Thisis meant to be aneasy to use API for consuming services. If you want to do more complextasks,such as invoking a client inside a module, or wrap the client API withanother interface, you may need to useaxis2_op_client
,theoperation client API. For most of the use cases, the service client APIissufficient.
The behavior of the service client can be fine tuned with theoptionspassed to the service client. You can set the options by creating anaxis2_options
instance. The bare minimum thatyou need to set isthe endpoint URI to which the request is to be sent. An example of thiswasgiven in theQuick Start Guidesection.
The service client interface serves as the primary clientinterface forconsuming services. You can set the options to be used by the serviceclientand then invoke an operation on a given service. There are several waysofinvoking a service operation. The method of invoking an operationdepends on3 things. They are,
Many service operation invocation scenarios can be obtained bycombiningthe above three factors. The service client interface provides thenecessaryAPI calls to achieve this.
Deciding the Message Exchange Pattern (MEP)
There are 2 message exchange patterns.
In the Out-Only MEP, the client doesn't expect a reply fromthe server.The service client provides two methods of using the Out-Only MEP.
Function Signature | Description |
---|---|
AXIS2_EXTERN void AXIS2_CALL | Sends a message and forgets about it. This method isused to interact with a service operation whose MEP is In-Only. Thereis no way of getting an error from the service using this method.However, you may still get client-side errors, such as host unknown. |
AXIS2_EXTERN axis2_status_t AXIS2_CALL | This method too is used to interact with a serviceoperation whose MEP is In-Only. However, unlikeaxis2_svc_client_fire_and_forget ,this function reports an error back to the caller if a fault triggerson the server side.When using Out-In MEP, the client expects a reply from the server. axis2_svc_client_send_receive and axis2_svc_client_send_receive_non_blocking functionssupport this MEP |
AXIS2_EXTERN axiom_node_t *AXIS2_CALL | This method is used to interact with a serviceoperation whose MEP is In-Out. It sends an XML request and receives anXML response. Returns a pointer to the AXIOM node representing the XML response. Thismethod blocks the client until the response arrives. |
AXIS2_EXTERN void AXIS2_CALL | This method too, is used to interact with a serviceoperation whose MEP is In-Out. It sends an XML request and receives anXML response, but the client does not block for the response. In this method, the client does not block for the response, but insteadit expects the user to set a call back to capture the response. |
Please have a look at theaxis2_svc_client.h
header file formore information on the above mentioned functions, as well as theirsynonymsthat accept an operation's qualified name.
This will determine whether the client would block for theresponse(synchronous) or return immediately expecting the response to behandled by acallback (asynchronous, in other words non-blocking) in an Out-In MEPscenario.axis2_svc_client_send_receive
operates insynchronous mode,whereasaxis2_svc_client_send_receive_non_blocking
operates inasynchronous mode.
If the transport is two-way, then only one channel is used,which meansthe request is sent and the response is received on the same channel.If thetransport is one-way, then the request is sent on one channel and theresponse is received on a separate channel.
If we want to use a separate channel for the response, a separatelistenerhas to be started to receive the response, This can be done by settingtheseparate listener option to True using theaxis2_options_set_use_separate_listener
function above theoptions.
Please have a look at theecho_blocking_dual
sample to seehow to set the separate channel option.
Please seeAppendix Dfor further details on settingoptions.
Axis2/C comes with plain old XML (POX) like REST support. Agiven servicecan be exposed both as a SOAP service as well as a REST service. Bydefault,your service will support SOAP as well as REST, however, your serviceoperationswill only be available for SOAP. In order to enable REST for youroperations youneed to add one or more parameters under your operation, in theservices.xml.If you want to consume Web services using REST style calls, you can usethe HTTPPOST method, the HTTP GET method, the HTTP HEAD method, the HTTP PUTmethod orthe HTTP DELETE method.
The following example code fragment shows how to set up aclient enabling a REST styleinvocation.
axis2_options_set_enable_rest(options, env, AXIS2_TRUE);
You can use the same code that you use with a SOAP call, anddo REST styleinvocation by just enabling REST using the option setting shown above.
The default HTTP method used with REST is HTTP POST. If youneed to changeit to the HTTP GET method, the following needs to be done.
axis2_options_set_http_method(options, env, AXIS2_HTTP_GET);
Similarly you can use AXIX2_HTTP_HEAD to change it to the HTTPHEAD method,or AXIX2_HTTP_PUT to change it to the HTTP PUT method, orAXIX2_HTTP_DELETE to change itto the HTTP DELETE method.
Please have a look at theecho_rest
sample for a completesource code on how to use REST.
You basically need to add the REST Location, and the RESTMethod parameters to theservices.xmlto enable REST in a service operation. The REST location is thetemplate that needs to be matchedto find your operation, and the REST Method is the HTTP Methodassociated with the service.Note that the REST Method is optional for each operation. If no RESTMethod is specified, POST,will be assumed. Optionally you may specify the default REST Method forall operations at the servicelevel. Then, if you haven't specified a REST Method for your operation,the default REST Methodspecified will be assumed instead of POST. Please have a look at theecho
sampleservice for a complete source code on how to set up REST. Shown belowis an example, on how toconfigure thelocate
operation to work withHTTP GET on REST.
<operation name="locate">
<parameter name="RESTMethod">GET</parameter>
<parameter name="RESTLocation">location/{lat}/{long}</parameter>
</operation>
The corresponding request would look like,http://www.sample.org/service/location/34N/118W
,which would return Los Angeles, California. In here, the portionlocation
is fixed andlat
andlong
are optional parameters which will be captured to the payload.
It is also possible to enable a single service operation forSOAP as well as REST. This can be done by specifying a REST Locationthat does not contain the operation name. Thelocate
operation is an example to such a case. Thus, for a SOAP invocation,you need to usehttp://www.sample.org/service/locate
,as the end point or WS-Addressing Action.
Axis2/C allows you to send and receive binary data with SOAPmessagesusing MTOM/XOP conventions. When sending and receiving attachments, youhaveto use the service client (axis2_svc_client
)API to perform thesend and receive operations, and provide or consume binary data inrelationto the AXIOM payloads.
In order to send a binary attachment, you need to build theAXIOM payloadand attach the data handler with binary content to the payload.
<soapenv:Body>
<ns1:mtomSample xmlns:ns1="http://ws.apache.org/axis2/c/samples/mtom">
<ns1:fileName>test.jpg</ns1:fileName>
<ns1:image>
<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include"
href="cid:1.f399248e-8b39-1db1-3124-0015c53de2e5@apache.org"></xop:Include>
</ns1:image>
</ns1:mtomSample>
</soapenv:Body>
In the above sample payload shown, we place our image file astext withinan image element
image_om_ele = axiom_element_create(env, mtom_om_node, "image", ns1, &image_om_node);
data_handler = axiom_data_handler_create(env, image_name, "image/jpeg");
data_text = axiom_text_create_with_data_handler(env, image_om_node, data_handler, &data_om_node);
When sending attachments, you can configure the client eitherto send theattachment in the optimized format or non-optimized format.
To do this, set the optionaxis2_options_set_enable_mtom(options,env, AXIS2_TRUE);
or the setting<enableMtom>true</enableMtom>
inaxis2.xml
If enableMTOM is set to True, the attachment is sent as it is,out of theSOAP body, using MIME headers. Also the payload will have anXOP:Includeelement, referring to the MIME part that contains the binaryattachment.Sending the attachment as it is, in pure binary format, is calledbinaryoptimized format. In the case of binary non-optimized format, whereenableMTOM is False, the attachment content is sent in the payloaditself, asa base64 encoded string.
user_paramis of any type which the user should know how to handle from thecallback. The path to the implemented callback should be specified inthe axis2.xml as follows.
<parameter name="MTOMSendingCallback" locked="false">/path/to/the/attachment_sending_callback</parameter>
Forlarge attachments users can specify them to be cached either to a fileor to a any storage. In order to enable caching user should set either "attachmentDir" or "MTOMCachingCallback"parameters in the axis2.xml. If both are set the callback will be used.If nothing is set attachment will reside in memory.
Following is an example of specifying the attachmentDir.
<parameter name="attachmentDIR" locked="false">/path/to/the/dir/</parameter>
So the attachments will be savedin the specified directory using the attachment content id as the filename.
In the callback case the callback should be implemented usingaxiom_mtom_caching_callback.h. The following paramter will enbale the caching callback.
<parameter name="MTOMCachingCallback" locked="false">/path/to/the/attachment_caching_callback</parameter>
A sample callback implementation can be foundhere.Axis2/Callows to set the caching threshold. The default is 1MB. Forexample to cache attachments which are greater than 10MB in size userneed to add the following directive in axis2.xml.
<parameter name="MTOMBufferSize" locked="false">10</parameter>
This will give the control to the users to use the availbale memory even with larger attachments.
When the attachment is cached the ultimate receiver can always identify it by calling ,
if (axiom_data_handler_get_cached(data_handler, env))
{
/* logic for attachment handling */
}
The logic on how to handle the attachment will depend on the mechanism which is used to cached the attachment.
Please have a look at the MTOM related samples in the Axis2/C samples directory.
A module is a set of handlers that helps to extend the messageprocessingbehavior of the Axis2/C engine. Modules have the concepts of beingAvailableand Engaged associated with them. Available means modules are deployedin thesystem but not activated. They will be activated only after beingengaged.Every module comes with its own module.xml file . This module.xml filespecifies the module specific handlers and the phases into which thehandlersare to be placed in the handler chain. Some of the module specifichandlersmay be put into system predefined phases. In that case, the module.xmlfileshould specify where to put the handlers relative to the others in thatphase. Sometimes a module may define its own phase. In that case, someof themodule specific handlers may be put into that phase. The handlers addedtothe system predefined phases (global handlers) are invoked for everymessagethat comes to or goes out from the system. The handlers in the modulespecific phase are invoked only for the messages invoking theoperations thatengage that module. Engaging a module means correctly adding thehandlers ofa particular module to one or more phases. Once the module is engaged,thehandlers and the operations defined in the module are added to theentitythat engaged them.
Before engaging a module, the following steps have to befollowed.
The following is an example of engaging a sample module calledthe loggingmodule with Axis2/C:
In the module.xml file, the handlers of the module and thephases to whichthey are to be added have to be specified. Below is the module.xml fileofthe sample logging module.
<module name="logging">
<inflow>
<handler name="LoggingInHandler">
<order phase="PreDispatch"/>
</handler>
</inflow>
<outflow>
<handler name="LoggingOutHandler">
<order phase="MessageOut"/>
</handler>
</outflow>
<Outfaultflow>
<handler name="LoggingOutHandler">
<order phase="MessageOut"/>
</handler>
</Outfaultflow>
</module>
In the above shown module configuration file, the name of themodule islogging. There are two handlers in this module, the LoggingInHandlerand theLoggingOutHandler. The LoggingInHandler is placed into the PreDispatchphaseof the in flow. The LoggingOutHandler is placed into the MessageOutphase ofboth the out flow and the fault out flow.
The above module.xml file should be copied to a folder named"logging"(because the module name is "logging") inside theAXIS2C_INSTALL_DIR/modulesfolder. The module libraries containing the handler implementationshouldalso be copied to the same folder. According to the module.xml fileshownabove, the name of the shared library file should belibaxis2_mod_log.so onLinux and axis2_mod_log.dll on MS Windows.
Module specific phases have to be added after the systempredefinedphases. The following example shows where to add the module specificphases.Look for thephaseOrder
elements in theaxis2.xml file. Note thecomment lines:
<!-- User defined phases could be added here -->
You can add user defined phases after the above comment lineinto any of theflows. Thetype
attribute of thephaseOrder
elementindicates the flow.
For the logging module example, user defined phases are notrequired. Allthe module specific handlers are added to system predefined phases asspecified in the module.xml file.
The following is an example of engaging the logging module tothe echoservice. This can be done by simply adding<moduleref="logging"/>
in the services.xml file of the echoservice. Thisinforms the Axis2/C engine that the module "logging" should be engagedforthis service. The handlers inside the module will be executed in theirrespective phases as described by the module.xml.
<service name="echo">
<module ref ="logging"/>
<parameter name="ServiceClass" locked="xsd:false">echo</parameter>
<description>
This is a testing service, to test if the system is working or not.
</description>
<operation name="echoString">
<!--messageReceiver /-->
<parameter name="wsamapping" >
http://ws.apache.org/axis2/c/samples/echoString
</parameter>
</operation>
</service>
One important thing to note here is that because the loggingmodule'shandlers are placed into the global phases, even though the loggingmodule isengaged only to the echo service, the module will be engaged globally.Thisis a feature of the Axis2 architecture, not a bug. When invoked, thehandlersin a module can check whether the module has been engaged to aparticularservice, and act accordingly.
If we want to engage a module for every service deployed inthe Axis2/Csystem, we can add the<module ref="logging"/>
entry inthe axis2.xml file. This will inform the Axis2/C engine to invoke thehandlers associated with the module for every message coming in orgoing outfor all the services deployed.
On the client side, if<module ref="logging"/>
isadded in the axis2.xml, the handlers specific to the logging modulewill beinvoked for every request the client sends and every response theclientreceives. If only a particular client wants to engage the module, itcan bedone by engaging the module programmatically. This can be done byadding thefollowing line in the client code after setting the options.
axis2_svc_client_engage_module(svc_client, env, "module-name");
Remember to replace "module-name" with the name of the moduleyou want toengage. For example to engage the logging module you can use:
axis2_svc_client_engage_module(svc_client, env, "logging");
WS-Addressingprovidesmechanisms to address Web services and messages. With Axis2/C, you canuseboth WS-Addressingversion1.0 as well as thesubmissionversion.
WS-Addressing is implemented as a module in Axis2/C. Hence asexplained inthe previous section, the addressing module can be engaged both on theclientside as well as on the server side.
The WS-Addressing module can be globally engaged by adding the<module ref="addressing"/>
lineto the axis2.xml file.
The WS-Addressing module can also be programmatically engagedusing thefollowing line of code with the service client API
axis2_svc_client_engage_module(svc_client, env, AXIS2_MODULE_ADDRESSING);
WS-Addressing related options can be set using theaxis2_options
struct instance on the clientside. If theaddressing module is engaged, there are no options to be set on theserverside. The server will employ WS-Addressing if the incoming requestshaveWS-Addressing headers.
There is a mandatory requirement for using WS-Addressing onthe clientside with Axis2/C. That is to set a WS-Addressing action thatrepresents theoperation to be invoked. Example:
axis2_options_set_action(options,env,"http://ws.apache.org/axis2/c/samples/echoString")
In addition to the action, which is mandatory, there are otherWS-Addressing related headers that can be sent in a message. Axis2/Csupportsto set those headers as options at the client level. The followingfunctionsare used to set them.
axis2_options_set_reply_to(options, env, reply_to)
Sets thewsa:ReplyTo
header. TheReplyTo header contains theendpoint to send reply messages. The ReplyTo header is required whentheresponse comes in a separate channel (when using a dual channel).
axis2_options_set_fault_to(options, env, fault_to)
Sets thewsa:FaultTo
header. Thiscontains the endpoint todirect fault messages.
axis2_options_set_from(options, env, from)
Sometimes the receiving endpoint requires to know the originalsender ofthe message. Thewsa:From
header is used insuch cases. Theabove function sets the From header.
axis2_options_set_relates_to(options, env, relates_to)
Sets thewsa:RelatesTo
header. Thisheader contains a uniqueID which is the message ID of a previously exchanged message. It helpstoidentify a previous message that relates to the current message.
A module is an extension point in the Axis2/C engine. Modulesareprimarily used to WS-* specifications. In other words, quality ofserviceaspects such as security and reliable messaging can be implemented asmodulesand deployed with the Axis2/C engine.
A SOAP message can contain any number of header blocks. These headerblocksprovide various processing information. In Axis2/C, these variousheaderblocks are processed by modules. Some times modules may add headerblocks toa SOAP message.
Normally a module is a collection of handlers. So writing amodule mainlyconsists of writing handlers. There are two interfaces that areimportantwhen writing a module. They areaxis2_module
andaxis2_handler
.
Every module should have three basic functions that aredefined asfunction pointer members of theaxis2_module_ops
struct. Thisstruct is defined in theaxis2_module.h
header file.
Function Signature | Description |
---|---|
axis2_status_t (AXIS2_CALL * | This function takes care of the module initialization. |
axis2_status_t (AXIS2_CALL * | Shuts down and cleans up the module. |
axis2_status_t (AXIS2_CALL * | This function fills the hash map of the handler createfunctions for the module. |
The module developer has to implement functions with the abovesignaturesand assign them to the members of anaxis2_module_ops
structinstance. Then that struct instance has to be assigned to the opsmember ofanaxis2_module
struct instance.
mod_log.chas the source for thelogging module. Please have a look at theaxis2_mod_log_create
function in it to see how anaxis2_module
instance is allocatedand how the ops are initialized.
The axis2_mod_log_fill_handler_create_func_map
function addsthe handler create functions to the module's hash map, which stores thehandler create functions. In themod_log.cexample, the logging module addstwo handlers. The in handler and the out handler that deals withloggingalong with the in-flow and out-flow respectively.
A handler is the smallest unit of execution in the Axis2/Cengine'sexecution flow. The engine can have two flows, the in-flow and theout-flow.A flow is a collection of phases, and a phase in turn is a collectionofhandlers. A handler is invoked when the phase within which it lives isinvoked. Axis2/C defines an interface calledaxis2_handler
,which is to be implemented by all the handlers.
log_in_handler.ccontains thesource code of the in-handler of the logging module. Please have a lookattheaxutil_log_in_handler_create
function tosee how anaxis2_handler
instance is created and how theinvoke functionimplementation,axis2_log_in_handler_invoke
is assigned to theaxis2_handler
invoke function pointer. Theinvoke is called todo the actual work assigned to the handler. The phase that owns thehandleris responsible for calling the invoke function of the handler.
log_out_handler.ccontainsthe source code of the out handler of the logging module. Theimplementationis similar to the in handler, except that it is placed along theout-flowwhen deployed.
After writing the module, the module.xml file should bewritten. Themodule.xml file contains all the configuration details for a particularmodule. Please see the samplemodule.xmlfile for the logging module.
Please see theEngaginga Module sectionfor more details on how to package and deploy the module.
Simple Axis2 HTTP Server is the inbuilt HTTP server of Axis2/C.
Synopsis :
axis2_http_server [-p PORT] [-t TIMEOUT] [-r REPO_PATH] [-l LOG_LEVEL] [-f LOG_FILE] [-s LOG_FILE_SIZE]
You can use the following options with simple axis HTTP server.
-p PORT port number to use, default port is 9090
-r REPO_PATH repository path, default is ../
-t TIMEOUT socket read timeout, default is 30 seconds
-l LOG_LEVEL log level, available log levels:
0 - critical 1 - errors 2 - warnings
3 - information 4 - debug 5- user 6 - trace
Default log level is 4(debug).
-f LOG_FILE log file, default is $AXIS2C_HOME/logs/axis2.log
or axis2.log in current folder if AXIS2C_HOME not set
-s LOG_FILE_SIZE Maximum log file size in mega bytes, default maximum size is 1MB.
-h display the help screen.
Example :
axis2_http_server -l 3 -p 8080 -r $AXIS2C_HOME -f /dev/stderr
Synopsis :
axis2_http_server.exe [-p PORT] [-t TIMEOUT] [-r REPO_PATH] [-l LOG_LEVEL] [-f LOG_FILE] [-s LOG_FILE_SIZE]
You can use the following options with simple axis HTTP server.
-p PORT port number to use, default port is 9090
-r REPO_PATH repository path, default is ../
-t TIMEOUT socket read timeout, default is 30 seconds
-l LOG_LEVEL log level, available log levels:
0 - critical 1 - errors 2 - warnings
3 - information 4 - debug 5- user 6 - trace
Default log level is 4(debug).
-f LOG_FILE log file, default is %AXIS2C_HOME%\logs\axis2.log
or axis2.log in current folder if AXIS2C_HOME not set
-s LOG_FILE_SIZE Maximum log file size in mega bytes, default maximum size is 1MB.
-h display the help screen.
Example :
axis2_http_server.exe -l 3 -p 8080 -r %AXIS2C_HOME% -f C:\logs\error.log
To build Axis2/C with the Apache HTTP server module, alsocalledmod_axis2, you need to provide the following configuration options ontheLinux platform:
./configure --with-apache2=[path to Apache2 include directory] [other configure options]
./configure --with-apache2=[path to Apache2 include directory] --with-apr=[path to APR include directory]
[other configure options]
Then build the source tree as usual using:
make
make install
This will install mod_axis2.so into yourAXIS2C_INSTALL_DIR/lib folder.
On the MS Windows platform, you have to provide the Apache2installlocation in the configure.in file with the setting APACHE_BIN_DIR.Example:
APACHE_BIN_DIR = "C:\Program Files\Apache Software Foundation\Apache2.2"
Based on the Apache HTTP server version you are using, youalso need toset the setting APACHE_VERSION_2_0_X in the configure.in file. Ifyou areusing Apache 2.2 family, this setting should be set to 0,else set it to1.
APACHE_VERSION_2_0_X = 0
To build the source, you have to run the command
nmake axis2_apache_module
This will build mod_axis2.dll and copy it toAXIS2C_INSTALL_DIR\lib directory.
Copy the mod_axis2 shared library to the Apache2 modules directory as mod_axis2.so
On Linux
cp $AXIS2C_HOME/lib/libmod_axis2.so.0.6.0 /usr/lib/apache2/modules/mod_axis2.so
On MS Windows
copy /Y "%AXIS2C_HOME%\lib\mod_axis2.dll" C:\Apache2\modules\mod_axis2.so
Edit the Apache2's configuration file (generally httpd.conf)and add thefollowing directives at the end of the file.
LoadModule axis2_module MOD_AXIS2_SO_PATH
Axis2RepoPath AXIS2C_INSTALL_DIR
Axis2LogFile PATH_TO_LOG_FILE
Axis2LogLevel LOG_LEVEL
Axis2ServiceURLPrefix PREFIX
Axis2MaxLogFileSize SIZE_IN_MB
<Location /axis2>
SetHandler axis2_module
</Location>
Please note that you have to fine tune the above settings tomach yoursystem.
MOD_AXIS2_SO_PATH has to be replaced with the full path tomod_axis2.so,for example,/usr/lib/apache2/modules/mod_axis2.so
on Linux, orC:\Apache2\modules\mod_axis2.so
on MS Windows
AXIS2C_INSTALL_DIR has to be replaced with the full path to Axis2/Crepository, for example,/usr/local/axis2
onLinux, orc:\axis2c
on MS Windows. Note thatrepository path shouldhave read access to the daemon user account under which the Apache2HTTPDprocess is run.
PATH_TO_LOG_FILE has to be replaced with the full path to where youwish tohave the Axis2/C log file, for example,/tmp/axis2.log
on Linux, orC:\Apache2\logs\axis2.log
on MSWindows. Note that the logfile path should have write access to the daemon user account underwhich theApache2 HTTPD process is run.
LOG_LEVEL has to be replaced with one of the following values: crit,error,warn, info, debug, trace. These log levels have the following meanings:
SIZE_IN_MB must be replaced by the size of the particularresource in MB, rounded tothe nearest whole value.
PREFIX has to be replaced with the prefix to be used with the serviceendpoints. This is optional and defaults to "services".As an example, if you have "web_services" as the prefix, then all theservices hosted would have the endpoint prefix of :
http://localhost/axis2/web_services
If you wish, you can also change the location as well by replacing"/axis2" in <Location /axis2> setting with whatever youwish.
Axis2GlobalPoolSize SIZE_IN_MB
To ensure that everything works fine, start Apache2 (restartif it isalready running) and test whether the mod_axis2 module is loadedcorrectly byaccessing the URL:http://localhost/axis2/services.
This should show the list of services deployed with Axis2/C.Then youshould be able to run clients against this endpoint. Example:
echo http://localhost/axis2/services/echo
In case things are not working as expected, here are some tipson how totroubleshoot:
Use the Axis2/C VC project or makefile to buid thecomponent. If you are using the makefile to build the source, you haveto run the command
nmake axis2_iis_module
In this document I assume that the mod_axis2_IIS.dllis in the directoryc:\axis2c\lib
andAXIS2C_HOMEisc:\axis2c
Add the following key to theregistery.
HKEY_LOCAL_MACHINE\SOFTWARE\Apache Axis2c\IISISAPIRedirector
Add a string value with the nameAXIS2C_HOME
and avalue ofc:\axis2c
Add a string value with the namelog_file
and a valueofc:\axis2c\logs\axis2.log
Add a string value with the namelog_level
.The valuecan be eithertrace
,error
,info
,critical
,user
,debug
, orwarning
.
You can add a string value with the nameservices_url_prefix
. This is optional and defaults to "/services".As an example, if you have "/web_services" as the prefix, then all theservices hosted would have the endpoint prefix of :
http://localhost/axis2/web_services.
Note: don't forget the / at the begining.
If you wish, you can also change the location as well by adding a string value with the nameaxis2_location
. This is also optional and defaults to /axis2.If you have /myserser as the value you can access your web services with a url like http://localhost/myserver/services.
Note: Don't forget the / at the beginning.
Now you can do all the registry editing using the JScript fileaxis2_iis_regedit.js provided with the distribution. When you buildaxis2/C with the IIS module the file is copied to the root directory ofthe binary distribution. Just double click it and everything will beset to the defaults. The axis2c_home is taken as the current directory,so make sure you run the file in the Axis2/C repository location (orroot of the binary distribution). If you want to change the values youcan manually edit the the .js file or give it as command line argumentsto the script when running the script. To run the jscript from thecommand line use the command:\cscript axis2_iis_regedit.js optional arguments
. We recomend the manual editing as it is the easiest way to specify the values.
IIS 5.1 or Below
Using the IIS management console, add a new virtualdirectory to your IIS/PWS web site. The name of the virtual directorymust beaxis2
. Itsphysical path should be the directory in which you placedmod_axis2_IIS.dll (in our example it isc:\axis2c\lib). When creating this new virtual directory,assignexecute access to it.By using the IIS management console, addmod_axis2_IIS.dll as a filter in your IIS/PWS web site and restart theIISadmin service.
IIS 6 & 7
Using the IIS management console, add the mod_axis2_IIS.dll as aWildcard Script Map.Please don't add the mod_axis2_IIS.dll as a filter to IIS asin the IIS 5.1 case.
Note: If the Axis2/C failed to load, verify that Axis2/C andits dependent DLLs are in the System Path (not the user path).
In order to allow an Axis2/C client to communicate with an SSLenabledserver, we need to compile Axis2/C with SSL support enabled.
To build with SSL client support, first of all, make sure youhaveinstalledOpenSSLon your machine. Thenyou can start building with SSL client support. This can be achieved onLinuxby configuring Axis2/C with the--enable-openssl=yes
option.
Example
%./configure --enable-openssl=yes --prefix=${AXIS2C_HOME}/deploy
%make
%make install
On MS Windows, setENABLE_SSL=1
intheconfigure.in
file and run thenmakeall
command.
If you need SSL client authentication, Axis2/C requires you toprovide theclient certificate and the private key file in a single file. Such afilewhich contains both the certificate and relevant private key is calledacertificate chain file. Creating such a file is very easy. Assume thattheclient certificate is stored in a file namedclient.crt
and theprivate key is stored in a file namedclient.key
.Then thecertificate chain file can be created by concatenating the certificatefileand the private key file in that order, in to another file, sayclient.pem
.
On Linux you can do this as follows:%catclient.crt client.key >client.pem
On MS Windows, you can do this by copying the contents ofclient.crt andclient.key files and saving them in a file named client.pem usingNotepad.
Uncomment the following inaxis2.xml
to enable https transport receiver and https transport sender.Axis2/C will then be able to recognize the "https" sheme in a given endpoint reference (EPR) and use SSL transport.
<transportReceiver name="https">
<parameter name="port" locked="false">6060</parameter>
<parameter name="exposeHeaders" locked="true">false</parameter>
</transportReceiver>
<transportSender name="https">
<parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
</transportSender>
For the SSL client to work, the file containing the CAcertificate shouldbe given asSERVER_CERT
parameter in theaxis2.xml file. If youneed client authentication, you can also set the parameters in theaxis2.xmlfile to specify the client certificate, private key, and the passphraseforthe client private key. Parameter names for these are:
KEY_FILE
- certificate chain filecontaining the client'scertificate and the private key (Please refer to thecreating the client certificate chainfilesection)SSL_PASSPHRASE
- passphrase used to encryptthe private keyfile.
Example:
<parametername="SERVER_CERT">/path/to/ca/certificate</parameter>
<parametername="KEY_FILE">/path/to/client/certificate/chain/file</parameter>
<
parametername="SSL_
PASSPHRASE">passphrase</parameter>
For testing purposes, you can use the server's certificateinstead of theCA certificate. You can obtain this by running the commandopenssls_client -connect <servername>:<port>
and copying theportion of the output bounded by and including:
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
On Linux, if you run the following piece of code, the servercertificatewill be saved to a filecert.pem
:
echo |\
openssl s_client -connect <servername>:<port> 2>&1 |\
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > cert.pem
Here we will only look at the configuration of the Apache HTTPWeb server.Refer to the 'Deploying with ApacheHTTP Server Version2.x' section for information on deployingAxis2/C as an Apachemodule.
For more detailed information on SSL configuration, pleaserefer toApache2SSL/TLSdocumentation.
In thehttpd.conf
file, add thefollowing configurationstatements (in addition to other necessary configuration):
SSLEngine on
SSLCertificateFile /path/to/server/certificate/file
SSLCertificateKeyFile /path/to/private/key/file
SSLCACertificateFile /path/to/CA/certificate/file
SSLVerifyClient require
SSLVerifyDepth 1
When using a proxy, there are two methods for specifying proxysettings:
When using proxy authentication, there are three methods forspecifying proxyauthentication settings:
<transportSender name="http">
<parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
<parameter name="PROXY" proxy_host="127.0.0.1" proxy_port="8080" proxy_username="" proxy_password="" locked="true"/>
</transportSender>
You can specify proxy authentication settings using thefollowing function with theservice client:
axis2_svc_client_set_proxy_with_auth(axis2_svc_client_t *svc_client,
const axutil_env_t *env,
axis2_char_t *proxy_host,
axis2_char_t *proxy_port,
axis2_char_t *username,
axis2_char_t *password);
You can specify proxy authentication settings using thefollowing function with theservice client options:
axis2_options_set_proxy_auth_info(
axis2_options_t * options,
const axutil_env_t * env,
const axis2_char_t * username,
const axis2_char_t * password,
const axis2_char_t * auth_type);
Inauth_type
, useBasicto force Basic Authentication orDigest to forceDigestAuthentication. Leave this field NULL if you are not forcingauthentication.
You can also predetermine whether proxy authentication isrequired. This can be done by calling the function below:
axis2_options_set_test_proxy_auth(
axis2_options_t * options,
const axutil_env_t * env,
const axis2_bool_t test_proxy_auth);
Settest_proxy_auth
toAXIS2_TRUE
to enable testing.When testing is enabled, the request will be sentwithout without adding authentication information. If it fails, andrequests Authentication Information, the request type of authenticationwill be saved. This information can be obtained in the following manner:
axis2_svc_client_get_auth_type(
const axis2_svc_client_t * svc_client,
const axutil_env_t * env);
This will return eitherBasic,DigestorNULL according to the type of authentiationrequested. In addition to that, after each request made through theservice client, you can check whether authentication was required.
axis2_svc_client_get_proxy_auth_required(
const axis2_svc_client_t * svc_client,
const axutil_env_t * env);
Please take a look at theecho_blocking_auth
sample for more information on how to use these methods to identifyproxy Authentication requirements.
When using HTTP authentication, there are two methods forspecifying proxyauthentication settings:
<transportSender name="http">
<parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
<parameter name="HTTP-Authentication" username="your username" password="your password" locked="true"/>
</transportSender>
You can specify HTTP authentication settings using thefollowing function with theservice client options:
axis2_options_set_http_auth_info(
axis2_options_t * options,
const axutil_env_t * env,
const axis2_char_t * username,
const axis2_char_t * password,
const axis2_char_t * auth_type);
Inauth_type
, useBasicto force HTTP Basic Authentication orDigest toforce HTTP DigestAuthentication. Leave this field NULL if you are not forcingauthentication.
You can also predetermine whether HTTP authentication isrequired. This can be done by calling the function below:
axis2_options_set_test_http_auth(
axis2_options_t * options,
const axutil_env_t * env,
const axis2_bool_t test_http_auth);
Settest_http_auth
toAXIS2_TRUE
to enable testing.When testing is enabled, the request will be sentwithout without adding authentication information. If it fails, andrequests Authentication Information, the request type of authenticationwill be saved. This information can be obtained in the following manner:
axis2_svc_client_get_auth_type(
const axis2_svc_client_t * svc_client,
const axutil_env_t * env);
This will return eitherBasic,DigestorNULL according to the type of authentiationrequested. In addition to that, after each request made through theservice client, you can check whether authentication was required.
axis2_svc_client_get_http_auth_required(
const axis2_svc_client_t * svc_client,
const axutil_env_t * env);
Please take a look at theecho_blocking_auth
sample for more information on how to use these methods to identifyHTTP Authentication requirements.
WSDL2C tool that comes with Axis2/Java supports the generationof Axis2/Cstubs and skeletons for WSDL files. This is a Java tool that can beused togenerate C code that works with Axis2/C API. You should useAxis2/JavaSVN revision 529533 or later revisions. You can download theAxis2/Javanightlybuild and use those binaries to generate code. Check out abasicguide on the Java tool.
Before you run the tool, make sure that all the .jar libraryfiles thatcome with Axis2/Java are added to the CLASSPATH environment variable.
The tool can be run with the following parameters and generatethe serviceskeleton and other required files with ADB (Axis Data Binding) support.
java org.apache.axis2.wsdl.WSDL2C -uri interoptestdoclitparameters.wsdl -ss -sd -d adb -u
To understand the meanings of the options used with the tool,please havea look at the Java tooldocumentation.
If you need an XML in/out programming model, you can justignore the databinding support. To generate code with no data binding support, justreplace-d adb -u
, that was used in a previouscommand, with-dnone
.
java org.apache.axis2.wsdl.WSDL2C -uri interoptestdoclitparameters.wsdl -ss -sd -d none
The WSDL file,interoptestdoclitparameters.wsdl
,used in theabove command examples can be found in<axis2_src_dir>/test/resourcesdirectory.
Once the code is generated, you have to implement the businesslogic forthe service. For this, locate the skeleton source file from thegeneratedfiles. To identify the locations where you can place your businesslogic inline with the operations defined in the WSDL file that you used togeneratecode, look for the comment lines:
/* Todo fill this with the necessary business logic */
You can also go through the generated header files andunderstand the API inline with the WSDL file that you used to generate the code.
The WSDL2C code generator tool provides support for generatingclientstubs as well. You can generate the required stubs from a given WSDLwith theother supporting files. Use following parameters to generate theAxis2/Cclient stub code with ADB support.
java WSDL2C -uri interoptestdoclitparameters.wsdl -d adb -u
In order to ignore the data binding support and use a raw XMLin/outmodel, just use the following parameters.
java WSDL2C -uri interoptestdoclitparameters.wsdl -d none
Like in the case of service skeletons, you have to fill in thebusinesslogic as required in the client stubs as well. To do this, go throughtheheader files generated and understand the API in line with the WSDLfile thatyou used to generate the code.
This section will guide you through installing Axis2C with tcpenabled, and this also includes how to test it by running samples.Please note that both the Server and the Client must be built with TCPenabled.
./configure --enable-tcp=yes
make
make install
libaxis2_tcp_sender.so
libaxis2_tcp_reciever.so
<transportSender name="tcp">
<parameter name="PROTOCOL" locked="false">TCP</parameter>
</transportSender>
configure.in
:WITH_TCP = 1
axis2_tcp_sender.dll
axis2_tcp_reciever.dll
<transportSender name="tcp">
<parameter name="PROTOCOL" locked="false">TCP</parameter>
</transportSender>
cd $AXIS2C_HOME/bin/
./axis2_tcp_server
cd %AXIS2C_HOME%\bin
axis2_tcp_server.exe
Synopsis :
axis2_tcp_server [-p PORT] [-t TIMEOUT] [-r REPO_PATH] [-l LOG_LEVEL] [-f LOG_FILE] [-s LOG_FILE_SIZE]
You can use the following options with simple axis TCP server.
-p PORT port number to use, default port is 9091
-r REPO_PATH repository path, default is ../
-t TIMEOUT socket read timeout, default is 30 seconds
-l LOG_LEVEL log level, available log levels:
0 - critical 1 - errors 2 - warnings
3 - information 4 - debug 5- user 6 - trace
Default log level is 4(debug).
-f LOG_FILE log file, default is $AXIS2C_HOME/logs/axis2.log
or axis2.log in current folder if AXIS2C_HOME not set
-s LOG_FILE_SIZE Maximum log file size in mega bytes, default maximum size is 1MB.
-h display the help screen.
Example :
axis2_tcp_server -l 3 -p 8080 -r $AXIS2C_HOME -f /dev/stderr
Synopsis :
axis2_tcp_server.exe [-p PORT] [-t TIMEOUT] [-r REPO_PATH] [-l LOG_LEVEL] [-f LOG_FILE] [-s LOG_FILE_SIZE]
You can use the following options with simple axis TCP server.
-p PORT port number to use, default port is 9091
-r REPO_PATH repository path, default is ../
-t TIMEOUT socket read timeout, default is 30 seconds
-l LOG_LEVEL log level, available log levels:
0 - critical 1 - errors 2 - warnings
3 - information 4 - debug 5- user 6 - trace
Default log level is 4(debug).
-f LOG_FILE log file, default is %AXIS2C_HOME%\logs\axis2.log
or axis2.log in current folder if AXIS2C_HOME not set
-s LOG_FILE_SIZE Maximum log file size in mega bytes, default maximum size is 1MB.
-h display the help screen.
Example :
axis2_tcp_server.exe -l 3 -p 8080 -r %AXIS2C_HOME% -f C:\logs\error.log
tcp://[service_hostname]:[service_port]/axis2/services/your_service_name
This section will guide you through installing Axis2C withAMQPenabled, and this also includes how to test it by running samples.Please note that both the Server and the Client must be built with AMQPenabled.
./configure --with-qpid=path/to/qpid home
make
make install
libaxis2_qmqp_sender.so
libaxis2_amqp_reciever.so
<transportReceiver name="amqp">
<parameter name="qpid_broker_ip" locked="false">127.0.0.1</parameter>
<parameter name="qpid_broker_port" locked="false">5672</parameter>
</transportReceiver>
<transportSender name="amqp"/>
$ cd ${QPID_HOME}/sbin
$ ./qpidd --data-dir ./
$ cd ${AXIS2C_HOME}/binYou should see the message
$ ./axis2_amqp_server
$ ./axis2_amqp_server -h
Simple Axis2 AMQP Server is the inbuilt AMQP server of Axis2/C.
Synopsis :
axis2_amqp_server [-i QPID_BROKER_IP] [-p QPID_BROKER_PORT] [-r REPO_PATH] [-l LOG_LEVEL] [-f LOG_FILE] [-s LOG_FILE_SIZE]
You can use the following options with simple axis AMQP server.
-i IP where the Qpid broker is running, default IP is 127.0.0.1
-p PORT port number the Qpid broker listens on, default port is 5672
-r REPO_PATH repository path, default is ../
-l LOG_LEVEL log level, available log levels:
0 - critical
1 - errors
2 - warnings
3 - information
4 - debug
5- user
6 - trace
Default log level is 4(debug).
-f LOG_FILE log file, default is $AXIS2C_HOME/logs/axis2.log or axis2.log in current folder if AXIS2C_HOME not set
-s LOG_FILE_SIZE Maximum log file size in mega bytes, default maximum size is 1MB.
-h display the help screen.
Example :
axis2_amqp_server -i 127.0.0.1 -p 5050 -r $AXIS2C_HOME -f /dev/stderr
Axis2/C supports two main deployment models,
Also, it is requirement that you have zlib. Most Linux systemsdo have zlib by default, but would require zlib development packages.More information can be foundhere.For MS Windows systems, you can download it fromhere.
Next, you will have to build Axis2/C enabling Archive BasedDeployment. On Linux, you need to set the--with-archive=[path_to_zlib_headers]
Example:
%./configure --with-archive=/usr/include/ --prefix=${AXIS2C_HOME}/deploy
%make
%make install
On MS Windows, setWITH_ARCHIVE = 1
in theconfigure.in
file and run thenmakeall
command. Please note that you have to specify thedirectory where you can find the zlib binary, for a MS Windows system.This can be done by setting theZLIB_BIN_DIR
in theconfigure.in
file.
Once you have successfully completed the installation, youwill have to deploy services as archives in order to make use of thisdeployment model. Please note that directory based deployment cancoexist with the archive based deployment model. Therefore, you canalternatively use either of the two.
You will merely have to add your existing service librariesand the services.xml file into an archive. For example, in order todeploy the sample echo service as an archive, you can zip the echofolder found in theAXIS2C_BIN_DIR/services
directory. You can optionally rename your zip file, to have the.aar
extension.
Please note that all such services deployed as archives shouldalso be placed inside theAXIS2C_BIN_DIR/services
directory. Now, when ever you start your Simple Axis2 Server, or anyAxis2/C module attached to any other server, your services deployed asarchives, will also get loaded.
Similar to services, you also can deploy modules as archives.You also can optionally rename your zip files to have the extension,.mar
as in service archives.
Your module archives must be placed in theAXIS2C_BIN_DIR/modules
directory.
Please note that there are a few known issues when runningarchive based deployment, mainly on Linux based systems.
TCPMon is a TCP Monitor tool provided by Axis2/C formonitoring payloads exchanged between client and server. If you areusing a source distribution, this may or may not be built for you bydefault. Thus, to get started, you may require building it from source.
On Linux
./configure --prefix=${AXIS2C_HOME} --enable-tests=no
make
On MS Windows
nmake tcpmon
Please note that in most Linux based installations, this willmost probably be built for you. Once you've done with the buildingprocess, you can find the executable at${AXIS2C_HOME}/bin/tools
on Linux, or at%AXIS2C_HOME%\bin\tools
on MSWindows.
By default, the TCPMon tool will listen on port9090
and reply to port8080
.The default target host will belocalhost
andtcpmon_traffic.log
will be the default log_file. If you want to change any of thesesettings run ./tcpmon -h
on Linux, ortcpmon.exe-h
on MS Windows for more information.
The TCPMon tool does depend on the Axis2/C Util, Axis2/C AXIOMand Axis2/C Parser libraries. Thus, if you want to use TCPMon tomonitor payloads in any other message transfer, independant of theAxis2/C engine, you will have to build those dependant libraries too.In addition to that, TCPMon does not depend on the Axis2/C Core andinstalling the Axis2/C engine is not always a pre-requisite to runTCPMon.
The axis2.xml file is the configuration file for Axis2/C. Ithas 6 toplevel elements. They areparameter, transportReceiver,transportSender,module, phaseOrder andmessageReceiver.The following sectionsdescribe these elements, their sub elements, element attributes,possiblevalues, and their purpose.
axisconfigis the root element of axis2.xmlfile.
Attribute | Possible Values |
---|---|
name | Axis2/C |
In Axis2/C, a parameter is a name value pair. Each and everytop levelparameter available in the axis2.xml (direct sub elements of the rootelement) will be stored as parameters asaxis2_conf
.Therefore,the top level parameters set in the configuration file can be accessedviatheaxis2_conf
instance in the running system.
Sub elements :- none
Attributes :- name, locked
Attribute | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
name | Name of the parameter. The table below shows possiblevalues of the name attribute and their description.
| |||||||||
locked | Indicates whether the parameter can be changed from thecode. Following are the possible values for the locked attribute.
|
This element specifies the transport receiver details in anIN-OUT messageexchange scenario. The users can change the transport receiver port astheywish.
Attributes :- name, class
Attribute | Description | Possible Values |
---|---|---|
name | Specifies which transport protocol is used | http (when using HTTP) |
class | Specifies the shared library which implements thetransport interface | Name of the shared library. Example:- On Linux if the value is given asfoothen shared library is libfoo.so. On MS Windows,foo.dll. |
Sub elements :- can have zero or more parameter elements.
The following table shows possible parameter values.
Attribute | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
name | Name of the parameter.
| |||||||||
locked | whether the parameter can be changed from the code
|
This element specifies the transport senders used to sendmessages.
Attributes :- name, class
Attribute | Description | Possible Values |
---|---|---|
name | Specifies which transport protocol is used when sendingmessages | http(when using http) |
class | Specifies the shared library which implements thetransport interface | Name of the shared library. Example:- On Linux if the value is given asfoothen the shared library is libfoo.so. On MS Windows,foo.dll. |
Sub elements : can have zero or more parameter elements.
The following table shows possible parameter values.
Attribute | Description | ||||||
---|---|---|---|---|---|---|---|
name | The name of the parameter.
| ||||||
locked | Indicates whether the parameter can be changed from thecode.
|
This element is optional. It is used when a particular moduleneeds to beengaged globally for every service deployed with Axis2/C.
Attributes | Description | Possible Values |
---|---|---|
ref | The name of the module which is to be engaged globally. | Name of the module. Example : addressing |
The order of phases in a particular execution chain has to beconfiguredusing phaseOrder element.
Attribute | Description | Possible Values |
---|---|---|
type | The flow to which the phase belongs | inflow outflow INfaultflow Outfaultflow |
A flow is a collection of handlers which is invoked for aparticularmessage. The types of flows are described below.
Flow | Description |
---|---|
inflow | Collection of handlers invoked for a message coming into the system. |
outflow | Collection of handlers invoked for a message going outof the system. |
INfaultflow | Collection of handlers invoked for an incoming faultmessage. |
Outfaultflow | Collection of handlers invoked for an outgoing faultmessage. |
Sub elements :phase: represents theavailable phases in theexecution chain
The system predefined phases cannot be changed.
The system predefined phases are,
Attribute | Description | Possible Values |
---|---|---|
name | Specifies the name of the phase | Transport, Dispatch, PreDispatch, PostDispatch,MessageOut User defined phases (can have a user defined name) |
Sub elements of phase element:handler
Attribute | Description | Possible Values |
---|---|---|
name | Specifies the handler name. Phase may contain zero ormore handlers. | Based on the handler name. Example: AddressingbasedDispatcher,RequestURIbaseddispatcher |
class | Specifies the shared library which implements thehandler | Name of the shared library. Example: On Linux, if the value is given asfoo,then the shared library is libfoo.so. On MS Windows,foo.dll. |
Attribute | Description | Possible Values |
---|---|---|
mep | Message Exchange Pattern | IN-OUT, IN-ONLY |
class | Specify the shared library which implements thetransport interface. If not specified, the Axis2/C default message receiveris used. | Name of the shared library. Example: On Linux, if the value is given asfoo,then the shared library is libfoo.so. On MS Windows,foo.dll. |
Configuration of a service is specified using a services.xml.Each serviceor service archive file needs to have a services.xml in order to be avalidservice. The following sections describe the elements of theservices.xmlfile.
If services.xml describes a single service, the root elementisservice. If it is describing a service group, thenthe root elementisserviceGroup. The serviceelement will be a childelement of serviceGroup if there are multiple services specified inservices.xml.
Attributes | Description | Possible Values |
---|---|---|
name | Name of the service or service group. | Depends on the service or the service group. Examples: echo, sg_math |
This is optional. This element can be used to describe theservice in ahuman readable format.
This is optional. Can be used to engage modules at servicelevel.
Attributes | Description | Possible Values |
---|---|---|
ref | Name of the module which is to be engaged for theservice | Name of the module which is to be engaged at servicelevel. |
The service element can have any number of parameters as subelements.
Attribute | Detail | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
| ||||||||||||
locked |
|
The operations of the service are specified using operationelements.
Attributes | Description | Possible Values |
---|---|---|
name | name of the operation | Example: echoString |
mep | message exchange pattern uri. This is defaulted to in-out MEP. For other MEPs, You need to specify the MEP. | Example: "http://www.w3.org/2004/08/wsdl/in-only" |
Sub elements ofoperation:parameterelements can bepresent as sub elements. Zero or more parameters may be present.
Attribute | Detail | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
|
Also, anoperation element can have oneor moreactionMapping element as sub elements.
Description | Possible Values |
---|---|
Action mapping or an alias to an operation | Example: echoString |
An operation specific message receiver is specified from this.This isoptional.
Attributes | Description | Possible Values |
---|---|---|
class | Shared library with the message receiver implementation | Name of the shared library. Example: On Linux, if the value is given asfoo,then the shared library is libfoo.so. On MS Windows,foo.dll. |
The module.xml file provides the configuration details for aparticularmodule in Axis2/C. The top level element ismodule.
Attributes | Description | Possible Values |
---|---|---|
name | Name of the module | Example- addressing |
class | Specifies the shared library which implements themodule. | Name of the shared library. Example- On Linux, if the value is given asfoo,then the shared library is libfoo.so. On MS Windows,foo.dll. |
Other elements are child elements ofmodule.
Any number of parameters can be present, depending on themodule.
Attributes | Description | Possible Values |
---|---|---|
name | Name of the parameter | Depends on the module |
locked | Indicates whether the parameter can be changed from thecode | true - cannot be changed false - can be changed |
Describes the behavior of the module. This element is optionaland has noattributes or sub elements.
Encapsulates details added to the in-flow by the module. Zeroor oneelement is possible and does not have any attributes.
Sub elements ofinflow :handler,contains details aboutthe module specific handlers added to a particular flow. Zero or morehandlers can be added.
Attributes | Description | Possible Values |
---|---|---|
name | Name of the handler | Depends on the handlers in the module. |
class | Specifies the shared library which implements thehandler | Name of the shared library. Example: On Linux, if the value is given asfoo,then the shared library is libfoo.so. On MS Windows,foo.dll. |
sub elements ofhandler :order,specifies where to puta handler in a particular phase.
Attribute | Description | Possible Values |
---|---|---|
phase | The name of the phase the handler belongs to | depends on the handler |
phaseLast | Indicates that the handler is the last handler of thephase | true |
phaseFirst | Indicates that the handler is the first handler of thephase. | true |
before | Handler should be invoked before the handler, which isspecified by the before handler | handler name |
after | Handler should be invoked after the handler, which isspecified by the after handler | handler name |
From the above attributes, phase is compulsory. Given belowarecombinations possible from the other four attributes.
Combination | Description |
---|---|
phaseLast | Indicates that the handler is the last handler of thephase |
phasefirst | Indicates that the handler is the first handler of thephase. |
before | Handler should be invoked before the handler, which isspecified by the before handler |
after | Handler should be invoked after the handler, which isspecified by the after handler |
before & after | Handler should be invoked before the handler specifiedby the before handler, and after the handler specified by the after handler. |
outflow,INfaultflow,OUTfaultflow elementshave the same syntax as that ofinflow.
This is used when a module wants to add operations to aservice thatengages the module.
Attributes | Description | Possible Values |
---|---|---|
name | Name of the operation (compulsory) | Depends on the module |
mep | Message Exchange Pattern | IN-OUT, IN-ONLY |
Sub elements ofoperation : Any numberof parameters can beincluded as sub elements in the operation element.
ThemessageReceiver parameter specifiesthe message receiver themessage is intended for. If it is not set, the default message receiverisused.
This section describes various types of options that can beset withaxis2_options
. These options are used by theservice clientbefore sending messages.
axis2_options_set_action(options, env, action)
Sets the WS-Addressing action that is to be set in theaddressing SOAPheaders.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct |
const axutil_env_t *env | Pointer to the environment struct |
const axis2_char_t *action | Pointer to the action string |
axis2_options_set_fault_to(options, env,fault_to)
Sets the end point reference which may receive the message ina case of aSOAP fault.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
axis2_endpoint_ref_t *fault_to | Pointer to the endpoint reference struct representingthe fault to address. |
axis2_options_set_from(options, env, from)
Some services need to know the source from which the messagecomes. Thisoption sets the from endpoint
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
axis2_endpoint_ref_t *from | Pointer to the endpoint reference struct representingthe from address. |
axis2_options_set_to(options, env, to)
Sets the endpoint reference the message is destined to.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
axis2_endpoint_ref_t *to | Pointer to the endpoint reference struct representingthe to address. |
axis2_options_set_transport_receiver(options,env,receiver)
Sets the transport receiver in an OUT-IN message exchangescenario.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
axis2_transport_receiver_t *receiver | Pointer to the transport receiver struct. |
axis2_options_set_transport_in(options, env,transport_in)
Sets the transport-in description.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
axis2_transport_in_desc_t *transport_in | Pointer to the transport_in struct. |
axis2_options_set_transport_in_protocol(options,env,transport_in_protocol)
Sets the transport-in protocol.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
const AXIS2_TRANSPORT_ENUMS transport_in_protocol | The value indicating the transport protocol. |
axis2_options_set_message_id(options, env,message_id)
Sets the message ID.
Parameter | Description |
---|---|
axis2_options_t *options | The pointer to the options struct. |
const axutil_env_t *env | The pointer to the environment struct. |
const axis2_char_t *message_id | The message ID string. |
axis2_options_set_properties(options, env,properties)
Sets the properties hash map.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
axis2_hash_t *properties | Pointer to the properties hash map. |
axis2_options_set_property(options, env, key,property)
Sets a property with a given key value.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
const axis2_char_t *property_key | The property key string. |
const void *property | Pointer to the property to be set. |
axis2_options_set_relates_to(options, env,relates_to)
Sets the relates-to message information.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
axis2_relates_to_t *relates_to | Pointer to the relates_to struct. |
axis2_options_set_reply_to(options, env,reply_to)
Sets the reply-to address, when the client wants a reply to besent to adifferent end point.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
axis2_endpoint_ref_t *reply_to | Pointer to the endpoint reference struct representingthe reply-to address. |
axis2_options_set_transport_out(options, env,transport_out)
Sets the transport-out description.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
axis2_transport_out_desc_t *transport_out | Pointer to the transport-out description struct. |
axis2_options_set_sender_transport(options, env,sender_transport,conf)
Sets the sender transport.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
const AXIS2_TRANSPORT_ENUMS sender_transport | The name of the sender transport to be set. |
axis2_conf_t *conf | Pointer to the conf struct. It is from the conf thatthe transport is picked with the given name. |
axis2_options_set_soap_version_uri(options, env,soap_version_uri)
Sets the SOAP version URI.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
const axis2_char_t *soap_version_uri | URI of the SOAP version to be set. |
axis2_options_set_timeout_in_milli_seconds(options,env,timeout_in_milli_seconds)
Sets the time out in milli seconds. This is used inasynchronous messageexchange scenarios to specify how long the call back object is to waitforthe response.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
const long timeout_in_milli_seconds | Timeout in milli seconds. |
axis2_options_set_transport_info(options, env,sender_transport,receiver_transport, user_separate_listener)
Sets the transport information. Transport information includesthe name ofthe sender transport, name of the receiver transport, and whether aseparatelistener is to be used to receive a response.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
const AXIS2_TRANSPORT_ENUMS sender_transport | Name of the sender transport to be used. |
const AXIS2_TRANSPORT_ENUMS receiver_transport | Name of the receiver transport to be used. |
const axis2_bool_t use_separate_listener | bool value indicating whether to use a separatelistener or not. |
axis2_options_set_use_separate_listener(options,env,use_separate_listener)
Sets the bool value indicating whether to use a separatelistener or not.A separate listener is used when the transport is a one-way transportand themessage exchange pattern is two way.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
const axis2_bool_t use_separate_listener | bool value indicating whether to use a separatelistener or not |
axis2_options_set_soap_version(options, env,soap_version)
Sets the SOAP version.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
const int soap_version | SOAP version, either AXIOM_SOAP11 or AXIOM_SOAP12. |
axis2_options_set_enable_mtom(options, env,enable_mtom)
Enable or disable MTOM handling when sending binaryattachments.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
axis2_bool_t enable_mtom | AXIS2_TRUE if MTOM is to be enabled, else AXIS2_FALSE |
axis2_options_set_enable_rest(options, env,enable_rest)
Enable or disable REST support.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
axis2_bool_t enable_rest | AXIS2_TRUE if REST is to be enabled, else AXIS2_FALSE |
axis2_options_set_http_auth_info(options, env,username, password, auth_type)
Sets HTTP Authentication information.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
const axis2_char_t *username | String representing username |
const axis2_char_t *password | String representing password. |
const axis2_char_t *auth_type | use "Basic" to force basic authentication and "Digest"to force digest authentication or NULL for not forcing authentication |
axis2_options_set_proxy_auth_info(options, env,username, password, auth_type)
Sets Proxy Authentication information.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
const axis2_char_t *username | String representing username |
const axis2_char_t *password | String representing password. |
const axis2_char_t *auth_type | use "Basic" to force basic authentication and "Digest"to force digest authentication or NULL for not forcing authentication |
axis2_options_set_test_http_auth(options, env,test_http_auth)
Enables testing of HTTP Authentication information.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
const axis2_bool_t test_http_auth | bool value indicating whether to test or not,AXIS2_TRUE to enable, AXIS2_FALSE to disable |
axis2_options_set_test_proxy_auth(options, env,test_proxy_auth)
Enables testing of proxy Authentication information.
Parameter | Description |
---|---|
axis2_options_t *options | Pointer to the options struct. |
const axutil_env_t *env | Pointer to the environment struct. |
const axis2_bool_t test_proxy_auth | bool value indicating whether to test or not,AXIS2_TRUE to enable, AXIS2_FALSE to disable |