axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r415506 - in /webservices/axis2/trunk/c/woden/samples/wsdl10: ./ CalculatorDoc.wsdl Makefile.am test_wsdl1.c
Date Tue, 20 Jun 2006 05:20:11 GMT
Author: damitha
Date: Mon Jun 19 22:20:10 2006
New Revision: 415506

URL: http://svn.apache.org/viewvc?rev=415506&view=rev
Log:
added wsdl1 sample

Added:
    webservices/axis2/trunk/c/woden/samples/wsdl10/
    webservices/axis2/trunk/c/woden/samples/wsdl10/CalculatorDoc.wsdl
    webservices/axis2/trunk/c/woden/samples/wsdl10/Makefile.am
    webservices/axis2/trunk/c/woden/samples/wsdl10/test_wsdl1.c

Added: webservices/axis2/trunk/c/woden/samples/wsdl10/CalculatorDoc.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/samples/wsdl10/CalculatorDoc.wsdl?rev=415506&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/samples/wsdl10/CalculatorDoc.wsdl (added)
+++ webservices/axis2/trunk/c/woden/samples/wsdl10/CalculatorDoc.wsdl Mon Jun 19 22:20:10
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/woden/samples/wsdl10/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/samples/wsdl10/Makefile.am?rev=415506&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/samples/wsdl10/Makefile.am (added)
+++ webservices/axis2/trunk/c/woden/samples/wsdl10/Makefile.am Mon Jun 19 22:20:10 2006
@@ -0,0 +1,20 @@
+prgbindir=$(prefix)/bin/samples/woden
+prgbin_PROGRAMS = test_wsdl1
+check_PROGRAMS = test_wsdl1
+test_wsdl1_SOURCES = \
+					 test_wsdl1.c
+					 
+test_wsdl1_LDADD   =  \
+                   	-laxis2_util \
+					-laxis2_axiom \
+					-laxis2_xml_schema \
+                    -laxis2_parser \
+					-lwoden_wsdl10 \
+					-lwoden_wsdl20 \
+                    $(GUTHTHILA_LIBS) \
+                    $(LIBXML2_LIBS)
+
+INCLUDES = -I$(top_builddir)/include \
+			@AXIOMINC@ \
+			@UTILINC@ \
+			@XMLSCHEMAINC@

Added: webservices/axis2/trunk/c/woden/samples/wsdl10/test_wsdl1.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/samples/wsdl10/test_wsdl1.c?rev=415506&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/samples/wsdl10/test_wsdl1.c (added)
+++ webservices/axis2/trunk/c/woden/samples/wsdl10/test_wsdl1.c Mon Jun 19 22:20:10 2006
@@ -0,0 +1,105 @@
+/*
+ * 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 <stdio.h>
+#include <axiom.h>
+#include <axiom_xml_reader.h>
+#include <axis2_env.h>
+#include <axis2_utils.h>
+#include <platforms/axis2_platform_auto_sense.h>
+#include <woden_reader.h>
+#include <woden_wsdl10_desc.h>
+#include <woden_interface.h>
+#include <woden_svc.h>
+
+#include <axiom.h>
+
+static axiom_document_t* 
+get_root_element_from_filename(
+        const axis2_env_t *env, 
+        axis2_char_t *filename);
+
+int main(int argc, char *argv[])
+{
+    axis2_env_t *env = NULL;
+    axiom_document_t *om_doc = NULL;
+    axis2_char_t *doc_base_uri = NULL;
+    axis2_char_t *axis2c_home = NULL;
+    woden_reader_t *reader = NULL;
+    void *desc = NULL;
+    void *intface = NULL;
+    axis2_array_list_t *intfaces = NULL;
+    axis2_qname_t *intface_qname = NULL;
+    axis2_char_t *filename = NULL;
+    axis2_array_list_t *svc_list = NULL;
+    
+    if(argc > 1)
+    {
+        filename = argv[1];
+        printf("filename:%s\n", filename);
+    }
+    else
+    {
+        printf("Give a wsdl2 file name and continue\n");
+        return 0;        
+    }
+    
+    env = axis2_env_create_all("test.log", 1);
+    
+    om_doc = get_root_element_from_filename(env, filename);
+    axis2c_home = AXIS2_GETENV("AXIS2C_HOME");
+    doc_base_uri = AXIS2_STRACAT (axis2c_home, "/woden", env);
+    reader = woden_reader_create(env);
+    
+    desc = (void *)WODEN_READER_READ_WSDL(reader, env, om_doc, doc_base_uri);
+    intfaces = WODEN_WSDL10_DESC_GET_INTERFACES(desc, env);
+    intface = AXIS2_ARRAY_LIST_GET(intfaces, env, 0);
+    intface_qname = WODEN_INTERFACE_GET_QNAME(intface, env);
+    printf("Interface qname is %s\n", AXIS2_QNAME_TO_STRING(intface_qname, env));
+    svc_list = WODEN_WSDL10_DESC_ELEMENT_GET_SVC_ELEMENTS(desc, env);
+    if (svc_list)
+    {
+        void *svc = NULL;
+        svc = AXIS2_ARRAY_LIST_GET(svc_list, env, 0);
+        if (svc)
+        {
+            axis2_qname_t *svc_qname = WODEN_SVC_GET_QNAME(svc, env);
+            if (svc_qname)
+            {
+                printf("First service qname is %s\n", AXIS2_QNAME_TO_STRING(svc_qname, env));
+            }
+        }
+    }
+    return 0;
+}
+
+static axiom_document_t* 
+get_root_element_from_filename(
+        const axis2_env_t *env, 
+        axis2_char_t *filename)
+{
+    axiom_xml_reader_t *reader = NULL;
+    axiom_stax_builder_t *om_builder = NULL;
+    axiom_document_t *doc   = NULL;
+
+    reader = axiom_xml_reader_create_for_file(env, filename, NULL);
+    om_builder = axiom_stax_builder_create(env, reader);
+    doc = axiom_document_create(env, NULL, om_builder); 
+    AXIOM_DOCUMENT_BUILD_ALL(doc, env);
+
+    return doc;    
+}
+



---------------------------------------------------------------------
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