axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r424196 - in /webservices/axis2/trunk/c/samples/client/diclient: ./ CalculatorDoc.wsdl Makefile.am README calc_client.c test.c
Date Fri, 21 Jul 2006 06:26:21 GMT
Author: damitha
Date: Thu Jul 20 23:26:21 2006
New Revision: 424196

URL: http://svn.apache.org/viewvc?rev=424196&view=rev
Log:
Added dynamic client sample

Added:
    webservices/axis2/trunk/c/samples/client/diclient/
    webservices/axis2/trunk/c/samples/client/diclient/CalculatorDoc.wsdl
    webservices/axis2/trunk/c/samples/client/diclient/Makefile.am
    webservices/axis2/trunk/c/samples/client/diclient/README
    webservices/axis2/trunk/c/samples/client/diclient/calc_client.c
    webservices/axis2/trunk/c/samples/client/diclient/test.c

Added: webservices/axis2/trunk/c/samples/client/diclient/CalculatorDoc.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/diclient/CalculatorDoc.wsdl?rev=424196&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/client/diclient/CalculatorDoc.wsdl (added)
+++ webservices/axis2/trunk/c/samples/client/diclient/CalculatorDoc.wsdl Thu Jul 20 23:26:21
2006
@@ -0,0 +1,255 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2003-2004 The Apache Software Foundation.                      -->
+<!-- (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved                   -->
+<!--                                                                          -->
+<!-- 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.                                           -->
+
+<wsdl:definitions targetNamespace="http://localhost/axis/Calculator" xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost/axis/Calculator" xmlns:intf="http://localhost/axis/Calculator"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+  <schema elementFormDefault="qualified" targetNamespace="http://localhost/axis/Calculator"
xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost/axis/Calculator" xmlns:intf="http://localhost/axis/Calculator"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+   <element name="add">
+    <complexType>
+     <sequence>
+      <element name="arg_0_0" type="xsd:int"/>
+      <element name="arg_1_0" type="xsd:int"/>
+     </sequence>
+    </complexType>
+   </element>
+   <element name="addResponse">
+    <complexType>
+     <sequence>
+      <element name="addReturn" type="xsd:int"/>
+     </sequence>
+    </complexType>
+   </element>
+   <element name="sub">
+    <complexType>
+     <sequence>
+      <element name="arg_0_1" type="xsd:int"/>
+      <element name="arg_1_1" type="xsd:int"/>
+     </sequence>
+    </complexType>
+   </element>
+   <element name="subResponse">
+    <complexType>
+     <sequence>
+      <element name="subReturn" type="xsd:int"/>
+     </sequence>
+    </complexType>
+   </element>
+   <element name="mul">
+    <complexType>
+     <sequence>
+      <element name="arg_0_2" type="xsd:int"/>
+      <element name="arg_1_2" type="xsd:int"/>
+     </sequence>
+    </complexType>
+   </element>
+   <element name="mulResponse">
+    <complexType>
+     <sequence>
+      <element name="mulReturn" type="xsd:int"/>
+     </sequence>
+    </complexType>
+   </element>
+   <element name="div">
+    <complexType>
+     <sequence>
+      <element name="arg_0_3" type="xsd:int"/>
+      <element name="arg_1_3" type="xsd:int"/>
+     </sequence>
+    </complexType>
+   </element>
+   <element name="divResponse">
+    <complexType>
+     <sequence>
+      <element name="divReturn" type="xsd:int"/>
+     </sequence>
+    </complexType>
+   </element>
+  </schema>
+ </wsdl:types>
+
+   <wsdl:message name="subResponse">
+
+      <wsdl:part element="impl:subResponse" name="parameters"/>
+
+   </wsdl:message>
+
+   <wsdl:message name="mulResponse">
+
+      <wsdl:part element="impl:mulResponse" name="parameters"/>
+
+   </wsdl:message>
+
+   <wsdl:message name="subRequest">
+
+      <wsdl:part element="impl:sub" name="parameters"/>
+
+   </wsdl:message>
+
+   <wsdl:message name="divRequest">
+
+      <wsdl:part element="impl:div" name="parameters"/>
+
+   </wsdl:message>
+
+   <wsdl:message name="divResponse">
+
+      <wsdl:part element="impl:divResponse" name="parameters"/>
+
+   </wsdl:message>
+
+   <wsdl:message name="mulRequest">
+
+      <wsdl:part element="impl:mul" name="parameters"/>
+
+   </wsdl:message>
+
+   <wsdl:message name="addResponse">
+
+      <wsdl:part element="impl:addResponse" name="parameters"/>
+
+   </wsdl:message>
+
+   <wsdl:message name="addRequest">
+
+      <wsdl:part element="impl:add" name="parameters"/>
+
+   </wsdl:message>
+
+   <wsdl:portType name="Calculator">
+
+      <wsdl:operation name="add">
+
+         <wsdl:input message="impl:addRequest" name="addRequest"/>
+
+         <wsdl:output message="impl:addResponse" name="addResponse"/>
+
+      </wsdl:operation>
+
+      <wsdl:operation name="sub">
+
+         <wsdl:input message="impl:subRequest" name="subRequest"/>
+
+         <wsdl:output message="impl:subResponse" name="subResponse"/>
+
+      </wsdl:operation>
+
+      <wsdl:operation name="mul">
+
+         <wsdl:input message="impl:mulRequest" name="mulRequest"/>
+
+         <wsdl:output message="impl:mulResponse" name="mulResponse"/>
+
+      </wsdl:operation>
+
+      <wsdl:operation name="div">
+
+         <wsdl:input message="impl:divRequest" name="divRequest"/>
+
+         <wsdl:output message="impl:divResponse" name="divResponse"/>
+
+      </wsdl:operation>
+
+   </wsdl:portType>
+
+   <wsdl:binding name="CalculatorSoapBinding" type="impl:Calculator">
+
+      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+      <wsdl:operation name="add">
+
+         <wsdlsoap:operation soapAction="Calculator#add"/>
+
+         <wsdl:input name="addRequest">
+
+            <wsdlsoap:body use="literal"/>
+
+         </wsdl:input>
+
+         <wsdl:output name="addResponse">
+
+            <wsdlsoap:body use="literal"/>
+
+         </wsdl:output>
+
+      </wsdl:operation>
+
+      <wsdl:operation name="sub">
+
+         <wsdlsoap:operation soapAction="Calculator#sub"/>
+
+         <wsdl:input name="subRequest">
+
+            <wsdlsoap:body use="literal"/>
+
+         </wsdl:input>
+
+         <wsdl:output name="subResponse">
+
+            <wsdlsoap:body use="literal"/>
+
+         </wsdl:output>
+
+      </wsdl:operation>
+
+      <wsdl:operation name="mul">
+
+         <wsdlsoap:operation soapAction="Calculator#mul"/>
+
+         <wsdl:input name="mulRequest">
+
+            <wsdlsoap:body use="literal"/>
+
+         </wsdl:input>
+
+         <wsdl:output name="mulResponse">
+
+            <wsdlsoap:body use="literal"/>
+
+         </wsdl:output>
+
+      </wsdl:operation>
+
+      <wsdl:operation name="div">
+
+         <wsdlsoap:operation soapAction="Calculator#div"/>
+
+         <wsdl:input name="divRequest">
+
+            <wsdlsoap:body use="literal"/>
+
+         </wsdl:input>
+
+         <wsdl:output name="divResponse">
+
+            <wsdlsoap:body use="literal"/>
+
+         </wsdl:output>
+
+      </wsdl:operation>
+
+   </wsdl:binding>
+
+   <wsdl:service name="Calculator">
+
+      <wsdl:port binding="impl:CalculatorSoapBinding" name="Calculator">
+
+         <wsdlsoap:address location="http://localhost/axis/Calculator"/>
+
+      </wsdl:port>
+
+   </wsdl:service>
+
+</wsdl:definitions>

Added: webservices/axis2/trunk/c/samples/client/diclient/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/diclient/Makefile.am?rev=424196&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/client/diclient/Makefile.am (added)
+++ webservices/axis2/trunk/c/samples/client/diclient/Makefile.am Thu Jul 20 23:26:21 2006
@@ -0,0 +1,24 @@
+prgbindir=$(prefix)/bin/samples
+prgbin_PROGRAMS = diclient
+samplesdir=$(prefix)/samples/client/diclient
+samples_DATA=calc_client.c README Makefile.am Makefile.in
+diclient_SOURCES = calc_client.c
+
+diclient_LDADD   = $(LDFLAGS) \
+                    -L$(AXIS2C_HOME)/lib \
+					-laxis2_util \
+                    -laxis2_axiom \
+                    -laxis2_wsdl \
+                    -laxis2_engine \
+                    -laxis2_parser \
+                    -lpthread \
+					-lwoden \
+					-laxis2_xml_schema \
+                    -laxis2_http_sender \
+                    -laxis2_http_receiver \
+                    $(GUTHTHILA_LIBS) \
+                    $(LIBXML2_LIBS)
+
+INCLUDES = -I$(AXIS2C_HOME)/include \
+			@UTILINC@ \
+			@AXIOMINC@

Added: webservices/axis2/trunk/c/samples/client/diclient/README
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/diclient/README?rev=424196&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/client/diclient/README (added)
+++ webservices/axis2/trunk/c/samples/client/diclient/README Thu Jul 20 23:26:21 2006
@@ -0,0 +1,43 @@
+This sample demonstrate the Dynamic Invocation capabilities of Axis2 C.
+It should be noted that to run this sample you should have configured
+Axis2 C with the configure option --enable-wsdl-pull=yes.
+To do this you should have installed WsdlPull and Axis2c_wsdl4c which
+is a C wrapper for WsdlPull.
+
+I'm using WsdlPull 1.10
+
+Notes for WsdlPull 1.9
+======================
+Note1:
+In WsdlPull version 1.9 I noticed that,  WsdlParser::getService() 
+method is there in the Header file but not implemented.
+Therefore add the following code to WsdlParser.cpp
+
+const Service *
+WsdlParser::getService()
+{
+    if (element_ != SERVICE)
+    {
+         error ("Attempted to extract a Service when ,no service was parsed",1);
+         return 0;
+    }
+    else
+    {
+        return services_.back();
+    }
+}
+Note2:
+Also there is another fix for WsdlPull
+In WsdlParser.cpp's parseService method
+
+Add the following two lines
+    if ("name" == xParser_->getAttributeName(i) &&
+                (xParser_->getAttributePrefix(i)).empty())
+        portName = xParser_->getAttributeValue(i);
+
+after following code
+
+for (i = 0; i < num_att; i++) {
+    if ("binding" == xParser_->getAttributeName(i) &&
+                (xParser_->getAttributePrefix(i)).empty())
+        bnName = xParser_->getAttributeValue(i);

Added: webservices/axis2/trunk/c/samples/client/diclient/calc_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/diclient/calc_client.c?rev=424196&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/client/diclient/calc_client.c (added)
+++ webservices/axis2/trunk/c/samples/client/diclient/calc_client.c Thu Jul 20 23:26:21 2006
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2004,2005 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.
+ */
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axiom_text.h>
+#include <axis2_stream.h>
+#include <axis2_log_default.h>
+#include <axis2_error_default.h>
+#include <axis2_svc_client.h>
+#include <axis2_util.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+axiom_node_t *
+build_om_programatically(axis2_env_t *env);
+
+int main(int argc, char** argv)
+{
+	axiom_node_t *payload = NULL;
+	axiom_node_t *response = NULL;
+	axis2_env_t *env = NULL;
+    axis2_error_t *error = NULL;
+    axis2_log_t *log = NULL;
+    axis2_allocator_t *allocator = NULL;
+    axis2_uri_t *wsdl_uri = NULL;
+    axis2_char_t *wsdl_uri_str = NULL;
+    axis2_qname_t *op_qname = NULL;
+    axis2_svc_client_t *svc_client = NULL;
+    const axis2_char_t *client_home = NULL;
+    axis2_qname_t *wsdl_svc_qname = NULL;
+
+    /* set up the envioronment with allocator and log*/
+    allocator = axis2_allocator_init (NULL);
+    error = axis2_error_create(allocator);
+    log = axis2_log_create(allocator, NULL, "addr_echo.log");
+    env = axis2_env_create_with_error_log(allocator, error, log);
+    env->log->level = AXIS2_LOG_LEVEL_TRACE;
+    axis2_error_init();
+
+	if (argc <= 1)
+    {
+      printf("Usage: print <wsdl_File_Name>\n");
+      return 1;
+    }
+    wsdl_uri_str = argv[1];
+
+    /* Set up deploy folder. It is from the deploy folder, the configuration 
+     * is picked up using the axis2.xml file.
+     * In this sample client_home points to the Axis2/C default deploy folder. 
+     * The client_home can be different from this folder on your system. For 
+     * example, you may have a different folder (say, my_client_folder) with 
+     * its own axis2.xml file. my_client_folder/modules will have the 
+     * modules that the client uses
+     */
+    client_home = AXIS2_GETENV("AXIS2C_HOME");
+    if (!client_home)
+        client_home = "../../deploy";
+
+    wsdl_svc_qname = axis2_qname_create(env, "Calculator", 
+            "http://localhost/axis/Calculator", NULL);
+    wsdl_uri = axis2_uri_parse_string(env, wsdl_uri_str);
+    svc_client = 
+        axis2_svc_client_create_with_conf_ctx_and_wsdl_uri_wsdl_svc_name_and_endpoint(
+                env, NULL, wsdl_uri, wsdl_svc_qname, "Calculator", client_home);
+    payload = build_om_programatically(env);
+    op_qname = axis2_qname_create(env, "add", "http://localhost/axis/Calculator", 
+            NULL); 
+    response = AXIS2_SVC_CLIENT_SEND_RECEIVE_WITH_OP_QNAME(svc_client, env, 
+            op_qname, payload);
+        
+	if(response)
+		printf("status:%s\n", "Success");
+	else
+		printf("status:%s\n", "Failure");
+    if(svc_client)
+    {
+        AXIS2_SVC_CLIENT_FREE(svc_client, env);
+        svc_client = NULL;
+    }
+	return 0;
+}
+
+/* build SOAP request message content using OM */
+axiom_node_t *
+build_om_programatically(axis2_env_t *env)
+{
+    axiom_node_t *add_om_node = NULL;
+    axiom_element_t* add_om_ele = NULL;
+    axiom_node_t *arg0_om_node = NULL;
+    axiom_element_t* arg0_om_ele = NULL;
+    axiom_node_t *arg1_om_node = NULL;
+    axiom_element_t* arg1_om_ele = NULL;
+    axiom_node_t *seq_om_node = NULL;
+    axiom_element_t* seq_om_ele = NULL;
+    axiom_node_t *cmplx_type_om_node = NULL;
+    axiom_element_t* cmplx_type_om_ele = NULL;
+    axiom_namespace_t *ns1 = NULL;
+    axiom_attribute_t *attr = NULL;
+    axiom_attribute_t *attr_name_arg0 = NULL;
+    axiom_attribute_t *attr_name_arg1 = NULL;
+    
+
+    axiom_xml_writer_t *xml_writer = NULL;
+    axiom_output_t *om_output = NULL;
+    axis2_char_t *buffer = NULL;
+    axis2_char_t *ns = NULL;
+
+    ns = AXIS2_STRDUP("http://localhost/axis/Calculator", env);
+    ns1 = axiom_namespace_create (env, ns, "tns0");
+    
+    add_om_ele = axiom_element_create(env, NULL, "add", ns1, &add_om_node);
+    cmplx_type_om_ele = axiom_element_create(env, add_om_node, "complexType", ns1, &cmplx_type_om_node);
+    seq_om_ele = axiom_element_create(env, cmplx_type_om_node, "sequence", ns1, &seq_om_node);
+    attr = axiom_attribute_create(env, "type", "xsd:int", ns1);
+    attr_name_arg0 = axiom_attribute_create(env, "name", "arg_0_0", ns1);
+    attr_name_arg1 = axiom_attribute_create(env, "name", "arg_1_0", ns1);
+    arg0_om_ele = axiom_element_create(env, seq_om_node, "arg_0_0", ns1, &arg0_om_node);
+    AXIOM_ELEMENT_SET_TEXT(arg0_om_ele, env, "5", arg0_om_node);
+    AXIOM_ELEMENT_ADD_ATTRIBUTE(arg0_om_ele, env, attr, arg0_om_node);
+    AXIOM_ELEMENT_ADD_ATTRIBUTE(arg0_om_ele, env, attr_name_arg0, arg0_om_node);
+    arg1_om_ele = axiom_element_create(env, seq_om_node, "arg_1_0", ns1, &arg1_om_node);
+    AXIOM_ELEMENT_SET_TEXT(arg1_om_ele, env, "10", arg1_om_node);
+    AXIOM_ELEMENT_ADD_ATTRIBUTE(arg1_om_ele, env, attr_name_arg1, arg1_om_node);
+    AXIOM_ELEMENT_ADD_ATTRIBUTE(arg1_om_ele, env, attr, arg1_om_node);
+    
+    xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, 
+            AXIS2_FALSE, AXIS2_XML_PARSER_TYPE_BUFFER);
+    om_output = axiom_output_create( env, xml_writer);
+    
+    AXIOM_NODE_SERIALIZE(add_om_node, env, om_output);
+    buffer = AXIOM_XML_WRITER_GET_XML(xml_writer, env);         
+    printf("\nOM node in XML : %s \n",  buffer); 
+    AXIS2_FREE(env->allocator, buffer);
+    AXIOM_OUTPUT_FREE(om_output, env);
+
+    return add_om_node;
+}
+

Added: webservices/axis2/trunk/c/samples/client/diclient/test.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/diclient/test.c?rev=424196&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/client/diclient/test.c (added)
+++ webservices/axis2/trunk/c/samples/client/diclient/test.c Thu Jul 20 23:26:21 2006
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2004,2005 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.
+ */
+#include <axiom_node.h>
+#include <axiom_element.h>
+#include <axiom_text.h>
+#include <axis2_stream.h>
+#include <axis2_log_default.h>
+#include <axis2_error_default.h>
+#include <axis2_svc_client.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+axiom_node_t *
+build_om_programatically(axis2_env_t *env);
+
+int main(int argc, char** argv)
+{
+	axis2_env_t *env = NULL;
+    axis2_error_t *error = NULL;
+    axis2_log_t *log = NULL;
+    axis2_allocator_t *allocator = NULL;
+    
+    /* set up the envioronment with allocator and log*/
+    allocator = axis2_allocator_init (NULL);
+    error = axis2_error_create(allocator);
+    log = axis2_log_create(allocator, NULL, "addr_echo.log");
+    env = axis2_env_create_with_error_log(allocator, error, log);
+    env->log->level = AXIS2_LOG_LEVEL_TRACE;
+    axis2_error_init();
+
+
+    build_om_programatically(env);
+	return 0;
+}
+
+/* build SOAP request message content using OM */
+axiom_node_t *
+build_om_programatically(axis2_env_t *env)
+{
+    axiom_node_t *add_om_node = NULL;
+    axiom_element_t* add_om_ele = NULL;
+    axiom_node_t *arg0_om_node = NULL;
+    axiom_element_t* arg0_om_ele = NULL;
+    axiom_node_t *arg1_om_node = NULL;
+    axiom_element_t* arg1_om_ele = NULL;
+    axiom_node_t *seq_om_node = NULL;
+    axiom_element_t* seq_om_ele = NULL;
+    axiom_node_t *cmplx_type_om_node = NULL;
+    axiom_element_t* cmplx_type_om_ele = NULL;
+    axiom_namespace_t *ns1 = NULL;
+    axiom_attribute_t *attr = NULL;
+    axiom_attribute_t *attr_name_arg0 = NULL;
+    axiom_attribute_t *attr_name_arg1 = NULL;
+    
+
+    axiom_xml_writer_t *xml_writer = NULL;
+    axiom_output_t *om_output = NULL;
+    axis2_char_t *buffer = NULL;
+    axis2_char_t *ns = NULL;
+
+    ns = AXIS2_STRDUP("http://localhost/axis/Calculator", env);
+    ns1 = axiom_namespace_create (env, ns, "tns0");
+    
+    add_om_ele = axiom_element_create(env, NULL, "add", ns1, &add_om_node);
+    cmplx_type_om_ele = axiom_element_create(env, add_om_node, "complexType", ns1, &cmplx_type_om_node);
+    seq_om_ele = axiom_element_create(env, cmplx_type_om_node, "sequence", ns1, &seq_om_node);
+    attr = axiom_attribute_create(env, "type", "xsd:int", ns1);
+    attr_name_arg0 = axiom_attribute_create(env, "name", "arg_0_0", ns1);
+    attr_name_arg1 = axiom_attribute_create(env, "name", "arg_1_0", ns1);
+    arg0_om_ele = axiom_element_create(env, seq_om_node, "arg_0_0", ns1, &arg0_om_node);
+    AXIOM_ELEMENT_SET_TEXT(arg0_om_ele, env, "5", arg0_om_node);
+    AXIOM_ELEMENT_ADD_ATTRIBUTE(arg0_om_ele, env, attr, arg0_om_node);
+    AXIOM_ELEMENT_ADD_ATTRIBUTE(arg0_om_ele, env, attr_name_arg0, arg0_om_node);
+    arg1_om_ele = axiom_element_create(env, seq_om_node, "arg_1_0", ns1, &arg1_om_node);
+    AXIOM_ELEMENT_SET_TEXT(arg1_om_ele, env, "10", arg1_om_node);
+    AXIOM_ELEMENT_ADD_ATTRIBUTE(arg1_om_ele, env, attr_name_arg1, arg1_om_node);
+    AXIOM_ELEMENT_ADD_ATTRIBUTE(arg1_om_ele, env, attr, arg1_om_node);
+    
+    xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, 
+            AXIS2_FALSE, AXIS2_XML_PARSER_TYPE_BUFFER);
+    om_output = axiom_output_create( env, xml_writer);
+    
+    AXIOM_NODE_SERIALIZE(add_om_node, env, om_output);
+    buffer = AXIOM_XML_WRITER_GET_XML(xml_writer, env);         
+    printf("\nOM node in XML : %s \n",  buffer); 
+    AXIS2_FREE(env->allocator, buffer);
+    AXIOM_OUTPUT_FREE(om_output, env);
+
+    return add_om_node;
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message