axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dimu...@apache.org
Subject svn commit: r685507 - in /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c: SkelHeaderTemplate.xsl SkelSourceTemplate.xsl StubSourceTemplate.xsl
Date Wed, 13 Aug 2008 10:44:38 GMT
Author: dimuthu
Date: Wed Aug 13 03:44:37 2008
New Revision: 685507

URL: http://svn.apache.org/viewvc?rev=685507&view=rev
Log:
generating policy for stub for wsdl2c

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl?rev=685507&r1=685506&r2=685507&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelHeaderTemplate.xsl
Wed Aug 13 03:44:37 2008
@@ -90,7 +90,7 @@
                                           <xsl:variable name="inputtype">
                                              <xsl:if test="@ours">adb_</xsl:if><xsl:value-of
select="@type"/><xsl:if test="@ours">_t*</xsl:if>
                                           </xsl:variable>
-                                          <xsl:value-of select="$inputtype"/><xsl:text>
</xsl:text><xsl:value-of select="@name"/>
+                                          <xsl:value-of select="$inputtype"/><xsl:text>
_</xsl:text><xsl:value-of select="@name"/>
                                           </xsl:for-each><xsl:for-each select="output/param[@location='soap_header']">,
                                             <xsl:variable name="outputtype"><xsl:if
test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t**</xsl:if></xsl:variable>
                                             <xsl:value-of select="$outputtype"/><xsl:text>
dp_</xsl:text><xsl:value-of select="@name"/><xsl:text> /* output header
double ptr*/</xsl:text>

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl?rev=685507&r1=685506&r2=685507&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/SkelSourceTemplate.xsl
Wed Aug 13 03:44:37 2008
@@ -67,7 +67,7 @@
                                               <xsl:variable name="inputtype">
                                                   <xsl:if test="@ours">adb_</xsl:if><xsl:value-of
select="@type"/><xsl:if test="@ours">_t*</xsl:if>
                                               </xsl:variable>
-                                              <xsl:value-of select="$inputtype"/><xsl:text>
</xsl:text><xsl:value-of select="@name"/>
+                                              <xsl:value-of select="$inputtype"/><xsl:text>
_</xsl:text><xsl:value-of select="@name"/>
                                           </xsl:for-each><xsl:for-each select="output/param[@location='soap_header']">,
                                             <xsl:variable name="outputtype"><xsl:if
test="@ours">adb_</xsl:if><xsl:value-of select="@type"/><xsl:if test="@ours">_t**</xsl:if></xsl:variable>
                                             <xsl:value-of select="$outputtype"/><xsl:text>
dp_</xsl:text><xsl:value-of select="@name"/><xsl:text> /* output header
double ptr*/</xsl:text>

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl?rev=685507&r1=685506&r2=685507&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl
Wed Aug 13 03:44:37 2008
@@ -41,6 +41,14 @@
 
       #include "<xsl:value-of select="@name"/>.h"
       #include &lt;axis2_msg.h&gt;
+      #include &lt;axis2_policy_include.h&gt;
+      #include &lt;neethi_engine.h&gt;
+
+
+      axiom_node_t *
+      axis2_deserialize_buffer (
+            const axutil_env_t * env,
+            char *buffer);
 
       /**
        * <xsl:value-of select="@name"/> C implementation
@@ -92,7 +100,13 @@
          axis2_msg_t *msg_in = NULL;
          axis2_msg_t *msg_out_fault = NULL;
          axis2_msg_t *msg_in_fault = NULL;
+         axis2_policy_include_t *policy_include = NULL;
 
+         axis2_desc_t *desc = NULL;
+         axiom_node_t *policy_node = NULL;
+         axiom_element_t *policy_root_ele = NULL;
+         neethi_policy_t *neethi_policy = NULL;
+         axis2_status_t status;
 
          /* Modifying the Service */
          svc_client = axis2_stub_get_svc_client (stub, env );
@@ -132,9 +146,25 @@
            axis2_op_add_msg(op, env, AXIS2_MSG_IN, msg_in);
            axis2_op_add_msg(op, env, AXIS2_MSG_OUT_FAULT, msg_out_fault);
            axis2_op_add_msg(op, env, AXIS2_MSG_IN_FAULT, msg_in_fault);
-           
-           axis2_svc_add_op(svc, env, op);
+       
+           <xsl:if test="input/@policy">
+           /* adding the input policies */
+
+           policy_node = axis2_deserialize_buffer(env, "<xsl:value-of select="input/@policy"/>");
+           policy_root_ele = (axiom_element_t *) axiom_node_get_data_element (policy_node,
env);
+
+           neethi_policy = neethi_engine_get_policy (env, policy_node, policy_root_ele);
+           status = axis2_svc_client_set_policy(svc_client, env, neethi_policy);
+
+           if(status == AXIS2_FAILURE)
+           {
+                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
+                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "neethi policy setting failed");
+                return;
+           }
 
+           </xsl:if>
+           axis2_svc_add_op(svc, env, op);
          </xsl:for-each>
       }
 
@@ -937,5 +967,50 @@
         </xsl:if>
      </xsl:for-each>
 
+    axiom_node_t *
+    axis2_deserialize_buffer (
+        const axutil_env_t * env,
+        char *buffer)
+    {
+        axiom_xml_reader_t *reader = NULL;
+        axiom_stax_builder_t *builder = NULL;
+        axiom_document_t *document = NULL;
+        axiom_node_t *payload = NULL;
+
+        reader = axiom_xml_reader_create_for_memory (env, buffer, axutil_strlen (buffer),
+            AXIS2_UTF_8, AXIS2_XML_PARSER_TYPE_BUFFER);
+
+        if (!reader)
+        {
+            return NULL;
+        }
+
+        builder = axiom_stax_builder_create (env, reader);
+
+        if (!builder)
+        {
+            return NULL;
+        }
+        document = axiom_stax_builder_get_document (builder, env);
+        if (!document)
+        {
+            AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "Document is null for deserialization");
+            return NULL;
+        }
+
+        payload = axiom_document_get_root_element (document, env);
+
+        if (!payload)
+        {
+            AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "Root element of the document is
not found");
+            return NULL;
+        }
+        axiom_document_build_all (document, env);
+
+        axiom_stax_builder_free_self (builder, env);
+
+        return payload;
+    }
+
    </xsl:template>
 </xsl:stylesheet>



Mime
View raw message