You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2006/12/20 13:23:42 UTC
svn commit: r489066 [6/24] - in
/webservices/axis2/branches/java/1_1/modules: adb-codegen/
adb-codegen/src/org/apache/axis2/schema/
adb-codegen/src/org/apache/axis2/schema/i18n/
adb-codegen/src/org/apache/axis2/schema/template/ adb-codegen/test-resourc...
Modified: webservices/axis2/branches/java/1_1/modules/codegen/other/MappingFile.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/other/MappingFile.xsd?view=diff&rev=489066&r1=489065&r2=489066
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/other/MappingFile.xsd (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/other/MappingFile.xsd Wed Dec 20 04:23:24 2006
@@ -1,4 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
<!-- edited with XMLSpy v2006 sp2 U (http://www.altova.com) by Ajith Harshana Ranabahu (W3C) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="mappings">
Modified: webservices/axis2/branches/java/1_1/modules/codegen/other/beanGenerationSchema.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/other/beanGenerationSchema.xsd?view=diff&rev=489066&r1=489065&r2=489066
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/other/beanGenerationSchema.xsd (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/other/beanGenerationSchema.xsd Wed Dec 20 04:23:24 2006
@@ -1,4 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
<!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Ajith Harshana Ranabahu (WSO2/Development) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
Modified: webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties?view=diff&rev=489066&r1=489065&r2=489066
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties Wed Dec 20 04:23:24 2006
@@ -1,3 +1,18 @@
+# -------------------------------------------------------------------
+# Copyright 2001-2004 The Apache Software Foundation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -------------------------------------------------------------------
#######################################################################################################################
##################### code generator property file #################################################################
#######################################################################################################################
Modified: webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/schema/soap-enc.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/schema/soap-enc.xsd?view=diff&rev=489066&r1=489065&r2=489066
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/schema/soap-enc.xsd (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/schema/soap-enc.xsd Wed Dec 20 04:23:24 2006
@@ -1,5 +1,21 @@
<?xml version='1.0' encoding='UTF-8' ?>
-
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
<!-- Schema for the SOAP/1.1 encoding
This schema has been produced using W3C's SOAP Version 1.2 schema
Modified: webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/schema/xmime.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/schema/xmime.xsd?view=diff&rev=489066&r1=489065&r2=489066
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/schema/xmime.xsd (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/codegen/schema/xmime.xsd Wed Dec 20 04:23:24 2006
@@ -1,4 +1,20 @@
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ --><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.w3.org/2004/06/xmlmime"
targetNamespace="http://www.w3.org/2004/06/xmlmime" >
<xs:attribute name="contentType" >
Modified: webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties?view=diff&rev=489066&r1=489065&r2=489066
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties Wed Dec 20 04:23:24 2006
@@ -1,3 +1,18 @@
+# -------------------------------------------------------------------
+# Copyright 2001-2004 The Apache Software Foundation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -------------------------------------------------------------------
# Translation instructions.
# 1. Each message line is of the form key=value.
# Translate the value, DO NOT translate the key.
Modified: webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl?view=diff&rev=489066&r1=489065&r2=489066
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceSkeleton.xsl Wed Dec 20 04:23:24 2006
@@ -1,264 +1,280 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="text"/>
-
- <!--Template for in out message receiver -->
- <xsl:template match="/interface">
- <xsl:variable name="skeletonname"><xsl:value-of select="@name"/></xsl:variable>
- <xsl:variable name="qname"><xsl:value-of select="@qname"/></xsl:variable>
- <xsl:variable name="method-prefix"><xsl:value-of select="@prefix"/></xsl:variable>
- <xsl:variable name="svcop-prefix"><xsl:value-of select="@svcop_prefix"/></xsl:variable>
- <xsl:variable name="svcname"><xsl:value-of select="@svcname"/></xsl:variable>
- <xsl:variable name="soapVersion"><xsl:value-of select="@soap-version"/></xsl:variable>
-
- /**
- * <xsl:value-of select="@name"/>.c
- *
- * This file was auto-generated from WSDL for "<xsl:value-of select="$qname"/>" service
- * by the Apache Axis2 version: #axisVersion# #today#
- * <xsl:value-of select="$skeletonname"/>
- */
-
- #include "<xsl:value-of select="$svcop-prefix"/>.h"
- #include <axis2_svc_skeleton.h>
- #include <axis2_array_list.h>
- #include <stdio.h>
-
- /**
- * functions prototypes
- */
-
- /* On fault, handle the fault */
- axiom_node_t* AXIS2_CALL
- <xsl:value-of select="$method-prefix"/>_on_fault(axis2_svc_skeleton_t *svc_skeleton,
- const axis2_env_t *env, axiom_node_t *node);
-
- /* Free the service */
- int AXIS2_CALL
- <xsl:value-of select="$method-prefix"/>_free(axis2_svc_skeleton_t *svc_skeleton,
- const axis2_env_t *env);
-
- /* This method invokes the right service method */
- axiom_node_t* AXIS2_CALL
- <xsl:value-of select="$method-prefix"/>_invoke(axis2_svc_skeleton_t *svc_skeleton,
- const axis2_env_t *env,
- axiom_node_t *node,
- axis2_msg_ctx_t *msg_ctx);
-
- /* Initializing the environment */
- int AXIS2_CALL
- <xsl:value-of select="$method-prefix"/>_init(axis2_svc_skeleton_t *svc_skeleton,
- const axis2_env_t *env);
-
- /* Create the service */
- axis2_svc_skeleton_t* AXIS2_CALL
- <xsl:value-of select="$method-prefix"/>_create(const axis2_env_t *env);
-
- /**
- * Implementations for the functions
- */
-
- axis2_svc_skeleton_t* AXIS2_CALL
- <xsl:value-of select="$method-prefix"/>_create(const axis2_env_t *env)
- {
- axis2_svc_skeleton_t *svc_skeleton = NULL;
- svc_skeleton = AXIS2_MALLOC(env->allocator,
- sizeof(axis2_svc_skeleton_t));
-
-
- svc_skeleton->ops = AXIS2_MALLOC(
- env->allocator, sizeof(axis2_svc_skeleton_ops_t));
-
- svc_skeleton->func_array = NULL;
-
- svc_skeleton->ops->free = <xsl:value-of select="$method-prefix"/>_free;
- svc_skeleton->ops->init = <xsl:value-of select="$method-prefix"/>_init;
- svc_skeleton->ops->invoke = <xsl:value-of select="$method-prefix"/>_invoke;
- svc_skeleton->ops->on_fault = <xsl:value-of select="$method-prefix"/>_on_fault;
-
- return svc_skeleton;
- }
-
-
- int AXIS2_CALL
- <xsl:value-of select="$method-prefix"/>_init(axis2_svc_skeleton_t *svc_skeleton,
- const axis2_env_t *env)
- {
- svc_skeleton->func_array = axis2_array_list_create(env, 10);
- <xsl:for-each select="method">
- AXIS2_ARRAY_LIST_ADD(svc_skeleton->func_array, env, "<xsl:value-of select="@localpart"/>");
- </xsl:for-each>
-
- /* Any initialization stuff of <xsl:value-of select="$svcname"/> goes here */
- return AXIS2_SUCCESS;
- }
-
- int AXIS2_CALL
- <xsl:value-of select="$method-prefix"/>_free(axis2_svc_skeleton_t *svc_skeleton,
- const axis2_env_t *env)
- {
- if(svc_skeleton->func_array)
- {
- AXIS2_ARRAY_LIST_FREE(svc_skeleton->func_array, env);
- svc_skeleton->func_array = NULL;
- }
-
- if(svc_skeleton->ops)
- {
- AXIS2_FREE(env->allocator, svc_skeleton->ops);
- svc_skeleton->ops = NULL;
- }
-
- if(svc_skeleton)
- {
- AXIS2_FREE(env->allocator, svc_skeleton);
- svc_skeleton = NULL;
- }
- return AXIS2_SUCCESS;
- }
-
-
- /*
- * This method invokes the right service method
- */
- axiom_node_t* AXIS2_CALL
- <xsl:value-of select="$method-prefix"/>_invoke(axis2_svc_skeleton_t *svc_skeleton,
- const axis2_env_t *env,
- axiom_node_t *content_node,
- axis2_msg_ctx_t *msg_ctx)
- {
- /* depending on the function name invoke the
- * corresponding method
- */
-
- axiom_element_t *element = NULL;
- axiom_node_t *ret_node = NULL;
-
- <xsl:for-each select="method">
- <xsl:text>
- </xsl:text>
- <xsl:variable name="position"><xsl:value-of select="position()"/></xsl:variable>
- <xsl:variable name="outputtype">
- <xsl:choose>
- <xsl:when test="output/param/@ours">axis2_<xsl:value-of select="output/param/@type"></xsl:value-of>_t*</xsl:when>
- <xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$outputtype"/> ret_val<xsl:value-of select="$position"/><xsl:if test="output/param/@ours"> = NULL</xsl:if>;
- <xsl:for-each select="input/param[@type!='']">
- <xsl:variable name="inputtype">
- <xsl:if test="@ours">axis2_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if>
- </xsl:variable>
- <xsl:value-of select="$inputtype"/> input_val<xsl:value-of select="$position"/>_<xsl:value-of select="position()"/><xsl:if test="input/param/@ours"> = NULL</xsl:if>;
- </xsl:for-each>
- </xsl:for-each>
- if (content_node)
- {
- if (AXIOM_NODE_GET_NODE_TYPE(content_node, env) == AXIOM_ELEMENT)
- {
- element = (axiom_element_t *)AXIOM_NODE_GET_DATA_ELEMENT(content_node, env);
- if (element)
- {
- axis2_char_t *op_name = AXIOM_ELEMENT_GET_LOCALNAME(element, env);
- if (op_name)
- {
- <xsl:for-each select="method">
- <xsl:variable name="position"><xsl:value-of select="position()"/></xsl:variable>
- <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
- <xsl:variable name="method-name"><xsl:value-of select="@name"/></xsl:variable>
- <xsl:variable name="method-ns"><xsl:value-of select="@namespace"/> </xsl:variable>
- <xsl:variable name="outputCapsType"><xsl:value-of select="@output/param/@caps-type"/> </xsl:variable>
- <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"/></xsl:variable>
-
- if ( AXIS2_STRCMP(op_name, "<xsl:value-of select="@localpart"/>") == 0 )
- {
- <xsl:for-each select="input/param[@type!='']">
- input_val<xsl:value-of select="$position"/>_<xsl:value-of select="position()"/> = <xsl:choose>
- <xsl:when test="@ours">
- axis2_<xsl:value-of select="@type"/>_create( env);
- AXIS2_<xsl:value-of select="@caps-type"/>_BUILD_OM(input_val<xsl:value-of select="$position"/>_<xsl:value-of select="position()"/>, env, content_node );
- </xsl:when>
- <xsl:otherwise>content_node;</xsl:otherwise>
- </xsl:choose>
- ret_val<xsl:value-of select="$position"/> = <xsl:value-of select="$svcop-prefix"/>_<xsl:value-of select="$method-name"/>(env,
- input_val<xsl:value-of select="$position"/>_<xsl:value-of select="position()"/> );
- if ( NULL == ret_val<xsl:value-of select="$position"/> )
- {
- AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from <xsl:value-of select="$method-name"/> "
- " %d :: %s", env->error->error_number,
- AXIS2_ERROR_GET_MESSAGE(env->error));
- return <xsl:value-of select="$method-prefix"/>_on_fault( svc_skeleton, env, NULL);
- }
- ret_node = <xsl:choose>
- <xsl:when test="@ours">
- AXIS2_<xsl:value-of select="@caps-type"/>_PARSE_OM(ret_val<xsl:value-of select="$position"/>, env, NULL );
- </xsl:when>
- <xsl:otherwise>ret_val<xsl:value-of select="$position"/>;</xsl:otherwise>
- </xsl:choose>
- return ret_node;
- </xsl:for-each>
-
- <!-- below was prior to the databinding -->
- <!-- <xsl:if test="$outputtype!=''">return </xsl:if>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$svcop-prefix"/>_<xsl:value-of select="$method-name"/>(env <xsl:for-each select="input/param[@type!='']"> ,
- content_node </xsl:for-each>);
- <xsl:if test="$outputtype=''">return NULL;</xsl:if> -->
-
- }
- </xsl:for-each>
- }
- }
- }
- }
- printf("<xsl:value-of select="$skeletonname"/> service ERROR: invalid OM parameters in request\n");
- return content_node;
- }
-
- axiom_node_t* AXIS2_CALL
- <xsl:value-of select="$method-prefix"/>_on_fault(axis2_svc_skeleton_t *svc_skeleton,
- const axis2_env_t *env, axiom_node_t *node)
- {
- axiom_node_t *error_node = NULL;
- axiom_element_t *error_ele = NULL;
- error_ele = axiom_element_create(env, node, "fault", NULL,
- &error_node);
- AXIOM_ELEMENT_SET_TEXT(error_ele, env, "<xsl:value-of select="$qname"/> failed",
- error_node);
- return error_node;
- }
-
-
- /**
- * Following block distinguish the exposed part of the dll.
- */
-
- AXIS2_EXTERN int AXIS2_CALL
- axis2_get_instance(struct axis2_svc_skeleton **inst,
- const axis2_env_t *env)
- {
- *inst = <xsl:value-of select="$method-prefix"/>_create(env);
-
- if(!(*inst))
- {
- return AXIS2_FAILURE;
- }
-
- return AXIS2_SUCCESS;
- }
-
- AXIS2_EXTERN int AXIS2_CALL
- axis2_remove_instance(axis2_svc_skeleton_t *inst,
- const axis2_env_t *env)
- {
- axis2_status_t status = AXIS2_FAILURE;
- if (inst)
- {
- status = AXIS2_SVC_SKELETON_FREE(inst, env);
- }
- return status;
- }
-
-
- </xsl:template>
-
-</xsl:stylesheet>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ --><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="text"/>
+
+ <!--Template for in out message receiver -->
+ <xsl:template match="/interface">
+ <xsl:variable name="skeletonname"><xsl:value-of select="@name"/></xsl:variable>
+ <xsl:variable name="qname"><xsl:value-of select="@qname"/></xsl:variable>
+ <xsl:variable name="method-prefix"><xsl:value-of select="@prefix"/></xsl:variable>
+ <xsl:variable name="svcop-prefix"><xsl:value-of select="@svcop_prefix"/></xsl:variable>
+ <xsl:variable name="svcname"><xsl:value-of select="@svcname"/></xsl:variable>
+ <xsl:variable name="soapVersion"><xsl:value-of select="@soap-version"/></xsl:variable>
+
+ /**
+ * <xsl:value-of select="@name"/>.c
+ *
+ * This file was auto-generated from WSDL for "<xsl:value-of select="$qname"/>" service
+ * by the Apache Axis2 version: #axisVersion# #today#
+ * <xsl:value-of select="$skeletonname"/>
+ */
+
+ #include "<xsl:value-of select="$svcop-prefix"/>.h"
+ #include <axis2_svc_skeleton.h>
+ #include <axis2_array_list.h>
+ #include <stdio.h>
+
+ /**
+ * functions prototypes
+ */
+
+ /* On fault, handle the fault */
+ axiom_node_t* AXIS2_CALL
+ <xsl:value-of select="$method-prefix"/>_on_fault(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env, axiom_node_t *node);
+
+ /* Free the service */
+ int AXIS2_CALL
+ <xsl:value-of select="$method-prefix"/>_free(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env);
+
+ /* This method invokes the right service method */
+ axiom_node_t* AXIS2_CALL
+ <xsl:value-of select="$method-prefix"/>_invoke(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env,
+ axiom_node_t *node,
+ axis2_msg_ctx_t *msg_ctx);
+
+ /* Initializing the environment */
+ int AXIS2_CALL
+ <xsl:value-of select="$method-prefix"/>_init(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env);
+
+ /* Create the service */
+ axis2_svc_skeleton_t* AXIS2_CALL
+ <xsl:value-of select="$method-prefix"/>_create(const axis2_env_t *env);
+
+ /**
+ * Implementations for the functions
+ */
+
+ axis2_svc_skeleton_t* AXIS2_CALL
+ <xsl:value-of select="$method-prefix"/>_create(const axis2_env_t *env)
+ {
+ axis2_svc_skeleton_t *svc_skeleton = NULL;
+ svc_skeleton = AXIS2_MALLOC(env->allocator,
+ sizeof(axis2_svc_skeleton_t));
+
+
+ svc_skeleton->ops = AXIS2_MALLOC(
+ env->allocator, sizeof(axis2_svc_skeleton_ops_t));
+
+ svc_skeleton->func_array = NULL;
+
+ svc_skeleton->ops->free = <xsl:value-of select="$method-prefix"/>_free;
+ svc_skeleton->ops->init = <xsl:value-of select="$method-prefix"/>_init;
+ svc_skeleton->ops->invoke = <xsl:value-of select="$method-prefix"/>_invoke;
+ svc_skeleton->ops->on_fault = <xsl:value-of select="$method-prefix"/>_on_fault;
+
+ return svc_skeleton;
+ }
+
+
+ int AXIS2_CALL
+ <xsl:value-of select="$method-prefix"/>_init(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env)
+ {
+ svc_skeleton->func_array = axis2_array_list_create(env, 10);
+ <xsl:for-each select="method">
+ AXIS2_ARRAY_LIST_ADD(svc_skeleton->func_array, env, "<xsl:value-of select="@localpart"/>");
+ </xsl:for-each>
+
+ /* Any initialization stuff of <xsl:value-of select="$svcname"/> goes here */
+ return AXIS2_SUCCESS;
+ }
+
+ int AXIS2_CALL
+ <xsl:value-of select="$method-prefix"/>_free(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env)
+ {
+ if(svc_skeleton->func_array)
+ {
+ AXIS2_ARRAY_LIST_FREE(svc_skeleton->func_array, env);
+ svc_skeleton->func_array = NULL;
+ }
+
+ if(svc_skeleton->ops)
+ {
+ AXIS2_FREE(env->allocator, svc_skeleton->ops);
+ svc_skeleton->ops = NULL;
+ }
+
+ if(svc_skeleton)
+ {
+ AXIS2_FREE(env->allocator, svc_skeleton);
+ svc_skeleton = NULL;
+ }
+ return AXIS2_SUCCESS;
+ }
+
+
+ /*
+ * This method invokes the right service method
+ */
+ axiom_node_t* AXIS2_CALL
+ <xsl:value-of select="$method-prefix"/>_invoke(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env,
+ axiom_node_t *content_node,
+ axis2_msg_ctx_t *msg_ctx)
+ {
+ /* depending on the function name invoke the
+ * corresponding method
+ */
+
+ axiom_element_t *element = NULL;
+ axiom_node_t *ret_node = NULL;
+
+ <xsl:for-each select="method">
+ <xsl:text>
+ </xsl:text>
+ <xsl:variable name="position"><xsl:value-of select="position()"/></xsl:variable>
+ <xsl:variable name="outputtype">
+ <xsl:choose>
+ <xsl:when test="output/param/@ours">axis2_<xsl:value-of select="output/param/@type"></xsl:value-of>_t*</xsl:when>
+ <xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="$outputtype"/> ret_val<xsl:value-of select="$position"/><xsl:if test="output/param/@ours"> = NULL</xsl:if>;
+ <xsl:for-each select="input/param[@type!='']">
+ <xsl:variable name="inputtype">
+ <xsl:if test="@ours">axis2_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if>
+ </xsl:variable>
+ <xsl:value-of select="$inputtype"/> input_val<xsl:value-of select="$position"/>_<xsl:value-of select="position()"/><xsl:if test="input/param/@ours"> = NULL</xsl:if>;
+ </xsl:for-each>
+ </xsl:for-each>
+ if (content_node)
+ {
+ if (AXIOM_NODE_GET_NODE_TYPE(content_node, env) == AXIOM_ELEMENT)
+ {
+ element = (axiom_element_t *)AXIOM_NODE_GET_DATA_ELEMENT(content_node, env);
+ if (element)
+ {
+ axis2_char_t *op_name = AXIOM_ELEMENT_GET_LOCALNAME(element, env);
+ if (op_name)
+ {
+ <xsl:for-each select="method">
+ <xsl:variable name="position"><xsl:value-of select="position()"/></xsl:variable>
+ <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
+ <xsl:variable name="method-name"><xsl:value-of select="@name"/></xsl:variable>
+ <xsl:variable name="method-ns"><xsl:value-of select="@namespace"/> </xsl:variable>
+ <xsl:variable name="outputCapsType"><xsl:value-of select="@output/param/@caps-type"/> </xsl:variable>
+ <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"/></xsl:variable>
+
+ if ( AXIS2_STRCMP(op_name, "<xsl:value-of select="@localpart"/>") == 0 )
+ {
+ <xsl:for-each select="input/param[@type!='']">
+ input_val<xsl:value-of select="$position"/>_<xsl:value-of select="position()"/> = <xsl:choose>
+ <xsl:when test="@ours">
+ axis2_<xsl:value-of select="@type"/>_create( env);
+ AXIS2_<xsl:value-of select="@caps-type"/>_BUILD_OM(input_val<xsl:value-of select="$position"/>_<xsl:value-of select="position()"/>, env, content_node );
+ </xsl:when>
+ <xsl:otherwise>content_node;</xsl:otherwise>
+ </xsl:choose>
+ ret_val<xsl:value-of select="$position"/> = <xsl:value-of select="$svcop-prefix"/>_<xsl:value-of select="$method-name"/>(env,
+ input_val<xsl:value-of select="$position"/>_<xsl:value-of select="position()"/> );
+ if ( NULL == ret_val<xsl:value-of select="$position"/> )
+ {
+ AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the business logic from <xsl:value-of select="$method-name"/> "
+ " %d :: %s", env->error->error_number,
+ AXIS2_ERROR_GET_MESSAGE(env->error));
+ return <xsl:value-of select="$method-prefix"/>_on_fault( svc_skeleton, env, NULL);
+ }
+ ret_node = <xsl:choose>
+ <xsl:when test="@ours">
+ AXIS2_<xsl:value-of select="@caps-type"/>_PARSE_OM(ret_val<xsl:value-of select="$position"/>, env, NULL );
+ </xsl:when>
+ <xsl:otherwise>ret_val<xsl:value-of select="$position"/>;</xsl:otherwise>
+ </xsl:choose>
+ return ret_node;
+ </xsl:for-each>
+
+ <!-- below was prior to the databinding -->
+ <!-- <xsl:if test="$outputtype!=''">return </xsl:if>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$svcop-prefix"/>_<xsl:value-of select="$method-name"/>(env <xsl:for-each select="input/param[@type!='']"> ,
+ content_node </xsl:for-each>);
+ <xsl:if test="$outputtype=''">return NULL;</xsl:if> -->
+
+ }
+ </xsl:for-each>
+ }
+ }
+ }
+ }
+ printf("<xsl:value-of select="$skeletonname"/> service ERROR: invalid OM parameters in request\n");
+ return content_node;
+ }
+
+ axiom_node_t* AXIS2_CALL
+ <xsl:value-of select="$method-prefix"/>_on_fault(axis2_svc_skeleton_t *svc_skeleton,
+ const axis2_env_t *env, axiom_node_t *node)
+ {
+ axiom_node_t *error_node = NULL;
+ axiom_element_t *error_ele = NULL;
+ error_ele = axiom_element_create(env, node, "fault", NULL,
+ &error_node);
+ AXIOM_ELEMENT_SET_TEXT(error_ele, env, "<xsl:value-of select="$qname"/> failed",
+ error_node);
+ return error_node;
+ }
+
+
+ /**
+ * Following block distinguish the exposed part of the dll.
+ */
+
+ AXIS2_EXTERN int AXIS2_CALL
+ axis2_get_instance(struct axis2_svc_skeleton **inst,
+ const axis2_env_t *env)
+ {
+ *inst = <xsl:value-of select="$method-prefix"/>_create(env);
+
+ if(!(*inst))
+ {
+ return AXIS2_FAILURE;
+ }
+
+ return AXIS2_SUCCESS;
+ }
+
+ AXIS2_EXTERN int AXIS2_CALL
+ axis2_remove_instance(axis2_svc_skeleton_t *inst,
+ const axis2_env_t *env)
+ {
+ axis2_status_t status = AXIS2_FAILURE;
+ if (inst)
+ {
+ status = AXIS2_SVC_SKELETON_FREE(inst, env);
+ }
+ return status;
+ }
+
+
+ </xsl:template>
+
+</xsl:stylesheet>
Modified: webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceXMLTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceXMLTemplate.xsl?view=diff&rev=489066&r1=489065&r2=489066
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceXMLTemplate.xsl (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/ServiceXMLTemplate.xsl Wed Dec 20 04:23:24 2006
@@ -1,25 +1,41 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
-
- <xsl:template match="/">
- <xsl:comment> This file was auto-generated from WSDL </xsl:comment>
- <xsl:comment> by the Apache Axis2 version: #axisVersion# #today# </xsl:comment>
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="interface">
-
- <service>
- <xsl:attribute name="name"><xsl:value-of select="@servicename"/></xsl:attribute>
-
- <parameter name="ServiceClass" locked="false">
- <xsl:value-of select="@servicename"/>
- </parameter>
- <xsl:for-each select="method">
- <operation>
- <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
- </operation>
- </xsl:for-each>
- </service>
- </xsl:template>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ --><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
+
+ <xsl:template match="/">
+ <xsl:comment> This file was auto-generated from WSDL </xsl:comment>
+ <xsl:comment> by the Apache Axis2 version: #axisVersion# #today# </xsl:comment>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="interface">
+
+ <service>
+ <xsl:attribute name="name"><xsl:value-of select="@servicename"/></xsl:attribute>
+
+ <parameter name="ServiceClass" locked="false">
+ <xsl:value-of select="@servicename"/>
+ </parameter>
+ <xsl:for-each select="method">
+ <operation>
+ <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
+ </operation>
+ </xsl:for-each>
+ </service>
+ </xsl:template>
</xsl:stylesheet>
Modified: webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl?view=diff&rev=489066&r1=489065&r2=489066
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl Wed Dec 20 04:23:24 2006
@@ -1,70 +1,87 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="text"/>
- <xsl:template match="/interface">
- <xsl:variable name="svc_name"><xsl:value-of select="@name"/></xsl:variable>
- <xsl:variable name="method-prefix"><xsl:value-of select="@prefix"/></xsl:variable>
- <xsl:variable name="qname"><xsl:value-of select="@qname"/></xsl:variable>
-
- /**
- * <xsl:value-of select="@name"/>.h
- *
- * This file was auto-generated from WSDL for "<xsl:value-of select="$qname"/>" service
- * by the Apache Axis2/C version: #axisVersion# #today#
- * <xsl:value-of select="@name"/> Axis2/C skeleton for the axisService- Header file
- */
-
-
- #include <axis2_svc_skeleton.h>
- #include <axis2_log_default.h>
- #include <axis2_error_default.h>
- #include <axiom_text.h>
- #include <axiom_node.h>
- #include <axiom_element.h>
- #include <stdio.h>
-
-
- <xsl:for-each select="method">
- <xsl:if test="output/param[@ours and @type!='']">
- <xsl:variable name="outputtype">axis2_<xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
- #include "<xsl:value-of select="$outputtype"/>.h"
- </xsl:if>
- <xsl:for-each select="input/param[@type!='' and @ours]">
- <xsl:variable name="inputtype">axis2_<xsl:value-of select="@type"></xsl:value-of></xsl:variable>
- #include "<xsl:value-of select="$inputtype"/>.h"
- </xsl:for-each>
- </xsl:for-each>
-
-
- <xsl:for-each select="method">
- <xsl:variable name="outputours"><xsl:value-of select="output/param/@ours"></xsl:value-of></xsl:variable>
- <xsl:variable name="outputtype">
- <xsl:choose>
- <xsl:when test="output/param/@ours">axis2_<xsl:value-of select="output/param/@type"></xsl:value-of>_t*</xsl:when>
- <xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="count"><xsl:value-of select="count(output/param)"/></xsl:variable>
-
- <!-- regardless of the sync or async status, the generated method signature would be just a usual
- c function-->
- /**
- * auto generated function declaration
- * for "<xsl:value-of select="@qname"/>" operation.
- <!-- select only the body parameters -->
- <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
- */
- <xsl:choose>
- <xsl:when test="$outputtype=''">axis2_status_t </xsl:when>
- <xsl:when test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:when>
- </xsl:choose>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$method-prefix"/>_<xsl:value-of select="@name"/> (const axis2_env_t *env <xsl:for-each select="input/param[@type!='']"> ,
- <xsl:variable name="inputtype">
- <xsl:if test="@ours">axis2_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if>
- </xsl:variable>
- <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="$inputtype"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
- </xsl:for-each> );
- </xsl:for-each>
-
- </xsl:template>
- </xsl:stylesheet>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="text"/>
+ <xsl:template match="/interface">
+ <xsl:variable name="svc_name"><xsl:value-of select="@name"/></xsl:variable>
+ <xsl:variable name="method-prefix"><xsl:value-of select="@prefix"/></xsl:variable>
+ <xsl:variable name="qname"><xsl:value-of select="@qname"/></xsl:variable>
+
+ /**
+ * <xsl:value-of select="@name"/>.h
+ *
+ * This file was auto-generated from WSDL for "<xsl:value-of select="$qname"/>" service
+ * by the Apache Axis2/C version: #axisVersion# #today#
+ * <xsl:value-of select="@name"/> Axis2/C skeleton for the axisService- Header file
+ */
+
+
+ #include <axis2_svc_skeleton.h>
+ #include <axis2_log_default.h>
+ #include <axis2_error_default.h>
+ #include <axiom_text.h>
+ #include <axiom_node.h>
+ #include <axiom_element.h>
+ #include <stdio.h>
+
+
+ <xsl:for-each select="method">
+ <xsl:if test="output/param[@ours and @type!='']">
+ <xsl:variable name="outputtype">axis2_<xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
+ #include "<xsl:value-of select="$outputtype"/>.h"
+ </xsl:if>
+ <xsl:for-each select="input/param[@type!='' and @ours]">
+ <xsl:variable name="inputtype">axis2_<xsl:value-of select="@type"></xsl:value-of></xsl:variable>
+ #include "<xsl:value-of select="$inputtype"/>.h"
+ </xsl:for-each>
+ </xsl:for-each>
+
+
+ <xsl:for-each select="method">
+ <xsl:variable name="outputours"><xsl:value-of select="output/param/@ours"></xsl:value-of></xsl:variable>
+ <xsl:variable name="outputtype">
+ <xsl:choose>
+ <xsl:when test="output/param/@ours">axis2_<xsl:value-of select="output/param/@type"></xsl:value-of>_t*</xsl:when>
+ <xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="count"><xsl:value-of select="count(output/param)"/></xsl:variable>
+
+ <!-- regardless of the sync or async status, the generated method signature would be just a usual
+ c function-->
+ /**
+ * auto generated function declaration
+ * for "<xsl:value-of select="@qname"/>" operation.
+ <!-- select only the body parameters -->
+ <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
+ */
+ <xsl:choose>
+ <xsl:when test="$outputtype=''">axis2_status_t </xsl:when>
+ <xsl:when test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:when>
+ </xsl:choose>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$method-prefix"/>_<xsl:value-of select="@name"/> (const axis2_env_t *env <xsl:for-each select="input/param[@type!='']"> ,
+ <xsl:variable name="inputtype">
+ <xsl:if test="@ours">axis2_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if>
+ </xsl:variable>
+ <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="$inputtype"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:for-each> );
+ </xsl:for-each>
+
+ </xsl:template>
+ </xsl:stylesheet>
Modified: webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl?view=diff&rev=489066&r1=489065&r2=489066
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl Wed Dec 20 04:23:24 2006
@@ -1,55 +1,72 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="text"/>
- <xsl:template match="/interface">
- <xsl:variable name="svc_name"><xsl:value-of select="@name"/></xsl:variable>
- <xsl:variable name="method-prefix"><xsl:value-of select="@prefix"/></xsl:variable>
- <xsl:variable name="qname"><xsl:value-of select="@qname"/></xsl:variable>
-
- /**
- * <xsl:value-of select="@name"/>.c
- *
- * This file was auto-generated from WSDL for "<xsl:value-of select="$qname"/>" service
- * by the Apache Axis2/C version: #axisVersion# #today#
- * <xsl:value-of select="@name"/> Axis2/C skeleton for the axisService
- */
-
- #include "<xsl:value-of select="@name"/>.h"
-
- <xsl:for-each select="method">
- <xsl:variable name="outputours"><xsl:value-of select="output/param/@ours"></xsl:value-of></xsl:variable>
- <xsl:variable name="count"><xsl:value-of select="count(output/param)"/></xsl:variable>
- <xsl:variable name="outputtype">
- <xsl:choose>
- <xsl:when test="output/param/@ours">axis2_<xsl:value-of select="output/param/@type"></xsl:value-of>_t*</xsl:when>
- <xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- regardless of the sync or async status, the generated method signature would be just a usual
- c function-->
- /**
- * auto generated function definition signature
- * for "<xsl:value-of select="@qname"/>" operation.
- <!-- select only the body parameters -->
- <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
- */
- <xsl:choose>
- <xsl:when test="$outputtype=''">axis2_status_t </xsl:when>
- <xsl:when test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:when>
- </xsl:choose>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$method-prefix"/>_<xsl:value-of select="@name"/> (const axis2_env_t *env <xsl:for-each select="input/param[@type!='']"> ,
- <xsl:variable name="inputtype">
- <xsl:if test="@ours">axis2_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if>
- </xsl:variable>
- <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="$inputtype"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
- </xsl:for-each> )
- {
- /* TODO fill this with the necessary business logic */
- <xsl:if test="$outputtype!=''">return NULL;</xsl:if>
- <xsl:if test="$outputtype=''">return AXIS2_SUCCESS;</xsl:if>
- }
- </xsl:for-each>
-
- </xsl:template>
- </xsl:stylesheet>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="text"/>
+ <xsl:template match="/interface">
+ <xsl:variable name="svc_name"><xsl:value-of select="@name"/></xsl:variable>
+ <xsl:variable name="method-prefix"><xsl:value-of select="@prefix"/></xsl:variable>
+ <xsl:variable name="qname"><xsl:value-of select="@qname"/></xsl:variable>
+
+ /**
+ * <xsl:value-of select="@name"/>.c
+ *
+ * This file was auto-generated from WSDL for "<xsl:value-of select="$qname"/>" service
+ * by the Apache Axis2/C version: #axisVersion# #today#
+ * <xsl:value-of select="@name"/> Axis2/C skeleton for the axisService
+ */
+
+ #include "<xsl:value-of select="@name"/>.h"
+
+ <xsl:for-each select="method">
+ <xsl:variable name="outputours"><xsl:value-of select="output/param/@ours"></xsl:value-of></xsl:variable>
+ <xsl:variable name="count"><xsl:value-of select="count(output/param)"/></xsl:variable>
+ <xsl:variable name="outputtype">
+ <xsl:choose>
+ <xsl:when test="output/param/@ours">axis2_<xsl:value-of select="output/param/@type"></xsl:value-of>_t*</xsl:when>
+ <xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- regardless of the sync or async status, the generated method signature would be just a usual
+ c function-->
+ /**
+ * auto generated function definition signature
+ * for "<xsl:value-of select="@qname"/>" operation.
+ <!-- select only the body parameters -->
+ <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
+ */
+ <xsl:choose>
+ <xsl:when test="$outputtype=''">axis2_status_t </xsl:when>
+ <xsl:when test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:when>
+ </xsl:choose>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$method-prefix"/>_<xsl:value-of select="@name"/> (const axis2_env_t *env <xsl:for-each select="input/param[@type!='']"> ,
+ <xsl:variable name="inputtype">
+ <xsl:if test="@ours">axis2_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if>
+ </xsl:variable>
+ <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="$inputtype"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:for-each> )
+ {
+ /* TODO fill this with the necessary business logic */
+ <xsl:if test="$outputtype!=''">return NULL;</xsl:if>
+ <xsl:if test="$outputtype=''">return AXIS2_SUCCESS;</xsl:if>
+ }
+ </xsl:for-each>
+
+ </xsl:template>
+ </xsl:stylesheet>
Modified: webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl?view=diff&rev=489066&r1=489065&r2=489066
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl (original)
+++ webservices/axis2/branches/java/1_1/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl Wed Dec 20 04:23:24 2006
@@ -1,117 +1,134 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="text"/>
-
- <xsl:template match="/class">
- <xsl:variable name="interfaceName"><xsl:value-of select="@interfaceName"/></xsl:variable>
- <xsl:variable name="callbackname"><xsl:value-of select="@callbackname"/></xsl:variable>
- <xsl:variable name="isSync"><xsl:value-of select="@isSync"/></xsl:variable>
- <xsl:variable name="isAsync"><xsl:value-of select="@isAsync"/></xsl:variable>
- <xsl:variable name="soapVersion"><xsl:value-of select="@soap-version"/></xsl:variable>
- <xsl:variable name="method-prefix"><xsl:value-of select="@prefix"/></xsl:variable>
- <xsl:variable name="qname"><xsl:value-of select="@qname"/></xsl:variable>
-
- /**
- * <xsl:value-of select="@name"/>.h
- *
- * This file was auto-generated from WSDL for "<xsl:value-of select="$qname"/>" service
- * by the Apache Axis2/C version: #axisVersion# #today#
- */
-
- #include <stdio.h>
- #include <axiom.h>
- #include <axis2_util.h>
- #include <axiom_soap.h>
- #include <axis2_client.h>
- #include <axis2_stub.h>
-
- <xsl:for-each select="method">
- <xsl:if test="output/param[@ours and @type!='']">
- <xsl:variable name="outputtype">axis2_<xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
- #include "<xsl:value-of select="$outputtype"/>.h"
- </xsl:if>
- <xsl:for-each select="input/param[@type!='' and @ours ]">
- <xsl:variable name="inputtype">axis2_<xsl:value-of select="@type"></xsl:value-of></xsl:variable>
- #include "<xsl:value-of select="$inputtype"/>.h"
- </xsl:for-each>
- </xsl:for-each>
- /* function prototypes - for header file*/
- /**
- * <xsl:value-of select="$method-prefix"/>_create
- * create and return the stub with services populated
- * params - env : environment ( mandatory)
- * - client_home : Axis2/C home ( mandatory )
- * - endpoint_uri : service endpoint uri( optional ) - if NULL default picked from wsdl used
- */
- axis2_stub_t*
- <xsl:value-of select="$method-prefix"/>_create (const axis2_env_t *env,
- axis2_char_t *client_home,
- axis2_char_t *endpoint_uri);
- /**
- * <xsl:value-of select="$method-prefix"/>_populate_services
- * populate the svc in stub with the service and operations
- */
- void <xsl:value-of select="$method-prefix"/>_populate_services( axis2_stub_t *stub, const axis2_env_t *env);
- /**
- * <xsl:value-of select="$method-prefix"/>_get_endpoint_uri_from_wsdl
- * return the endpoint URI picked from wsdl
- */
- axis2_char_t *<xsl:value-of select="$method-prefix"/>_get_endpoint_uri_from_wsdl ( const axis2_env_t *env );
-
- <xsl:if test="$isSync='1'">
- <xsl:for-each select="method">
- /**
- * auto generated function declaration
- * for "<xsl:value-of select="@qname"/>" operation.
- <!-- select only the body parameters -->
- <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
- */
-
- <xsl:variable name="outputours"><xsl:value-of select="output/param/@ours"></xsl:value-of></xsl:variable>
- <xsl:variable name="outputtype">
- <xsl:choose>
- <xsl:when test="output/param/@ours">axis2_<xsl:value-of select="output/param/@type"></xsl:value-of>_t*</xsl:when>
- <xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$outputtype=''">axis2_status_t</xsl:when>
- <xsl:when test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:when>
- </xsl:choose>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$method-prefix"/>_<xsl:value-of select="@name"/>( axis2_stub_t *stub, const axis2_env_t *env<xsl:for-each select="input/param[@type!='']">,
- <xsl:variable name="inputtype">
- <xsl:if test="@ours">axis2_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if>
- </xsl:variable>
- <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="$inputtype"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
- </xsl:for-each>);
- </xsl:for-each>
- </xsl:if> <!--close for test="$isSync='1'-->
-
- <!-- Async method prototype generation -->
- <xsl:if test="$isAsync='1'">
- <xsl:for-each select="method">
- /**
- * auto generated function declaration
- * for "<xsl:value-of select="@qname"/>" operation.
- <!-- select only the body parameters -->
- <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
- * @param on_complete callback to handle on complete
- * @param on_error callback to handle on error
- */
-
- <xsl:variable name="mep"><xsl:value-of select="@mep"/></xsl:variable>
- <xsl:if test="$mep='12'">
- void <xsl:value-of select="$method-prefix"/>_<xsl:value-of select="@name"/>_start( axis2_stub_t *stub, const axis2_env_t *env<xsl:for-each select="input/param[@type!='']">,
- <xsl:variable name="inputtype">
- <xsl:if test="@ours">axis2_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if>
- </xsl:variable>
- <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="$inputtype"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
- </xsl:for-each>,
- axis2_status_t ( AXIS2_CALL *on_complete ) (struct axis2_callback *, const axis2_env_t* ) ,
- axis2_status_t ( AXIS2_CALL *on_error ) (struct axis2_callback *, const axis2_env_t*, int ) );
-
- </xsl:if> <!--close for test="$mep='http://www.w3.org/2004/08/wsdl/in-out'"-->
- </xsl:for-each>
- </xsl:if> <!--close for test="$isAsync='1'-->
- </xsl:template>
-</xsl:stylesheet>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="text"/>
+
+ <xsl:template match="/class">
+ <xsl:variable name="interfaceName"><xsl:value-of select="@interfaceName"/></xsl:variable>
+ <xsl:variable name="callbackname"><xsl:value-of select="@callbackname"/></xsl:variable>
+ <xsl:variable name="isSync"><xsl:value-of select="@isSync"/></xsl:variable>
+ <xsl:variable name="isAsync"><xsl:value-of select="@isAsync"/></xsl:variable>
+ <xsl:variable name="soapVersion"><xsl:value-of select="@soap-version"/></xsl:variable>
+ <xsl:variable name="method-prefix"><xsl:value-of select="@prefix"/></xsl:variable>
+ <xsl:variable name="qname"><xsl:value-of select="@qname"/></xsl:variable>
+
+ /**
+ * <xsl:value-of select="@name"/>.h
+ *
+ * This file was auto-generated from WSDL for "<xsl:value-of select="$qname"/>" service
+ * by the Apache Axis2/C version: #axisVersion# #today#
+ */
+
+ #include <stdio.h>
+ #include <axiom.h>
+ #include <axis2_util.h>
+ #include <axiom_soap.h>
+ #include <axis2_client.h>
+ #include <axis2_stub.h>
+
+ <xsl:for-each select="method">
+ <xsl:if test="output/param[@ours and @type!='']">
+ <xsl:variable name="outputtype">axis2_<xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
+ #include "<xsl:value-of select="$outputtype"/>.h"
+ </xsl:if>
+ <xsl:for-each select="input/param[@type!='' and @ours ]">
+ <xsl:variable name="inputtype">axis2_<xsl:value-of select="@type"></xsl:value-of></xsl:variable>
+ #include "<xsl:value-of select="$inputtype"/>.h"
+ </xsl:for-each>
+ </xsl:for-each>
+ /* function prototypes - for header file*/
+ /**
+ * <xsl:value-of select="$method-prefix"/>_create
+ * create and return the stub with services populated
+ * params - env : environment ( mandatory)
+ * - client_home : Axis2/C home ( mandatory )
+ * - endpoint_uri : service endpoint uri( optional ) - if NULL default picked from wsdl used
+ */
+ axis2_stub_t*
+ <xsl:value-of select="$method-prefix"/>_create (const axis2_env_t *env,
+ axis2_char_t *client_home,
+ axis2_char_t *endpoint_uri);
+ /**
+ * <xsl:value-of select="$method-prefix"/>_populate_services
+ * populate the svc in stub with the service and operations
+ */
+ void <xsl:value-of select="$method-prefix"/>_populate_services( axis2_stub_t *stub, const axis2_env_t *env);
+ /**
+ * <xsl:value-of select="$method-prefix"/>_get_endpoint_uri_from_wsdl
+ * return the endpoint URI picked from wsdl
+ */
+ axis2_char_t *<xsl:value-of select="$method-prefix"/>_get_endpoint_uri_from_wsdl ( const axis2_env_t *env );
+
+ <xsl:if test="$isSync='1'">
+ <xsl:for-each select="method">
+ /**
+ * auto generated function declaration
+ * for "<xsl:value-of select="@qname"/>" operation.
+ <!-- select only the body parameters -->
+ <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
+ */
+
+ <xsl:variable name="outputours"><xsl:value-of select="output/param/@ours"></xsl:value-of></xsl:variable>
+ <xsl:variable name="outputtype">
+ <xsl:choose>
+ <xsl:when test="output/param/@ours">axis2_<xsl:value-of select="output/param/@type"></xsl:value-of>_t*</xsl:when>
+ <xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$outputtype=''">axis2_status_t</xsl:when>
+ <xsl:when test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:when>
+ </xsl:choose>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$method-prefix"/>_<xsl:value-of select="@name"/>( axis2_stub_t *stub, const axis2_env_t *env<xsl:for-each select="input/param[@type!='']">,
+ <xsl:variable name="inputtype">
+ <xsl:if test="@ours">axis2_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if>
+ </xsl:variable>
+ <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="$inputtype"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:for-each>);
+ </xsl:for-each>
+ </xsl:if> <!--close for test="$isSync='1'-->
+
+ <!-- Async method prototype generation -->
+ <xsl:if test="$isAsync='1'">
+ <xsl:for-each select="method">
+ /**
+ * auto generated function declaration
+ * for "<xsl:value-of select="@qname"/>" operation.
+ <!-- select only the body parameters -->
+ <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
+ * @param on_complete callback to handle on complete
+ * @param on_error callback to handle on error
+ */
+
+ <xsl:variable name="mep"><xsl:value-of select="@mep"/></xsl:variable>
+ <xsl:if test="$mep='12'">
+ void <xsl:value-of select="$method-prefix"/>_<xsl:value-of select="@name"/>_start( axis2_stub_t *stub, const axis2_env_t *env<xsl:for-each select="input/param[@type!='']">,
+ <xsl:variable name="inputtype">
+ <xsl:if test="@ours">axis2_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t*</xsl:if>
+ </xsl:variable>
+ <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="$inputtype"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:for-each>,
+ axis2_status_t ( AXIS2_CALL *on_complete ) (struct axis2_callback *, const axis2_env_t* ) ,
+ axis2_status_t ( AXIS2_CALL *on_error ) (struct axis2_callback *, const axis2_env_t*, int ) );
+
+ </xsl:if> <!--close for test="$mep='http://www.w3.org/2004/08/wsdl/in-out'"-->
+ </xsl:for-each>
+ </xsl:if> <!--close for test="$isAsync='1'-->
+ </xsl:template>
+</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org