|
|
Axis 2 example source code file (CADBBeanTemplateHeader.xsl)
This example Axis 2 source code file (CADBBeanTemplateHeader.xsl) is included in the DevDaily.com
"Java Source Code
Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.
The Axis 2 CADBBeanTemplateHeader.xsl source code
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<!-- cater for the multiple classes - wrappped mode -->
<xsl:template match="/classs">
<xsl:variable name="name">
<xsl:variable name="axis2_name">adb_
<xsl:variable name="caps_axis2_name">ADB_
#ifndef <xsl:value-of select="$caps_axis2_name"/>_H
#define <xsl:value-of select="$caps_axis2_name"/>_H
/**
* <xsl:value-of select="$axis2_name"/>.h
*
* This file was auto-generated from WSDL
* by the Apache Axis2 Java version: #axisVersion# #today#
*/
<xsl:for-each select="property">
<xsl:if test="@ours">
<xsl:variable name="propertyType">adb_
#include "<xsl:value-of select="$propertyType"/>.h"
</xsl:if>
</xsl:for-each>
#include <stdio.h>
#include <axiom.h>
#include <axis2_util.h>
#include <axiom_soap.h>
#include <axis2_client.h>
#ifdef __cplusplus
extern "C"
{
#endif
#define AXIS2_DEFAULT_DIGIT_LIMIT 128
/**
* <xsl:value-of select="$axis2_name"/> wrapped class classes ( structure for C )
*/
<xsl:apply-templates/>
#ifdef __cplusplus
}
#endif
#endif /* <xsl:value-of select="$caps_axis2_name"/>_H */
</xsl:template>
<!--cater for the multiple classes - unwrappped mode -->
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="class">
<xsl:variable name="name">
<xsl:variable name="axis2_name">adb_
<xsl:variable name="caps_axis2_name">ADB_
#ifndef <xsl:value-of select="$caps_axis2_name"/>_H
#define <xsl:value-of select="$caps_axis2_name"/>_H
/**
* <xsl:value-of select="$axis2_name"/>.h
*
* This file was auto-generated from WSDL
* by the Apache Axis2 version: #axisVersion# #today#
*/
<xsl:for-each select="property">
<xsl:if test="@ours">
<xsl:variable name="propertyType">adb_
#include "<xsl:value-of select="$propertyType"/>.h"
</xsl:if>
</xsl:for-each>
<!--include special headers-->
<xsl:if test="property/@type='axutil_date_time_t*'">
#include <axutil_date_time.h>
</xsl:if>
<xsl:if test="property/@type='axutil_base64_binary_t*'">
#include <axutil_base64_binary.h>
</xsl:if>
#include <stdio.h>
#include <axiom.h>
#include <axutil_utils.h>
#include <axiom_soap.h>
#include <axis2_client.h>
#ifdef __cplusplus
extern "C"
{
#endif
#define AXIS2_DEFAULT_DIGIT_LIMIT 64
/**
* <xsl:value-of select="$axis2_name"/> class class
*/
typedef struct <xsl:value-of select="$axis2_name"/> _t;
AXIS2_EXTERN <xsl:value-of select="$axis2_name"/>_t* AXIS2_CALL
<xsl:value-of select="$axis2_name"/>_create(
const axutil_env_t *env );
axis2_status_t AXIS2_CALL
<xsl:value-of select="$axis2_name"/>_free (
<xsl:value-of select="$axis2_name"/>_t* _,
const axutil_env_t *env);
<xsl:if test="not(@type)">
axutil_qname_t* AXIS2_CALL
<xsl:value-of select="$axis2_name"/>_get_qname (
<xsl:value-of select="$axis2_name"/>_t* _,
const axutil_env_t *env);
</xsl:if>
axiom_node_t* AXIS2_CALL
<xsl:value-of select="$axis2_name"/>_serialize(
<xsl:value-of select="$axis2_name"/>_t* _,
const axutil_env_t *env,
axiom_node_t* <xsl:value-of select="$name"/>_om_node, int has_parent);
axis2_status_t AXIS2_CALL
<xsl:value-of select="$axis2_name"/>_deserialize(
<xsl:value-of select="$axis2_name"/>_t* _,
const axutil_env_t *env, axiom_node_t* parent);
<xsl:for-each select="property">
<xsl:variable name="propertyType">
<xsl:choose>
<xsl:when test="@isarray">axutil_array_list_t*
<xsl:when test="not(@type)">axiom_node_t*
<xsl:when test="@ours">
<xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
adb_<xsl:value-of select="@type"/>_t*
<xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">axutil__t*
<xsl:otherwise>
axis2_<xsl:value-of select="@type"/>_t*
</xsl:choose>
</xsl:when>
<xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="propertyName">
<xsl:variable name="CName">
/**
* getter for <xsl:value-of select="$propertyName"/>.
*/
<xsl:value-of select="$propertyType"/> AXIS2_CALL
<xsl:value-of select="$axis2_name"/>_get_(
<xsl:value-of select="$axis2_name"/>_t* _,
const axutil_env_t *env);
/**
* setter for <xsl:value-of select="$propertyName"/>
*/
axis2_status_t AXIS2_CALL
<xsl:value-of select="$axis2_name"/>_set_(
<xsl:value-of select="$axis2_name"/>_t* _,
const axutil_env_t *env,
<xsl:value-of select="$propertyType"/> param_);
<xsl:if test="@isarray">
/**
* resetter for <xsl:value-of select="$propertyName"/>
*/
axis2_status_t AXIS2_CALL
<xsl:value-of select="$axis2_name"/>_reset_(
<xsl:value-of select="$axis2_name"/>_t* _,
const axutil_env_t *env);
</xsl:if>
</xsl:for-each>
#ifdef __cplusplus
}
#endif
#endif /* <xsl:value-of select="$caps_axis2_name"/>_H */
</xsl:template>
</xsl:stylesheet>
Other Axis 2 examples (source code examples)
Here is a short list of links related to this Axis 2 CADBBeanTemplateHeader.xsl source code file:
|