diff options
Diffstat (limited to 'axiom')
328 files changed, 84884 insertions, 0 deletions
diff --git a/axiom/AUTHORS b/axiom/AUTHORS new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/axiom/AUTHORS diff --git a/axiom/COPYING b/axiom/COPYING new file mode 100644 index 0000000..6b0b127 --- /dev/null +++ b/axiom/COPYING @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. + diff --git a/axiom/CREDITS b/axiom/CREDITS new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/axiom/CREDITS diff --git a/axiom/ChangeLog b/axiom/ChangeLog new file mode 100644 index 0000000..0bd857b --- /dev/null +++ b/axiom/ChangeLog @@ -0,0 +1,6 @@ +Apache Axiom/C + + * Seperated Axiom module from Axis2/C + +-- Axis2-C team <axis-c-dev@ws.apache.org> Thu, 18 May 2006 + diff --git a/axiom/INSTALL b/axiom/INSTALL new file mode 100644 index 0000000..9406038 --- /dev/null +++ b/axiom/INSTALL @@ -0,0 +1,14 @@ +Getting Axiom/C source working on Linux +============================================= +Build the source +This can be done using the following command sequence: + ./configure + make + make install + use './configure --help' for options + +NOTE: If you don't provide a --prefix configure option, it will by default +install into /usr/local/axis2_axiom directory. + + + diff --git a/axiom/LICENSE b/axiom/LICENSE new file mode 100644 index 0000000..6b0b127 --- /dev/null +++ b/axiom/LICENSE @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. + diff --git a/axiom/Makefile.am b/axiom/Makefile.am new file mode 100644 index 0000000..a468a0c --- /dev/null +++ b/axiom/Makefile.am @@ -0,0 +1,9 @@ +datadir=$(prefix) +SUBDIRS = src $(TESTDIR) include +includedir=$(prefix)/include/axis2-1.6.0/ +include_HEADERS=$(top_builddir)/include/*.h +data_DATA= INSTALL README AUTHORS NEWS CREDITS LICENSE COPYING +EXTRA_DIST = build.sh autogen.sh CREDITS LICENSE +dist-hook: + rm -rf `find $(distdir)/ -type d -name .svn` + rm -rf `find $(distdir)/ -type d -name .deps` diff --git a/axiom/NEWS b/axiom/NEWS new file mode 100644 index 0000000..268572f --- /dev/null +++ b/axiom/NEWS @@ -0,0 +1,7 @@ +Axiom module seperated from Axis2/C +====================================== +Initially this was inside Axis2/C code base as axiom directory. As the +project expands it's moved to the top level with the view of making it a +seperate Apache project called Apache Axiom/C. + +-- Axis2-C team <axis-c-dev@ws.apache.org> Thu, 18 May 2006 diff --git a/axiom/README b/axiom/README new file mode 100644 index 0000000..0b442a7 --- /dev/null +++ b/axiom/README @@ -0,0 +1,57 @@ +
+ Apache Axiom/C
+ ================
+
+ What is it?
+ -----------
+
+ Axiom stands for AXis Object Model (also known as OM - Object Model) and
+ refers to the XML infoset model that is initially developed for Apache
+ Axis2. This is an effort to implement Apache Axiom in C.
+
+ Please have a look at http://ws.apache.org/axis2/c/docs/om_tutorial.html
+ for an introduction about Apache Axiom/C.
+
+ As a project of the Apache Software Foundation, the
+ developers aim to collaboratively develop and maintain a robust,
+ commercial-grade, standards-based Web Services stack implementation with
+ freely available source code.
+
+ The Latest Version
+ ------------------
+
+ You can get the latest svn checkout of Apache Axiom/C module from
+
+ https://svn.apache.org/repos/asf/webservices/axis2/trunk/c/axiom
+
+ Installation
+ ------------
+
+ Please see the file called INSTALL.
+
+ Licensing
+ ---------
+
+ Please see the file called LICENSE.
+
+ Contacts
+ --------
+
+ o If you want freely available support for using Apache Axiom/C please
+ join the Apache Axis2/C user community by subscribing to users mailing
+ list, axis-c-user@ws.apache.org' as described at
+ http://ws.apache.org/axis2/c/mail-lists.html
+
+ o If you have a bug report for Apache Axis2/C Guththila please log-in and create a JIRA issue
+ at http://issues.apache.org/jira/browse/AXIS2C
+
+ o If you want to participate actively in developing Apache Axis2/C Guththila please
+ subscribe to the `axis-c-dev@ws.apache.org' mailing list as described at
+ http://ws.apache.org/axis2/c/mail-lists.html
+
+
+ Acknowledgments
+ ----------------
+
+ Apache Axiom/C relies heavily on the use of autoconf, automake and libtool
+ to provide a build environment.
diff --git a/axiom/autogen.sh b/axiom/autogen.sh new file mode 100755 index 0000000..3862edc --- /dev/null +++ b/axiom/autogen.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +echo -n 'Running libtoolize...' +if [ `uname -s` = Darwin ] +then + LIBTOOLIZE=glibtoolize +else + LIBTOOLIZE=libtoolize +fi + +if $LIBTOOLIZE --force > /dev/null 2>&1; then + echo 'done.' +else + echo 'failed.' + exit 1 +fi + +echo -n 'Running aclocal...' +if aclocal > /dev/null 2>&1; then + echo 'done.' +else + echo 'failed.' + exit 1 +fi + +echo -n 'Running autoheader...' +if autoheader > /dev/null 2>&1; then + echo 'done.' +else + echo 'failed.' + exit 1 +fi + +echo -n 'Running autoconf...' +if autoconf > /dev/null 2>&1; then + echo 'done.' +else + echo 'failed.' + exit 1 +fi + +echo -n 'Running automake...' +if automake --add-missing > /dev/null 2>&1; then + echo 'done.' +else + echo 'failed.' + exit 1 +fi + +echo 'done' diff --git a/axiom/build.sh b/axiom/build.sh new file mode 100755 index 0000000..d39c3e7 --- /dev/null +++ b/axiom/build.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +./autogen.sh +./configure --prefix=${AXIS2C_HOME} --enable-static=no --enable-tests=no +make +make install + diff --git a/axiom/configure.ac b/axiom/configure.ac new file mode 100644 index 0000000..6802fb9 --- /dev/null +++ b/axiom/configure.ac @@ -0,0 +1,179 @@ +dnl run autogen.sh to generate the configure script. + +AC_PREREQ(2.59) + +AC_INIT(axis2_axiom-src, 1.6.0) +AC_CANONICAL_SYSTEM +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE +AC_PREFIX_DEFAULT(/usr/local/axis2_axiom) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CXX +AC_PROG_CPP +AC_PROG_LIBTOOL +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET + +dnl check for flavours of varargs macros (test from GLib) +AC_MSG_CHECKING(for ISO C99 varargs macros in C) +AC_TRY_COMPILE([],[ +int a(int p1, int p2, int p3); +#define call_a(...) a(1,__VA_ARGS__) +call_a(2,3); +],axis2c_have_iso_c_varargs=yes,axis2c_have_iso_c_varargs=no) +AC_MSG_RESULT($axis2c_have_iso_c_varargs) + +AC_MSG_CHECKING(for GNUC varargs macros) +AC_TRY_COMPILE([],[ +int a(int p1, int p2, int p3); +#define call_a(params...) a(1,params) +call_a(2,3); +],axis2c_have_gnuc_varargs=yes,axis2c_have_gnuc_varargs=no) +AC_MSG_RESULT($axis2c_have_gnuc_varargs) + +dnl Output varargs tests +if test x$axis2c_have_iso_c_varargs = xyes; then + AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros]) +fi +if test x$axis2c_have_gnuc_varargs = xyes; then + AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros]) +fi + +dnl Checks for libraries. +AC_CHECK_LIB(dl, dlopen) +AC_CHECK_LIB(z, inflate) + +#CFLAGS="$CFLAGS -ansi -Wall -D_LARGEFILE64_SOURCE -Wno-implicit-function-declaration" +CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE" +if test "$GCC" = "yes"; then + CFLAGS="$CFLAGS -ansi -Werror -Wall -Wno-implicit-function-declaration " +fi + + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([stdio.h stdlib.h string.h]) +AC_CHECK_HEADERS([sys/socket.h]) +AC_CHECK_HEADERS([linux/if.h],[],[], +[ +#if HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#endif +]) + +dnl This is a check to see if we are running MacOS X +dnl It may be better to do a Darwin check +AC_CHECK_HEADER([sys/appleapiopts.h], + [AC_DEFINE([IS_MACOSX],[1],[Define to 1 if compiling on MacOS X])], + []) + +dnl Checks for typedefs, structures, and compiler characteristics. +dnl AC_C_CONST + +dnl Checks for library functions. +dnl AC_FUNC_MALLOC +dnl AC_FUNC_REALLOC +#AC_CHECK_FUNCS([memmove]) + +AC_MSG_CHECKING(whether to build xpath) +AC_ARG_ENABLE(xpath, [ --enable-xpath build xpath. default=yes], +[ case "${enableval}" in + no) + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_RESULT(yes) + XPATH_DIR="xpath" + + ;; + esac ], + AC_MSG_RESULT(yes) + XPATH_DIR="xpath" +) + + +AC_MSG_CHECKING(whether to build guththila xml parser library) +AC_ARG_ENABLE(guththila, [ --enable-guththila build guththila xml parser library wrapper. default=yes], +[ case "${enableval}" in + no) + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_RESULT(yes) + WRAPPER_DIR="guththila" + + ;; + esac ], + AC_MSG_RESULT(yes) + WRAPPER_DIR="guththila" +) + +AC_MSG_CHECKING(whether to build libxml2 xml parser library) +AC_ARG_ENABLE(libxml2, [ --enable-libxml2 build libxml2 xml parser library wrapper. default=no], +[ case "${enableval}" in + no) + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_RESULT(yes) + CFLAGS="$CFLAGS -DAXIS2_LIBXML2_ENABLED" + WRAPPER_DIR="libxml2" + PKG_CHECK_MODULES(LIBXML2, libxml-2.0) + + ;; + esac ], + AC_MSG_RESULT(no) +) + + +AC_MSG_CHECKING(whether to build tests) +AC_ARG_ENABLE(tests, [ --enable-tests build tests. default=no], +[ case "${enableval}" in + yes) + AC_MSG_RESULT(yes) + TESTDIR="test" + ;; + *) + AC_MSG_RESULT(no) + TESTDIR="" + + ;; + esac ], + AC_MSG_RESULT(no) + TESTDIR="" +) + +PKG_PROG_PKG_CONFIG(0.15) +CFLAGS="$CFLAGS $GUTHTHILA_CFLAGS" +VERSION_NO="6:0:6" + +AC_SUBST(VERSION_NO) +AC_SUBST(LIBXML2_CFLAGS) +AC_SUBST(LIBXML2_LIBS) +AC_SUBST(WRAPPER_DIR) +AC_SUBST(GUTHTHILA_LIBS) +AC_SUBST(TESTDIR) +AC_SUBST(XPATH_DIR) + +AC_CONFIG_FILES([Makefile \ + src/Makefile \ + src/parser/Makefile \ + src/parser/libxml2/Makefile \ + src/parser/guththila/Makefile \ + src/soap/Makefile \ + src/om/Makefile \ + src/util/Makefile \ + src/attachments/Makefile \ + src/xpath/Makefile \ + test/Makefile \ + test/om/Makefile \ + test/soap/Makefile \ + test/util/Makefile \ + test/xpath/Makefile \ + include/Makefile + ]) + +AC_OUTPUT diff --git a/axiom/include/Makefile.am b/axiom/include/Makefile.am new file mode 100644 index 0000000..d938299 --- /dev/null +++ b/axiom/include/Makefile.am @@ -0,0 +1 @@ +TESTS = diff --git a/axiom/include/axiom.h b/axiom/include/axiom.h new file mode 100644 index 0000000..38272d6 --- /dev/null +++ b/axiom/include/axiom.h @@ -0,0 +1,57 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_H +#define AXIOM_H +#include <axiom_node.h> +#include <axiom_attribute.h> +#include <axiom_child_element_iterator.h> +#include <axiom_children_iterator.h> +#include <axiom_children_qname_iterator.h> +#include <axiom_children_with_specific_attribute_iterator.h> +#include <axiom_comment.h> +#include <axiom_doctype.h> +#include <axiom_document.h> +#include <axiom_element.h> +#include <axiom_namespace.h> +#include <axiom_navigator.h> +#include <axiom_output.h> +#include <axiom_processing_instruction.h> +#include <axiom_stax_builder.h> +#include <axiom_text.h> +#include <axiom_data_source.h> +#include <axiom_xml_reader.h> +#include <axiom_xml_writer.h> +#include <axiom_defines.h> + +/** +* @file axiom.h +* @brief includes all headers in OM +*/ +#ifdef __cplusplus +extern "C" +{ +#endif + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_H */ diff --git a/axiom/include/axiom_attribute.h b/axiom/include/axiom_attribute.h new file mode 100644 index 0000000..b0a6e8e --- /dev/null +++ b/axiom/include/axiom_attribute.h @@ -0,0 +1,263 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You 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. +*/ + +#ifndef AXIOM_ATTRIBUTE_H +#define AXIOM_ATTRIBUTE_H + +/** +* @file axiom_attribute.h +* @brief om attribute struct represents an xml attribute +*/ +#include <axutil_env.h> +#include <axutil_qname.h> +#include <axiom_namespace.h> +#include <axiom_output.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_attribute attribute + * @ingroup axiom_om + * @{ + */ + + typedef struct axiom_attribute axiom_attribute_t; + + /** + * creates an om_attribute struct + * @param env Environment. MUST NOT be NULL + * @param localname localname of the attribute, should not be a null value. + * @param value normalized attribute value. cannot be NULL + * @param ns namespace, if any, of the attribute. Optional, can be NULL om_attribute wont free the ns + * @return a pointer to newly created attribute struct, returns NULL on error with + * error code set in environment's error. + */ + AXIS2_EXTERN axiom_attribute_t *AXIS2_CALL + axiom_attribute_create( + const axutil_env_t * env, + const axis2_char_t * localname, + const axis2_char_t * value, + axiom_namespace_t * ns); + + /** + * Free om attribute passed as void pointer. This will be + * cast into appropriate type and then pass the cast object + * into the om_attribute structure's free method + * @param om_attribute pointer to attribute struct to be freed + * @param env Environment. MUST NOT be NULL + */ + + AXIS2_EXTERN void AXIS2_CALL + axiom_attribute_free_void_arg( + void *om_attribute, + const axutil_env_t * env); + + /** + * Free an axiom_attribute struct + * @param om_attribute pointer to attribute struct to be freed + * @param env Environment. MUST NOT be NULL + */ + + AXIS2_EXTERN void AXIS2_CALL + axiom_attribute_free( + struct axiom_attribute *om_attribute, + const axutil_env_t * env); + + /** + * Creates and returns a qname struct for this attribute + * @param om_attribute pointer to attribute struct + * for which the qname is to be returned + * @param env Environment. MUST NOT be NULL + * @return returns qname for given attribute.NULL on error + */ + + AXIS2_EXTERN axutil_qname_t *AXIS2_CALL + axiom_attribute_get_qname( + struct axiom_attribute *om_attribute, + const axutil_env_t * env); + + /** + * Serialize op + * @param om_attribute pointer to attribute struct to be serialized + * @param env Environment. MUST NOT be NULL, + * @param om_output AXIOM output handler to be used in serializing + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE. + */ + + AXIS2_EXTERN int AXIS2_CALL + axiom_attribute_serialize( + struct axiom_attribute *om_attribute, + const axutil_env_t * env, + axiom_output_t * om_output); + + /** Returns the localname of this attribute + * @param om_attribute pointer to attribute struct + * @param env environment. MUST NOT not be NULL. + * @return localname returns NULL on error. + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_attribute_get_localname( + struct axiom_attribute *om_attribute, + const axutil_env_t * env); + + /** + * returns value of this attribute + *@param om_attribute pointer to om_attribute struct + *@param env environment N not be null + *@return value , null on error + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_attribute_get_value( + struct axiom_attribute *om_attribute, + const axutil_env_t * env); + + /** + * returns namespace of this attribute + *@param om_attribute + *@param env environment MUST NOT be NULL + *@return a pointer to om_namespace struct , returns NULL on error. + */ + AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL + axiom_attribute_get_namespace( + struct axiom_attribute *om_attribute, + const axutil_env_t * env); + + /** sets the localname of the attribute + *@param om_attribute pointer to om attribute struct. + *@param env environment, MUST NOT be null. + *@param localname localname that should be set for this attribute + *@return status code AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_attribute_set_localname( + struct axiom_attribute *om_attribute, + const axutil_env_t * env, + const axis2_char_t * localname); + + /** set the attribute value + *@param om_attribute a pointer to om_attribute struct. + *@param env environment, MUST NOT be NULL. + *@param value value that should be set for this attribute + *@return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_attribute_set_value( + struct axiom_attribute *om_attribute, + const axutil_env_t * env, + const axis2_char_t * value); + + /** set namespace of the attribute + *@param om_attribute a pointer to om_attribute struct + *@param env environment, MUST NOT be NULL. + *@param om_namespace a pointer to om_namespace struct that should be set + * for this attribute + *@return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_attribute_set_namespace( + struct axiom_attribute *om_attribute, + const axutil_env_t * env, + axiom_namespace_t * om_namespace); + + /** + * clones an om attribute + * @param om_attibute + * @param env environment + * @returns pointer to cloned om attribute struct on success + * NULL otherwise + */ + AXIS2_EXTERN struct axiom_attribute *AXIS2_CALL + axiom_attribute_clone( + struct axiom_attribute *om_attribute, + const axutil_env_t * env); + + /** Increment the reference counter. + * @param om_attribute a pointer to om_attribute struct + * @param env environment, MUST NOT be NULL. + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_attribute_increment_ref( + struct axiom_attribute *om_attribute, + const axutil_env_t * env); + + /** Create OM attribute + * @param om_attribute a pointer to om_attribute struct + * @param env environment, MUST NOT be NULL. + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axiom_attribute_t *AXIS2_CALL + axiom_attribute_create_str( + const axutil_env_t * env, + axutil_string_t * localname, + axutil_string_t * value, + axiom_namespace_t * ns); + + /** Get the localname as a string + * @param om_attribute a pointer to om_attribute struct + * @param env environment, MUST NOT be NULL. + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axutil_string_t *AXIS2_CALL + axiom_attribute_get_localname_str( + axiom_attribute_t * attribute, + const axutil_env_t * env); + + /** Get the value as a string + * @param om_attribute a pointer to om_attribute struct + * @param env environment, MUST NOT be NULL. + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axutil_string_t *AXIS2_CALL + axiom_attribute_get_value_str( + axiom_attribute_t * attribute, + const axutil_env_t * env); + + /** Set the localname of the attribute + * @param om_attribute a pointer to om_attribute struct + * @param env environment, MUST NOT be NULL. + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_attribute_set_localname_str( + axiom_attribute_t * attribute, + const axutil_env_t * env, + axutil_string_t * localname); + + /** Set the value of the attribute + * @param om_attribute a pointer to om_attribute struct + * @param env environment, MUST NOT be NULL. + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_attribute_set_value_str( + axiom_attribute_t * attribute, + const axutil_env_t * env, + axutil_string_t * value); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_ATTRIBUTE_H */ diff --git a/axiom/include/axiom_child_element_iterator.h b/axiom/include/axiom_child_element_iterator.h new file mode 100644 index 0000000..627a347 --- /dev/null +++ b/axiom/include/axiom_child_element_iterator.h @@ -0,0 +1,124 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_CHILD_ELEMENT_ITERATOR_H +#define AXIOM_CHILD_ELEMENT_ITERATOR_H + +/** +*@file axiom_child_element_iterator.h +*@brief this is the iterator for om elemnts +*/ + +#include <axiom_node.h> +#include <axiom_text.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_child_element_iterator + axiom_child_element_iterator_t; + + /** + * @defgroup axiom_child_element_iterator child element iterator + * @ingroup axiom_om + * @{ + */ + + /** + * Free the iterator + * @param iterator a pointer to child element iterator struct + * @param env environment, MUST NOT be NULL. + */ + + AXIS2_EXTERN void AXIS2_CALL + axiom_child_element_iterator_free( + void *iterator, + const axutil_env_t * env); + + /** + * Removes from the underlying collection the last element returned by the + * iterator (optional op). This method can be called only once per + * call to <tt>next</tt>. The behavior of an iterator is unspecified if + * the underlying collection is modified while the iteration is in + * progress in any way other than by calling this method. + * @param iterator a pointer to child element iterator struct + * @param env environment, MUST NOT be NULL. + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_child_element_iterator_remove( + axiom_child_element_iterator_t * iterator, + const axutil_env_t * env); + + /** + * returns true if the iteration has more elements + * in otherwords it returns true if the next() would return an element + * rather than null with an error code set to environments error + * @param iterator a pointer to child element iterator struct + * @param env environment, MUST NOT be NULL. + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + + axiom_child_element_iterator_has_next( + axiom_child_element_iterator_t * iterator, + const axutil_env_t * env); + + /** + * Returns the next element in the iteration. Returns null if there + * is no more elements + * @param iterator a pointer to child element iterator struct + * @param env environment, MUST NOT be NULL. + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_child_element_iterator_next( + axiom_child_element_iterator_t * iterator, + const axutil_env_t * env); + + /** + * Create a child element interator for the current child + * @param current child + * @param env environment, MUST NOT be NULL. + * return axiom_child_element_iterator_t + */ + + AXIS2_EXTERN axiom_child_element_iterator_t *AXIS2_CALL + axiom_child_element_iterator_create( + const axutil_env_t * env, + axiom_node_t * current_child); + +#define AXIOM_CHILD_ELEMENT_ITERATOR_FREE(iterator, env) \ + axiom_child_element_iterator_free(iterator, env) + +#define AXIOM_CHILD_ELEMENT_ITERATOR_REMOVE(iterator, env) \ + axiom_child_element_iterator_remove(iterator, env) + +#define AXIOM_CHILD_ELEMENT_ITERATOR_HAS_NEXT(iterator, env) \ + axiom_child_element_iterator_has_next(iterator, env) + +#define AXIOM_CHILD_ELEMENT_ITERATOR_NEXT(iterator, env) \ + axiom_child_element_iterator_next(iterator, env) + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_CHILD_ELEMENT_ITERATOR_H */ diff --git a/axiom/include/axiom_children_iterator.h b/axiom/include/axiom_children_iterator.h new file mode 100644 index 0000000..c0e802a --- /dev/null +++ b/axiom/include/axiom_children_iterator.h @@ -0,0 +1,123 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_CHILDREN_ITERATOR_H +#define AXIOM_CHILDREN_ITERATOR_H + +/** +*@file axiom_children_iterator.h +*@brief this is the iterator for om nodes +*/ + +#include <axiom_node.h> +#include <axiom_text.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_children_iterator axiom_children_iterator_t; + + /** + * @defgroup axiom_children_iterator children iterator + * @ingroup axiom_om + * @{ + */ + + /** + * @param current child + * @param env environment + * return axiom_children_iterator_t + */ + + AXIS2_EXTERN axiom_children_iterator_t *AXIS2_CALL + + axiom_children_iterator_create( + const axutil_env_t * env, + axiom_node_t * current_child); + + /** + * Free the om_children_iterator struct + * @param iterator a pointer to axiom children iterator struct + * @param env environment, MUST NOT be NULL + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_children_iterator_free( + axiom_children_iterator_t * iterator, + const axutil_env_t * env); + + /** + * Removes from the underlying collection the last element returned by the + * iterator (optional op). This method can be called only once per + * call to <tt>next</tt>. The behavior of an iterator is unspecified if + * the underlying collection is modified while the iteration is in + * progress in any way other than by calling this method. + * @param iterator a pointer to axiom children iterator struct + * @param env environment, MUST NOT be NULL + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_children_iterator_remove( + axiom_children_iterator_t * iterator, + const axutil_env_t * env); + + /** + * @returns true if the iteration has more elements. In other + * words, returns true if next() would return an om_node_t struct + * rather than null with error code set in environment + * @param iterator a pointer to axiom children iterator struct + * @param env environment, MUST NOT be NULL + */ + + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_children_iterator_has_next( + axiom_children_iterator_t * iterator, + const axutil_env_t * env); + + /** + * Returns the next element in the iteration. Returns null if there are + * no more elements in the iteration + * @param iterator a pointer to axiom children iterator struct + * @param env environment, MUST NOT be NULL + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_children_iterator_next( + axiom_children_iterator_t * iterator, + const axutil_env_t * env); + + /** + * Resets the Iterator. This moves the cursor back to the initial. + * iterator chidren_iterator to be reset. + * @param iterator a pointer to axiom children iterator struct + * @param env environment, MUST NOT be NULL + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_children_iterator_reset( + axiom_children_iterator_t * iterator, + const axutil_env_t * env); + + /************ Macros *********************************************/ + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_CHILDREN_ITERATOR_H */ diff --git a/axiom/include/axiom_children_qname_iterator.h b/axiom/include/axiom_children_qname_iterator.h new file mode 100644 index 0000000..f7daa66 --- /dev/null +++ b/axiom/include/axiom_children_qname_iterator.h @@ -0,0 +1,107 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_CHILDREN_QNAME_ITERATOR_H +#define AXIOM_CHILDREN_QNAME_ITERATOR_H + +/** + *@file axiom_children_qname_iterator.h + *@brief this is the iterator for om nodes using qname + */ + +#include <axiom_node.h> +#include <axiom_namespace.h> +#include <axutil_qname.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_children_qname_iterator + axiom_children_qname_iterator_t; + + /** + * @defgroup axiom_children_qname_iterator children qname iterator + * @ingroup axiom_om + * @{ + */ + + AXIS2_EXTERN axiom_children_qname_iterator_t *AXIS2_CALL + axiom_children_qname_iterator_create( + const axutil_env_t * env, + axiom_node_t * current_child, + axutil_qname_t * given_qname); + + /** + * free om_children_qname_iterator struct + * @param iterator a pointer to axiom children iterator struct + * @param env environment, MUST NOT be NULL + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_children_qname_iterator_free( + axiom_children_qname_iterator_t * iterator, + const axutil_env_t * env); + + /** + * Removes from the underlying collection the last element returned by the + * iterator (optional operation). This method can be called only once per + * call to <tt>next</tt>. The behavior of an iterator is unspecified if + * the underlying collection is modified while the iteration is in + * progress in any way other than by calling this method. + * @param iterator a pointer to axiom children iterator struct + * @param env environment, MUST NOT be NULL + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_children_qname_iterator_remove( + axiom_children_qname_iterator_t * iterator, + const axutil_env_t * env); + + /** + * Returns <tt>true</tt> if the iteration has more elements. (In other + * words, returns <tt>true</tt> if <tt>next</tt> would return an + * axiom_node_t struct rather than null with error code set in environment + * @param iterator a pointer to axiom children iterator struct + * @param env environment, MUST NOT be NULL + */ + + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + + axiom_children_qname_iterator_has_next( + axiom_children_qname_iterator_t * iterator, + const axutil_env_t * env); + + /** + * Returns the next element in the iteration. + * @param iterator a pointer to axiom children iterator struct + * @param env environment, MUST NOT be NULL + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_children_qname_iterator_next( + axiom_children_qname_iterator_t * iterator, + const axutil_env_t * env); + + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_CHILDREN_QNAME_ITERATOR_H */ diff --git a/axiom/include/axiom_children_with_specific_attribute_iterator.h b/axiom/include/axiom_children_with_specific_attribute_iterator.h new file mode 100644 index 0000000..cbfb21d --- /dev/null +++ b/axiom/include/axiom_children_with_specific_attribute_iterator.h @@ -0,0 +1,128 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_CHILDREN_WITH_SPECIFIC_ATTRIBUTE_ITERATOR_H +#define AXIOM_CHILDREN_WITH_SPECIFIC_ATTRIBUTE_ITERATOR_H + +/** +*@file axiom_children_with_specific_attribute_iterator.h +*@brief this is the iterator for om nodes +*/ + +#include <axiom_node.h> +#include <axiom_text.h> +#include <axutil_qname.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_children_with_specific_attribute_iterator + axiom_children_with_specific_attribute_iterator_t; + + /** + * @defgroup axiom_children_with_specific_attribute_iterator children with specific attribute iterator + * @ingroup axiom_om + * @{ + */ + + /** + * Free function free the om_children_with_specific_attribute_iterator struct + * @param iterator a pointer to axiom children with specific attribute iterator struct + * @param env environment, MUST NOT be NULL + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_children_with_specific_attribute_iterator_free( + axiom_children_with_specific_attribute_iterator_t * iterator, + const axutil_env_t * env); + + /** + * Removes from the underlying collection the last element returned by the + * iterator (optional op). This method can be called only once per + * call to <tt>next</tt>. The behavior of an iterator is unspecified if + * the underlying collection is modified while the iteration is in + * progress in any way other than by calling this method. + * @param iterator a pointer to axiom children with specific attribute iterator struct + * @param env environment, MUST NOT be NULL + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_children_with_specific_attribute_iterator_remove( + axiom_children_with_specific_attribute_iterator_t * iterator, + const axutil_env_t * env); + + /** + * Returns true< if the iteration has more elements. (In other + * words, returns true if next would return an axiom_node_t struct + * rather than NULL with error code set in environment + * @param iterator a pointer to axiom children with specific attribute iterator struct + * @param env environment, MUST NOT be NULL + */ + + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_children_with_specific_attribute_iterator_has_next( + axiom_children_with_specific_attribute_iterator_t * iterator, + const axutil_env_t * env); + + /** + * Returns the next element in the iteration. returns null if there is no + * more elements in the iteration + * @param iterator a pointer to axiom children with specific attribute iterator struct + * @param env environment, MUST NOT be NULL + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_children_with_specific_attribute_iterator_next( + axiom_children_with_specific_attribute_iterator_t * iterator, + const axutil_env_t * env); + + /** + * @param env environment, MUST NOT be NULL + * @param current_child the current child for the interation + * @param attr_qname the qname for the attribute + * @param attr_value the value string for the attribute + * @param detach AXIS2_TRUE to detach AXIS2_FALSE not to + * return axiom_children_with_specific_attribute_iterator_t + */ + + AXIS2_EXTERN axiom_children_with_specific_attribute_iterator_t *AXIS2_CALL + axiom_children_with_specific_attribute_iterator_create( + const axutil_env_t * env, + axiom_node_t * current_child, + axutil_qname_t * attr_qname, + axis2_char_t * attr_value, + axis2_bool_t detach); + +#define AXIOM_CHILDREN_WITH_SPECIFIC_ATTRIBUTE_ITERATOR_FREE(iterator, env) \ + axiom_children_with_specific_attribute_iterator_free(iterator, env) + +#define AXIOM_CHILDREN_WITH_SPECIFIC_ATTRIBUTE_ITERATOR_REMOVE(iterator, env) \ + axiom_children_with_specific_attribute_iterator_remove(iterator, env) + +#define AXIOM_CHILDREN_WITH_SPECIFIC_ATTRIBUTE_ITERATOR_HAS_NEXT(iterator, env) \ + axiom_children_with_specific_attribute_iterator_has_next(iterator, env) + +#define AXIOM_CHILDREN_WITH_SPECIFIC_ATTRIBUTE_ITERATOR_NEXT(iterator, env) \ + axiom_children_with_specific_attribute_iterator_next(iterator, env) + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_CHILDREN_WITH_SPECIFIC_ATTRIBUTE_ITERATOR_H */ diff --git a/axiom/include/axiom_comment.h b/axiom/include/axiom_comment.h new file mode 100644 index 0000000..63d048e --- /dev/null +++ b/axiom/include/axiom_comment.h @@ -0,0 +1,115 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_COMMENT_H +#define AXIOM_COMMENT_H + +/** + * @file axiom_comment.h + * @brief defines axiom_comment_t struct, and manipulation functions + */ + +#include <axiom_node.h> +#include <axiom_output.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_comment comment + * @ingroup axiom_om + * @{ + */ + + typedef struct axiom_comment axiom_comment_t; + + /** + * Creates a comment struct + * @param env Environment. MUST NOT be NULL, + * @param parent This is the parent node of the comment is any, can be NULL. + * @param value comment text + * @param node This is an out parameter.cannot be NULL. + * Returns the node corresponding to the comment created. + * Node type will be set to AXIOM_COMMENT + * @return a pointer to the newly created comment struct + */ + AXIS2_EXTERN axiom_comment_t *AXIS2_CALL + axiom_comment_create( + const axutil_env_t * env, + axiom_node_t * parent, + const axis2_char_t * value, + axiom_node_t ** node); + + /** + * Free a axis2_comment_t struct + * @param om_comment pointer to axis2_commnet_t struct to be freed + * @param env Environment. MUST NOT be NULL. + * @return satus of the op. + * AXIS2_SUCCESS on success ,AXIS2_FAILURE on error. + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_comment_free( + struct axiom_comment *om_comment, + const axutil_env_t * env); + + /** get the comments data + * @param om_comment a pointer to axiom_comment_t struct + * @param env environment, MUST NOT be NULL + * @returns comment text + */ + + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_comment_get_value( + struct axiom_comment *om_comment, + const axutil_env_t * env); + + /** + * set comment data + * @param om_comment pointer to axiom_comment_t struct + * @param env environment, MUST NOT be NULL. + * @param value comment text + * @returns AXIS2_SUCCESS on success , AXIS2_FAILURE on error + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_comment_set_value( + struct axiom_comment *om_comment, + const axutil_env_t * env, + const axis2_char_t * value); + + /** + * serialize function + * @param om_comment pointer to axiom_comment_t struct + * @param env environment, MUST NOT be NULL. + * @param om_output pointer to om_output_t struct + * @return AXIS2_SUCCESS on success, AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_comment_serialize( + struct axiom_comment *om_comment, + const axutil_env_t * env, + axiom_output_t * om_output); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_COMMENT_H */ diff --git a/axiom/include/axiom_data_handler.h b/axiom/include/axiom_data_handler.h new file mode 100644 index 0000000..0cf65c9 --- /dev/null +++ b/axiom/include/axiom_data_handler.h @@ -0,0 +1,260 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_DATA_HANDLER_H +#define AXIOM_DATA_HANDLER_H + +/** + * @file axiom_data_handler.h + * @brief axis2 data_handler interface + */ + +#include <axutil_utils.h> +#include <axutil_error.h> +#include <axutil_utils_defines.h> +#include <axutil_env.h> +#include <axutil_allocator.h> +#include <axutil_string.h> +#include <axutil_array_list.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef enum axiom_data_handler_type + { + AXIOM_DATA_HANDLER_TYPE_FILE, + AXIOM_DATA_HANDLER_TYPE_BUFFER, + AXIOM_DATA_HANDLER_TYPE_CALLBACK + } axiom_data_handler_type_t; + + typedef struct axiom_data_handler axiom_data_handler_t; + + /** @defgroup axiom_data_handler Flow + * @ingroup axiom_data_handler + * @{ + */ + + /** + * @param data_handler, a pointer to data handler struct + * @param env environment, MUST NOT be NULL. + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_data_handler_get_content_type( + axiom_data_handler_t * data_handler, + const axutil_env_t * env); + + /** + * @param data_handler, a pointer to data handler struct + * @param env environment, MUST NOT be NULL. + * @param mime type, + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_data_handler_set_content_type( + axiom_data_handler_t * data_handler, + const axutil_env_t * env, + const axis2_char_t *mime_type); + + /** + * @param data_handler, a pointer to data handler struct + * @param env environment, MUST NOT be NULL. + * @return bool whether attachment is cached or not + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_data_handler_get_cached( + axiom_data_handler_t * data_handler, + const axutil_env_t * env); + + /** + * @param data_handler, a pointer to data handler struct + * @param env environment, MUST NOT be NULL. + * @param cached, + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_data_handler_set_cached( + axiom_data_handler_t * data_handler, + const axutil_env_t * env, + axis2_bool_t cached); + + + /** + * @param data_handler, a pointer to data handler struct + * @param env environment, MUST NOT be NULL. + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_byte_t *AXIS2_CALL + + axiom_data_handler_get_input_stream( + axiom_data_handler_t * data_handler, + const axutil_env_t * env); + + /** + * @param data_handler, a pointer to data handler struct + * @param env environment, MUST NOT be NULL. + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN size_t AXIS2_CALL + axiom_data_handler_get_input_stream_len( + axiom_data_handler_t * data_handler, + const axutil_env_t * env); + + /** + * The data_handler is responsible for memory occupied by the stream + * returned + * @param output_stream parameter to store reference to output byte stream. + * @param output_stream_size parameter to store reference to output byte + * stream length + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_data_handler_read_from( + axiom_data_handler_t * data_handler, + const axutil_env_t * env, + axis2_byte_t ** output_stream, + size_t *output_stream_size); + + /** + * @param data_handler, a pointer to data handler struct + * @param env environment, MUST NOT be NULL. + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_data_handler_set_binary_data( + axiom_data_handler_t * data_handler, + const axutil_env_t * env, + axis2_byte_t * input_stream, + size_t input_stream_len); + + /** + * @param data_handler, a pointer to data handler struct + * @param env environment, MUST NOT be NULL. + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_data_handler_write_to( + axiom_data_handler_t * data_handler, + const axutil_env_t * env); + + /** + * @param data_handler, a pointer to data handler struct + * @param env environment, MUST NOT be NULL. + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_data_handler_set_file_name( + axiom_data_handler_t * data_handler, + const axutil_env_t * env, + axis2_char_t * file_name); + + /** + * @param data_handler, a pointer to data handler struct + * @param env environment, MUST NOT be NULL. + * @return file name, in the case of file type data handler. + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_data_handler_get_file_name( + axiom_data_handler_t * data_handler, + const axutil_env_t * env); + + /** + * @param data_handler, a pointer to data handler struct + * @param env environment, MUST NOT be NULL. + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_data_handler_free( + axiom_data_handler_t * data_handler, + const axutil_env_t * env); + + /** + * Creates data_handler struct + * @return pointer to newly created data_handler + */ + AXIS2_EXTERN axiom_data_handler_t *AXIS2_CALL + axiom_data_handler_create( + const axutil_env_t * env, + const axis2_char_t * file_name, + const axis2_char_t * mime_type); + + /* Add the binary to the array_list + * @param data_handler, a pointer to data handler struct + * data_handler, a pointer to data handler struct + * list, a pointer to an array_list which containing some message parts need + * to be written to the wire + * data_handler, a pointer to data handler struct + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_data_handler_add_binary_data( + axiom_data_handler_t *data_handler, + const axutil_env_t *env, + axutil_array_list_t *list); + + + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_data_handler_get_mime_id( + axiom_data_handler_t *data_handler, + const axutil_env_t *env); + + /** + * @param data_handler, a pointer to data handler struct + * @param env environment, MUST NOT be NULL. + * @param mime id, + * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error. + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_data_handler_set_mime_id( + axiom_data_handler_t *data_handler, + const axutil_env_t *env, + const axis2_char_t *mime_id); + + + AXIS2_EXTERN axiom_data_handler_type_t AXIS2_CALL + axiom_data_handler_get_data_handler_type( + axiom_data_handler_t *data_handler, + const axutil_env_t *env); + + AXIS2_EXTERN void AXIS2_CALL + axiom_data_handler_set_data_handler_type( + axiom_data_handler_t *data_handler, + const axutil_env_t *env, + axiom_data_handler_type_t data_handler_type); + + AXIS2_EXTERN void *AXIS2_CALL + axiom_data_handler_get_user_param( + axiom_data_handler_t *data_handler, + const axutil_env_t *env); + + AXIS2_EXTERN void AXIS2_CALL + axiom_data_handler_set_user_param( + axiom_data_handler_t *data_handler, + const axutil_env_t *env, + void *user_param); + + + /** @} */ + +#ifdef __cplusplus +} +#endif +#endif /* AXIOM_DATA_HANDLER_H */ diff --git a/axiom/include/axiom_data_source.h b/axiom/include/axiom_data_source.h new file mode 100644 index 0000000..f892682 --- /dev/null +++ b/axiom/include/axiom_data_source.h @@ -0,0 +1,111 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_DATA_SOURCE_H +#define AXIOM_DATA_SOURCE_H + +/** + * @file axiom_data_source.h + * @brief Axis2 AXIOM XML data_source + */ + +#include <axutil_env.h> +#include <axiom_node.h> +#include <axiom_output.h> +#include <axutil_stream.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_data_source data_source + * @ingroup axiom_om + * @{ + */ + + /** + * \brief data_source struct + * Handles the XML data_source in OM + */ + typedef struct axiom_data_source axiom_data_source_t; + + /** + * Creates a new data_source struct + * @param env Environment. MUST NOT be NULL, . + * @param parent parent of the new node. Optinal, can be NULL. + * The parent element must be of type AXIOM_ELEMENT + * @param value Text value. Optinal, can be NULL. + * @param comment_node This is an out parameter. cannot be NULL. + * Returns the node corresponding to the data_source struct created. + * Node type will be set to AXIOM_DATA_SOURCE + * @return pointer to newly created data_source struct + */ + AXIS2_EXTERN axiom_data_source_t *AXIS2_CALL + axiom_data_source_create( + const axutil_env_t * env, + axiom_node_t * parent, + axiom_node_t ** node); + + /** + * Free an axiom_data_source struct + * @param env environment. MUST NOT be NULL. + * @param om_data_source pointer to om data_source struct to be freed. + * @return satus of the op. AXIS2_SUCCESS on success + * AXIS2_FAILURE on error. + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_data_source_free( + struct axiom_data_source *om_data_source, + const axutil_env_t * env); + + /** + * Serialize op + * @param env environment. MUST NOT be NULL. + * @param om_data_source pointer to om data_source struct to be serialized. + * @param om_output AXIOM output handler to be used in serializing. + * @return satus of the op. AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_data_source_serialize( + struct axiom_data_source *om_data_source, + const axutil_env_t * env, + axiom_output_t * om_output); + + /** + * set the data_source value + * @param om_data_source om_data_source struct + * @param env environment , MUST NOT be NULL. + * @param value data_source + * @return status of the op. AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axutil_stream_t *AXIS2_CALL + axiom_data_source_get_stream( + struct axiom_data_source *om_data_source, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_DATA_SOURCE_H */ diff --git a/axiom/include/axiom_defines.h b/axiom/include/axiom_defines.h new file mode 100644 index 0000000..9cf4b51 --- /dev/null +++ b/axiom/include/axiom_defines.h @@ -0,0 +1,40 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_DEFINES_H +#define AXIOM_DEFINES_H + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * This enum is used to decide the type of storage used + */ + typedef enum _axis2_xml_parser_type + { + AXIS2_XML_PARSER_TYPE_BUFFER = 1, + AXIS2_XML_PARSER_TYPE_FILE, + AXIS2_XML_PARSER_TYPE_DOC + } axis2_xml_parser_type; + +#ifdef __cplusplus +} +#endif +#endif /* AXIOM_DEFINES_H */ diff --git a/axiom/include/axiom_doctype.h b/axiom/include/axiom_doctype.h new file mode 100644 index 0000000..a054c6e --- /dev/null +++ b/axiom/include/axiom_doctype.h @@ -0,0 +1,120 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_DOCTYPE_H +#define AXIOM_DOCTYPE_H + +/** + *@file axiom_doctype.h + *@brief defines struct representing xml DTD and its manipulation functions + */ + +#include <axiom_node.h> +#include <axiom_output.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + struct axiom_doctype; + struct axiom_doctype_ops; + + /** + * @defgroup axiom_doctype doctype + * @ingroup axiom_om + * @{ + */ + + typedef struct axiom_doctype axiom_doctype_t; + + /** + * Creates a axiom_doctype_t struct + * @param env Environment. MUST NOT be NULL, + * @param parent parent of the new node. Optinal, can be NULL. + * @param value doctype text + * @param node This is an out parameter.cannot be NULL. + * Returns the node corresponding to the doctype created. + * Node type will be set to AXIOM_DOCTYPE + * @return pointer to newly created doctype struct + */ + AXIS2_EXTERN axiom_doctype_t *AXIS2_CALL + axiom_doctype_create( + const axutil_env_t * env, + axiom_node_t * parent, + const axis2_char_t * value, + axiom_node_t ** node); + + /** + * free doctype struct + * @param om_doctype pointer to axiom_doctype_t struct to be freed + * @param env Environment. MUST NOT be NULL, + * @return satus of the op. AXIS2_SUCCESS on success + * AXIS2_FAILURE on error. + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_doctype_free( + struct axiom_doctype *om_doctype, + const axutil_env_t * env); + + /** + * @param om_doctype pointer to a axiom_doctype_t struct + * @param env environment must not be null + * @return DTD text + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_doctype_get_value( + struct axiom_doctype *om_doctype, + const axutil_env_t * env); + + /** + * @param om_doctype pointer to axiom doctype_t struct + * @param env environment , MUST NOT be NULL. + * @param value doctype text value + * @return status of the op, + * AXIS2_SUCCESS on success, AXIS2_FAILURE on error. + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_doctype_set_value( + struct axiom_doctype *om_doctype, + const axutil_env_t * env, + const axis2_char_t * value); + + /** + * serialize op + * @param om_doctype pointer to axiom_doctype_t struct + * @param env environment , MUST NOT be NULL + * @param om_output pointer to axiom_output_t struct + * @returns status of the op, + * AXIS2_SUCCESS on success, AXIS2_FAILURE on error. + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_doctype_serialize( + struct axiom_doctype *om_doctype, + const axutil_env_t * env, + axiom_output_t * om_output); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_DOCTYPE_H */ diff --git a/axiom/include/axiom_document.h b/axiom/include/axiom_document.h new file mode 100644 index 0000000..ac014df --- /dev/null +++ b/axiom/include/axiom_document.h @@ -0,0 +1,173 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_DOCUMENT_H +#define AXIOM_DOCUMENT_H + +#include <axutil_env.h> +#include <axiom_node.h> +#include <axutil_utils_defines.h> +#include <axiom_output.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @file axiom_document.h + * @brief om_document represents an XML document + */ + +#define CHAR_SET_ENCODING "UTF-8" +#define XML_VERSION "1.0" + + struct axiom_stax_builder; + + /** + * @defgroup axiom_document document + * @ingroup axiom_om + * @{ + */ + + typedef struct axiom_document axiom_document_t; + + /** + * creates an axiom_document_t struct + * @param env Environment. MUST NOT be NULL. + * @param root pointer to document's root node. Optional, can be NULL + * @param builder pointer to axiom_stax_builder + * @return pointer to the newly created document. + */ + AXIS2_EXTERN axiom_document_t *AXIS2_CALL + axiom_document_create( + const axutil_env_t * env, + axiom_node_t * root, + struct axiom_stax_builder *builder); + + /** + * Free document struct + * @param document pointer to axiom_document_t struct to be freed + * @param env Environment. MUST NOT be NULL + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE. + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_document_free( + struct axiom_document *document, + const axutil_env_t * env); + + /** + * Free document struct only, Does not free the associated axiom struture. + * @param document pointer to axiom_document_t struct to be freed + * @param env Environment. MUST NOT be NULL + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE. + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_document_free_self( + struct axiom_document *document, + const axutil_env_t * env); + + /** Builds the next node if the builder is not finished with input xml stream + * @param document document whose next node is to be built. cannot be NULL + * @param env Environment. MUST NOT be NULL. + * @return pointer to the next node. NULL on error. + */ + + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_document_build_next( + struct axiom_document *document, + const axutil_env_t * env); + + /** + * Gets the root element of the document. + * @param document document to return the root of + * @param env Environment. MUST NOT be NULL. + * @return returns a pointer to the root node. If no root present, + * this method tries to build the root. Returns NULL on error. + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_document_get_root_element( + struct axiom_document *document, + const axutil_env_t * env); + + /** + * set the root element of the document. IF a root node is already exist,it is freed + * before setting to root element + * @param document document struct to return the root of + * @param env Environment. MUST NOT be NULL. + * @return returns status code AXIS2_SUCCESS on success ,AXIS2_FAILURE on error. + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_document_set_root_element( + struct axiom_document *document, + const axutil_env_t * env, + axiom_node_t * om_node); + + /** + * This method builds the rest of the xml input stream from current position till + * the root element is completed . + * @param document pointer to axiom_document_t struct to be built. + * @param env environment MUST NOT be NULL. + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_document_build_all( + struct axiom_document *document, + const axutil_env_t * env); + + /** + * get builder + * @param document pointer to axiom_document_t struct to be built. + * @param env environment MUST NOT be NULL. + * @return builder, returns NULL if a builder is not associated with + * document + */ + AXIS2_EXTERN struct axiom_stax_builder *AXIS2_CALL + axiom_document_get_builder( + struct axiom_document *document, + const axutil_env_t * env); + + /** + * sets builder for document. + * @param document pointer to axiom_document_t struct to be built. + * @param env environment MUST NOT be NULL. + * @param builder pointer to builder to associate with document + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_document_set_builder( + axiom_document_t * document, + const axutil_env_t * env, + struct axiom_stax_builder * builder); + + /** + * @param om_document + * @return status code AXIS2_SUCCESS on success , otherwise AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_document_serialize( + struct axiom_document *document, + const axutil_env_t * env, + axiom_output_t * om_output); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_DOCUMENT_H */ diff --git a/axiom/include/axiom_element.h b/axiom/include/axiom_element.h new file mode 100644 index 0000000..ceb4417 --- /dev/null +++ b/axiom/include/axiom_element.h @@ -0,0 +1,747 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_ELEMENT_H +#define AXIOM_ELEMENT_H + +#include <axiom_namespace.h> +#include <axiom_attribute.h> +#include <axiom_output.h> +#include <axiom_node.h> +#include <axiom_children_iterator.h> +#include <axiom_children_qname_iterator.h> +#include <axiom_child_element_iterator.h> +#include <axutil_hash.h> +#include <axutil_utils.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_element axiom_element_t; + + /** + * @defgroup axiom_element element + * @ingroup axiom_om + * @{ + */ + + /** + * Creates an AXIOM element with given local name + * @param env Environment. MUST NOT be NULL. + * @param parent parent of the element node to be created. can be NULL. + * @param localname local name of the elment. cannot be NULL. + * @param ns namespace of the element. can be NULL. + * If the value of the namespace has not already been declared + * then the namespace structure ns will be declared and will be + * freed when the tree is freed. + * If the value of the namespace has already been declared using + * another namespace structure then the namespace structure ns + * will be freed. + * @param node This is an out parameter. cannot be NULL. + * Returns the node corresponding to the comment created. + * Node type will be set to AXIOM_ELEMENT + * @return a pointer to the newly created element struct + */ + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_element_create( + const axutil_env_t * env, + axiom_node_t * parent, + const axis2_char_t * localname, + axiom_namespace_t * ns, + axiom_node_t ** node); + + /** + * Creates an AXIOM element with given qname + * @param env Environment. MUST NOT be NULL. + * @param parent parent of the element node to be created. can be NULL. + * @param qname qname of the elment.cannot be NULL. + * @param node This is an out parameter. cannot be NULL. + * Returns the node corresponding to the comment created. + * Node type will be set to AXIOM_ELEMENT + * @return a pointer to the newly created element struct + */ + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_element_create_with_qname( + const axutil_env_t * env, + axiom_node_t * parent, + const axutil_qname_t * qname, + axiom_node_t ** node); + /* + * Find a namespace in the scope of the document. + * Start to find from the given node and go up the hierarchy. + * @param om_element pointer to om_element_struct contained in + * node , + * @param env Environment. MUST NOT be NULL. + * @param node node containing an instance of an AXIOM element,cannot be NULL. + * @param uri namespace uri.. + * @param prefix namespace prefix. can be NULL. + * @return pointer to the namespace, if found, else NULL. On error, returns + * NULL and sets error code in environment,s error + */ + AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL + axiom_element_find_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * node, + const axis2_char_t * uri, + const axis2_char_t * prefix); + + /** + * Declare a namespace in current element (in the scope of this element ). + * It checks to see if it is already declared. + * @param om_element contained in the om node struct + * @param env Environment. MUST NOT be NULL. + * @param node node containing an instance of an AXIOM element. + * @param ns pointer to the namespace struct to be declared + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_element_declare_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * node, + axiom_namespace_t * ns); + /** + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param om_node pointer to this element node + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE. + * + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_element_declare_namespace_assume_param_ownership( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_namespace_t * ns); + + /** + * Finds a namespace using qname + * Start to find from the given node and go up the hierarchy. + * @param om_element om_element contained in node + * @param env Environment. MUST NOT be NULL. + * @param node node containing an instance of an AXIOM element, cannot be NULL. + * @param qname qname of the namespace to be found. cannot be NULL. + * @return pointer to the namespace, if found, else NULL. On error, returns + * NULL and sets the error code in environment's error struct. + */ + AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL + axiom_element_find_namespace_with_qname( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * node, + axutil_qname_t * qname); + + /** + * Adds an attribute to current element The current element takes responsibility of the assigned attribute + * @param om_element element to which the attribute is to be added.cannot be NULL. + * @param env Environment. MUST NOT be NULL. + * @param attribute attribute to be added. + * @param node axiom_node_t node that om_element is contained in + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_element_add_attribute( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_attribute_t * attribute, + axiom_node_t * node); + + /** + * Gets (finds) the attribute with the given qname + * @param element element whose attribute is to be found. + * @param env Environment. MUST NOT be NULL. + * @qname qname qname of the attribute to be found. should not be NULL. + * @return a pointer to the attribute with given qname if found, else NULL. + * On error, returns NULL and sets the error code in environment's error struct. + */ + AXIS2_EXTERN axiom_attribute_t *AXIS2_CALL + axiom_element_get_attribute( + axiom_element_t * om_element, + const axutil_env_t * env, + axutil_qname_t * qname); + + /** + * Gets (finds) the attribute value with the given qname + * @param element element whose attribute is to be found. + * @param env Environment. MUST NOT be NULL. + * @qname qname qname of the attribute to be found. should not be NULL. + * @return the attribute value with given qname if found, else NULL. + * On error, returns NULL and sets the error code in environment's error struct. + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_element_get_attribute_value( + axiom_element_t * om_element, + const axutil_env_t * env, + axutil_qname_t * qname); + + /** + * Frees given element + * @param element AXIOM element to be freed. + * @param env Environment. MUST NOT be NULL. + * @return satus of the op. AXIS2_SUCCESS on success ,AXIS2_FAILURE on error. + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_element_free( + axiom_element_t * element, + const axutil_env_t * env); + + /** + * Serializes the start part of the given element + * @param element element to be serialized. + * @param env Environment. MUST NOT be NULL. + * @param om_output AXIOM output handler to be used in serializing + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_element_serialize_start_part( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_output_t * om_output, + axiom_node_t * ele_node); + + /** + * Serializes the end part of the given element. serialize_start_part must + * have been called before calling this method. + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param om_node pointer to this element node + * @param om_output AXIOM output handler to be used in serializing + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_element_serialize_end_part( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_output_t * om_output); + + /** + * finds a namespace in current element's scope, + * by uri or prefix or both + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param uri namespace uri, may be null + * @param prefix prefix + * @return axiom_namespace_t if found, else return NULL + */ + + AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL + axiom_element_find_declared_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + const axis2_char_t * uri, + const axis2_char_t * prefix); + + /** + * returns the localname of this element + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @returns localname of element, returns NULL on error. + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_element_get_localname( + axiom_element_t * om_element, + const axutil_env_t * env); + + /** + * set the localname of this element + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @localname text value to be set as localname + * @returns status code of op, AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_element_set_localname( + axiom_element_t * om_element, + const axutil_env_t * env, + const axis2_char_t * localname); + + /** + * get the namespace of om_element + * @param om_element om_element struct + * @param env environemt, MUST NOT be NULL. + * @returns pointer to axiom_namespace_t struct + * NULL if there is no namespace associated with the element, + * NULL on error with error code set to environment's error + */ + AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL + axiom_element_get_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * ele_node); + + /** + * set the namespace of the element + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param ns pointer to namespace + * If the value of the namespace has not already been declared + * then the namespace structure ns will be declared and will be + * freed when the tree is freed. + * @returns status code of the op, with error code + * set to environment's error + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_element_set_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_namespace_t * ns, + axiom_node_t * node); + + + /** + * unconditionally set the namespace of the element + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param ns pointer to namespace + * The namespace ns is assumed to have been declared already. + * @returns status code of the op, with error code + * set to environment's error + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_element_set_namespace_assume_param_ownership( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_namespace_t * ns); + + /** + * get the attribute list of the element + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @returns axutil_hash poiner to attributes hash + * This hash table is read only + */ + AXIS2_EXTERN axutil_hash_t *AXIS2_CALL + axiom_element_get_all_attributes( + axiom_element_t * om_element, + const axutil_env_t * env); + + /** + * get the namespace list of the element + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @returns axutil_hash pointer to namespaces hash + * this hash table is read only + */ + AXIS2_EXTERN axutil_hash_t *AXIS2_CALL + axiom_element_get_namespaces( + axiom_element_t * om_element, + const axutil_env_t * env); + + /** + *@return qname of this element + * the returned qname should not be externaly freed + * when om_element struct is freed qname is also + * freed + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param ele_node pointer to this element node + * + * @returns axutil_qname_t struct , NULL on failure + */ + AXIS2_EXTERN axutil_qname_t *AXIS2_CALL + axiom_element_get_qname( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * ele_node); + + /** + * returns a list of children iterator + * returned iterator is freed when om_element struct + * is freed + * iterators reset function must be called by user + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param element_node pointer to this element node + * + */ + AXIS2_EXTERN axiom_children_iterator_t *AXIS2_CALL + axiom_element_get_children( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node); + + /** + * returns a list of children iterator with qname + * returned iterator is freed when om element struct + * is freed + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param element_node pointer to this element node + * @returns children qname iterator struct + */ + + AXIS2_EXTERN axiom_children_qname_iterator_t *AXIS2_CALL + axiom_element_get_children_with_qname( + axiom_element_t * om_element, + const axutil_env_t * env, + axutil_qname_t * element_qname, + axiom_node_t * element_node); + + /** + * Returns the om_element corresponding to element_qname + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param element_qname qname of the element + * @param om_node pointer to this element node + * @param element_node + * @param child_node + * @returns children qname iterator struct + */ + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_element_get_first_child_with_qname( + axiom_element_t * om_element, + const axutil_env_t * env, + axutil_qname_t * element_qname, + axiom_node_t * element_node, + axiom_node_t ** child_node); + + /** + * removes an attribute from the element attribute list + * user must free this attribute, element free function does not free + * attributes that are not is it's attribute list + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param om_attribute attribute to be removed + * @return AXIS2_SUCCESS if attribute was found and removed, else + * AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_element_remove_attribute( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_attribute_t * om_attribute); + + /** + * Sets the text of the given element. + * caution - This method will wipe out all the text elements (and hence any + * mixed content) before setting the text + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param text text to set. + * @param element_node node of element. + * @return AXIS2_SUCCESS if attribute was found and removed, else + * AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_element_set_text( + axiom_element_t * om_element, + const axutil_env_t * env, + const axis2_char_t * text, + axiom_node_t * element_node); + + /** + * Select all the text children and concat them to a single string. The string + * returned by this method call will be free by axiom when this method is called again. + * So it is recomended to have a copy of the return value if this method is going to + * be called more that once and the return values of the earlier calls are important. + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param element node , the container node of this om element + * @return the contanated text of all text childrens text values + * return null if no text children is avilable or on error + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_element_get_text( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node); + + /** + * returns the first child om element of this om element node + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param om_node pointer to this element node + * @return om_element if one is availble otherwise return NULL + */ + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_element_get_first_element( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node, + axiom_node_t ** first_element_node); + + /** + * returns the serilized text of this element and its children + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param element_node the container node this on element is contained + * @return a char array of xml , returns NULL on error + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_element_to_string( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node); + + /** + * returns an iterator with child elements of type AXIOM_ELEMENT + * iterator is freed when om_element node is freed + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param element_node + * @returns axiom_child_element_iterator_t , NULL on error + */ + AXIS2_EXTERN axiom_child_element_iterator_t *AXIS2_CALL + axiom_element_get_child_elements( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node); + + /** + * builds this om_element_node completely, This is only possible + * if the om_stax_builder is associated with the om_element_node, + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param om_node pointer to this element node + * @param element_node corresponding om element node of this om element + * struct + * @returns AXIS2_SUCCESS if this element node was successfully completed, + * otherwise returns AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_element_build( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node); + + /** + * retrieves the default namespace of this element , if available, + * @param om_element pointer to om element + * @param env axutil_environment MUST Not be NULL + * @param element_node corresponding om element node of this om element + * @returns pointer to default namespace if availale , NULL otherwise + */ + AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL + axiom_element_get_default_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node); + + /** + * declared a default namespace explicitly + * @param om_element pointer to om element + * @param env environment MUST not be NULL + * @param uri namespace uri of the default namespace + * @returns the declared namespace + */ + AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL + axiom_element_declare_default_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axis2_char_t * uri); + + /** + * checks for the namespace in the context of this element + * with the given prefix + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param om_element_node pointer to this element node + * @returns pointer to relevent namespace + */ + AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL + axiom_element_find_namespace_uri( + axiom_element_t * om_element, + const axutil_env_t * env, + const axis2_char_t * prefix, + axiom_node_t * element_node); + + /** + *This will not search the namespace in the scope nor will + * declare in the current element, as in set_namespace. This will + * just assign the given namespace to the element. + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param om_node pointer to this element node + * @param om_ns pointer to namespace to be set + * @returns + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_element_set_namespace_with_no_find_in_current_scope( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_namespace_t * om_ns); + + /** + * Extract attributes , returns a clones hash table of attributes, + * if attributes are associated with a namespace it is also cloned + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param om_node pointer to this element node + * + */ + AXIS2_EXTERN axutil_hash_t *AXIS2_CALL + axiom_element_extract_attributes( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * ele_node); + + /** + * Returns the attribute value as a string for the given element + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param attr_name the attribute name + * + * @return the attribute value as a string + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_element_get_attribute_value_by_name( + axiom_element_t * om_ele, + const axutil_env_t * env, + axis2_char_t * attr_name); + + /** + * Create an OM Element and an OM node from given string params + * @param env environment MUST not be NULL + * @param parent pointer to this parent element node + * @param localname the locanmae of the element + * @param ns the namespace of the element + * @param node the reference ot the created node + * @return + */ + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_element_create_str( + const axutil_env_t * env, + axiom_node_t * parent, + axutil_string_t * localname, + axiom_namespace_t * ns, + axiom_node_t ** node); + + /** + * Returns the Local name of the element + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param om_node pointer to this element node + * + * @return the Local name of the element + */ + AXIS2_EXTERN axutil_string_t *AXIS2_CALL + axiom_element_get_localname_str( + axiom_element_t * om_element, + const axutil_env_t * env); + + /** + * Set the Local name of the element + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param localname the Local name of the element + * + * @return + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_element_set_localname_str( + axiom_element_t * om_element, + const axutil_env_t * env, + axutil_string_t * localname); + + /** + * Return whether the element is empty or not + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * + * @return AXIS2_TRUE if empty AXIS2_FALSE if not empty + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_element_get_is_empty( + axiom_element_t * om_element, + const axutil_env_t * env); + + /** + * Set whether the element is empty or not + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param is_empty AXIS2_TRUE if empty AXIS2_FALSE if not empty + * + * @return VOID + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_element_set_is_empty( + axiom_element_t * om_element, + const axutil_env_t * env, + axis2_bool_t is_empty); + + /** + * Collect all the namespaces with distinct prefixes in + * the parents of the given element. Effectively this + * is the set of namespaces declared above this element + * that are inscope at this element and might be used + * by it or its children. + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param om_node pointer to this element node + * @returns pointer to hash of relevent namespaces + */ + AXIS2_EXTERN axutil_hash_t * AXIS2_CALL + axiom_element_gather_parent_namespaces( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * om_node); + + /** + * If the provided namespace used by the provided element + * is one of the namespaces from the parent of the root + * root element, redeclares that namespace at the root element + * and removes it from the hash of parent namespaces + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param om_node pointer to this element node + * @param ns pointer to namespace to redeclare + * @param root_element pointer to the subtree root element node + * @param inscope_namespaces pointer to hash of parent namespaces + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_element_use_parent_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * om_node, + axiom_namespace_t *ns, + axiom_element_t * root_element, + axutil_hash_t *inscope_namespaces); + + /** + * Examines the subtree beginning at the provided element + * For each element or attribute, if it refers to a namespace + * declared in a parent of the subtree root element, redeclares + * that namespace at the level of the subtree root and removes + * it from the set of parent namespaces in scope and not yet + * declared + * @param om_element pointer to om_element + * @param env environment MUST not be NULL + * @param om_node pointer to this element node + * + * @param root_element pointer to the subtree root element node + * @param inscope_namespaces pointer to hash of parent namespaces + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_element_redeclare_parent_namespaces( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * om_node, + axiom_element_t * root_element, + axutil_hash_t *inscope_namespaces); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_ELEMENT_H */ diff --git a/axiom/include/axiom_mime_const.h b/axiom/include/axiom_mime_const.h new file mode 100644 index 0000000..e75fbd7 --- /dev/null +++ b/axiom/include/axiom_mime_const.h @@ -0,0 +1,56 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_MIME_CONST_H +#define AXIOM_MIME_CONST_H + +/** +* @file axiom.h +* @brief includes all headers in MIME_CONST +*/ +#ifdef __cplusplus +extern "C" +{ +#endif + +#define AXIOM_MIME_BOUNDARY_BYTE 45 +#define AXIOM_MIME_CRLF_BYTE 13 + +#define AXIOM_MIME_TYPE_XOP_XML "application/xop+xml" +#define AXIOM_MIME_TYPE_MULTIPART_RELATED "multipart/related" +#define AXIOM_MIME_TYPE_OCTET_STREAM "application/octet-stream" + +#define AXIOM_MIME_HEADER_FIELD_CHARSET "charset" +#define AXIOM_MIME_HEADER_FIELD_TYPE "type" +#define AXIOM_MIME_HEADER_FIELD_BOUNDARY "boundary" +#define AXIOM_MIME_HEADER_FIELD_START_INFO "start-info" +#define AXIOM_MIME_HEADER_FIELD_START "start" + +#define AXIOM_MIME_HEADER_CONTENT_TYPE "content-type" +#define AXIOM_MIME_HEADER_CONTENT_TRANSFER_ENCODING "content-transfer-encoding" +#define AXIOM_MIME_HEADER_CONTENT_ID "content-id" + +#define AXIOM_MIME_CONTENT_TRANSFER_ENCODING_BINARY "binary" + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_MIME_CONST_H */ diff --git a/axiom/include/axiom_mime_parser.h b/axiom/include/axiom_mime_parser.h new file mode 100644 index 0000000..b7f4f00 --- /dev/null +++ b/axiom/include/axiom_mime_parser.h @@ -0,0 +1,220 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_MIME_PARSER_H +#define AXIOM_MIME_PARSER_H + +/** + * @file axiom_mime_parser.h + * @brief axis2 mime_parser interface + */ + +#include <axutil_utils.h> +#include <axutil_error.h> +#include <axutil_utils_defines.h> +#include <axutil_env.h> +#include <axutil_allocator.h> +#include <axutil_string.h> +#include <axutil_hash.h> +#include <axiom_mime_const.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define AXIOM_MIME_PARSER_BUFFER_SIZE (1024 * 1024/2) +#define AXIOM_MIME_PARSER_MAX_BUFFERS 1000 + +#define AXIOM_MIME_PARSER_END_OF_MIME_MAX_COUNT 100 + + + typedef struct axiom_mime_parser axiom_mime_parser_t; + + /** @defgroup axiom_mime_parser Flow + * @ingroup axiom_mime_parser + * @{ + */ + + /** + * Parse and returns mime parts as a hash map + * @param mime_parser the pointer for the mime parser struct + * @param env Environment. MUST NOT be NULL. + * @param callback_ctx the callback context + * @param mime_boundary the MIME boundary + * @return mime parts as a hash map + */ + /*AXIS2_EXTERN axutil_hash_t *AXIS2_CALL + axiom_mime_parser_parse( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK, + void *callback_ctx, + axis2_char_t * mime_boundary);*/ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_mime_parser_parse_for_soap( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK callback, + void *callback_ctx, + axis2_char_t * mime_boundary); + + + AXIS2_EXTERN axutil_hash_t *AXIS2_CALL + axiom_mime_parser_parse_for_attachments( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK callback, + void *callback_ctx, + axis2_char_t * mime_boundary, + void *user_param); + + + /** + * Returns mime parts as a hash map + * @param mime_parser the pointer for the mime parser struct + * @param env Environment. MUST NOT be NULL. + * @return mime parts as a hash map + */ + AXIS2_EXTERN axutil_hash_t *AXIS2_CALL + axiom_mime_parser_get_mime_parts_map( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env); + + /** + * Deallocate memory. Free the mime parser struct + * @param mime_parser the pointer for the mime parser struct + * @param env Environment. MUST NOT be NULL. + * @return VOID + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_mime_parser_free( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env); + + /** + * Returns the length of the SOAP Body + * @param mime_parser the pointer for the mime parser struct + * @param env Environment. MUST NOT be NULL. + * @return the length of the SOAP Body + */ + AXIS2_EXTERN size_t AXIS2_CALL + axiom_mime_parser_get_soap_body_len( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env); + + /** + * Get the SOAP Body as a string + * @param mime_parser the pointer for the mime parser struct + * @param env Environment. MUST NOT be NULL. + * @return the SOAP Body as a string + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_mime_parser_get_soap_body_str( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env); + + /** + * Create a mime parser struct + * @param env Environment. MUST NOT be NULL. + * @return created mime parser + */ + AXIS2_EXTERN axiom_mime_parser_t *AXIS2_CALL + axiom_mime_parser_create( + const axutil_env_t * env); + + /** + * Set the size of the chink buffer + * @param mime_parser the pointer for the mime parser struct + * @param env Environment. MUST NOT be NULL. + * @param size the size of the chink buffer + * @return mime parts as a hash map + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_mime_parser_set_buffer_size( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env, + int size); + + /** + * Set maximum number of chunk buffers + * @param mime_parser the pointer for the mime parser struct + * @param env Environment. MUST NOT be NULL. + * @param num maximum number of chunk buffers + * @return VOID + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_mime_parser_set_max_buffers( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env, + int num); + + + /** + * Set attachment dir specified in the axis2.xml + * @param mime_parser the pointer for the mime parser struct + * @param env Environment. MUST NOT be NULL. + * @param attachment_dir is string containg the directory path + * @return VOID + */ + + AXIS2_EXTERN void AXIS2_CALL + axiom_mime_parser_set_attachment_dir( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env, + axis2_char_t *attachment_dir); + + + /** + * Set Caching callback name specified in the axis2.xml + * @param mime_parser the pointer for the mime parser struct + * @param env Environment. MUST NOT be NULL. + * @param callback_name is string containg the dll path + * @return VOID + */ + + + AXIS2_EXTERN void AXIS2_CALL + axiom_mime_parser_set_caching_callback_name( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env, + axis2_char_t *callback_name); + + + AXIS2_EXTERN void AXIS2_CALL + axiom_mime_parser_set_mime_boundary( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env, + axis2_char_t *mime_boundary); + + + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_mime_parser_get_mime_boundary( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env); + + + + + /** @} */ + +#ifdef __cplusplus +} +#endif +#endif /* AXIOM_MIME_PARSER_H */ diff --git a/axiom/include/axiom_mime_part.h b/axiom/include/axiom_mime_part.h new file mode 100644 index 0000000..e4cfc36 --- /dev/null +++ b/axiom/include/axiom_mime_part.h @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_MIME_PART_H +#define AXIOM_MIME_PART_H + +/** + * @file axiom_mime_part.h + * @brief axis2 mime_part interface + */ + +#include <axutil_utils.h> +#include <axutil_error.h> +#include <axutil_utils_defines.h> +#include <axutil_env.h> +#include <axutil_allocator.h> +#include <axutil_string.h> +#include <axutil_array_list.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_mime_part_t axiom_mime_part_t; + + + /* An enum to keep different mime_part types */ + + typedef enum axiom_mime_part_type_t + { + + /** Char buffer */ + AXIOM_MIME_PART_BUFFER = 0, + + /* A file */ + AXIOM_MIME_PART_FILE, + + /* User specified callback */ + AXIOM_MIME_PART_CALLBACK, + + /* unknown type*/ + AXIOM_MIME_PART_UNKNOWN + + } axiom_mime_part_type_t; + + struct axiom_mime_part_t + { + /* This is when the mime part is a buffer. + * This will be null when the part is a file */ + axis2_byte_t *part; + + /* This is to keep file name when the part is a file + * NULL when the part is a buffer */ + axis2_char_t *file_name; + + /* Size of the part. In the case of buffer this is + * the buffer size and in the case of file this is + the file size */ + size_t part_size; + + /* This is one from the above defined enum */ + axiom_mime_part_type_t type; + + /* This is required in the case of the callback */ + void *user_param; + }; + + + + + AXIS2_EXTERN const axis2_char_t *AXIS2_CALL + axiom_mime_part_get_content_type_for_mime( + const axutil_env_t * env, + axis2_char_t * boundary, + axis2_char_t * content_id, + axis2_char_t * char_set_encoding, + const axis2_char_t * soap_content_type); + + + /** + * Creates mime_part struct + * @return pointer to newly created mime_part + */ + + AXIS2_EXTERN axiom_mime_part_t *AXIS2_CALL + axiom_mime_part_create( + const axutil_env_t *env); + + /* This method will create the output part + * list.*/ + + AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL + axiom_mime_part_create_part_list( + const axutil_env_t *env, + axis2_char_t *soap_body, + axutil_array_list_t *binary_node_list, + axis2_char_t *boundary, + axis2_char_t *content_id, + axis2_char_t *char_set_encoding, + const axis2_char_t *soap_content_type); + + + AXIS2_EXTERN void AXIS2_CALL + axiom_mime_part_free( + axiom_mime_part_t *mime_part, + const axutil_env_t *env); + + + + + /** @} */ + +#ifdef __cplusplus +} +#endif +#endif /* AXIOM_MIME_PART_H */ diff --git a/axiom/include/axiom_mtom_caching_callback.h b/axiom/include/axiom_mtom_caching_callback.h new file mode 100644 index 0000000..e432b2f --- /dev/null +++ b/axiom/include/axiom_mtom_caching_callback.h @@ -0,0 +1,114 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You 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. +*/ + +#ifndef AXIOM_MTOM_CACHING_CALLBACK_H +#define AXIOM_MTOM_CACHING_CALLBACK_H + +/** + * @file axiom_mtom_caching_callback.h + * @brief Caching callback for mime parser + */ + +/** +* @defgroup caching_callback +* @ingroup axiom +* @{ +*/ + +#include <axutil_env.h> +#include <axutil_param.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * Type name for struct axiom_mtom_caching_callback_ops + */ + typedef struct axiom_mtom_caching_callback_ops axiom_mtom_caching_callback_ops_t; + + /** + * Type name for struct axiom_mtom_caching_callback + */ + typedef struct axiom_mtom_caching_callback axiom_mtom_caching_callback_t; + + + /** + * init_handler will init the caching storage + */ + + /** + * cache will write the data to the storage + */ + + /** + * close_handler will close the storage + */ + + struct axiom_mtom_caching_callback_ops + { + void* (AXIS2_CALL* + init_handler)(axiom_mtom_caching_callback_t *mtom_caching_callback, + const axutil_env_t* env, + axis2_char_t *key); + + axis2_status_t (AXIS2_CALL* + cache)(axiom_mtom_caching_callback_t *mtom_caching_callback, + const axutil_env_t* env, + axis2_char_t *data, + int length, + void *handler); + + axis2_status_t (AXIS2_CALL* + close_handler)(axiom_mtom_caching_callback_t *mtom_caching_callback, + const axutil_env_t* env, + void *handler); + + axis2_status_t (AXIS2_CALL* + free)(axiom_mtom_caching_callback_t *mtom_caching_callback, + const axutil_env_t* env); + }; + + struct axiom_mtom_caching_callback + { + axiom_mtom_caching_callback_ops_t *ops; + axutil_param_t *param; + void *user_param; + }; + + /*************************** Function macros **********************************/ +#define AXIOM_MTOM_CACHING_CALLBACK_INIT_HANDLER(mtom_caching_callback, env, key) \ + ((mtom_caching_callback)->ops->init_handler(mtom_caching_callback, env, key)) + +#define AXIOM_MTOM_CACHING_CALLBACK_CACHE(mtom_caching_callback, env, data, length, handler) \ + ((mtom_caching_callback)->ops->cache(mtom_caching_callback, env, data, length, handler)) + +#define AXIOM_MTOM_CACHING_CALLBACK_CLOSE_HANDLER(mtom_caching_callback, env, handler) \ + ((mtom_caching_callback)->ops->close_handler(mtom_caching_callback, env, handler)) + +#define AXIOM_MTOM_CACHING_CALLBACK_FREE(mtom_caching_callback, env) \ + ((mtom_caching_callback)->ops->free(mtom_caching_callback, env)) + + /** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_MTOM_CACHING_CALLBACK */ + + diff --git a/axiom/include/axiom_mtom_sending_callback.h b/axiom/include/axiom_mtom_sending_callback.h new file mode 100644 index 0000000..ce2587e --- /dev/null +++ b/axiom/include/axiom_mtom_sending_callback.h @@ -0,0 +1,112 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You 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. +*/ + +#ifndef AXIOM_MTOM_SENDING_CALLBACK_H +#define AXIOM_MTOM_SENDING_CALLBACK_H + +/** + * @file axiom_mtom_sending_callback.h + * @brief sending callback for attachment sending + */ + +/** +* @defgroup mtom_sending_callback +* @ingroup axiom +* @{ +*/ + +#include <axutil_env.h> +#include <axutil_param.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * Type name for struct axiom_mtom_sending_callback_ops + */ + typedef struct axiom_mtom_sending_callback_ops axiom_mtom_sending_callback_ops_t; + + /** + * Type name for struct axiom_mtom_sending_callback + */ + typedef struct axiom_mtom_sending_callback axiom_mtom_sending_callback_t; + + + /** + * init_handler will init the attachment storage + */ + + /** + * load will read the attachemnt by part from the storage + */ + + /** + * close_handler will close the storage + */ + + struct axiom_mtom_sending_callback_ops + { + void* (AXIS2_CALL* + init_handler)(axiom_mtom_sending_callback_t *mtom_sending_callback, + const axutil_env_t* env, + void *user_param); + + int (AXIS2_CALL* + load_data)(axiom_mtom_sending_callback_t *mtom_sending_callback, + const axutil_env_t* env, + void *handler, + axis2_char_t **buffer); + + axis2_status_t (AXIS2_CALL* + close_handler)(axiom_mtom_sending_callback_t *mtom_sending_callback, + const axutil_env_t* env, + void *handler); + + axis2_status_t (AXIS2_CALL* + free)(axiom_mtom_sending_callback_t *mtom_sending_callback, + const axutil_env_t* env); + }; + + struct axiom_mtom_sending_callback + { + axiom_mtom_sending_callback_ops_t *ops; + axutil_param_t *param; + }; + + /*************************** Function macros **********************************/ +#define AXIOM_MTOM_SENDING_CALLBACK_INIT_HANDLER(mtom_sending_callback, env, user_param) \ + ((mtom_sending_callback)->ops->init_handler(mtom_sending_callback, env, user_param)) + +#define AXIOM_MTOM_SENDING_CALLBACK_LOAD_DATA(mtom_sending_callback, env, handler, buffer) \ + ((mtom_sending_callback)->ops->load_data(mtom_sending_callback, env, handler, buffer)) + +#define AXIOM_MTOM_SENDING_CALLBACK_CLOSE_HANDLER(mtom_sending_callback, env, handler) \ + ((mtom_sending_callback)->ops->close_handler(mtom_sending_callback, env, handler)) + +#define AXIOM_MTOM_SENDING_CALLBACK_FREE(mtom_sending_callback, env) \ + ((mtom_sending_callback)->ops->free(mtom_sending_callback, env)) + + /** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_MTOM_SENDING_CALLBACK */ + + diff --git a/axiom/include/axiom_namespace.h b/axiom/include/axiom_namespace.h new file mode 100644 index 0000000..73ccf17 --- /dev/null +++ b/axiom/include/axiom_namespace.h @@ -0,0 +1,201 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_NAMESPACE_H +#define AXIOM_NAMESPACE_H + +#include <axutil_utils_defines.h> +#include <axutil_env.h> +#include <axiom_output.h> +#include <axutil_string.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_namespace namespace + * @ingroup axiom_om + * @{ + */ + + typedef struct axiom_namespace axiom_namespace_t; + + /** + * Creates a namespace struct + * @param uri namespace URI + * @param prefix namespace prefix + * @return a pointer to newly created namespace struct + */ + AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL + axiom_namespace_create( + const axutil_env_t * env, + const axis2_char_t * uri, + const axis2_char_t * prefix); + + /** + * Frees given AXIOM namespcae + * @param om_namespace namespace to be freed. + * @param env Environment. MUST NOT be NULL. + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE. + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_namespace_free( + struct axiom_namespace *om_namespace, + const axutil_env_t * env); + + /** + * Compares two namepsaces + * @param om_namespace first namespase to be compared + * @param env Environment. MUST NOT be NULL. + * @param om_namespace1 second namespace to be compared + * @return AXIS2_TRUE if the two namespaces are equal,AXIS2_FALSE otherwise + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_namespace_equals( + struct axiom_namespace *om_namespace, + const axutil_env_t * env, + struct axiom_namespace *om_namespace1); + + /** + * Serializes given namespace + * @param om_namespace namespace to be serialized. + * @param env Environment. MUST NOT be NULL. + * @param om_output AXIOM output handler to be used in serializing + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_namespace_serialize( + struct axiom_namespace *om_namespace, + const axutil_env_t * env, + axiom_output_t * om_output); + + /** + * @param om_namespace pointer to om_namespace struct + * @param env environment , MUST NOT be NULL. + * @returns namespace uri , NULL on error + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_namespace_get_uri( + struct axiom_namespace *om_namespace, + const axutil_env_t * env); + + /** + * @param om_namespace pointer to om namespace struct + * @param env environment, MUST NOT be NULL + * @return prefix , NULL on error + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_namespace_get_prefix( + struct axiom_namespace *om_namespace, + const axutil_env_t * env); + + /** + * Clones an om_namespace struct + * @param om_namespace pointer to namespace struct + * @param env Environment. MUST NOT be NULL + * @returns axiom_namespace on success , NULL on error + */ + AXIS2_EXTERN struct axiom_namespace *AXIS2_CALL + axiom_namespace_clone( + struct axiom_namespace *om_namespace, + const axutil_env_t * env); + + /** + * to string , returns the string by combining namespace_uri, + * and prefix seperated by a '|' character + * @param om_namespace + * @param env Environment. MUST NOT be NULL + * @returns pointer to string , This is a property of namespace, + * should not be freed by user + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_namespace_to_string( + struct axiom_namespace *om_namespace, + const axutil_env_t * env); + + /** + * Incerament the reference value. The struct will be freed when the ref value is zero + * @param om_namespace pointer to the axiom namespace struct + * @param env Environment. MUST NOT be NULL + * + * @return AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_namespace_increment_ref( + struct axiom_namespace *om_namespace, + const axutil_env_t * env); + + /** + * Create an OM namespace from a URI and a Prefix + * @param om_namespace pointer to the axiom namespace struct + * @param env Environment. MUST NOT be NULL + * + * @return created OM namespace + */ + AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL + axiom_namespace_create_str( + const axutil_env_t * env, + axutil_string_t * uri, + axutil_string_t * prefix); + + /** + * Set the uri string + * @param om_namespace pointer to the axiom namespace struct + * @param env Environment. MUST NOT be NULL + * + * @return AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_namespace_set_uri_str( + axiom_namespace_t * om_namespace, + const axutil_env_t * env, + axutil_string_t * uri); + + /** + * Get the uri as a string + * @param om_namespace pointer to the axiom namespace struct + * @param env Environment. MUST NOT be NULL + * + * @return the uri as a string + */ + AXIS2_EXTERN axutil_string_t *AXIS2_CALL + axiom_namespace_get_uri_str( + axiom_namespace_t * om_namespace, + const axutil_env_t * env); + + /** + * Get the prefix as a string + * @param om_namespace pointer to the axiom namespace struct + * @param env Environment. MUST NOT be NULL + * + * @return the prefix as a string + */ + AXIS2_EXTERN axutil_string_t *AXIS2_CALL + axiom_namespace_get_prefix_str( + axiom_namespace_t * om_namespace, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_NAMESPACE */ diff --git a/axiom/include/axiom_navigator.h b/axiom/include/axiom_navigator.h new file mode 100644 index 0000000..6ff8b53 --- /dev/null +++ b/axiom/include/axiom_navigator.h @@ -0,0 +1,121 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_NAVIGATOR_H +#define AXIOM_NAVIGATOR_H + +#include <axutil_utils.h> +#include <axutil_env.h> +#include <axiom_node.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_navigator navigator + * @ingroup axiom_om + * @{ + */ + + typedef struct axiom_navigator axiom_navigator_t; + + /** Creates an axiom_navigator + * @param env environment MUST not be NULL + * @param node a pointer to axiom_node_t struct + * which is to be navigated + * @returns a pointer to axiom_navigator_t struct + * or returns NULL on error + */ + AXIS2_EXTERN axiom_navigator_t *AXIS2_CALL + axiom_navigator_create( + const axutil_env_t * env, + axiom_node_t * node); + + /** + * free function , free the axiom_navigator struct + * @param om_navigator axiom_navigator_struct + * @param env environment MUST not be NULL + * @returns AXIS2_SUCCESS + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_navigator_free( + axiom_navigator_t * om_navigator, + const axutil_env_t * env); + + /** + * Returns the navigable status + * @param om_navigator axiom_navigator_struct + * @param env environment MUST not be NULL + * @returns AXIS2_TRUE if the om is navigable + * otherwise returns AXIS2_FALSE + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_navigator_is_navigable( + axiom_navigator_t * om_navigator, + const axutil_env_t * env); + + /** + * Returns the build status of this node + * if the node is completly build returns AXIS2_TRUE + * otherwise AXIS2_FALSE + * @param om_navigator axiom_navigator struct + * @param env environment MUST not be NULL + * @return AXIS2_TRUE if this node is completly built + * otherwise return AXIS2_FALSE + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_navigator_is_completed( + axiom_navigator_t * om_navigator, + const axutil_env_t * env); + + /** + * gets the next node + * @param om_navigator om_navigaot struct + * @param env environment MUST not be NULL + * @returns axiom_node_t pointer in the sequence of preorder travasal + * however the an element node is treated slightly differently + * Once the om_element type om node is passed it returns the same om_node + * pointer in the next , returns NULL on error or if there is no more nodes + */ + + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_navigator_next( + axiom_navigator_t * om_navigator, + const axutil_env_t * env); + + /** + * method visited + * @param om_navigator om_navigaot struct + * @param env environment MUST not be NULL + * @returns AXIS2_TRUE if this node is alrady visited + * otherwise AXIS2_FALSE + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_navigator_visited( + axiom_navigator_t * om_navigator, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_NAVIGATOR_H */ diff --git a/axiom/include/axiom_node.h b/axiom/include/axiom_node.h new file mode 100644 index 0000000..dd5c320 --- /dev/null +++ b/axiom/include/axiom_node.h @@ -0,0 +1,379 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_NODE_H +#define AXIOM_NODE_H + +/** + * @defgroup axiom AXIOM project + * @{ + * @} + */ + +/** + * @defgroup axiom_om AXIOM + * @ingroup axiom + * @{ + * @} + */ + +/** + * @file axiom_node.h + * @brief defines axiom_node struct + */ +#include <axutil_env.h> +#include <axutil_utils.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_node axiom_node_t; + struct axiom_output; + struct axiom_document; + struct axiom_stax_builder; + + /** + * @defgroup axiom_node node + * @ingroup axiom_om + * @{ + */ + + /** + * @brief AXIOM types + */ + typedef enum axiom_types_t + { + + /** Invalid node type */ + AXIOM_INVALID = 0, + + /** AXIOM document type */ + AXIOM_DOCUMENT, + + /** AXIOM element type */ + AXIOM_ELEMENT, + + /** AXIOM doctype type */ + AXIOM_DOCTYPE, + + /** AXIOM comment type */ + AXIOM_COMMENT, + + /** AXIOM attribute type */ + AXIOM_ATTRIBUTE, + + /** AXIOM namespace type */ + AXIOM_NAMESPACE, + + /** AXIOM processing instruction type */ + AXIOM_PROCESSING_INSTRUCTION, + + /** AXIOM text type */ + AXIOM_TEXT, + + /** AXIOM data source, represent a serialized XML fragment with a stream */ + AXIOM_DATA_SOURCE + } axiom_types_t; + + /** + * Creates a node struct. + * @param env Environment. MUST NOT be NULL, . + * @return a pointer to newly created node struct. NULL on error. + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_node_create( + const axutil_env_t * env); + + /** + * Creates a node struct from a character buffer. + * @param env Environment. MUST NOT be NULL, . + * @param buffer string. buffer to make the node + * @return a pointer to newly created node struct. NULL on error. + */ + AXIS2_EXTERN axiom_node_t* AXIS2_CALL + axiom_node_create_from_buffer( + const axutil_env_t * env, + axis2_char_t *buffer); + + + /** + * Frees an om node and all of its children. Please note that the attached + * data_element will also be freed along with the node. If the node is + * still attached to a parent, it will be detached first, then freed. + * @param om_node node to be freed. + * @param env Environment. MUST NOT be NULL, . + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_node_free_tree( + axiom_node_t * om_node, + const axutil_env_t * env); + + /** + * Adds given node as child to parent. child should not have a parent + * if child has a parent it will be detached from existing parent + * @param om_node parent node. cannot be NULL. + * @param env Environment. MUST NOT be NULL, . + * @param child child node. + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_add_child( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * child); + + /** + * Detaches given node from the parent and reset the links + * @param om_node node to be detached, cannot be NULL. + * @param env Environment. MUST NOT be NULL, . + * @return a pointer to detached node,returns NULL on error with error + * code set to environment's error struct + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_node_detach( + axiom_node_t * om_node, + const axutil_env_t * env); + + /** + * Inserts a sibling node after the given node + * @param om_node node to whom the sibling to be inserted. , cannot be NULL. + * @param env Environment. MUST NOT be NULL, . + * @param node_to_insert the node to be inserted. , cannot be NULL. + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_insert_sibling_after( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * node_to_insert); + + /** + * Inserts a sibling node before the given current node + * @param om_node node to whom the sibling to be inserted. , cannot be NULL. + * @param env Environment. MUST NOT be NULL, . + * @param node_to_insert the node to be inserted. , cannot be NULL. + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_insert_sibling_before( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * node_to_insert); + + /** + * Serializes the given node. This op makes the node go + * through its children and serialize them in order. + * @param om_node node to be serialized. cannot be NULL. + * @param env Environment .MUST NOT be NULL. + * @param om_output AXIOM output handler to be used in serializing + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_serialize( + axiom_node_t * om_node, + const axutil_env_t * env, + struct axiom_output *om_output); + + /** get parent of om_node + *@om_node node + *@param env environment + *@return pointer to parent node of om_node, return NULL if no parent exists or + * when an error occured. + */ + + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_node_get_parent( + axiom_node_t * om_node, + const axutil_env_t * env); + + /** + * get the first child of om_node + * @param om_node node + * @param env environment must not be null. + * @returns pointer to first child node , NULL is returned on error with + * error code set in environments error + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_node_get_first_child( + axiom_node_t * om_node, + const axutil_env_t * env); + + /**get the first AXIOM_ELEMENT in om_node + * @param om_node node + * @param env environment must not be null + * @returns pointer to first child om element, NULL is returned on error + * with error code set in environments error. + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_node_get_first_element( + axiom_node_t * om_node, + const axutil_env_t * env); + + /** + * get the last child + * @param om_node node + * @param env environment, MUST NOT be NULL + * @return pointer to last child of this node , return NULL on error. + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_node_get_last_child( + axiom_node_t * om_node, + const axutil_env_t * env); + + /** + * get the previous sibling + * @param om_node om_node struct + * @param env environment , must node be null + * @returns a pointer to previous sibling , NULL if a previous sibling does not exits + * (happens when this node is the first child of a node ) + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_node_get_previous_sibling( + axiom_node_t * om_node, + const axutil_env_t * env); + + /** + * get next sibling + * @param om_node om_node struct + * @param env environment, MUST NOT be NULL. + * @return next sibling of this node. + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_node_get_next_sibling( + axiom_node_t * om_node, + const axutil_env_t * env); + + /** + * get the node type of this element + * Node type can be one of AXIOM_ELEMENT, AXIOM_COMMENT, AXIOM_TEXT + * AXIOM_DOCTYPE, AXIOM_PROCESSING_INSTRUCTION + * @param om_node node of which node type is required + * @param env environment + * @return node type + */ + AXIS2_EXTERN axiom_types_t AXIS2_CALL + axiom_node_get_node_type( + axiom_node_t * om_node, + const axutil_env_t * env); + + /** + * get the struct contained in the node + * IF the node is on type AXIOM_ELEMENT , this method returns + * a pointer to axiom_element_t struct contained + * @param om_node node + * @param env environment, MUST NOT be NULL. + * @returns pointer to struct contained in the node + * returns NULL if no struct is contained + */ + AXIS2_EXTERN void *AXIS2_CALL + axiom_node_get_data_element( + axiom_node_t * om_node, + const axutil_env_t * env); + + /** + * Indicates whether parser has parsed this information item completely or not + * @param om_node om_node struct + * @param env environment, MUST NOT be NULL. + * @returns AXIS2_TRUE if node is completly build, + * AXIS2_FALSE if node is not completed + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_node_is_complete( + axiom_node_t * om_node, + const axutil_env_t * env); + + /** + * returns the associated document, + * only valid if built using builder and for a node of type + * AXIOM_ELEMENT + * returns null if no document is available + * @param om_node + * @param env environment, MUST NOT be NULL. + * + * @return the OM document of the node + */ + AXIS2_EXTERN struct axiom_document *AXIS2_CALL + axiom_node_get_document( + axiom_node_t * om_node, + const axutil_env_t * env); + + /** + * + * @param om_node pointer to the OM node struct + * @param env environment, MUST NOT be NULL + * + * @return the string representation of the node + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_node_to_string( + axiom_node_t * om_node, + const axutil_env_t * env); + + /** + * + * @param om_node pointer to the OM node struct + * @param env environment, MUST NOT be NULL + * @param om_output the serialized output will be placed here + * + * @return AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_serialize_sub_tree( + axiom_node_t * om_node, + const axutil_env_t * env, + struct axiom_output *om_output); + + /** + * + * @param om_node pointer to the OM node struct + * @param env environment, MUST NOT be NULL + * + * @return the tree as a string + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_node_sub_tree_to_string( + axiom_node_t * om_node, + const axutil_env_t * env); + + /** + * Convert the node to string, treating the binary contents, if any, + * as non-optimized content. + * @param om_node pointer to the OM node struct + * @param env environment, MUST NOT be NULL + * + * @return the none optimized string + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_node_to_string_non_optimized( + axiom_node_t * om_node, + const axutil_env_t * env); + + AXIS2_EXTERN struct axiom_stax_builder *AXIS2_CALL + axiom_node_get_builder( + axiom_node_t * om_node, + const axutil_env_t * env); + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_NODE_H */ diff --git a/axiom/include/axiom_output.h b/axiom/include/axiom_output.h new file mode 100644 index 0000000..18b524b --- /dev/null +++ b/axiom/include/axiom_output.h @@ -0,0 +1,254 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_OUTPUT_H +#define AXIOM_OUTPUT_H + +#include <axutil_utils_defines.h> +#include <axutil_utils.h> +#include <axutil_env.h> +#include <axiom_node.h> +#include <axiom_xml_writer.h> +#include <axutil_array_list.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_output output + * @ingroup axiom_om + * @{ + */ + + /** + * \brief output struct + * The XML writer interface struct of om + */ + typedef struct axiom_output axiom_output_t; + struct axiom_text; + + /** + * Creates AXIOM output struct + * @param env Environment. MUST NOT be NULL, . + * @param xml_writer XML writer. OM output takes + * ownership of the xml_writer. + * @return a pointer to newly created output struct. + */ + AXIS2_EXTERN axiom_output_t *AXIS2_CALL + axiom_output_create( + const axutil_env_t * env, + axiom_xml_writer_t * xml_writer); + + /** + * Performs xml writing. + * Accepts variable number of args depending on the on AXIOM type to be serialized + * @param om_output Output struct to be used + * @param env Environment. MUST NOT be NULL, + * @param type one of the AXIOM types + * @param no_of_args number of arguments passed in the variable parameter list + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_output_write( + axiom_output_t * om_output, + const axutil_env_t * env, + axiom_types_t type, + int no_of_args, + ...); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_output_write_optimized( + axiom_output_t * om_output, + const axutil_env_t * env, + struct axiom_text *om_text); + + /** + * Free om_output + * @param om_output om_output struct + * @param env environment + * @return status code AXIS2_SUCCESS on success, + * AXIS2_FAILURE otherwise + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_output_free( + axiom_output_t * om_output, + const axutil_env_t * env); + + /** + * If the xml to be serialized is soap 11, this property is set to true + * @param om_output pointer to om_output struct + * @param env environment must not be NULL + * @returns the output soap version + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_output_is_soap11( + axiom_output_t * om_output, + const axutil_env_t * env); + + /** + * @returns true if the ignore_xml_declaration property is true + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + + axiom_output_is_ignore_xml_declaration( + axiom_output_t * om_output, + const axutil_env_t * env); + + /** + * Sets the ignore_xml_declaration property is true + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_output_set_ignore_xml_declaration( + axiom_output_t * om_output, + const axutil_env_t * env, + axis2_bool_t ignore_xml_dec); + + /** + * Sets the soap11 property to true + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_output_set_soap11( + axiom_output_t * om_output, + const axutil_env_t * env, + axis2_bool_t soap11); + + /** + * Sets xml_version property + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_output_set_xml_version( + axiom_output_t * om_output, + const axutil_env_t * env, + axis2_char_t * xml_version); + + /** + * @returns xml version property + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_output_get_xml_version( + axiom_output_t * om_output, + const axutil_env_t * env); + + /** + * Sets the char set encoding property + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_output_set_char_set_encoding( + axiom_output_t * om_output, + const axutil_env_t * env, + axis2_char_t * char_set_encoding); + + /** + * @returns the char set encoding property + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_output_get_char_set_encoding( + axiom_output_t * om_output, + const axutil_env_t * env); + + /** + * Sets the do optimize property true + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_output_set_do_optimize( + axiom_output_t * om_output, + const axutil_env_t * env, + axis2_bool_t optimize); + + /** + * Returns the xml writer + */ + AXIS2_EXTERN axiom_xml_writer_t *AXIS2_CALL + axiom_output_get_xml_writer( + axiom_output_t * om_output, + const axutil_env_t * env); + + /** + * Returns the content type + * for soap11 'text/xml' etc.. + * @param om_output + * @param env environemnt + * @returns content id + */ + AXIS2_EXTERN const axis2_char_t *AXIS2_CALL + axiom_output_get_content_type( + axiom_output_t * om_output, + const axutil_env_t * env); + + /** + * Writes the xml versio encoding + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_output_write_xml_version_encoding( + axiom_output_t * om_output, + const axutil_env_t * env); + + /** + * @returns whether the output is to be optimized + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_output_is_optimized( + axiom_output_t * om_output, + const axutil_env_t * env); + + /** + * Returns the next content id + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_output_get_next_content_id( + axiom_output_t * om_output, + const axutil_env_t * env); + + /** + * root content id + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_output_get_root_content_id( + axiom_output_t * om_output, + const axutil_env_t * env); + /** + * + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_output_get_mime_boundry( + axiom_output_t * om_output, + const axutil_env_t * env); + /** + * + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_output_flush( + axiom_output_t * om_output, + const axutil_env_t * env); + + AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL + axiom_output_get_mime_parts( + axiom_output_t * om_output, + const axutil_env_t * env); + + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_OUTPUT_H */ diff --git a/axiom/include/axiom_processing_instruction.h b/axiom/include/axiom_processing_instruction.h new file mode 100644 index 0000000..24fcdc9 --- /dev/null +++ b/axiom/include/axiom_processing_instruction.h @@ -0,0 +1,136 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_PI_H +#define AXIOM_PI_H + +#include <axiom_node.h> +#include <axiom_output.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_processing_instruction pocessing instruction + * @ingroup axiom_om + * @{ + */ + + typedef struct axiom_processing_instruction + axiom_processing_instruction_t; + + /** + * Creates a processing instruction + * @param environment Environment. MUST NOT be NULL. + * @param parent parent of the element node to be created. Optional, can be NULL. + * @param target target of the processing instruction.cannot be NULL. + * @param value value of the processing instruction.cannot be NULL. + * @param node This is an out parameter. cannot be NULL. + * Returns the node corresponding to the comment created. + * Node type will be set to AXIOM_PROCESSING_INSTRUCTION + * @return a pointer tonewly created processing instruction struct + */ + AXIS2_EXTERN axiom_processing_instruction_t *AXIS2_CALL + axiom_processing_instruction_create( + const axutil_env_t * env, + axiom_node_t * parent, + const axis2_char_t * target, + const axis2_char_t * value, + axiom_node_t ** node); + + /** + * Frees an instance of axiom_processing_instruction + * @param om_pi processing instruction to be freed. + * @param env Environment. MUST NOT be NULL, . + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_processing_instruction_free( + struct axiom_processing_instruction *om_pi, + const axutil_env_t * env); + + /** + * Set processing instruction data + * @param om_pi + * @param env Environment. MUST NOT be NULL, . + * @param value + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_processing_instruction_set_value( + struct axiom_processing_instruction *om_pi, + const axutil_env_t * env, + const axis2_char_t * value); + + /** + * Set processing instruction target + * @param om_pi processing_instruction struct + * @param env environment, MUST NOT be NULL. + * @param target + * @return status of the op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_processing_instruction_set_target( + struct axiom_processing_instruction *om_pi, + const axutil_env_t * env, + const axis2_char_t * target); + + /** + * Get PI target + * @param om_pi processing_instruction struct + * @param env Environment. MUST NOT be NULL, . + * @return target text , NULL on error or if target is null + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_processing_instruction_get_target( + struct axiom_processing_instruction *om_pi, + const axutil_env_t * env); + + /** + * Get data part of processing_instruction + * @param om_pi processing instruction + * @param env environment , MUST NOT be NULL. + * @return data text , NULL if there is no data, + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_processing_instruction_get_value( + struct axiom_processing_instruction *om_pi, + const axutil_env_t * env); + + /** + * Serialize function + * @param om_pi processing_instruction struct + * @param env environment, MUST NOT be NULL. + * @param om_output om_output handler struct + * @return status of the op, AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_processing_instruction_serialize( + struct axiom_processing_instruction *om_pi, + const axutil_env_t * env, + axiom_output_t * om_output); + + /** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_PI_H */ diff --git a/axiom/include/axiom_soap.h b/axiom/include/axiom_soap.h new file mode 100644 index 0000000..be0d956 --- /dev/null +++ b/axiom/include/axiom_soap.h @@ -0,0 +1,53 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_H +#define AXIOM_SOAP_H + +#include <axiom_soap_body.h> +#include <axiom_soap_builder.h> +#include <axiom_soap_const.h> +#include <axiom_soap_envelope.h> +#include <axiom_soap_fault_code.h> +#include <axiom_soap_fault_detail.h> +#include <axiom_soap_fault.h> +#include <axiom_soap_fault_node.h> +#include <axiom_soap_fault_reason.h> +#include <axiom_soap_fault_role.h> +#include <axiom_soap_fault_sub_code.h> +#include <axiom_soap_fault_text.h> +#include <axiom_soap_fault_value.h> +#include <axiom_soap_header_block.h> +#include <axiom_soap_header.h> + +/** +* @file axiom_soap.h +* @brief includes all SOAP related headers +*/ +#ifdef __cplusplus +extern "C" +{ +#endif + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_SOAP_H */ diff --git a/axiom/include/axiom_soap_body.h b/axiom/include/axiom_soap_body.h new file mode 100644 index 0000000..203b584 --- /dev/null +++ b/axiom/include/axiom_soap_body.h @@ -0,0 +1,184 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_BODY_H +#define AXIOM_SOAP_BODY_H + +/** + * @file axiom_soap_body.h + * @brief axiom_soap_body struct + */ + +#include <axutil_env.h> +#include <axiom_node.h> +#include <axiom_element.h> +#include <axiom_namespace.h> +#include <axiom_soap_fault.h> +#include <axiom_soap_envelope.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_body axiom_soap_body_t; + struct axiom_soap_builder; + + /** + * @defgroup axiom_soap_body soap body + * @ingroup axiom_soap + * @{ + */ + + /** + * a struct that represents the contents of the SOAP body + * element in a SOAP message. SOAP body element consists of XML data + * that affects the way the application-specific content is processed. + * soap_body_struct contains soap_header and + * which have the content for the SOAP body. + * this also contains axiom_soap_fault_t struct , which carries status and/or + * error information. + */ + + /** + * creates a soap body struct + * @param env Environment. MUST NOT be NULL + * @param envelope the SOAP envelope to set the SOAP Body + * @return created SOAP Body + */ + + AXIS2_EXTERN axiom_soap_body_t *AXIS2_CALL + axiom_soap_body_create_with_parent( + const axutil_env_t * env, + struct axiom_soap_envelope *envelope); + + /** + * Deallocate all the resources associated to soap_body + * But it does not deallocate the underlying om structure + * @param body soap_body struct + * @param env must not be null + * @return status code AXIS2_SUCCESS + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_body_free( + axiom_soap_body_t * body, + const axutil_env_t * env); + + /** + * Indicates whether a soap fault is available with this + * soap body + * @param body soap_body struct + * @param env environment must not be null + * @return AXIS2_TRUE if fault is available, AXIS2_FALSE otherwise + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_soap_body_has_fault( + axiom_soap_body_t * body, + const axutil_env_t * env); + + /** + * returns the soap fault in this soap_body + * IF a soap_builder is associated with the soap_body + * Pulling will take place + * @param body soap_body + * @param env environment must not be null + * @return axiom_soap_fault_t if available, NULL otherwise + */ + AXIS2_EXTERN axiom_soap_fault_t *AXIS2_CALL + axiom_soap_body_get_fault( + axiom_soap_body_t * body, + const axutil_env_t * env); + + /** + * get the underlying om_node + * @param body soap_body + * @param env environment must not be null + * @returns axiom_node_t + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_body_get_base_node( + axiom_soap_body_t * body, + const axutil_env_t * env); + + /** + * return the soap version + * @param body soap_body + * @param env environment must not be null + * @return one of AXIOM_SOAP11 or AXIOM_SOAP12 + */ + AXIS2_EXTERN int AXIS2_CALL + axiom_soap_body_get_soap_version( + axiom_soap_body_t * body, + const axutil_env_t * env); + + /** + * build the soap body completely . return the status code, + * @param body pointer to soap_body struct + * @param env axutil_environment struct MUST not be NULL + * @returns status code , AXIS2_SUCCESS on success , AXIS2_ERROR + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_body_build( + axiom_soap_body_t * body, + const axutil_env_t * env); + + /** add an om node as the child to this soap_body + * the child is added to as the first child + * @param body pointer to soap_body struct + * @param env axutil_environment struct MUST not be NULL + * @returns status code , AXIS2_SUCCESS on success , AXIS2_ERROR + * otherwise + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_body_add_child( + axiom_soap_body_t * body, + const axutil_env_t * env, + axiom_node_t * child); + + /** + * SOAP builder construct a SOAP 1.2 fault all the time. + * So when SOAP 1.1 is in use, we should convert SOAP fault to + * SOAP 1.1 fault format before use. + * @param body pointer to soap_body struct + * @param env axutil_environment struct MUST not be NULL + * @returns status code , AXIS2_SUCCESS on success , AXIS2_ERROR + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_body_convert_fault_to_soap11( + axiom_soap_body_t * soap_body, + const axutil_env_t * env); + + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_body_process_attachments( + axiom_soap_body_t * soap_body, + const axutil_env_t * env, + void *user_param, + axis2_char_t *callback_name); + + AXIS2_EXTERN struct axiom_soap_builder *AXIS2_CALL + axiom_soap_body_get_builder( + axiom_soap_body_t * soap_body, + const axutil_env_t * env); + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_SOAP_BODY_H */ diff --git a/axiom/include/axiom_soap_builder.h b/axiom/include/axiom_soap_builder.h new file mode 100644 index 0000000..9fffb78 --- /dev/null +++ b/axiom/include/axiom_soap_builder.h @@ -0,0 +1,253 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_BUILDER_H +#define AXIOM_SOAP_BUILDER_H + +#include <axiom_stax_builder.h> +#include <axiom_soap_envelope.h> +#include <axiom_mime_parser.h> + +/** + * @file axiom_soap_builder.h + * @brief axiom_soap_builder struct + */ + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_builder axiom_soap_builder_t; + + /** + * @defgroup axiom_soap_builder soap builder + * @ingroup axiom_soap + * @{ + */ + + /** + * creates a axiom_soap_builder struct + * @param env Environment. MUST NOT be NULL + * @param builder Stax builder + * @return the created SOAP Builder + */ + AXIS2_EXTERN axiom_soap_builder_t *AXIS2_CALL + axiom_soap_builder_create( + const axutil_env_t * env, + axiom_stax_builder_t * builder, + const axis2_char_t * soap_version); + /** + * Free the SOAP Builder + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * + * @return VOID + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_builder_free( + axiom_soap_builder_t * builder, + const axutil_env_t * env); + + /** + * Get the SOAP envelope of the SOAP builder + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * + * @return the SOAP envelope + */ + AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL + axiom_soap_builder_get_soap_envelope( + axiom_soap_builder_t * builder, + const axutil_env_t * env); + + /** + * Get the OM document of the SOAP Buidler + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * + * @return the OM document + */ + AXIS2_EXTERN axiom_document_t *AXIS2_CALL + axiom_soap_builder_get_document( + axiom_soap_builder_t * builder, + const axutil_env_t * env); + + /** + * Builds next element of the OM structure + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * @return AXIS2_SUCCESS if the next element is present else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_builder_next( + axiom_soap_builder_t * builder, + const axutil_env_t * env); + + /** + * + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * + * @return the axiom_node of the OM document + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_builder_get_document_element( + axiom_soap_builder_t * builder, + const axutil_env_t * env); + + /** + * + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * + * @return AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_builder_set_bool_processing_mandatory_fault_elements( + axiom_soap_builder_t * builder, + const axutil_env_t * env, + axis2_bool_t value); + + /** + * + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * + * @return AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_builder_set_processing_detail_elements( + axiom_soap_builder_t * builder, + const axutil_env_t * env, + axis2_bool_t value); + + /** + * + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * + * @return AXIS2_TRUE if the the element is present, AXIS2_FALSE otherwise + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_soap_builder_is_processing_detail_elements( + axiom_soap_builder_t * builder, + const axutil_env_t * env); + + /** + * Get the SOAP version + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * + * @return the SOAP version + */ + AXIS2_EXTERN int AXIS2_CALL + axiom_soap_builder_get_soap_version( + axiom_soap_builder_t * builder, + const axutil_env_t * env); + + /** + * Set the MIME body parts + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * + * @return AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_builder_set_mime_body_parts( + axiom_soap_builder_t * builder, + const axutil_env_t * env, + axutil_hash_t * map); + + /** + * Get the MIME body parts + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * + * @return hash of mime body parts + */ + AXIS2_EXTERN axutil_hash_t *AXIS2_CALL + axiom_soap_builder_get_mime_body_parts( + axiom_soap_builder_t * builder, + const axutil_env_t * env); + + /** + * Set the mime_parser + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * @paran mime_parser pointer to a axiom_mime_parser_t instance + */ + + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_builder_set_mime_parser( + axiom_soap_builder_t * builder, + const axutil_env_t * env, + axiom_mime_parser_t *mime_parser); + + /** + * Set the callback function + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * @param callback to the callback function pointer + */ + + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_builder_set_callback_function( + axiom_soap_builder_t * builder, + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK callback); + + /** + * Set the callback_ctx + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * @param void pointer to the callback_ctx + */ + + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_builder_set_callback_ctx( + axiom_soap_builder_t * builder, + const axutil_env_t * env, + void *callback_ctx); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_builder_create_attachments( + axiom_soap_builder_t * builder, + const axutil_env_t * env, + void *user_param, + axis2_char_t *callback_name); + + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_soap_builder_replace_xop( + axiom_soap_builder_t * builder, + const axutil_env_t * env, + axiom_node_t *om_element_node, + axiom_element_t *om_element); + + AXIS2_EXTERN axiom_stax_builder_t *AXIS2_CALL + axiom_soap_builder_get_om_builder( + axiom_soap_builder_t * builder, + const axutil_env_t * env); + + + + /** @} */ +#ifdef __cplusplus +} +#endif +#endif /* AXIOM_SOAP_BUILDER_H */ diff --git a/axiom/include/axiom_soap_const.h b/axiom/include/axiom_soap_const.h new file mode 100644 index 0000000..3d5933b --- /dev/null +++ b/axiom/include/axiom_soap_const.h @@ -0,0 +1,176 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_CONST_H +#define AXIOM_SOAP_CONST_H + +/** +* @file axiom_soap.h +* @brief defines SOAP constants +*/ +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap SOAP + * @ingroup axiom + * @{ + * @} + */ + typedef enum soap_version + { + AXIOM_SOAP_VERSION_NOT_SET = 0, + + AXIOM_SOAP11, + + AXIOM_SOAP12 + } axiom_soap_version; + + /** soap 11 constants */ + +#define AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI "http://schemas.xmlsoap.org/soap/envelope/" + +#define AXIOM_SOAP11_ATTR_ACTOR "actor" + +#define AXIOM_SOAP11_SOAP_FAULT_CODE_LOCAL_NAME "faultcode" + +#define AXIOM_SOAP11_SOAP_FAULT_STRING_LOCAL_NAME "faultstring" + +#define AXIOM_SOAP11_SOAP_FAULT_ACTOR_LOCAL_NAME "faultactor" + +#define AXIOM_SOAP11_SOAP_FAULT_DETAIL_LOCAL_NAME "detail" + +#define AXIOM_SOAP11_CONTENT_TYPE "text/xml" + +#define AXIOM_SOAP11_FAULT_CODE_SENDER "Client" + +#define AXIOM_SOAP11_FAULT_CODE_RECEIVER "Server" + +#define AXIOM_SOAP11_SOAP_ACTOR_NEXT "http://schemas.xmlsoap.org/soap/actor/next" + + /** soap12 constants */ + +#define AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI "http://www.w3.org/2003/05/soap-envelope" + +#define AXIOM_SOAP12_SOAP_ROLE "role" + +#define AXIOM_SOAP12_SOAP_RELAY "relay" + +#define AXIOM_SOAP12_SOAP_FAULT_CODE_LOCAL_NAME "Code" + +#define AXIOM_SOAP12_SOAP_FAULT_SUB_CODE_LOCAL_NAME "Subcode" + +#define AXIOM_SOAP12_SOAP_FAULT_VALUE_LOCAL_NAME "Value" + +#define AXIOM_SOAP12_SOAP_FAULT_VALUE_VERSION_MISMATCH "VersionMismatch" + +#define AXIOM_SOAP12_SOAP_FAULT_VALUE_MUST_UNDERSTAND "MustUnderstand" + +#define AXIOM_SOAP12_SOAP_FAULT_VALUE_DATA_ENCODING_UKNOWN "DataEncodingUnknown" + +#define AXIOM_SOAP12_SOAP_FAULT_VALUE_SENDER "Sender" + +#define AXIOM_SOAP12_SOAP_FAULT_VALUE_RECEIVER "Receiver" + + /** SOAP Fault */ + +#define AXIOM_SOAP12_SOAP_FAULT_REASON_LOCAL_NAME "Reason" + +#define AXIOM_SOAP12_SOAP_FAULT_TEXT_LOCAL_NAME "Text" + +#define AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME "lang" + +#define AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_NS_URI "http://www.w3.org/XML/1998/namespace" + +#define AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX "xml" + +#define AXIOM_SOAP12_SOAP_FAULT_NODE_LOCAL_NAME "Node" + +#define AXIOM_SOAP12_SOAP_FAULT_DETAIL_LOCAL_NAME "Detail" + +#define AXIOM_SOAP12_SOAP_FAULT_ROLE_LOCAL_NAME "Role" + +#define AXIOM_SOAP12_CONTENT_TYPE "application/soap+xml" + +#define AXIOM_SOAP12_FAULT_CODE_SENDER "Sender" + +#define AXIOM_SOAP12_FAULT_CODE_RECEIVER "Receiver" + +#define AXIOM_SOAP12_SOAP_ROLE_NEXT "http://www.w3.org/2003/05/soap-envelope/role/next" + +#define AXIOM_SOAP12_SOAP_ROLE_NONE "http://www.w3.org/2003/05/soap-envelope/role/none" + +#define SOAP12_SOAP_ROLE_ULTIMATE_RECEIVER "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" + +#define AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX "soapenv" + +#define AXIOM_SOAP_ENVELOPE_LOCAL_NAME "Envelope" + +#define AXIOM_SOAP_HEADER_LOCAL_NAME "Header" + +#define AXIOM_SOAP_BODY_LOCAL_NAME "Body" + +#define AXIOM_SOAP_BODY_NAMESPACE_PREFIX AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX + +#define AXIOM_SOAP_BODY_FAULT_LOCAL_NAME "Fault" + + /** attribute must understand */ + +#define AXIOM_SOAP_ATTR_MUST_UNDERSTAND "mustUnderstand" + +#define AXIOM_SOAP_ATTR_MUST_UNDERSTAND_TRUE "true" + +#define AXIOM_SOAP_ATTR_MUST_UNDERSTAND_FALSE "false" + +#define AXIOM_SOAP_ATTR_MUST_UNDERSTAND_0 "0" + +#define AXIOM_SOAP_ATTR_MUST_UNDERSTAND_1 "1" + +#define AXIOM_SOAP_FAULT_LOCAL_NAME "Fault" + +#define AXIOM_SOAP_FAULT_DETAIL_LOCAL_NAME "detail" + +#define AXIOM_SOAP_FAULT_NAMESPACE_PREFIX AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX + +#define AXIOM_SOAP_FAULT_DETAIL_EXCEPTION_ENTRY "Exception" + +#define AXIOM_SOAP_FAULT_CODE_VERSION_MISMATCH "soapenv:VersionMismatch" + +#define AXIOM_SOAP_FAULT_CODE_MUST_UNDERSTAND "soapenv:MustUnderstand" + +#define AXIOM_SOAP_FAULT_CODE_DATA_ENCODING_UNKNOWN "soapenv:DataEncodingUnknown" + +#define AXIOM_SOAP_FAULT_CODE_SENDER "" + +#define AXIOM_SOAP_FAULT_CODE_RECEIVER "" + + /* MTOM related */ + +#define AXIS2_XOP_NAMESPACE_URI "http://www.w3.org/2004/08/xop/include" + +#define AXIS2_XOP_INCLUDE "Include" + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_SOAP_CONSTANTS_H */ diff --git a/axiom/include/axiom_soap_envelope.h b/axiom/include/axiom_soap_envelope.h new file mode 100644 index 0000000..24b8645 --- /dev/null +++ b/axiom/include/axiom_soap_envelope.h @@ -0,0 +1,244 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_ENVELOPE_H +#define AXIOM_SOAP_ENVELOPE_H + +/** + * @file axiom_soap_envelope.h + * @brief axiom_soap_envelope struct + * corresponds to root element of soap message + */ +#include <axutil_env.h> +#include <axiom_node.h> +#include <axiom_element.h> +#include <axiom_namespace.h> +#include <axutil_array_list.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_envelope axiom_soap_envelope_t; + + struct axiom_soap_body; + struct axiom_soap_header; + struct axiom_soap_header_block; + struct axiom_soap_builder; + + /** + * @defgroup axiom_soap_envelope soap envelope + * @ingroup axiom_soap + * @{ + */ + + /** + * create a soap_envelope with the given namespace prefix and uri + * as the prefix and uri, The uri of ns should be valid soap uri + * @param env Environment. MUST NOT be NULL + * @param ns The OM namespace + * + * @return Created SOAP envelope + */ + AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL + axiom_soap_envelope_create( + const axutil_env_t * env, + axiom_namespace_t * ns); + + /** + * create a soap_envelope with the given namespace prefix and uri is selected + * according to soap_version, soap version should be one of AXIOM_SOAP11 + * or AXIOM_SOAP12 + * @param env Environment. MUST NOT be NULL + * @param prefix soap envelope prefix + * if prefix is NULL default prefix is used + * + * @return a pointer to soap envelope struct + */ + AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL + axiom_soap_envelope_create_with_soap_version_prefix( + const axutil_env_t * env, + int soap_version, + const axis2_char_t * prefix); + + /** + * Create the default SOAP envelope + * @param envelope OM SOAP Envelope + * @param env Environment. MUST NOT be NULL + * + * @return Created SOAP envelope + */ + AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL + axiom_soap_envelope_create_default_soap_envelope( + const axutil_env_t * env, + int soap_version); + + /** + * Create the default SOAP fault envelope + * @param envelope OM SOAP Envelope + * @param env Environment. MUST NOT be NULL + * + * @return Created SOAP fault envelope + */ + AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL + axiom_soap_envelope_create_default_soap_fault_envelope( + const axutil_env_t * env, + const axis2_char_t * code_value, + const axis2_char_t * reason_text, + const int soap_version, + axutil_array_list_t * sub_codes, + axiom_node_t * detail_node); + + /** + * gets the soap header of this soap envelope + * @param envelope soap envelope + * @param env environment must not be null + * @return soap header null it no header is present + */ + AXIS2_EXTERN struct axiom_soap_header *AXIS2_CALL + axiom_soap_envelope_get_header( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env); + + /** + * Returns the soap body associated with this soap envelope + * @param envelope soap_envelope + * @param env environment + * @return soap_body + */ + AXIS2_EXTERN struct axiom_soap_body *AXIS2_CALL + axiom_soap_envelope_get_body( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env); + + /** + * serialize function , serialize the soap envelope + * IF the soap version it set to soap11 the soap fault part is converted + * to soap11 fault even is the underlying soap fault is of soap12 type + * @param envelope soap envelope + * @param env environment must not be null + * @param om_output + * @param cache whether caching is enabled or not + * @return status code , AXIS2_SUCCESS if success , + * AXIS2_FAILURE otherwise + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_envelope_serialize( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env, + axiom_output_t * om_output, + axis2_bool_t cache); + + /** + * Free function, This function deallocate all the resources associated + * with the soap_envelope + * IT frees it's soap body and soap headers as well as the underlying + * om node tree by calling axiom_node_free_tree function + * @param envelope soap_envelope + * @param env environment + * @return VOID + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_envelope_free( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env); + + /** + * returns the om_node associated with this soap envelope + * @param envelope soap_envelope + * @param env environment + * @return axiom_node_t pointer + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_envelope_get_base_node( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env); + + /** returns the soap version of this soap envelope + * @param envelope soap_envelope + * @param env environment must not be null + * @return soap_version AXIOM_SOAP12 or AXIOM_SOAP11 + */ + AXIS2_EXTERN int AXIS2_CALL + axiom_soap_envelope_get_soap_version( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env); + + /** + * Return the soap envelope namespace + * @param envelope + * @param env + * @return axiom_namespace_t + */ + AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL + axiom_soap_envelope_get_namespace( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env); + + /** + * Set the SOAP version + * @param envelope OM SOAP Envelope + * @param env Environment. MUST NOT be NULL + * @param soap_version, the SOAP version number. + * Must be either AXIOM_SOAP11 or AXIOM_SOAP12 + * + * @return AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_envelope_set_soap_version( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env, + int soap_version); + + /** + * Increment the reference number for the created instance + * @param envelope OM SOAP Envelope + * @param env Environment. MUST NOT be NULL + * + * @return AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_envelope_increment_ref( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env); + + /** + * get the soap builder of the envelope + * @param envelope OM SOAP Envelope + * @param env Environment. MUST NOT be NULL + * + * @return soap_builder struct related to the envelope + */ + AXIS2_EXTERN struct axiom_soap_builder *AXIS2_CALL + axiom_soap_envelope_get_soap_builder( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env); + + AXIS2_EXTERN struct axiom_soap_builder *AXIS2_CALL + axiom_soap_envelope_get_builder( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_SOAP_ENVELOPE_H */ diff --git a/axiom/include/axiom_soap_fault.h b/axiom/include/axiom_soap_fault.h new file mode 100644 index 0000000..d75ea3c --- /dev/null +++ b/axiom/include/axiom_soap_fault.h @@ -0,0 +1,215 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_FAULT_H +#define AXIOM_SOAP_FAULT_H + +/** + * @file axiom_soap_fault.h + * @brief axiom_soap_fault struct + */ +#include <axiom_soap_const.h> +#include <axutil_env.h> +#include <axiom_node.h> +#include <axiom_element.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_fault axiom_soap_fault_t; + + struct axiom_soap_fault_reason; + struct axiom_soap_fault_detail; + struct axiom_soap_fault_sub_code; + struct axiom_soap_fault_code; + struct axiom_soap_fault_node; + struct axiom_soap_fault_role; + struct axiom_soap_fault_text; + struct axiom_soap_fault_value; + struct axiom_soap_body; + struct axiom_soap_builder; + + /** + * @defgroup axiom_soap_fault soap fault + * @ingroup axiom_soap + * @{ + */ + + /** + * creates a soap fault struct + * @param env environment must not be NULL + * @param parent soap body struct to which this soap + * fault is the child + * @param env Environment. MUST NOT be NULL + * @returns pointer to axiom_soap_fault_t struct on success + * otherwise return NULL with error code set in environments error + */ + AXIS2_EXTERN axiom_soap_fault_t *AXIS2_CALL + axiom_soap_fault_create_with_parent( + const axutil_env_t * env, + struct axiom_soap_body *parent); + + /** create an returns a axiom_soap_fault_t struct with a soap fault detail + * element and have this exceptio string as a text of a child of soap fault + * detail + * @param env environment must not be NULL + * @param parent soap body struct must not be NULL + * @param exceptio an error string must not be NULL + * @returns pointer to axiom_soap_fault_t on success , + * otherwise return NULL + */ + AXIS2_EXTERN axiom_soap_fault_t *AXIS2_CALL + axiom_soap_fault_create_with_exception( + const axutil_env_t * env, + struct axiom_soap_body *parent, + axis2_char_t * exception); + + /** + * + * @param env environment must not be NULL + * @param parent soap body struct must not be NULL + * @param code_value + * @param reason_text + * @param soap_version + * + * @return the created default OM SOAP fault + */ + AXIS2_EXTERN axiom_soap_fault_t *AXIS2_CALL + axiom_soap_fault_create_default_fault( + const axutil_env_t * env, + struct axiom_soap_body *parent, + const axis2_char_t * code_value, + const axis2_char_t * reason_text, + const int soap_version); + + /** + * Free an axiom_soap_fault + * @param fault pointer to soap_fault struct + * @param env Environment. MUST NOT be NULL + * @return status of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_fault_free( + axiom_soap_fault_t * fault, + const axutil_env_t * env); + + /** + * this function returns a axiom_soap_fault_code struct + * if a fault code is associated with this soap fault + * only valid when called after building the soap fault + * @param fault soap fault struct + * @param env environment must not be NULL + * @returns pointer to soap_fault_code struct if one is associated + * with this soap_fault struct , NULL is returned otherwise + */ + AXIS2_EXTERN struct axiom_soap_fault_code *AXIS2_CALL + axiom_soap_fault_get_code( + axiom_soap_fault_t * fault, + const axutil_env_t * env); + + /** + * @param fault soap fault struct + * @param env environment must not be NULL + * @returns pointer to soap_fault_reason struct if one is associated + * with this soap_fault struct , NULL is returned otherwise + */ + + AXIS2_EXTERN struct axiom_soap_fault_reason *AXIS2_CALL + axiom_soap_fault_get_reason( + axiom_soap_fault_t * fault, + const axutil_env_t * env); + + /** + * @param fault soap fault struct + * @param env environment must not be NULL + * @returns pointer to soap_fault_node struct if one is associated + * with this soap_fault struct , NULL is returned otherwise + */ + AXIS2_EXTERN struct axiom_soap_fault_node *AXIS2_CALL + axiom_soap_fault_get_node( + axiom_soap_fault_t * fault, + const axutil_env_t * env); + + /** + * @param fault soap fault struct + * @param env environment must not be NULL + * @returns pointer to soap_fault_code struct if one is associated + * with this soap_fault struct , NULL is returned otherwise + */ + AXIS2_EXTERN struct axiom_soap_fault_role *AXIS2_CALL + axiom_soap_fault_get_role( + axiom_soap_fault_t * fault, + const axutil_env_t * env); + + /** + * @param fault soap fault struct + * @param env environment must not be NULL + * @returns a pointer to soap_fault_code struct if one is + * associated with this soap_fault struct , NULL is returned otherwise + */ + AXIS2_EXTERN struct axiom_soap_fault_detail *AXIS2_CALL + axiom_soap_fault_get_detail( + axiom_soap_fault_t * fault, + const axutil_env_t * env); + + /** + * @param fault soap fault struct + * @param env enviroment must not be NULL + * @returns a pointer to soap_fault_code struct if one is + * associated with this soap_fault struct , NULL is returned otherwise + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_soap_fault_get_exception( + axiom_soap_fault_t * fault, + const axutil_env_t * env); + + /** + * set an error string + * @param fualt soap fault struct + * @param env enviroment must not be NULL + * @param exception error message to be stored on soap fault + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_set_exception( + axiom_soap_fault_t * fault, + const axutil_env_t * env, + axis2_char_t * exception); + + /** + * returns the axiom_node_t struct which is wrapped by + * this soap fault struct + * @param fault soap fault struct + * @param env environment must not be NULL + * @returns a pointer to axiom_node_t struct if an om node is associated + * with this soap fault struct, otherwise return NULL + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_fault_get_base_node( + axiom_soap_fault_t * fault, + const axutil_env_t * env); + + /** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_SOAP_FAULT_H */ diff --git a/axiom/include/axiom_soap_fault_code.h b/axiom/include/axiom_soap_fault_code.h new file mode 100644 index 0000000..ccc2b46 --- /dev/null +++ b/axiom/include/axiom_soap_fault_code.h @@ -0,0 +1,120 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_FAULT_CODE_H +#define AXIOM_SOAP_FAULT_CODE_H + +/** + * @file axiom_soap_fault_code.h + * @brief axiom_soap_fault_code struct + */ +#include <axutil_env.h> +#include <axiom_soap_fault.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_fault_code axiom_soap_fault_code_t; + + struct axiom_soap_fault_value; + struct axiom_soap_fault_sub_code; + struct axiom_soap_builder; + + /** + * @defgroup axiom_soap_fault_code soap fault code + * @ingroup axiom_soap + * @{ + */ + + /** + * creates a soap fault code struct + * @param env Environment. MUST NOT be NULL + * @param fault_code the pointer to the AXIOM fault code struct + * + * @return + */ + AXIS2_EXTERN axiom_soap_fault_code_t *AXIS2_CALL + axiom_soap_fault_code_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_t * fault); + /** + * + * @param fault_code the pointer to the AXIOM fault code struct + * @param env Environment. MUST NOT be NULL + * + * @return + */ + AXIS2_EXTERN axiom_soap_fault_code_t *AXIS2_CALL + axiom_soap_fault_code_create_with_parent_value( + const axutil_env_t * env, + axiom_soap_fault_t * fault, + axis2_char_t * value); + + /** + * Free an axiom_soap_fault_code + * @param fault_code pointer to soap_fault_code struct + * @param env Environment. MUST NOT be NULL + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_fault_code_free( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env); + + /** + * @param fault_code the pointer to the AXIOM fault code struct + * @param env Environment. MUST NOT be NULL + * @returns axiom_soap_fault_sub_code struct if one is associated with + * this fault_code struct , otherwise teturns NULL + */ + + AXIS2_EXTERN struct axiom_soap_fault_sub_code *AXIS2_CALL + axiom_soap_fault_code_get_sub_code( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env); + + /** + * @param fault_code the pointer to the AXIOM fault code struct + * @param env Environment. MUST NOT be NULL + * @returns soap_fault_value if available + */ + AXIS2_EXTERN struct axiom_soap_fault_value *AXIS2_CALL + axiom_soap_fault_code_get_value( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env); + /** + * Get the base node of the SOAP fault + * @param fault_code the pointer to the AXIOM fault code struct + * @param env Environment. MUST NOT be NULL + * + * @return retrns the base node of the SOAP fault + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_fault_code_get_base_node( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif +#endif /* AXIOM_SOAP_FAULT_CODE_H */ diff --git a/axiom/include/axiom_soap_fault_detail.h b/axiom/include/axiom_soap_fault_detail.h new file mode 100644 index 0000000..6d17a77 --- /dev/null +++ b/axiom/include/axiom_soap_fault_detail.h @@ -0,0 +1,111 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_FAULT_DETAIL_H +#define AXIOM_SOAP_FAULT_DETAIL_H + +/** + * @file axiom_soap_fault_detail.h + * @brief axiom_soap_fault_detail struct + */ + +#include <axutil_env.h> +#include <axiom_soap_fault.h> +#include <axiom_children_iterator.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_fault_detail axiom_soap_fault_detail_t; + + /** + * @defgroup axiom_soap_fault_detail soap fault detail + * @ingroup axiom_soap + * @{ + */ + + /** + * creates a soap struct + * @param env Environment. MUST NOT be NULL + * @param fault The SOAP fault + * + * @return the created OM SOAP fault detail + */ + AXIS2_EXTERN axiom_soap_fault_detail_t *AXIS2_CALL + axiom_soap_fault_detail_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_t * fault); + + /** + * Free an axiom_soap_fault_detail + * @param fault_detail pointer to soap_fault_detail struct + * @param env Environment. MUST NOT be NULL + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_fault_detail_free( + axiom_soap_fault_detail_t * fault_detail, + const axutil_env_t * env); + + /** + * Adds a detail entry to the SOAP fault detail + * @param fault_detail pointer to soap_fault_detail struct + * @param env Environment. MUST NOT be NULL + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_detail_add_detail_entry( + axiom_soap_fault_detail_t * fault_detail, + const axutil_env_t * env, + axiom_node_t * ele_node); + + /** + * Return all detail entries in the SOAP fault detail + * @param fault_detail pointer to soap_fault_detail struct + * @param env Environment. MUST NOT be NULL + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axiom_children_iterator_t *AXIS2_CALL + axiom_soap_fault_detail_get_all_detail_entries( + axiom_soap_fault_detail_t * fault_detail, + const axutil_env_t * env); + + /** + * Returns the base node of the SOAP fault detail + * @param fault_detail pointer to soap_fault_detail struct + * @param env Environment. MUST NOT be NULL + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_fault_detail_get_base_node( + axiom_soap_fault_detail_t * fault_code, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_SOAP_FAULT_DETAIL_H */ diff --git a/axiom/include/axiom_soap_fault_node.h b/axiom/include/axiom_soap_fault_node.h new file mode 100644 index 0000000..b0a8313 --- /dev/null +++ b/axiom/include/axiom_soap_fault_node.h @@ -0,0 +1,112 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_FAULT_NODE_H +#define AXIOM_SOAP_FAULT_NODE_H + +/** + * @file axiom_soap_fault_node.h + * @brief axiom_soap_fault_node struct + */ +#include <axutil_env.h> +#include <axiom_soap_fault.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_fault_node axiom_soap_fault_node_t; + + /** + * @defgroup axiom_soap_fault_node soap fault node + * @ingroup axiom_soap + * @{ + */ + + /** + * creates a soap fault node struct + * @param env Environment. MUST NOT be NULL + * @param fault_node pointer to soap_fault_node struct + * + * @return the created SOAP fault node + */ + AXIS2_EXTERN axiom_soap_fault_node_t *AXIS2_CALL + axiom_soap_fault_node_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_t * fault); + + /** + * Free an axiom_soap_fault_node + * @param fault_node pointer to soap_fault_node struct + * @param env Environment. MUST NOT be NULL + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_fault_node_free( + axiom_soap_fault_node_t * fault_node, + const axutil_env_t * env); + + /** + * Set the fault string value of the SOAP fault node + * @param fault_node pointer to soap_fault_node struct + * @param env Environment. MUST NOT be NULL + * @param fault_val the fault string value + * + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_node_set_value( + axiom_soap_fault_node_t * fault_node, + const axutil_env_t * env, + axis2_char_t * fault_val); + + /** + * Get the string value of the SOAP fault node + * @param fault_node pointer to soap_fault_node struct + * @param env Environment. MUST NOT be NULL + * + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_soap_fault_node_get_value( + axiom_soap_fault_node_t * fault_node, + const axutil_env_t * env); + + /** + * Get the base node of the SOAP fault node + * @param fault_node pointer to soap_fault_node struct + * @param env Environment. MUST NOT be NULL + * + * @return the base node of the fault node + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_fault_node_get_base_node( + axiom_soap_fault_node_t * fault_node, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_SOAP_FAULT_NODE_H */ diff --git a/axiom/include/axiom_soap_fault_reason.h b/axiom/include/axiom_soap_fault_reason.h new file mode 100644 index 0000000..e9e8da3 --- /dev/null +++ b/axiom/include/axiom_soap_fault_reason.h @@ -0,0 +1,139 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_FAULT_REASON_H +#define AXIOM_SOAP_FAULT_REASON_H + +/** +* @file axiom_soap_fault_reason.h +* @brief axiom_soap_fault_reason +*/ +#include <axutil_env.h> +#include <axiom_soap_fault.h> +#include <axutil_array_list.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_fault_reason axiom_soap_fault_reason_t; + struct axiom_soap_fault_text; + struct axiom_soap_builder; + + /** + * @defgroup axiom_soap_fault_reason soap fault reason + * @ingroup axiom_soap + * @{ + */ + + /** + * creates a SOAP fault reason struct + * @param env Environment. MUST NOT be NULL + * @param fault the SOAP fault + * + * @return the created SOAP fault reason struct + */ + AXIS2_EXTERN axiom_soap_fault_reason_t *AXIS2_CALL + axiom_soap_fault_reason_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_t * fault); + + /** + * Free an axiom_soap_fault_reason + * @param fault_reason pointer to soap_fault_reason struct + * @param env Environment. MUST NOT be NULL + * + * @return VOID + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_fault_reason_free( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env); + + /** + * Get the SOAP fault text by comparing the given string + * @param fault_reason pointer to soap_fault_reason struct + * @param env Environment. MUST NOT be NULL + * @param lang string to be compares + * + * @return the SOAP fault text of the SOAP fault string + */ + AXIS2_EXTERN struct axiom_soap_fault_text *AXIS2_CALL + axiom_soap_fault_reason_get_soap_fault_text( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env, + axis2_char_t * lang); + + /** + * Returns all the SOAP fault reason strings as an array list + * @param fault_reason pointer to soap_fault_reason struct + * @param env Environment. MUST NOT be NULL + * + * @return all the SOAP fault reason strings as an array list + */ + AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL + axiom_soap_fault_reason_get_all_soap_fault_texts( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env); + + /** + * Retuens the first SOAP fault reason string + * @param fault_reason pointer to soap_fault_reason struct + * @param env Environment. MUST NOT be NULL + * + * @return The first SOAP fault reason string + */ + AXIS2_EXTERN struct axiom_soap_fault_text *AXIS2_CALL + axiom_soap_fault_reason_get_first_soap_fault_text( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env); + + /** + * Add a string as a SOAP fault reason + * @param fault_reason pointer to soap_fault_reason struct + * @param env Environment. MUST NOT be NULL + * @param fault_text The text to be added as the SOAP fault reason + * + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_reason_add_soap_fault_text( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env, + struct axiom_soap_fault_text *fault_text); + + /** + * Get the base node of the SOAP fault reason + * @param fault_reason pointer to soap_fault_reason struct + * @param env Environment. MUST NOT be NULL + * @return the base node of the SOAP fault reason + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_fault_reason_get_base_node( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_SOAP_FAULT_REASON_H */ diff --git a/axiom/include/axiom_soap_fault_role.h b/axiom/include/axiom_soap_fault_role.h new file mode 100644 index 0000000..7cfa82c --- /dev/null +++ b/axiom/include/axiom_soap_fault_role.h @@ -0,0 +1,109 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_FAULT_ROLE_H +#define AXIOM_SOAP_FAULT_ROLE_H + +/** + * @file axiom_soap_fault_role.h + * @brief axiom_soap_fault_role + */ +#include <axutil_env.h> +#include <axiom_soap_fault.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_fault_role axiom_soap_fault_role_t; + + /** + * @defgroup axiom_soap_fault_role soap fault role + * @ingroup axiom_soap + * @{ + */ + + /** + * creates a soap struct + * @param env Environment. MUST NOT be NULL + */ + AXIS2_EXTERN axiom_soap_fault_role_t *AXIS2_CALL + axiom_soap_fault_role_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_t * fault); + + /** + * Free an axiom_soap_fault_role + * @param fault_role pointer to soap_fault_role struct + * @param env Environment. MUST NOT be NULL + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_fault_role_free( + axiom_soap_fault_role_t * fault_role, + const axutil_env_t * env); + + /** + * Set the SOAP fault role value + * @param fault_role pointer to soap_fault_role struct + * @param env Environment. MUST NOT be NULL + * @param uri the URI to be set + * + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_role_set_role_value( + axiom_soap_fault_role_t * fault_role, + const axutil_env_t * env, + axis2_char_t * uri); + + /** + * Get the SOAP fault role value + * @param fault_role pointer to soap_fault_role struct + * @param env Environment. MUST NOT be NULL + * + * @return the SOAP fault role value + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_soap_fault_role_get_role_value( + axiom_soap_fault_role_t * fault_role, + const axutil_env_t * env); + + /** + * Get the base node of the OM SOAP fault role + * @param fault_role pointer to soap_fault_role struct + * @param env Environment. MUST NOT be NULL + * + * @return the base node of the OM SOAP fault role + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_fault_role_get_base_node( + axiom_soap_fault_role_t * fault_role, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_SOAP_FAULT_ROLE_H */ diff --git a/axiom/include/axiom_soap_fault_sub_code.h b/axiom/include/axiom_soap_fault_sub_code.h new file mode 100644 index 0000000..6d4723c --- /dev/null +++ b/axiom/include/axiom_soap_fault_sub_code.h @@ -0,0 +1,123 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_FAULT_SUB_CODE_H +#define AXIOM_SOAP_FAULT_SUB_CODE_H + +/** + * @file axiom_soap_fault_sub_code.h + * @brief axiom_soap_fault_sub_code struct + */ +#include <axutil_env.h> +#include <axiom_soap_fault_code.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_fault_sub_code axiom_soap_fault_sub_code_t; + struct axiom_soap_fault_value; + struct axiom_soap_builder; + + /** + * @defgroup axiom_soap_fault_sub_code soap fault sub code + * @ingroup axiom_soap + * @{ + */ + + /** + * creates a soap struct + * @param env Environment. MUST NOT be NULL + * @param fault_code SOAP fault code + * + * @return Created SOAP fault sub code + */ + AXIS2_EXTERN axiom_soap_fault_sub_code_t *AXIS2_CALL + axiom_soap_fault_sub_code_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_code_t * fault_code); + + /** + * Create a SOAP fault sub code from the given SOAP fault and value + * @param fault_sub_code pointer to soap_fault_sub_code struct + * @param env Environment. MUST NOT be NULL + * @param value the value to be set to the SOAP fault + * + * @return Created SOAP sub code + */ + AXIS2_EXTERN axiom_soap_fault_sub_code_t *AXIS2_CALL + axiom_soap_fault_sub_code_create_with_parent_value( + const axutil_env_t * env, + axiom_soap_fault_code_t * fault_code, + axis2_char_t * value); + + /** + * Free an axiom_soap_fault_sub_code + * @param fault_sub_code pointer to soap_fault_sub_code struct + * @param env Environment. MUST NOT be NULL + * @return VOID + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_fault_sub_code_free( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env); + + /** + * Get the SOAP fault sub code + * @param fault_sub_code pointer to soap_fault_sub_code struct + * @param env Environment. MUST NOT be NULL + * + * @return the SOAP fault sub code + */ + AXIS2_EXTERN axiom_soap_fault_sub_code_t *AXIS2_CALL + axiom_soap_fault_sub_code_get_sub_code( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env); + + /** + * Get the value of the SOAP fault sub code + * @param fault_sub_code pointer to soap_fault_sub_code struct + * @param env Environment. MUST NOT be NULL + * + * @return the SOAP fault value + */ + AXIS2_EXTERN struct axiom_soap_fault_value *AXIS2_CALL + axiom_soap_fault_sub_code_get_value( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env); + + /** + * Get the base node of the SOAP fault sub code + * @param fault_sub_code pointer to soap_fault_sub_code struct + * @param env Environment. MUST NOT be NULL + * + * @return the base node of the SOAP fault sub code as OM node + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_fault_sub_code_get_base_node( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_SOAP_FAULT_SUB_CODE_H */ diff --git a/axiom/include/axiom_soap_fault_text.h b/axiom/include/axiom_soap_fault_text.h new file mode 100644 index 0000000..10a0465 --- /dev/null +++ b/axiom/include/axiom_soap_fault_text.h @@ -0,0 +1,138 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_FAULT_TEXT_H +#define AXIOM_SOAP_FAULT_TEXT_H + +/** + * @file axiom_soap_fault_text.h + * @brief axiom_soap_fault_text + */ +#include <axutil_env.h> +#include <axiom_soap_fault_reason.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_fault_text axiom_soap_fault_text_t; + + /** + * @defgroup axiom_soap_fault_text soap fault text + * @ingroup axiom_soap + * @{ + */ + + /** + * creates a soap fault struct + * @param env Environment. MUST NOT be NULL + * @param fault the SOAP fault reason + * + * @return Created SOAP fault text + */ + AXIS2_EXTERN axiom_soap_fault_text_t *AXIS2_CALL + axiom_soap_fault_text_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_reason_t * fault); + + /** + * Free an axiom_soap_fault_text + * @param fault_text pointer to soap_fault_text struct + * @param env Environment. MUST NOT be NULL + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_fault_text_free( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env); + + /** + * Set the lang of the SOAP fault text + * @param fault_text pointer to soap_fault_text struct + * @param env Environment. MUST NOT be NULL + * @param lang the string to be set + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_text_set_lang( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env, + const axis2_char_t * lang); + + /** + * Get the lang of the SOAP fault + * @param fault_text pointer to soap_fault_text struct + * @param env Environment. MUST NOT be NULL + * + * @return the lang of the SOAP fault + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_soap_fault_text_get_lang( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env); + + /** + * Get the base node of the SOAP fault text + * @param fault_text pointer to soap_fault_text struct + * @param env Environment. MUST NOT be NULL + * + * @return the base node of the SOAP fault text + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_fault_text_get_base_node( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env); + + /** + * Set the SOAP fault text + * @param fault_text pointer to soap_fault_text struct + * @param env Environment. MUST NOT be NULL + * @param value the text value + * @param lang string to be compared + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_text_set_text( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env, + axis2_char_t * value, + axis2_char_t * lang); + + /** + * get the SOAP fault text + * @param fault_text pointer to soap_fault_text struct + * @param env Environment. MUST NOT be NULL + * + * @return the Text of the SOAP fault + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_soap_fault_text_get_text( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_SOAP_FAULT_TEXT_H */ diff --git a/axiom/include/axiom_soap_fault_value.h b/axiom/include/axiom_soap_fault_value.h new file mode 100644 index 0000000..446a89e --- /dev/null +++ b/axiom/include/axiom_soap_fault_value.h @@ -0,0 +1,120 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_FAULT_VALUE_H +#define AXIOM_SOAP_FAULT_VALUE_H + +/** +* @file axiom_soap_fault_value.h +* @brief axiom_soap_fault_value +*/ +#include <axutil_env.h> +#include <axiom_soap_fault.h> +#include <axiom_soap_fault_sub_code.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_fault_value axiom_soap_fault_value_t; + + /** + * @defgroup axiom_soap_fault_value soap fault value + * @ingroup axiom_soap + * @{ + */ + + /** + * creates a soap struct + * @param env Environment. MUST NOT be NULL + */ + AXIS2_EXTERN axiom_soap_fault_value_t *AXIS2_CALL + axiom_soap_fault_value_create_with_subcode( + const axutil_env_t * env, + axiom_soap_fault_sub_code_t * parent); + + /** + * Create s SOAP fault value givn a SOAP fault code + * @param fault_value pointer to soap_fault_value struct + * @param env Environment. MUST NOT be NULL + * + * @return Created SOAP fault value + */ + AXIS2_EXTERN axiom_soap_fault_value_t *AXIS2_CALL + axiom_soap_fault_value_create_with_code( + const axutil_env_t * env, + axiom_soap_fault_code_t * parent); + + /** + * Free an axiom_soap_fault_value + * @param fault_value pointer to soap_fault_value struct + * @param env Environment. MUST NOT be NULL + * + * @return VOID + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_fault_value_free( + axiom_soap_fault_value_t * fault_value, + const axutil_env_t * env); + + /** + * Get the text value of the soapenv:Value element directly under soapenv:Code element + * @param fault_value pointer to axiom_soap_fault_t + * @param env Environment. MUST NOT BE NULL + * @return text value + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_soap_fault_value_get_text( + axiom_soap_fault_value_t * fault_value, + const axutil_env_t * env); + + /** + * Set the text value of the soapenv:Value element directly under soapenv:Code element + * @param fault_value pointer to axiom_soap_fault_t + * @param env Environment. MUST NOT BE NULL + * @param text value to be set + * + * @return the base node + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_fault_value_get_base_node( + axiom_soap_fault_value_t * fault_value, + const axutil_env_t * env); + + /** + * set the text value of soap_fault_value element + * @param fault_value pointer to soap fault value struct + * @param env environment MUST not be NULL + * @param text Text value to be set + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_value_set_text( + axiom_soap_fault_value_t * fault_value, + const axutil_env_t * env, + axis2_char_t * text); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_SOAP_FAULT_VALUE_H */ diff --git a/axiom/include/axiom_soap_header.h b/axiom/include/axiom_soap_header.h new file mode 100644 index 0000000..f0ed2f5 --- /dev/null +++ b/axiom/include/axiom_soap_header.h @@ -0,0 +1,205 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_HEADER_H +#define AXIOM_SOAP_HEADER_H + +/** + * @file axiom_soap_header.h + * @brief axiom_soap_header struct + */ +#include <axutil_env.h> +#include <axiom_node.h> +#include <axiom_element.h> +#include <axutil_array_list.h> +#include <axiom_children_qname_iterator.h> +#include <axiom_children_with_specific_attribute_iterator.h> +#include <axutil_hash.h> +#include <axiom_soap_envelope.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_header axiom_soap_header_t; + + struct axiom_soap_header_block; + struct axiom_soap_builder; + + /** + * @defgroup axiom_soap_header soap header + * @ingroup axiom_soap + * @{ + */ + + AXIS2_EXTERN axiom_soap_header_t *AXIS2_CALL + axiom_soap_header_create_with_parent( + const axutil_env_t * env, + struct axiom_soap_envelope *envelope); + + /** + * Free an axiom_soap_header + * @param header pointer to soap_header struct + * @param env Environment. MUST NOT be NULL + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_header_free( + axiom_soap_header_t * header, + const axutil_env_t * env); + + /** + * create a new axiom_soap_header_block_t struct initialized with the + * specified name and adds it to passed axiom_soap_header_t struct. + * @param header pointer to soap_header struct + * @param env Environment. MUST NOT be NULL + * @param localName the localname of the SOAP header block + * @param ns the namespace of the SOAP header block + * @return The newly created axiom_soap_header_block_t struct + */ + AXIS2_EXTERN struct axiom_soap_header_block *AXIS2_CALL + + axiom_soap_header_add_header_block( + axiom_soap_header_t * header, + const axutil_env_t * env, + const axis2_char_t * localname, + axiom_namespace_t * ns); + + /** + * returns a hash_table of all the soap_header_block_t struct in this + * soap_header_t object that have the the specified actor. An + * actor is a global attribute that indicates the intermediate parties to + * whom the message should be sent. An actor receives the message and then + * sends it to the next actor. The default actor is the ultimate intended + * recipient for the message, so if no actor attribute is set in a + * axiom_soap_header_t struct the message is sent to its ultimate + * destination. + * @param header pointer to soap_header struct + * @param env Environment. MUST NOT be NULL + * @param role the role value for the examination + * + * @return hash_table of all the soap_header_block_t struct + */ + AXIS2_EXTERN axutil_hash_t *AXIS2_CALL + axiom_soap_header_examine_header_blocks( + axiom_soap_header_t * header, + const axutil_env_t * env, + axis2_char_t * param_role); + + /** + * returns an arraylist of header_blocks which has a given namesapce uri + * @param header pointer to soap_header struct + * @param env Environment. MUST NOT be NULL + * @param ns_uri namespace uri + * @return pointer to axutil_array_list_t, or null if no header_blocks with + * given namespace uri exists + * The returned array_list must be freed by the user. + */ + AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL + axiom_soap_header_get_header_blocks_with_namespace_uri( + axiom_soap_header_t * header, + const axutil_env_t * env, + const axis2_char_t * ns_uri); + + /** + * returns an iterator to iterate through all soap header block's om nodes + * @param header pointer to soap_header struct + * @param env Environment. MUST NOT be NULL + * @returns axiom_children_qname_iterator_t or null if no header blocks + * present + */ + AXIS2_EXTERN axiom_children_qname_iterator_t *AXIS2_CALL + axiom_soap_header_examine_all_header_blocks( + axiom_soap_header_t * header, + const axutil_env_t * env); + + /** + * returns an iterator to iterate through all header blocks om_nodes + * with the matching role attribute + * @param header pointer to soap_header struct + * @param env Environment. MUST NOT be NULL + * @param role + * @returns iterator or null if no header blocks present with matching + * role attribute + */ + AXIS2_EXTERN axiom_children_with_specific_attribute_iterator_t + *AXIS2_CALL + axiom_soap_header_extract_header_blocks( + axiom_soap_header_t * header, + const axutil_env_t * env, + axis2_char_t * role); + + /** + * returns the axiom_node_t struct wrapped in soap_header + * @param header pointer to soap_header struct + * @param env Environment. MUST NOT be NULL + * + * @return the base node of the SOAP header + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_header_get_base_node( + axiom_soap_header_t * header, + const axutil_env_t * env); + + /** + * return the soap_version of this soap_header + * @param header pointer to soap_header struct + * @param env Environment. MUST NOT be NULL + * + * @return AXIOM_SOAP11 or AXIOM_SOAP12 + */ + AXIS2_EXTERN int AXIS2_CALL + axiom_soap_header_get_soap_version( + axiom_soap_header_t * header, + const axutil_env_t * env); + + /** + * Get all the SOAP headers + * @param header pointer to soap_header struct + * @param env Environment. MUST NOT be NULL + * + * @returns a hash table of all header_blocks in this header + * the returned hash is a readonly hash should not be modified + */ + AXIS2_EXTERN axutil_hash_t *AXIS2_CALL + axiom_soap_header_get_all_header_blocks( + axiom_soap_header_t * header, + const axutil_env_t * env); + + /** + * remove header block that matches to the given qname + * qname should not be null + * @param header pointer to soap_header struct + * @param env Environment. MUST NOT be NULL + * + * @return status of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_header_remove_header_block( + axiom_soap_header_t * header, + const axutil_env_t * env, + axutil_qname_t * qname); + + /** @} */ +#ifdef __cplusplus +} +#endif +#endif /* AXIOM_SOAP_HEADER_H */ diff --git a/axiom/include/axiom_soap_header_block.h b/axiom/include/axiom_soap_header_block.h new file mode 100644 index 0000000..30ba4b0 --- /dev/null +++ b/axiom/include/axiom_soap_header_block.h @@ -0,0 +1,228 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP_HEADER_BLOCK_H +#define AXIOM_SOAP_HEADER_BLOCK_H + +/** + * @file axiom_soap_header_block.h + * @brief axiom_soap_header_block struct + */ +#include <axutil_env.h> +#include <axiom_node.h> +#include <axiom_element.h> +#include <axutil_array_list.h> +#include <axiom_soap_header.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap_header_block axiom_soap_header_block_t; + + /** + * @defgroup axiom_soap_header_block soap header block + * @ingroup axiom_soap + * @{ + */ + + /** + * creates a soap struct + * @param env Environment. MUST NOT be NULL + * this is an internal function. + * + * @return the created SOAP header block + */ + AXIS2_EXTERN axiom_soap_header_block_t *AXIS2_CALL + axiom_soap_header_block_create_with_parent( + const axutil_env_t * env, + const axis2_char_t * localname, + axiom_namespace_t * ns, + struct axiom_soap_header *parent); + + /** + * Free an axiom_soap_header_block + * @param header_block pointer to soap_header_block struct + * @param env Environment. MUST NOT be NULL + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_soap_header_block_free( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env); + + /** + * Set the SOAP role + * @param header_block pointer to soap_header_block struct + * @param env Environment. MUST NOT be NULL + * @param uri the role URI + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_header_block_set_role( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + axis2_char_t * uri); + + /** + * Set the mustunderstand attribute of the SOAP header + * If must_understand=TRUE its set to 1, otherwise set to 0 + * @param header_block pointer to soap_header_block struct + * @param env Environment. MUST NOT be NULL + * @param must_understand SOAP mustunderstand attribute value + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_header_block_set_must_understand_with_bool( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + axis2_bool_t must_understand); + + /** + * Set the SOAP mustunderstand attribute + * @param header_block pointer to soap_header_block struct + * @param env Environment. MUST NOT be NULL + * @param must_understand SOAP mustunderstand attribute + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_header_block_set_must_understand_with_string( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + axis2_char_t * must_understand); + + /** + * To check the SOAP mustunderstand attribute + * If must_understand=TRUE its set to 1, otherwise set to 0 + * @param header_block pointer to soap_header_block struct + * @param env Environment. MUST NOT be NULL + * + * @return AXIS2_TRUE if mustunderstand is set true. AXIS2_FALSE otherwise + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_soap_header_block_get_must_understand( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env); + + /** + * To chk if the SOAP header is processed or not + * @param header_block pointer to soap_header_block struct + * @param env Environment. MUST NOT be NULL + * + * @return AXIS2_TRUE if checked AXIS2_FALSE otherwise + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_soap_header_block_is_processed( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env); + + /** + * Set the SOAP header as processed + * @param header_block pointer to soap_header_block struct + * @param env Environment. MUST NOT be NULL + * + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_header_block_set_processed( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env); + + /** + * Get the SOAP role of the header block + * @param header_block pointer to soap_header_block struct + * @param env Environment. MUST NOT be NULL + * + * @return the SOAP role of the header block + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_soap_header_block_get_role( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env); + + /** + * Set the attribute of the header block + * @param header_block pointer to soap_header_block struct + * @param env Environment. MUST NOT be NULL + * @param attr_name the attribute name + * @param attr_value the attribute value + * @param soap_envelope_namespace_uri the namsepace URI value + * + * @return satus of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_header_block_set_attribute( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + const axis2_char_t * attr_name, + const axis2_char_t * attr_value, + const axis2_char_t * soap_envelope_namespace_uri); + + /** + * Get the attribute of the header block + * @param header_block pointer to soap_header_block struct + * @param env Environment. MUST NOT be NULL + * @param attr_name the attribute name + * @param the namespace URI of the SOAP envelope + * + * @return the attribute of the header block + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_soap_header_block_get_attribute( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + const axis2_char_t * attr_name, + const axis2_char_t * soap_envelope_namespace_uri); + + /** + * Get the base node of the header block + * @param header_block pointer to soap_header_block struct + * @param env Environment. MUST NOT be NULL + * + * @return the base node of the of the header block + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_soap_header_block_get_base_node( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env); + + /** + * Get the SOAP version of the header block + * @param header_block pointer to soap_header_block struct + * @param env Environment. MUST NOT be NULL + * + * @return the SOAP version of the header block + */ + AXIS2_EXTERN int AXIS2_CALL + axiom_soap_header_block_get_soap_version( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif +#endif /* AXIOM_SOAP_HEADER_BLOCK_H */ diff --git a/axiom/include/axiom_stax_builder.h b/axiom/include/axiom_stax_builder.h new file mode 100644 index 0000000..fb4a1ec --- /dev/null +++ b/axiom/include/axiom_stax_builder.h @@ -0,0 +1,154 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_STAX_BUILDER_H +#define AXIOM_STAX_BUILDER_H + +#include <axiom_node.h> +#include <axiom_xml_reader.h> +#include <axiom_document.h> +#include <axutil_env.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_stax_builder stax builder + * @ingroup axiom_om + * @{ + */ + + typedef struct axiom_stax_builder axiom_stax_builder_t; + + /** + * Creates an stax builder + * @param environment Environment. MUST NOT be NULL. + * @param parser parser to be used with builder. The builder + * will take ownership of the parser. + * @return a pointer to the newly created builder struct. + */ + AXIS2_EXTERN axiom_stax_builder_t *AXIS2_CALL + axiom_stax_builder_create( + const axutil_env_t * env, + axiom_xml_reader_t * parser); + + /** + * Builds the next node from stream. Moves pull parser forward and reacts + * to events. + * @param builder pointer to stax builder struct to be used + * @param environment Environment. MUST NOT be NULL. + * @return a pointer to the next node, or NULL if there are no more nodes. + * On erros sets the error and returns NULL. + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_stax_builder_next( + struct axiom_stax_builder *builder, + const axutil_env_t * env); + + /** + * Discards the element that is being built currently. + * @param environment Environment. MUST NOT be NULL, . + * @param builder pointer to stax builder struct to be used + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_stax_builder_discard_current_element( + struct axiom_stax_builder *builder, + const axutil_env_t * env); + + /** + * Free the build struct instance and its associated document,axiom tree. + * @param builder pointer to builder struct + * @param env environment, MUST NOT be NULL + * @return status of the op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_stax_builder_free( + struct axiom_stax_builder *builder, + const axutil_env_t * env); + + /** + * Free the build struct instance and its associated document. + does not free the associated axiom tree. + * @param builder pointer to builder struct + * @param env environment, MUST NOT be NULL + * @return status of the op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_stax_builder_free_self( + struct axiom_stax_builder *builder, + const axutil_env_t * env); + + /** Gets the document associated with the builder + * @param builder axiom_stax_builder + * @param env environment + * @return pointer to document struct associated with builder + * NULL if there is no document associated with the builder, + * NULL if an error occured. + */ + AXIS2_EXTERN axiom_document_t *AXIS2_CALL + axiom_stax_builder_get_document( + struct axiom_stax_builder *builder, + const axutil_env_t * env); + + /** + * builder is finished building om structure + * @param builder pointer to stax builder struct to be used + * @param environment Environment. MUST NOT be NULL. + * + * @return AXIS2_TRUE if is complete or AXIS2_FALSE otherwise + */ + + AXIS2_EXTERN axis2_bool_t AXIS2_CALL + axiom_stax_builder_is_complete( + struct axiom_stax_builder *builder, + const axutil_env_t * env); + + /** + * moves the reader to next event and returns the token returned by the xml_reader , + * @param builder pointer to STAX builder struct to be used + * @param environment Environment. MUST NOT be NULL. + * @return next event axiom_xml_reader_event_types. Returns -1 on error + */ + AXIS2_EXTERN int AXIS2_CALL + axiom_stax_builder_next_with_token( + struct axiom_stax_builder *builder, + const axutil_env_t * env); + + AXIS2_EXTERN axiom_xml_reader_t *AXIS2_CALL + axiom_stax_builder_get_parser( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env); + + AXIS2_EXTERN void AXIS2_CALL + axiom_stax_builder_set_cache( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env, + axis2_bool_t enable_cache); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_STAX_BUILDER_H */ diff --git a/axiom/include/axiom_text.h b/axiom/include/axiom_text.h new file mode 100644 index 0000000..3768d90 --- /dev/null +++ b/axiom/include/axiom_text.h @@ -0,0 +1,265 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_TEXT_H +#define AXIOM_TEXT_H + +#include <axutil_env.h> +#include <axiom_node.h> +#include <axiom_output.h> +#include <axiom_data_handler.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_text text + * @ingroup axiom_om + * @{ + */ + + typedef struct axiom_text axiom_text_t; + + /** + * Creates a new text struct + * @param env Environment. + * @param parent parent of the new node. Optinal, can be NULL. + * The parent element must be of type AXIOM_ELEMENT + * @param value Text value. Optinal, can be NULL. + * @param comment_node This is an out parameter. cannot be NULL. + * Returns the node corresponding to the text struct created. + * Node type will be set to AXIOM_TEXT + * @return pointer to newly created text struct + */ + AXIS2_EXTERN axiom_text_t *AXIS2_CALL + axiom_text_create( + const axutil_env_t * env, + axiom_node_t * parent, + const axis2_char_t * value, + axiom_node_t ** node); + + /** + * Creates a new text struct + * @param env Environment. + * @param parent parent of the new node. Optinal, can be NULL. + * The parent element must be of type AXIOM_ELEMENT + * @param value Text value string. Optinal, can be NULL. + * @param comment_node This is an out parameter. cannot be NULL. + * Returns the node corresponding to the text struct created. + * Node type will be set to AXIOM_TEXT + * @return pointer to newly created text struct + */ + AXIS2_EXTERN axiom_text_t *AXIS2_CALL + axiom_text_create_str( + const axutil_env_t * env, + axiom_node_t * parent, + axutil_string_t * value, + axiom_node_t ** node); + + /** + * Creates a new text struct for binary data (MTOM) + * @param env Environment. + * @param parent parent of the new node. Optinal, can be NULL. + * The parent element must be of type AXIOM_ELEMENT + * @param data_handler data handler. Optinal, can be NULL. + * @param comment_node This is an out parameter. cannot be NULL. + * Returns the node corresponding to the text struct created. + * Node type will be set to AXIOM_TEXT + * @return pointer to newly created text struct + */ + AXIS2_EXTERN axiom_text_t *AXIS2_CALL + axiom_text_create_with_data_handler( + const axutil_env_t * env, + axiom_node_t * parent, + axiom_data_handler_t * data_handler, + axiom_node_t ** node); + + /** + * Free an axiom_text struct + * @param env environment. + * @param om_text pointer to om text struct to be freed. + * @return satus of the op. AXIS2_SUCCESS on success + * AXIS2_FAILURE on error. + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_text_free( + struct axiom_text *om_text, + const axutil_env_t * env); + + /** + * Serialize op + * @param env environment. + * @param om_text pointer to om text struct to be serialized. + * @param om_output AXIOM output handler to be used in serializing. + * @return satus of the op. AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_text_serialize( + struct axiom_text *om_text, + const axutil_env_t * env, + axiom_output_t * om_output); + + /** + * Sets the text value + * @param om_text om_text struct + * @param env environment. + * @param value text + * @return status of the op. AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_text_set_value( + struct axiom_text *om_text, + const axutil_env_t * env, + const axis2_char_t * value); + + /** + * Gets text value + * @param om_text om_text struct + * @param env environment. + * @return text value , NULL is returned if there is no text value. + */ + AXIS2_EXTERN const axis2_char_t *AXIS2_CALL + axiom_text_get_value( + struct axiom_text *om_text, + const axutil_env_t * env); + + /** + * Sets the text value + * @param om_text om_text struct + * @param env environment. + * @param value string + * @return status of the op. AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_text_set_value_str( + struct axiom_text *om_text, + const axutil_env_t * env, + axutil_string_t * value); + + /** + * Gets text value from the text node even when MTOM optimized + * @param om_text om_text struct + * @param env environment. + * @return text value base64 encoded text when MTOM optimized, + * NULL is returned if there is no text value. + */ + AXIS2_EXTERN const axis2_char_t *AXIS2_CALL + axiom_text_get_text( + axiom_text_t * om_text, + const axutil_env_t * env); + + /** + * Gets text value + * @param om_text om_text struct + * @param env environment. + * @return text valu stringe , NULL is returned if there is no text value. + */ + AXIS2_EXTERN axutil_string_t *AXIS2_CALL + axiom_text_get_value_str( + struct axiom_text *om_text, + const axutil_env_t * env); + + /** + * Sets optimized + * @param om_text pointer to om_text struct + * @param env environment + * @optimize optimize value + * @returns AXIS2_SUCCESS + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_text_set_optimize( + struct axiom_text *om_text, + const axutil_env_t * env, + axis2_bool_t optimize); + + /** + * @param om_text text value + * @param env environment + * @param is_binary + * @returns AXIS2_SUCCESS + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_text_set_is_binary( + struct axiom_text *om_text, + const axutil_env_t * env, + const axis2_bool_t is_binary); + + /** + * Get the data handler of the OM text + * @param om_text pointer to the OM Text struct + * @param environment Environment. MUST NOT be NULL + * + * @return the data handler of the OM text + */ + AXIS2_EXTERN axiom_data_handler_t *AXIS2_CALL + axiom_text_get_data_handler( + struct axiom_text *om_text, + const axutil_env_t * env); + + /** + * Get the Content ID of the OM text + * @param om_text pointer to the OM Text struct + * @param environment Environment. MUST NOT be NULL + * + * @return the content id of the OM text + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_text_get_content_id( + struct axiom_text *om_text, + const axutil_env_t * env); + + /** + * Set the content ID of the OM text + * @param om_text pointer to the OM Text struct + * @param environment Environment. MUST NOT be NULL + * @param content_id the content ID + * @return status of the op. AXIS2_SUCCESS on success + * else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_text_set_content_id( + axiom_text_t * om_text, + const axutil_env_t * env, + const axis2_char_t * content_id); + + /** + * Sets the boolean value indicating if the binary data associated with the text + * node should be sent in SOAP with Attachment (SwA) format or not. + * @param om_text text node + * @param env environment + * @param is_swa bool value, AXIS2_TRUE means use SwA format, else AXIS2_FALSE + * @returns AXIS2_SUCCESS + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_text_set_is_swa( + struct axiom_text *om_text, + const axutil_env_t * env, + const axis2_bool_t is_swa); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_TEXT_H */ diff --git a/axiom/include/axiom_util.h b/axiom/include/axiom_util.h new file mode 100644 index 0000000..9c87877 --- /dev/null +++ b/axiom/include/axiom_util.h @@ -0,0 +1,396 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_UTIL_H +#define AXIOM_UTIL_H + +#include <axutil_array_list.h> +#include <axutil_string.h> +#include <axiom.h> +#include <axutil_uri.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + /** + * After calling this method the variable child points to + * the node of the returning element + * @param ele_node axiom node + * @param env environment, MUST not be NULL + * @param uri uri + * return the first child element which has the given uri + */ + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_first_child_element_with_uri( + axiom_node_t * ele_node, + const axutil_env_t * env, + axis2_char_t * uri, + axiom_node_t ** child); + /** + * After calling this method next_node will point to the + * previous sibling node to the returning node + * @param ele_node axiom node + * @param env environment, MUST not be NULL + * @param uri uri + * @param next_node + * return the next sibling element to the element which contains + * the give namespace uri + */ + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_next_sibling_element_with_uri( + axiom_node_t * ele_node, + const axutil_env_t * env, + axis2_char_t * uri, + axiom_node_t ** next_node); + /** + * @param eleaxiom node + * @param env environment, MUST not be NULL + * @param ele_node + * @param child_node + * return the first child element this calls the method + * axiom_element_get_first_child_element + * + */ + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_first_child_element( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axiom_node_t ** child_node); + /** + * @param ele axiom element + * @param env environment, MUST not be NULL + * @param ele_node + * @param child_node + * return the last child element of the given element ele_node + */ + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_last_child_element( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axiom_node_t ** child_node); + /** + * @param ele axiom node + * @param env environment, MUST not be NULL + * @param ele_node + * @param next_node + * return the first child element which has the given uri + */ + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_next_sibling_element( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axiom_node_t ** next_node); + /** + * @param ele axiom element + * @param env environment, MUST not be NULL + * @param ele_node axiom node + * @param localname localname to find the first child element + * @param child_node + * + * return the first child element from ele_node which contains the + * given local name + */ + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_first_child_element_with_localname( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axiom_node_t ** child_node); + /** + * @param ele + * @param env environment, MUST not be NULL + * @param ele_node axiom node + * @param localname to find the last child element + * @param child_node + * return the last child element which having the given local name + */ + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_last_child_element_with_localname( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axiom_node_t ** child_node); + /** + * @param ele + * @param env environment, MUST not be NULL + * @param ele_node axiom node + * @param localname to find the last child element + * @param next_node + * return the next sibling element which is having the given local name + */ + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_next_siblng_element_with_localname( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axiom_node_t ** next_node); + /** + * @param ele + * @param env environment, MUST not be NULL + * @param ele_node axiom node + * @param localname to find the last child element + * @param uri uri to of the namespace to find the first element + * @param next_node + * return the first child element which is having the given local + * name and the given namespace uri + */ + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_first_child_element_with_uri_localname( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axis2_char_t * uri, + axiom_node_t ** child_node); + /** + * @param ele + * @param env environment, MUST not be NULL + * @param ele_node axiom node + * @param localname to find the last child element + * @param uri uri of the namespace to find the last element + * @param next_node + * return the last child element which is having the given local name and + * the given namespace uri + */ + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_last_child_element_with_uri_localname( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axis2_char_t * uri, + axiom_node_t ** child_node); + /** + * @param ele + * @param env environment, MUST not be NULL + * @param ele_node axiom node + * @param localname to find the last child element + * @param uri uri of the namespace to find the last element + * @param next_node + * return next sibling element which is having the given local name and + * the given namespace uri + */ + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_next_sibling_element_with_uri_localname( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axis2_char_t * uri, + axiom_node_t ** next_node); + /** + * @param ele + * @param env environment, MUST not be NULL + * @param ele_node axiom node + * @param names local names to find the child element + * @param child_node + * return the first child element which is having all the localnames given + */ + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_first_child_element_with_localnames( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axutil_array_list_t * names, + axiom_node_t ** child_node); + /** + * @param ele + * @param env environment, MUST not be NULL + * @param ele_node axiom node + * @param names local names to find the last child element + * @param child_node + * return the last child element which is having all the localnames given + */ + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_last_child_element_with_localnames( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axutil_array_list_t * names, + axiom_node_t ** child_node); + /** + * @param ele + * @param env environment, MUST not be NULL + * @param ele_node axiom node + * @param names local names to find the next sibling + * @param child_node + * return the next sibling element which is having all the localnames given + */ + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_next_siblng_element_with_localnames( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axutil_array_list_t * names, + axiom_node_t ** next_node); + /** + * @param ele + * @param env environment, MUST not be NULL + * @param ele_node + * @param localname local name to find the first child + * @param attr_name attribute name to find first child + * @param attr_value attribute value of attr_name attribute + * @param child_node + * return the first child element which is having the given local + * name and the given attribute (attribute name and attribute value) + */ + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_first_child_element_with_localname_attr( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axis2_char_t * attr_name, + axis2_char_t * attr_value, + axiom_node_t ** child_node); + /** + * @param ele + * @param env environment, MUST not be NULL + * @param ele_node + * @param localname local name to find the last child + * @param attr_name attribute name to find last child + * @param attr_value attribute value of attr_name attribute + * @param child_node + * return the last child element which is having the given local + * name and the given attribute (attribute name and attribute value) + */ + + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_last_child_element_with_localname_attr( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axis2_char_t * attr_name, + axis2_char_t * attr_value, + axiom_node_t ** child_node); + /** + * @param ele + * @param env environment, MUST not be NULL + * @param ele_node + * @param localname local name to find the next sibling child + * @param attr_name attribute name to find the next sibling child + * @param attr_value attribute value of attr_name attribute + * @param child_node + * return the next sibling child element which is having the given local + * name and the given attribute (attribute name and attribute value) + */ + + AXIS2_EXTERN axiom_element_t *AXIS2_CALL + axiom_util_get_next_siblng_element_with_localname_attr( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axis2_char_t * attr_name, + axis2_char_t * attr_value, + axiom_node_t ** next_node); + /** + * @param node axiom node + * @param env environment, MUST not be NULL + * + * return the element text of axiom_node + */ + + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_util_get_child_text( + axiom_node_t * node, + const axutil_env_t * env); + /** + * @param node axiom node + * @param env environment, MUST not be NULL + * + * return the local name of axiom_node + */ + + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_util_get_localname( + axiom_node_t * node, + const axutil_env_t * env); + /** + * @param om_node axiom node + * @param env environment, MUST not be NULL + * + * return the namespace uri of the give node variable om_node if + * there's no namespace in that particular om_node this method + * returns NULL + */ + + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_util_get_node_namespace_uri( + axiom_node_t * om_node, + const axutil_env_t * env); + /** + * @param om_ele axiom node + * @param env environment, MUST not be NULL + * @param om_node + * return all the child element using the method + * axiom_child_element_iterator_create + */ + + AXIS2_EXTERN axiom_child_element_iterator_t *AXIS2_CALL + axiom_util_get_child_elements( + axiom_element_t * om_ele, + const axutil_env_t * env, + axiom_node_t * om_node); + + AXIS2_EXTERN axiom_document_t *AXIS2_CALL + axiom_util_new_document( + const axutil_env_t * env, + const axutil_uri_t * uri); + + AXIS2_EXTERN axiom_node_t* AXIS2_CALL + axiom_util_get_node_by_local_name( + const axutil_env_t *env, + axiom_node_t *node, + axis2_char_t *local_name); + + /** + * Creates a clone of given node + * @param env environment, MUST not be NULL + * @param node node to be cloned + * @return cloned node + */ + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_util_clone_node( + const axutil_env_t *env, + axiom_node_t *node); + +#ifdef __cplusplus + } +#endif +#endif /* AXIOM_UTIL_H */ diff --git a/axiom/include/axiom_xml_reader.h b/axiom/include/axiom_xml_reader.h new file mode 100644 index 0000000..c9450a8 --- /dev/null +++ b/axiom/include/axiom_xml_reader.h @@ -0,0 +1,706 @@ + +/* + * 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. + * + */ + +#ifndef AXIOM_XML_READER_H +#define AXIOM_XML_READER_H + +/** + *@file axiom_xml_reader.h + *@brief this is the parser abstraction layer for axis2 + */ + +#include <axutil_env.h> +#include <axutil_utils.h> +#include <axiom_defines.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_xml_reader_ops axiom_xml_reader_ops_t; + typedef struct axiom_xml_reader axiom_xml_reader_t; + + /** + * @defgroup axiom_parser parser + * @ingroup axiom + * @{ + * @} + */ + + /** + * @defgroup axiom_xml_reader XML reader + * @ingroup axiom_parser + * @{ + */ + + typedef enum axiom_xml_reader_event_types + { + AXIOM_XML_READER_START_DOCUMENT = 0, /* <?xml version="1.0" encoding="utf-8"?> */ + AXIOM_XML_READER_START_ELEMENT, /* <element> */ + AXIOM_XML_READER_END_ELEMENT, /* </element> */ + AXIOM_XML_READER_SPACE, /* <x> </x>*//*event is for value, not for x*/ + AXIOM_XML_READER_EMPTY_ELEMENT, /* <element/> */ + AXIOM_XML_READER_CHARACTER, /* <x>text</x>*//*event is for text, not for x*/ + AXIOM_XML_READER_ENTITY_REFERENCE, + AXIOM_XML_READER_COMMENT, /* <!--comment--> */ + AXIOM_XML_READER_PROCESSING_INSTRUCTION, + AXIOM_XML_READER_CDATA, + AXIOM_XML_READER_DOCUMENT_TYPE + } axiom_xml_reader_event_types; + + /** + * \brief AXIOM_XML_READER ops + * Encapsulator struct for ops of axiom_xml_reader + */ + + struct axiom_xml_reader_ops + { + + /** + * causes the reader to read the next parse event. + * returns the event just read + * @param parser axiom_xml_reader struct + * @param env axutil_environment, MUST NOT be NULL + * @returns one of the events defined in + * axiom_xml_reader_event_types + */ + + int( + AXIS2_CALL + * next)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * free pull_parser + * @param parser axiom_xml_reader struct + * @param env axutil_environment MUST NOT be NULL + * @returns axis2_status_code + */ + + void( + AXIS2_CALL + * free)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * Get the Number of attributes in the current element + * @param parser axiom_xml_reader + * @param env axutil_environment, MUST NOT be NULL. + * @returns Number of attributes , AXIS2_FAILURE on error + */ + + int( + AXIS2_CALL + * get_attribute_count)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** This is used to get an attribute's localname using an index relative to + * current element.The iterations are not zero based. + * To access the first attribute use 1 for parameter i + * @param parser parser struct + * @param env environment struct + * @param i attribute index + * @returns the attribute localname + * caller must free the value using axiom_xml_reader_xml_free macro + */ + axis2_char_t *( + AXIS2_CALL + * get_attribute_name_by_number)( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + + /** This is used to get an attribute's prefix using an index relative to + * current element. The iterations are not zero based. + * To access the first attribute use 1 for parameter i + * @param parser parser struct + * @param env environment, MUST NOT be NULL + * @param i attribute index. + * @returns the attribute prefix, returns NULL on error, + * caller must free the value using axiom_xml_reader_xml_free macro + */ + + axis2_char_t *( + AXIS2_CALL + * get_attribute_prefix_by_number)( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + + /** Gets an attribute's value using an index relative to + * current element. The iterations are not zero based. + * To access the first attribute use 1 for parameter i + * @param parser parser struct + * @param env environment, MUST NOT be NULL. + * @param i attribute index + * @returns the attribute value, returns NULL on error, + * caller must free the value using axiom_xml_reader_xml_free macro + */ + + axis2_char_t *( + AXIS2_CALL + * get_attribute_value_by_number)( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + + /** Gets an attribute's namespace uri using an index relative to + * current element. The iterations are not zero based. + * To access the first attribute use 1 for parameter i + * @param parser parser struct + * @param env environment struct + * @param i attribute index + * @returns the attribute value, returns NULL on error + * caller must free the value using axiom_xml_reader_xml_free macro + */ + + axis2_char_t *( + AXIS2_CALL + * get_attribute_namespace_by_number)( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + + /** Returns the text value of current element + * @param parser pointer to parser + * @param env environment, MUST not be NULL + * @returns Text Value, NULL on error + * caller must free the value using axiom_xml_reader_xml_free macro + */ + axis2_char_t *( + AXIS2_CALL + * get_value)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * Returns the namespace count of current element + * @param parser parser struct + * @param env environment + * @returns namespace count of current element, + */ + int( + AXIS2_CALL + * get_namespace_count)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * Accesses the namespace uri of the namespaces declared in current element + * using an index + * @param parser parser struct + * @param env environment + * @param i index + * @returns namespace uri of corresponding namespace + * caller must free the value using axiom_xml_reader_xml_free macro + */ + axis2_char_t *( + AXIS2_CALL + * get_namespace_uri_by_number)( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + + /** + * Accesses the namespace prefix of the namespaces declared in current element + * using an index + * @param parser parser struct + * @param env environment + * @param i index + * @returns namespace prefix of corresponding namespace + * caller must free the value using axiom_xml_reader_xml_free macro + */ + axis2_char_t *( + AXIS2_CALL + * get_namespace_prefix_by_number)( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + + /** + * Used to obtain the current element prefix + * @param parser parser struct + * @param env environment struct + * @returns prefix , NULL on error + * caller must free the value using axiom_xml_reader_xml_free macro + */ + axis2_char_t *( + AXIS2_CALL + * get_prefix)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * Used to obtain the current element localname + * @param parser parser struct + * @param env environment struct + * @returns localname , NULL on error + * caller must free the value using axiom_xml_reader_xml_free macro + */ + axis2_char_t *( + AXIS2_CALL + * get_name)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * Used to get the processingInstruction target + * @param parser parser struct + * @param env environment, MUST NOT be NULL. + * @returns target value of processingInstruction + * caller must free the value using axiom_xml_reader_xml_free macro + */ + axis2_char_t *( + AXIS2_CALL + * get_pi_target)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * Gets the processingInstruction data + * @param parser parser struct + * @param env environment, MUST NOT be NULL. + * @returns data of processingInstruction + * caller must free the value using axiom_xml_reader_xml_free macro + */ + axis2_char_t *( + AXIS2_CALL + * get_pi_data)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * Used to get the DTD + * @param parser pointer to pull parser struct + * @param env environment, MUST NOT be NULL. + * @return text of doctype declaration. NULL is returns of no data + * exists. + */ + axis2_char_t *( + AXIS2_CALL + * get_dtd)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * Free function , this function wraps the underlying parser's + * xml free function. For freeing values obatined by calling + * pull parser api methods, This function must be used. + * @param parser pointer to axiom_xml_reader + * @param env environment, MUST NOT be NULL. + * @param data data values to be destroyed + * @return status of the op, AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + void( + AXIS2_CALL + * xml_free)( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + void *data); + + /** + * Gets the char set encoding of the parser + * @param parser xml parser + * @param env environment + * @returns char set encoding string or NULL in failure + */ + + axis2_char_t *( + AXIS2_CALL + * get_char_set_encoding)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** Returns the namespace uri associated with current node */ + axis2_char_t *( + AXIS2_CALL + * get_namespace_uri)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + axis2_char_t *( + AXIS2_CALL + * get_namespace_uri_by_prefix)( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + axis2_char_t * prefix); + + void *( + AXIS2_CALL + * get_context)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + axis2_char_t *( + AXIS2_CALL + * get_current_buffer)( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + }; + + /** + * @brief axiom_xml_reader struct + * Axis2 OM pull_parser + */ + struct axiom_xml_reader + { + const axiom_xml_reader_ops_t *ops; + }; + + /** + * Creates an instance of axiom_xml_reader to parse + * a file using an xml document in a file system + * @param env environment struct, must not be null + * @param filename url of an xml document + * @returns a pointer to xml_pull_parser_t struct + * NULL on error with error code set in the environment's error + */ + AXIS2_EXTERN axiom_xml_reader_t *AXIS2_CALL + axiom_xml_reader_create_for_file( + const axutil_env_t * env, + char *filename, + const axis2_char_t * encoding); + + /** + * This create an instance of axiom_xml_reader to + * parse a xml document in a buffer. It takes a callback + * function that takes a buffer and the size of the buffer + * The user must implement a function that takes in buffer + * and size and fill the buffer with specified size + * with xml stream, parser will call this function to fill the + * buffer on the fly while parsing. + * @param env environment MUST NOT be NULL. + * @param read_input_callback() callback function that fills + * a char buffer. + * @param close_input_callback() callback function that closes + * the input stream. + * @param ctx, context can be any data that needs to be passed + * to the callback method. + * @param encoding encoding scheme of the xml stream + */ + AXIS2_EXTERN axiom_xml_reader_t *AXIS2_CALL + axiom_xml_reader_create_for_io( + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK, + AXIS2_CLOSE_INPUT_CALLBACK, + void *ctx, + const axis2_char_t * encoding); + + /** + * Create an axiom_xml_reader_t using a buffer, which is the xml input + * @param env environment, MUST not be NULL + * @param container any data that needs to passed to the corresponding + * parser's create_for_memory method. The reader does not take ownership + * of this data. + * @param size size of the buffer + * @param encoding encoding of the xml + * @return pointer to axiom_xml_reader_t struct on success , NULL otherwise + */ + AXIS2_EXTERN axiom_xml_reader_t *AXIS2_CALL + axiom_xml_reader_create_for_memory( + const axutil_env_t * env, + void *container, + int size, + const axis2_char_t * encoding, + int type); + + /** + * init function initializes the parser. When using libxml2 parser, this function + * is needed to initialize libxml2. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_reader_init(void + ); + + /** + * parser cleanup function. This function is used to clean up the globals of libxml2 + * parser. + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_reader_cleanup(void + ); + + /** + * while parsing through this method is calling for each and every + * time it parse a charactor.This is the atomic method which parse charactors. + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return + */ + AXIS2_EXTERN int AXIS2_CALL + axiom_xml_reader_next( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_xml_reader_free( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * free method for xml reader + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return + */ + AXIS2_EXTERN int AXIS2_CALL + axiom_xml_reader_get_attribute_count( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return number of attributes in an element + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_attribute_name_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return the attribute name by number + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_attribute_prefix_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return the attribute prefix by number + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_attribute_value_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return attribute value by number + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_attribute_namespace_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return attribute namespace by number + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_value( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return value of the element + */ + AXIS2_EXTERN int AXIS2_CALL + axiom_xml_reader_get_namespace_count( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return the number of namespaces in an element + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_namespace_uri_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return uri or the namespace by number + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_namespace_prefix_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return prefix of the namespace by number + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_prefix( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return namespace prefix + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_name( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return name of the element + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_pi_target( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_pi_data( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_dtd( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_xml_reader_xml_free( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + void *data); + + /** + * free method for xml + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_char_set_encoding( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return charactor encoding + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_namespace_uri( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** + * + * @param parser pointer to the OM XML Reader struct + * @param env environment struct, must not be null + * + * @return + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_namespace_uri_by_prefix( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + axis2_char_t * prefix); + + AXIS2_EXTERN void *AXIS2_CALL + axiom_xml_reader_get_context( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_reader_get_current_buffer( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_XML_READER_H */ + + + + + + + + + + + + + + diff --git a/axiom/include/axiom_xml_writer.h b/axiom/include/axiom_xml_writer.h new file mode 100644 index 0000000..cddfc73 --- /dev/null +++ b/axiom/include/axiom_xml_writer.h @@ -0,0 +1,1014 @@ + +/* + * 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. + * + */ + +#ifndef AXIOM_XML_WRITER_H +#define AXIOM_XML_WRITER_H + +/** + *@file axiom_xml_writer.h + *@brief this is the parser abstraction layer for axis2 + */ + +#include <axutil_env.h> +#include <axiom_defines.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_xml_writer_ops axiom_xml_writer_ops_t; + typedef struct axiom_xml_writer axiom_xml_writer_t; + + /** + * @defgroup axiom_xml_writer XML writer + * @ingroup axiom_parser + * @{ + */ + + /** + * \brief axiom_xml_writer ops + * Encapsulator struct for ops of axiom_xml_writer + */ + + struct axiom_xml_writer_ops + { + + /** + * Free xml writer + * @param writer pointer to xml_writer struct to be freed + * @param env environment, MUST NOT be NULL. + * @returns status of the op. + * AXIS2_SUCCESS on success and AXIS2_FAILURE on error + */ + + void( + AXIS2_CALL + * free)( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** + * Write a start tag to output stream with localname. + * Internally the writer keeps track of the opened tags + * @param writer pointer to xml writer struct + * @param env environment. MUST NOT be NULL. + * @param localname localname of the tag, May not be NULL. + * @return the status of the op, AXIS2_SUCCESS on success + AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_start_element)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname); + + /** + * write an end tag to the output relying on the internal + * state of writer to determine the prefix and localname of + * the element + * @param writer xml_writer struct + * @param env environment, MUST NOT be NULL. + * @return status of the op. AXIS2_SUCCESS on success. + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * end_start_element)( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** + * Write an element tag with localname and namespace uri + * @param writer pointer to xml writer struct + * @param env environment struct + * @param localname localname of the tag, May not be null. + * @param namespace_uri the namespace URI of the the pefix + * to use.may not be null. + * @returns status of the op, AXIS2_SUCCESS on success. + * AXIS2_FAILURE on error + */ + axis2_status_t( + AXIS2_CALL + * write_start_element_with_namespace)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri); + + /** + * write a start tag to output + * @param writer pointer to xml_writer struct + * @param environment, MUST NOT be NULL. + * @param localname localname of the tag, May not be null. + * @param namespace_uri namespace to bind the prefix to + * @param prefix the prefix to the tag.May not be NULL. + * @return status of the op + AXIS2_SUCCESS on success. AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_start_element_with_namespace_prefix)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix); + + /** + * write an element tag with localname + * @param writer xml_writer + * @param env environment + * @param localname localname + * @return status of the op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_empty_element)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname); + + /** + * write empty_element with localname and namespace uri. + * @param writer xml writer + * @param env environment + * @param localname localname + * @param namespace uri + * @return status of the op, AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + + axis2_status_t( + AXIS2_CALL + * write_empty_element_with_namespace)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri); + + /** + * write empty element with namespace uri and prefix + * @param writer xml_writer + * @param env environment + * @param localname localname + * @param namespace_uri namespace uri + * @param prefix prefix + * @return status of the op, AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_empty_element_with_namespace_prefix)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix); + + /** + * write end tag with correct localname prefix resolved internally + * @param writer xml writer + * @param env environment + * @return status of the op, AXIS2_SUCCESS on success, + * AXIS2_FAILURE on failure + */ + axis2_status_t( + AXIS2_CALL + * write_end_element)( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** + * write end document + * @param writer xml writer + * @param env environment + * @return status of the op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_end_document)( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** + * write attribute with localname and value + * @param writer writer + * @param env environment + * @param localname localname + * @param value text value of attribute + * @return status of the op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_attribute)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value); + + /** + * @param writer + * @param env environment + * @param localname + * @param value text value of attribute + * @param namespace uri namespace uri + * @return status code of the op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_attribute_with_namespace)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri); + + /** + * @param writer xml_writer + * @param env environment + * @param localname localname + * @param value text value of attribute + * @param namespace uri namespaceuri + * @param prefix prefix + */ + axis2_status_t( + AXIS2_CALL + * write_attribute_with_namespace_prefix)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri, + axis2_char_t * prefix); + + /** + * @param writer xml_writer + * @param env environment + * @param prefix prefix + * @param namespace uri namespaceuri + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + + axis2_status_t( + AXIS2_CALL + * write_namespace)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * namespace_uri); + + /** + * @param writer xml_writer + * @param env environment + * @param namespace uri namespaceuri + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + + axis2_status_t( + AXIS2_CALL + * write_default_namespace)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * namespace_uri); + + /** + * @param writer xml_writer + * @param env environment + * @param value value + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + + axis2_status_t( + AXIS2_CALL + * write_comment)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * value); + + /** + * @param writer xml_writer + * @param env environment + * @param target pi target + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + + axis2_status_t( + AXIS2_CALL + * write_processing_instruction)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target); + + /** + * @param writer xml_writer + * @param env environment + * @param target pi target + * @param data pi data + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + + axis2_status_t( + AXIS2_CALL + * write_processing_instruction_data)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target, + axis2_char_t * data); + + /** + * @param writer xml_writer + * @param env environment + * @param data cdata + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_cdata)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * data); + + /** + * @param writer xml_writer + * @param env environment + * @param dtd dtd + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_dtd)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * dtd); + + /** + * @param writer xml_writer + * @param env environment + * @param name name + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_entity_ref)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * name); + + /** + * @param writer xml_writer + * @param env environment + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_start_document)( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** + * @param writer xml_writer + * @param env environment + * @param version version + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_start_document_with_version)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * version); + + /** + * @param writer xml_writer + * @param env environment + * @param version version + * @param encoding encoding + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_start_document_with_version_encoding)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * version, + axis2_char_t * encoding); + + /** + * @param writer xml_writer + * @param env environment + * @param text text + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_characters)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text); + + /** + * @param writer xml_writer + * @param env environment + * @param uri uri + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_char_t *( + AXIS2_CALL + * get_prefix)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri); + + /** + * @param writer xml_writer + * @param env environment + * @param prefix prefix + * @param uri uri + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * set_prefix)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * uri); + + /** + * @param writer xml_writer + * @param env environment + * @param uri uri + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * set_default_prefix)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri); + + /** + * @param writer xml_writer + * @param env environment + * @param text text + * @param in_attr + * @return status of op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error. + */ + axis2_status_t( + AXIS2_CALL + * write_encoded)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text, + int in_attr); + + void *( + AXIS2_CALL + * get_xml)( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + unsigned int( + AXIS2_CALL + * get_xml_size)( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + int( + AXIS2_CALL + * get_type)( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + axis2_status_t( + AXIS2_CALL + * write_raw)( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * content); + axis2_status_t( + AXIS2_CALL + * flush)( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + }; + + /** + * @brief axis2_pull_parser struct + * Axis2 OM pull_parser + */ + + struct axiom_xml_writer + { + const axiom_xml_writer_ops_t *ops; + }; + + /** + * create function for axiom_xml_writer + * @param env environment + * @param filename filename + * @param encoding encoding + * @param is_prefix_default + * @param compression + * return xml writer wrapper structure + */ + AXIS2_EXTERN axiom_xml_writer_t *AXIS2_CALL + axiom_xml_writer_create( + const axutil_env_t * env, + axis2_char_t * filename, + axis2_char_t * encoding, + int is_prefix_default, + int compression); + + /** + * create fuction for xml writer for memory buffer + * @param env environment struct, must not be null + * @param env environment + * @param encoding encoding + * @param is_prefix_default + * @param compression + * @return xml writer wrapper structure. + */ + AXIS2_EXTERN axiom_xml_writer_t *AXIS2_CALL + axiom_xml_writer_create_for_memory( + const axutil_env_t * env, + axis2_char_t * encoding, + int is_prefix_default, + int compression, + int type); + + /** + * free method for axiom xml writer + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_xml_writer_free( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * @param localname local name of the start element + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_start_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname); + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_end_start_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_start_element_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * @param localname localname of the start element + * @param namespace_uri namespace uri of that element + * @param prefix prefix of that namespace + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_start_element_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * @param localname local name of the element + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_empty_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * @param localname local name of the element + * @param namespace_uri uri of the namespace + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_empty_element_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * @param localname local name of the element + * @param namespace_uri uri of the namespace + * @param prefix prefix of the namespace + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_empty_element_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_end_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_end_document( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * @param localname local name of the element + * @param value value of the element + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_attribute( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * @param localname local name of the element + * @param value value of the element + * @param uri of the namespace + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_attribute_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * @param localname local name of the element + * @param value value of the element + * @param uri of the namespace + * @param prefix of the namespace + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_attribute_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri, + axis2_char_t * prefix); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * @param prefix prefix of the namespace + * @param uri of the namespace + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * namespace_uri); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_default_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * namespace_uri); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_comment( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * value); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_processing_instruction( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_processing_instruction_data( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target, + axis2_char_t * data); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_cdata( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * data); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_dtd( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * dtd); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_entity_ref( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * name); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_start_document( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_start_document_with_version( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * version); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_start_document_with_version_encoding( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * version, + axis2_char_t * encoding); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_characters( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return + */ + AXIS2_EXTERN axis2_char_t *AXIS2_CALL + axiom_xml_writer_get_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return prefix + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_set_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * uri); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_set_default_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri); + + /** + * sets the default prefix + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_encoded( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text, + int in_attr); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return + */ + AXIS2_EXTERN void *AXIS2_CALL + axiom_xml_writer_get_xml( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return + */ + AXIS2_EXTERN unsigned int AXIS2_CALL + axiom_xml_writer_get_xml_size( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return size of the xml + */ + AXIS2_EXTERN int AXIS2_CALL + axiom_xml_writer_get_type( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return type + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_write_raw( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * content); + + /** + * @param writer pointer to the OM XML Writer struct + * @param env environment struct, must not be null + * + * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_xml_writer_flush( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_XML_WRITER_H */ diff --git a/axiom/include/axiom_xpath.h b/axiom/include/axiom_xpath.h new file mode 100644 index 0000000..d2b0ee2 --- /dev/null +++ b/axiom/include/axiom_xpath.h @@ -0,0 +1,407 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_XPATH_H +#define AXIOM_XPATH_H + +#include <axiom.h> +#include <axutil_env.h> +#include <axutil_stack.h> +#include <axiom_soap.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_xpath_api api + * @ingroup axiom_xpath + * @{ + */ + + + /** + * Enable tracing + */ + +#define AXIOM_XPATH_DEBUG + + /** + * An error occured while evaluating the xpath expression + */ +#define AXIOM_XPATH_EVALUATION_ERROR 0 + +#define AXIOM_XPATH_ERROR_STREAMING_NOT_SUPPORTED 10 + + /* Typedefs */ + + /** + * XPath expression + * It includes the expression as a string and parsed data. + */ + typedef struct axiom_xpath_expression axiom_xpath_expression_t; + + /** + * The XPath context + * Keeps a reference to the context node or attribute, + * XPath expression, environment and result set. + */ + typedef struct axiom_xpath_context axiom_xpath_context_t; + + /** + * XPath result set + * Contains the result set and other information such as + * whether the expression was evaluated successfully. + */ + typedef struct axiom_xpath_result axiom_xpath_result_t; + + /** + * XPath result + * Stores type and value of the result. + */ + typedef struct axiom_xpath_result_node axiom_xpath_result_node_t; + + /** + * XPath result types + */ + typedef enum axiom_xpath_result_type_t + { + AXIOM_XPATH_TYPE_NODE = 0, + AXIOM_XPATH_TYPE_ATTRIBUTE, + AXIOM_XPATH_TYPE_NAMESPACE, + AXIOM_XPATH_TYPE_TEXT, + AXIOM_XPATH_TYPE_NUMBER, + AXIOM_XPATH_TYPE_BOOLEAN + } axiom_xpath_result_type_t; + + typedef int (*axiom_xpath_function_t)(axiom_xpath_context_t *context, + int np); + + /** + * XPath expression + */ + struct axiom_xpath_expression + { + /** XPath expression as a string */ + axis2_char_t* expr_str; + + /** Length of the expression */ + int expr_len; + + /** A cursor pointing to the position currently being parsed */ + int expr_ptr; + + /** Parsed expression in an array list*/ + axutil_array_list_t *operations; + + /** A pointer to the start operation in operations */ + int start; + }; + + /** + * XPath context + */ + struct axiom_xpath_context + { + /** Environment */ + const axutil_env_t *env; + + /** List of namespaces */ + axutil_hash_t *namespaces; + + /** Set of functions */ + axutil_hash_t *functions; + + /** Root node */ + axiom_node_t *root_node; + + /** Context node */ + axiom_node_t *node; + + /** Context attribute */ + axiom_attribute_t *attribute; + + /** Context attribute */ + axiom_namespace_t *ns; + + /** Context position */ + int position; + + /** Context size + * *Does not work location paths due to optimizations */ + int size; + + /** XPath expression */ + axiom_xpath_expression_t *expr; + + /** Streaming */ + axis2_bool_t streaming; + + /** Stack of processed items */ + axutil_stack_t *stack; + + /* TODO: + functions + variables + etc */ + }; + + /** + * XPath result set + */ + struct axiom_xpath_result + { + /** A flag indicating whether errors occured while evaluting XPath + * expression */ + int flag; + + /** An array list containing the set of results */ + axutil_array_list_t * nodes; + }; + + /** + * XPath result + */ + struct axiom_xpath_result_node + { + /** Type of result */ + axiom_xpath_result_type_t type; + + /** Value */ + void * value; + }; + + /** + * Compile an XPath expression + * + * @param env Environment must not be null + * @param xpath_expr A pointer to the XPath expression + * @return The parsed XPath expression. Returns NULL if an error occured + * while parsing. + */ + AXIS2_EXTERN axiom_xpath_expression_t * AXIS2_CALL axiom_xpath_compile_expression( + const axutil_env_t *env, + const axis2_char_t* xpath_expr); + + /** + * Create an empty XPath context + * + * @param env Environment must not be null + * @param root_node A pointer to the root of the tree + * @return The initialized XPath context. + */ + AXIS2_EXTERN axiom_xpath_context_t * AXIS2_CALL axiom_xpath_context_create( + const axutil_env_t *env, + axiom_node_t * root_node); + + /** + * Evaluate an parsed XPath expression. Different expressions could + * be evaluated on the same context, and same expression could be + * evaluated on multiple trees without recompiling. + * + * @param context XPath context must not be null + * @param xpath_expr XPath expression to be evaluated + * @return The set of results. + */ + AXIS2_EXTERN axiom_xpath_result_t * AXIS2_CALL axiom_xpath_evaluate( + axiom_xpath_context_t *context, + axiom_xpath_expression_t *xpath_expr); + + + /** + * Convert an XPath result to a boolean. + * If the result is a boolean the value of it is returned. + * If the result is a number, AXIS2_TRUE is + * returned if the value is not equal to 0 and AXIS2_FALSE otherwise. + * Otherwise AXIS2_TRUE is returned if the result is not NULL and AXIS2_FALSE otherwise. + * + * @param env Environment must not be null + * @param node A pointer to the XPath result + * @return The boolean value. + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL axiom_xpath_cast_node_to_boolean( + const axutil_env_t *env, + axiom_xpath_result_node_t * node); + + /** + * Convert an XPath result to a number. + * If the result is a boolean, 1 is returned if it's true and 0 otherwise. + * If the result is a number the value of it is returned. + * Otherwise AXIS2_TRUE is returned if the result is not NULL and AXIS2_FALSE otherwise. + * + * @param env Environment must not be null + * @param node A pointer to the XPath result + * @return The numerical value. + */ + AXIS2_EXTERN double AXIS2_CALL axiom_xpath_cast_node_to_number( + const axutil_env_t *env, + axiom_xpath_result_node_t * node); + + /** + * Convert an XPath result to text. + * If the result is a boolean, "true" is returned if it's true and "false" otherwise. + * If the result is a number the text representation of it is returned. + * If the result is a text the value of it is returned. + * If the result is an axiom node, the text value of it is returned + * If the result is an axiom attribue, the text value of it is returned + * + * @param env Environment must not be null + * @param node A pointer to the XPath result + * @return The text value. + */ + AXIS2_EXTERN axis2_char_t * AXIS2_CALL axiom_xpath_cast_node_to_string( + const axutil_env_t *env, + axiom_xpath_result_node_t * node); + + /** + * Convert an XPath result to an axiom node. + * If the result is an axiom node it is returned and NULL otherwise. + * + * @param env Environment must not be null + * @param node A pointer to the XPath result + * @return The axiom node. + */ + AXIS2_EXTERN axiom_node_t * AXIS2_CALL axiom_xpath_cast_node_to_axiom_node( + const axutil_env_t *env, + axiom_xpath_result_node_t * node); + + + /** + * Free XPath context + * + * @param env Environment must not be null + * @param context XPath context must not be null + */ + AXIS2_EXTERN void AXIS2_CALL axiom_xpath_free_context( + const axutil_env_t *env, + axiom_xpath_context_t *context); + + /** + * Free XPath expression + * + * @param env Environment must not be null + * @param xpath_expr XPath expression must not be null + */ + AXIS2_EXTERN void AXIS2_CALL axiom_xpath_free_expression( + const axutil_env_t *env, + axiom_xpath_expression_t * xpath_expr); + + /** + * Free XPath result set + * + * @param env Environment must not be null + * @param result XPath result set must not be null + */ + AXIS2_EXTERN void AXIS2_CALL axiom_xpath_free_result( + const axutil_env_t *env, + axiom_xpath_result_t* result); + + /** + * Registers a XPath namespace + * + * @param context XPath Context, must not be null + * @param ns AXIOM namespace, must not be null + */ + AXIS2_EXTERN void AXIS2_CALL axiom_xpath_register_namespace( + axiom_xpath_context_t *context, + axiom_namespace_t *ns); + + /** + * Get a registered namespace by the prefix. + * If there is no namespace registered by the given prefix NULL will be returned + * + * @param context XPath Context, must not be null + * @param prefix Prefix of the namespace, must not be null + * @return The namespace corresponding to the prefix. + */ + AXIS2_EXTERN axiom_namespace_t * AXIS2_CALL axiom_xpath_get_namespace( + axiom_xpath_context_t *context, + axis2_char_t *prefix); + + /** + * Clears all registered XPath namespaces + * + * @param context XPath Context, must not be null + */ + AXIS2_EXTERN void AXIS2_CALL axiom_xpath_clear_namespaces( + axiom_xpath_context_t *context); + + /** + * Evaluates an XPath expression on streaming XML. + * Not all expressions can be evaluated on streaming XML. + * If the expression cannot be evaluated on streaming XML NULL will be returned. + * + * @param context XPath Context, must not be null + * @param xpath_expr XPath expression to be evaluated + */ + AXIS2_EXTERN axiom_xpath_result_t * AXIS2_CALL axiom_xpath_evaluate_streaming( + axiom_xpath_context_t *context, + axiom_xpath_expression_t *xpath_expr); + + /** + * Checks whether the given expression can be evaluated on streaming XML. + * If it is possible AXIS2_TRUE will be retuned; AXIS2_FALSE otherwise. + * + * @param env Axis2 environment, must not be null + * @param expr Complied XPath expression, must not be null + * @return A boolean indicating whether the expression can be evaluated on streaming XML. + */ + AXIS2_EXTERN axis2_bool_t AXIS2_CALL axiom_xpath_streaming_check( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Setup the XPath core function library + * + * @param context XPath Context, must not be null + */ + AXIS2_EXTERN void AXIS2_CALL axiom_xpath_register_default_functions_set( + axiom_xpath_context_t *context); + + /** + * Registers a custom XPath function http://www.w3.org/TR/xpath#corelib + * + * @param context XPath Context, must not be null + * @param name Name of the function, must not be null + * @param func Pointer to the function, must not be null + */ + AXIS2_EXTERN void AXIS2_CALL axiom_xpath_register_function( + axiom_xpath_context_t *context, + axis2_char_t *name, + axiom_xpath_function_t func); + + /** + * Retrive a pointer to a registered funciton by the function name. + * If there is no function registered by the given name, NULL will be returned. + * + * @param context XPath Context, must not be null + * @param name Name of the function, must not be null + * @return The corresponding function. + */ + AXIS2_EXTERN axiom_xpath_function_t AXIS2_CALL axiom_xpath_get_function( + axiom_xpath_context_t *context, + axis2_char_t *name); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/axiom/src/Makefile.am b/axiom/src/Makefile.am new file mode 100644 index 0000000..a3e9472 --- /dev/null +++ b/axiom/src/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = parser attachments soap util ${XPATH_DIR} om + diff --git a/axiom/src/attachments/Makefile.am b/axiom/src/attachments/Makefile.am new file mode 100644 index 0000000..e4ec8fd --- /dev/null +++ b/axiom/src/attachments/Makefile.am @@ -0,0 +1,15 @@ +noinst_LTLIBRARIES = libaxis2_attachments.la +AM_CPPFLAGS = $(CPPFLAGS) +libaxis2_attachments_la_SOURCES = mime_part.c \ + data_handler.c \ + mime_body_part.c \ + mime_parser.c + +libaxis2_attachments_la_LIBADD = ../../../util/src/libaxutil.la + +INCLUDES = -I$(top_builddir)/include \ + -I$(top_builddir)/parser \ + -I ../../../util/include + +EXTRA_DIST = axiom_mime_body_part.h + diff --git a/axiom/src/attachments/axiom_mime_body_part.h b/axiom/src/attachments/axiom_mime_body_part.h new file mode 100644 index 0000000..a925679 --- /dev/null +++ b/axiom/src/attachments/axiom_mime_body_part.h @@ -0,0 +1,121 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_MIME_BODY_PART_H +#define AXIOM_MIME_BODY_PART_H + +/** + * @file axiom_mime_body_part.h + * @brief axis2 mime_body_part interface + */ + +#include <axutil_utils.h> +#include <axutil_error.h> +#include <axutil_utils_defines.h> +#include <axutil_env.h> +#include <axutil_allocator.h> +#include <axutil_string.h> +#include <axutil_array_list.h> +#include <axiom_data_handler.h> +#include <axiom_text.h> +#include <axiom_mime_const.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_mime_body_part axiom_mime_body_part_t; + + /** @defgroup axiom_mime_body_part + * @ingroup axiom_mime_body_part + * @{ + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_mime_body_part_add_header( + axiom_mime_body_part_t * mime_body_part, + const axutil_env_t * env, + const axis2_char_t * name, + const axis2_char_t * value); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_mime_body_part_set_data_handler( + axiom_mime_body_part_t * mime_body_part, + const axutil_env_t * env, + axiom_data_handler_t * data_handler); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_mime_body_part_write_to( + axiom_mime_body_part_t * mime_body_part, + const axutil_env_t * env, + axis2_byte_t ** output_stream, + int *output_stream_size); + + /** Deallocate memory + * @return status code + */ + AXIS2_EXTERN void AXIS2_CALL + axiom_mime_body_part_free( + axiom_mime_body_part_t * mime_body_part, + const axutil_env_t * env); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_mime_body_part_write_to_list( + axiom_mime_body_part_t *mime_body_part, + const axutil_env_t *env, + axutil_array_list_t *list); + + /** + * Creates mime_body_part struct + * @return pointer to newly created mime_body_part + */ + AXIS2_EXTERN axiom_mime_body_part_t *AXIS2_CALL + axiom_mime_body_part_create( + const axutil_env_t * env); + + /** + * Creates mime_body_part struct from a om_text + * @return pointer to newly created mime_body_part + */ + + AXIS2_EXTERN axiom_mime_body_part_t *AXIS2_CALL + axiom_mime_body_part_create_from_om_text( + const axutil_env_t *env, + axiom_text_t *text); + + +#define AXIOM_MIME_BODY_PART_FREE(mime_body_part, env) \ + axiom_mime_body_part_free (mime_body_part, env) + +#define AXIOM_MIME_BODY_PART_ADD_HEADER(mime_body_part, env, name, value) \ + axiom_mime_body_part_add_header (mime_body_part, env, name, value) + +#define AXIOM_MIME_BODY_PART_SET_DATA_HANDLER(mime_body_part, env, data_handler) \ + axiom_mime_body_part_set_data_handler (mime_body_part, env, data_handler) + +#define AXIOM_MIME_BODY_PART_WRITE_TO(mime_body_part, env, output_stream, output_stream_size) \ + axiom_mime_body_part_write_to (mime_body_part, env, output_stream, output_stream_size) + + /** @} */ + +#ifdef __cplusplus +} +#endif +#endif /* AXIOM_MIME_BODY_PART_H */ diff --git a/axiom/src/attachments/data_handler.c b/axiom/src/attachments/data_handler.c new file mode 100644 index 0000000..3be8a9d --- /dev/null +++ b/axiom/src/attachments/data_handler.c @@ -0,0 +1,572 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_data_handler.h> +#include <stdio.h> +#include <sys/stat.h> +#include <axiom_mime_part.h> + +struct axiom_data_handler +{ + /* The content type */ + axis2_char_t *mime_type; + + /* If in a file then the file name*/ + axis2_char_t *file_name; + + /* If it is in a buffer then the buffer */ + axis2_byte_t *buffer; + + /* The length of the buffer */ + size_t buffer_len; + + /* Is this a data_handler with a file name or a buffer*/ + axiom_data_handler_type_t data_handler_type; + + /* When parsing whether we have cached it or not */ + axis2_bool_t cached; + + /* The Content Id */ + axis2_char_t *mime_id; + + /* In the case of sending callback this is required */ + void *user_param; + +}; + +/* Creates the data_handler. The file name is not mandatory */ + +AXIS2_EXTERN axiom_data_handler_t *AXIS2_CALL +axiom_data_handler_create( + const axutil_env_t *env, + const axis2_char_t *file_name, + const axis2_char_t *mime_type) +{ + axiom_data_handler_t *data_handler = NULL; + + AXIS2_ENV_CHECK(env, NULL); + data_handler = (axiom_data_handler_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_data_handler_t)); + + if(!data_handler) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create data handler"); + return NULL; + } + + data_handler->mime_type = NULL; + data_handler->file_name = NULL; + data_handler->buffer = NULL; + data_handler->buffer_len = 0; + /* By default, a Data Handler is of type Buffer */ + data_handler->data_handler_type = AXIOM_DATA_HANDLER_TYPE_BUFFER; + data_handler->cached = AXIS2_FALSE; + data_handler->mime_id = NULL; + data_handler->user_param = NULL; + + if(mime_type) + { + data_handler->mime_type = axutil_strdup(env, mime_type); + if(!(data_handler->mime_type)) + { + axiom_data_handler_free(data_handler, env); + return NULL; + } + } + if(file_name) + { + data_handler->file_name = axutil_strdup(env, file_name); + if(!(data_handler->file_name)) + { + axiom_data_handler_free(data_handler, env); + return NULL; + } + data_handler->data_handler_type = AXIOM_DATA_HANDLER_TYPE_FILE; + } + + return data_handler; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_data_handler_free( + axiom_data_handler_t *data_handler, + const axutil_env_t *env) +{ + if(data_handler->file_name) + { + AXIS2_FREE(env->allocator, data_handler->file_name); + } + + if(data_handler->mime_type) + { + AXIS2_FREE(env->allocator, data_handler->mime_type); + } + + if(data_handler->buffer) + { + AXIS2_FREE(env->allocator, data_handler->buffer); + } + + if(data_handler->mime_id) + { + AXIS2_FREE(env->allocator, data_handler->mime_id); + } + + if(data_handler) + { + AXIS2_FREE(env->allocator, data_handler); + } + + return; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_data_handler_get_content_type( + axiom_data_handler_t *data_handler, + const axutil_env_t *env) +{ + return data_handler->mime_type; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_data_handler_set_content_type( + axiom_data_handler_t *data_handler, + const axutil_env_t *env, + const axis2_char_t *mime_type) +{ + if(data_handler->mime_type) + { + AXIS2_FREE(env->allocator, data_handler->mime_type); + } + data_handler->mime_type = axutil_strdup(env, mime_type); + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_data_handler_get_cached( + axiom_data_handler_t *data_handler, + const axutil_env_t *env) +{ + return data_handler->cached; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_data_handler_set_cached( + axiom_data_handler_t *data_handler, + const axutil_env_t *env, + axis2_bool_t cached) +{ + data_handler->cached = cached; +} + +AXIS2_EXTERN axis2_byte_t *AXIS2_CALL +axiom_data_handler_get_input_stream( + axiom_data_handler_t *data_handler, + const axutil_env_t *env) +{ + return data_handler->buffer; +} + +AXIS2_EXTERN size_t AXIS2_CALL +axiom_data_handler_get_input_stream_len( + axiom_data_handler_t *data_handler, + const axutil_env_t *env) +{ + return data_handler->buffer_len; +} + +/* With MTOM caching support this function is no longer used + * Because this will load whole file in to buffer. So for large + * attachment this is not wise */ + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_data_handler_read_from( + axiom_data_handler_t *data_handler, + const axutil_env_t *env, + axis2_byte_t **output_stream, + size_t *output_stream_size) +{ + if(data_handler->data_handler_type == AXIOM_DATA_HANDLER_TYPE_BUFFER) + { + *output_stream = data_handler->buffer; + *output_stream_size = data_handler->buffer_len; + } + else if(data_handler->data_handler_type == AXIOM_DATA_HANDLER_TYPE_FILE + && data_handler->file_name) + { + FILE *f = NULL; + axis2_byte_t *byte_stream = NULL; + axis2_byte_t *temp_byte_stream = NULL; + axis2_byte_t *read_stream = NULL; + int byte_stream_size = 0; + int temp_byte_stream_size = 0; + int read_stream_size = 0; + int count = 0; + struct stat stat_p; + + f = fopen(data_handler->file_name, "rb"); + if(!f) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error opening file %s for reading", + data_handler->file_name); + return AXIS2_FAILURE; + } + + if(stat(data_handler->file_name, &stat_p) == -1) + { + fclose(f); + return AXIS2_FAILURE; + } + else if(stat_p.st_size == 0) + { + fclose(f); + *output_stream = NULL; + *output_stream_size = 0; + return AXIS2_SUCCESS; + } + + do + { + read_stream_size = stat_p.st_size; + read_stream = AXIS2_MALLOC(env->allocator, (read_stream_size) * sizeof(axis2_byte_t)); + if(!read_stream) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create binary stream"); + if(byte_stream) + { + AXIS2_FREE(env->allocator, byte_stream); + } + fclose(f); + return AXIS2_FAILURE; + } + count = (int)fread(read_stream, 1, read_stream_size, f); + /* The count lies within the int range */ + if(ferror(f)) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in reading file %s", + data_handler->file_name); + if(byte_stream) + { + AXIS2_FREE(env->allocator, byte_stream); + } + if(read_stream) + { + AXIS2_FREE(env->allocator, read_stream); + } + fclose(f); + return AXIS2_FAILURE; + } + + /* copy the read bytes */ + if(count > 0) + { + if(byte_stream) + { + temp_byte_stream = byte_stream; + temp_byte_stream_size = byte_stream_size; + byte_stream_size = temp_byte_stream_size + count; + byte_stream = AXIS2_MALLOC(env->allocator, (byte_stream_size) + * sizeof(axis2_byte_t)); + if(!byte_stream) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "No memory. Cannot create binary stream"); + if(read_stream) + { + AXIS2_FREE(env->allocator, read_stream); + } + if(temp_byte_stream) + { + AXIS2_FREE(env->allocator, temp_byte_stream); + } + fclose(f); + return AXIS2_FAILURE; + } + + memcpy(byte_stream, temp_byte_stream, temp_byte_stream_size); + memcpy(byte_stream + temp_byte_stream_size, read_stream, count); + + if(read_stream) + { + AXIS2_FREE(env->allocator, read_stream); + read_stream_size = 0; + } + if(temp_byte_stream) + { + AXIS2_FREE(env->allocator, temp_byte_stream); + temp_byte_stream = NULL; + temp_byte_stream_size = 0; + } + } + else + { + byte_stream = read_stream; + byte_stream_size = read_stream_size; + read_stream = NULL; + read_stream_size = 0; + } + } + else if(read_stream) + { + AXIS2_FREE(env->allocator, read_stream); + } + } + while(!feof(f)); + + fclose(f); + data_handler->buffer = byte_stream; + data_handler->buffer_len = byte_stream_size; + *output_stream = byte_stream; + *output_stream_size = byte_stream_size; + } + else + { + /* Data Handler File Name is missing */ + return AXIS2_FAILURE; + } + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_data_handler_set_binary_data( + axiom_data_handler_t *data_handler, + const axutil_env_t *env, + axis2_byte_t *input_stream, + size_t input_stream_len) +{ + data_handler->buffer = input_stream; + data_handler->buffer_len = input_stream_len; + return AXIS2_SUCCESS; +} + +/* This function will write the data in the buffer + * to a file. When caching is being used this will + * not be called , because the parser it self cache + * the attachment while parsing */ + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_data_handler_write_to( + axiom_data_handler_t *data_handler, + const axutil_env_t *env) +{ + if(data_handler->file_name) + { + FILE *f = NULL; + int count = 0; + + f = fopen(data_handler->file_name, "wb"); + if(!f) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error opening file %s for writing", + data_handler->file_name); + return AXIS2_FAILURE; + } + + count = (int)fwrite(data_handler->buffer, 1, data_handler->buffer_len, f); + /* The count lies within the int range */ + + if(ferror(f)) + { + fclose(f); + return AXIS2_FAILURE; + } + fflush(f); + fclose(f); + } + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_data_handler_set_file_name( + axiom_data_handler_t *data_handler, + const axutil_env_t *env, + axis2_char_t *file_name) +{ + if(data_handler->file_name) + { + AXIS2_FREE(env->allocator, data_handler->file_name); + data_handler->file_name = NULL; + } + + if(file_name) + { + data_handler->file_name = axutil_strdup(env, file_name); + if(!(data_handler->file_name)) + { + return AXIS2_FAILURE; + } + } + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_data_handler_get_file_name( + axiom_data_handler_t *data_handler, + const axutil_env_t *env) +{ + if(data_handler->file_name) + { + return data_handler->file_name; + } + else + { + return NULL; + } +} + +/* This method will add the data_handler binary data to the array_list. + * If it is a buffer the part type is buffer. otherwise it is a file. In the + * case of file the array_list have just the file name and the size. The content + * is not loaded to the memory. + */ + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_data_handler_add_binary_data( + axiom_data_handler_t *data_handler, + const axutil_env_t *env, + axutil_array_list_t *list) + +{ + axiom_mime_part_t *binary_part = NULL; + + binary_part = axiom_mime_part_create(env); + + if(!binary_part) + { + return AXIS2_FAILURE; + } + + if(data_handler->data_handler_type == AXIOM_DATA_HANDLER_TYPE_BUFFER) + { + binary_part->part = (axis2_byte_t *)AXIS2_MALLOC(env->allocator, (data_handler->buffer_len) + * sizeof(axis2_byte_t)); + memcpy(binary_part->part, data_handler->buffer, data_handler->buffer_len); + + binary_part->part_size = data_handler->buffer_len; + binary_part->type = AXIOM_MIME_PART_BUFFER; + } + + /* In the case of file we first calculate the file size + * and then add the file name */ + + else if(data_handler->data_handler_type == AXIOM_DATA_HANDLER_TYPE_FILE + && data_handler->file_name) + { + struct stat stat_p; + + if(stat(data_handler->file_name, &stat_p) == -1) + { + return AXIS2_FAILURE; + } + else if(stat_p.st_size == 0) + { + return AXIS2_SUCCESS; + } + else + { + binary_part->file_name = (axis2_char_t *)axutil_strdup(env, data_handler->file_name); + binary_part->part_size = stat_p.st_size; + binary_part->type = AXIOM_MIME_PART_FILE; + } + } + /* In the case of Callback the user should specify the callback name in the + * configuration file. We just set the correct type. Inside the transport + * it will load the callback and send the attachment appropriately */ + + else if(data_handler->data_handler_type == AXIOM_DATA_HANDLER_TYPE_CALLBACK) + { + binary_part->type = AXIOM_MIME_PART_CALLBACK; + binary_part->user_param = data_handler->user_param; + } + + else + { + /* Data Handler File Name is missing */ + return AXIS2_FAILURE; + } + + /* Finaly we add the binary details to the list */ + + axutil_array_list_add(list, env, binary_part); + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_data_handler_get_mime_id( + axiom_data_handler_t *data_handler, + const axutil_env_t *env) +{ + return data_handler->mime_id; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_data_handler_set_mime_id( + axiom_data_handler_t *data_handler, + const axutil_env_t *env, + const axis2_char_t *mime_id) +{ + if(data_handler->mime_id) + { + AXIS2_FREE(env->allocator, data_handler->mime_id); + } + data_handler->mime_id = axutil_strdup(env, mime_id); + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_data_handler_type_t AXIS2_CALL +axiom_data_handler_get_data_handler_type( + axiom_data_handler_t *data_handler, + const axutil_env_t *env) +{ + return data_handler->data_handler_type; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_data_handler_set_data_handler_type( + axiom_data_handler_t *data_handler, + const axutil_env_t *env, + axiom_data_handler_type_t data_handler_type) +{ + data_handler->data_handler_type = data_handler_type; + return; +} + +AXIS2_EXTERN void *AXIS2_CALL +axiom_data_handler_get_user_param( + axiom_data_handler_t *data_handler, + const axutil_env_t *env) +{ + return data_handler->user_param; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_data_handler_set_user_param( + axiom_data_handler_t *data_handler, + const axutil_env_t *env, + void *user_param) +{ + data_handler->user_param = user_param; + return; +} + diff --git a/axiom/src/attachments/mime_body_part.c b/axiom/src/attachments/mime_body_part.c new file mode 100644 index 0000000..186acdb --- /dev/null +++ b/axiom/src/attachments/mime_body_part.c @@ -0,0 +1,284 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_mime_body_part.h" +#include <axiom_mime_part.h> +#include <axiom_data_handler.h> +#include <axutil_hash.h> + +struct axiom_mime_body_part +{ + /* hash map to hold header name, value pairs */ + axutil_hash_t *header_map; + axiom_data_handler_t *data_handler; +}; + +/* This method just create a mime_body_part. It does not + * fill the header map. + */ + +AXIS2_EXTERN axiom_mime_body_part_t *AXIS2_CALL +axiom_mime_body_part_create( + const axutil_env_t *env) +{ + axiom_mime_body_part_t *mime_body_part = NULL; + + AXIS2_ENV_CHECK(env, NULL); + mime_body_part = (axiom_mime_body_part_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_mime_body_part_t)); + + if(!mime_body_part) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create MIME body part"); + return NULL; + } + + mime_body_part->header_map = NULL; + mime_body_part->data_handler = NULL; + + mime_body_part->header_map = axutil_hash_make(env); + if(!(mime_body_part->header_map)) + { + axiom_mime_body_part_free(mime_body_part, env); + return NULL; + } + + return mime_body_part; +} + +/* This method will create the mime_body_part and fill the header map with + * default information. Default information are for binary attachments. + * Attachment information is taken from the information in data_handler in passed + * om_text. + */ + +AXIS2_EXTERN axiom_mime_body_part_t *AXIS2_CALL +axiom_mime_body_part_create_from_om_text( + const axutil_env_t *env, + axiom_text_t *text) +{ + axiom_data_handler_t *data_handler = NULL; + axiom_mime_body_part_t *mime_body_part = NULL; + axis2_char_t *content_id = NULL; + axis2_char_t *temp_content_id = NULL; + const axis2_char_t *content_type = AXIOM_MIME_TYPE_OCTET_STREAM; + + mime_body_part = axiom_mime_body_part_create(env); + if(!mime_body_part) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "MIME body part creation failed"); + return NULL; + } + + /* Take the data_handler which is set by the sending applocation. */ + + data_handler = axiom_text_get_data_handler(text, env); + + if(data_handler) + { + content_type = axiom_data_handler_get_content_type(data_handler, env); + } + + AXIOM_MIME_BODY_PART_SET_DATA_HANDLER(mime_body_part, env, data_handler); + content_id = (axis2_char_t *)"<"; + content_id = axutil_stracat(env, content_id, axiom_text_get_content_id(text, env)); + temp_content_id = axutil_stracat(env, content_id, ">"); + + AXIS2_FREE(env->allocator, content_id); + content_id = temp_content_id; + + /* Adding the content-id */ + AXIOM_MIME_BODY_PART_ADD_HEADER(mime_body_part, env, AXIOM_MIME_HEADER_CONTENT_ID, content_id); + + /* Adding the content-type */ + AXIOM_MIME_BODY_PART_ADD_HEADER(mime_body_part, env, AXIOM_MIME_HEADER_CONTENT_TYPE, + axutil_strdup(env, content_type)); + + /* Adding the content-transfer encoding */ + AXIOM_MIME_BODY_PART_ADD_HEADER(mime_body_part, env, + AXIOM_MIME_HEADER_CONTENT_TRANSFER_ENCODING, axutil_strdup(env, + AXIOM_MIME_CONTENT_TRANSFER_ENCODING_BINARY)); + + return mime_body_part; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_mime_body_part_free( + axiom_mime_body_part_t *mime_body_part, + const axutil_env_t *env) +{ + if(mime_body_part->header_map) + { + axutil_hash_index_t *hash_index = NULL; + const void *key = NULL; + void *value = NULL; + for(hash_index = axutil_hash_first(mime_body_part->header_map, env); hash_index; hash_index + = axutil_hash_next(env, hash_index)) + { + axutil_hash_this(hash_index, &key, NULL, &value); + if(value) + { + AXIS2_FREE(env->allocator, value); + } + } + + axutil_hash_free(mime_body_part->header_map, env); + mime_body_part->header_map = NULL; + } + + if(mime_body_part) + { + AXIS2_FREE(env->allocator, mime_body_part); + } + + return; +} + +/* This method will add a mime_header to the hash */ + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_mime_body_part_add_header( + axiom_mime_body_part_t *mime_body_part, + const axutil_env_t *env, + const axis2_char_t *name, + const axis2_char_t *value) +{ + AXIS2_PARAM_CHECK(env->error, name, AXIS2_FAILURE); + + if(!mime_body_part->header_map) + { + return AXIS2_FAILURE; + } + axutil_hash_set(mime_body_part->header_map, name, AXIS2_HASH_KEY_STRING, value); + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_mime_body_part_set_data_handler( + axiom_mime_body_part_t *mime_body_part, + const axutil_env_t *env, + axiom_data_handler_t *data_handler) +{ + mime_body_part->data_handler = data_handler; + return AXIS2_SUCCESS; +} + +/* This method will fill the array_list with binary and binary_beader information. + * If the binary is in a file this will not load the file to the memory. Because + * that will cause performance degradation when the file size is large. Instead + * this will add file information to the list so that when writing the message + * through transport_sender it can send the file by chunk. + */ + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_mime_body_part_write_to_list( + axiom_mime_body_part_t *mime_body_part, + const axutil_env_t *env, + axutil_array_list_t *list) +{ + axutil_hash_index_t *hash_index = NULL; + const void *key = NULL; + void *value = NULL; + axis2_char_t *header_str = NULL; + axis2_char_t *temp_header_str = NULL; + int header_str_size = 0; + axis2_status_t status = AXIS2_FAILURE; + axiom_mime_part_t *mime_header_part = NULL; + + /* We have the mime headers in the hash with thier keys + * So first concatenate them to a one string */ + + for(hash_index = axutil_hash_first(mime_body_part->header_map, env); hash_index; hash_index + = axutil_hash_next(env, hash_index)) + { + axutil_hash_this(hash_index, &key, NULL, &value); + if(key && value) + { + /* First conactenate to the already conacatenated stuff */ + + temp_header_str = axutil_stracat(env, header_str, (axis2_char_t *)key); + if(header_str) + { + AXIS2_FREE(env->allocator, header_str); + } + header_str = temp_header_str; + temp_header_str = axutil_stracat(env, header_str, ": "); + AXIS2_FREE(env->allocator, header_str); + header_str = temp_header_str; + + /* Add the new stuff */ + temp_header_str = axutil_stracat(env, header_str, (axis2_char_t *)value); + AXIS2_FREE(env->allocator, header_str); + header_str = temp_header_str; + + /* Next header will be in a new line. So lets add it */ + + temp_header_str = axutil_stracat(env, header_str, AXIS2_CRLF); + AXIS2_FREE(env->allocator, header_str); + header_str = temp_header_str; + } + } + + /* If there is a data handler that's mean there is an attachment. Attachment + * will always start after an additional new line . So let's add it .*/ + + if(mime_body_part->data_handler) + { + temp_header_str = axutil_stracat(env, header_str, AXIS2_CRLF); + AXIS2_FREE(env->allocator, header_str); + header_str = temp_header_str; + } + + if(header_str) + { + header_str_size = axutil_strlen(header_str); + } + + /* Now we have the complete mime_headers string for a particular mime part. + * First wrap it as a mime_part_t .Then add it to the array list so + * later through the transport this can be written to the wire. */ + + mime_header_part = axiom_mime_part_create(env); + + if(mime_header_part) + { + mime_header_part->part = (axis2_byte_t *)header_str; + mime_header_part->part_size = header_str_size; + mime_header_part->type = AXIOM_MIME_PART_BUFFER; + } + else + { + return AXIS2_FAILURE; + } + + axutil_array_list_add(list, env, mime_header_part); + + /* Then if the data_handler is there let's add the binary data, may be + * buffer , may be file name and information. + */ + + if(mime_body_part->data_handler) + { + status = axiom_data_handler_add_binary_data(mime_body_part->data_handler, env, list); + if(status != AXIS2_SUCCESS) + { + return status; + } + } + return AXIS2_SUCCESS; +} diff --git a/axiom/src/attachments/mime_parser.c b/axiom/src/attachments/mime_parser.c new file mode 100644 index 0000000..f36286c --- /dev/null +++ b/axiom/src/attachments/mime_parser.c @@ -0,0 +1,2304 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_mime_parser.h> +#include <axutil_string.h> +#include <axiom_data_handler.h> +#include <stdio.h> +#include <ctype.h> +#include <axutil_http_chunked_stream.h> +#include <axiom_mtom_caching_callback.h> +#include <axutil_class_loader.h> +#include <axutil_url.h> + +struct axiom_mime_parser +{ + /* This will keep the attachment and its info*/ + axutil_hash_t *mime_parts_map; + + /* This is the actual SOAP part len */ + size_t soap_body_len; + + /* The SOAP part of the message */ + axis2_char_t *soap_body_str; + + /* The size of the buffer we give to the callback to + * read data */ + size_t buffer_size; + + /* The number of buffers */ + int max_buffers; + + /* The attachment dir name, in the case of caching */ + axis2_char_t *attachment_dir; + + /*A pointer to the caching callback */ + axiom_mtom_caching_callback_t *mtom_caching_callback; + + /* The caching callback name specified */ + axis2_char_t *callback_name; + + axis2_char_t **buf_array; + + size_t *len_array; + + int current_buf_num; + + axis2_bool_t end_of_mime; + + axis2_char_t *mime_boundary; + +}; + +struct axiom_search_info +{ + /*String need to be searched*/ + const axis2_char_t *search_str; + + /*The buffers and the lengths need to be searched*/ + axis2_char_t *buffer1; + size_t len1; + axis2_char_t *buffer2; + size_t len2; + + /*Flag to keep what type of search is this buffer has done*/ + axis2_bool_t primary_search; + + /*The offset where we found the pattern entirely in one buffer*/ + size_t match_len1; + + /*when pattern contains in two buffers the length of partial pattern + in buffer2 */ + size_t match_len2; + + /*Whether we need caching or not*/ + axis2_bool_t cached; + + /*A pointer to a user provided storage to which we cache the attachment*/ + void *handler; + + /* Size of the binary when writing to the buffer*/ + size_t binary_size; +}; + +typedef struct axiom_search_info axiom_search_info_t; + +#define AXIOM_MIME_PARSER_CONTENT_ID "content-id" +#define AXIOM_MIME_PARSER_CONTENT_TYPE "content-type" + +#define AXIOM_MIME_PARSER_END_OF_MIME_MAX_COUNT 100 + +static axis2_char_t * +axiom_mime_parser_search_for_soap( + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK callback, + void *callback_ctx, + int *buf_num, + size_t *len_array, + axis2_char_t **buf_array, + axiom_search_info_t *search_info, + size_t size, + axis2_char_t *mime_boundary, + axiom_mime_parser_t *mime_parser); + +static axis2_char_t * +axiom_mime_parser_search_for_crlf( + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK callback, + void *callback_ctx, + int *buf_num, + size_t *len_array, + axis2_char_t **buf_array, + axiom_search_info_t *search_info, + size_t size, + axiom_mime_parser_t *mime_parser); + +static size_t +axiom_mime_parser_calculate_part_len( + const axutil_env_t *env, + int buf_num, + size_t *len_list, + int maker, + axis2_char_t *pos, + axis2_char_t *buf); + +static axis2_char_t * +axiom_mime_parser_create_part( + const axutil_env_t *env, + size_t part_len, + int buf_num, + size_t *len_list, + int marker, + axis2_char_t *pos, + axis2_char_t **buf_list, + axiom_mime_parser_t *mime_parser); + +static axis2_char_t * +axiom_mime_parser_search_string( + axiom_search_info_t *search_info, + const axutil_env_t *env); + +static axis2_char_t * +axiom_mime_parser_search_for_attachment( + axiom_mime_parser_t *mime_parser, + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK callback, + void *callback_ctx, + int *buf_num, + size_t *len_array, + axis2_char_t **buf_array, + axiom_search_info_t *search_info, + size_t size, + axis2_char_t *mime_boundary, + axis2_char_t *mime_id, + void *user_param); + +static axis2_status_t +axiom_mime_parser_store_attachment( + const axutil_env_t *env, + axiom_mime_parser_t *mime_parser, + axis2_char_t *mime_id, + axis2_char_t *mime_type, + axis2_char_t *mime_binary, + size_t mime_binary_len, + axis2_bool_t cached); + +static void +axiom_mime_parser_clear_buffers( + const axutil_env_t *env, + axis2_char_t **buf_list, + int free_from, + int free_to); + +static axis2_status_t +axiom_mime_parser_cache_to_buffer( + const axutil_env_t *env, + axis2_char_t *buf, + size_t buf_len, + axiom_search_info_t *search_info, + axiom_mime_parser_t *mime_parser); + +static axis2_bool_t +axiom_mime_parser_is_more_data( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env, + axis2_callback_info_t *callback_info); + +static axis2_char_t * +axiom_mime_parser_process_mime_headers( + const axutil_env_t *env, + axiom_mime_parser_t *mime_parser, + axis2_char_t **mime_id, + axis2_char_t *mime_headers); + +static axis2_status_t +axiom_mime_parser_cache_to_file( + const axutil_env_t* env, + axis2_char_t *buf, + size_t buf_len, + void *handler); + +static void* +axiom_mime_parser_initiate_callback( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env, + axis2_char_t *mime_id, + void *user_param); + +AXIS2_EXTERN axiom_mime_parser_t *AXIS2_CALL +axiom_mime_parser_create( + const axutil_env_t * env) +{ + axiom_mime_parser_t *mime_parser = NULL; + + AXIS2_ENV_CHECK(env, NULL); + mime_parser = (axiom_mime_parser_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_mime_parser_t)); + + if(!mime_parser) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + mime_parser->mime_parts_map = NULL; + mime_parser->soap_body_len = 0; + mime_parser->soap_body_str = NULL; /* shallow copy */ + mime_parser->buffer_size = 1; + mime_parser->max_buffers = AXIOM_MIME_PARSER_MAX_BUFFERS; + mime_parser->attachment_dir = NULL; + mime_parser->mtom_caching_callback = NULL; + mime_parser->callback_name = NULL; + mime_parser->buf_array = NULL; + mime_parser->len_array = NULL; + mime_parser->current_buf_num = 0; + mime_parser->end_of_mime = AXIS2_FALSE; + mime_parser->mime_boundary = NULL; + + mime_parser->mime_parts_map = axutil_hash_make(env); + if(!(mime_parser->mime_parts_map)) + { + axiom_mime_parser_free(mime_parser, env); + return NULL; + } + + return mime_parser; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_mime_parser_free( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + /* The map is passed on to SOAP builder, and SOAP builder take over the + ownership of the map */ + + /* We will unload the callback at the end */ + + if(mime_parser->mtom_caching_callback) + { + axutil_param_t *param = NULL; + param = mime_parser->mtom_caching_callback->param; + + AXIOM_MTOM_CACHING_CALLBACK_FREE(mime_parser->mtom_caching_callback, env); + mime_parser->mtom_caching_callback = NULL; + + if(param) + { + axutil_param_free(param, env); + param = NULL; + } + } + + if(mime_parser->buf_array) + { + AXIS2_FREE(env->allocator, mime_parser->buf_array); + mime_parser->buf_array = NULL; + } + + if(mime_parser->len_array) + { + AXIS2_FREE(env->allocator, mime_parser->len_array); + mime_parser->len_array = NULL; + } + + if(mime_parser) + { + AXIS2_FREE(env->allocator, mime_parser); + } + + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_mime_parser_parse_for_soap( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK callback, + void *callback_ctx, + axis2_char_t * mime_boundary) +{ + size_t size = 0; + axis2_char_t *soap_str = NULL; + size_t soap_len = 0; + size_t temp_mime_boundary_size = 0; + axis2_char_t *temp_mime_boundary = NULL; + axis2_char_t **buf_array = NULL; + size_t *len_array = NULL; + int buf_num = 0; + axis2_char_t *pos = NULL; + axiom_search_info_t *search_info = NULL; + int part_start = 0; + axis2_bool_t end_of_mime = AXIS2_FALSE; + size_t len = 0; + axis2_char_t *buffer = NULL; + size_t malloc_len = 0; + axis2_callback_info_t *callback_info = NULL; + + callback_info = (axis2_callback_info_t *)callback_ctx; + + /* The user will specify the mime_parser->buffer_size */ + + size = AXIOM_MIME_PARSER_BUFFER_SIZE * (mime_parser->buffer_size); + + /*An array to keep the set of buffers*/ + + buf_array = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t *) * (mime_parser->max_buffers)); + + if(!buf_array) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Failed in creating buffer array"); + return AXIS2_FAILURE; + } + + /*Keeps the corresponding lengths of buffers in buf_array*/ + + len_array = AXIS2_MALLOC(env->allocator, sizeof(size_t) * (mime_parser->max_buffers)); + + if(!len_array) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Failed in creating length array"); + return AXIS2_FAILURE; + } + + mime_parser->buf_array = buf_array; + mime_parser->len_array = len_array; + + temp_mime_boundary = axutil_stracat(env, "--", mime_boundary); + temp_mime_boundary_size = strlen(mime_boundary) + 2; + + /*This struct keeps the pre-post search informations*/ + search_info = AXIS2_MALLOC(env->allocator, sizeof(axiom_search_info_t)); + + /* The first buffer is created */ + buf_array[buf_num] = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (size + 1)); + + /* The buffer is filled from the callback */ + + if(buf_array[buf_num]) + { + len = callback(buf_array[buf_num], (int)size, (void *)callback_ctx); + } + if(len > 0) + { + len_array[buf_num] = len; + } + else + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error reading from the stream"); + return AXIS2_FAILURE; + } + + /*starting buffer for the current search*/ + part_start = buf_num; + + /*We are passing the address of the buf_num , beacause that value + is changing inside the method.*/ + + /* Following call to the method will search first \r\n\r\n */ + + pos = axiom_mime_parser_search_for_crlf(env, callback, callback_ctx, &buf_num, len_array, + buf_array, search_info, size, mime_parser); + + if(!pos) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in the message."); + return AXIS2_FAILURE; + } + + /* The patteren contains in one buffer */ + + if((search_info->match_len2 == 0)) + { + /*Readjusting the buffers for the next search and discarding the prevoius + buffers*/ + + /* We need the remaining part in the buffer after the \r\n\r\n*/ + + malloc_len = buf_array[buf_num] + len_array[buf_num] - pos - 4; + if(malloc_len < 0) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in parsing."); + return AXIS2_FAILURE; + } + else + { + /* Here we will create a new buffer of predefined size fill the + * first portion from the remaining part after previous search + * and then fill the remaining from the callback */ + + buffer = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (size + 1)); + + if(malloc_len > 0) + { + memcpy(buffer, pos + 4, malloc_len); + } + + /* Here we need to check for more data, because if the message is too small + * comapred to the reading size there may be no data in the stream , instead + * all the remaining data may be in the buffer.And if there are no more data + * we will set the len to be 0. Otherwise len_array will contain wrong lenghts. + */ + + if(axiom_mime_parser_is_more_data(mime_parser, env, callback_info)) + { + /* There is more data so fill the remaining from the stream*/ + + len = callback(buffer + malloc_len, (int)(size - malloc_len), (void *)callback_ctx); + } + else + { + len = 0; + } + + /* We do not need the data in the previous buffers once we found a particular + * string and after worked with those buffers */ + + axiom_mime_parser_clear_buffers(env, buf_array, part_start, buf_num); + + /* Adding the new buffer to the buffer list */ + + if(len >= 0) + { + buf_array[buf_num] = buffer; + len_array[buf_num] = malloc_len + len; + } + } + } + + /*The pattern divides among two buffers*/ + + else if(search_info->match_len2 > 0) + { + malloc_len = len_array[buf_num] - search_info->match_len2; + if(malloc_len < 0) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in parsing."); + return AXIS2_FAILURE; + } + else + { + buffer = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (size + 1)); + + /* Here the buf_num is the second buffer. We will copy the remaining data + * after the partial string in the second buffer */ + + if(malloc_len > 0) + { + memcpy(buffer, buf_array[buf_num] + search_info->match_len2, malloc_len); + } + if(axiom_mime_parser_is_more_data(mime_parser, env, callback_info)) + { + len = callback(buffer + malloc_len, (int)(size - malloc_len), (void *)callback_ctx); + } + else + { + len = 0; + } + axiom_mime_parser_clear_buffers(env, buf_array, part_start, buf_num); + if(len >= 0) + { + buf_array[buf_num] = buffer; + len_array[buf_num] = malloc_len + len; + } + } + } + else + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in parsing."); + return AXIS2_FAILURE; + } + + /*Resetting the previous search data and getting ready + for the next search */ + + part_start = buf_num; + pos = NULL; + malloc_len = 0; + + search_info->match_len1 = 0; + search_info->match_len2 = 0; + + /*In order to extract the soap envelope we need to search for the first + --MIMEBOUNDARY */ + + pos = axiom_mime_parser_search_for_soap(env, callback, callback_ctx, &buf_num, len_array, + buf_array, search_info, size, temp_mime_boundary, mime_parser); + + if(!pos) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error while searching for the SOAP part "); + return AXIS2_FAILURE; + } + + if(search_info->match_len2 == 0) + { + /*Calculating the length of the SOAP str*/ + + soap_len = axiom_mime_parser_calculate_part_len(env, buf_num, len_array, part_start, pos, + buf_array[buf_num]); + if(soap_len > 0) + { + /* Get the SOAP string from the starting and end buffers containing + * the SOAP part */ + + soap_str = axiom_mime_parser_create_part(env, soap_len, buf_num, len_array, part_start, + pos, buf_array, mime_parser); + if(!soap_str) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "Error while creating the SOAP part from the message "); + return AXIS2_FAILURE; + } + + malloc_len = len_array[buf_num] - search_info->match_len1 - temp_mime_boundary_size; + if(malloc_len < 0) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in parsing for mime."); + return AXIS2_FAILURE; + } + else + { + /* This will fill the new buffer with remaining data after the + * SOAP */ + + buffer = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (size + 1)); + + memset(buffer, 0, size + 1); + if(malloc_len > 0) + { + memcpy(buffer, pos + temp_mime_boundary_size, malloc_len); + } + if(axiom_mime_parser_is_more_data(mime_parser, env, callback_info)) + { + len = callback(buffer + malloc_len,(int)(size - malloc_len),(void *)callback_ctx); + } + else + { + len = 0; + } + axiom_mime_parser_clear_buffers(env, buf_array, part_start, buf_num); + if(len >= 0) + { + buf_array[buf_num] = buffer; + len_array[buf_num] = malloc_len + len; + } + } + } + else + { + return AXIS2_FAILURE; + } + } + + /* This is the condition where the --MIMEBOUNDARY is divided among two + * buffers */ + + else if(search_info->match_len2 > 0) + { + soap_len = axiom_mime_parser_calculate_part_len(env, buf_num - 1, len_array, part_start, + pos, buf_array[buf_num - 1]); + + if(soap_len > 0) + { + /* Here we pass buf_num-1 because buf_num does not have any thing we want to + * for this particular part. It begins with the latter part of the search string */ + + soap_str = axiom_mime_parser_create_part(env, soap_len, buf_num - 1, len_array, + part_start, pos, buf_array, mime_parser); + if(!soap_str) + { + return AXIS2_FAILURE; + } + + malloc_len = len_array[buf_num] - search_info->match_len2; + if(malloc_len < 0) + { + return AXIS2_FAILURE; + } + else + { + buffer = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (size + 1)); + + if(malloc_len > 0) + { + memcpy(buffer, buf_array[buf_num] + search_info->match_len2, malloc_len); + } + + if(axiom_mime_parser_is_more_data(mime_parser, env, callback_info)) + { + len = callback(buffer + malloc_len,(int)(size - malloc_len),(void *)callback_ctx); + } + else + { + len = 0; + } + axiom_mime_parser_clear_buffers(env, buf_array, part_start, buf_num); + if(len >= 0) + { + buf_array[buf_num] = buffer; + len_array[buf_num] = malloc_len + len; + } + } + } + else + { + return AXIS2_FAILURE; + } + } + + mime_parser->soap_body_str = soap_str; + mime_parser->soap_body_len = soap_len; + mime_parser->current_buf_num = buf_num; + + /* There are multipart/related messages which does not contain attachments + * The only mime_part is the soap envelope. So for those messages the mime + * boundary after the soap will end up with -- + * So we will check that here and if we found then the logic inside the + * while loop will not be executed */ + + end_of_mime = (AXIOM_MIME_BOUNDARY_BYTE == *(buf_array[buf_num])) && (AXIOM_MIME_BOUNDARY_BYTE + == *(buf_array[buf_num] + 1)); + if(end_of_mime) + { + AXIS2_FREE(env->allocator, buf_array[buf_num]); + buf_array[buf_num] = NULL; + } + + if(temp_mime_boundary) + { + AXIS2_FREE(env->allocator, temp_mime_boundary); + temp_mime_boundary = NULL; + } + + if(search_info) + { + AXIS2_FREE(env->allocator, search_info); + search_info = NULL; + } + + mime_parser->end_of_mime = end_of_mime; + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axutil_hash_t *AXIS2_CALL +axiom_mime_parser_parse_for_attachments( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK callback, + void *callback_ctx, + axis2_char_t * mime_boundary, + void *user_param) +{ + int count = 0; + axiom_search_info_t *search_info = NULL; + axis2_char_t *pos = NULL; + int part_start = 0; + axis2_char_t **buf_array = NULL; + size_t *len_array = NULL; + int buf_num = 0; + size_t size = 0; + size_t malloc_len = 0; + axis2_callback_info_t *callback_info = NULL; + axis2_char_t *temp_mime_boundary = NULL; + size_t temp_mime_boundary_size = 0; + axis2_bool_t end_of_mime = AXIS2_FALSE; + + callback_info = (axis2_callback_info_t *)callback_ctx; + + search_info = AXIS2_MALLOC(env->allocator, sizeof(axiom_search_info_t)); + + size = AXIOM_MIME_PARSER_BUFFER_SIZE * (mime_parser->buffer_size); + + buf_array = mime_parser->buf_array; + len_array = mime_parser->len_array; + buf_num = mime_parser->current_buf_num; + + /*<SOAP></SOAP>--MIMEBOUNDARY + mime_headr1:....... + mime_headr2:.... + + Binarstart................. + ...............--MIMEBOUNDARY + */ + + /* This loop will extract all the attachments in the message. The condition + * with the count is needed because if the sender not marked the end of the + * attachment wiht -- then this loop may run infinitely. To prevent that + * this additional condition has been put */ + + temp_mime_boundary = axutil_stracat(env, "--", mime_boundary); + temp_mime_boundary_size = strlen(mime_boundary) + 2; + + while((!(mime_parser->end_of_mime)) && count < AXIOM_MIME_PARSER_END_OF_MIME_MAX_COUNT) + { + /*First we will search for \r\n\r\n*/ + axis2_char_t *mime_id = NULL; + axis2_char_t *mime_type = NULL; + size_t mime_headers_len = 0; + size_t mime_binary_len = 0; + axis2_char_t *mime_binary = NULL; + axis2_char_t *mime_headers = NULL; + axis2_char_t *buffer = NULL; + int len = 0; + axis2_status_t status = AXIS2_FAILURE; + + search_info->match_len1 = 0; + search_info->match_len2 = 0; + pos = NULL; + part_start = buf_num; + + malloc_len = 0; + + count++; + + pos = axiom_mime_parser_search_for_crlf(env, callback, callback_ctx, &buf_num, len_array, + buf_array, search_info, size, mime_parser); + + if(!pos) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in parsing for mime."); + return NULL; + } + + /*The pattern contains in one buffer*/ + if(search_info->match_len2 == 0) + { + /*We found it . so lets seperates the details of this binary into + mime headers.*/ + + mime_headers_len = axiom_mime_parser_calculate_part_len(env, buf_num, len_array, + part_start, pos, buf_array[buf_num]); + if(mime_headers_len > 0) + { + mime_headers = axiom_mime_parser_create_part(env, mime_headers_len, buf_num, + len_array, part_start, pos, buf_array, mime_parser); + + if(!mime_headers) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in parsing for mime headers."); + return NULL; + } + malloc_len = buf_array[buf_num] + len_array[buf_num] - pos - 4; + + /*This should be > 0 , > 0 means there is some part to copy = 0 means + there is nothing to copy*/ + if(malloc_len < 0) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in parsing for mime headers"); + return NULL; + } + + else + { + buffer = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (size + 1)); + + if(malloc_len > 0) + { + memcpy(buffer, pos + 4, malloc_len); + } + + if(axiom_mime_parser_is_more_data(mime_parser, env, callback_info)) + { + len = callback(buffer + malloc_len,(int)(size - malloc_len),(void *)callback_ctx); + } + else + { + len = 0; + } + axiom_mime_parser_clear_buffers(env, buf_array, part_start, buf_num); + if(len >= 0) + { + buf_array[buf_num] = buffer; + len_array[buf_num] = malloc_len + len; + } + } + } + else + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in parsing for mime headers."); + return NULL; + } + } + + else if(search_info->match_len2 > 0) + { + /*Now we extract the mime headers */ + + mime_headers_len = axiom_mime_parser_calculate_part_len(env, buf_num - 1, len_array, + part_start, pos, buf_array[buf_num - 1]); + + if(mime_headers_len > 0) + { + mime_headers = axiom_mime_parser_create_part(env, mime_headers_len, buf_num - 1, + len_array, part_start, pos, buf_array, mime_parser); + if(!mime_headers) + { + return NULL; + } + + malloc_len = len_array[buf_num] - search_info->match_len2; + if(malloc_len < 0) + { + return NULL; + } + else + { + buffer = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (size + 1)); + + if(malloc_len > 0) + { + memcpy(buffer, buf_array[buf_num] + search_info->match_len2, malloc_len); + } + if(axiom_mime_parser_is_more_data(mime_parser, env, callback_info)) + { + len = callback(buffer + malloc_len,(int)(size - malloc_len),(void*)callback_ctx); + } + else + { + len = 0; + } + axiom_mime_parser_clear_buffers(env, buf_array, part_start, buf_num); + if(len >= 0) + { + buf_array[buf_num] = buffer; + len_array[buf_num] = malloc_len + len; + } + } + } + else + { + return NULL; + } + } + else + { + return NULL; + } + + pos = NULL; + + search_info->match_len1 = 0; + search_info->match_len2 = 0; + + part_start = buf_num; + malloc_len = 0; + + mime_type + = axiom_mime_parser_process_mime_headers(env, mime_parser, &mime_id, mime_headers); + + if(!mime_id) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "Error in parsing for mime headers.Mime id did not find"); + return NULL; + } + + if(!mime_type) + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Mime type did not find"); + } + + /*We extract the mime headers. So lets search for the attachment.*/ + + pos = axiom_mime_parser_search_for_attachment(mime_parser, env, callback, callback_ctx, + &buf_num, len_array, buf_array, search_info, size, temp_mime_boundary, mime_id, + user_param); + + if(pos) + { + /*If it is small we are not caching. Hence the attachment + is in memory. So store it in a buffer. */ + + if(!search_info->cached) + { + if(search_info->match_len2 == 0) + { + /* mime_binary contains the attachment when it does not + * cached */ + + mime_binary_len = axiom_mime_parser_calculate_part_len(env, buf_num, len_array, + part_start, pos, buf_array[buf_num]); + if(mime_binary_len > 0) + { + mime_binary = axiom_mime_parser_create_part(env, mime_binary_len, buf_num, + len_array, part_start, pos, buf_array, mime_parser); + if(!mime_binary) + { + return NULL; + } + } + else + { + return NULL; + } + } + + else if(search_info->match_len2 > 0) + { + mime_binary_len = axiom_mime_parser_calculate_part_len(env, buf_num - 1, + len_array, part_start, pos, buf_array[buf_num - 1]); + + if(mime_binary_len > 0) + { + mime_binary = axiom_mime_parser_create_part(env, mime_binary_len, buf_num + - 1, len_array, part_start, pos, buf_array, mime_parser); + if(!mime_binary) + { + return NULL; + } + } + else + { + return NULL; + } + } + } + + /* The functionality below is common when it is cached or not. It deals with remaining + * after a particualr attachment, Those may be related to a end of mime_boundary or + * another attachment */ + + if(search_info->match_len2 == 0) + { + malloc_len = len_array[buf_num] - search_info->match_len1 - temp_mime_boundary_size; + if(malloc_len < 0) + { + return NULL; + } + else + { + buffer = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (size + 1)); + + if(malloc_len > 0) + { + memcpy(buffer, pos + temp_mime_boundary_size, malloc_len); + } + + /*When the last buffer only containing -- we know this is the end + of the attachments. Hence we don't need to read again*/ + + if(malloc_len != 2) + { + if(axiom_mime_parser_is_more_data(mime_parser, env, callback_info)) + { + len = callback(buffer + malloc_len,(int)(size - malloc_len),(void*)callback_ctx); + } + else + { + len = 0; + } + if(len >= 0) + { + len_array[buf_num] = malloc_len + len; + } + } + + /* This means there is another attachment */ + else + { + len_array[buf_num] = malloc_len; + } + axiom_mime_parser_clear_buffers(env, buf_array, part_start, buf_num); + buf_array[buf_num] = buffer; + } + } + else if(search_info->match_len2 > 0) + { + malloc_len = len_array[buf_num] - search_info->match_len2; + + if(malloc_len < 0) + { + return NULL; + } + else + { + buffer = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (size + 1)); + + if(malloc_len > 0) + { + memcpy(buffer, buf_array[buf_num] + search_info->match_len2, malloc_len); + } + if(malloc_len != 2) + { + if(axiom_mime_parser_is_more_data(mime_parser, env, callback_info)) + { + len = callback(buffer + malloc_len,(int)(size - malloc_len),(void *)callback_ctx); + } + else + { + len = 0; + } + if(len >= 0) + { + len_array[buf_num] = malloc_len + len; + } + } + else + { + len_array[buf_num] = malloc_len; + } + axiom_mime_parser_clear_buffers(env, buf_array, part_start, buf_num); + buf_array[buf_num] = buffer; + } + } + } + else + { + return NULL; + } + + /*We have the attachment now either cached or not. So lets put it in the mime_parts + * hash map with the mime_id. Remember at this moment we have already processed the + * mime_headers and mime_id is already there */ + + /* In the case user has not specified the callback or the attachment dir . So we cached it to a memory + * buffer. Hence the data_handler type we need to create is different */ + + if((search_info->cached) && (!mime_parser->attachment_dir) && (!mime_parser->callback_name)) + { + mime_binary = (axis2_char_t *)search_info->handler; + mime_binary_len = search_info->binary_size; + } + + /* Storing the attachment in the hash map with the id*/ + + status = axiom_mime_parser_store_attachment(env, mime_parser, mime_id, mime_type, + mime_binary, mime_binary_len, search_info->cached); + + /*Check wether we encounter --MIMEBOUNDARY-- to find the end of mime*/ + + if(buf_array[buf_num]) + { + /* Here we check for the end of mime */ + + end_of_mime = (AXIOM_MIME_BOUNDARY_BYTE == *(buf_array[buf_num])) + && (AXIOM_MIME_BOUNDARY_BYTE == *(buf_array[buf_num] + 1)); + if(end_of_mime) + { + AXIS2_FREE(env->allocator, buf_array[buf_num]); + buf_array[buf_num] = NULL; + } + mime_parser->end_of_mime = end_of_mime; + } + + if(mime_headers) + { + AXIS2_FREE(env->allocator, mime_headers); + mime_headers = NULL; + } + + if(status != AXIS2_SUCCESS) + { + return NULL; + } + } + + /*Do the necessary cleaning */ + + /*if (buf_array) + { + AXIS2_FREE(env->allocator, buf_array); + buf_array = NULL; + } + + if (len_array) + { + AXIS2_FREE(env->allocator, len_array); + len_array = NULL; + }*/ + + if(temp_mime_boundary) + { + AXIS2_FREE(env->allocator, temp_mime_boundary); + temp_mime_boundary = NULL; + } + + if(search_info) + { + AXIS2_FREE(env->allocator, search_info); + search_info = NULL; + } + + return mime_parser->mime_parts_map; + +} + +/*This method will search for \r\n\r\n */ + +static axis2_char_t * +axiom_mime_parser_search_for_crlf( + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK callback, + void *callback_ctx, + int *buf_num, + size_t *len_array, + axis2_char_t **buf_array, + axiom_search_info_t *search_info, + size_t size, + axiom_mime_parser_t *mime_parser) +{ + axis2_char_t *found = NULL; + int len = 0; + + search_info->search_str = "\r\n\r\n"; + search_info->buffer1 = NULL; + search_info->buffer2 = NULL; + search_info->len1 = 0; + search_info->len2 = 0; + search_info->match_len1 = 0; + search_info->match_len2 = 0; + search_info->primary_search = AXIS2_FALSE; + search_info->cached = AXIS2_FALSE; + search_info->handler = NULL; + search_info->binary_size = 0; + + /*First do a search in the first buffer*/ + + if(buf_array[*buf_num]) + { + search_info->buffer1 = buf_array[*buf_num]; + search_info->len1 = len_array[*buf_num]; + found = axiom_mime_parser_search_string(search_info, env); + } + + while(!found) + { + /*Let's read another buffer and do a boundary search in both*/ + + *buf_num = *buf_num + 1; + buf_array[*buf_num] = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (size + 1)); + + if(buf_array[*buf_num]) + { + len = callback(buf_array[*buf_num], (int)size, (void *)callback_ctx); + } + if(len > 0) + { + len_array[*buf_num] = len; + search_info->buffer2 = buf_array[*buf_num]; + search_info->len2 = len; + found = axiom_mime_parser_search_string(search_info, env); + } + else + { + break; + } + if(!found) + { + /*Let's do a full search in the second buffer*/ + + search_info->buffer1 = buf_array[*buf_num]; + search_info->len1 = len_array[*buf_num]; + search_info->primary_search = AXIS2_FALSE; + search_info->buffer2 = NULL; + search_info->len2 = 0; + found = axiom_mime_parser_search_string(search_info, env); + } + } + + return found; +} + +/* This method will search for the mime_boundary after the SOAP part + * of the message */ + +static axis2_char_t * +axiom_mime_parser_search_for_soap( + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK callback, + void *callback_ctx, + int *buf_num, + size_t *len_array, + axis2_char_t **buf_array, + axiom_search_info_t *search_info, + size_t size, + axis2_char_t *mime_boundary, + axiom_mime_parser_t *mime_parser) +{ + axis2_char_t *found = NULL; + int len = 0; + + /* What we need to search is the mime_boundary */ + + search_info->search_str = mime_boundary; + search_info->buffer1 = NULL; + search_info->buffer2 = NULL; + search_info->len1 = 0; + search_info->len2 = 0; + search_info->match_len1 = 0; + search_info->match_len2 = 0; + search_info->primary_search = AXIS2_FALSE; + + if(buf_array[*buf_num]) + { + search_info->buffer1 = buf_array[*buf_num]; + search_info->len1 = len_array[*buf_num]; + found = axiom_mime_parser_search_string(search_info, env); + + /* Inside this search primary_search flag will be set to TRUE */ + } + + while(!found) + { + /* We need to create the second buffer and do the search for the + * mime_boundary in the both the buffers */ + + *buf_num = *buf_num + 1; + buf_array[*buf_num] = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (size + 1)); + + if(buf_array[*buf_num]) + { + len = callback(buf_array[*buf_num], (int)size, (void *)callback_ctx); + } + if(len > 0) + { + /* In this search we are matching end part of the first + * buffer and starting part of the previous buffer */ + len_array[*buf_num] = len; + search_info->buffer2 = buf_array[*buf_num]; + search_info->len2 = len; + found = axiom_mime_parser_search_string(search_info, env); + } + else + { + break; + } + if(!found) + { + search_info->buffer1 = buf_array[*buf_num]; + search_info->len1 = len_array[*buf_num]; + search_info->primary_search = AXIS2_FALSE; + search_info->buffer2 = NULL; + search_info->len2 = 0; + found = axiom_mime_parser_search_string(search_info, env); + } + } + + return found; +} + +/*The caching is done in this function. Caching happens when we did not + find the mime_boundary in initial two buffers. So the maximum size + that we are keeping in memory is 2 * size. This size can be configurable from + the aixs.xml. The caching may starts when the search failed with the + second buffer. + In this logic first we will search for a callback to cache. If it is not + there then we will search for a directory to save the file. If it is also + not there then the attachment will be in memory. + */ + +static axis2_char_t * +axiom_mime_parser_search_for_attachment( + axiom_mime_parser_t *mime_parser, + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK callback, + void *callback_ctx, + int *buf_num, + size_t *len_array, + axis2_char_t **buf_array, + axiom_search_info_t *search_info, + size_t size, + axis2_char_t *mime_boundary, + axis2_char_t *mime_id, + void *user_param) +{ + axis2_char_t *found = NULL; + int len = 0; + axis2_status_t status = AXIS2_FAILURE; + axis2_char_t *temp = NULL; + size_t temp_length = 0; + axis2_char_t *file_name = NULL; + + search_info->search_str = mime_boundary; + search_info->buffer1 = NULL; + search_info->buffer2 = NULL; + search_info->len1 = 0; + search_info->len2 = 0; + search_info->match_len1 = 0; + search_info->match_len2 = 0; + search_info->primary_search = AXIS2_FALSE; + search_info->cached = AXIS2_FALSE; + search_info->handler = NULL; + + /*First search in the incoming buffer*/ + + if(buf_array[*buf_num]) + { + search_info->buffer1 = buf_array[*buf_num]; + search_info->len1 = len_array[*buf_num]; + found = axiom_mime_parser_search_string(search_info, env); + } + + while(!found) + { + if(search_info->cached) + { + if(mime_parser->callback_name) + { + if(!(search_info->handler)) + { + /* If the callback is not loaded yet then we load it*/ + if(!mime_parser->mtom_caching_callback) + { + search_info->handler = axiom_mime_parser_initiate_callback(mime_parser, + env, mime_id, user_param); + if(!(search_info->handler)) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "Caching Callback is not loaded"); + return NULL; + } + } + } + /*So lets cache the previous buffer which has undergone the + full search and the partial search. */ + + if(mime_parser->mtom_caching_callback) + { + /* Caching callback is loaded. So we can cache the previous buffer */ + status + = AXIOM_MTOM_CACHING_CALLBACK_CACHE(mime_parser->mtom_caching_callback, + env, buf_array[*buf_num - 1], (int)len_array[*buf_num - 1], + search_info->handler); + } + } + + else if(mime_parser->attachment_dir) + { + if(!(search_info->handler)) + { + /* If the File is not opened yet we will open it*/ + + axis2_char_t *encoded_mime_id = NULL; + + /* Some times content-ids urls, hence we need to encode them + * becasue we can't create files with / */ + + encoded_mime_id = AXIS2_MALLOC(env->allocator, (sizeof(axis2_char_t)) + * (strlen(mime_id))); + memset(encoded_mime_id, 0, strlen(mime_id)); + encoded_mime_id = axutil_url_encode(env, encoded_mime_id, mime_id, (int)strlen( + mime_id)); + if(!encoded_mime_id) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Mime Id encoding failed"); + return NULL; + } + + file_name = axutil_stracat(env, mime_parser->attachment_dir, encoded_mime_id); + AXIS2_FREE(env->allocator, encoded_mime_id); + encoded_mime_id = NULL; + + if(!file_name) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Caching file name creation error"); + return NULL; + } + search_info->handler = (void *)fopen(file_name, "ab+"); + if(!(search_info->handler)) + { + return NULL; + } + } + + /*So lets cache the previous buffer which has undergone the + full search and the partial search. */ + + status = axiom_mime_parser_cache_to_file(env, buf_array[*buf_num - 1], + len_array[*buf_num - 1], search_info->handler); + } + + else + { + /* Here the user has not specified the caching File location. So we are + * not going to cache. Instead we store the attachment in the buffer */ + status = axiom_mime_parser_cache_to_buffer(env, buf_array[*buf_num - 1], + len_array[*buf_num - 1], search_info, mime_parser); + } + + if(status == AXIS2_FAILURE) + { + return NULL; + } + /*Here we interchange the buffers.*/ + + temp = buf_array[*buf_num - 1]; + buf_array[*buf_num - 1] = buf_array[*buf_num]; + buf_array[*buf_num] = temp; + temp_length = len_array[*buf_num - 1]; + len_array[*buf_num - 1] = len_array[*buf_num]; + len_array[*buf_num] = temp_length; + if(buf_array[*buf_num]) + { + /*The cached buffer is the one which get filled.*/ + len = callback(buf_array[*buf_num], (int)size, (void *)callback_ctx); + } + } + + /*Size of the data in memory not yet risen to the caching threasold + *So we can create the second buffer */ + else + { + *buf_num = *buf_num + 1; + buf_array[*buf_num] = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (size + 1)); + + if(buf_array[*buf_num]) + { + len = callback(buf_array[*buf_num], (int)size, (void *)callback_ctx); + } + } + + /*Doing a complete search in newly cretaed buffer*/ + + if(len > 0) + { + len_array[*buf_num] = len; + search_info->buffer2 = buf_array[*buf_num]; + search_info->len2 = len; + found = axiom_mime_parser_search_string(search_info, env); + } + else + { + break; + } + + /* Now there are two buffers. If the searching string is not + * here then we must cache the first buffer */ + + if(!found) + { + /*So now we must start caching*/ + search_info->buffer1 = buf_array[*buf_num]; + search_info->len1 = len_array[*buf_num]; + search_info->primary_search = AXIS2_FALSE; + search_info->buffer2 = NULL; + search_info->len2 = 0; + found = axiom_mime_parser_search_string(search_info, env); + if(!found) + { + /* So at the begining of the next search we start + * that only after caching this data */ + search_info->cached = AXIS2_TRUE; + } + } + } + + /* Here we are out of the loop. If there is no error then this means + * the searching string is found */ + if(search_info->cached && found) + { + /* If the attachment is cached then we need to cache the + * final buffer */ + + if(search_info->match_len2 == 0) + { + /* This is the case where we found the whole string in one buffer + * So we need to cache previous buffer and the data up to the starting + * point of the search string in the current buffer */ + + /* deduct last 2 CRLF character. + * For buffering case, it will be done when creating datahandler.*/ + + if(mime_parser->mtom_caching_callback) + { + status = AXIOM_MTOM_CACHING_CALLBACK_CACHE(mime_parser->mtom_caching_callback, env, + buf_array[*buf_num - 1], (int)len_array[*buf_num - 1], search_info->handler); + if(status == AXIS2_SUCCESS) + { + status + = AXIOM_MTOM_CACHING_CALLBACK_CACHE(mime_parser->mtom_caching_callback, + env, buf_array[*buf_num], (int)(found - buf_array[*buf_num] - 2), + search_info->handler); + } + } + + else if(mime_parser->attachment_dir) + { + status = axiom_mime_parser_cache_to_file(env, buf_array[*buf_num - 1], + len_array[*buf_num - 1], search_info->handler); + if(status == AXIS2_SUCCESS) + { + status = axiom_mime_parser_cache_to_file(env, buf_array[*buf_num], found + - buf_array[*buf_num] - 2, search_info->handler); + } + } + + /* If the callback or a file is not there then the data is appended to the buffer */ + + else + { + status = axiom_mime_parser_cache_to_buffer(env, buf_array[*buf_num - 1], + len_array[*buf_num - 1], search_info, mime_parser); + if(status == AXIS2_SUCCESS) + { + status = axiom_mime_parser_cache_to_buffer(env, buf_array[*buf_num], found + - buf_array[*buf_num], search_info, mime_parser); + } + } + } + else if(search_info->match_len2 > 0) + { + /*Here the curent buffer has partial mime boundary. So we need + to cache only the previous buffer. */ + + if(mime_parser->mtom_caching_callback) + { + status = AXIOM_MTOM_CACHING_CALLBACK_CACHE(mime_parser->mtom_caching_callback, env, + buf_array[*buf_num - 1], (int)(search_info->match_len1 - 2), search_info->handler); + } + + else if(mime_parser->attachment_dir) + { + status = axiom_mime_parser_cache_to_file(env, buf_array[*buf_num - 1], + search_info->match_len1 - 2, search_info->handler); + } + else + { + status = axiom_mime_parser_cache_to_buffer(env, buf_array[*buf_num - 1], + search_info->match_len1, search_info, mime_parser); + } + } + else + { + return NULL; + } + + if(status == AXIS2_FAILURE) + { + return NULL; + } + } + + /* Parsing is done so lets close the relative handlers */ + + if(search_info->handler) + { + if(mime_parser->mtom_caching_callback) + { + status = AXIOM_MTOM_CACHING_CALLBACK_CLOSE_HANDLER(mime_parser->mtom_caching_callback, + env, search_info->handler); + if(status == AXIS2_FAILURE) + { + return NULL; + } + } + + else if(mime_parser->attachment_dir) + { + if(fclose((FILE *)(search_info->handler)) == 0) + { + status = AXIS2_SUCCESS; + } + else + { + status = AXIS2_FAILURE; + } + + AXIS2_FREE(env->allocator, file_name); + file_name = NULL; + + if(status == AXIS2_FAILURE) + { + return NULL; + } + } + } + return found; +} + +/*following two functions are used to extract important information + from the buffer list. eg: SOAP, MIME_HEADERS*/ + +/*marker is the starting buffer of the required + part and pos is the end point of that part */ + +static size_t +axiom_mime_parser_calculate_part_len( + const axutil_env_t *env, + int buf_num, + size_t *len_list, + int marker, + axis2_char_t *pos, + axis2_char_t *buf) +{ + size_t part_len = 0; + int i = 0; + + for(i = marker; i < buf_num; i++) + { + part_len += len_list[i]; + } + + part_len = part_len + (pos - buf); + + return part_len; +} + +static axis2_char_t * +axiom_mime_parser_create_part( + const axutil_env_t *env, + size_t part_len, + int buf_num, + size_t *len_list, + int marker, + axis2_char_t *pos, + axis2_char_t **buf_list, + axiom_mime_parser_t *mime_parser) +{ + /*We will copy the set of buffers which contains the required part. + This part can be the SOAP message , mime headers or the mime + binary in the case of none cahced.*/ + + axis2_char_t *part_str = NULL; + int i = 0; + size_t temp = 0; + + part_str = AXIS2_MALLOC(env->allocator, sizeof(char) * (part_len + 1)); + + if(!part_str) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Failed in creating buffer"); + return NULL; + } + + /* Copy from the part starting buffer to the + * curent buffer */ + + for(i = marker; i < buf_num; i++) + { + if(buf_list[i]) + { + memcpy(part_str + temp, buf_list[i], len_list[i]); + temp += len_list[i]; + } + } + /* Finally we are copying from the final portion */ + + memcpy(part_str + temp, buf_list[i], pos - buf_list[i]); + + part_str[part_len] = '\0'; + + return part_str; +} + +AXIS2_EXTERN axutil_hash_t *AXIS2_CALL +axiom_mime_parser_get_mime_parts_map( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env) +{ + return mime_parser->mime_parts_map; +} + +AXIS2_EXTERN size_t AXIS2_CALL +axiom_mime_parser_get_soap_body_len( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env) +{ + return mime_parser->soap_body_len; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_mime_parser_get_soap_body_str( + axiom_mime_parser_t * mime_parser, + const axutil_env_t * env) +{ + return mime_parser->soap_body_str; +} + +/*This is the new search function. This will first do a + search for the entire search string.Then will do a search + for the partial string which can be divided among two buffers.*/ + +static axis2_char_t * +axiom_mime_parser_search_string( + axiom_search_info_t *search_info, + const axutil_env_t *env) +{ + axis2_char_t *pos = NULL; + axis2_char_t *old_pos = NULL; + axis2_char_t *found = NULL; + size_t str_length = 0; + size_t search_length = 0; + + str_length = strlen(search_info->search_str); + + /*First lets search the entire buffer*/ + if(!search_info->primary_search) + { + old_pos = search_info->buffer1; + + do + { + /*find the first byte. We need to adhere to this + approach rather than straightaway using strstr + because the buffer1 can be containg binary data*/ + + pos = NULL; + + search_length = search_info->buffer1 + search_info->len1 - old_pos - str_length + 1; + + if(search_length < 0) + { + break; + } + + if(old_pos) + { + pos = memchr(old_pos, *(search_info->search_str), search_length); + } + + /* found it so lets check the remaining */ + + if(pos) + { + found = axutil_strstr(pos, search_info->search_str); + if(found) + { + search_info->match_len1 = found - search_info->buffer1; + break; + } + else + { + old_pos = pos + 1; + } + } + } + while(pos); + } + + search_info->primary_search = AXIS2_TRUE; + + if(found) + { + return found; + } + + /*So we didn't find the string in the buffer + lets check whether it is divided in two buffers*/ + + else + { + size_t offset = 0; + pos = NULL; + old_pos = NULL; + found = NULL; + search_length = 0; + + if(search_info->buffer2) + { + old_pos = search_info->buffer1 + search_info->len1 - str_length + 1; + do + { + /*First check the starting byte*/ + pos = NULL; + found = NULL; + + search_length = search_info->buffer1 + search_info->len1 - old_pos; + + if(search_length < 0) + { + break; + } + + pos = memchr(old_pos, *(search_info->search_str), search_length); + + if(pos) + { + offset = search_info->buffer1 + search_info->len1 - pos; + + /*First match the beginng to offset in buffer1*/ + + if(offset > 0) + { + if(memcmp(pos, search_info->search_str, offset) == 0) + { + found = pos; + } + + /*We found something in buffer1 so lets match the + remaining in buffer2*/ + + if(found) + { + if(memcmp(search_info->buffer2, search_info->search_str + offset, + str_length - offset) == 0) + { + search_info->match_len2 = str_length - offset; + search_info->match_len1 = found - search_info->buffer1; + break; + } + else + { + old_pos = pos + 1; + } + } + else + { + old_pos = pos + 1; + } + } + } + } + while(pos); + + /* We will set this to AXIS2_FALSE so when the next time this + * search method is called it will do a full search first for buffer1 */ + search_info->primary_search = AXIS2_FALSE; + + return found; + } + else + { + return NULL; + } + } +} + +/* This method creates a data_handler out of the attachment + * and store the data_handler in the mime_parts map */ + +static axis2_status_t +axiom_mime_parser_store_attachment( + const axutil_env_t *env, + axiom_mime_parser_t *mime_parser, + axis2_char_t *mime_id, + axis2_char_t *mime_type, + axis2_char_t *mime_binary, + size_t mime_binary_len, + axis2_bool_t cached) +{ + if(mime_parser->mime_parts_map) + { + if(mime_id) + { + axiom_data_handler_t *data_handler = NULL; + + /* Handling the case where attachment is cached using a callback */ + + if(mime_parser->callback_name && cached) + { + data_handler = axiom_data_handler_create(env, NULL, mime_type); + if(data_handler) + { + axiom_data_handler_set_cached(data_handler, env, AXIS2_TRUE); + axiom_data_handler_set_data_handler_type(data_handler, env, + AXIOM_DATA_HANDLER_TYPE_CALLBACK); + } + } + + /* Handling the case where attachment is cached to a file*/ + + else if(mime_parser->attachment_dir && cached) + { + axis2_char_t *attachment_location = NULL; + axis2_char_t *encoded_mime_id = NULL; + + /* Some times content-ids urls, hence we need to encode them + * becasue we can't create files with / */ + + encoded_mime_id = AXIS2_MALLOC(env->allocator, (sizeof(axis2_char_t)) * (strlen( + mime_id))); + memset(encoded_mime_id, 0, strlen(mime_id)); + encoded_mime_id = axutil_url_encode( + env, encoded_mime_id, mime_id, (int)strlen(mime_id)); + if(!encoded_mime_id) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Mime Id encoding failed"); + return AXIS2_FAILURE; + } + + attachment_location = axutil_stracat(env, mime_parser->attachment_dir, + encoded_mime_id); + + AXIS2_FREE(env->allocator, encoded_mime_id); + encoded_mime_id = NULL; + + if(attachment_location) + { + + data_handler = axiom_data_handler_create(env, attachment_location, mime_type); + if(data_handler) + { + axiom_data_handler_set_cached(data_handler, env, AXIS2_TRUE); + + } + AXIS2_FREE(env->allocator, attachment_location); + attachment_location = NULL; + } + } + + /* Attachment is in memory, either it is small to be cached or + * user does not provided the attachment cached directory */ + + else if(mime_binary) + { + data_handler = axiom_data_handler_create(env, NULL, mime_type); + if(data_handler) + { + axiom_data_handler_set_binary_data(data_handler, env, mime_binary, + mime_binary_len - 2); + } + } + axiom_data_handler_set_mime_id(data_handler, env, mime_id); + + axutil_hash_set(mime_parser->mime_parts_map, mime_id, AXIS2_HASH_KEY_STRING, + data_handler); + if(mime_type) + { + AXIS2_FREE(env->allocator, mime_type); + } + } + else + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Mime Id or Mime rype not found"); + return AXIS2_FAILURE; + /*axis2_char_t temp_boundry[1024]; + sprintf(temp_boundry, "--%s--", mime_boundary); + if (body_mime && axutil_strstr(body_mime, temp_boundry)) + { + break; + }*/ + } + return AXIS2_SUCCESS; + } + else + { + return AXIS2_FAILURE; + } +} + +/* This method will process the mime_headers for a particualr + attacment and return the mime_id */ + +static axis2_char_t * +axiom_mime_parser_process_mime_headers( + const axutil_env_t *env, + axiom_mime_parser_t *mime_parser, + axis2_char_t **mime_id, + axis2_char_t *mime_headers) +{ + axis2_char_t *id = NULL; + axis2_char_t *type = NULL; + axis2_char_t *pos = NULL; + + /* Get the MIME ID */ + if(mime_headers) + { + id = axutil_strcasestr(mime_headers, AXIOM_MIME_HEADER_CONTENT_ID); + type = axutil_strcasestr(mime_headers, AXIOM_MIME_HEADER_CONTENT_TYPE); + if(type) + { + axis2_char_t *end = NULL; + axis2_char_t *temp_type = NULL; + type += axutil_strlen(AXIOM_MIME_HEADER_CONTENT_TYPE); + while(type && *type && *type != ':') + { + type++; + } + type++; + while(type && *type && *type == ' ') + { + type++; + } + end = type; + while(end && *end && !isspace((int)*end)) + { + end++; + } + if((end - type) > 0) + { + temp_type = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * ((end - type) + 1)); + if(!temp_type) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "No memory. Failed in creating Content-Type"); + return NULL; + } + memcpy(temp_type, type, (end - type)); + temp_type[end - type] = '\0'; + type = temp_type; + } + } + if(id) + { + id += axutil_strlen(AXIOM_MIME_HEADER_CONTENT_ID); + while(id && *id && *id != ':') + { + id++; + } + if(id) + { + while(id && *id && *id != '<') + { + id++; + } + id++; + pos = axutil_strstr(id, ">"); + if(pos) + { + int mime_id_len = 0; + mime_id_len = (int)(pos - id); + *mime_id = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * mime_id_len + 1); + /* The MIME ID will be freed by the SOAP builder */ + if(*mime_id) + { + memcpy(*mime_id, id, mime_id_len); + (*mime_id)[mime_id_len] = '\0'; + } + else + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "No memory. Failed in creating MIME ID"); + return NULL; + } + } + } + } + else + { + /*axis2_char_t temp_boundry[1024]; + sprintf(temp_boundry, "--%s--", mime_boundary); + if (body_mime && axutil_strstr(body_mime, temp_boundry)) + { + break; + }*/ + return NULL; + } + return type; + } + else + { + return NULL; + } +} + +/*This is used to free some unwanted buffers. For example we did + not want the buffers which contains the data before the soap + envelope starts. */ + +static void +axiom_mime_parser_clear_buffers( + const axutil_env_t *env, + axis2_char_t **buf_list, + int free_from, + int free_to) +{ + int i = 0; + + for(i = free_from; i <= free_to; i++) + { + if(buf_list[i]) + { + AXIS2_FREE(env->allocator, buf_list[i]); + buf_list[i] = NULL; + } + } + return; +} + +/* Instead of caching to a file this method will cache it + * to a buffer */ + +static axis2_status_t +axiom_mime_parser_cache_to_buffer( + const axutil_env_t *env, + axis2_char_t *buf, + size_t buf_len, + axiom_search_info_t *search_info, + axiom_mime_parser_t *mime_parser) +{ + axis2_char_t *data_buffer = NULL; + axis2_char_t *temp_buf = NULL; + size_t mime_binary_len = 0; + + temp_buf = (axis2_char_t *)search_info->handler; + mime_binary_len = search_info->binary_size + buf_len; + + if(mime_binary_len > 0) + { + data_buffer = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (mime_binary_len)); + + if(data_buffer) + { + if(temp_buf && search_info->binary_size > 0) + { + memcpy(data_buffer, temp_buf, search_info->binary_size); + AXIS2_FREE(env->allocator, temp_buf); + temp_buf = NULL; + } + memcpy(data_buffer + (search_info->binary_size), buf, buf_len); + search_info->binary_size = mime_binary_len; + search_info->handler = (void *)data_buffer; + + return AXIS2_SUCCESS; + } + else + { + return AXIS2_FAILURE; + } + } + else + { + return AXIS2_FAILURE; + } +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_mime_parser_set_buffer_size( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env, + int size) +{ + mime_parser->buffer_size = size; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_mime_parser_set_max_buffers( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env, + int num) +{ + mime_parser->max_buffers = num; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_mime_parser_set_attachment_dir( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env, + axis2_char_t *attachment_dir) +{ + mime_parser->attachment_dir = attachment_dir; +} + +/* Set the path of the caching callnack to be loaded */ + +AXIS2_EXTERN void AXIS2_CALL +axiom_mime_parser_set_caching_callback_name( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env, + axis2_char_t *callback_name) +{ + mime_parser->callback_name = callback_name; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_mime_parser_set_mime_boundary( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env, + axis2_char_t *mime_boundary) +{ + mime_parser->mime_boundary = mime_boundary; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_mime_parser_get_mime_boundary( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env) +{ + return mime_parser->mime_boundary; +} + +/* Load the caching callback dll */ + +static void* +axiom_mime_parser_initiate_callback( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env, + axis2_char_t *mime_id, + void *user_param) +{ + axutil_dll_desc_t *dll_desc = NULL; + axutil_param_t *impl_info_param = NULL; + void *ptr = NULL; + + if(mime_parser->callback_name) + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Trying to load module = %s", + mime_parser->callback_name); + dll_desc = axutil_dll_desc_create(env); + axutil_dll_desc_set_name(dll_desc, env, mime_parser->callback_name); + impl_info_param = axutil_param_create(env, NULL, dll_desc); + /*Set the free function*/ + axutil_param_set_value_free(impl_info_param, env, axutil_dll_desc_free_void_arg); + axutil_class_loader_init(env); + ptr = axutil_class_loader_create_dll(env, impl_info_param); + + if(!ptr) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Unable to load the module %s. ERROR", + mime_parser->callback_name); + return NULL; + } + + mime_parser->mtom_caching_callback = (axiom_mtom_caching_callback_t *)ptr; + mime_parser->mtom_caching_callback->param = impl_info_param; + mime_parser->mtom_caching_callback->user_param = user_param; + + return AXIOM_MTOM_CACHING_CALLBACK_INIT_HANDLER(mime_parser->mtom_caching_callback, env, + mime_id); + } + + else + { + return NULL; + } + +} + +/* This method will tell whether there are more data in the + * stream */ + +static axis2_bool_t +axiom_mime_parser_is_more_data( + axiom_mime_parser_t *mime_parser, + const axutil_env_t *env, + axis2_callback_info_t *callback_info) +{ + /* In the case of axutil_http_chunked stream it is the + * end of chunk */ + + if(callback_info->chunked_stream) + { + if(axutil_http_chunked_stream_get_end_of_chunks(callback_info->chunked_stream, env)) + { + return AXIS2_FALSE; + } + else + { + return AXIS2_TRUE; + } + } + + /* When we are using content length or any wrapped + * stream it will be the unread_length */ + + else if(callback_info->unread_len == 0) + { + return AXIS2_FALSE; + } + else + { + return AXIS2_TRUE; + } +} + +static axis2_status_t +axiom_mime_parser_cache_to_file( + const axutil_env_t* env, + axis2_char_t *buf, + size_t buf_len, + void *handler) +{ + size_t len = 0; + FILE *fp = NULL; + + fp = (FILE *)handler; + + len = fwrite(buf, 1, buf_len, fp); + if(len < 0) + { + return AXIS2_FAILURE; + } + else + { + return AXIS2_SUCCESS; + } +} + diff --git a/axiom/src/attachments/mime_part.c b/axiom/src/attachments/mime_part.c new file mode 100644 index 0000000..8343327 --- /dev/null +++ b/axiom/src/attachments/mime_part.c @@ -0,0 +1,535 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_mime_part.h> +#include <axiom_data_handler.h> +#include "axiom_mime_body_part.h" +#include <axutil_string.h> +#include <axiom_text.h> +#include <axiom_mime_const.h> + + +static axis2_status_t +axiom_mime_part_write_body_part_to_list( + const axutil_env_t *env, + axutil_array_list_t *list, + axiom_mime_body_part_t *part, + axis2_char_t *boundary); + +static axis2_status_t +axiom_mime_part_write_mime_boundary( + const axutil_env_t *env, + axutil_array_list_t *list, + axis2_char_t *boundary); + +static axis2_status_t +axiom_mime_part_finish_adding_parts( + const axutil_env_t *env, + axutil_array_list_t *list, + axis2_char_t *boundary); + +/* This method will create a mime_part + * A mime part will encapsulate a buffer + * a file or a callback to load the attachment + which needs to be send */ + +AXIS2_EXTERN axiom_mime_part_t *AXIS2_CALL +axiom_mime_part_create( + const axutil_env_t *env) +{ + axiom_mime_part_t *mime_part = NULL; + mime_part = AXIS2_MALLOC(env->allocator, sizeof(axiom_mime_part_t)); + + if(mime_part) + { + mime_part->part = NULL; + mime_part->file_name = NULL; + mime_part->part_size = 0; + mime_part->type = AXIOM_MIME_PART_UNKNOWN; + mime_part->user_param = NULL; + + return mime_part; + } + else + { + return NULL; + } +} + +/* Frees the mime_part */ + +AXIS2_EXTERN void AXIS2_CALL +axiom_mime_part_free( + axiom_mime_part_t *mime_part, + const axutil_env_t *env) +{ + if(mime_part) + { + if(mime_part->type == AXIOM_MIME_PART_BUFFER) + { + if(mime_part->part) + { + AXIS2_FREE(env->allocator, mime_part->part); + mime_part->part = NULL; + } + } + else if(mime_part->type == AXIOM_MIME_PART_FILE) + { + if(mime_part->file_name) + { + AXIS2_FREE(env->allocator, mime_part->file_name); + mime_part->file_name = NULL; + } + } + + AXIS2_FREE(env->allocator, mime_part); + mime_part = NULL; + } + return; +} + +/* This method will create a mime_boundary buffer + * and based on the buffer creates a mime_part. + * This will be added to the array_list so later in the trasnport + * this can be put to the wire. */ + +static axis2_status_t +axiom_mime_part_write_mime_boundary( + const axutil_env_t *env, + axutil_array_list_t *list, + axis2_char_t *boundary) +{ + axis2_byte_t *byte_buffer = NULL; + axis2_byte_t *byte_stream = NULL; + int size = 0; + axiom_mime_part_t *boundary_part = NULL; + + boundary_part = axiom_mime_part_create(env); + + byte_buffer = (axis2_byte_t *)boundary; + size = axutil_strlen(boundary); + + byte_stream = AXIS2_MALLOC(env->allocator, (size + 2) * sizeof(axis2_byte_t)); + if(!byte_stream) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create byte stream"); + return AXIS2_FAILURE; + } + + /* Mime boundary is always in the following form + --MimeBoundary */ + + byte_stream[0] = AXIOM_MIME_BOUNDARY_BYTE; + byte_stream[1] = AXIOM_MIME_BOUNDARY_BYTE; + + memcpy(byte_stream + 2, byte_buffer, size); + + boundary_part->part = byte_stream; + boundary_part->part_size = size + 2; + boundary_part->type = AXIOM_MIME_PART_BUFFER; + + axutil_array_list_add(list, env, boundary_part); + + return AXIS2_SUCCESS; +} + +/* This method will add the attachment file related information + to the list. It will create a mime_part from those information + and add to the list. If there are not data_handlers in the mime_body + then this method just add the headers. */ + +static axis2_status_t +axiom_mime_part_write_body_part_to_list( + const axutil_env_t *env, + axutil_array_list_t *list, + axiom_mime_body_part_t *part, + axis2_char_t *boundary) +{ + axiom_mime_part_t *crlf1 = NULL; + axiom_mime_part_t *crlf2 = NULL; + axis2_status_t status = AXIS2_SUCCESS; + + /* We are adding accoarding to the following format here. + * --MimeBoundary + * mime_header1 + * mime_header2 + * mime_header3 */ + + status = axiom_mime_part_write_mime_boundary(env, list, boundary); + + if(status != AXIS2_SUCCESS) + { + return status; + } + + /* Then we will add the new line charator after + * the mime_boundary */ + + crlf1 = axiom_mime_part_create(env); + + crlf1->part = (axis2_byte_t *)axutil_strdup(env, AXIS2_CRLF); + crlf1->part_size = 2; + crlf1->type = AXIOM_MIME_PART_BUFFER; + + axutil_array_list_add(list, env, crlf1); + + /*This method will fill the list with mime_headers and + *if there is an attachment with attachment details*/ + + axiom_mime_body_part_write_to_list(part, env, list); + + /* Then add the next \r\n after the attachment */ + + crlf2 = axiom_mime_part_create(env); + + crlf2->part = (axis2_byte_t *)axutil_strdup(env, AXIS2_CRLF); + crlf2->part_size = 2; + crlf2->type = AXIOM_MIME_PART_BUFFER; + + axutil_array_list_add(list, env, crlf2); + + return AXIS2_SUCCESS; +} + +/* This methos will add the final mime_boundary + * It is in --MimeBoundary-- format */ + +static axis2_status_t +axiom_mime_part_finish_adding_parts( + const axutil_env_t *env, + axutil_array_list_t *list, + axis2_char_t *boundary) +{ + axis2_byte_t *byte_buffer = NULL; + axis2_byte_t *byte_stream = NULL; + int size = 0; + axiom_mime_part_t *final_part = NULL; + + size = axutil_strlen(boundary); + byte_buffer = (axis2_byte_t *)boundary; + + /* There is -- before and after so the length of the + * actual part is mime_boundary_len + 4 */ + + byte_stream = AXIS2_MALLOC(env->allocator, (size + 4) * sizeof(axis2_byte_t)); + if(!byte_stream) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create byte stream"); + return AXIS2_FAILURE; + } + + /* Adding the starting -- */ + + byte_stream[0] = AXIOM_MIME_BOUNDARY_BYTE; + byte_stream[1] = AXIOM_MIME_BOUNDARY_BYTE; + if(byte_buffer) + { + memcpy(byte_stream + 2, byte_buffer, size); + } + else + { + AXIS2_LOG_WARNING(env->log, AXIS2_LOG_SI, "Byte buffer not available for writing"); + } + + /* Adding the final -- */ + + byte_stream[size + 2] = AXIOM_MIME_BOUNDARY_BYTE; + byte_stream[size + 3] = AXIOM_MIME_BOUNDARY_BYTE; + + /* Now we add this as an mime_part to + * the list. */ + + final_part = axiom_mime_part_create(env); + + if(!final_part) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create final_part"); + return AXIS2_FAILURE; + } + + final_part->part = byte_stream; + final_part->part_size = size + 4; + final_part->type = AXIOM_MIME_PART_BUFFER; + + axutil_array_list_add(list, env, final_part); + + return AXIS2_SUCCESS; +} + +/* This is the method which creates the content-type string + which is in the HTTP header or in mime_headers*/ + +AXIS2_EXTERN const axis2_char_t *AXIS2_CALL +axiom_mime_part_get_content_type_for_mime( + const axutil_env_t *env, + axis2_char_t *boundary, + axis2_char_t *content_id, + axis2_char_t *char_set_encoding, + const axis2_char_t *soap_content_type) +{ + axis2_char_t *content_type_string = NULL; + axis2_char_t *temp_content_type_string = NULL; + + content_type_string = axutil_strdup(env, AXIOM_MIME_TYPE_MULTIPART_RELATED); + if(!content_type_string) + { + AXIS2_LOG_WARNING(env->log, AXIS2_LOG_SI, "Creation of Content-Type string failed"); + return NULL; + } + temp_content_type_string = axutil_stracat(env, content_type_string, "; "); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + if(boundary) + { + temp_content_type_string = + axutil_stracat(env, content_type_string, + AXIOM_MIME_HEADER_FIELD_BOUNDARY "="); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + temp_content_type_string = axutil_stracat(env, content_type_string, boundary); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + temp_content_type_string = axutil_stracat(env, content_type_string, "; "); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + } temp_content_type_string = + axutil_stracat(env, content_type_string, + AXIOM_MIME_HEADER_FIELD_TYPE "=\"" AXIOM_MIME_TYPE_XOP_XML "\""); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + temp_content_type_string = axutil_stracat(env, content_type_string, "; "); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + if(content_id) + { + temp_content_type_string = + axutil_stracat(env, content_type_string, + AXIOM_MIME_HEADER_FIELD_START "=\"<"); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + temp_content_type_string = axutil_stracat(env, content_type_string, content_id); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + temp_content_type_string = axutil_stracat(env, content_type_string, ">\""); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + temp_content_type_string = axutil_stracat(env, content_type_string, "; "); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + } + if(soap_content_type) + { + temp_content_type_string = + axutil_stracat(env, content_type_string, + AXIOM_MIME_HEADER_FIELD_START_INFO "=\""); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + temp_content_type_string = axutil_stracat(env, content_type_string, soap_content_type); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + temp_content_type_string = axutil_stracat(env, content_type_string, "\"; "); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + } + if(char_set_encoding) + { + temp_content_type_string = + axutil_stracat(env, content_type_string, + AXIOM_MIME_HEADER_FIELD_CHARSET "=\""); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + temp_content_type_string = axutil_stracat(env, content_type_string, char_set_encoding); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + temp_content_type_string = axutil_stracat(env, content_type_string, "\""); + AXIS2_FREE(env->allocator, content_type_string); + content_type_string = temp_content_type_string; + } + + return content_type_string; +} + +/* This method is the core of attachment sending + * part. It will build each and every part and put them in + * an array_list. Instead of a big buffer we pass the array_list + * with small buffers and attachment locations. */ + +AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL +axiom_mime_part_create_part_list( + const axutil_env_t *env, + axis2_char_t *soap_body, + axutil_array_list_t *binary_node_list, + axis2_char_t *boundary, + axis2_char_t *content_id, + axis2_char_t *char_set_encoding, + const axis2_char_t *soap_content_type) +{ + axis2_status_t status = AXIS2_FAILURE; + axis2_char_t *header_value = NULL; + axis2_char_t *temp_header_value = NULL; + axis2_char_t *content_id_string = NULL; + axis2_char_t *temp_content_id_string = NULL; + axiom_mime_body_part_t *root_mime_body_part = NULL; + axis2_char_t *soap_body_buffer = NULL; + axutil_array_list_t *part_list = NULL; + axiom_mime_part_t *soap_part = NULL; + + part_list = axutil_array_list_create(env, 0); + + if(!part_list) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create part list array"); + return NULL; + } + + /* This mime_body part just keeps the mime_headers of the + * SOAP part. Since it is not created from an axiom_text + * this will not contain an attachment*/ + + root_mime_body_part = axiom_mime_body_part_create(env); + + if(!root_mime_body_part) + { + return NULL; + } + + /* In order to understand the following code which creates + * mime_headers go through the code with a sample mtom message */ + + /* Adding Content-Type Header */ + header_value = axutil_strdup(env, AXIOM_MIME_TYPE_XOP_XML + ";" AXIOM_MIME_HEADER_FIELD_CHARSET "="); + temp_header_value = axutil_stracat(env, header_value, char_set_encoding); + AXIS2_FREE(env->allocator, header_value); + header_value = temp_header_value; + temp_header_value = axutil_stracat(env, header_value, ";" + AXIOM_MIME_HEADER_FIELD_TYPE "=\""); + AXIS2_FREE(env->allocator, header_value); + header_value = temp_header_value; + temp_header_value = axutil_stracat(env, header_value, soap_content_type); + AXIS2_FREE(env->allocator, header_value); + header_value = temp_header_value; + temp_header_value = axutil_stracat(env, header_value, "\";"); + AXIS2_FREE(env->allocator, header_value); + header_value = temp_header_value; + AXIOM_MIME_BODY_PART_ADD_HEADER(root_mime_body_part, env, AXIOM_MIME_HEADER_CONTENT_TYPE, + header_value); + + /* Adding Content Transfer Encoding header */ + + AXIOM_MIME_BODY_PART_ADD_HEADER(root_mime_body_part, env, + AXIOM_MIME_HEADER_CONTENT_TRANSFER_ENCODING, axutil_strdup(env, + AXIOM_MIME_CONTENT_TRANSFER_ENCODING_BINARY)); + + /* Adding Content ID header */ + + content_id_string = (axis2_char_t *)"<"; + content_id_string = axutil_stracat(env, content_id_string, content_id); + temp_content_id_string = axutil_stracat(env, content_id_string, ">"); + AXIS2_FREE(env->allocator, content_id_string); + content_id_string = temp_content_id_string; + AXIOM_MIME_BODY_PART_ADD_HEADER(root_mime_body_part, env, AXIOM_MIME_HEADER_CONTENT_ID, + content_id_string); + + /* Now first insert the headers needed for SOAP */ + + /* After calling this method we have mime_headers of the SOAP envelope + * as a mime_part in the array_list */ + + status = axiom_mime_part_write_body_part_to_list(env, part_list, root_mime_body_part, boundary); + + if(status == AXIS2_FAILURE) + { + return NULL; + } + + /* Now add the SOAP body */ + + AXIOM_MIME_BODY_PART_FREE(root_mime_body_part, env); + root_mime_body_part = NULL; + + soap_part = axiom_mime_part_create(env); + + if(!soap_part) + { + return NULL; + } + + /* The atachment's mime_boundary will start after a new line charator */ + + soap_body_buffer = axutil_stracat(env, soap_body, AXIS2_CRLF); + + soap_part->part = (axis2_byte_t *)soap_body_buffer; + soap_part->part_size = (int)axutil_strlen(soap_body_buffer); + soap_part->type = AXIOM_MIME_PART_BUFFER; + + axutil_array_list_add(part_list, env, soap_part); + + /* Now we need to add each binary attachment to the array_list */ + + if(binary_node_list) + { + int j = 0; + for(j = 0; j < axutil_array_list_size(binary_node_list, env); j++) + { + /* Getting each attachment text node from the node list */ + + axiom_text_t *text = (axiom_text_t *)axutil_array_list_get(binary_node_list, env, j); + if(text) + { + axiom_mime_body_part_t *mime_body_part = NULL; + mime_body_part = axiom_mime_body_part_create_from_om_text(env, text); + + /* Let's fill the mime_part arraylist with attachment data*/ + if(!mime_body_part) + { + return NULL; + } + + /* This call will create mime_headers for the attachment and put + * them to the array_list. Then put the attachment file_name to the + * list */ + + status = axiom_mime_part_write_body_part_to_list(env, part_list, mime_body_part, + boundary); + + if(status == AXIS2_FAILURE) + { + return NULL; + } + + AXIOM_MIME_BODY_PART_FREE(mime_body_part, env); + mime_body_part = NULL; + } + } + } + + /* Now we have the SOAP message, all the attachments and headers are added to the list. + * So let's add the final mime_boundary with -- at the end */ + + status = axiom_mime_part_finish_adding_parts(env, part_list, boundary); + if(status == AXIS2_FAILURE) + { + return NULL; + } + return part_list; +} + diff --git a/axiom/src/om/Makefile.am b/axiom/src/om/Makefile.am new file mode 100644 index 0000000..40db6c5 --- /dev/null +++ b/axiom/src/om/Makefile.am @@ -0,0 +1,35 @@ +lib_LTLIBRARIES = libaxis2_axiom.la +libaxis2_axiom_la_SOURCES = om_attribute.c \ + om_document.c \ + om_node.c \ + om_text.c \ + om_data_source.c \ + om_comment.c \ + om_element.c \ + om_output.c \ + om_doctype.c \ + om_namespace.c \ + om_processing_instruction.c \ + om_stax_builder.c \ + om_children_iterator.c \ + om_children_qname_iterator.c \ + om_child_element_iterator.c \ + om_children_with_specific_attribute_iterator.c \ + om_navigator.c + +libaxis2_axiom_la_LIBADD = $(top_builddir)/src/soap/libaxis2_soap.la \ + $(top_builddir)/src/attachments/libaxis2_attachments.la \ + $(top_builddir)/src/util/libaxis2_axiom_util.la \ + ../parser/${WRAPPER_DIR}/libaxis2_parser.la \ + ../../../util/src/libaxutil.la + +libaxis2_axiom_la_LDFLAGS = -version-info $(VERSION_NO) + +INCLUDES = -I$(top_builddir)/include \ + -I$(top_builddir)/src/parser \ + -I$(top_builddir)/src/om \ + -I$(top_builddir)/src/attachments \ + -I ../../../util/include + +EXTRA_DIST = axiom_namespace_internal.h axiom_node_internal.h axiom_stax_builder_internal.h + diff --git a/axiom/src/om/axiom_namespace_internal.h b/axiom/src/om/axiom_namespace_internal.h new file mode 100644 index 0000000..833de7f --- /dev/null +++ b/axiom/src/om/axiom_namespace_internal.h @@ -0,0 +1,46 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_NAMESPACE_INTERNAL_H +#define AXIOM_NAMESPACE_INTERNAL_H + +/** @defgroup axiom AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_namespace.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_namespace_set_uri( + axiom_namespace_t * ns, + const axutil_env_t * env, + const axis2_char_t * ns_uri); + +#ifdef __cplusplus +} +#endif + +#endif /** AXIOM_NAMESPACE_H */ diff --git a/axiom/src/om/axiom_node_internal.h b/axiom/src/om/axiom_node_internal.h new file mode 100644 index 0000000..6e9adb4 --- /dev/null +++ b/axiom/src/om/axiom_node_internal.h @@ -0,0 +1,165 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_NODE_INTERNAL_H +#define AXIOM_NODE_INTERNAL_H + +/** @defgroup axiom AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_node.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_node OM Node + * @ingroup axiom + * @{ + */ + struct axiom_document; + struct axiom_stax_builder; + + /** + * Sets a parent node to a given node, if a parent already exist for this node + * then it is detached before seting the parent internal function; + * @param om_node child node to whom a parent to be added. , cannot be NULL. + * @param env Environment. MUST NOT be NULL, . + * @param parent_node the node that will be set as parent. , cannot be NULL. + * @return satus of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_set_parent( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * parent); + + /** + * Sets a node as first child of om_node + * @param om_node om_node + * @param env environment, MUST NOT be NULL. + * @param first_child child to be set as first child + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_set_first_child( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * first_child); + + /** + * Sets previous sibling + * @param om_node + * @param env environment, MUST NOT be NULL. + * @param prev_sibling + * @return status of the op, AXIS2_SUCCESS on success + * AXIS2_FAILURE on error + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_set_previous_sibling( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * prev_sibling); + + /** + * Sets next sibling + * @param om_node + * @param env environment, MUST NOT be NULL. + * @param last_sibling + * @return status of the op, AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_set_next_sibling( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * next_sibling); + + /** + * Sets node type + * @param om_node + * @param env environment, MUST NOT be NULL. + * @param type type of the node + * @return status code of the op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_set_node_type( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_types_t type); + + /** + * Sets data element + * @param om_node node struct + * @param env environment, MUST NOT be NULL. + * @param data_element + * @return status code of the op AXIS2_SUCCESS on success, + * AXIS2_FAILURE on error + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_set_data_element( + axiom_node_t * om_node, + const axutil_env_t * env, + void *data_element); + + /** + * Sets the build status , if the node if completety build, this attribute is + * set to AXIS2_TRUE , otherwise AXIS2_FALSE + * @param om_node + * @param env environment, MUST NOT be NULL. + * @param done + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_set_complete( + axiom_node_t * om_node, + const axutil_env_t * env, + axis2_bool_t done); + + /** + * This functions is only to be used by builder + * do not use this function + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_set_document( + axiom_node_t * om_node, + const axutil_env_t * env, + struct axiom_document *om_doc); + + /** + * Sets the builder + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_node_set_builder( + axiom_node_t * om_node, + const axutil_env_t * env, + struct axiom_stax_builder *builder); + + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** AXIOM_NODE_INTERNAL_H */ diff --git a/axiom/src/om/axiom_stax_builder_internal.h b/axiom/src/om/axiom_stax_builder_internal.h new file mode 100644 index 0000000..788ecf6 --- /dev/null +++ b/axiom/src/om/axiom_stax_builder_internal.h @@ -0,0 +1,75 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_STAX_BUILDER_INTERNAL_H +#define AXIOM_STAX_BUILDER_INTERNAL_H + +/** @defgroup axiom AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_stax_builder.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_stax builder + * @ingroup axiom + * @{ + */ + + AXIS2_EXTERN int AXIS2_CALL + axiom_stax_builder_get_current_event( + axiom_stax_builder_t * builder, + const axutil_env_t * env); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_stax_builder_set_lastnode( + axiom_stax_builder_t * builder, + const axutil_env_t * env, + axiom_node_t * om_node); + + AXIS2_EXTERN axiom_node_t *AXIS2_CALL + axiom_stax_builder_get_lastnode( + axiom_stax_builder_t * builder, + const axutil_env_t * env); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_stax_builder_set_element_level( + axiom_stax_builder_t * builder, + const axutil_env_t * env, + int element_level); + + AXIS2_EXTERN int AXIS2_CALL + axiom_stax_builder_get_element_level( + axiom_stax_builder_t * builder, + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** AXIOM_STAX_BUILDER_INTERNAL_H */ diff --git a/axiom/src/om/om_attribute.c b/axiom/src/om/om_attribute.c new file mode 100644 index 0000000..9d2a81e --- /dev/null +++ b/axiom/src/om/om_attribute.c @@ -0,0 +1,433 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_attribute.h> +#include <string.h> +#include <axutil_utils_defines.h> + +struct axiom_attribute +{ + + /** localname of this attribute */ + axutil_string_t *localname; + + /** value of this attribute */ + axutil_string_t *value; + + /** attribute namespace */ + axiom_namespace_t *ns; + + /** store qname here */ + axutil_qname_t *qname; + int ref; +}; + +AXIS2_EXTERN axiom_attribute_t *AXIS2_CALL +axiom_attribute_create( + const axutil_env_t * env, + const axis2_char_t * localname, + const axis2_char_t * value, + axiom_namespace_t * ns) +{ + axiom_attribute_t *attribute = NULL; + + AXIS2_ENV_CHECK(env, NULL); + /* localname is mandatory */ + AXIS2_PARAM_CHECK(env->error, localname, NULL); + + attribute = (axiom_attribute_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_attribute_t)); + if(!attribute) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + /** initialize fields */ + attribute->localname = NULL; + attribute->value = NULL; + attribute->ns = NULL; + attribute->qname = NULL; + + attribute->localname = axutil_string_create(env, localname); + if(!(attribute->localname)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_FREE(env->allocator, attribute); + return NULL; + } + if(value) + { + attribute->value = axutil_string_create(env, value); + if(!(attribute->value)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + axutil_string_free(attribute->localname, env); + AXIS2_FREE(env->allocator, attribute); + return NULL; + } + } + attribute->ns = ns; + + attribute->ref = 0; + + return attribute; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_attribute_free( + axiom_attribute_t * attribute, + const axutil_env_t * env) +{ + if(--attribute->ref > 0) + { + return; + } + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(attribute->localname) + { + axutil_string_free(attribute->localname, env); + } + if(attribute->value) + { + axutil_string_free(attribute->value, env); + } + if(attribute->qname) + { + axutil_qname_free(attribute->qname, env); + } + + AXIS2_FREE(env->allocator, attribute); + + return; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_attribute_free_void_arg( + void *attribute, + const axutil_env_t * env) +{ + axiom_attribute_t *om_attribute_l = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + om_attribute_l = (axiom_attribute_t *)attribute; + axiom_attribute_free(om_attribute_l, env); + return; +} + +AXIS2_EXTERN axutil_qname_t *AXIS2_CALL +axiom_attribute_get_qname( + axiom_attribute_t * attribute, + const axutil_env_t * env) +{ + axutil_qname_t *qname = NULL; + AXIS2_ENV_CHECK(env, NULL); + if(!(attribute->qname)) + { + if(attribute->ns) + { + qname = axutil_qname_create(env, axutil_string_get_buffer(attribute-> localname, env), + axiom_namespace_get_uri(attribute->ns, env), axiom_namespace_get_prefix( + attribute-> ns, env)); + } + else + { + qname = axutil_qname_create(env, axutil_string_get_buffer(attribute-> localname, env), + NULL, NULL); + } + attribute->qname = qname; + return qname; + } + return attribute->qname; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_attribute_serialize( + axiom_attribute_t * attribute, + const axutil_env_t * env, + axiom_output_t * om_output) +{ + int status = AXIS2_SUCCESS; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE); + + if(attribute->ns) + { + axis2_char_t *uri = NULL; + axis2_char_t *prefix = NULL; + + uri = axiom_namespace_get_uri(attribute->ns, env); + prefix = axiom_namespace_get_prefix(attribute->ns, env); + + if((uri) && (NULL != prefix) && (axutil_strcmp(prefix, "") != 0)) + { + status = axiom_output_write(om_output, env, AXIOM_ATTRIBUTE, 4, + axutil_string_get_buffer(attribute-> localname, env), axutil_string_get_buffer( + attribute-> value, env), uri, prefix); + } + else if(uri) + { + status = axiom_output_write(om_output, env, AXIOM_ATTRIBUTE, 3, + axutil_string_get_buffer(attribute-> localname, env), axutil_string_get_buffer( + attribute-> value, env), uri); + } + } + else + { + status = axiom_output_write(om_output, env, AXIOM_ATTRIBUTE, 2, axutil_string_get_buffer( + attribute-> localname, env), axutil_string_get_buffer(attribute->value, env)); + } + return status; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_attribute_get_localname( + axiom_attribute_t * attribute, + const axutil_env_t * env) +{ + if(attribute->localname) + { + return (axis2_char_t *)axutil_string_get_buffer(attribute->localname, env); + } + return NULL; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_attribute_get_value( + axiom_attribute_t * attribute, + const axutil_env_t * env) +{ + if(attribute->value) + { + return (axis2_char_t *)axutil_string_get_buffer(attribute->value, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL +axiom_attribute_get_namespace( + axiom_attribute_t * attribute, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + return attribute->ns; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_attribute_set_localname( + axiom_attribute_t * attribute, + const axutil_env_t * env, + const axis2_char_t * localname) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + + if(attribute->localname) + { + axutil_string_free(attribute->localname, env); + attribute->localname = NULL; + } + + attribute->localname = axutil_string_create(env, localname); + + if(!(attribute->localname)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_attribute_set_value( + axiom_attribute_t * attribute, + const axutil_env_t * env, + const axis2_char_t * value) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE); + + if(attribute->value) + { + axutil_string_free(attribute->value, env); + attribute->value = NULL; + } + + attribute->value = axutil_string_create(env, value); + if(!(attribute->value)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_attribute_set_namespace( + axiom_attribute_t * attribute, + const axutil_env_t * env, + axiom_namespace_t * om_namespace) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_FUNC_PARAM_CHECK(om_namespace, env, AXIS2_FAILURE); + attribute->ns = om_namespace; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_attribute_t *AXIS2_CALL +axiom_attribute_clone( + axiom_attribute_t * attribute, + const axutil_env_t * env) +{ + axiom_attribute_t *cloned_attr = NULL; + if(!attribute) + return NULL; + AXIS2_ENV_CHECK(env, NULL); + + /** namespace is not cloned since it is a shollow copy*/ + cloned_attr = axiom_attribute_create_str(env, attribute->localname, attribute->value, + attribute->ns); + if(cloned_attr) + { + return cloned_attr; + } + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_attribute_increment_ref( + struct axiom_attribute * om_attribute, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + om_attribute->ref++; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_attribute_t *AXIS2_CALL +axiom_attribute_create_str( + const axutil_env_t * env, + axutil_string_t * localname, + axutil_string_t * value, + axiom_namespace_t * ns) +{ + axiom_attribute_t *attribute = NULL; + + AXIS2_ENV_CHECK(env, NULL); + /* localname is mandatory */ + AXIS2_PARAM_CHECK(env->error, localname, NULL); + + attribute = (axiom_attribute_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_attribute_t)); + if(!attribute) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + /** initialize fields */ + attribute->localname = NULL; + attribute->value = NULL; + attribute->ns = NULL; + attribute->qname = NULL; + + attribute->localname = axutil_string_clone(localname, env); + if(!(attribute->localname)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_FREE(env->allocator, attribute); + return NULL; + } + if(value) + { + attribute->value = axutil_string_clone(value, env); + if(!(attribute->value)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + axutil_string_free(attribute->localname, env); + AXIS2_FREE(env->allocator, attribute); + return NULL; + } + } + attribute->ns = ns; + + attribute->ref = 0; + + return attribute; +} + +AXIS2_EXTERN axutil_string_t *AXIS2_CALL +axiom_attribute_get_localname_str( + axiom_attribute_t * attribute, + const axutil_env_t * env) +{ + return attribute->localname; +} + +AXIS2_EXTERN axutil_string_t *AXIS2_CALL +axiom_attribute_get_value_str( + axiom_attribute_t * attribute, + const axutil_env_t * env) +{ + return attribute->value; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_attribute_set_localname_str( + axiom_attribute_t * attribute, + const axutil_env_t * env, + axutil_string_t * localname) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + + if(attribute->localname) + { + axutil_string_free(attribute->localname, env); + attribute->localname = NULL; + } + + attribute->localname = axutil_string_clone(localname, env); + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_attribute_set_value_str( + axiom_attribute_t * attribute, + const axutil_env_t * env, + axutil_string_t * value) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE); + + if(attribute->value) + { + axutil_string_free(attribute->value, env); + attribute->value = NULL; + } + + attribute->value = axutil_string_clone(value, env); + if(!(attribute->value)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} diff --git a/axiom/src/om/om_child_element_iterator.c b/axiom/src/om/om_child_element_iterator.c new file mode 100644 index 0000000..622cfbd --- /dev/null +++ b/axiom/src/om/om_child_element_iterator.c @@ -0,0 +1,119 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_child_element_iterator.h> + +struct axiom_child_element_iterator +{ + axiom_node_t *current_child; + axiom_node_t *last_child; + axis2_bool_t next_called; + axis2_bool_t remove_called; +}; + +AXIS2_EXTERN axiom_child_element_iterator_t *AXIS2_CALL +axiom_child_element_iterator_create( + const axutil_env_t * env, + axiom_node_t * current_child) +{ + axiom_child_element_iterator_t *iterator = NULL; + AXIS2_ENV_CHECK(env, NULL); + + iterator = (axiom_child_element_iterator_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_child_element_iterator_t)); + + if(!iterator) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + iterator->current_child = current_child; + iterator->last_child = NULL; + + iterator->next_called = AXIS2_FALSE; + iterator->remove_called = AXIS2_FALSE; + + return iterator; +} + +AXIS2_EXTERN void AXIS2_CALL axiom_child_element_iterator_free( + void *iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_FREE(env->allocator, iterator); + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_child_element_iterator_remove( + axiom_child_element_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, iterator, AXIS2_FAILURE); + + if(!(iterator->next_called)) + return AXIS2_FAILURE; + if(iterator->remove_called) + return AXIS2_FAILURE; + + iterator->remove_called = AXIS2_TRUE; + + if(!(iterator->last_child)) + return AXIS2_FAILURE; + axiom_node_free_tree(iterator->last_child, env); + iterator->last_child = NULL; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_child_element_iterator_has_next( + axiom_child_element_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return (iterator->current_child) ? AXIS2_TRUE : AXIS2_FALSE; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL axiom_child_element_iterator_next( + axiom_child_element_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + + iterator->next_called = AXIS2_TRUE; + iterator->remove_called = AXIS2_FALSE; + if (iterator->current_child) + { + iterator->last_child = iterator->current_child; + do + { + iterator->current_child = + axiom_node_get_next_sibling(iterator->current_child, env); + + } + while (iterator->current_child && + (axiom_node_get_node_type(iterator->current_child, env) + != AXIOM_ELEMENT)); + + return iterator->last_child; + } + return NULL; +} diff --git a/axiom/src/om/om_children_iterator.c b/axiom/src/om/om_children_iterator.c new file mode 100644 index 0000000..42046e5 --- /dev/null +++ b/axiom/src/om/om_children_iterator.c @@ -0,0 +1,138 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_children_iterator.h> + +struct axiom_children_iterator +{ + axiom_node_t *first_child; + axiom_node_t *current_child; + axiom_node_t *last_child; + axis2_bool_t next_called; + axis2_bool_t remove_called; +}; + +AXIS2_EXTERN axiom_children_iterator_t *AXIS2_CALL +axiom_children_iterator_create( + const axutil_env_t * env, + axiom_node_t * current_child) +{ + axiom_children_iterator_t *iterator = NULL; + AXIS2_ENV_CHECK(env, NULL); + + iterator = (axiom_children_iterator_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_children_iterator_t)); + + if(!iterator) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + iterator->current_child = NULL; + iterator->last_child = NULL; + iterator->first_child = NULL; + + iterator->next_called = AXIS2_FALSE; + iterator->remove_called = AXIS2_FALSE; + + iterator->first_child = current_child; + iterator->current_child = current_child; + + return iterator; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_children_iterator_free( + axiom_children_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, void); + + AXIS2_FREE(env->allocator, iterator); + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_children_iterator_remove( + axiom_children_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, iterator, AXIS2_FAILURE); + + if(!(iterator->next_called)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_ITERATOR_NEXT_METHOD_HAS_NOT_YET_BEEN_CALLED, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + if(iterator->remove_called) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_ITERATOR_REMOVE_HAS_ALREADY_BEING_CALLED, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + iterator->remove_called = AXIS2_TRUE; + + if(!(iterator->last_child)) + { + return AXIS2_FAILURE; + } + axiom_node_free_tree(iterator->last_child, env); + iterator->last_child = NULL; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_children_iterator_has_next( + axiom_children_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + return (iterator->current_child) ? AXIS2_TRUE : AXIS2_FALSE; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_children_iterator_next( + axiom_children_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + + iterator->next_called = AXIS2_TRUE; + iterator->remove_called = AXIS2_FALSE; + if(iterator->current_child) + { + iterator->last_child = iterator->current_child; + iterator->current_child = axiom_node_get_next_sibling(iterator->current_child, env); + return iterator->last_child; + } + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_children_iterator_reset( + axiom_children_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + iterator->current_child = iterator->first_child; + return AXIS2_SUCCESS; +} diff --git a/axiom/src/om/om_children_qname_iterator.c b/axiom/src/om/om_children_qname_iterator.c new file mode 100644 index 0000000..d508a9e --- /dev/null +++ b/axiom/src/om/om_children_qname_iterator.c @@ -0,0 +1,190 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_children_qname_iterator.h> +#include <axiom_element.h> + +struct axiom_children_qname_iterator +{ + axiom_node_t *current_child; + axiom_node_t *last_child; + axis2_bool_t next_called; + axis2_bool_t remove_called; + axutil_qname_t *given_qname; + axis2_bool_t need_to_move_forward; + axis2_bool_t matching_node_found; + +}; + +AXIS2_EXTERN axiom_children_qname_iterator_t *AXIS2_CALL +axiom_children_qname_iterator_create( + const axutil_env_t * env, + axiom_node_t * current_child, + axutil_qname_t * given_qname) +{ + axiom_children_qname_iterator_t *iterator = NULL; + + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, current_child, NULL); + + iterator = (axiom_children_qname_iterator_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_children_qname_iterator_t)); + + if(!iterator) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + iterator->current_child = NULL; + iterator->last_child = NULL; + iterator->need_to_move_forward = AXIS2_TRUE; + iterator->matching_node_found = AXIS2_FALSE; + iterator->next_called = AXIS2_FALSE; + iterator->remove_called = AXIS2_FALSE; + iterator->given_qname = NULL; + + iterator->current_child = current_child; + if(given_qname) + { + iterator->given_qname = axutil_qname_clone(given_qname, env); + if(!(iterator->given_qname)) + { + axiom_children_qname_iterator_free(iterator, env); + return NULL; + } + } + + return iterator; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_children_qname_iterator_free( + axiom_children_qname_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, void); + + if(iterator->given_qname) + { + axutil_qname_free(iterator->given_qname, env); + } + AXIS2_FREE(env->allocator, iterator); + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_children_qname_iterator_remove( + axiom_children_qname_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, iterator, AXIS2_FAILURE); + + if(!(iterator->next_called)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_ITERATOR_NEXT_METHOD_HAS_NOT_YET_BEEN_CALLED, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + if(iterator->remove_called) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_ITERATOR_REMOVE_HAS_ALREADY_BEING_CALLED, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + iterator->remove_called = AXIS2_TRUE; + + if(!(iterator->last_child)) + return AXIS2_FAILURE; + axiom_node_free_tree(iterator->last_child, env); + iterator->last_child = NULL; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_children_qname_iterator_has_next( + axiom_children_qname_iterator_t * iterator, + const axutil_env_t * env) +{ + while(iterator->need_to_move_forward) + { + if(iterator->current_child) + { + axiom_element_t *om_element = NULL; + axutil_qname_t *element_qname = NULL; + + if(axiom_node_get_node_type(iterator->current_child, env) == AXIOM_ELEMENT) + { + om_element = (axiom_element_t *)axiom_node_get_data_element( + iterator-> current_child, env); + } + + if(om_element) + { + element_qname = axiom_element_get_qname(om_element, env, iterator->current_child); + } + + if(om_element && axutil_qname_equals(element_qname, env, iterator->given_qname)) + { + iterator->matching_node_found = AXIS2_TRUE; + iterator->need_to_move_forward = AXIS2_FALSE; + } + else + { + iterator->current_child = axiom_node_get_next_sibling(iterator->current_child, env); + if(iterator->current_child) + { + iterator->need_to_move_forward = AXIS2_TRUE; + iterator->matching_node_found = AXIS2_TRUE; + } + else + { + iterator->need_to_move_forward = AXIS2_FALSE; + iterator->matching_node_found = AXIS2_FALSE; + } + } + } + else + { + iterator->need_to_move_forward = AXIS2_FALSE; + } + } + return iterator->matching_node_found; + +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_children_qname_iterator_next( + axiom_children_qname_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + + iterator->need_to_move_forward = AXIS2_TRUE; + iterator->matching_node_found = AXIS2_FALSE; + iterator->next_called = AXIS2_TRUE; + iterator->remove_called = AXIS2_FALSE; + + iterator->last_child = iterator->current_child; + if(iterator->current_child) + { + iterator->current_child = axiom_node_get_next_sibling(iterator->current_child, env); + } + return iterator->last_child; +} + diff --git a/axiom/src/om/om_children_with_specific_attribute_iterator.c b/axiom/src/om/om_children_with_specific_attribute_iterator.c new file mode 100644 index 0000000..8f2e463 --- /dev/null +++ b/axiom/src/om/om_children_with_specific_attribute_iterator.c @@ -0,0 +1,177 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_children_with_specific_attribute_iterator.h> +#include <axiom_attribute.h> +#include <axiom_element.h> + +struct axiom_children_with_specific_attribute_iterator +{ + axiom_node_t *current_child; + axiom_node_t *last_child; + axis2_bool_t next_called; + axis2_bool_t remove_called; + axutil_qname_t *attr_qname; + axis2_char_t *attr_value; + axis2_bool_t detach; +}; + +AXIS2_EXTERN axiom_children_with_specific_attribute_iterator_t *AXIS2_CALL +axiom_children_with_specific_attribute_iterator_create( + const axutil_env_t * env, + axiom_node_t * current_child, + axutil_qname_t * attr_qname, + axis2_char_t * attr_value, + axis2_bool_t detach) +{ + axiom_children_with_specific_attribute_iterator_t *iterator = NULL; + + AXIS2_PARAM_CHECK(env->error, current_child, NULL); + AXIS2_PARAM_CHECK(env->error, attr_qname, NULL); + AXIS2_PARAM_CHECK(env->error, attr_value, NULL); + iterator = (axiom_children_with_specific_attribute_iterator_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_children_with_specific_attribute_iterator_t)); + + if(!iterator) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + iterator->current_child = NULL; + iterator->last_child = NULL; + + iterator->next_called = AXIS2_FALSE; + iterator->remove_called = AXIS2_FALSE; + + iterator->attr_qname = axutil_qname_clone(attr_qname, env); + iterator->attr_value = attr_value; + iterator->detach = detach; + + return iterator; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_children_with_specific_attribute_iterator_free( + axiom_children_with_specific_attribute_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, void); + if(iterator->attr_qname) + { + axutil_qname_free(iterator->attr_qname, env); + } + AXIS2_FREE(env->allocator, iterator); + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_children_with_specific_attribute_iterator_remove( + axiom_children_with_specific_attribute_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, iterator, AXIS2_FAILURE); + + if(!(iterator->next_called)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_ITERATOR_NEXT_METHOD_HAS_NOT_YET_BEEN_CALLED, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + if(iterator->remove_called) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_ITERATOR_REMOVE_HAS_ALREADY_BEING_CALLED, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + iterator->remove_called = AXIS2_TRUE; + + if(!(iterator->last_child)) + return AXIS2_FAILURE; + axiom_node_free_tree(iterator->last_child, env); + iterator->last_child = NULL; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_children_with_specific_attribute_iterator_has_next( + axiom_children_with_specific_attribute_iterator_t * iterator, + const axutil_env_t * env) +{ + axis2_bool_t matching_node_found = AXIS2_FALSE; + axis2_bool_t need_to_move_forward = AXIS2_TRUE; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(!(iterator->current_child)) + { + return AXIS2_FALSE; + } + while(need_to_move_forward) + { + if(axiom_node_get_node_type(iterator->current_child, env) == AXIOM_ELEMENT) + { + axiom_attribute_t *om_attr = NULL; + axiom_element_t *om_ele = NULL; + om_ele = (axiom_element_t *)axiom_node_get_data_element(iterator-> current_child, env); + om_attr = axiom_element_get_attribute(om_ele, env, iterator->attr_qname); + break; + /*if (om_attr && + (axutil_strcmp(axiom_attribute_get_value(om_attr, env), + iterator->attr_value) == 0)) + { + matching_node_found = AXIS2_TRUE; + need_to_move_forward = AXIS2_FALSE; + } + else + { + iterator->current_child = + axiom_node_get_next_sibling(iterator->current_child, env); + need_to_move_forward = (iterator->current_child != NULL); + + }*/ + } + else + { + + iterator->current_child = axiom_node_get_next_sibling(iterator->current_child, env); + need_to_move_forward = (iterator->current_child != NULL); + } + + } + return matching_node_found; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_children_with_specific_attribute_iterator_next( + axiom_children_with_specific_attribute_iterator_t * iterator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, iterator, NULL); + + iterator->next_called = AXIS2_TRUE; + iterator->remove_called = AXIS2_FALSE; + iterator->last_child = iterator->current_child; + iterator->current_child = axiom_node_get_next_sibling(iterator->current_child, env); + if(iterator->last_child && iterator->detach + && (axiom_node_get_parent(iterator->last_child, env))) + { + axiom_node_free_tree(iterator->last_child, env); + } + return iterator->last_child; +} diff --git a/axiom/src/om/om_comment.c b/axiom/src/om/om_comment.c new file mode 100644 index 0000000..ad17f74 --- /dev/null +++ b/axiom/src/om/om_comment.c @@ -0,0 +1,142 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_comment.h> +#include "axiom_node_internal.h" +#include <axutil_string.h> + +struct axiom_comment +{ + + /** comment text */ + axis2_char_t *value; +}; + +AXIS2_EXTERN axiom_comment_t *AXIS2_CALL +axiom_comment_create( + const axutil_env_t * env, + axiom_node_t * parent, + const axis2_char_t * value, + axiom_node_t ** node) +{ + axiom_comment_t *comment = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, value, NULL); + AXIS2_PARAM_CHECK(env->error, node, NULL); + *node = NULL; + *node = axiom_node_create(env); + if(!*node) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + comment = (axiom_comment_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_comment_t)); + if(!comment) + { + AXIS2_FREE(env->allocator, (*node)); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + comment->value = NULL; + + if(value) + { + comment->value = (axis2_char_t *)axutil_strdup(env, value); + if(!comment->value) + { + AXIS2_FREE(env->allocator, comment); + AXIS2_FREE(env->allocator, (*node)); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + } + + axiom_node_set_data_element((*node), env, comment); + axiom_node_set_node_type((*node), env, AXIOM_COMMENT); + + if(parent) + { + axiom_node_add_child(parent, env, (*node)); + } + + return comment; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_comment_free( + axiom_comment_t * comment, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(comment->value) + { + AXIS2_FREE(env->allocator, comment->value); + } + AXIS2_FREE(env->allocator, comment); + return; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_comment_get_value( + axiom_comment_t * comment, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + return comment->value; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_comment_set_value( + axiom_comment_t * comment, + const axutil_env_t * env, + const axis2_char_t * value) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE); + if(comment->value) + { + AXIS2_FREE(env->allocator, comment->value); + } + + comment->value = (axis2_char_t *)axutil_strdup(env, value); + + if(!comment->value) + { + return AXIS2_FAILURE; + } + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_comment_serialize( + axiom_comment_t * comment, + const axutil_env_t * env, + axiom_output_t * om_output) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE); + + if(comment->value) + { + return axiom_output_write(om_output, env, AXIOM_COMMENT, 1, comment->value); + } + return AXIS2_FAILURE; +} diff --git a/axiom/src/om/om_data_source.c b/axiom/src/om/om_data_source.c new file mode 100644 index 0000000..3959e49 --- /dev/null +++ b/axiom/src/om/om_data_source.c @@ -0,0 +1,133 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_data_source.h> +#include <axiom_output.h> +#include <axutil_string.h> +#include "axiom_node_internal.h" +#include <axiom_xml_writer.h> +#include <axiom_output.h> +#include <axiom_attribute.h> +#include <axiom_namespace.h> +#include <axutil_base64.h> + +/********************* axiom_data_source_struct ***************/ + +struct axiom_data_source +{ + + /** stream holding serialized XML string */ + axutil_stream_t *stream; +}; + +AXIS2_EXTERN axiom_data_source_t *AXIS2_CALL +axiom_data_source_create( + const axutil_env_t * env, + axiom_node_t * parent, + axiom_node_t ** node) +{ + + axiom_data_source_t *data_source = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, node, NULL); + + *node = axiom_node_create(env); + + if(!(*node)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + data_source = (axiom_data_source_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_data_source_t)); + if(!data_source) + { + AXIS2_FREE(env->allocator, *node); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + axiom_node_set_data_element((*node), env, data_source); + axiom_node_set_node_type((*node), env, AXIOM_DATA_SOURCE); + axiom_node_set_complete((*node), env, AXIS2_FALSE); + + data_source->stream = NULL; + + data_source->stream = axutil_stream_create_basic(env); + if(!(data_source->stream)) + { + AXIS2_FREE(env->allocator, *node); + AXIS2_FREE(env->allocator, data_source); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + if(parent && axiom_node_get_node_type(parent, env) == AXIOM_ELEMENT) + { + axiom_node_add_child(parent, env, (*node)); + } + + return data_source; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_data_source_free( + axiom_data_source_t * data_source, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, void); + + if(data_source->stream) + { + axutil_stream_free(data_source->stream, env); + } + + AXIS2_FREE(env->allocator, data_source); + + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_data_source_serialize( + axiom_data_source_t * data_source, + const axutil_env_t * env, + axiom_output_t * om_output) +{ + int status = AXIS2_SUCCESS; + axis2_char_t *data = NULL; + unsigned int data_len = 0; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE); + + data = axutil_stream_get_buffer(data_source->stream, env); + data_len = axutil_stream_get_len(data_source->stream, env); + if(data) + { + data[data_len] = '\0'; + status = axiom_output_write(om_output, env, AXIOM_DATA_SOURCE, 1, data); + } + return status; +} + +AXIS2_EXTERN axutil_stream_t *AXIS2_CALL +axiom_data_source_get_stream( + axiom_data_source_t * data_source, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + return data_source->stream; +} diff --git a/axiom/src/om/om_doctype.c b/axiom/src/om/om_doctype.c new file mode 100644 index 0000000..fa5616b --- /dev/null +++ b/axiom/src/om/om_doctype.c @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_doctype.h> +#include <axutil_string.h> +#include "axiom_node_internal.h" + +struct axiom_doctype +{ + + /** Doctype value */ + axis2_char_t *value; +}; + +AXIS2_EXTERN axiom_doctype_t *AXIS2_CALL +axiom_doctype_create( + const axutil_env_t * env, + axiom_node_t * parent, + const axis2_char_t * value, + axiom_node_t ** node) +{ + axiom_doctype_t *doctype = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, node, NULL); + + *node = axiom_node_create(env); + if(!*node) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + doctype = (axiom_doctype_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_doctype_t)); + + if(!doctype) + { + AXIS2_FREE(env->allocator, (*node)); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + doctype->value = NULL; + + if(value) + { + doctype->value = (axis2_char_t *)axutil_strdup(env, value); + if(!doctype->value) + { + AXIS2_FREE(env->allocator, doctype); + AXIS2_FREE(env->allocator, (*node)); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + } + + axiom_node_set_data_element((*node), env, doctype); + axiom_node_set_node_type((*node), env, AXIOM_DOCTYPE); + + if(parent) + { + axiom_node_add_child(parent, env, (*node)); + } + + return doctype; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_doctype_free( + axiom_doctype_t * om_doctype, + const axutil_env_t * env) +{ + if(om_doctype) + { + if(om_doctype->value) + { + AXIS2_FREE(env->allocator, om_doctype->value); + } + AXIS2_FREE(env->allocator, om_doctype); + } + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_doctype_set_value( + axiom_doctype_t * om_doctype, + const axutil_env_t * env, + const axis2_char_t * value) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE); + om_doctype->value = (axis2_char_t *)axutil_strdup(env, value); + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_doctype_get_value( + axiom_doctype_t * om_doctype, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + return om_doctype->value; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_doctype_serialize( + axiom_doctype_t * om_doctype, + const axutil_env_t * env, + axiom_output_t * om_output) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE); + + if(om_doctype->value) + return axiom_output_write(om_output, env, AXIOM_DOCTYPE, 1, om_doctype->value); + + return AXIS2_FAILURE; +} diff --git a/axiom/src/om/om_document.c b/axiom/src/om/om_document.c new file mode 100644 index 0000000..149edec --- /dev/null +++ b/axiom/src/om/om_document.c @@ -0,0 +1,263 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_document.h> +#include <axiom_stax_builder.h> +#include <axutil_string.h> + +struct axiom_document +{ + + /** root element */ + axiom_node_t *root_element; + + /** last child */ + axiom_node_t *last_child; + + /** first child */ + axiom_node_t *first_child; + + /** done building the document */ + axis2_bool_t done; + + /** builder of the document */ + struct axiom_stax_builder *builder; + + /** char set encoding */ + axis2_char_t *char_set_encoding; + + /** XML version */ + axis2_char_t *xml_version; +}; + +AXIS2_EXTERN axiom_document_t *AXIS2_CALL +axiom_document_create( + const axutil_env_t * env, + axiom_node_t * root, + axiom_stax_builder_t * builder) +{ + axiom_document_t *document = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + document = (axiom_document_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_document_t)); + + if(!document) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + document->builder = builder; + document->root_element = root; + document->first_child = root; + document->last_child = root; + document->xml_version = XML_VERSION; + document->char_set_encoding = CHAR_SET_ENCODING; + document->done = AXIS2_FALSE; + + return document; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_document_free( + axiom_document_t * document, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, void); + + if(document->root_element) + { + axiom_node_free_tree(document->root_element, env); + } + AXIS2_FREE(env->allocator, document); + return; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_document_free_self( + axiom_document_t * document, + const axutil_env_t * env) +{ + AXIS2_FREE(env->allocator, document); + return; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_document_build_next( + axiom_document_t * document, + const axutil_env_t * env) +{ + axiom_node_t *last_child = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + if(!document->builder) + { + return NULL; + } + + if(!(document->root_element)) + { + last_child = axiom_stax_builder_next(document->builder, env); + if(last_child) + { + document->last_child = last_child; + document->root_element = last_child; + } + return last_child; + } + else if((document->root_element) && (axiom_node_is_complete(document->root_element, env) + == AXIS2_TRUE)) + return NULL; /* Nothing wrong but done with pulling */ + + last_child = axiom_stax_builder_next(document->builder, env); + if(last_child) + { + document->last_child = last_child; + } + return last_child; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_document_get_root_element( + axiom_document_t * document, + const axutil_env_t * env) +{ + axiom_node_t *node = NULL; + AXIS2_ENV_CHECK(env, NULL); + + if(document->root_element) + { + return document->root_element; + } + node = axiom_document_build_next(document, env); + + if(document->root_element) + { + return document->root_element; + } + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_DOCUMENT_STATE_ROOT_NULL, AXIS2_FAILURE); + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_document_set_root_element( + axiom_document_t * document, + const axutil_env_t * env, + axiom_node_t * node) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + + if(document->root_element) + { + axiom_node_free_tree(document->root_element, env); + document->root_element = node; + return AXIS2_SUCCESS; + } + else + { + document->root_element = node; + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_document_build_all( + struct axiom_document * document, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + if(!document) + { + return NULL; + } + if(!document->root_element) + { + axiom_document_get_root_element(document, env); + } + if(document->root_element) + { + do + { + axiom_node_t *ret_val = NULL; + ret_val = axiom_document_build_next(document, env); + if(!ret_val) + { + if(axiom_node_is_complete(document->root_element, env) == AXIS2_TRUE) + { + + /** document is completly build */ + return document->root_element; + } + else + { + + /** error occurred */ + return NULL; + } + } + } + while(!axiom_node_is_complete(document->root_element, env)); + return document->root_element; + } + else + return NULL; +} + +AXIS2_EXTERN axiom_stax_builder_t *AXIS2_CALL +axiom_document_get_builder( + axiom_document_t * document, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + return document->builder; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_document_set_builder( + axiom_document_t * document, + const axutil_env_t * env, + axiom_stax_builder_t * builder) +{ + document->builder = builder; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_document_serialize( + axiom_document_t * document, + const axutil_env_t * env, + axiom_output_t * om_output) +{ + if(!document) + return AXIS2_FAILURE; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + if(!(document->root_element)) + { + axiom_document_get_root_element(document, env); + } + if(document->root_element) + { + return axiom_node_serialize(document->root_element, env, om_output); + } + else + { + return AXIS2_FAILURE; + } +} diff --git a/axiom/src/om/om_element.c b/axiom/src/om/om_element.c new file mode 100644 index 0000000..84982cd --- /dev/null +++ b/axiom/src/om/om_element.c @@ -0,0 +1,1818 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_element.h> +#include "axiom_node_internal.h" +#include <axiom_attribute.h> +#include <axiom_namespace.h> +#include <axiom_xml_writer.h> +#include <axiom_stax_builder.h> +#include <string.h> +#include <stdio.h> + +struct axiom_element +{ + + /** Element's namespace */ + axiom_namespace_t *ns; + + /** Element's local name */ + axutil_string_t *localname; + + /** List of attributes */ + axutil_hash_t *attributes; + + /** List of namespaces */ + axutil_hash_t *namespaces; + + axutil_qname_t *qname; + + axiom_child_element_iterator_t *child_ele_iter; + + axiom_children_iterator_t *children_iter; + + axiom_children_qname_iterator_t *children_qname_iter; + + axis2_char_t *text_value; + + int next_ns_prefix_number; + + axis2_bool_t is_empty; + +}; + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_element_create( + const axutil_env_t * env, + axiom_node_t * parent, + const axis2_char_t * localname, + axiom_namespace_t * ns, + axiom_node_t ** node) +{ + axiom_element_t *element; + AXIS2_ENV_CHECK(env, NULL); + + if(!localname || !node) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "localname or node is NULL"); + return NULL; + } + + (*node) = axiom_node_create(env); + if(!(*node)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No Memory"); + return NULL; + } + element = (axiom_element_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_element_t)); + + if(!element) + { + AXIS2_FREE(env->allocator, (*node)); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No Memory"); + return NULL; + } + element->ns = NULL; + element->localname = NULL; + element->attributes = NULL; + element->namespaces = NULL; + element->qname = NULL; + element->child_ele_iter = NULL; + element->children_iter = NULL; + element->children_qname_iter = NULL; + element->text_value = NULL; + element->next_ns_prefix_number = 0; + element->is_empty = AXIS2_FALSE; + + element->localname = axutil_string_create(env, localname); + if(!element->localname) + { + AXIS2_FREE(env->allocator, element); + AXIS2_FREE(env->allocator, (*node)); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + if(parent) + { + axiom_node_add_child(parent, env, (*node)); + } + axiom_node_set_complete((*node), env, AXIS2_FALSE); + axiom_node_set_node_type((*node), env, AXIOM_ELEMENT); + axiom_node_set_data_element((*node), env, element); + + if(ns) + { + axis2_char_t *uri = NULL; + axis2_char_t *prefix = NULL; + + uri = axiom_namespace_get_uri(ns, env); + prefix = axiom_namespace_get_prefix(ns, env); + + /* + if (prefix && axutil_strcmp(prefix, "") == 0) + { + element->ns = NULL; + return element; + } + */ + element->ns = axiom_element_find_namespace(element, env, *node, uri, prefix); + + if(element->ns) + { + if(ns != element->ns) + { + axiom_namespace_free(ns, env); + ns = NULL; + } + } + + if(!(element->ns)) + { + if(axiom_element_declare_namespace(element, env, *node, ns) == AXIS2_SUCCESS) + { + element->ns = ns; + } + } + + /*if (prefix && axutil_strcmp(prefix, "") == 0) + { + element->ns = NULL; + } + */ + } + + return element; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_element_create_with_qname( + const axutil_env_t * env, + axiom_node_t * parent, + const axutil_qname_t * qname, + axiom_node_t ** node) +{ + axiom_element_t *element = NULL; + axis2_char_t *localpart = NULL; + + AXIS2_ENV_CHECK(env, NULL); + if(!qname || !node) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "qname or node is NULL"); + return NULL; + } + localpart = axutil_qname_get_localpart(qname, env); + if(!localpart) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "localpart is NULL"); + return NULL; + } + element = axiom_element_create(env, parent, localpart, NULL, node); + if(!element) + { + return NULL; + } + + if(*node) + { + axiom_element_t *om_element = NULL; + axis2_char_t *temp_nsuri = NULL; + axis2_char_t *temp_prefix = NULL; + axiom_namespace_t *ns = NULL; + + om_element = ((axiom_element_t *)axiom_node_get_data_element((*node), env)); + temp_nsuri = axutil_qname_get_uri(qname, env); + temp_prefix = axutil_qname_get_prefix(qname, env); + if(!om_element) + { + return NULL; + } + + if((!temp_nsuri) || (axutil_strcmp(temp_nsuri, "") == 0)) + { + + /** no namespace uri is available in given qname + no need to bother about it + */ + return om_element; + } + + om_element->ns = axiom_element_find_namespace(om_element, env, (*node), temp_nsuri, + temp_prefix); + + if(!(element->ns)) + { + + /** could not find a namespace so declare namespace */ + ns = axiom_namespace_create(env, temp_nsuri, temp_prefix); + if(ns && axiom_element_declare_namespace(om_element, env, *node, ns) == AXIS2_SUCCESS) + { + (element->ns) = ns; + return om_element; + } + else + { + if(ns) + { + axiom_namespace_free(ns, env); + } + axiom_element_free(om_element, env); + AXIS2_FREE(env->allocator, *node); + return NULL; + } + } + } + return element; +} + +AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL +axiom_element_find_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node, + const axis2_char_t * uri, + const axis2_char_t * prefix) +{ + axiom_node_t *parent = NULL; + AXIS2_ENV_CHECK(env, NULL); + + if(!element_node || !om_element) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "element_node or om_element is NULL"); + return NULL; + } + if(!axiom_node_get_data_element(element_node, env) || axiom_node_get_node_type(element_node, + env) != AXIOM_ELEMENT) + { + /* wrong element type or null node */ + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Wrong element type or null node"); + return NULL; + } + + if(om_element->namespaces) + { + void *ns = NULL; + + if(uri && (!prefix || axutil_strcmp(prefix, "") == 0)) + { + + /** check for a default namepsace */ + axiom_namespace_t *default_ns = NULL; + axutil_hash_index_t *hashindex; + + default_ns = axiom_element_get_default_namespace(om_element, env, element_node); + if(default_ns) + { + axis2_char_t *default_uri = NULL; + default_uri = axiom_namespace_get_uri(default_ns, env); + + if(axutil_strcmp(uri, default_uri) == 0) + { + return default_ns; + } + } + + /** prefix is null , so iterate the namespaces hash to find the namespace */ + for(hashindex = axutil_hash_first(om_element->namespaces, env); hashindex; hashindex + = axutil_hash_next(env, hashindex)) + { + axutil_hash_this(hashindex, NULL, NULL, &ns); + if(ns) + { + axiom_namespace_t *temp_ns = NULL; + axis2_char_t *temp_nsuri = NULL; + temp_ns = (axiom_namespace_t *)ns; + temp_nsuri = axiom_namespace_get_uri(temp_ns, env); + + if(axutil_strcmp(temp_nsuri, uri) == 0) + { + /** namespace uri matches, so free hashindex and return ns*/ + AXIS2_FREE(env->allocator, hashindex); + return (axiom_namespace_t *)(ns); + } + temp_ns = NULL; + temp_nsuri = NULL; + ns = NULL; + } + } + ns = NULL; + } + else if(prefix) + { + + /** prefix is not null get namespace directly if exist */ + ns = axutil_hash_get(om_element->namespaces, prefix, AXIS2_HASH_KEY_STRING); + if(ns) + { + axiom_namespace_t *found_ns = NULL; + axis2_char_t *found_uri = NULL; + found_ns = (axiom_namespace_t *)ns; + found_uri = axiom_namespace_get_uri(found_ns, env); + if(uri) + { + /* if uri provided, return found ns only if uri matches */ + return (axutil_strcmp(found_uri, uri) == 0) ? found_ns : NULL; + } + return found_ns; + } + } + } + + /** could not find the namespace in current element scope + look in the parent */ + + parent = axiom_node_get_parent(element_node, env); + + if(parent) + { + if(axiom_node_get_node_type(parent, env) == AXIOM_ELEMENT) + { + axiom_element_t *om_element = NULL; + om_element = (axiom_element_t *)axiom_node_get_data_element(parent, env); + if(om_element) + + { /** parent exist, parent is om element so find in parent*/ + return axiom_element_find_namespace(om_element, env, parent, uri, prefix); + } + } + } + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_element_declare_namespace_assume_param_ownership( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_namespace_t * ns) +{ + axis2_char_t *prefix = NULL; + axis2_char_t *uri = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(!ns || !om_element) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "namespace or om_element is NULL"); + return AXIS2_FAILURE; + } + + uri = axiom_namespace_get_uri(ns, env); + prefix = axiom_namespace_get_prefix(ns, env); + + if(!(om_element->namespaces)) + { + om_element->namespaces = axutil_hash_make(env); + if(!(om_element->namespaces)) + { + return AXIS2_FAILURE; + } + } + if(prefix) + { + axutil_hash_set(om_element->namespaces, prefix, AXIS2_HASH_KEY_STRING, ns); + } + else + { + axis2_char_t *key = NULL; + key = AXIS2_MALLOC(env->allocator, sizeof(char) * 10); + memset(key, 0, sizeof(char) * 10); + om_element->next_ns_prefix_number++; + key[0] = '\0'; + axutil_hash_set(om_element->namespaces, key, AXIS2_HASH_KEY_STRING, ns); + } + axiom_namespace_increment_ref(ns, env); + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_element_declare_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * node, + axiom_namespace_t * ns) +{ + axiom_namespace_t *declared_ns = NULL; + axis2_char_t *prefix = NULL; + axis2_char_t *uri = NULL; + + if(!node || !ns || !om_element) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "node or namespace or om_element is NULL"); + return AXIS2_FAILURE; + } + + uri = axiom_namespace_get_uri(ns, env); + prefix = axiom_namespace_get_prefix(ns, env); + + declared_ns = axiom_element_find_namespace(om_element, env, node, uri, prefix); + + if(declared_ns) + { + if(axiom_namespace_equals(ns, env, declared_ns) == AXIS2_TRUE) + { + /*Namespace already declared, so return */ + return AXIS2_SUCCESS; + } + } + + if(!(om_element->namespaces)) + { + om_element->namespaces = axutil_hash_make(env); + if(!(om_element->namespaces)) + { + return AXIS2_FAILURE; + } + } + if(prefix) + { + axutil_hash_set(om_element->namespaces, prefix, AXIS2_HASH_KEY_STRING, ns); + } + else + { + axis2_char_t *key = NULL; + key = AXIS2_MALLOC(env->allocator, sizeof(char) * 10); + memset(key, 0, sizeof(char) * 10); + om_element->next_ns_prefix_number++; + key[0] = '\0'; + axutil_hash_set(om_element->namespaces, key, AXIS2_HASH_KEY_STRING, ns); + } + axiom_namespace_increment_ref(ns, env); + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL +axiom_element_find_declared_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + const axis2_char_t * uri, + const axis2_char_t * prefix) +{ + axutil_hash_index_t *hash_index = NULL; + void *ns = NULL; + AXIS2_ENV_CHECK(env, NULL); + + if(!(om_element->namespaces)) + { + return NULL; + } + if(uri && (!prefix || axutil_strcmp(prefix, "") == 0)) + { + /** prefix null iterate the namespace hash for matching uri */ + for(hash_index = axutil_hash_first(om_element->namespaces, env); hash_index; hash_index + = axutil_hash_next(env, hash_index)) + { + axutil_hash_this(hash_index, NULL, NULL, &ns); + if(ns) + { + axiom_namespace_t *temp_ns = NULL; + axis2_char_t *temp_nsuri = NULL; + temp_ns = (axiom_namespace_t *)(ns); + temp_nsuri = axiom_namespace_get_uri(temp_ns, env); + if(axutil_strcmp(temp_nsuri, uri) == 0) + { + AXIS2_FREE(env->allocator, hash_index); + return temp_ns; + } + temp_ns = NULL; + temp_nsuri = NULL; + } + } + ns = NULL; + return NULL; + } + else if(prefix) + { + axiom_namespace_t *found_ns = NULL; + ns = axutil_hash_get(om_element->namespaces, prefix, AXIS2_HASH_KEY_STRING); + if(ns) + { + axis2_char_t *found_uri = NULL; + found_ns = (axiom_namespace_t *)ns; + found_uri = axiom_namespace_get_uri(found_ns, env); + /* If uri provided, ensure this namespace found by prefix matches the uri */ + if(uri) + { + return (axutil_strcmp(found_uri, uri) == 0) ? found_ns : NULL; + } + return found_ns; + } + } + return NULL; +} + +AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL +axiom_element_find_namespace_with_qname( + axiom_element_t * element, + const axutil_env_t * env, + axiom_node_t * node, + axutil_qname_t * qname) +{ + AXIS2_ENV_CHECK(env, NULL); + if(!element || !node || !qname) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "element or node or qname is NULL"); + return NULL; + } + + if(axutil_qname_get_uri(qname, env)) + { + return axiom_element_find_namespace(element, env, node, axutil_qname_get_uri(qname, env), + axutil_qname_get_prefix(qname, env)); + } + else + { + return NULL; + } +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_element_add_attribute( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_attribute_t * attribute, + axiom_node_t * element_node) +{ + + axutil_qname_t *qname = NULL; + axiom_namespace_t *om_namespace = NULL; + axiom_namespace_t *temp_ns = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, attribute, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, element_node, AXIS2_FAILURE); + + /* ensure the attribute's namespace structure is declared */ + om_namespace = axiom_attribute_get_namespace(attribute, env); + if(om_namespace) + { + temp_ns = axiom_element_find_namespace(om_element, env, element_node, + axiom_namespace_get_uri(om_namespace, env), axiom_namespace_get_prefix(om_namespace, + env)); + if(temp_ns != om_namespace) + { + axis2_status_t status; + /* as the attribute's namespace structure is not declared in scope, + declare it here */ + status = axiom_element_declare_namespace_assume_param_ownership(om_element, env, + om_namespace); + if(status != AXIS2_SUCCESS) + { + return status; + } + } + } + + if(!(om_element->attributes)) + { + om_element->attributes = axutil_hash_make(env); + if(!(om_element->attributes)) + { + return AXIS2_FAILURE; + } + } + + qname = axiom_attribute_get_qname(attribute, env); + if(qname) + { + axis2_char_t *name = axutil_qname_to_string(qname, env); + axutil_hash_set(om_element->attributes, name, AXIS2_HASH_KEY_STRING, attribute); + axiom_attribute_increment_ref(attribute, env); + } + return ((qname) ? AXIS2_SUCCESS : AXIS2_FAILURE); +} + +AXIS2_EXTERN axiom_attribute_t *AXIS2_CALL +axiom_element_get_attribute( + axiom_element_t * om_element, + const axutil_env_t * env, + axutil_qname_t * qname) +{ + axis2_char_t *name = NULL; + axiom_attribute_t *attr = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, qname, NULL); + + name = axutil_qname_to_string(qname, env); + + if((om_element->attributes) && name) + { + attr = (axiom_attribute_t *)(axutil_hash_get(om_element->attributes, name, + AXIS2_HASH_KEY_STRING)); + } + return attr; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_element_free( + axiom_element_t * om_element, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + if(!om_element) + { + return; + } + + if(om_element->localname) + { + axutil_string_free(om_element->localname, env); + } + if(om_element->ns) + { + /* it is the responsibility of the element where the namespace is declared to free it */ + } + if(om_element->attributes) + { + axutil_hash_index_t *hi; + void *val = NULL; + + for(hi = axutil_hash_first(om_element->attributes, env); hi; hi = axutil_hash_next(env, hi)) + { + axutil_hash_this(hi, NULL, NULL, &val); + + if(val) + { + axiom_attribute_free((axiom_attribute_t *)val, env); + } + } + axutil_hash_free(om_element->attributes, env); + } + + if(om_element->namespaces) + { + axutil_hash_index_t *hi; + void *val = NULL; + for(hi = axutil_hash_first(om_element->namespaces, env); hi; hi = axutil_hash_next(env, hi)) + { + axutil_hash_this(hi, NULL, NULL, &val); + if(val) + { + axiom_namespace_free((axiom_namespace_t *)val, env); + } + } + axutil_hash_free(om_element->namespaces, env); + } + if(om_element->qname) + { + axutil_qname_free(om_element->qname, env); + } + if(om_element->children_iter) + { + axiom_children_iterator_free(om_element->children_iter, env); + } + if(om_element->child_ele_iter) + { + AXIOM_CHILD_ELEMENT_ITERATOR_FREE(om_element->child_ele_iter, env); + } + if(om_element->children_qname_iter) + { + axiom_children_qname_iterator_free(om_element->children_qname_iter, env); + } + if(om_element->text_value) + { + AXIS2_FREE(env->allocator, om_element->text_value); + } + AXIS2_FREE(env->allocator, om_element); + + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_element_serialize_start_part( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_output_t * om_output, + axiom_node_t * ele_node) +{ + int status = AXIS2_SUCCESS; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE); + + if(om_element->is_empty) + { + if(om_element->ns) + { + axis2_char_t *uri = NULL; + axis2_char_t *prefix = NULL; + + uri = axiom_namespace_get_uri(om_element->ns, env); + prefix = axiom_namespace_get_prefix(om_element->ns, env); + + if((uri) && (prefix) && (axutil_strcmp(prefix, "") != 0)) + { + status = axiom_output_write(om_output, env, AXIOM_ELEMENT, 4, + axutil_string_get_buffer(om_element-> localname, env), uri, prefix, NULL); + } + else if(uri) + { + status = axiom_output_write(om_output, env, AXIOM_ELEMENT, 4, + axutil_string_get_buffer(om_element-> localname, env), uri, NULL, NULL); + } + } + else + { + status = axiom_output_write(om_output, env, AXIOM_ELEMENT, 4, axutil_string_get_buffer( + om_element-> localname, env), NULL, NULL, NULL); + } + } + else + { + if(om_element->ns) + { + axis2_char_t *uri = NULL; + axis2_char_t *prefix = NULL; + + uri = axiom_namespace_get_uri(om_element->ns, env); + prefix = axiom_namespace_get_prefix(om_element->ns, env); + + if((uri) && (prefix) && (axutil_strcmp(prefix, "") != 0)) + { + status = axiom_output_write(om_output, env, AXIOM_ELEMENT, 3, + axutil_string_get_buffer(om_element-> localname, env), uri, prefix); + } + else if(uri) + { + status = axiom_output_write(om_output, env, AXIOM_ELEMENT, 2, + axutil_string_get_buffer(om_element-> localname, env), uri); + } + } + else + { + status = axiom_output_write(om_output, env, AXIOM_ELEMENT, 1, axutil_string_get_buffer( + om_element-> localname, env)); + } + } + if(om_element->attributes) + { + axutil_hash_index_t *hi; + void *val; + for(hi = axutil_hash_first(om_element->attributes, env); hi; hi = axutil_hash_next(env, hi)) + { + axutil_hash_this(hi, NULL, NULL, &val); + + if(val) + { + status = axiom_attribute_serialize((axiom_attribute_t *)val, env, om_output); + } + else + { + status = AXIS2_FAILURE; + } + } + } + + if(om_element->namespaces) + { + axutil_hash_index_t *hi; + void *val; + for(hi = axutil_hash_first(om_element->namespaces, env); hi; hi = axutil_hash_next(env, hi)) + { + axutil_hash_this(hi, NULL, NULL, &val); + + if(val) + { + status = axiom_namespace_serialize((axiom_namespace_t *)val, env, om_output); + } + else + { + status = AXIS2_FAILURE; + } + } + } + + return status; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_element_serialize_end_part( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_output_t * om_output) +{ + int status = AXIS2_SUCCESS; + AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE); + status = axiom_output_write(om_output, env, AXIOM_ELEMENT, 0); + return status; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_element_get_localname( + axiom_element_t * om_element, + const axutil_env_t * env) +{ + if(om_element->localname) + return (axis2_char_t *)axutil_string_get_buffer(om_element->localname, env); + else + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_element_set_localname( + axiom_element_t * om_element, + const axutil_env_t * env, + const axis2_char_t * localname) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + if(om_element->localname) + { + axutil_string_free(om_element->localname, env); + om_element->localname = NULL; + } + om_element->localname = axutil_string_create(env, localname); + if(!(om_element->localname)) + { + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL +axiom_element_get_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * ele_node) +{ + axiom_namespace_t *ns = NULL; + AXIS2_ENV_CHECK(env, NULL); + + if(om_element->ns) + { + ns = om_element->ns; + } + else + { + ns = axiom_element_get_default_namespace(om_element, env, ele_node); + + } + return ns; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_element_set_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_namespace_t * ns, + axiom_node_t * node) +{ + axiom_namespace_t *om_ns = NULL; + axis2_status_t status = AXIS2_SUCCESS; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, ns, AXIS2_FAILURE); + om_ns = axiom_element_find_namespace(om_element, env, node, axiom_namespace_get_uri(ns, env), + axiom_namespace_get_prefix(ns, env)); + if(!om_ns) + { + status = axiom_element_declare_namespace(om_element, env, node, ns); + if(status == AXIS2_FAILURE) + { + return AXIS2_FAILURE; + } + om_element->ns = ns; + } + else + { + om_element->ns = om_ns; + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_element_set_namespace_assume_param_ownership( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_namespace_t * ns) +{ + om_element->ns = ns; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axutil_hash_t *AXIS2_CALL +axiom_element_get_all_attributes( + axiom_element_t * om_element, + const axutil_env_t * env) +{ + + return om_element->attributes; +} + +AXIS2_EXTERN axutil_hash_t *AXIS2_CALL +axiom_element_get_namespaces( + axiom_element_t * om_element, + const axutil_env_t * env) +{ + return om_element->namespaces; +} + +AXIS2_EXTERN axutil_qname_t *AXIS2_CALL +axiom_element_get_qname( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * ele_node) +{ + axiom_namespace_t *ns = NULL; + AXIS2_ENV_CHECK(env, NULL); + + if(om_element->qname) + { + return om_element->qname; + } + else + { + ns = axiom_element_get_namespace(om_element, env, ele_node); + if(ns) + { + if(axiom_namespace_get_prefix(ns, env)) + { + om_element->qname = axutil_qname_create(env, axutil_string_get_buffer( + om_element->localname, env), axiom_namespace_get_uri(ns, env), + axiom_namespace_get_prefix(ns, env)); + } + else + { + om_element->qname = axutil_qname_create(env, axutil_string_get_buffer( + om_element->localname, env), axiom_namespace_get_uri(ns, env), NULL); + } + } + else + { + om_element->qname = axutil_qname_create(env, axutil_string_get_buffer( + om_element->localname, env), NULL, NULL); + } + } + return om_element->qname; +} + +AXIS2_EXTERN axiom_children_iterator_t *AXIS2_CALL +axiom_element_get_children( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node) +{ + AXIS2_PARAM_CHECK(env->error, element_node, NULL); + + if(!om_element->children_iter) + { + om_element->children_iter = axiom_children_iterator_create(env, axiom_node_get_first_child( + element_node, env)); + } + else + { + axiom_children_iterator_reset(om_element->children_iter, env); + } + return om_element->children_iter; +} + +AXIS2_EXTERN axiom_children_qname_iterator_t *AXIS2_CALL +axiom_element_get_children_with_qname( + axiom_element_t * om_element, + const axutil_env_t * env, + axutil_qname_t * element_qname, + axiom_node_t * element_node) +{ + AXIS2_PARAM_CHECK(env->error, element_node, NULL); + if(om_element->children_qname_iter) + { + axiom_children_qname_iterator_free(om_element->children_qname_iter, env); + om_element->children_qname_iter = NULL; + } + om_element->children_qname_iter = axiom_children_qname_iterator_create(env, + axiom_node_get_first_child(element_node, env), element_qname); + return om_element->children_qname_iter; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_element_get_first_child_with_qname( + axiom_element_t * om_element, + const axutil_env_t * env, + axutil_qname_t * element_qname, + axiom_node_t * element_node, + axiom_node_t ** child_node) +{ + axiom_node_t *om_node = NULL; + axiom_children_qname_iterator_t *children_iterator = NULL; + + AXIS2_PARAM_CHECK(env->error, element_qname, NULL); + AXIS2_PARAM_CHECK(env->error, element_node, NULL); + + om_node = axiom_node_get_first_child(element_node, env); + if(!om_node) + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "There are no child elements for the node"); + return NULL; + } + children_iterator = axiom_children_qname_iterator_create(env, om_node, element_qname); + if(!children_iterator) + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Could not create children qname iterator"); + return NULL; + } + om_node = NULL; + if(axiom_children_qname_iterator_has_next(children_iterator, env)) + { + om_node = axiom_children_qname_iterator_next(children_iterator, env); + } + if(om_node && (axiom_node_get_node_type(om_node, env) == AXIOM_ELEMENT)) + { + axiom_children_qname_iterator_free(children_iterator, env); + + if(child_node) + { + *child_node = om_node; + } + return (axiom_element_t *)axiom_node_get_data_element(om_node, env); + } + + axiom_children_qname_iterator_free(children_iterator, env); + + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_element_remove_attribute( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_attribute_t * om_attribute) +{ + axutil_qname_t *qname = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_attribute, AXIS2_FAILURE); + + qname = axiom_attribute_get_qname(om_attribute, env); + if(qname && (om_element->attributes)) + { + axis2_char_t *name = NULL; + name = axutil_qname_to_string(qname, env); + if(name) + { + axutil_hash_set(om_element->attributes, name, AXIS2_HASH_KEY_STRING, NULL); + return AXIS2_SUCCESS; + } + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_element_get_first_element( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node, + axiom_node_t ** first_ele_node) +{ + axiom_node_t *temp_node = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, element_node, NULL); + + temp_node = axiom_node_get_first_child(element_node, env); + while(temp_node) + { + if(axiom_node_get_node_type(temp_node, env) == AXIOM_ELEMENT) + { + if(first_ele_node) + { + *first_ele_node = temp_node; + } + return (axiom_element_t *)axiom_node_get_data_element(temp_node, env); + } + else + { + temp_node = axiom_node_get_next_sibling(temp_node, env); + } + } + return NULL; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_element_get_text( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node) +{ + axis2_char_t *dest = NULL; + const axis2_char_t *temp_text = NULL; + axiom_text_t *text_node = NULL; + axiom_node_t *temp_node = NULL; + + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, element_node, NULL); + + if(om_element->text_value) + { + AXIS2_FREE(env->allocator, om_element->text_value); + om_element->text_value = NULL; + } + + temp_node = axiom_node_get_first_child(element_node, env); + + while(temp_node) + { + if(axiom_node_get_node_type(temp_node, env) == AXIOM_TEXT) + { + int dest_len = 0; + int curr_len = 0; + axis2_char_t *temp_dest = NULL; + + text_node = (axiom_text_t *)axiom_node_get_data_element(temp_node, env); + if(text_node) + { + temp_text = axiom_text_get_value(text_node, env); + if(dest && temp_text && axutil_strcmp(temp_text, "") != 0) + { + dest_len = axutil_strlen(dest); + curr_len = dest_len + axutil_strlen(temp_text); + temp_dest = AXIS2_MALLOC(env->allocator, (curr_len + 1) * sizeof(axis2_char_t)); + + memcpy(temp_dest, dest, dest_len * sizeof(axis2_char_t)); + memcpy((temp_dest + dest_len * sizeof(axis2_char_t)), temp_text, curr_len + - dest_len); + + temp_dest[curr_len] = '\0'; + + AXIS2_FREE(env->allocator, dest); + dest = NULL; + dest = temp_dest; + } + else if(!dest && temp_text && axutil_strcmp(temp_text, "") != 0) + { + dest = axutil_strdup(env, temp_text); + } + } + } + temp_node = axiom_node_get_next_sibling(temp_node, env); + } + + om_element->text_value = dest; + return om_element->text_value; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_element_set_text( + axiom_element_t * om_element, + const axutil_env_t * env, + const axis2_char_t * text, + axiom_node_t * element_node) +{ + axiom_node_t *temp_node, *next_node; + axiom_text_t *om_text = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, text, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, element_node, AXIS2_FAILURE); + + next_node = axiom_node_get_first_child(element_node, env); + while(next_node) + { + temp_node = next_node; + next_node = axiom_node_get_next_sibling(temp_node, env); + if(axiom_node_get_node_type(temp_node, env) == AXIOM_TEXT) + { + axiom_node_free_tree(temp_node, env); + } + } + + om_text = axiom_text_create(env, NULL, text, &temp_node); + axiom_node_add_child(element_node, env, temp_node); + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_element_to_string( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node) +{ + return axiom_node_to_string(element_node, env); +} + +AXIS2_EXTERN axiom_child_element_iterator_t *AXIS2_CALL +axiom_element_get_child_elements( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node) +{ + axiom_node_t *first_node = NULL; + axiom_element_t *ele = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, element_node, NULL); + ele = axiom_element_get_first_element(om_element, env, element_node, &first_node); + if(om_element->child_ele_iter) + { + return om_element->child_ele_iter; + } + else if(ele && first_node) + { + om_element->child_ele_iter = axiom_child_element_iterator_create(env, first_node); + return om_element->child_ele_iter; + } + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_element_build( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * om_ele_node) +{ + axiom_stax_builder_t *builder = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + AXIS2_PARAM_CHECK(env->error, om_ele_node, AXIS2_FAILURE); + if(axiom_node_get_node_type(om_ele_node, env) != AXIOM_ELEMENT) + { + return AXIS2_FAILURE; + } + + builder = axiom_node_get_builder(om_ele_node, env); + if(!builder) + { + return AXIS2_FAILURE; + } + while(!axiom_node_is_complete(om_ele_node, env) + && !axiom_stax_builder_is_complete(builder, env)) + { + void *value = NULL; + value = axiom_stax_builder_next(builder, env); + if(!value) + { + return AXIS2_FAILURE; + } + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL +axiom_element_get_default_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * element_node) +{ + axiom_node_t *parent_node = NULL; + axiom_namespace_t *default_ns = NULL; + + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, element_node, NULL); + + if(om_element->namespaces) + { + default_ns = axutil_hash_get(om_element->namespaces, "", AXIS2_HASH_KEY_STRING); + if(default_ns) + { + return default_ns; + } + } + + parent_node = axiom_node_get_parent(element_node, env); + if((parent_node) && (axiom_node_get_node_type(parent_node, env) == AXIOM_ELEMENT)) + { + axiom_element_t *parent_ele = NULL; + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + if(parent_ele) + { + return axiom_element_get_default_namespace(parent_ele, env, parent_node); + } + } + return NULL; +} + +/** + * declared a default namespace explicitly + */ +AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL +axiom_element_declare_default_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axis2_char_t * uri) +{ + axiom_namespace_t *default_ns = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, uri, NULL); + + if(axutil_strcmp(uri, "") == 0) + { + return NULL; + } + + default_ns = axiom_namespace_create(env, uri, ""); + if(!default_ns) + { + return NULL; + } + if(!om_element->namespaces) + { + om_element->namespaces = axutil_hash_make(env); + if(!(om_element->namespaces)) + { + axiom_namespace_free(default_ns, env); + return NULL; + } + } + + axutil_hash_set(om_element->namespaces, "", AXIS2_HASH_KEY_STRING, default_ns); + axiom_namespace_increment_ref(default_ns, env); + return default_ns; +} + +/** + * checks for the namespace in the context of this element + * with the given prefix + */ + +AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL +axiom_element_find_namespace_uri( + axiom_element_t * om_element, + const axutil_env_t * env, + const axis2_char_t * prefix, + axiom_node_t * element_node) +{ + axiom_node_t *parent_node = NULL; + axiom_namespace_t *ns = NULL; + + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, element_node, NULL); + AXIS2_PARAM_CHECK(env->error, prefix, NULL); + + if(om_element->namespaces) + { + ns = axutil_hash_get(om_element->namespaces, prefix, AXIS2_HASH_KEY_STRING); + if(ns) + { + return ns; + } + } + + parent_node = axiom_node_get_parent(element_node, env); + if((parent_node) && (axiom_node_get_node_type(parent_node, env) == AXIOM_ELEMENT)) + { + axiom_element_t *parent_ele = NULL; + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + if(parent_ele) + { + return axiom_element_find_namespace_uri(parent_ele, env, prefix, parent_node); + } + } + return NULL; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_element_get_attribute_value( + axiom_element_t * om_element, + const axutil_env_t * env, + axutil_qname_t * qname) +{ + axis2_char_t *name = NULL; + axiom_attribute_t *attr = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, qname, NULL); + + name = axutil_qname_to_string(qname, env); + + if((om_element->attributes) && (NULL != name)) + { + attr = (axiom_attribute_t *)axutil_hash_get(om_element->attributes, name, + AXIS2_HASH_KEY_STRING); + if(attr) + { + return axiom_attribute_get_value(attr, env); + } + } + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_element_set_namespace_with_no_find_in_current_scope( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_namespace_t * om_ns) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_ns, AXIS2_FAILURE); + om_element->ns = om_ns; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axutil_hash_t *AXIS2_CALL +axiom_element_extract_attributes( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * ele_node) +{ + axutil_hash_index_t *hi = NULL; + axutil_hash_t *ht_cloned = NULL; + + axiom_attribute_t *om_attr = NULL; + axiom_attribute_t *cloned_attr = NULL; + + axiom_namespace_t *om_ns = NULL; + /*axiom_namespace_t *cloned_ns = NULL; */ + + axis2_char_t *key = NULL; + axutil_qname_t *qn = NULL; + + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + if(!om_element->attributes) + { + return NULL; + } + ht_cloned = axutil_hash_make(env); + if(!ht_cloned) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + for(hi = axutil_hash_first(om_element->attributes, env); hi; hi = axutil_hash_next(env, hi)) + { + void *val = NULL; + axutil_hash_this(hi, NULL, NULL, &val); + if(val) + { + om_attr = (axiom_attribute_t *)val; + cloned_attr = axiom_attribute_clone(om_attr, env); + + om_ns = axiom_attribute_get_namespace(om_attr, env); + if(om_ns) + { + /*cloned_ns = axiom_namespace_clone(om_ns, env); */ + /*axiom_attribute_set_namespace(cloned_attr, env, cloned_ns); */ + axiom_attribute_set_namespace(cloned_attr, env, om_ns); + } + qn = axiom_attribute_get_qname(cloned_attr, env); + key = axutil_qname_to_string(qn, env); + axutil_hash_set(ht_cloned, key, AXIS2_HASH_KEY_STRING, cloned_attr); + } + val = NULL; + key = NULL; + qn = NULL; + om_attr = NULL; + cloned_attr = NULL; + om_ns = NULL; + /*cloned_ns = NULL; */ + } + return ht_cloned; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_element_get_attribute_value_by_name( + axiom_element_t * om_element, + const axutil_env_t * env, + axis2_char_t * attr_name) +{ + axutil_hash_index_t *hi = NULL; + + AXIS2_PARAM_CHECK(env->error, attr_name, NULL); + if(!om_element->attributes) + { + return NULL; + } + for(hi = axutil_hash_first(om_element->attributes, env); hi; hi = axutil_hash_next(env, hi)) + { + void *attr = NULL; + axiom_attribute_t *om_attr = NULL; + axutil_hash_this(hi, NULL, NULL, &attr); + if(attr) + { + axis2_char_t *this_attr_name; + axis2_char_t *this_attr_value; + axis2_char_t *attr_qn_str = NULL; + axiom_namespace_t *attr_ns = NULL; + axis2_char_t *prefix = NULL; + + om_attr = (axiom_attribute_t *)attr; + this_attr_name = axiom_attribute_get_localname(om_attr, env); + this_attr_value = axiom_attribute_get_value(om_attr, env); + attr_ns = axiom_attribute_get_namespace(om_attr, env); + if(attr_ns) + { + prefix = axiom_namespace_get_prefix(attr_ns, env); + if(prefix) + { + axis2_char_t *tmp_val = NULL; + tmp_val = axutil_stracat(env, prefix, ":"); + attr_qn_str = axutil_stracat(env, tmp_val, this_attr_name); + if(tmp_val) + { + AXIS2_FREE(env->allocator, tmp_val); + tmp_val = NULL; + } + } + } + else + { + attr_qn_str = axutil_strdup(env, this_attr_name); + } + + if(attr_qn_str && axutil_strcmp(attr_qn_str, attr_name) == 0) + { + AXIS2_FREE(env->allocator, attr_qn_str); + attr_qn_str = NULL; + AXIS2_FREE(env->allocator, hi); + return this_attr_value; + } + + AXIS2_FREE(env->allocator, attr_qn_str); + attr_qn_str = NULL; + } + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_element_create_str( + const axutil_env_t * env, + axiom_node_t * parent, + axutil_string_t * localname, + axiom_namespace_t * ns, + axiom_node_t ** node) +{ + axiom_element_t *element; + AXIS2_ENV_CHECK(env, NULL); + + if(!localname || !node) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "localname or node is NULL"); + return NULL; + } + + (*node) = axiom_node_create(env); + if(!(*node)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + element = (axiom_element_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_element_t)); + + if(!element) + { + AXIS2_FREE(env->allocator, (*node)); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + element->ns = NULL; + element->localname = NULL; + element->attributes = NULL; + element->namespaces = NULL; + element->qname = NULL; + element->child_ele_iter = NULL; + element->children_iter = NULL; + element->children_qname_iter = NULL; + element->text_value = NULL; + element->next_ns_prefix_number = 0; + element->is_empty = AXIS2_FALSE; + + element->localname = axutil_string_clone(localname, env); + if(!element->localname) + { + AXIS2_FREE(env->allocator, element); + AXIS2_FREE(env->allocator, (*node)); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + if(parent) + { + axiom_node_add_child(parent, env, (*node)); + } + axiom_node_set_complete((*node), env, AXIS2_FALSE); + axiom_node_set_node_type((*node), env, AXIOM_ELEMENT); + axiom_node_set_data_element((*node), env, element); + + if(ns) + { + axis2_char_t *uri = NULL; + axis2_char_t *prefix = NULL; + + uri = axiom_namespace_get_uri(ns, env); + prefix = axiom_namespace_get_prefix(ns, env); + + element->ns = axiom_element_find_namespace(element, env, *node, uri, prefix); + if(!(element->ns)) + { + if(axiom_element_declare_namespace(element, env, *node, ns) == AXIS2_SUCCESS) + { + element->ns = ns; + } + } + if(prefix && axutil_strcmp(prefix, "") == 0) + { + element->ns = NULL; + } + } + + return element; +} + +AXIS2_EXTERN axutil_string_t *AXIS2_CALL +axiom_element_get_localname_str( + axiom_element_t * om_element, + const axutil_env_t * env) +{ + return om_element->localname; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_element_set_localname_str( + axiom_element_t * om_element, + const axutil_env_t * env, + axutil_string_t * localname) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + + if(om_element->localname) + { + axutil_string_free(om_element->localname, env); + om_element->localname = NULL; + } + + om_element->localname = axutil_string_clone(localname, env); + + if(!(om_element->localname)) + { + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_element_get_is_empty( + axiom_element_t * om_element, + const axutil_env_t * env) +{ + return om_element->is_empty; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_element_set_is_empty( + axiom_element_t * om_element, + const axutil_env_t * env, + axis2_bool_t is_empty) +{ + om_element->is_empty = is_empty; +} + +/** + * Scan the parents of the element, to determine which namespaces are inscope for the + * the element and its children. + */ +AXIS2_EXTERN axutil_hash_t * AXIS2_CALL +axiom_element_gather_parent_namespaces( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * om_node) +{ + axutil_hash_t *inscope_namespaces = NULL; + axiom_node_t *parent_node = om_node; + + while((parent_node = axiom_node_get_parent(parent_node, env)) && (axiom_node_get_node_type( + parent_node, env) == AXIOM_ELEMENT)) + { + axiom_element_t *parent_element = (axiom_element_t *)axiom_node_get_data_element( + parent_node, env); + axutil_hash_t *parent_namespaces = axiom_element_get_namespaces(parent_element, env); + if(parent_namespaces) + { + axutil_hash_index_t *hi; + void *val; + for(hi = axutil_hash_first(parent_namespaces, env); hi; hi = axutil_hash_next(env, hi)) + { + axutil_hash_this(hi, NULL, NULL, &val); + if(val) + { + /* Check if prefix is already associated with some namespace in node being detached */ + if(!axiom_element_find_declared_namespace(om_element, env, NULL, + axiom_namespace_get_prefix((axiom_namespace_t *)val, env))) + { + axis2_char_t *key = axiom_namespace_get_prefix((axiom_namespace_t *)val, + env); + if(!key) + key = ""; + /* Check if prefix already associated with some namespace in a parent node */ + if(!(inscope_namespaces && axutil_hash_get(inscope_namespaces, key, + AXIS2_HASH_KEY_STRING))) + { + /* Remember this namespace as needing to be declared, if used */ + if(!inscope_namespaces) + inscope_namespaces = axutil_hash_make(env); + if(inscope_namespaces) + axutil_hash_set(inscope_namespaces, key, AXIS2_HASH_KEY_STRING, val); + } + } + } + } + } + } + + return inscope_namespaces; +} + +/** + * Test if the provided namespace pointer is declared in a parent namespace + * If so, redeclare it in the provided root element + */ +AXIS2_EXTERN void AXIS2_CALL +axiom_element_use_parent_namespace( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * om_node, + axiom_namespace_t *ns, + axiom_element_t * root_element, + axutil_hash_t *inscope_namespaces) +{ + if(ns && inscope_namespaces) + { + axiom_namespace_t *parent_ns; + axis2_char_t *key = axiom_namespace_get_prefix(ns, env); + if(!key) + key = ""; + + parent_ns = axutil_hash_get(inscope_namespaces, key, AXIS2_HASH_KEY_STRING); + /* Check if namespace is a namespace declared in a parent and not also + declared at an intermediate level */ + if(parent_ns && (parent_ns == ns) && (ns != axiom_element_find_namespace(om_element, env, + om_node, axiom_namespace_get_uri(ns, env), axiom_namespace_get_prefix(ns, env)))) + { + /* Redeclare this parent namespace at the level of the element being detached */ + axiom_element_declare_namespace_assume_param_ownership(root_element, env, parent_ns); + /* Remove the namespace from the inscope parent namespaces now that it has + been redeclared. */ + axutil_hash_set(inscope_namespaces, key, AXIS2_HASH_KEY_STRING, NULL); + } + } +} + +/** + * For each child node, determine if it uses a namespace from a parent of the node being detached + * If so, re-declare that namespace in the node being detached + */ +AXIS2_EXTERN void AXIS2_CALL +axiom_element_redeclare_parent_namespaces( + axiom_element_t * om_element, + const axutil_env_t * env, + axiom_node_t * om_node, + axiom_element_t * root_element, + axutil_hash_t *inscope_namespaces) +{ + axiom_node_t *child_node; + axutil_hash_t * attributes; + + if(!om_element || !om_node || !inscope_namespaces) + return; + + /* ensure the element's namespace is declared */ + axiom_element_use_parent_namespace(om_element, env, om_node, om_element->ns, root_element, + inscope_namespaces); + + /* for each attribute, ensure the attribute's namespace is declared */ + attributes = om_element->attributes; + if(attributes) + { + axutil_hash_index_t *hi; + void *val; + for(hi = axutil_hash_first(attributes, env); hi; hi = axutil_hash_next(env, hi)) + { + axutil_hash_this(hi, NULL, NULL, &val); + if(val) + { + axiom_element_use_parent_namespace(om_element, env, om_node, + axiom_attribute_get_namespace((axiom_attribute_t *)val, env), root_element, + inscope_namespaces); + } + } + } + + /* ensure the namespaces in all the children are declared */ + child_node = axiom_node_get_first_child(om_node, env); + while(child_node && (axutil_hash_count(inscope_namespaces) > 0)) + { + if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT) + { + axiom_element_redeclare_parent_namespaces(axiom_node_get_data_element(child_node, env), + env, child_node, root_element, inscope_namespaces); + } + child_node = axiom_node_get_next_sibling(child_node, env); + } +} diff --git a/axiom/src/om/om_namespace.c b/axiom/src/om/om_namespace.c new file mode 100644 index 0000000..2d9df2f --- /dev/null +++ b/axiom/src/om/om_namespace.c @@ -0,0 +1,385 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_namespace.h> +#include <axutil_string.h> +#include "axiom_namespace_internal.h" + +struct axiom_namespace +{ + + /** namespace URI */ + axutil_string_t *uri; + + /** namespace prefix */ + axutil_string_t *prefix; + + axis2_char_t *key; + + int ref; +}; + +AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL +axiom_namespace_create( + const axutil_env_t * env, + const axis2_char_t * uri, + const axis2_char_t * prefix) +{ + axiom_namespace_t *om_namespace = NULL; + + AXIS2_ENV_CHECK(env, NULL); + if(!uri) + { + uri = ""; + } + + om_namespace = (axiom_namespace_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_namespace_t)); + if(!om_namespace) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + om_namespace->ref = 0; + om_namespace->prefix = NULL; + om_namespace->uri = NULL; + om_namespace->key = NULL; + + om_namespace->uri = axutil_string_create(env, uri); + if(!om_namespace->uri) + { + AXIS2_FREE(env->allocator, om_namespace); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + if(prefix) + { + om_namespace->prefix = axutil_string_create(env, prefix); + if(!om_namespace->prefix) + { + AXIS2_FREE(env->allocator, om_namespace); + AXIS2_FREE(env->allocator, om_namespace->uri); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + } + + return om_namespace; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_namespace_free( + axiom_namespace_t * om_namespace, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(--om_namespace->ref > 0) + { + return; + } + + if(om_namespace->prefix) + { + axutil_string_free(om_namespace->prefix, env); + } + + if(om_namespace->uri) + { + axutil_string_free(om_namespace->uri, env); + } + + if(om_namespace->key) + { + AXIS2_FREE(env->allocator, om_namespace->key); + } + + AXIS2_FREE(env->allocator, om_namespace); + + return; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_namespace_equals( + axiom_namespace_t * om_namespace, + const axutil_env_t * env, + axiom_namespace_t * om_namespace1) +{ + int uris_differ = 0; + int prefixes_differ = 0; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_namespace, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_namespace1, AXIS2_FAILURE); + + if(!om_namespace || !om_namespace1) + { + return AXIS2_FALSE; + } + + if(om_namespace->uri && om_namespace1->uri) + { + uris_differ = axutil_strcmp(axutil_string_get_buffer(om_namespace->uri, env), + axutil_string_get_buffer(om_namespace1->uri, env)); + } + else + { + uris_differ = (om_namespace->uri || om_namespace1->uri); + } + + if(om_namespace->prefix && om_namespace1->prefix) + { + prefixes_differ = axutil_strcmp(axutil_string_get_buffer(om_namespace->prefix, env), + axutil_string_get_buffer(om_namespace1->prefix, env)); + } + else + { + prefixes_differ = (om_namespace->prefix || om_namespace1->prefix); + } + + return (!uris_differ && !prefixes_differ); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_namespace_serialize( + axiom_namespace_t * om_namespace, + const axutil_env_t * env, + axiom_output_t * om_output) +{ + int status = AXIS2_SUCCESS; + if(!om_namespace) + { + return AXIS2_FAILURE; + } + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE); + + if(om_namespace->uri && NULL != om_namespace->prefix && axutil_strcmp(axutil_string_get_buffer( + om_namespace->prefix, env), "") != 0) + { + status = axiom_output_write(om_output, env, AXIOM_NAMESPACE, 2, axutil_string_get_buffer( + om_namespace-> prefix, env), axutil_string_get_buffer(om_namespace->uri, env)); + } + else if(om_namespace->uri) + { + status = axiom_output_write(om_output, env, AXIOM_NAMESPACE, 2, NULL, + axutil_string_get_buffer(om_namespace->uri, env)); + } + return status; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_namespace_get_uri( + axiom_namespace_t * om_namespace, + const axutil_env_t * env) +{ + if(om_namespace->uri) + { + return (axis2_char_t *)axutil_string_get_buffer(om_namespace->uri, env); + } + return NULL; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_namespace_get_prefix( + axiom_namespace_t * om_namespace, + const axutil_env_t * env) +{ + if(om_namespace->prefix) + { + return (axis2_char_t *)axutil_string_get_buffer(om_namespace->prefix, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL +axiom_namespace_clone( + axiom_namespace_t * om_namespace, + const axutil_env_t * env) +{ + axiom_namespace_t *cloned_ns = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + cloned_ns = axiom_namespace_create_str(env, om_namespace->uri, om_namespace->prefix); + if(cloned_ns) + { + return cloned_ns; + } + return NULL; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_namespace_to_string( + axiom_namespace_t * om_namespace, + const axutil_env_t * env) +{ + axis2_char_t *temp_str = NULL; + AXIS2_ENV_CHECK(env, NULL); + if(om_namespace->key) + { + AXIS2_FREE(env->allocator, om_namespace->key); + om_namespace->key = NULL; + } + if((om_namespace->uri) && (NULL != om_namespace->prefix)) + { + temp_str = axutil_stracat(env, axutil_string_get_buffer(om_namespace->uri, env), "|"); + om_namespace->key = axutil_stracat(env, temp_str, axutil_string_get_buffer( + om_namespace->prefix, env)); + if(temp_str) + { + AXIS2_FREE(env->allocator, temp_str); + temp_str = NULL; + } + } + else if((om_namespace->uri) && !(om_namespace->prefix)) + { + om_namespace->key = axutil_strdup(env, axutil_string_get_buffer(om_namespace->uri, env)); + if(!(om_namespace->key)) + { + return NULL; + } + } + return om_namespace->key; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_namespace_set_uri( + axiom_namespace_t * om_namespace, + const axutil_env_t * env, + const axis2_char_t * uri) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, uri, AXIS2_FAILURE); + + if(om_namespace->uri) + { + axutil_string_free(om_namespace->uri, env); + om_namespace->uri = NULL; + } + + om_namespace->uri = axutil_string_create(env, uri); + if(!(om_namespace->uri)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_namespace_increment_ref( + struct axiom_namespace * om_namespace, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + om_namespace->ref++; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL +axiom_namespace_create_str( + const axutil_env_t * env, + axutil_string_t * uri, + axutil_string_t * prefix) +{ + axiom_namespace_t *om_namespace = NULL; + + AXIS2_ENV_CHECK(env, NULL); + if(!uri) + { + uri = axutil_string_create(env, ""); + } + + om_namespace = (axiom_namespace_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_namespace_t)); + if(!om_namespace) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + om_namespace->ref = 0; + om_namespace->prefix = NULL; + om_namespace->uri = NULL; + om_namespace->key = NULL; + + om_namespace->uri = axutil_string_clone(uri, env); + if(!om_namespace->uri) + { + AXIS2_FREE(env->allocator, om_namespace); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + if(prefix) + { + om_namespace->prefix = axutil_string_clone(prefix, env); + if(!om_namespace->prefix) + { + AXIS2_FREE(env->allocator, om_namespace); + AXIS2_FREE(env->allocator, om_namespace->uri); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + } + + return om_namespace; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_namespace_set_uri_str( + axiom_namespace_t * om_namespace, + const axutil_env_t * env, + axutil_string_t * uri) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, uri, AXIS2_FAILURE); + + if(om_namespace->uri) + { + axutil_string_free(om_namespace->uri, env); + om_namespace->uri = NULL; + } + + om_namespace->uri = axutil_string_clone(uri, env); + if(!(om_namespace->uri)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + + return AXIS2_SUCCESS; + +} + +AXIS2_EXTERN axutil_string_t *AXIS2_CALL +axiom_namespace_get_uri_str( + axiom_namespace_t * om_namespace, + const axutil_env_t * env) +{ + return om_namespace->uri; +} + +AXIS2_EXTERN axutil_string_t *AXIS2_CALL +axiom_namespace_get_prefix_str( + axiom_namespace_t * om_namespace, + const axutil_env_t * env) +{ + return om_namespace->prefix; +} diff --git a/axiom/src/om/om_navigator.c b/axiom/src/om/om_navigator.c new file mode 100644 index 0000000..c0405b8 --- /dev/null +++ b/axiom/src/om/om_navigator.c @@ -0,0 +1,206 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_navigator.h> + +static void +axiom_navigator_update_next_node( + axiom_navigator_t * om_navigator, + const axutil_env_t * env); + +struct axiom_navigator +{ + axiom_node_t *node; + + axis2_bool_t visited; + + axiom_node_t *next; + + axiom_node_t *root; + + axis2_bool_t backtracked; + + axis2_bool_t end; + + axis2_bool_t start; + +}; + +AXIS2_EXTERN axiom_navigator_t *AXIS2_CALL +axiom_navigator_create( + const axutil_env_t * env, + axiom_node_t * om_node) +{ + axiom_navigator_t *om_navigator = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, om_node, NULL); + + om_navigator = (axiom_navigator_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_navigator_t)); + if(!om_navigator) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + om_navigator->node = NULL; + om_navigator->visited = AXIS2_FALSE; + om_navigator->next = NULL; + om_navigator->root = NULL; + om_navigator->end = AXIS2_FALSE; + om_navigator->start = AXIS2_TRUE; + om_navigator->backtracked = AXIS2_FALSE; + + om_navigator->next = om_node; + om_navigator->root = om_node; + + return om_navigator; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_navigator_free( + axiom_navigator_t * om_navigator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_FREE(env->allocator, om_navigator); + return; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_navigator_is_navigable( + axiom_navigator_t * om_navigator, + const axutil_env_t * env) +{ + if(AXIS2_TRUE == om_navigator->end) + { + return AXIS2_FALSE; + } + else + { + if(om_navigator->next) + { + return AXIS2_TRUE; + } + } + return AXIS2_FALSE; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_navigator_is_completed( + axiom_navigator_t * om_navigator, + const axutil_env_t * env) +{ + return om_navigator->end; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_navigator_visited( + axiom_navigator_t * om_navigator, + const axutil_env_t * env) +{ + return om_navigator->visited; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_navigator_next( + axiom_navigator_t * om_navigator, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + + if(!om_navigator->next) + { + return NULL; + } + + om_navigator->node = om_navigator->next; + om_navigator->visited = om_navigator->backtracked; + om_navigator->backtracked = AXIS2_FALSE; + + axiom_navigator_update_next_node(om_navigator, env); + + /** set the starting and ending flags */ + if(om_navigator->root == om_navigator->next) + { + if(!(om_navigator->start)) + { + om_navigator->end = AXIS2_TRUE; + } + else + { + om_navigator->start = AXIS2_FALSE; + } + } + return om_navigator->node; +} + +/** this method encapsulate searching logic */ +static void +axiom_navigator_update_next_node( + axiom_navigator_t * om_navigator, + const axutil_env_t * env) +{ + if(!om_navigator) + { + return; + } + + if(!om_navigator->next) + { + return; + } + + if((AXIOM_ELEMENT == axiom_node_get_node_type(om_navigator->next, env)) + && !(om_navigator->visited)) + { + if(axiom_node_get_first_child(om_navigator->next, env)) + { + om_navigator->next = axiom_node_get_first_child(om_navigator->next, env); + } + else if(AXIS2_TRUE == axiom_node_is_complete(om_navigator->next, env)) + { + om_navigator->backtracked = AXIS2_TRUE; + } + else + { + om_navigator->next = NULL; + } + } + else + { + axiom_node_t *parent = NULL; + axiom_node_t *next_sibling = NULL; + + next_sibling = axiom_node_get_next_sibling(om_navigator->next, env); + + parent = axiom_node_get_parent(om_navigator->next, env); + + if(next_sibling) + { + om_navigator->next = next_sibling; + } + else if((parent) && axiom_node_is_complete(parent, env)) + { + om_navigator->next = parent; + om_navigator->backtracked = AXIS2_TRUE; + } + else + { + om_navigator->next = NULL; + } + } +} diff --git a/axiom/src/om/om_node.c b/axiom/src/om/om_node.c new file mode 100644 index 0000000..9b525aa --- /dev/null +++ b/axiom/src/om/om_node.c @@ -0,0 +1,1455 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_internal.h" +#include "axiom_stax_builder_internal.h" +#include <axiom_element.h> +#include <axiom_text.h> +#include <axiom_data_source.h> +#include <axiom_comment.h> +#include <axiom_processing_instruction.h> +#include <axiom_doctype.h> +#include <axiom_document.h> +#include <axiom_stax_builder.h> + +struct axiom_node +{ + + /** document only available if build through builder */ + struct axiom_document *om_doc; + + axiom_stax_builder_t *builder; + + /** parent node */ + axiom_node_t *parent; + + /** previous sibling */ + axiom_node_t *prev_sibling; + + /** next sibling */ + axiom_node_t *next_sibling; + + /** first child */ + axiom_node_t *first_child; + + /** last child */ + axiom_node_t *last_child; + + /** node type, indicates the type stored in data_element */ + axiom_types_t node_type; + + /** done true means that this node is completely built , false otherwise */ + int done; + + /** instances of an om struct, whose type is defined by node type */ + void *data_element; + +}; + +static axiom_node_t * +axiom_node_detach_without_namespaces( + axiom_node_t * om_node, + const axutil_env_t * env); + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_node_create( + const axutil_env_t * env) +{ + axiom_node_t *node = NULL; + AXIS2_ENV_CHECK(env, NULL); + + node = (axiom_node_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_node_t)); + if(!node) + { + env->error->error_number = AXIS2_ERROR_NO_MEMORY; + return NULL; + } + node->first_child = NULL; + node->last_child = NULL; + node->next_sibling = NULL; + node->prev_sibling = NULL; + node->parent = NULL; + node->node_type = AXIOM_INVALID; + node->done = AXIS2_FALSE; + node->data_element = NULL; + node->om_doc = NULL; + node->builder = NULL; + return node; +} + +AXIS2_EXTERN axiom_node_t* AXIS2_CALL +axiom_node_create_from_buffer( + const axutil_env_t * env, + axis2_char_t *buffer) +{ + axiom_xml_reader_t *reader = NULL; + axiom_stax_builder_t *builder = NULL; + axiom_document_t *document = NULL; + axiom_node_t *om_node = NULL; + + reader = axiom_xml_reader_create_for_memory(env, buffer, axutil_strlen(buffer), "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; + } + + om_node = axiom_document_get_root_element(document, env); + + if(!om_node) + { + 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 om_node; +} + +static void +axiom_node_free_detached_subtree( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + /* Free any child nodes first */ + if(om_node->first_child) + { + axiom_node_t *child_node = om_node->first_child, *next_sibling; + while(child_node) + { + next_sibling = child_node->next_sibling; + axiom_node_free_detached_subtree(child_node, env); + child_node = next_sibling; + } + } + + if(om_node->node_type == AXIOM_ELEMENT) + { + if(om_node->data_element) + { + axiom_element_free((axiom_element_t *)(om_node->data_element), env); + } + } + else if(om_node->node_type == AXIOM_COMMENT) + { + if(om_node->data_element) + { + axiom_comment_free((axiom_comment_t *)(om_node->data_element), env); + } + } + else if(om_node->node_type == AXIOM_DOCTYPE) + { + /*axiom_doctype_free((axiom_doctype_t*)(om_node->data_element), env); */ + } + else if(om_node->node_type == AXIOM_PROCESSING_INSTRUCTION) + { + if(om_node->data_element) + { + axiom_processing_instruction_free( + (axiom_processing_instruction_t *)(om_node->data_element), env); + } + } + else if(om_node->node_type == AXIOM_TEXT) + { + if(om_node->data_element) + { + axiom_text_free((axiom_text_t *)(om_node->data_element), env); + } + } + else if(om_node->node_type == AXIOM_DATA_SOURCE) + { + if(om_node->data_element) + { + axiom_data_source_free((axiom_data_source_t *)(om_node->data_element), env); + } + } + + AXIS2_FREE(env->allocator, om_node); + + return; +} + +/** + * This free function will free an om_element and all the children contained in it + * If the node is still attached to the tree, it will be detached first + */ +AXIS2_EXTERN void AXIS2_CALL +axiom_node_free_tree( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, void); + if(!om_node) + { + return; + } + + /* Detach this node before freeing it and its subtree. */ + axiom_node_detach_without_namespaces(om_node, env); + + /* Free this node and its subtree */ + axiom_node_free_detached_subtree(om_node, env); + + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_add_child( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * child) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, child, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_node, AXIS2_FAILURE); + + if(child->parent) + { + child = axiom_node_detach(child, env); + } + + if(!(om_node->first_child)) + { + om_node->first_child = child; + } + else + { + axiom_node_t *last_sib = NULL; + last_sib = om_node->last_child; + if(last_sib) + { + last_sib->next_sibling = child; + child->prev_sibling = last_sib; + } + } + + child->parent = om_node; + om_node->last_child = child; + return AXIS2_SUCCESS; +} + +/** + * Detach the node without regard to any namespace references in the node or + * its children. + */ +static axiom_node_t * +axiom_node_detach_without_namespaces( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + axiom_node_t *parent = NULL; + + parent = om_node->parent; + if(!parent) + { + /* Node is already detached */ + om_node->builder = NULL; + return om_node; + } + + if(!om_node->prev_sibling) + { + parent->first_child = om_node->next_sibling; + } + else + { + axiom_node_t *prev_sib = NULL; + prev_sib = om_node->prev_sibling; + if(prev_sib) + { + prev_sib->next_sibling = om_node->next_sibling; + } + } + + if(om_node->next_sibling) + { + axiom_node_t *next_sibling = NULL; + next_sibling = om_node->next_sibling; + if(next_sibling) + { + next_sibling->prev_sibling = om_node->prev_sibling; + } + } + + if(parent->last_child && (parent->last_child == om_node)) + { + parent->last_child = om_node->prev_sibling; + } + + /* if the STAX builder's last node is what we are detaching, then we should adjust the + * last node if previous sibling is available, set that as the builder's last node. Else set the + * parent as the last node*/ + if(om_node->builder && (axiom_stax_builder_get_lastnode(om_node->builder, env) == om_node)) + { + axiom_node_t *lastnode = parent; + if(om_node->prev_sibling) + { + lastnode = om_node->prev_sibling; + } + axiom_stax_builder_set_lastnode(om_node->builder, env, lastnode); + } + + om_node->parent = NULL; + om_node->prev_sibling = NULL; + om_node->next_sibling = NULL; + om_node->builder = NULL; + return om_node; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_node_detach( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + axutil_hash_t *inscope_namespaces = NULL; + axiom_element_t *om_element = NULL; + + AXIS2_ENV_CHECK(env, NULL); + if(!om_node) + { + return NULL; + } + + /* If this is an element node, determine which namespaces are available to it + from its parent nodes. */ + if((om_node->node_type == AXIOM_ELEMENT) && (om_element = om_node->data_element)) + { + inscope_namespaces = axiom_element_gather_parent_namespaces(om_element, env, om_node); + } + + /* Detach this node from its parent. */ + om_node = axiom_node_detach_without_namespaces(om_node, env); + + /* If this is an element node, ensure that any namespaces available to it or its + children remain available after the detach. */ + if(om_node && inscope_namespaces) + { + axiom_element_redeclare_parent_namespaces(om_element, env, om_node, om_element, + inscope_namespaces); + } + + if(inscope_namespaces) + { + axutil_hash_free(inscope_namespaces, env); + } + + return om_node; +} + +/** + Internal function , only used in om and soap + not to be used by users + */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_set_parent( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * parent) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + if(!om_node) + { + return AXIS2_FAILURE; + } + + AXIS2_PARAM_CHECK(env->error, parent, AXIS2_FAILURE); + + if(parent == om_node->parent) + { /* same parent already exist */ + return AXIS2_SUCCESS; + } + /* if a new parent is assigned in place of existing + one first the node should be detached + */ + if(om_node->parent) + { + om_node = axiom_node_detach_without_namespaces(om_node, env); + } + + om_node->parent = parent; + + return AXIS2_SUCCESS; +} + +/** + * This will insert a sibling just after the current information item + * @param node the node in consideration + * @param nodeto_insert the node that will be inserted + */ + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_insert_sibling_after( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * node_to_insert) +{ + axiom_node_t *next_sib = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + AXIS2_PARAM_CHECK(env->error, node_to_insert, AXIS2_FAILURE); + + if(!om_node->parent) + { + /* We shouldn't add a sibling because this node doesn't has a parent. + * This can be the root node of the tree*/ + return AXIS2_FAILURE; + } + + node_to_insert->parent = om_node->parent; + + node_to_insert->prev_sibling = om_node; + + next_sib = om_node->next_sibling; + + if(next_sib) + { + next_sib->prev_sibling = node_to_insert; + } + + node_to_insert->next_sibling = om_node->next_sibling; + + om_node->next_sibling = node_to_insert; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_insert_sibling_before( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * node_to_insert) +{ + axiom_node_t *prev_sibling = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, node_to_insert, AXIS2_FAILURE); + + if(!om_node->parent) + { + /* We shouldn't add a sibling because this node doesn't has a parent. + * This can be the root node of the tree*/ + return AXIS2_FAILURE; + } + + node_to_insert->parent = om_node->parent; + + node_to_insert->prev_sibling = om_node->prev_sibling; + + node_to_insert->next_sibling = om_node; + + prev_sibling = om_node->prev_sibling; + + if(!prev_sibling) + { + axiom_node_t *parent = om_node->parent; + parent->first_child = node_to_insert; + } + else + { + axiom_node_t *prev_sibling = om_node->prev_sibling; + if(prev_sibling) + { + prev_sibling->next_sibling = node_to_insert; + } + } + om_node->prev_sibling = node_to_insert; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_serialize( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_output_t * om_output) +{ + + int status = AXIS2_SUCCESS; + axiom_node_t *temp_node = NULL; + axiom_node_t *nodes[256]; + int count = 0; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(!om_node) + { + return AXIS2_SUCCESS; + } + + nodes[count++] = om_node; + + AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE); + + do + { + + if(om_node->node_type == AXIOM_ELEMENT) + { + if(om_node->data_element) + { + status = axiom_element_serialize_start_part( + (axiom_element_t *)(om_node-> data_element), env, om_output, om_node); + } + if(status != AXIS2_SUCCESS) + { + return status; + } + } + else if(om_node->node_type == AXIOM_DATA_SOURCE) + { + if(om_node->data_element) + { + status = axiom_data_source_serialize( + (axiom_data_source_t *)(om_node->data_element), env, om_output); + } + if(status != AXIS2_SUCCESS) + { + return status; + } + } + else if(om_node->node_type == AXIOM_TEXT) + { + if(om_node->data_element) + { + status = axiom_text_serialize((axiom_text_t *)(om_node-> data_element), env, + om_output); + } + if(status != AXIS2_SUCCESS) + { + return status; + } + } + else if(om_node->node_type == AXIOM_COMMENT) + { + if(om_node->data_element) + { + status = axiom_comment_serialize((axiom_comment_t *)(om_node-> data_element), env, + om_output); + } + if(status != AXIS2_SUCCESS) + { + return status; + } + } + else if(om_node->node_type == AXIOM_DOCTYPE) + { + if(om_node->data_element) + { + status = axiom_doctype_serialize((axiom_doctype_t *)(om_node-> data_element), env, + om_output); + } + if(status != AXIS2_SUCCESS) + { + return status; + } + } + else if(om_node->node_type == AXIOM_PROCESSING_INSTRUCTION) + { + if(om_node->data_element) + { + status = axiom_processing_instruction_serialize( + (axiom_processing_instruction_t *)(om_node->data_element), env, om_output); + } + + if(status != AXIS2_SUCCESS) + { + return status; + } + } + + temp_node = axiom_node_get_first_child(om_node, env); + /* serialize children of this node */ + if(temp_node) + { + om_node = temp_node; + nodes[count++] = om_node; + } + else + { + if(om_node->node_type == AXIOM_ELEMENT) + { + if(om_node->data_element) + { + status = axiom_element_serialize_end_part( + (axiom_element_t *)(om_node-> data_element), env, om_output); + } + if(status != AXIS2_SUCCESS) + { + return status; + } + } + + temp_node = axiom_node_get_next_sibling(om_node, env); + if(temp_node) + { + om_node = temp_node; + nodes[count - 1] = om_node; + } + else + { + while(count > 1 && !temp_node) + { + count--; + om_node = nodes[count - 1]; + if(om_node->node_type == AXIOM_ELEMENT) + { + if(om_node->data_element) + { + status = axiom_element_serialize_end_part( + (axiom_element_t *)(om_node->data_element), env, om_output); + } + if(status != AXIS2_SUCCESS) + { + return status; + } + } + + temp_node = axiom_node_get_next_sibling(om_node, env); + } + + if(temp_node && count > 1) + { + om_node = temp_node; + nodes[count - 1] = om_node; + } + else + { + count--; + } + } + + } + } + while(count > 0); + + return status; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_serialize_sub_tree( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_output_t * om_output) +{ + + int status = AXIS2_SUCCESS; + axiom_node_t *temp_node = NULL; + axiom_node_t *nodes[256]; + int count = 0; + axutil_hash_t *namespaces = NULL; + axutil_hash_t *namespaces_from_parents = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + if(!om_node) + { + return AXIS2_SUCCESS; + } + + namespaces = axutil_hash_make(env); + if(!namespaces) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "hash for namespaces creation failed"); + return AXIS2_FAILURE; + } + + namespaces_from_parents = axutil_hash_make(env); + if(!namespaces_from_parents) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "hash for namespaces_from_parents creation failed"); + return AXIS2_FAILURE; + } + + nodes[count++] = om_node; + + AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE); + + do + { + + if(om_node->node_type == AXIOM_ELEMENT) + { + if(om_node->data_element) + { + axutil_hash_t *temp_namespaces = NULL; + axutil_hash_t *temp_attributes = NULL; + axiom_namespace_t *namespace = NULL; + status = axiom_element_serialize_start_part( + (axiom_element_t *)(om_node-> data_element), env, om_output, om_node); + temp_namespaces = axiom_element_get_namespaces( + (axiom_element_t *)(om_node-> data_element), env); + if(temp_namespaces) + { + axutil_hash_t *new_hash = NULL; + new_hash = axutil_hash_overlay(temp_namespaces, env, namespaces); + if(namespaces) + axutil_hash_free(namespaces, env); + namespaces = new_hash; + } + namespace = axiom_element_get_namespace( + (axiom_element_t *)(om_node-> data_element), env, om_node); + if(namespace) + { + axiom_namespace_t *ns = NULL; + axis2_char_t *prefix = NULL; + prefix = axiom_namespace_get_prefix(namespace, env); + if(prefix) + { + ns = axutil_hash_get(namespaces, prefix, AXIS2_HASH_KEY_STRING); + if(!ns) + { + ns = axutil_hash_get(namespaces_from_parents, prefix, + AXIS2_HASH_KEY_STRING); + if(!ns) + { + axiom_namespace_serialize(namespace, env, om_output); + axutil_hash_set(namespaces_from_parents, prefix, + AXIS2_HASH_KEY_STRING, namespace); + } + } + } + } + + temp_attributes = axiom_element_get_all_attributes( + (axiom_element_t *)(om_node->data_element), env); + if(temp_attributes) + { + axutil_hash_index_t *hi; + void *val; + for(hi = axutil_hash_first(temp_attributes, env); hi; hi = axutil_hash_next( + env, hi)) + { + axutil_hash_this(hi, NULL, NULL, &val); + + if(val) + { + axiom_namespace_t *ns = NULL; + axis2_char_t *prefix = NULL; + + namespace + = axiom_attribute_get_namespace((axiom_attribute_t *)val, env); + + if(namespace) + { + prefix = axiom_namespace_get_prefix(namespace, env); + if(prefix) + { + ns = axutil_hash_get(namespaces, prefix, AXIS2_HASH_KEY_STRING); + if(!ns) + { + ns = axutil_hash_get(namespaces_from_parents, prefix, + AXIS2_HASH_KEY_STRING); + if(!ns) + { + axiom_namespace_serialize(namespace, env, om_output); + axutil_hash_set(namespaces_from_parents, prefix, + AXIS2_HASH_KEY_STRING, namespace); + } + } + } + } + } + else + { + status = AXIS2_FAILURE; + } + } + } + } + if(status != AXIS2_SUCCESS) + { + break; + } + } + else if(om_node->node_type == AXIOM_DATA_SOURCE) + { + if(om_node->data_element) + { + status = axiom_data_source_serialize( + (axiom_data_source_t *)(om_node->data_element), env, om_output); + } + if(status != AXIS2_SUCCESS) + { + break; + } + } + else if(om_node->node_type == AXIOM_TEXT) + { + if(om_node->data_element) + { + status = axiom_text_serialize((axiom_text_t *)(om_node-> data_element), env, + om_output); + } + if(status != AXIS2_SUCCESS) + { + break; + } + } + else if(om_node->node_type == AXIOM_COMMENT) + { + if(om_node->data_element) + { + status = axiom_comment_serialize((axiom_comment_t *)(om_node-> data_element), env, + om_output); + } + if(status != AXIS2_SUCCESS) + { + break; + } + } + else if(om_node->node_type == AXIOM_DOCTYPE) + { + if(om_node->data_element) + { + status = axiom_doctype_serialize((axiom_doctype_t *)(om_node-> data_element), env, + om_output); + } + if(status != AXIS2_SUCCESS) + { + break; + } + } + else if(om_node->node_type == AXIOM_PROCESSING_INSTRUCTION) + { + if(om_node->data_element) + { + status = axiom_processing_instruction_serialize( + (axiom_processing_instruction_t *)(om_node->data_element), env, om_output); + } + + if(status != AXIS2_SUCCESS) + { + break; + } + } + + temp_node = axiom_node_get_first_child(om_node, env); + /* serialize children of this node */ + if(temp_node) + { + om_node = temp_node; + nodes[count++] = om_node; + } + else + { + if(om_node->node_type == AXIOM_ELEMENT) + { + if(om_node->data_element) + { + + axutil_hash_t *temp_attributes = NULL; + axiom_namespace_t *namespace = NULL; + /* at the writing of end part all the namespaces declared + specially to that element should be cancelled */ + + /* first checking the element namespace */ + namespace = axiom_element_get_namespace( + (axiom_element_t *)(om_node-> data_element), env, om_node); + if(namespace) + { + axiom_namespace_t *ns = NULL; + axis2_char_t *prefix = NULL; + prefix = axiom_namespace_get_prefix(namespace, env); + if(prefix) + { + ns = axutil_hash_get(namespaces_from_parents, prefix, + AXIS2_HASH_KEY_STRING); + if(ns) + { + axutil_hash_set(namespaces_from_parents, prefix, + AXIS2_HASH_KEY_STRING, NULL); + } + } + } + + /* then checking the attribute namespaces */ + + temp_attributes = axiom_element_get_all_attributes( + (axiom_element_t *)(om_node->data_element), env); + if(temp_attributes) + { + axutil_hash_index_t *hi; + void *val; + for(hi = axutil_hash_first(temp_attributes, env); hi; hi + = axutil_hash_next(env, hi)) + { + axutil_hash_this(hi, NULL, NULL, &val); + + if(val) + { + axiom_namespace_t *ns = NULL; + axis2_char_t *prefix = NULL; + + namespace = axiom_attribute_get_namespace((axiom_attribute_t *)val, + env); + + if(namespace) + { + prefix = axiom_namespace_get_prefix(namespace, env); + if(prefix) + { + ns = axutil_hash_get(namespaces_from_parents, prefix, + AXIS2_HASH_KEY_STRING); + if(ns) + { + axutil_hash_set(namespaces_from_parents, prefix, + AXIS2_HASH_KEY_STRING, NULL); + } + } + } + } + } + } + + status = axiom_element_serialize_end_part( + (axiom_element_t *)(om_node-> data_element), env, om_output); + } + if(status != AXIS2_SUCCESS) + { + break; + } + } + /* We need to make make sure that om_node is not the root when we take the next sibling */ + if(count > 1) + { + temp_node = axiom_node_get_next_sibling(om_node, env); + } + if(temp_node) + { + om_node = temp_node; + nodes[count - 1] = om_node; + } + else + { + while(count > 1 && !temp_node) + { + count--; + om_node = nodes[count - 1]; + if(om_node->node_type == AXIOM_ELEMENT) + { + if(om_node->data_element) + { + axutil_hash_t *temp_attributes = NULL; + axiom_namespace_t *namespace = NULL; + + /* similar to the earlier time, whenever the ending is happened + * namespaces declared specially to that element should be cancelled */ + + /* first checking the element namespace */ + namespace = axiom_element_get_namespace( + (axiom_element_t *)(om_node-> data_element), env, om_node); + if(namespace) + { + axiom_namespace_t *ns = NULL; + axis2_char_t *prefix = NULL; + prefix = axiom_namespace_get_prefix(namespace, env); + if(prefix) + { + ns = axutil_hash_get(namespaces_from_parents, prefix, + AXIS2_HASH_KEY_STRING); + if(ns) + { + axutil_hash_set(namespaces_from_parents, prefix, + AXIS2_HASH_KEY_STRING, NULL); + } + } + } + + /* then checking the attribute namespaces */ + + temp_attributes = axiom_element_get_all_attributes( + (axiom_element_t *)(om_node->data_element), env); + if(temp_attributes) + { + axutil_hash_index_t *hi; + void *val; + for(hi = axutil_hash_first(temp_attributes, env); hi; hi + = axutil_hash_next(env, hi)) + { + axutil_hash_this(hi, NULL, NULL, &val); + + if(val) + { + axiom_namespace_t *ns = NULL; + axis2_char_t *prefix = NULL; + + namespace = axiom_attribute_get_namespace( + (axiom_attribute_t *)val, env); + + if(namespace) + { + prefix = axiom_namespace_get_prefix(namespace, env); + if(prefix) + { + ns = axutil_hash_get(namespaces_from_parents, + prefix, AXIS2_HASH_KEY_STRING); + if(ns) + { + axutil_hash_set(namespaces_from_parents, + prefix, AXIS2_HASH_KEY_STRING, NULL); + } + } + } + } + } + } + status = axiom_element_serialize_end_part( + (axiom_element_t *)(om_node->data_element), env, om_output); + } + if(status != AXIS2_SUCCESS) + { + break; + } + } + + temp_node = axiom_node_get_next_sibling(om_node, env); + } + + if(temp_node && count > 1) + { + om_node = temp_node; + nodes[count - 1] = om_node; + } + else + { + count--; + } + } + } + } + while(count > 0); + + axutil_hash_free(namespaces_from_parents, env); + axutil_hash_free(namespaces, env); + + return status; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_node_get_parent( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + return om_node->parent; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_node_get_first_child( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + int token = 0; + if(!om_node) + { + return NULL; + } + + /**********************************************************/ + while(!(om_node->first_child) && !(om_node->done) && om_node->builder) + { + token = axiom_stax_builder_next_with_token(om_node->builder, env); + if(token == -1) + { + return NULL; + } + } + + /**********************************************************/ + return om_node->first_child; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_node_get_first_element( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + int token = 0; + axiom_node_t *first_element; + if(!om_node) + { + return NULL; + } + + /**********************************************************/ + while(!(om_node->first_child) && !(om_node->done) && om_node->builder) + { + token = axiom_stax_builder_next_with_token(om_node->builder, env); + if(token == -1) + { + return NULL; + } + } + + /**********************************************************/ + first_element = om_node->first_child; + + while(first_element && (axiom_node_get_node_type(first_element, env) != AXIOM_ELEMENT)) + { + first_element = axiom_node_get_next_sibling(first_element, env); + } + + return first_element; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_node_get_last_child( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + return om_node->last_child; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_node_get_previous_sibling( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + return om_node->prev_sibling; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_node_get_next_sibling( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + int token = 0; + if(!om_node) + { + return NULL; + } + + while(!(om_node->next_sibling) && om_node->parent && om_node->builder + && !(axiom_node_is_complete(om_node->parent, env))) + { + token = axiom_stax_builder_next_with_token(om_node->builder, env); + if(token == -1) + { + return NULL; + } + } + + return om_node->next_sibling; +} + +AXIS2_EXTERN axiom_types_t AXIS2_CALL +axiom_node_get_node_type( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + return om_node->node_type; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_node_is_complete( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + return om_node->done; + +} + +AXIS2_EXTERN struct axiom_document *AXIS2_CALL +axiom_node_get_document( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + return om_node->om_doc; +} + +AXIS2_EXTERN void *AXIS2_CALL +axiom_node_get_data_element( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + return om_node->data_element; +} + +/** + internal function , not to be used by users + only sets the first_child link because this is needed by builder + */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_set_first_child( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * first_child) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_node, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, first_child, AXIS2_FAILURE); + + /** set the parent */ + axiom_node_set_parent(first_child, env, om_node); + + om_node->first_child = first_child; + return AXIS2_SUCCESS; +} + +/** + internal function not to be used by users + only sets the previous sibling link as it is needed by builders + + */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_set_previous_sibling( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * prev_sibling) +{ + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_node, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, prev_sibling, AXIS2_FAILURE); + + om_node->prev_sibling = prev_sibling; + return AXIS2_SUCCESS; +} + +/** + internal function, not to be used by users + only sets the next sibling link; + */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_set_next_sibling( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_node_t * next_sibling) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_node, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, next_sibling, AXIS2_FAILURE); + om_node->next_sibling = next_sibling; + return AXIS2_SUCCESS; +} + +/** + internal function not to be used by users + sets the node type only used in soap and om + */ + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_set_node_type( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_types_t type) +{ + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_node, AXIS2_FAILURE); + om_node->node_type = type; + return AXIS2_SUCCESS; +} + +/** + internal function , not to be used by users + only used in om and soap + */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_set_data_element( + axiom_node_t * om_node, + const axutil_env_t * env, + void *data_element) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_node, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, data_element, AXIS2_FAILURE); + om_node->data_element = data_element; + return AXIS2_SUCCESS; +} + +/** + internal function not to be used by users + only sets the build status + + */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_set_complete( + axiom_node_t * om_node, + const axutil_env_t * env, + axis2_bool_t done) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_node, AXIS2_FAILURE); + om_node->done = done; + return AXIS2_SUCCESS; +} + +/** + internal function not to be used by users + only used by om builder + + */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_set_document( + axiom_node_t * om_node, + const axutil_env_t * env, + struct axiom_document * om_doc) +{ + AXIS2_PARAM_CHECK(env->error, om_node, AXIS2_FAILURE); + om_node->om_doc = om_doc; + return AXIS2_SUCCESS; +} + +/** + internal function only sets the builder reference , + should not be used by user + */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_node_set_builder( + axiom_node_t * om_node, + const axutil_env_t * env, + axiom_stax_builder_t * builder) +{ + AXIS2_PARAM_CHECK(env->error, om_node, AXIS2_FAILURE); + om_node->builder = builder; + return AXIS2_SUCCESS; +} + +/** + * This is an internal function + */ +AXIS2_EXTERN axiom_stax_builder_t *AXIS2_CALL +axiom_node_get_builder( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + if(!om_node) + { + return NULL; + } + return om_node->builder; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_node_to_string( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + axiom_output_t *om_output = NULL; + axiom_xml_writer_t *xml_writer = NULL; + axis2_char_t *xml = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, om_node, NULL); + + xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0, + AXIS2_XML_PARSER_TYPE_BUFFER); + if(!xml_writer) + { + return NULL; + } + + om_output = axiom_output_create(env, xml_writer); + if(!om_output) + { + axiom_xml_writer_free(xml_writer, env); + return NULL; + } + status = axiom_node_serialize(om_node, env, om_output); + if(status == AXIS2_SUCCESS) + { + xml = axutil_strdup(env, (axis2_char_t *)axiom_xml_writer_get_xml(xml_writer, env)); + } + axiom_output_free(om_output, env); + return xml; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_node_sub_tree_to_string( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + axiom_output_t *om_output = NULL; + axiom_xml_writer_t *xml_writer = NULL; + axis2_char_t *xml = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, om_node, NULL); + + xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0, + AXIS2_XML_PARSER_TYPE_BUFFER); + if(!xml_writer) + { + return NULL; + } + + om_output = axiom_output_create(env, xml_writer); + if(!om_output) + { + axiom_xml_writer_free(xml_writer, env); + return NULL; + } + status = axiom_node_serialize_sub_tree(om_node, env, om_output); + if(status == AXIS2_SUCCESS) + { + xml = axutil_strdup(env, (axis2_char_t *)axiom_xml_writer_get_xml(xml_writer, env)); + } + axiom_output_free(om_output, env); + return xml; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_node_to_string_non_optimized( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + axiom_output_t *om_output = NULL; + axiom_xml_writer_t *xml_writer = NULL; + axis2_char_t *xml = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, om_node, NULL); + + xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0, + AXIS2_XML_PARSER_TYPE_BUFFER); + if(!xml_writer) + { + return NULL; + } + + om_output = axiom_output_create(env, xml_writer); + if(!om_output) + { + axiom_xml_writer_free(xml_writer, env); + return NULL; + } + /*This is where we set the output to be non-optimized*/ + axiom_output_set_do_optimize(om_output, env, AXIS2_FALSE); + status = axiom_node_serialize(om_node, env, om_output); + if(status == AXIS2_SUCCESS) + { + xml = axutil_strdup(env, (axis2_char_t *)axiom_xml_writer_get_xml(xml_writer, env)); + } + axiom_output_free(om_output, env); + return xml; +} + diff --git a/axiom/src/om/om_output.c b/axiom/src/om/om_output.c new file mode 100644 index 0000000..893f426 --- /dev/null +++ b/axiom/src/om/om_output.c @@ -0,0 +1,638 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_output.h> +#include <stdarg.h> +#include <axutil_string.h> +#include <axiom_xml_writer.h> +#include <axiom_text.h> +#include <axiom_soap_const.h> +#include <axutil_array_list.h> +#include <axutil_uuid_gen.h> +#include <axiom_mime_part.h> + +#define AXIS2_DEFAULT_CHAR_SET_ENCODING "UTF-8" + +/** also defined in axiom_soap.h */ + +/** max args for om_output_write function */ +#define MAX_ARGS 4 + +struct axiom_output +{ + + /** axiom_xml_writer. any xml writer which + implemet axiom_xml_writer.h interface */ + axiom_xml_writer_t *xml_writer; + + axis2_bool_t do_optimize; + + axis2_char_t *mime_boundary; + + axis2_char_t *root_content_id; + + int next_id; + + axis2_char_t *next_content_id; + + axis2_bool_t is_soap11; + + axis2_char_t *char_set_encoding; + + axis2_char_t *xml_version; + + axis2_bool_t ignore_xml_declaration; + + axutil_array_list_t *binary_node_list; + + axis2_char_t *mime_boundry; + + axis2_char_t *content_type; + + axutil_array_list_t *mime_parts; + +}; + +AXIS2_EXTERN axiom_output_t *AXIS2_CALL +axiom_output_create( + const axutil_env_t * env, + axiom_xml_writer_t * xml_writer) +{ + axiom_output_t *om_output = NULL; + AXIS2_ENV_CHECK(env, NULL); + + om_output = (axiom_output_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_output_t)); + + if(!om_output) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + om_output->xml_writer = xml_writer; + om_output->do_optimize = AXIS2_TRUE; + om_output->mime_boundary = NULL; + om_output->root_content_id = NULL; + om_output->next_content_id = NULL; + om_output->next_id = 0; + om_output->is_soap11 = AXIS2_TRUE; + om_output->char_set_encoding = AXIS2_DEFAULT_CHAR_SET_ENCODING; + om_output->xml_version = NULL; + om_output->ignore_xml_declaration = AXIS2_TRUE; + om_output->binary_node_list = NULL; + om_output->mime_boundry = NULL; + om_output->content_type = NULL; + om_output->mime_parts = NULL; + + return om_output; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_output_free( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, void); + + if(om_output->xml_version) + { + AXIS2_FREE(env->allocator, om_output->xml_version); + } + if(om_output->mime_boundary) + { + AXIS2_FREE(env->allocator, om_output->mime_boundary); + } + if(om_output->next_content_id) + { + AXIS2_FREE(env->allocator, om_output->next_content_id); + } + if(om_output->root_content_id) + { + AXIS2_FREE(env->allocator, om_output->root_content_id); + } + + if(om_output->xml_writer) + { + axiom_xml_writer_free(om_output->xml_writer, env); + } + + if(om_output->binary_node_list) + { + axutil_array_list_free(om_output->binary_node_list, env); + } + + if(om_output->content_type) + { + AXIS2_FREE(env->allocator, om_output->content_type); + } + + AXIS2_FREE(env->allocator, om_output); + return; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_output_is_soap11( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + return om_output->is_soap11; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_output_is_ignore_xml_declaration( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + return om_output->ignore_xml_declaration; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_output_set_ignore_xml_declaration( + axiom_output_t * om_output, + const axutil_env_t * env, + axis2_bool_t ignore_xml_dec) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + om_output->ignore_xml_declaration = ignore_xml_dec; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_output_set_soap11( + axiom_output_t * om_output, + const axutil_env_t * env, + axis2_bool_t soap11) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + om_output->is_soap11 = soap11; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_output_set_xml_version( + axiom_output_t * om_output, + const axutil_env_t * env, + axis2_char_t * xml_version) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + AXIS2_PARAM_CHECK(env->error, xml_version, AXIS2_FAILURE); + + if(om_output->xml_version) + { + AXIS2_FREE(env->allocator, om_output->xml_version); + om_output->xml_version = NULL; + } + + om_output->xml_version = axutil_strdup(env, xml_version); + if(!om_output->xml_version) + { + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_output_get_xml_version( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + return om_output->xml_version; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_output_set_char_set_encoding( + axiom_output_t * om_output, + const axutil_env_t * env, + axis2_char_t * char_set_encoding) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + om_output->char_set_encoding = char_set_encoding; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_output_get_char_set_encoding( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + return om_output->char_set_encoding; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_output_set_do_optimize( + axiom_output_t * om_output, + const axutil_env_t * env, + axis2_bool_t optimize) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + om_output->do_optimize = optimize; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_xml_writer_t *AXIS2_CALL +axiom_output_get_xml_writer( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + return om_output->xml_writer; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_output_is_optimized( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + return om_output->do_optimize; +} + +AXIS2_EXTERN const axis2_char_t *AXIS2_CALL +axiom_output_get_content_type( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + const axis2_char_t *soap_content_type = NULL; + if(AXIS2_TRUE == om_output->do_optimize) + { + if(AXIS2_TRUE == om_output->is_soap11) + { + soap_content_type = AXIOM_SOAP11_CONTENT_TYPE; + } + else + { + soap_content_type = AXIOM_SOAP12_CONTENT_TYPE; + } + if(om_output->content_type) + { + AXIS2_FREE(env->allocator, om_output->content_type); + om_output->content_type = NULL; + } + + om_output->content_type = (axis2_char_t *)axiom_mime_part_get_content_type_for_mime(env, + om_output->mime_boundry, om_output->root_content_id, om_output->char_set_encoding, + soap_content_type); + return om_output->content_type; + } + else if(AXIS2_TRUE == om_output->is_soap11) + { + return AXIOM_SOAP11_CONTENT_TYPE; + } + return AXIOM_SOAP12_CONTENT_TYPE; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_output_write_optimized( + axiom_output_t * om_output, + const axutil_env_t * env, + axiom_text_t * om_text) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + if(om_output->binary_node_list) + { + axutil_array_list_add(om_output->binary_node_list, env, om_text); + } + else + { + om_output->binary_node_list = axutil_array_list_create(env, 5); + if(!(om_output->binary_node_list)) + { + return AXIS2_FAILURE; + } + axutil_array_list_add(om_output->binary_node_list, env, om_text); + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_output_get_next_content_id( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + axis2_char_t *uuid = NULL; + axis2_char_t *temp_str = NULL; + axis2_char_t *temp_str1 = NULL; + axis2_char_t id[256]; + om_output->next_id++; + + /** free existing id */ + if(om_output->next_content_id) + { + AXIS2_FREE(env->allocator, om_output->next_content_id); + om_output->next_content_id = NULL; + } + + uuid = axutil_uuid_gen(env); + if(!uuid) + { + return NULL; + } + + sprintf(id, "%d", om_output->next_id); + + temp_str = axutil_stracat(env, id, "."); + temp_str1 = axutil_stracat(env, temp_str, uuid); + om_output->next_content_id = axutil_stracat(env, temp_str1, "@apache.org"); + if(temp_str) + { + AXIS2_FREE(env->allocator, temp_str); + temp_str = NULL; + } + if(temp_str1) + { + AXIS2_FREE(env->allocator, temp_str1); + temp_str1 = NULL; + } + if(uuid) + { + AXIS2_FREE(env->allocator, uuid); + uuid = NULL; + } + return om_output->next_content_id; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_output_get_root_content_id( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + axis2_char_t *temp_str = NULL; + axis2_char_t *uuid = NULL; + + if(!om_output->root_content_id) + { + uuid = axutil_uuid_gen(env); + + temp_str = axutil_stracat(env, "0.", uuid); + + om_output->root_content_id = axutil_stracat(env, temp_str, "@apache.org"); + + if(temp_str) + { + AXIS2_FREE(env->allocator, temp_str); + temp_str = NULL; + } + if(uuid) + { + AXIS2_FREE(env->allocator, uuid); + uuid = NULL; + } + } + + return om_output->root_content_id; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_output_get_mime_boundry( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + axis2_char_t *uuid = NULL; + if(!om_output->mime_boundary) + { + uuid = axutil_uuid_gen(env); + + om_output->mime_boundary = axutil_stracat(env, "MIMEBoundary", uuid); + if(uuid) + { + AXIS2_FREE(env->allocator, uuid); + uuid = NULL; + } + } + return om_output->mime_boundary; +} + +/******************************************************************************/ + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_output_write( + axiom_output_t * om_output, + const axutil_env_t * env, + axiom_types_t type, + int no_of_args, + ...) +{ + int status = AXIS2_SUCCESS; + axis2_char_t *args_list[MAX_ARGS]; + int i = 0; + va_list ap; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + va_start(ap, no_of_args); + for(i = 0; i < no_of_args; i++) + { + args_list[i] = va_arg(ap, axis2_char_t *); + } + va_end(ap); + + if(type == AXIOM_ELEMENT) + { + if(no_of_args == 0) + { + status = axiom_xml_writer_write_end_element(om_output->xml_writer, env); + } + else if(no_of_args == 1) + { + status = axiom_xml_writer_write_start_element(om_output->xml_writer, env, args_list[0]); + } + else if(no_of_args == 2) + { + status = axiom_xml_writer_write_start_element_with_namespace( + om_output->xml_writer, env, args_list[0], args_list[1]); + } + else if(no_of_args == 3) + { + status = axiom_xml_writer_write_start_element_with_namespace_prefix( + om_output->xml_writer, env, args_list[0], args_list[1], args_list[2]); + } + else if(no_of_args == 4) + { + if(!args_list[0]) + { + status = AXIS2_FAILURE; + } + else if(!args_list[1]) + { + status = axiom_xml_writer_write_empty_element( + om_output->xml_writer, env,args_list[0]); + } + else if(!args_list[2]) + { + status = axiom_xml_writer_write_empty_element_with_namespace( + om_output->xml_writer, env, args_list[0], args_list[1]); + } + else + { + status = axiom_xml_writer_write_empty_element_with_namespace_prefix( + om_output->xml_writer, env, args_list[0], args_list[1], args_list[2]); + } + } + } + else if(type == AXIOM_DATA_SOURCE) + { + status = axiom_xml_writer_write_raw(om_output->xml_writer, env, args_list[0]); + } + else if(type == AXIOM_ATTRIBUTE) + { + if(no_of_args == 2) + { + status = axiom_xml_writer_write_attribute( + om_output->xml_writer, env, args_list[0], args_list[1]); + } + else if(no_of_args == 3) + { + status = axiom_xml_writer_write_attribute_with_namespace( + om_output-> xml_writer, env, args_list[0], args_list[1], args_list[2]); + } + else if(no_of_args == 4) + { + status = axiom_xml_writer_write_attribute_with_namespace_prefix( + om_output->xml_writer, env, args_list[0], args_list[1], args_list[2], args_list[3]); + } + } + else if(type == AXIOM_NAMESPACE) + { + /* If the namespace prefix is xml, it must be the pre-defined xml + namespace. Although the XML spec allows it to be declared + explicitly, this is superfluous and not accepted by all xml + parsers. */ + if((!args_list[0]) || (strcmp(args_list[0], "xml") != 0)) + { + status = axiom_xml_writer_write_namespace( + om_output->xml_writer, env, args_list[0], args_list[1]); + } + } + else if(type == AXIOM_TEXT) + { + status = axiom_xml_writer_write_characters(om_output->xml_writer, env, args_list[0]); + } + else if(type == AXIOM_COMMENT) + { + status = axiom_xml_writer_write_comment(om_output->xml_writer, env, args_list[0]); + } + else if(type == AXIOM_PROCESSING_INSTRUCTION) + { + if(no_of_args == 1) + { + status = axiom_xml_writer_write_processing_instruction( + om_output-> xml_writer, env, args_list[0]); + } + else if(no_of_args == 2) + { + status = axiom_xml_writer_write_processing_instruction_data( + om_output-> xml_writer, env, args_list[0], args_list[1]); + } + } + else if(type == AXIOM_DOCTYPE) + { + status = axiom_xml_writer_write_dtd(om_output->xml_writer, env, args_list[0]); + } + + if(status == AXIS2_SUCCESS) + { + return AXIS2_SUCCESS; + } + else + return AXIS2_FAILURE; +} + +axis2_status_t AXIS2_CALL +axiom_output_write_xml_version_encoding( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + if(!om_output->xml_version) + { + axiom_output_set_xml_version(om_output, env, "1.0"); + } + if(!om_output->char_set_encoding) + { + axiom_output_set_char_set_encoding(om_output, env, "UTF-8"); + } + return axiom_xml_writer_write_start_document_with_version_encoding(om_output-> xml_writer, env, + om_output-> xml_version, om_output-> char_set_encoding); + +} + +/* This method will be called from transport. After this method each and every + * message part needs to be send are stored in an arraylits. So the transport + * sender should correctly figure out how to send from the given information. + */ + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_output_flush( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + const axis2_char_t *soap_content_type = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + if(om_output->do_optimize) + { + axis2_char_t *root_content_id = NULL; + axis2_char_t *buffer = NULL; + + /* Extracting the soap part */ + + buffer = axiom_xml_writer_get_xml(om_output->xml_writer, env); + if(om_output->is_soap11) + { + soap_content_type = AXIOM_SOAP11_CONTENT_TYPE; + } + else + { + soap_content_type = AXIOM_SOAP12_CONTENT_TYPE; + } + + /* The created mime_boundary for this soap message */ + + om_output->mime_boundry = axiom_output_get_mime_boundry(om_output, env); + + /* This is also created for attachments*/ + root_content_id = axiom_output_get_root_content_id(om_output, env); + + /* different parts of the message is added according to their order + * to an arraylist */ + om_output->mime_parts = axiom_mime_part_create_part_list(env, buffer, + om_output->binary_node_list, om_output->mime_boundry, om_output->root_content_id, + om_output->char_set_encoding, soap_content_type); + + if(om_output->mime_parts) + { + return AXIS2_SUCCESS; + } + else + { + return AXIS2_FAILURE; + } + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL +axiom_output_get_mime_parts( + axiom_output_t * om_output, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + return om_output->mime_parts; +} + diff --git a/axiom/src/om/om_processing_instruction.c b/axiom/src/om/om_processing_instruction.c new file mode 100644 index 0000000..5be688b --- /dev/null +++ b/axiom/src/om/om_processing_instruction.c @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_processing_instruction.h> +#include <axutil_string.h> +#include "axiom_node_internal.h" + +struct axiom_processing_instruction +{ + + /** processing instruction target */ + axis2_char_t *target; + + /** processing instruction value */ + axis2_char_t *value; +}; + +AXIS2_EXTERN axiom_processing_instruction_t *AXIS2_CALL +axiom_processing_instruction_create( + const axutil_env_t * env, + axiom_node_t * parent, + const axis2_char_t * target, + const axis2_char_t * value, + axiom_node_t ** node) +{ + axiom_processing_instruction_t *processing_instruction = NULL; + AXIS2_ENV_CHECK(env, NULL); + + if(!node || !target || !value) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Node or target or value is NULL"); + return NULL; + } + + *node = axiom_node_create(env); + + if(!*node) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + processing_instruction = (axiom_processing_instruction_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_processing_instruction_t)); + + if(!processing_instruction) + { + AXIS2_FREE(env->allocator, (*node)); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + processing_instruction->value = NULL; + + if(value) + { + processing_instruction->value = (axis2_char_t *)axutil_strdup(env, value); + if(!processing_instruction->value) + { + AXIS2_FREE(env->allocator, processing_instruction); + AXIS2_FREE(env->allocator, *node); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + } + + processing_instruction->target = NULL; + + if(target) + { + processing_instruction->target = (axis2_char_t *)axutil_strdup(env, target); + if(!processing_instruction->target) + { + AXIS2_FREE(env->allocator, processing_instruction->value); + AXIS2_FREE(env->allocator, processing_instruction); + AXIS2_FREE(env->allocator, *node); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + } + axiom_node_set_data_element(*node, env, processing_instruction); + axiom_node_set_node_type(*node, env, AXIOM_PROCESSING_INSTRUCTION); + if(parent) + { + axiom_node_add_child(parent, env, (*node)); + } + + return processing_instruction; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_processing_instruction_free( + axiom_processing_instruction_t * om_pi, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, void); + + if(om_pi->value) + { + AXIS2_FREE(env->allocator, om_pi->value); + om_pi->value = NULL; + } + + if(om_pi->target) + { + AXIS2_FREE(env->allocator, om_pi->target); + om_pi->target = NULL; + } + + AXIS2_FREE(env->allocator, om_pi); + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_processing_instruction_set_value( + axiom_processing_instruction_t * om_pi, + const axutil_env_t * env, + const axis2_char_t * value) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE); + om_pi->value = (axis2_char_t *)axutil_strdup(env, value); + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_processing_instruction_set_target( + axiom_processing_instruction_t * om_pi, + const axutil_env_t * env, + const axis2_char_t * target) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, target, AXIS2_FAILURE); + om_pi->target = (axis2_char_t *)axutil_strdup(env, target); + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_processing_instruction_get_value( + axiom_processing_instruction_t * om_pi, + const axutil_env_t * env) +{ + return om_pi->value; +} +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_processing_instruction_get_target( + axiom_processing_instruction_t * om_pi, + const axutil_env_t * env) +{ + return om_pi->target; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_processing_instruction_serialize( + axiom_processing_instruction_t * om_pi, + const axutil_env_t * env, + axiom_output_t * om_output) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE); + + if(om_pi->target && om_pi->value) + { + return axiom_output_write(om_output, env, AXIOM_PROCESSING_INSTRUCTION, 2, om_pi->target, + om_pi->value); + } + else if(om_pi->target) + { + return axiom_output_write(om_output, env, AXIOM_PROCESSING_INSTRUCTION, 2, om_pi->target, + om_pi->value); + } + return AXIS2_FAILURE; +} diff --git a/axiom/src/om/om_stax_builder.c b/axiom/src/om/om_stax_builder.c new file mode 100644 index 0000000..399a711 --- /dev/null +++ b/axiom/src/om/om_stax_builder.c @@ -0,0 +1,1072 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_stax_builder.h> +#include <axiom_element.h> +#include <axiom_text.h> +#include <axiom_processing_instruction.h> +#include <axiom_comment.h> +#include <axutil_string.h> +#include <axiom_xml_writer.h> +#include <axiom_doctype.h> +#include "axiom_node_internal.h" +#include "axiom_stax_builder_internal.h" + +struct axiom_stax_builder +{ + + /** pull parser instance used by the om_builder */ + axiom_xml_reader_t *parser; + + /** last node the om_builder found */ + axiom_node_t *lastnode; + + axiom_node_t *root_node; + + /** document associated with the om_builder */ + axiom_document_t *document; + + /** done building the document? */ + axis2_bool_t done; + + /** parser was accessed? */ + axis2_bool_t parser_accessed; + + /** caching enabled? */ + axis2_bool_t cache; + + /** current event */ + int current_event; + /** Indicate the current element level. */ + int element_level; + axutil_hash_t *declared_namespaces; +}; + +AXIS2_EXTERN axiom_stax_builder_t *AXIS2_CALL +axiom_stax_builder_create( + const axutil_env_t * env, + axiom_xml_reader_t * parser) +{ + axiom_stax_builder_t *om_builder = NULL; + AXIS2_PARAM_CHECK(env->error, parser, NULL); + + om_builder = (axiom_stax_builder_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_stax_builder_t)); + if(!om_builder) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + om_builder->cache = AXIS2_TRUE; + om_builder->parser_accessed = AXIS2_FALSE; + om_builder->done = AXIS2_FALSE; + om_builder->lastnode = NULL; + om_builder->document = NULL; + om_builder->parser = parser; + om_builder->current_event = -1; + om_builder->root_node = NULL; + om_builder->element_level = 0; + om_builder->declared_namespaces = axutil_hash_make(env); + om_builder->document = axiom_document_create(env, NULL, om_builder); + if(!om_builder->document) + { + AXIS2_FREE(env->allocator, om_builder); + return NULL; + } + + return om_builder; +} + +static axis2_status_t +axiom_stax_builder_process_attributes( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env, + axiom_node_t * element_node) +{ + int i = 0; + int attribute_count; + axiom_element_t *om_ele = NULL; + + om_ele = (axiom_element_t *)axiom_node_get_data_element(element_node, env); + attribute_count = axiom_xml_reader_get_attribute_count(om_builder->parser, env); + for(i = 1; i <= attribute_count; ++i) + { + axiom_namespace_t *ns = NULL; + axis2_char_t *uri = NULL; + axis2_char_t *prefix = NULL; + axis2_char_t *attr_name = NULL; + axis2_char_t *attr_value = NULL; + + uri = axiom_xml_reader_get_attribute_namespace_by_number(om_builder-> parser, env, i); + prefix = axiom_xml_reader_get_attribute_prefix_by_number(om_builder->parser, env, i); + if(uri && (axutil_strcmp(uri, "") != 0)) + { + ns = axiom_element_find_namespace(om_ele, env, element_node, uri, prefix); + if(!ns) + { + /* if namespace is not defined yet, create it */ + ns = axiom_namespace_create(env, uri, prefix); + } + } + if(uri) + { + axiom_xml_reader_xml_free(om_builder->parser, env, uri); + } + if(prefix) + { + axiom_xml_reader_xml_free(om_builder->parser, env, prefix); + } + + attr_name = axiom_xml_reader_get_attribute_name_by_number(om_builder->parser, env, i); + attr_value = axiom_xml_reader_get_attribute_value_by_number(om_builder->parser, env, i); + + if(attr_name) + { + axutil_string_t *attr_name_str = NULL; + axutil_string_t *attr_value_str = NULL; + axiom_attribute_t *attribute = NULL; + +#ifdef AXIS2_LIBXML2_ENABLED + attr_name_str = axutil_string_create(env, attr_name); + attr_value_str = axutil_string_create(env, attr_value); + axiom_xml_reader_xml_free(om_builder->parser, env, attr_name); + axiom_xml_reader_xml_free(om_builder->parser, env, attr_value); +#else + attr_name_str = axutil_string_create_assume_ownership(env, &attr_name); + attr_value_str = axutil_string_create_assume_ownership(env, &attr_value); +#endif + + attribute = axiom_attribute_create_str(env, attr_name_str, attr_value_str, ns); + axutil_string_free(attr_name_str, env); + axutil_string_free(attr_value_str, env); + + if(!attribute) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot create attribute"); + return AXIS2_FAILURE; + } + if(axiom_element_add_attribute(om_ele, env, attribute, element_node) != AXIS2_SUCCESS) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot add attribute to element"); + return AXIS2_FAILURE; + } + } + } + return AXIS2_SUCCESS; +} + +static axiom_node_t * +axiom_stax_builder_create_om_text( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + axis2_char_t *temp_value = NULL; + axutil_string_t *temp_value_str = NULL; + axiom_node_t *node = NULL; + axiom_node_t *parent = om_builder->lastnode; + + if(!parent) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_BUILDER_STATE_LAST_NODE_NULL, AXIS2_FAILURE); + return NULL; + } + + temp_value = axiom_xml_reader_get_value(om_builder->parser, env); + if(!temp_value) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_XML_READER_VALUE_NULL, AXIS2_FAILURE); + return NULL; + } + +#ifdef AXIS2_LIBXML2_ENABLED + temp_value_str = axutil_string_create(env, temp_value); + axiom_xml_reader_xml_free(om_builder->parser, env, temp_value); +#else + temp_value_str = axutil_string_create_assume_ownership(env, &temp_value); +#endif + + if(!temp_value_str) + { + /* axutil_string_create will have set an error number */ + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot create OM Text value"); + return NULL; + } + + if(axiom_node_is_complete(parent, env)) + { + parent = axiom_node_get_parent(om_builder->lastnode, env); + } + + axiom_text_create_str(env, parent, temp_value_str, &node); + axutil_string_free(temp_value_str, env); + + if(node) + { + axiom_node_set_complete(node, env, AXIS2_TRUE); + om_builder->lastnode = node; + } + + return node; +} + +static axis2_status_t +axiom_stax_builder_process_namespaces( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env, + axiom_node_t * node, + int is_soap_element) +{ + axis2_status_t status = AXIS2_SUCCESS; + int namespace_count = 0; + axiom_namespace_t *om_ns = NULL; + axiom_element_t *om_ele = NULL; + + /* temp values */ + axis2_char_t *tmp_prefix = NULL; + axis2_char_t *tmp_ns_prefix = NULL; + axis2_char_t *tmp_ns_uri = NULL; + axutil_string_t *tmp_ns_prefix_str = NULL; + axutil_string_t *tmp_ns_uri_str = NULL; + + int i = 0; + om_ele = (axiom_element_t *)axiom_node_get_data_element(node, env); + + namespace_count = axiom_xml_reader_get_namespace_count(om_builder->parser, env); + for(i = 1; i <= namespace_count; ++i) + { + tmp_ns_prefix = axiom_xml_reader_get_namespace_prefix_by_number(om_builder->parser, env, i); + tmp_ns_uri = axiom_xml_reader_get_namespace_uri_by_number(om_builder->parser, env, i); + +#ifdef AXIS2_LIBXML2_ENABLED + tmp_ns_prefix_str = axutil_string_create(env, tmp_ns_prefix); + tmp_ns_uri_str = axutil_string_create(env, tmp_ns_uri); +#else + tmp_ns_prefix_str = axutil_string_create_assume_ownership(env, &tmp_ns_prefix); + tmp_ns_uri_str = axutil_string_create_assume_ownership(env, &tmp_ns_uri); +#endif + + if(!tmp_ns_prefix || axutil_strcmp(tmp_ns_prefix, "xmlns") == 0) + { + /* default namespace case. !temp_ns_prefix is for guththila */ + + if(tmp_ns_prefix_str) + { + axutil_string_free(tmp_ns_prefix_str, env); + } + + tmp_ns_prefix_str = axutil_string_create(env, ""); + om_ns = axiom_namespace_create_str(env, tmp_ns_uri_str, tmp_ns_prefix_str); + if(!om_ns) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot create namespace"); + return AXIS2_FAILURE; + } + + status = axiom_element_declare_namespace(om_ele, env, node, om_ns); + if(!status) + { + axiom_namespace_free(om_ns, env); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error when declaring namespace"); + return AXIS2_FAILURE; + } + } + else + { + axis2_char_t *prefix = NULL; + om_ns = axiom_namespace_create_str(env, tmp_ns_uri_str, tmp_ns_prefix_str); + if(!om_ns) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot create namespace"); + return AXIS2_FAILURE; + } + + status = axiom_element_declare_namespace_assume_param_ownership(om_ele, env, om_ns); + prefix = axiom_namespace_get_prefix(om_ns, env); + axutil_hash_set(om_builder->declared_namespaces, prefix, AXIS2_HASH_KEY_STRING, om_ns); + } + + axutil_string_free(tmp_ns_uri_str, env); + axutil_string_free(tmp_ns_prefix_str, env); +#ifdef AXIS2_LIBXML2_ENABLED + axiom_xml_reader_xml_free(om_builder->parser, env, tmp_ns_uri); + axiom_xml_reader_xml_free(om_builder->parser, env, tmp_ns_prefix); +#endif + } + + /* set own namespace */ + tmp_prefix = axiom_xml_reader_get_prefix(om_builder->parser, env); + if(tmp_prefix) + { + om_ns = axutil_hash_get(om_builder->declared_namespaces, tmp_prefix, AXIS2_HASH_KEY_STRING); + + if(om_ns) + { + axiom_element_set_namespace_assume_param_ownership(om_ele, env, om_ns); + } + else + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_INVALID_DOCUMENT_STATE_UNDEFINED_NAMESPACE, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error when setting namespace"); + return AXIS2_FAILURE; + } + + axiom_xml_reader_xml_free(om_builder->parser, env, tmp_prefix); + } + + return status; +} + +static axiom_node_t * +axiom_stax_builder_create_om_element( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env, + axis2_bool_t is_empty) +{ + axiom_node_t *element_node = NULL; + axiom_element_t *om_ele = NULL; + axis2_char_t *temp_localname = NULL; + axutil_string_t *temp_localname_str = NULL; + + temp_localname = axiom_xml_reader_get_name(om_builder->parser, env); + + if(!temp_localname) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_XML_READER_ELEMENT_NULL, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot find name of the element"); + return NULL; + } + +#ifdef AXIS2_LIBXML2_ENABLED + temp_localname_str = axutil_string_create(env, temp_localname); + axiom_xml_reader_xml_free(om_builder->parser, env, temp_localname); +#else + temp_localname_str = axutil_string_create_assume_ownership(env, &temp_localname); +#endif + + om_builder->element_level++; + + if(!om_builder->lastnode) + { + /* since last node is null, this should be the root node */ + om_ele = axiom_element_create_str(env, NULL, temp_localname_str, NULL, &element_node); + om_builder->root_node = element_node; + if(om_builder->document) + { + axiom_document_set_root_element(om_builder->document, env, element_node); + } + } + else if(axiom_node_is_complete(om_builder->lastnode, env)) + { + /* previous node building is finished. So, this node should be a sibling of previous node */ + axiom_node_t *parent = axiom_node_get_parent(om_builder->lastnode, env); + om_ele = axiom_element_create_str(env, parent, temp_localname_str, NULL, &element_node); + if(element_node) + { + axiom_node_set_next_sibling(om_builder->lastnode, env, element_node); + axiom_node_set_previous_sibling(element_node, env, om_builder->lastnode); + } + } + else + { + /* previous node building is not finished. This should be first child of previous node */ + om_ele = axiom_element_create_str( + env, om_builder->lastnode, temp_localname_str, NULL, &element_node); + if(element_node) + { + axiom_node_set_first_child(om_builder->lastnode, env, element_node); + axiom_node_set_parent(element_node, env, om_builder->lastnode); + } + } + + axutil_string_free(temp_localname_str, env); + + if((!om_ele) || (!element_node)) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot create axiom element"); + return NULL; + } + + axiom_node_set_builder(element_node, env, om_builder); + axiom_node_set_document(element_node, env, om_builder->document); + axiom_element_set_is_empty(om_ele, env, is_empty); + + /* order of processing name spaces first (before processing attributes) is important */ + axiom_stax_builder_process_namespaces(om_builder, env, element_node, 0); + axiom_stax_builder_process_attributes(om_builder, env, element_node); + + om_builder->lastnode = element_node; + return element_node; +} + +static axiom_node_t * +axiom_stax_builder_create_om_comment( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + axiom_node_t *comment_node = NULL; + axis2_char_t *comment_value = NULL; + + if(!om_builder->lastnode) + { + /* if the comment is at the root level, we will omit it */ + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Top level comment is ignored"); + return NULL; + } + + comment_value = axiom_xml_reader_get_value(om_builder->parser, env); + if(!comment_value) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_XML_READER_ELEMENT_NULL, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in reading comment"); + return NULL; + } + + if(axiom_node_is_complete(om_builder->lastnode, env)) + { + /* Last node is completed means, this node should be a sibling of last node */ + axiom_node_t *parent = axiom_node_get_parent(om_builder->lastnode, env); + axiom_comment_create(env, parent, comment_value, &comment_node); + axiom_node_set_next_sibling(om_builder->lastnode, env, comment_node); + axiom_node_set_previous_sibling(comment_node, env, om_builder->lastnode); + } + else + { + /* this node should be a child of last node */ + axiom_comment_create(env, om_builder->lastnode, comment_value, &comment_node); + axiom_node_set_first_child(om_builder->lastnode, env, comment_node); + axiom_node_set_parent(comment_node, env, om_builder->lastnode); + } + + axiom_xml_reader_xml_free(om_builder->parser,env,comment_value); + axiom_node_set_builder(comment_node, env, om_builder); + axiom_node_set_document(comment_node, env, om_builder->document); + om_builder->element_level++; + om_builder->lastnode = comment_node; + + return comment_node; +} + + +static axiom_node_t * +axiom_stax_builder_create_om_processing_instruction( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + axiom_node_t *pi_node = NULL; + axis2_char_t *target = NULL; + axis2_char_t *value = NULL; + + target = axiom_xml_reader_get_pi_target(om_builder->parser, env); + value = axiom_xml_reader_get_pi_data(om_builder->parser, env); + if(!target) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_XML_READER_ELEMENT_NULL, AXIS2_FAILURE); + return NULL; + } + if(!om_builder->lastnode) + { + /* do nothing */ + axiom_xml_reader_xml_free(om_builder->parser, env, target); + axiom_xml_reader_xml_free(om_builder->parser, env, value); + return NULL; + } + else if(axiom_node_is_complete(om_builder->lastnode, env) + || (axiom_node_get_node_type(om_builder->lastnode, env) == AXIOM_TEXT)) + { + axiom_processing_instruction_create(env, axiom_node_get_parent(om_builder-> lastnode, env), + target, value, &pi_node); + + axiom_node_set_next_sibling(om_builder->lastnode, env, pi_node); + axiom_node_set_previous_sibling(pi_node, env, om_builder->lastnode); + } + else + { + axiom_processing_instruction_create(env, om_builder->lastnode, target, value, &pi_node); + axiom_node_set_first_child(om_builder->lastnode, env, pi_node); + axiom_node_set_parent(pi_node, env, om_builder->lastnode); + } + + om_builder->element_level++; + + if(target) + { + axiom_xml_reader_xml_free(om_builder->parser, env, target); + } + if(value) + { + axiom_xml_reader_xml_free(om_builder->parser, env, value); + } + + om_builder->lastnode = pi_node; + return pi_node; +} + +static axis2_status_t +axiom_stax_builder_end_element( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + /* if last node is not set, that means end_element is called before start_element, + * which is an error */ + if(!om_builder->lastnode) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "Invalid XML. End element is received before start element."); + return AXIS2_FAILURE; + } + + om_builder->element_level--; + if(axiom_node_is_complete(om_builder->lastnode, env)) + { + /* Last node completed means, this end element should be parent of the last node. */ + axiom_node_t *parent = NULL; + parent = axiom_node_get_parent(om_builder->lastnode, env); + if(parent) + { + axiom_node_set_complete(parent, env, AXIS2_TRUE); + om_builder->lastnode = parent; + } + } + else + { + axiom_node_set_complete((om_builder->lastnode), env, AXIS2_TRUE); + } + + /* if we finish building the root node, then we can set the complete status of om_builder */ + if(om_builder->root_node && axiom_node_is_complete(om_builder->root_node, env)) + { + om_builder->done = AXIS2_TRUE; + } + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_stax_builder_next( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + int token = 0; + axiom_node_t *node = NULL; + AXIS2_ENV_CHECK(env, NULL); + + if(!om_builder->parser) + { + return NULL; + } + do + { + if(om_builder->done) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_BUILDER_DONE_CANNOT_PULL, AXIS2_FAILURE); + return NULL; + } + + token = axiom_xml_reader_next(om_builder->parser, env); + if(token == -1) + { + return NULL; + } + + om_builder->current_event = token; + + if(!(om_builder->cache)) + { + return NULL; + } + + switch(token) + { + case AXIOM_XML_READER_START_DOCUMENT: + /*Do nothing */ + break; + + case AXIOM_XML_READER_START_ELEMENT: + node = axiom_stax_builder_create_om_element(om_builder, env, AXIS2_FALSE); + break; + + case AXIOM_XML_READER_EMPTY_ELEMENT: + +#ifdef AXIS2_LIBXML2_ENABLED + node = axiom_stax_builder_create_om_element(om_builder, env, AXIS2_FALSE); +#else + node = axiom_stax_builder_create_om_element(om_builder, env, AXIS2_TRUE); +#endif + + case AXIOM_XML_READER_END_ELEMENT: + axiom_stax_builder_end_element(om_builder, env); + break; + + case AXIOM_XML_READER_SPACE: + node = axiom_stax_builder_create_om_text(om_builder, env); + break; + + case AXIOM_XML_READER_CHARACTER: + node = axiom_stax_builder_create_om_text(om_builder, env); + break; + + case AXIOM_XML_READER_ENTITY_REFERENCE: + break; + + case AXIOM_XML_READER_COMMENT: + + node = axiom_stax_builder_create_om_comment(om_builder, env); + axiom_stax_builder_end_element(om_builder, env); + break; + + case AXIOM_XML_READER_PROCESSING_INSTRUCTION: + + node = axiom_stax_builder_create_om_processing_instruction(om_builder, env); + axiom_stax_builder_end_element(om_builder, env); + break; + + case AXIOM_XML_READER_CDATA: + break; + + case AXIOM_XML_READER_DOCUMENT_TYPE: + break; + + default: + break; + } + } + while(!node); + return node; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_stax_builder_free( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + if(!om_builder) + { + return; + } + if(om_builder->declared_namespaces) + { + axutil_hash_free(om_builder->declared_namespaces, env); + om_builder->declared_namespaces = NULL; + } + + if(om_builder->document) + { + axiom_document_free(om_builder->document, env); + om_builder->document = NULL; + } + else + { + if(om_builder->root_node) + { + axiom_node_free_tree(om_builder->root_node, env); + om_builder->root_node = NULL; + } + } + + if(om_builder->parser) + { + axiom_xml_reader_free(om_builder->parser, env); + om_builder->parser = NULL; + } + + AXIS2_FREE(env->allocator, om_builder); + + return; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_stax_builder_free_self( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + + axiom_node_t *temp_node = NULL; + axiom_node_t *nodes[256]; + axiom_node_t *om_node = NULL; + int count = 0; + + om_node = om_builder->root_node; + + nodes[count++] = om_node; + + if(om_node) + { + do + { + + axiom_node_set_builder(om_node, env, NULL); + axiom_node_set_document(om_node, env, NULL); + + temp_node = axiom_node_get_first_child(om_node, env); + /* serialize children of this node */ + if(temp_node) + { + om_node = temp_node; + nodes[count++] = om_node; + } + else + { + temp_node = axiom_node_get_next_sibling(om_node, env); + if(temp_node) + { + om_node = temp_node; + nodes[count - 1] = om_node; + } + else + { + while(count > 1 && !temp_node) + { + count--; + om_node = nodes[count - 1]; + temp_node = axiom_node_get_next_sibling(om_node, env); + } + if(temp_node && count > 1) + { + om_node = temp_node; + nodes[count - 1] = om_node; + } + else + { + count--; + } + } + } + } + while(count > 0); + } + if(om_builder->declared_namespaces) + { + axutil_hash_free(om_builder->declared_namespaces, env); + om_builder->declared_namespaces = NULL; + } + + if(om_builder->parser) + { + axiom_xml_reader_free(om_builder->parser, env); + om_builder->parser = NULL; + } + if(om_builder->document) + { + axiom_document_free_self(om_builder->document, env); + om_builder->document = NULL; + } + AXIS2_FREE(env->allocator, om_builder); + return; +} + +AXIS2_EXTERN axiom_document_t *AXIS2_CALL +axiom_stax_builder_get_document( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + return om_builder->document; +} + +/** + * moves the reader to next event and returns the token returned by the xml_reader , + * @param builder pointer to STAX builder struct to be used + * @param environment Environment. MUST NOT be NULL. + * @return next event axiom_xml_reader_event_types. Returns -1 on error + */ +AXIS2_EXTERN int AXIS2_CALL +axiom_stax_builder_next_with_token( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + int token = 0; + + if((!om_builder) || (!om_builder->parser)) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Invalid OM builder"); + return -1; + } + + if(om_builder->done) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_BUILDER_DONE_CANNOT_PULL, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "OM is fully built. Nothing more to build"); + return -1; + } + + token = axiom_xml_reader_next(om_builder->parser, env); + om_builder->current_event = token; + + if(token == -1) + { + om_builder->done = AXIS2_TRUE; + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error when reading xml"); + return -1; + } + + if(!om_builder->cache) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Caching disabled"); + return -1; + } + + switch(token) + { + case AXIOM_XML_READER_START_DOCUMENT: + { + /*Do nothing */ + break; + } + case AXIOM_XML_READER_START_ELEMENT: + { + if(!axiom_stax_builder_create_om_element(om_builder, env, AXIS2_FALSE)) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in creating start element"); + return -1; + } + break; + } + case AXIOM_XML_READER_EMPTY_ELEMENT: + { + axis2_bool_t is_empty = AXIS2_TRUE; +#ifdef AXIS2_LIBXML2_ENABLED + is_empty = AXIS2_FALSE; +#endif + if(!axiom_stax_builder_create_om_element(om_builder, env, is_empty)) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in creating empty element"); + return -1; + } + /* Let this to fall to AXIOM_XML_READER_END_ELEMENT case as well, since empty element + * = start element logic + end element logic */ + } + case AXIOM_XML_READER_END_ELEMENT: + { + if(axiom_stax_builder_end_element(om_builder, env) != AXIS2_SUCCESS) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in processing end element"); + return -1; + } + break; + } + case AXIOM_XML_READER_SPACE: + { + /* ignore white space before the root element */ + if(om_builder->lastnode) + { + if(!axiom_stax_builder_create_om_text(om_builder, env)) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in creating axiom text"); + return -1; + } + } + break; + } + case AXIOM_XML_READER_CHARACTER: + { + if(!axiom_stax_builder_create_om_text(om_builder, env)) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error in creating axiom text"); + return -1; + } + break; + } + case AXIOM_XML_READER_ENTITY_REFERENCE: + { + break; + } + case AXIOM_XML_READER_COMMENT: + { + if(axiom_stax_builder_create_om_comment(om_builder, env)) + { + axiom_stax_builder_end_element(om_builder, env); + } + break; + } + case AXIOM_XML_READER_PROCESSING_INSTRUCTION: + { + if(axiom_stax_builder_create_om_processing_instruction(om_builder, env)) + { + axiom_stax_builder_end_element(om_builder, env); + } + break; + } + case AXIOM_XML_READER_CDATA: + case AXIOM_XML_READER_DOCUMENT_TYPE: + default: + break; + } + return token; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_stax_builder_discard_current_element( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + axiom_node_t *element = NULL; + axiom_node_t *prev_node = NULL; + axiom_node_t *parent = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + element = om_builder->lastnode; + + if(axiom_node_is_complete(element, env) || !(om_builder->cache)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_BUILDER_STATE_CANNOT_DISCARD, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + + om_builder->cache = AXIS2_FALSE; + do + { + while(axiom_xml_reader_next(om_builder->parser, env) != AXIOM_XML_READER_END_ELEMENT) + ; + } + while(!(axiom_node_is_complete(element, env))); + + /*All children of this element is pulled now */ + + prev_node = axiom_node_get_previous_sibling(element, env); + if(prev_node) + { + axiom_node_free_tree(axiom_node_get_next_sibling(prev_node, env), env); + axiom_node_set_next_sibling(prev_node, env, NULL); + } + else + { + parent = axiom_node_get_parent(element, env); + axiom_node_free_tree(axiom_node_get_first_child(parent, env), env); + axiom_node_set_first_child(parent, env, NULL); + om_builder->lastnode = parent; + } + om_builder->cache = AXIS2_TRUE; + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_xml_reader_t *AXIS2_CALL +axiom_stax_builder_get_parser( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + return om_builder->parser; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_stax_builder_set_cache( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env, + axis2_bool_t enable_cache) +{ + om_builder->cache = enable_cache; +} + +/** + internal function for soap om_builder only + */ +AXIS2_EXTERN int AXIS2_CALL +axiom_stax_builder_get_current_event( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + return om_builder->current_event; +} + +/** + internal function for soap om_builder only + */ +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_stax_builder_get_lastnode( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + return om_builder->lastnode; +} + +/** + internal function for soap om_builder only + */ +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_stax_builder_is_complete( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + return om_builder->done; +} + +/** + internal function for soap om_builder only + */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_stax_builder_set_lastnode( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env, + axiom_node_t * om_node) +{ + om_builder->lastnode = om_node; + return AXIS2_SUCCESS; +} + +/** + internal function for soap om_builder only + */ +AXIS2_EXTERN int AXIS2_CALL +axiom_stax_builder_get_element_level( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + return om_builder->element_level; +} + +/** + internal function for soap om_builder only + */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_stax_builder_set_element_level( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env, + int element_level) +{ + om_builder->element_level = element_level; + return AXIS2_SUCCESS; +} + +#if 0 +static axiom_node_t * +axiom_stax_builder_create_om_doctype( + axiom_stax_builder_t * om_builder, + const axutil_env_t * env) +{ + axiom_node_t *doctype_node = NULL; + axis2_char_t *doc_value = NULL; + + doc_value = axiom_xml_reader_get_dtd(om_builder->parser, env); + if(!doc_value) + { + return NULL; + } + if(!(om_builder->lastnode)) + { + axiom_doctype_create(env, NULL, doc_value, &doctype_node); + if(om_builder->document) + { + axiom_document_set_root_element(om_builder->document, env, doctype_node); + } + } + om_builder->lastnode = doctype_node; + axiom_xml_reader_xml_free(om_builder->parser, env, doc_value); + return doctype_node; +} +#endif diff --git a/axiom/src/om/om_text.c b/axiom/src/om/om_text.c new file mode 100644 index 0000000..453c395 --- /dev/null +++ b/axiom/src/om/om_text.c @@ -0,0 +1,637 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_text.h> +#include <axiom_output.h> +#include <axutil_string.h> +#include "axiom_node_internal.h" +#include <axiom_xml_writer.h> +#include <axiom_output.h> +#include <axiom_attribute.h> +#include <axiom_namespace.h> +#include <axutil_base64.h> + +static axis2_bool_t AXIS2_CALL axiom_text_get_is_binary( + axiom_text_t * om_text, + const axutil_env_t * env); + +static axis2_status_t AXIS2_CALL axiom_text_serialize_start_part( + axiom_text_t * om_text, + const axutil_env_t * env, + axiom_output_t * om_output); + +struct axiom_text +{ + + /** Text value */ + axutil_string_t *value; + + /** The following fields are for MTOM */ + axis2_char_t *mime_type; + axis2_bool_t optimize; + const axis2_char_t *localname; + axis2_bool_t is_binary; + axis2_bool_t is_swa; + axis2_char_t *content_id; + axiom_attribute_t *om_attribute; + axiom_namespace_t *ns; + axiom_data_handler_t *data_handler; +}; + +AXIS2_EXTERN axiom_text_t *AXIS2_CALL +axiom_text_create( + const axutil_env_t * env, + axiom_node_t * parent, + const axis2_char_t * value, + axiom_node_t ** node) +{ + axiom_text_t *om_text = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, node, NULL); + + *node = axiom_node_create(env); + + if(!(*node)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + om_text = (axiom_text_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_text_t)); + if(!om_text) + { + AXIS2_FREE(env->allocator, *node); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + om_text->mime_type = NULL; + om_text->optimize = AXIS2_FALSE; + om_text->localname = "Include"; + om_text->is_binary = AXIS2_FALSE; + om_text->is_swa = AXIS2_FALSE; + om_text->content_id = NULL; + om_text->om_attribute = NULL; + om_text->value = NULL; + om_text->ns = NULL; + om_text->data_handler = NULL; + om_text->mime_type = NULL; + + if(value) + { + om_text->value = axutil_string_create(env, value); + } + + axiom_node_set_data_element((*node), env, om_text); + axiom_node_set_node_type((*node), env, AXIOM_TEXT); + axiom_node_set_complete((*node), env, AXIS2_FALSE); + + if(parent && axiom_node_get_node_type(parent, env) == AXIOM_ELEMENT) + { + axiom_node_add_child(parent, env, (*node)); + } + + return om_text; +} + +AXIS2_EXTERN axiom_text_t *AXIS2_CALL +axiom_text_create_with_data_handler( + const axutil_env_t * env, + axiom_node_t * parent, + axiom_data_handler_t * data_handler, + axiom_node_t ** node) +{ + + axiom_text_t *om_text = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, data_handler, NULL); + + om_text = (axiom_text_t *)axiom_text_create(env, parent, NULL, node); + if(!om_text) + { + return NULL; + } + om_text->optimize = AXIS2_TRUE; + om_text->is_binary = AXIS2_TRUE; + om_text->data_handler = data_handler; + om_text->mime_type = axiom_data_handler_get_content_type(data_handler, env); + return om_text; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_text_free( + axiom_text_t * om_text, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, void); + + if(om_text->value) + { + axutil_string_free(om_text->value, env); + } + + if(om_text->ns) + { + axiom_namespace_free(om_text->ns, env); + } + + if(om_text->content_id) + { + AXIS2_FREE(env->allocator, om_text->content_id); + } + + if(om_text->om_attribute) + { + axiom_attribute_free(om_text->om_attribute, env); + } + + if(om_text->data_handler) + { + axiom_data_handler_free(om_text->data_handler, env); + } + + AXIS2_FREE(env->allocator, om_text); + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_text_serialize( + axiom_text_t * om_text, + const axutil_env_t * env, + axiom_output_t * om_output) +{ + int status = AXIS2_SUCCESS; + axis2_char_t *attribute_value = NULL; + const axis2_char_t *text = NULL; + axiom_xml_writer_t *om_output_xml_writer = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE); + + if(!axiom_text_get_is_binary(om_text, env)) + { + if(om_text->value) + { + status = axiom_output_write(om_output, env, AXIOM_TEXT, 1, axutil_string_get_buffer( + om_text->value, env)); + } + } + else + { + om_output_xml_writer = axiom_output_get_xml_writer(om_output, env); + if(axiom_output_is_optimized(om_output, env) && om_text->optimize) + { + if(!(axiom_text_get_content_id(om_text, env))) + { + axis2_char_t *content_id = axiom_output_get_next_content_id(om_output, env); + if(content_id) + { + om_text->content_id = axutil_strdup(env, content_id); + } + } + + attribute_value = axutil_stracat(env, "cid:", om_text->content_id); + + /*send binary as MTOM optimised */ + if(om_text->om_attribute) + { + axiom_attribute_free(om_text->om_attribute, env); + om_text->om_attribute = NULL; + } + + om_text->om_attribute = axiom_attribute_create(env, "href", attribute_value, NULL); + + AXIS2_FREE(env->allocator, attribute_value); + attribute_value = NULL; + + if(!om_text->is_swa) /* This is a hack to get SwA working */ + { + axiom_text_serialize_start_part(om_text, env, om_output); + } + else + { + status = axiom_output_write(om_output, env, AXIOM_TEXT, 1, om_text->content_id); + } + + axiom_output_write_optimized(om_output, env, om_text); + + axiom_output_write(om_output, env, AXIOM_ELEMENT, 0); + } + else + { + text = axiom_text_get_text(om_text, env); + axiom_xml_writer_write_characters(om_output_xml_writer, env, (axis2_char_t *)text); + } + } + return status; +} + +AXIS2_EXTERN const axis2_char_t *AXIS2_CALL +axiom_text_get_value( + axiom_text_t * om_text, + const axutil_env_t * env) +{ + if(om_text->value) + { + return axutil_string_get_buffer(om_text->value, env); + } + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_text_set_value( + axiom_text_t * om_text, + const axutil_env_t * env, + const axis2_char_t * value) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_text, AXIS2_FAILURE); + + if(om_text->value) + { + axutil_string_free(om_text->value, env); + om_text->value = NULL; + } + + om_text->value = axutil_string_create(env, value); + if(!om_text->value) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +/*Following has been implemented for the MTOM support*/ + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_text_get_mime_type( + axiom_text_t * om_text, + const axutil_env_t * env) +{ + return om_text->mime_type; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_text_set_mime_type( + axiom_text_t * om_text, + const axutil_env_t * env, + const axis2_char_t * mime_type) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_text, AXIS2_FAILURE); + if(om_text->mime_type) + { + AXIS2_FREE(env->allocator, om_text->mime_type); + } + om_text->mime_type = (axis2_char_t *)axutil_strdup(env, mime_type); + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_text_get_optimize( + axiom_text_t * om_text, + const axutil_env_t * env) +{ + return om_text->optimize; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_text_set_optimize( + axiom_text_t * om_text, + const axutil_env_t * env, + axis2_bool_t optimize) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_text, AXIS2_FAILURE); + om_text->optimize = optimize; + return AXIS2_SUCCESS; +} + +static axis2_bool_t AXIS2_CALL +axiom_text_get_is_binary( + axiom_text_t * om_text, + const axutil_env_t * env) +{ + return om_text->is_binary; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_text_set_is_binary( + axiom_text_t * om_text, + const axutil_env_t * env, + const axis2_bool_t is_binary) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_text, AXIS2_FAILURE); + om_text->is_binary = is_binary; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN const axis2_char_t *AXIS2_CALL +axiom_text_get_localname( + axiom_text_t * om_text, + const axutil_env_t * env) +{ + return om_text->localname; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_text_get_content_id( + axiom_text_t * om_text, + const axutil_env_t * env) +{ + return om_text->content_id; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_text_set_content_id( + axiom_text_t * om_text, + const axutil_env_t * env, + const axis2_char_t * content_id) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_text, AXIS2_FAILURE); + if(om_text->content_id) + { + AXIS2_FREE(env->allocator, om_text->content_id); + } + om_text->content_id = (axis2_char_t *)axutil_strdup(env, content_id); + return AXIS2_SUCCESS; +} + +static axis2_status_t AXIS2_CALL +axiom_text_serialize_start_part( + axiom_text_t * om_text, + const axutil_env_t * env, + axiom_output_t * om_output) +{ + axis2_char_t *namespace_uri = NULL; + axis2_char_t *prefix = NULL; + const axis2_char_t *local_name = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + local_name = axiom_text_get_localname(om_text, env); + + om_text->ns = axiom_namespace_create(env, "http://www.w3.org/2004/08/xop/include", "xop"); + + if(om_text->ns) + { + namespace_uri = axiom_namespace_get_uri(om_text->ns, env); + if(namespace_uri) + { + prefix = axiom_namespace_get_prefix(om_text->ns, env); + + if(prefix) + { + axiom_output_write(om_output, env, AXIOM_ELEMENT, 3, local_name, namespace_uri, + prefix); + } + else + { + axiom_output_write(om_output, env, AXIOM_ELEMENT, 2, local_name, namespace_uri); + } + } + else + { + axiom_output_write(om_output, env, AXIOM_ELEMENT, 1, local_name); + } + } + else + { + axiom_output_write(om_output, env, AXIOM_TEXT, 1, local_name); + } + if(om_text->om_attribute) + { + axiom_attribute_serialize(om_text->om_attribute, env, om_output); + } + if(om_text->ns) + { + axiom_namespace_serialize(om_text->ns, env, om_output); + axiom_namespace_free(om_text->ns, env); + om_text->ns = NULL; + } + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_text_serialize_attribute( + axiom_text_t * om_text, + const axutil_env_t * env, + axiom_output_t * om_output, + axiom_attribute_t * om_attribute) +{ + axiom_xml_writer_t *xml_writer = NULL; + axiom_namespace_t *om_namespace = NULL; + + axis2_char_t *namespace_uri = NULL; + axis2_char_t *prefix = NULL; + axis2_char_t *attribute_local_name = NULL; + axis2_char_t *attribute_value = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0, + AXIS2_XML_PARSER_TYPE_BUFFER); + om_namespace = axiom_namespace_create(env, "", ""); + + namespace_uri = axiom_namespace_get_uri(om_text->ns, env); + attribute_local_name = axiom_attribute_get_localname(om_attribute, env); + + if(om_namespace) + { + prefix = axiom_namespace_get_prefix(om_text->ns, env); + attribute_value = axiom_attribute_get_value(om_attribute, env); + if(prefix) + { + axiom_xml_writer_write_attribute(xml_writer, env, attribute_local_name, attribute_value); + } + else + { + axiom_xml_writer_write_attribute_with_namespace(xml_writer, env, attribute_local_name, + attribute_value, namespace_uri); + } + } + else + { + axiom_xml_writer_write_attribute(xml_writer, env, attribute_local_name, attribute_value); + } + axiom_namespace_free(om_namespace, env); + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_text_serialize_namespace( + axiom_text_t * om_text, + const axutil_env_t * env, + const axiom_namespace_t * om_namespace, + axiom_output_t * om_output) +{ + axiom_xml_writer_t *xml_writer = NULL; + axis2_char_t *namespace_uri = NULL; + axis2_char_t *namespace_prefix = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0, + AXIS2_XML_PARSER_TYPE_BUFFER); + om_namespace = axiom_namespace_create(env, "", ""); + + if(om_namespace) + { + namespace_uri = axiom_namespace_get_uri(om_text->ns, env); + namespace_prefix = axiom_namespace_get_prefix(om_text->ns, env); + axiom_xml_writer_write_namespace(xml_writer, env, namespace_prefix, namespace_uri); + axiom_xml_writer_set_prefix(xml_writer, env, namespace_prefix, namespace_uri); + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN const axis2_char_t *AXIS2_CALL +axiom_text_get_text( + axiom_text_t * om_text, + const axutil_env_t * env) +{ + if(om_text->value) + { + return axutil_string_get_buffer(om_text->value, env); + } + else + { + axis2_char_t *data_handler_stream = NULL; + size_t data_handler_stream_size = 0; + if(om_text->data_handler) + { + int encoded_len = 0; + axis2_char_t *encoded_str = NULL; + axiom_data_handler_read_from(om_text->data_handler, env, &data_handler_stream, + &data_handler_stream_size); + if(data_handler_stream) + { + encoded_len = axutil_base64_encode_len((int)data_handler_stream_size); + encoded_str = AXIS2_MALLOC(env->allocator, encoded_len + 2); + if(encoded_str) + { + encoded_len = axutil_base64_encode(encoded_str, data_handler_stream, + (int)data_handler_stream_size); + encoded_str[encoded_len] = '\0'; + return encoded_str; + } + } + } + } + return NULL; +} + +AXIS2_EXTERN axiom_data_handler_t *AXIS2_CALL +axiom_text_get_data_handler( + axiom_text_t * om_text, + const axutil_env_t * env) +{ + return om_text->data_handler; +} + +AXIS2_EXTERN axiom_text_t *AXIS2_CALL +axiom_text_create_str( + const axutil_env_t * env, + axiom_node_t * parent, + axutil_string_t * value, + axiom_node_t ** node) +{ + axiom_text_t *om_text = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, node, NULL); + + *node = axiom_node_create(env); + + if(!(*node)) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + om_text = (axiom_text_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_text_t)); + if(!om_text) + { + AXIS2_FREE(env->allocator, *node); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + om_text->mime_type = NULL; + om_text->optimize = AXIS2_FALSE; + om_text->localname = "Include"; + om_text->is_binary = AXIS2_FALSE; + om_text->content_id = NULL; + om_text->om_attribute = NULL; + om_text->value = NULL; + om_text->ns = NULL; + om_text->data_handler = NULL; + om_text->mime_type = NULL; + + if(value) + { + om_text->value = axutil_string_clone(value, env); + } + + axiom_node_set_data_element((*node), env, om_text); + axiom_node_set_node_type((*node), env, AXIOM_TEXT); + axiom_node_set_complete((*node), env, AXIS2_FALSE); + + if(parent && axiom_node_get_node_type(parent, env) == AXIOM_ELEMENT) + { + axiom_node_add_child(parent, env, (*node)); + } + + return om_text; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_text_set_value_str( + struct axiom_text * om_text, + const axutil_env_t * env, + axutil_string_t * value) +{ + if(om_text->value) + { + axutil_string_free(om_text->value, env); + om_text->value = NULL; + } + if(value) + { + om_text->value = axutil_string_clone(value, env); + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axutil_string_t *AXIS2_CALL +axiom_text_get_value_str( + struct axiom_text * om_text, + const axutil_env_t * env) +{ + return om_text->value; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_text_set_is_swa( + axiom_text_t * om_text, + const axutil_env_t * env, + const axis2_bool_t is_swa) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_text, AXIS2_FAILURE); + om_text->is_swa = is_swa; + return AXIS2_SUCCESS; +} diff --git a/axiom/src/parser/Makefile.am b/axiom/src/parser/Makefile.am new file mode 100644 index 0000000..6c1d2ba --- /dev/null +++ b/axiom/src/parser/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = $(WRAPPER_DIR) + +DIST_SUBDIRS=guththila libxml2 diff --git a/axiom/src/parser/guththila/Makefile.am b/axiom/src/parser/guththila/Makefile.am new file mode 100644 index 0000000..0cc6be5 --- /dev/null +++ b/axiom/src/parser/guththila/Makefile.am @@ -0,0 +1,13 @@ +lib_LTLIBRARIES = libaxis2_parser.la + +libaxis2_parser_la_LIBADD = ../../../../guththila/src/libguththila.la \ + ../../../../util/src/libaxutil.la + +libaxis2_parser_la_SOURCES = ../xml_reader.c ../xml_writer.c guththila_xml_writer_wrapper.c \ + guththila_xml_reader_wrapper.c + +libaxis2_parser_la_LDFLAGS = -version-info $(VERSION_NO) + +INCLUDES = -I$(top_builddir)/include \ + -I ../../../../util/include \ + -I ../../../../guththila/include diff --git a/axiom/src/parser/guththila/guththila_xml_reader_wrapper.c b/axiom/src/parser/guththila/guththila_xml_reader_wrapper.c new file mode 100644 index 0000000..086ed12 --- /dev/null +++ b/axiom/src/parser/guththila/guththila_xml_reader_wrapper.c @@ -0,0 +1,613 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_xml_reader.h> +#include <axutil_env.h> +#include <axutil_utils.h> +#include <guththila.h> + +/**************** function prototypes ******************************************/ + +int AXIS2_CALL guththila_xml_reader_wrapper_next( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +void AXIS2_CALL guththila_xml_reader_wrapper_free( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +int AXIS2_CALL guththila_xml_reader_wrapper_get_attribute_count( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_attribute_name_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_attribute_prefix_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_attribute_value_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_attribute_namespace_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + +axis2_char_t *AXIS2_CALL guththila_xml_reader_wrapper_get_value( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +int AXIS2_CALL guththila_xml_reader_wrapper_get_namespace_count( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_namespace_uri_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_namespace_prefix_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + +axis2_char_t *AXIS2_CALL guththila_xml_reader_wrapper_get_prefix( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL guththila_xml_reader_wrapper_get_name( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL guththila_xml_reader_wrapper_get_pi_target( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL guththila_xml_reader_wrapper_get_pi_data( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL guththila_xml_reader_wrapper_get_dtd( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +void AXIS2_CALL guththila_xml_reader_wrapper_xml_free( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + void *data); + +axis2_char_t *AXIS2_CALL guththila_xml_reader_wrapper_get_char_set_encoding( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL guththila_xml_reader_wrapper_get_namespace_uri( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_namespace_uri_by_prefix( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + axis2_char_t * prefix); + +void *AXIS2_CALL +guththila_xml_reader_wrapper_get_context( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_current_buffer( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +/*********** guththila_xml_reader_wrapper_impl_t wrapper struct *******************/ + +typedef struct guththila_xml_reader_wrapper_impl +{ + axiom_xml_reader_t parser; + guththila_t *guththila_parser; + guththila_reader_t *reader; + int event_map[10]; + void *context; + +} guththila_xml_reader_wrapper_impl_t; + +/********************************* Macro ***************************************/ + +#define AXIS2_INTF_TO_IMPL(p) ((guththila_xml_reader_wrapper_impl_t*)p) + +#define AXIS2_IMPL_TO_INTF(p) &(p->parser) + +/**********End macros -- event_map initializing function *********************/ + +static axis2_status_t +guththila_xml_reader_wrapper_init_map( + guththila_xml_reader_wrapper_impl_t * parser) +{ + if(parser) + { + parser->event_map[GUTHTHILA_START_DOCUMENT] = AXIOM_XML_READER_START_DOCUMENT; + parser->event_map[GUTHTHILA_START_ELEMENT] = AXIOM_XML_READER_START_ELEMENT; + parser->event_map[GUTHTHILA_END_ELEMENT] = AXIOM_XML_READER_END_ELEMENT; + parser->event_map[GUTHTHILA_SPACE] = AXIOM_XML_READER_SPACE; + parser->event_map[GUTHTHILA_EMPTY_ELEMENT] = AXIOM_XML_READER_EMPTY_ELEMENT; + parser->event_map[GUTHTHILA_CHARACTER] = AXIOM_XML_READER_CHARACTER; + parser->event_map[GUTHTHILA_ENTITY_REFERANCE] = AXIOM_XML_READER_ENTITY_REFERENCE; + parser->event_map[GUTHTHILA_COMMENT] = AXIOM_XML_READER_COMMENT; + return AXIS2_SUCCESS; + } + return AXIS2_FAILURE; +} + +static const axiom_xml_reader_ops_t axiom_xml_reader_ops_var = { guththila_xml_reader_wrapper_next, + guththila_xml_reader_wrapper_free, guththila_xml_reader_wrapper_get_attribute_count, + guththila_xml_reader_wrapper_get_attribute_name_by_number, + guththila_xml_reader_wrapper_get_attribute_prefix_by_number, + guththila_xml_reader_wrapper_get_attribute_value_by_number, + guththila_xml_reader_wrapper_get_attribute_namespace_by_number, + guththila_xml_reader_wrapper_get_value, guththila_xml_reader_wrapper_get_namespace_count, + guththila_xml_reader_wrapper_get_namespace_uri_by_number, + guththila_xml_reader_wrapper_get_namespace_prefix_by_number, + guththila_xml_reader_wrapper_get_prefix, guththila_xml_reader_wrapper_get_name, + guththila_xml_reader_wrapper_get_pi_target, guththila_xml_reader_wrapper_get_pi_data, + guththila_xml_reader_wrapper_get_dtd, guththila_xml_reader_wrapper_xml_free, + guththila_xml_reader_wrapper_get_char_set_encoding, + guththila_xml_reader_wrapper_get_namespace_uri, + guththila_xml_reader_wrapper_get_namespace_uri_by_prefix, + guththila_xml_reader_wrapper_get_context, + guththila_xml_reader_wrapper_get_current_buffer}; + +/********************************************************************************/ + +AXIS2_EXTERN axiom_xml_reader_t *AXIS2_CALL +axiom_xml_reader_create_for_file( + const axutil_env_t * env, + char *filename, + const axis2_char_t * encoding) +{ + guththila_xml_reader_wrapper_impl_t *guththila_impl = NULL; + guththila_t *guththila = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + guththila_impl = AXIS2_MALLOC(env->allocator, sizeof(guththila_xml_reader_wrapper_impl_t)); + + if(!guththila_impl) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + guththila_impl->reader = guththila_reader_create_for_file(filename, env); + + if(!(guththila_impl->reader)) + { + AXIS2_FREE(env->allocator, guththila_impl); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + guththila = (guththila_t *)AXIS2_MALLOC(env->allocator, sizeof(guththila_t)); + guththila_init(guththila, guththila_impl->reader, env); + if(!guththila) + { + AXIS2_FREE(env->allocator, guththila_impl); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + guththila_impl->guththila_parser = guththila; + guththila_impl->context = NULL; + guththila_impl->parser.ops = NULL; + /* guththila_impl->parser.ops = + (axiom_xml_reader_ops_t *) AXIS2_MALLOC(env->allocator, + sizeof(axiom_xml_reader_ops_t)); + if (!(guththila_impl->parser.ops)) + { + guththila_free(guththila, env); + AXIS2_FREE(env->allocator, guththila_impl); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + */ + guththila_xml_reader_wrapper_init_map(guththila_impl); + + /************** ops *****/ + guththila_impl->parser.ops = &axiom_xml_reader_ops_var; + return &(guththila_impl->parser); +} + +/****** pull parser for io create function ***************************/ + +axiom_xml_reader_t *AXIS2_CALL +axiom_xml_reader_create_for_io( + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK read_input_callback, + AXIS2_CLOSE_INPUT_CALLBACK close_input_callback, + void *ctx, + const char *encoding) +{ + guththila_xml_reader_wrapper_impl_t *guththila_impl = NULL; + /*axutil_allocator_t *allocator = NULL; */ + guththila_t *guththila = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + guththila_impl = AXIS2_MALLOC(env->allocator, sizeof(guththila_xml_reader_wrapper_impl_t)); + + if(!guththila_impl) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + /*allocator = axutil_allocator_init(NULL); */ + + /*-------difference of two create function is here--------*/ + guththila_impl->reader = guththila_reader_create_for_io(read_input_callback, ctx, env); + + if(!(guththila_impl->reader)) + { + AXIS2_FREE(env->allocator, guththila_impl); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + guththila = (guththila_t *)AXIS2_MALLOC(env->allocator, sizeof(guththila_t)); + guththila_init(guththila, guththila_impl->reader, env); + if(!guththila) + { + AXIS2_FREE(env->allocator, guththila_impl); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + guththila_impl->guththila_parser = guththila; + guththila_impl->context = ctx; + guththila_impl->parser.ops = NULL; + /* guththila_impl->parser.ops = (axiom_xml_reader_ops_t *) + AXIS2_MALLOC(env->allocator, sizeof(axiom_xml_reader_ops_t)); + if (!(guththila_impl->parser.ops)) + { + guththila_free(guththila, env); + AXIS2_FREE(env->allocator, guththila_impl); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + }*/ + + guththila_xml_reader_wrapper_init_map(guththila_impl); + + /************** ops *****/ + guththila_impl->parser.ops = &axiom_xml_reader_ops_var; + return &(guththila_impl->parser); +} + +/* ####################################################################### */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_reader_init() +{ + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_reader_cleanup() +{ + return AXIS2_SUCCESS; +} + +/* ######################################################################## */ + +AXIS2_EXTERN axiom_xml_reader_t *AXIS2_CALL +axiom_xml_reader_create_for_memory( + const axutil_env_t * env, + void *buffer, + int size, + const char *encoding, + int type) +{ + guththila_xml_reader_wrapper_impl_t *guththila_impl = NULL; + /*axutil_allocator_t *allocator = NULL; */ + guththila_t *guththila = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + guththila_impl = AXIS2_MALLOC(env->allocator, sizeof(guththila_xml_reader_wrapper_impl_t)); + + if(!guththila_impl) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + /*allocator = axutil_allocator_init(NULL); */ + + /*-------difference of two create function is here--------*/ + guththila_impl->reader = guththila_reader_create_for_memory(buffer, size, env); + + if(!(guththila_impl->reader)) + { + AXIS2_FREE(env->allocator, guththila_impl); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + guththila = (guththila_t *)AXIS2_MALLOC(env->allocator, sizeof(guththila_t)); + guththila_init(guththila, guththila_impl->reader, env); + if(!guththila) + { + AXIS2_FREE(env->allocator, guththila_impl); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + guththila_impl->guththila_parser = guththila; + guththila_impl->context = NULL; + guththila_impl->parser.ops = NULL; + /* guththila_impl->parser.ops = (axiom_xml_reader_ops_t *) + AXIS2_MALLOC(env->allocator, sizeof(axiom_xml_reader_ops_t)); + if (!(guththila_impl->parser.ops)) + { + guththila_free(guththila, env); + AXIS2_FREE(env->allocator, guththila_impl); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + */ + guththila_xml_reader_wrapper_init_map(guththila_impl); + + /************** ops *****/ + guththila_impl->parser.ops = &axiom_xml_reader_ops_var; + return &(guththila_impl->parser); +} + +int AXIS2_CALL +guththila_xml_reader_wrapper_next( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + int i = -1; + AXIS2_ENV_CHECK(env, -1); + i = guththila_next(AXIS2_INTF_TO_IMPL(parser)->guththila_parser, env); + return i == -1 ? -1 : AXIS2_INTF_TO_IMPL(parser)->event_map[i]; +} + +void AXIS2_CALL +guththila_xml_reader_wrapper_free( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + guththila_xml_reader_wrapper_impl_t *parser_impl = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + parser_impl = AXIS2_INTF_TO_IMPL(parser); + if(parser_impl->reader) + { + guththila_reader_free(parser_impl->reader, env); + } + + if(parser_impl->guththila_parser) + { + guththila_un_init(parser_impl->guththila_parser, env); + } + + AXIS2_FREE(env->allocator, parser_impl); +} + +int AXIS2_CALL +guththila_xml_reader_wrapper_get_attribute_count( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + return guththila_get_attribute_count(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser, env); +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_attribute_name_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + AXIS2_ENV_CHECK(env, NULL); + return guththila_get_attribute_name_by_number(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser, i, + env); +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_attribute_prefix_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + AXIS2_ENV_CHECK(env, NULL); + return guththila_get_attribute_prefix_by_number(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser, + i, env); +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_attribute_value_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + AXIS2_ENV_CHECK(env, NULL); + return guththila_get_attribute_value_by_number(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser, + i, env); +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_attribute_namespace_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + AXIS2_ENV_CHECK(env, NULL); + return guththila_get_attribute_namespace_by_number( + AXIS2_INTF_TO_IMPL(parser)-> guththila_parser, i, env); +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_value( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + return guththila_get_value(AXIS2_INTF_TO_IMPL(parser)->guththila_parser, env); +} + +int AXIS2_CALL +guththila_xml_reader_wrapper_get_namespace_count( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + return guththila_get_namespace_count(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser, env); +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_namespace_uri_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + AXIS2_ENV_CHECK(env, NULL); + return guththila_get_namespace_uri_by_number(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser, i, + env); +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_namespace_prefix_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + AXIS2_ENV_CHECK(env, NULL); + return guththila_get_namespace_prefix_by_number(AXIS2_INTF_TO_IMPL(parser)-> guththila_parser, + i, env); +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_prefix( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + return guththila_get_prefix(AXIS2_INTF_TO_IMPL(parser)->guththila_parser, env); +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_name( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, NULL); + return guththila_get_name(AXIS2_INTF_TO_IMPL(parser)->guththila_parser, env); +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_pi_target( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + /* guththila_does not support pi's yet */ + return NULL; +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_pi_data( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + /* guththila_dose not support yet */ + return NULL; +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_dtd( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + printf("not implemented in guththila"); + return NULL; +} + +void AXIS2_CALL +guththila_xml_reader_wrapper_xml_free( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + void *data) +{ + if(data) + AXIS2_FREE(env->allocator, data); +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_char_set_encoding( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return guththila_get_encoding(AXIS2_INTF_TO_IMPL(parser)->guththila_parser, env); +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_namespace_uri( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + + return (axis2_char_t *)NULL; +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_namespace_uri_by_prefix( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + axis2_char_t * prefix) +{ + return (axis2_char_t *)NULL; +} + +void *AXIS2_CALL +guththila_xml_reader_wrapper_get_context( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + guththila_xml_reader_wrapper_impl_t* parser_impl = NULL; + parser_impl = AXIS2_INTF_TO_IMPL(parser); + return parser_impl->context; +} + +axis2_char_t *AXIS2_CALL +guththila_xml_reader_wrapper_get_current_buffer( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return guththila_get_current_buffer(AXIS2_INTF_TO_IMPL(parser)->guththila_parser, env); +} + diff --git a/axiom/src/parser/guththila/guththila_xml_writer_wrapper.c b/axiom/src/parser/guththila/guththila_xml_writer_wrapper.c new file mode 100644 index 0000000..31b4040 --- /dev/null +++ b/axiom/src/parser/guththila/guththila_xml_writer_wrapper.c @@ -0,0 +1,787 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 <guththila_xml_writer.h> +#include <axutil_utils.h> +#include <axutil_env.h> +#include <axiom_xml_writer.h> +#include <string.h> + +/************************ function prototypes ************************************/ +void AXIS2_CALL guththila_xml_writer_wrapper_free( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_start_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_end_start_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_start_element_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_start_element_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_empty_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_empty_element_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_empty_element_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_end_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_end_document( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_attribute( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_attribute_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_attribute_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri, + axis2_char_t * prefix); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * namespace_uri); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_default_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * namespace_uri); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_comment( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * value); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_processing_instruction( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_processing_instruction_data( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target, + axis2_char_t * data); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_cdata( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * data); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_dtd( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * dtd); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_entity_ref( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * name); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_start_document( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_start_document_with_version( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * version); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_start_document_with_version_encoding( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * encoding, + axis2_char_t * version); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_characters( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text); + +axis2_char_t *AXIS2_CALL guththila_xml_writer_wrapper_get_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_set_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * uri); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_set_default_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_encoded( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text, + int in_attr); + +void *AXIS2_CALL guththila_xml_writer_wrapper_get_xml( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +unsigned int AXIS2_CALL guththila_xml_writer_wrapper_get_xml_size( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +int AXIS2_CALL guththila_xml_writer_wrapper_get_type( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_raw( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * content); + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_flush( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +/***************************** end function pointers *****************************/ + +typedef struct guththila_xml_writer_wrapper_impl +{ + axiom_xml_writer_t writer; + guththila_xml_writer_t *wr; +} guththila_xml_writer_wrapper_impl_t; + +static const axiom_xml_writer_ops_t axiom_xml_writer_ops_var = { guththila_xml_writer_wrapper_free, + guththila_xml_writer_wrapper_write_start_element, + guththila_xml_writer_wrapper_end_start_element, + guththila_xml_writer_wrapper_write_start_element_with_namespace, + guththila_xml_writer_wrapper_write_start_element_with_namespace_prefix, + guththila_xml_writer_wrapper_write_empty_element, + guththila_xml_writer_wrapper_write_empty_element_with_namespace, + guththila_xml_writer_wrapper_write_empty_element_with_namespace_prefix, + guththila_xml_writer_wrapper_write_end_element, + guththila_xml_writer_wrapper_write_end_document, guththila_xml_writer_wrapper_write_attribute, + guththila_xml_writer_wrapper_write_attribute_with_namespace, + guththila_xml_writer_wrapper_write_attribute_with_namespace_prefix, + guththila_xml_writer_wrapper_write_namespace, + guththila_xml_writer_wrapper_write_default_namespace, + guththila_xml_writer_wrapper_write_comment, + guththila_xml_writer_wrapper_write_processing_instruction, + guththila_xml_writer_wrapper_write_processing_instruction_data, + guththila_xml_writer_wrapper_write_cdata, guththila_xml_writer_wrapper_write_dtd, + guththila_xml_writer_wrapper_write_entity_ref, + guththila_xml_writer_wrapper_write_start_document, + guththila_xml_writer_wrapper_write_start_document_with_version, + guththila_xml_writer_wrapper_write_start_document_with_version_encoding, + guththila_xml_writer_wrapper_write_characters, guththila_xml_writer_wrapper_get_prefix, + guththila_xml_writer_wrapper_set_prefix, guththila_xml_writer_wrapper_set_default_prefix, + guththila_xml_writer_wrapper_write_encoded, guththila_xml_writer_wrapper_get_xml, + guththila_xml_writer_wrapper_get_xml_size, guththila_xml_writer_wrapper_get_type, + guththila_xml_writer_wrapper_write_raw, guththila_xml_writer_wrapper_flush }; + +/****************************** Macros *******************************************/ + +#define AXIS2_INTF_TO_IMPL(p) ((guththila_xml_writer_wrapper_impl_t*)p) + +/******************************* End macro ***************************************/ + +AXIS2_EXTERN axiom_xml_writer_t *AXIS2_CALL +axiom_xml_writer_create( + const axutil_env_t * env, + axis2_char_t * filename, + axis2_char_t * encoding, + int is_prefix_default, + int compression) +{ + guththila_xml_writer_wrapper_impl_t *writer_impl; + + AXIS2_ENV_CHECK(env, NULL); + + writer_impl = (guththila_xml_writer_wrapper_impl_t *)AXIS2_MALLOC(env->allocator, + sizeof(guththila_xml_writer_wrapper_impl_t)); + return &(writer_impl->writer); +} + +AXIS2_EXTERN axiom_xml_writer_t *AXIS2_CALL +axiom_xml_writer_create_for_memory( + const axutil_env_t * env, + axis2_char_t * encoding, + int is_prefix_default, + int compression, + int type) +{ + guththila_xml_writer_wrapper_impl_t *writer_impl = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + writer_impl = (guththila_xml_writer_wrapper_impl_t *)AXIS2_MALLOC(env->allocator, + sizeof(guththila_xml_writer_wrapper_impl_t)); + + if(!writer_impl) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + /* creating guththila parser */ + /* guththila xml stream writer for memory */ + + writer_impl->wr = guththila_create_xml_stream_writer_for_memory(env); + + if(!(writer_impl->wr)) + { + AXIS2_FREE(env->allocator, writer_impl->wr); + AXIS2_FREE(env->allocator, writer_impl); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + writer_impl->writer.ops = NULL; + /* ops */ + writer_impl->writer.ops = &axiom_xml_writer_ops_var; + return &(writer_impl->writer); + +} + +void AXIS2_CALL +guththila_xml_writer_wrapper_free( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + if(AXIS2_INTF_TO_IMPL(writer)->wr) + { + guththila_xml_writer_free(AXIS2_INTF_TO_IMPL(writer)->wr, env); + } + + if(writer) + { + AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(writer)); + } + +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_start_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname) +{ + int status = AXIS2_SUCCESS; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + guththila_write_start_element(AXIS2_INTF_TO_IMPL(writer)->wr, localname, env); + return status; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_start_element_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri) +{ + int status = AXIS2_SUCCESS; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + guththila_write_start_element_with_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, namespace_uri, + localname, env); + return status; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_start_element_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE); + guththila_write_start_element_with_prefix_and_namespace(AXIS2_INTF_TO_IMPL + (writer)->wr, prefix, namespace_uri, localname, env); + return AXIS2_SUCCESS; + +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_empty_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + guththila_write_empty_element(AXIS2_INTF_TO_IMPL(writer)->wr, localname, env); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_empty_element_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + guththila_write_empty_element_with_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, namespace_uri, + localname, env); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_empty_element_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE); + + guththila_write_empty_element_with_prefix_and_namespace(AXIS2_INTF_TO_IMPL + (writer)->wr, prefix, namespace_uri, localname, env); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_end_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + guththila_write_end_element(AXIS2_INTF_TO_IMPL(writer)->wr, env); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_end_document( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + guththila_write_end_document(AXIS2_INTF_TO_IMPL(writer)->wr, env); + return AXIS2_SUCCESS; + +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_attribute( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value) +{ + if(!value) + value = ""; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE); + guththila_write_attribute(AXIS2_INTF_TO_IMPL(writer)->wr, localname, value, env); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_attribute_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri) +{ + if(!value) + value = ""; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + + guththila_write_attribute_with_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, namespace_uri, + localname, value, env); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_attribute_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri, + axis2_char_t * prefix) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE); + guththila_write_attribute_with_prefix_and_namespace(AXIS2_INTF_TO_IMPL + (writer)->wr, prefix, namespace_uri, localname, value, env); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * namespace_uri) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + /* when default namespace comes is passed, prefix is null */ + if(prefix) + guththila_write_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, prefix, namespace_uri, env); + else + guththila_write_default_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, namespace_uri, env); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_default_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * namespace_uri) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + guththila_write_default_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, namespace_uri, env); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_comment( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * value) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE); + guththila_write_comment(AXIS2_INTF_TO_IMPL(writer)->wr, value, env); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_processing_instruction( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, target, AXIS2_FAILURE); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_processing_instruction_data( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target, + axis2_char_t * data) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, target, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, data, AXIS2_FAILURE); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_cdata( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * data) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, data, AXIS2_FAILURE); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_dtd( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * dtd) +{ + /* AXIS2_ENV_CHECK( env, AXIS2_FAILURE); */ + /* AXIS2_PARAM_CHECK(env->error, dtd, AXIS2_FAILURE); */ + /* return guththila_write_dtd( */ + /* (axutil_env_t *)env, */ + /* AXIS2_INTF_TO_IMPL(writer)->parser, */ + /* dtd); */ + return 0; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_entity_ref( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * name) +{ + /* AXIS2_ENV_CHECK( env, AXIS2_FAILURE); */ + /* AXIS2_PARAM_CHECK(env->error, name, AXIS2_FAILURE); */ + /* return guththila_write_entity_ref( */ + /* (axutil_env_t *)env, */ + /* AXIS2_INTF_TO_IMPL(writer)->parser, */ + /* name); */ + return 0; + +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_start_document( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + guththila_write_start_document(AXIS2_INTF_TO_IMPL(writer)->wr, env, NULL, NULL); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_start_document_with_version( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * version) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, version, AXIS2_FAILURE); + guththila_write_start_document(AXIS2_INTF_TO_IMPL(writer)->wr, env, NULL, version); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_start_document_with_version_encoding( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * encoding, + axis2_char_t * version) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, encoding, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, version, AXIS2_FAILURE); + guththila_write_start_document(AXIS2_INTF_TO_IMPL(writer)->wr, env, encoding, version); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_characters( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, text, AXIS2_FAILURE); + guththila_write_characters(AXIS2_INTF_TO_IMPL(writer)->wr, text, env); + return AXIS2_SUCCESS; +} + +axis2_char_t *AXIS2_CALL +guththila_xml_writer_wrapper_get_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri) +{ + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, uri, NULL); + return guththila_get_prefix_for_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, uri, env); +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_set_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * uri) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, uri, AXIS2_FAILURE); + guththila_write_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, prefix, uri, env); + return AXIS2_SUCCESS; + +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_set_default_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, uri, AXIS2_FAILURE); + guththila_write_default_namespace(AXIS2_INTF_TO_IMPL(writer)->wr, uri, env); + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_encoded( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text, + int in_attr) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, text, AXIS2_FAILURE); + return AXIS2_SUCCESS; +} + +void *AXIS2_CALL +guththila_xml_writer_wrapper_get_xml( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + char *buffer = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + buffer = guththila_get_memory_buffer(AXIS2_INTF_TO_IMPL(writer)->wr, env); + return (void *)buffer; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_write_raw( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * content) +{ + if(!content) + { + return AXIS2_FAILURE; + } + else + { + guththila_write_to_buffer(AXIS2_INTF_TO_IMPL(writer)->wr, (char *)content, (int)strlen( + content), env); + return AXIS2_SUCCESS; + } +} + +unsigned int AXIS2_CALL +guththila_xml_writer_wrapper_get_xml_size( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + return guththila_get_memory_buffer_size(AXIS2_INTF_TO_IMPL(writer)->wr, env); +} + +int AXIS2_CALL +guththila_xml_writer_wrapper_get_type( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + return 0; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_flush( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +guththila_xml_writer_wrapper_end_start_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + /* nothing to do , + it is automatically taken care by the libxml2 writer */ + return AXIS2_SUCCESS; +} diff --git a/axiom/src/parser/libxml2/Makefile.am b/axiom/src/parser/libxml2/Makefile.am new file mode 100644 index 0000000..a5b4c75 --- /dev/null +++ b/axiom/src/parser/libxml2/Makefile.am @@ -0,0 +1,17 @@ +lib_LTLIBRARIES = libaxis2_parser.la + + +libaxis2_parser_la_SOURCES = ../xml_reader.c ../xml_writer.c \ + libxml2_reader_wrapper.c libxml2_writer_wrapper.c + +libaxis2_parser_la_LIBADD = @LIBXML2_LIBS@ \ + ../../../../util/src/libaxutil.la + +libaxis2_parser_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_libxml2_la_LDFLAGS = -version-info $(VERSION_NO) + + +INCLUDES = -I$(top_builddir)/include \ + -I$(top_builddir)/src/parser \ + -I ../../../../util/include \ + @LIBXML2_CFLAGS@ diff --git a/axiom/src/parser/libxml2/libxml2_reader_wrapper.c b/axiom/src/parser/libxml2/libxml2_reader_wrapper.c new file mode 100644 index 0000000..2510d49 --- /dev/null +++ b/axiom/src/parser/libxml2/libxml2_reader_wrapper.c @@ -0,0 +1,949 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_xml_reader.h> +#include <libxml/xmlreader.h> +#include <libxml/parser.h> +#include <axutil_utils_defines.h> +#include <axutil_utils.h> +#include <string.h> +#include <axutil_string.h> + + +int AXIS2_CALL axis2_libxml2_reader_wrapper_next( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +void AXIS2_CALL axis2_libxml2_reader_wrapper_free( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +int AXIS2_CALL axis2_libxml2_reader_wrapper_get_attribute_count( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_attribute_name_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_attribute_prefix_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_attribute_value_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_attribute_namespace_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + +axis2_char_t *AXIS2_CALL axis2_libxml2_reader_wrapper_get_value( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +int AXIS2_CALL axis2_libxml2_reader_wrapper_get_namespace_count( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_namespace_uri_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_namespace_prefix_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i); + +axis2_char_t *AXIS2_CALL axis2_libxml2_reader_wrapper_get_prefix( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL axis2_libxml2_reader_wrapper_get_name( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL axis2_libxml2_reader_wrapper_get_pi_target( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL axis2_libxml2_reader_wrapper_get_pi_data( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL axis2_libxml2_reader_wrapper_get_dtd( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +void AXIS2_CALL axis2_libxml2_reader_wrapper_xml_free( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + void *data); + +axis2_char_t *AXIS2_CALL axis2_libxml2_reader_wrapper_get_char_set_encoding( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL axis2_libxml2_reader_wrapper_get_namespace_uri( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_namespace_uri_by_prefix( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + axis2_char_t * prefix); + +axis2_status_t +axis2_libxml2_reader_wrapper_fill_maps( + axiom_xml_reader_t * parser, + const axutil_env_t * env); + +void +axis2_libxml2_reader_wrapper_error_handler( + void *arg, + const char *msg, + int severities, + void *locator_ptr); + +static int +axis2_libxml2_reader_wrapper_read_input_callback( + void *ctx, + char *buffer, + int size); + +static int +axis2_libxml2_reader_wrapper_close_input_callback( + void *ctx); + +typedef struct axis2_libxml2_reader_wrapper_impl_t +{ + axiom_xml_reader_t parser; + + xmlTextReaderPtr reader; + + int current_event; + int current_attribute_count; + int current_namespace_count; + int event_map[18]; + + void *ctx; + /* assuming that max ns and attribute will be 20 */ + + int *namespace_map; + int *attribute_map; + + AXIS2_READ_INPUT_CALLBACK read_input_callback; + + AXIS2_CLOSE_INPUT_CALLBACK close_input_callback; + +} axis2_libxml2_reader_wrapper_impl_t; + +#define AXIS2_INTF_TO_IMPL(p) ((axis2_libxml2_reader_wrapper_impl_t*)p) +#define AXIS2_IMPL_TO_INTF(p) &(p->parser) + +static const axiom_xml_reader_ops_t axiom_xml_reader_ops_var = { axis2_libxml2_reader_wrapper_next, + axis2_libxml2_reader_wrapper_free, axis2_libxml2_reader_wrapper_get_attribute_count, + axis2_libxml2_reader_wrapper_get_attribute_name_by_number, + axis2_libxml2_reader_wrapper_get_attribute_prefix_by_number, + axis2_libxml2_reader_wrapper_get_attribute_value_by_number, + axis2_libxml2_reader_wrapper_get_attribute_namespace_by_number, + axis2_libxml2_reader_wrapper_get_value, axis2_libxml2_reader_wrapper_get_namespace_count, + axis2_libxml2_reader_wrapper_get_namespace_uri_by_number, + axis2_libxml2_reader_wrapper_get_namespace_prefix_by_number, + axis2_libxml2_reader_wrapper_get_prefix, axis2_libxml2_reader_wrapper_get_name, + axis2_libxml2_reader_wrapper_get_pi_target, axis2_libxml2_reader_wrapper_get_pi_data, + axis2_libxml2_reader_wrapper_get_dtd, axis2_libxml2_reader_wrapper_xml_free, + axis2_libxml2_reader_wrapper_get_char_set_encoding, + axis2_libxml2_reader_wrapper_get_namespace_uri, + axis2_libxml2_reader_wrapper_get_namespace_uri_by_prefix }; + +static axis2_status_t +axis2_libxml2_reader_wrapper_init_map( + axis2_libxml2_reader_wrapper_impl_t * parser) +{ + int i = 0; + if(parser) + { + for(i = 0; i < 18; i++) + { + parser->event_map[i] = -1; + } + + parser->event_map[XML_READER_TYPE_ELEMENT] = AXIOM_XML_READER_START_ELEMENT; + parser->event_map[XML_READER_TYPE_DOCUMENT] = AXIOM_XML_READER_START_DOCUMENT; + parser->event_map[XML_READER_TYPE_TEXT] = AXIOM_XML_READER_CHARACTER; + parser->event_map[XML_READER_TYPE_CDATA] = AXIOM_XML_READER_CHARACTER; + parser->event_map[XML_READER_TYPE_SIGNIFICANT_WHITESPACE] = AXIOM_XML_READER_SPACE; + parser->event_map[XML_READER_TYPE_WHITESPACE] = AXIOM_XML_READER_SPACE; + parser->event_map[XML_READER_TYPE_END_ELEMENT] = AXIOM_XML_READER_END_ELEMENT; + parser->event_map[XML_READER_TYPE_ENTITY_REFERENCE] = AXIOM_XML_READER_ENTITY_REFERENCE; + parser->event_map[XML_READER_TYPE_END_ENTITY] = AXIOM_XML_READER_SPACE; + parser->event_map[XML_READER_TYPE_ENTITY] = AXIOM_XML_READER_SPACE; + parser->event_map[XML_READER_TYPE_PROCESSING_INSTRUCTION] + = AXIOM_XML_READER_PROCESSING_INSTRUCTION; + parser->event_map[XML_READER_TYPE_COMMENT] = AXIOM_XML_READER_COMMENT; + parser->event_map[XML_READER_TYPE_DOCUMENT_TYPE] = AXIOM_XML_READER_DOCUMENT_TYPE; + return AXIS2_SUCCESS; + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_reader_init() +{ + xmlInitParser(); + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_reader_cleanup() +{ + xmlCleanupParser(); + return AXIS2_SUCCESS; +} + +static axis2_libxml2_reader_wrapper_impl_t* +libxml2_reader_wrapper_create( + const axutil_env_t *env) +{ + axis2_libxml2_reader_wrapper_impl_t *wrapper_impl = NULL; + wrapper_impl = (axis2_libxml2_reader_wrapper_impl_t *)AXIS2_MALLOC(env->allocator, + sizeof(axis2_libxml2_reader_wrapper_impl_t)); + + if(!wrapper_impl) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create libxml2 reader wrapper"); + return NULL; + } + memset(wrapper_impl, 0, sizeof(axis2_libxml2_reader_wrapper_impl_t)); + wrapper_impl->attribute_map = NULL; + wrapper_impl->namespace_map = NULL; + wrapper_impl->close_input_callback = NULL; + wrapper_impl->read_input_callback = NULL; + wrapper_impl->ctx = NULL; + wrapper_impl->current_namespace_count = 0; + wrapper_impl->current_attribute_count = 0; + wrapper_impl->current_event = -1; + return wrapper_impl; +} + +AXIS2_EXTERN axiom_xml_reader_t *AXIS2_CALL +axiom_xml_reader_create_for_file( + const axutil_env_t * env, + char *filename, + const axis2_char_t * encoding) +{ + + axis2_libxml2_reader_wrapper_impl_t *wrapper_impl = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, filename, NULL); + + wrapper_impl = libxml2_reader_wrapper_create(env); + if(!wrapper_impl) + { + return NULL; + } + + wrapper_impl->reader = xmlReaderForFile(filename, encoding, XML_PARSE_RECOVER); + if(!(wrapper_impl->reader)) + { + AXIS2_FREE(env->allocator, wrapper_impl); + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_CREATING_XML_STREAM_READER, AXIS2_FAILURE); + return NULL; + } + + xmlTextReaderSetErrorHandler(wrapper_impl->reader, + (xmlTextReaderErrorFunc)axis2_libxml2_reader_wrapper_error_handler, (void *)env); + wrapper_impl->current_event = -1; + wrapper_impl->ctx = NULL; + axis2_libxml2_reader_wrapper_init_map(wrapper_impl); + + wrapper_impl->parser.ops = &axiom_xml_reader_ops_var; + return &(wrapper_impl->parser); +} + +AXIS2_EXTERN axiom_xml_reader_t *AXIS2_CALL +axiom_xml_reader_create_for_io( + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK read_input_callback, + AXIS2_CLOSE_INPUT_CALLBACK close_input_callback, + void *ctx, + const axis2_char_t * encoding) +{ + axis2_libxml2_reader_wrapper_impl_t *wrapper_impl = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + if(!read_input_callback) + { + return NULL; + } + + wrapper_impl = libxml2_reader_wrapper_create(env); + if(!wrapper_impl) + { + return NULL; + } + wrapper_impl->close_input_callback = NULL; + wrapper_impl->read_input_callback = NULL; + wrapper_impl->read_input_callback = read_input_callback; + wrapper_impl->close_input_callback = close_input_callback; + wrapper_impl->ctx = ctx; + if(wrapper_impl->close_input_callback) + { + wrapper_impl->reader = xmlReaderForIO(axis2_libxml2_reader_wrapper_read_input_callback, + axis2_libxml2_reader_wrapper_close_input_callback, wrapper_impl, NULL, encoding, + XML_PARSE_RECOVER); + } + else + { + wrapper_impl->reader = xmlReaderForIO(axis2_libxml2_reader_wrapper_read_input_callback, + NULL, wrapper_impl, NULL, encoding, XML_PARSE_RECOVER); + } + if(!(wrapper_impl->reader)) + { + AXIS2_FREE(env->allocator, wrapper_impl); + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_CREATING_XML_STREAM_READER, AXIS2_FAILURE); + return NULL; + } + + xmlTextReaderSetErrorHandler(wrapper_impl->reader, + (xmlTextReaderErrorFunc)axis2_libxml2_reader_wrapper_error_handler, (void *)env); + + wrapper_impl->current_event = -1; + + axis2_libxml2_reader_wrapper_init_map(wrapper_impl); + + wrapper_impl->parser.ops = &axiom_xml_reader_ops_var; + return &(wrapper_impl->parser); +} + +AXIS2_EXTERN axiom_xml_reader_t *AXIS2_CALL +axiom_xml_reader_create_for_memory( + const axutil_env_t * env, + void *container, + int size, + const axis2_char_t * encoding, + int type) +{ + axis2_libxml2_reader_wrapper_impl_t *wrapper_impl = NULL; + + AXIS2_PARAM_CHECK(env->error, container, NULL); + + wrapper_impl = libxml2_reader_wrapper_create(env); + if(!wrapper_impl) + { + return NULL; + } + wrapper_impl->close_input_callback = NULL; + wrapper_impl->read_input_callback = NULL; + wrapper_impl->ctx = NULL; + + if(AXIS2_XML_PARSER_TYPE_BUFFER == type) + { + wrapper_impl->reader = xmlReaderForMemory((axis2_char_t *)container, size, NULL, encoding, + XML_PARSE_RECOVER); + } + else if(AXIS2_XML_PARSER_TYPE_DOC == type) + { + wrapper_impl->reader = xmlReaderWalker((xmlDocPtr)container); + } + else + { + AXIS2_FREE(env->allocator, wrapper_impl); + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_XML_PARSER_INVALID_MEM_TYPE, AXIS2_FAILURE); + return NULL; + } + + if(!(wrapper_impl->reader)) + { + AXIS2_FREE(env->allocator, wrapper_impl); + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_CREATING_XML_STREAM_READER, AXIS2_FAILURE); + return NULL; + } + + if(AXIS2_XML_PARSER_TYPE_BUFFER == type) + { + xmlTextReaderSetErrorHandler(wrapper_impl->reader, + (xmlTextReaderErrorFunc)axis2_libxml2_reader_wrapper_error_handler, (void *)env); + } + + wrapper_impl->current_event = -1; + + axis2_libxml2_reader_wrapper_init_map(wrapper_impl); + + wrapper_impl->parser.ops = &axiom_xml_reader_ops_var; + return &(wrapper_impl->parser); +} + +int AXIS2_CALL +axis2_libxml2_reader_wrapper_next( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + int ret_val = 0; + int node = 2; + int empty_check = 0; + axis2_libxml2_reader_wrapper_impl_t *parser_impl; + AXIS2_ENV_CHECK(env, -1); + parser_impl = AXIS2_INTF_TO_IMPL(parser); + ret_val = xmlTextReaderRead(parser_impl->reader); + if(ret_val == 0) + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "xml stream is over "); + } + if(ret_val == -1) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, " error occurred in reading xml stream "); + return -1; + } + + if(ret_val == 1) + { + node = xmlTextReaderNodeType(parser_impl->reader); + parser_impl->current_event = parser_impl->event_map[node]; + parser_impl->current_attribute_count = 0; + parser_impl->current_namespace_count = 0; + + if(node == XML_READER_TYPE_ELEMENT) + { + empty_check = xmlTextReaderIsEmptyElement(parser_impl->reader); + axis2_libxml2_reader_wrapper_fill_maps(parser, env); + } + if(empty_check == 1) + { + parser_impl->current_event = AXIOM_XML_READER_EMPTY_ELEMENT; + return AXIOM_XML_READER_EMPTY_ELEMENT; + } + return parser_impl->event_map[node]; + } + else + { + return -1; + } +} + +/** + * If your application crashes here, it may be due to an earlier call to + * xmlCleanupParser() function. In client API, op_client create function has a call + * to axiom_xml_reader_init and op_client_free function has a call to axiom_xml_reader_cleanup + * function. You can avoid the call to axiom_xml_reader_cleanup using + * axis2_options_set_xml_parser_reset function in client API. + * refer to jira issue: https://issues.apache.org/jira/browse/AXIS2C-884 + */ +void AXIS2_CALL +axis2_libxml2_reader_wrapper_free( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + parser_impl = AXIS2_INTF_TO_IMPL(parser); + if(parser_impl->ctx) + { + AXIS2_FREE(env->allocator, parser_impl->ctx); + } + + if(parser_impl->reader) + { + xmlTextReaderClose(parser_impl->reader); + xmlFreeTextReader(parser_impl->reader); + } + if(parser_impl->namespace_map) + { + AXIS2_FREE(env->allocator, parser_impl->namespace_map); + parser_impl->namespace_map = NULL; + } + if(parser_impl->attribute_map) + { + AXIS2_FREE(env->allocator, parser_impl->attribute_map); + parser_impl->attribute_map = NULL; + } + AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(parser)); + return; +} + +int AXIS2_CALL +axis2_libxml2_reader_wrapper_get_attribute_count( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + parser_impl = AXIS2_INTF_TO_IMPL(parser); + if(parser_impl->current_event == AXIOM_XML_READER_START_ELEMENT || parser_impl->current_event + == AXIOM_XML_READER_EMPTY_ELEMENT) + { + return parser_impl->current_attribute_count; + } + else + { + return 0; + } +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_attribute_name_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl; + AXIS2_ENV_CHECK(env, NULL); + parser_impl = AXIS2_INTF_TO_IMPL(parser); + + if(parser_impl->current_attribute_count > 0 && parser_impl->current_attribute_count >= i) + { + int ret = + xmlTextReaderMoveToAttributeNo(parser_impl->reader, parser_impl->attribute_map[i]); + if(ret == 1) + { + return (axis2_char_t *)xmlTextReaderLocalName(parser_impl->reader); + } + else + { + return NULL; + } + } + return NULL; +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_attribute_prefix_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + AXIS2_ENV_CHECK(env, NULL); + parser_impl = AXIS2_INTF_TO_IMPL(parser); + + if(parser_impl->current_attribute_count > 0 && parser_impl->current_attribute_count >= i) + { + int ret = + xmlTextReaderMoveToAttributeNo(parser_impl->reader, parser_impl->attribute_map[i]); + if(ret == 1) + { + return (axis2_char_t *)xmlTextReaderPrefix(parser_impl->reader); + } + else + { + return NULL; + } + } + return NULL; +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_attribute_value_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + + axis2_libxml2_reader_wrapper_impl_t *parser_impl; + AXIS2_ENV_CHECK(env, NULL); + parser_impl = AXIS2_INTF_TO_IMPL(parser); + + if(parser_impl->current_attribute_count > 0 && parser_impl->current_attribute_count >= i) + { + int ret = + xmlTextReaderMoveToAttributeNo(parser_impl->reader, parser_impl->attribute_map[i]); + if(ret == 1) + { + return (axis2_char_t *)xmlTextReaderValue(parser_impl->reader); + } + else + { + return NULL; + } + } + return NULL; +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_attribute_namespace_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl; + AXIS2_ENV_CHECK(env, NULL); + parser_impl = AXIS2_INTF_TO_IMPL(parser); + + if(parser_impl->current_attribute_count > 0 && parser_impl->current_attribute_count >= i) + { + int ret = + xmlTextReaderMoveToAttributeNo(parser_impl->reader, parser_impl->attribute_map[i]); + + if(ret == 1) + { + return (axis2_char_t *)xmlTextReaderNamespaceUri(parser_impl-> reader); + } + else + { + return NULL; + } + } + return NULL; +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_value( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + + AXIS2_ENV_CHECK(env, NULL); + parser_impl = AXIS2_INTF_TO_IMPL(parser); + return (axis2_char_t *)xmlTextReaderValue(parser_impl->reader); + +} + +int AXIS2_CALL +axis2_libxml2_reader_wrapper_get_namespace_count( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + parser_impl = AXIS2_INTF_TO_IMPL(parser); + if(parser_impl->current_event == AXIOM_XML_READER_START_ELEMENT || parser_impl->current_event + == AXIOM_XML_READER_EMPTY_ELEMENT) + { + return parser_impl->current_namespace_count; + } + else + { + return 0; + } +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_namespace_uri_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + AXIS2_ENV_CHECK(env, NULL); + parser_impl = AXIS2_INTF_TO_IMPL(parser); + + if(parser_impl->current_namespace_count > 0 && parser_impl->current_namespace_count >= i) + { + + int ret = + xmlTextReaderMoveToAttributeNo(parser_impl->reader, parser_impl->namespace_map[i]); + if(ret == 1) + { + return (axis2_char_t *)xmlTextReaderValue(parser_impl->reader); + } + else + return NULL; + } + return NULL; +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_namespace_prefix_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + AXIS2_ENV_CHECK(env, NULL); + parser_impl = AXIS2_INTF_TO_IMPL(parser); + + if(parser_impl->current_namespace_count > 0 && parser_impl->current_namespace_count >= i) + { + int ret = + xmlTextReaderMoveToAttributeNo(parser_impl->reader, parser_impl->namespace_map[i]); + + if(ret == 1) + { + return (axis2_char_t *)xmlTextReaderLocalName(parser_impl->reader); + } + else + { + return NULL; + } + } + return NULL; +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_prefix( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + parser_impl = AXIS2_INTF_TO_IMPL(parser); + xmlTextReaderMoveToElement(parser_impl->reader); + return (axis2_char_t *)xmlTextReaderPrefix(parser_impl->reader); +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_name( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + parser_impl = AXIS2_INTF_TO_IMPL(parser); + xmlTextReaderMoveToElement(parser_impl->reader); + return (axis2_char_t *)xmlTextReaderLocalName(parser_impl->reader); +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_pi_target( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + parser_impl = AXIS2_INTF_TO_IMPL(parser); + if(parser_impl->current_event == AXIOM_XML_READER_PROCESSING_INSTRUCTION) + { + return (axis2_char_t *)xmlTextReaderLocalName(parser_impl->reader); + } + else + { + return NULL; + } +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_dtd( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + parser_impl = AXIS2_INTF_TO_IMPL(parser); + if(parser_impl->current_event == AXIOM_XML_READER_DOCUMENT_TYPE) + { + return (axis2_char_t *)xmlTextReaderLocalName(parser_impl->reader); + } + else + { + return NULL; + } +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_pi_data( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + parser_impl = AXIS2_INTF_TO_IMPL(parser); + if(parser_impl->current_event == AXIOM_XML_READER_PROCESSING_INSTRUCTION) + { + return (axis2_char_t *)xmlTextReaderValue(parser_impl->reader); + } + else + { + return NULL; + } +} + +void AXIS2_CALL +axis2_libxml2_reader_wrapper_xml_free( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + void *data) +{ + AXIS2_ENV_CHECK(env, void); + if(data) + xmlFree(data); + return; +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_char_set_encoding( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + axis2_libxml2_reader_wrapper_impl_t *reader_impl = NULL; + reader_impl = AXIS2_INTF_TO_IMPL(parser); + return (axis2_char_t *)xmlTextReaderConstEncoding(reader_impl->reader); +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_namespace_uri( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + parser_impl = AXIS2_INTF_TO_IMPL(parser); + return (axis2_char_t *)xmlTextReaderNamespaceUri(parser_impl->reader); +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_reader_wrapper_get_namespace_uri_by_prefix( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + axis2_char_t * prefix) +{ + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + parser_impl = AXIS2_INTF_TO_IMPL(parser); + if(!prefix || axutil_strcmp(prefix, "") == 0) + { + return NULL; + } + return (axis2_char_t *)xmlTextReaderLookupNamespace(parser_impl->reader, + (const xmlChar *)prefix); +} + +axis2_status_t +axis2_libxml2_reader_wrapper_fill_maps( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + int libxml2_attribute_count = 0; + int attr_count = 0; + int ns_count = 0; + int i = 0; + char *q_name = NULL; + axis2_libxml2_reader_wrapper_impl_t *parser_impl = NULL; + int map_size = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + parser_impl = AXIS2_INTF_TO_IMPL(parser); + + libxml2_attribute_count = xmlTextReaderAttributeCount(parser_impl->reader); + if(libxml2_attribute_count == 0) + { + parser_impl->current_attribute_count = 0; + parser_impl->current_namespace_count = 0; + return AXIS2_SUCCESS; + } + map_size = libxml2_attribute_count + 1; + if(parser_impl->namespace_map) + { + AXIS2_FREE(env->allocator, parser_impl->namespace_map); + parser_impl->namespace_map = NULL; + } + if(parser_impl->attribute_map) + { + AXIS2_FREE(env->allocator, parser_impl->attribute_map); + parser_impl->attribute_map = NULL; + } + parser_impl->attribute_map = AXIS2_MALLOC(env->allocator, sizeof(int) * map_size); + memset(parser_impl->attribute_map, 0, map_size * sizeof(int)); + + parser_impl->namespace_map = AXIS2_MALLOC(env->allocator, sizeof(int) * map_size); + memset(parser_impl->namespace_map, 0, map_size * sizeof(int)); + + for(i = 0; i < map_size; i++) + { + parser_impl->namespace_map[i] = -1; + parser_impl->attribute_map[i] = -1; + } + + for(i = 0; i < libxml2_attribute_count; i++) + { + xmlTextReaderMoveToAttributeNo(parser_impl->reader, i); + q_name = (char *)xmlTextReaderName(parser_impl->reader); + if(q_name) + { + if((strcmp(q_name, "xmlns") == 0) || (strncmp(q_name, "xmlns:", 6) == 0)) + { + /* found a namespace */ + ns_count++; + parser_impl->namespace_map[ns_count] = i; + } + else + { + /* found an attribute */ + attr_count++; + parser_impl->attribute_map[attr_count] = i; + } + + xmlFree(q_name); + q_name = NULL; + } + + parser_impl->current_attribute_count = attr_count; + parser_impl->current_namespace_count = ns_count; + } + return AXIS2_SUCCESS; +} + +static int +axis2_libxml2_reader_wrapper_read_input_callback( + void *ctx, + char *buffer, + int size) +{ + return ((axis2_libxml2_reader_wrapper_impl_t *)ctx)-> read_input_callback(buffer, size, + ((axis2_libxml2_reader_wrapper_impl_t *)ctx)->ctx); +} + +void +axis2_libxml2_reader_wrapper_error_handler( + void *arg, + const char *msg, + int severities, + void *locator_ptr) +{ + const axutil_env_t *env = NULL; + env = (const axutil_env_t *)arg; + + switch(severities) + { + case XML_PARSER_SEVERITY_VALIDITY_WARNING: + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s VALIDITY WARNTING", msg); + } + break; + case XML_PARSER_SEVERITY_VALIDITY_ERROR: + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s -- VALIDITY ERROR", msg); + } + break; + case XML_PARSER_SEVERITY_WARNING: + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s -- VALIDITY ERROR", msg); + } + break; + case XML_PARSER_SEVERITY_ERROR: + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s -- SEVERITY_ERROR", msg); + } + break; + default: + break; + } +} + +static int +axis2_libxml2_reader_wrapper_close_input_callback( + void *ctx) +{ + return ((axis2_libxml2_reader_wrapper_impl_t *)ctx)-> close_input_callback( + ((axis2_libxml2_reader_wrapper_impl_t *)ctx)-> ctx); +} diff --git a/axiom/src/parser/libxml2/libxml2_writer_wrapper.c b/axiom/src/parser/libxml2/libxml2_writer_wrapper.c new file mode 100644 index 0000000..4c889d4 --- /dev/null +++ b/axiom/src/parser/libxml2/libxml2_writer_wrapper.c @@ -0,0 +1,1571 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 <libxml/xmlwriter.h> +#include <axutil_utils.h> +#include <axutil_utils_defines.h> +#include <axutil_env.h> +#include <axiom_xml_writer.h> +#include <axutil_string.h> +#include <string.h> +#include <axutil_stack.h> +#include <axutil_hash.h> +#include <axutil_array_list.h> + +/*******************************************************************************/ + +#define ENCODING "ISO-8859-1" + +#define AXIS2_XMLNS_NAMESPACE_URI "http://www.w3.org/XML/1998/namespace" +#define AXIS2_XMLNS_PREFIX "xml" + +typedef struct uri_prefix_element +{ + axis2_char_t *prefix; + + axis2_char_t *uri; + + axis2_char_t *real_prefix; + + axis2_char_t *key; + +} uri_prefix_element_t; + +typedef struct axis2_libxml2_writer_wrapper_impl +{ + axiom_xml_writer_t writer; + + xmlTextWriterPtr xml_writer; + + xmlBufferPtr buffer; + + xmlDocPtr doc; + + int writer_type; + + axis2_char_t *encoding; + + int is_prefix_defaulting; + + int compression; + + axutil_stack_t *stack; + + axis2_bool_t in_empty_element; + + axis2_bool_t in_start_element; + + axutil_hash_t *uri_prefix_map; + + uri_prefix_element_t *default_lang_namespace; + +} axis2_libxml2_writer_wrapper_impl_t; + +#define AXIS2_INTF_TO_IMPL(p) ((axis2_libxml2_writer_wrapper_impl_t*)p) + +void AXIS2_CALL axis2_libxml2_writer_wrapper_free( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_start_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_end_start_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_start_element_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_start_element_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_empty_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_empty_element_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_empty_element_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_end_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_end_document( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_attribute( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_attribute_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_attribute_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri, + axis2_char_t * prefix); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * namespace_uri); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_default_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * namespace_uri); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_comment( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * value); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_processing_instruction( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_processing_instruction_data( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target, + axis2_char_t * data); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_cdata( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * data); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_dtd( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * dtd); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_entity_ref( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * name); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_start_document( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_start_document_with_version( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * version); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_start_document_with_version_encoding( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * encoding, + axis2_char_t * version); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_characters( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text); + +axis2_char_t *AXIS2_CALL axis2_libxml2_writer_wrapper_get_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_set_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * uri); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_set_default_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_encoded( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text, + int in_attr); + +void *AXIS2_CALL axis2_libxml2_writer_wrapper_get_xml( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +unsigned int AXIS2_CALL axis2_libxml2_writer_wrapper_get_xml_size( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_flush( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +int AXIS2_CALL axis2_libxml2_writer_wrapper_get_type( + axiom_xml_writer_t * writer, + const axutil_env_t * env); + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_raw( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * content); + +static axis2_status_t +axis2_libxml2_writer_wrapper_push( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + const axis2_char_t * uri, + const axis2_char_t * prefix); + +static axis2_bool_t +axis2_libxml2_writer_wrapper_is_namespace_declared( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * key); + +static void +uri_prefix_element_free( + uri_prefix_element_t * up_element, + const axutil_env_t * env); + +static uri_prefix_element_t * +uri_prefix_element_create( + const axutil_env_t * env, + const axis2_char_t * uri, + const axis2_char_t * prefix, + const axis2_char_t * real_prefix, + const axis2_char_t * key); + +static void +create_key_from_uri_prefix( + const axutil_env_t * env, + const axis2_char_t * uri, + const axis2_char_t * prefix, + axis2_char_t * array); + +static axis2_char_t * +axis2_libxml2_writer_wrapper_find_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri); + +static uri_prefix_element_t * +axis2_libxml2_writer_wrapper_find_prefix_in_context( + axutil_array_list_t * context, + const axutil_env_t * env, + axis2_char_t * uri); + +static const axiom_xml_writer_ops_t axiom_xml_writer_ops_var = { axis2_libxml2_writer_wrapper_free, + axis2_libxml2_writer_wrapper_write_start_element, + axis2_libxml2_writer_wrapper_end_start_element, + axis2_libxml2_writer_wrapper_write_start_element_with_namespace, + axis2_libxml2_writer_wrapper_write_start_element_with_namespace_prefix, + axis2_libxml2_writer_wrapper_write_empty_element, + axis2_libxml2_writer_wrapper_write_empty_element_with_namespace, + axis2_libxml2_writer_wrapper_write_empty_element_with_namespace_prefix, + axis2_libxml2_writer_wrapper_write_end_element, + axis2_libxml2_writer_wrapper_write_end_document, axis2_libxml2_writer_wrapper_write_attribute, + axis2_libxml2_writer_wrapper_write_attribute_with_namespace, + axis2_libxml2_writer_wrapper_write_attribute_with_namespace_prefix, + axis2_libxml2_writer_wrapper_write_namespace, + axis2_libxml2_writer_wrapper_write_default_namespace, + axis2_libxml2_writer_wrapper_write_comment, + axis2_libxml2_writer_wrapper_write_processing_instruction, + axis2_libxml2_writer_wrapper_write_processing_instruction_data, + axis2_libxml2_writer_wrapper_write_cdata, axis2_libxml2_writer_wrapper_write_dtd, + axis2_libxml2_writer_wrapper_write_entity_ref, + axis2_libxml2_writer_wrapper_write_start_document, + axis2_libxml2_writer_wrapper_write_start_document_with_version, + axis2_libxml2_writer_wrapper_write_start_document_with_version_encoding, + axis2_libxml2_writer_wrapper_write_characters, axis2_libxml2_writer_wrapper_get_prefix, + axis2_libxml2_writer_wrapper_set_prefix, axis2_libxml2_writer_wrapper_set_default_prefix, + axis2_libxml2_writer_wrapper_write_encoded, axis2_libxml2_writer_wrapper_get_xml, + axis2_libxml2_writer_wrapper_get_xml_size, axis2_libxml2_writer_wrapper_get_type, + axis2_libxml2_writer_wrapper_write_raw, axis2_libxml2_writer_wrapper_flush }; + +AXIS2_EXTERN axiom_xml_writer_t *AXIS2_CALL +axiom_xml_writer_create( + const axutil_env_t * env, + axis2_char_t * filename, + axis2_char_t * encoding, + int is_prefix_default, + int compression) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + AXIS2_ENV_CHECK(env, NULL); + writer_impl = (axis2_libxml2_writer_wrapper_impl_t *)AXIS2_MALLOC(env->allocator, + sizeof(axis2_libxml2_writer_wrapper_impl_t)); + if(!writer_impl) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create an XML writer wrapper"); + return NULL; + } + writer_impl->xml_writer = xmlNewTextWriterFilename(filename, compression); + + if(!(writer_impl->xml_writer)) + { + AXIS2_FREE(env->allocator, writer_impl); + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_CREATING_XML_STREAM_WRITER, AXIS2_FAILURE); + return NULL; + } + writer_impl->buffer = NULL; + writer_impl->encoding = NULL; + writer_impl->compression = 0; + writer_impl->in_empty_element = AXIS2_FALSE; + writer_impl->in_start_element = AXIS2_FALSE; + writer_impl->stack = NULL; + writer_impl->uri_prefix_map = NULL; + writer_impl->default_lang_namespace = NULL; + + writer_impl->writer_type = AXIS2_XML_PARSER_TYPE_FILE; + writer_impl->compression = compression; + + if(encoding) + { + writer_impl->encoding = axutil_strdup(env, encoding); + } + else + { + writer_impl->encoding = axutil_strdup(env, ENCODING); + } + + writer_impl->uri_prefix_map = axutil_hash_make(env); + if(!(writer_impl->uri_prefix_map)) + { + axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create URI prefix hash map"); + return NULL; + } + writer_impl->writer.ops = &axiom_xml_writer_ops_var; + return &(writer_impl->writer); +} + +AXIS2_EXTERN axiom_xml_writer_t *AXIS2_CALL +axiom_xml_writer_create_for_memory( + const axutil_env_t * env, + axis2_char_t * encoding, + int is_prefix_default, + int compression, + int type) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + AXIS2_ENV_CHECK(env, NULL); + writer_impl = (axis2_libxml2_writer_wrapper_impl_t *)AXIS2_MALLOC(env->allocator, + sizeof(axis2_libxml2_writer_wrapper_impl_t)); + if(!writer_impl) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create writer wrapper"); + return NULL; + } + + writer_impl->encoding = NULL; + writer_impl->buffer = NULL; + writer_impl->doc = NULL; + writer_impl->in_empty_element = AXIS2_FALSE; + writer_impl->in_start_element = AXIS2_FALSE; + writer_impl->stack = NULL; + writer_impl->uri_prefix_map = NULL; + writer_impl->default_lang_namespace = NULL; + writer_impl->compression = compression; + + if(AXIS2_XML_PARSER_TYPE_BUFFER == type) + { + writer_impl->writer_type = AXIS2_XML_PARSER_TYPE_BUFFER; + writer_impl->buffer = xmlBufferCreate(); + if(!(writer_impl->buffer)) + { + axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "No memory. Cannot create a buffer for writer wrapper"); + return NULL; + } + + writer_impl->xml_writer = xmlNewTextWriterMemory(writer_impl->buffer, 0); + } + else if(AXIS2_XML_PARSER_TYPE_DOC == type) + { + writer_impl->writer_type = AXIS2_XML_PARSER_TYPE_DOC; + writer_impl->xml_writer = xmlNewTextWriterDoc(&writer_impl->doc, 0); + } + else + { + axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env); + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_XML_PARSER_INVALID_MEM_TYPE, AXIS2_FAILURE); + return NULL; + } + + if(!(writer_impl->xml_writer)) + { + axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env); + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_CREATING_XML_STREAM_WRITER, AXIS2_FAILURE); + return NULL; + } + + if(encoding) + { + writer_impl->encoding = axutil_strdup(env, encoding); + } + else + { + writer_impl->encoding = axutil_strdup(env, ENCODING); + } + + writer_impl->uri_prefix_map = axutil_hash_make(env); + if(!(writer_impl->uri_prefix_map)) + { + axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create URI prefix hash map"); + return NULL; + } + writer_impl->stack = axutil_stack_create(env); + if(!(writer_impl->stack)) + { + axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "No memory. Cannot create the stack for writer wrapper"); + return NULL; + } + + writer_impl->writer.ops = &axiom_xml_writer_ops_var; + + return &(writer_impl->writer); +} + +void AXIS2_CALL +axis2_libxml2_writer_wrapper_free( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + if(writer_impl->xml_writer) + { + xmlFreeTextWriter(writer_impl->xml_writer); + writer_impl->xml_writer = NULL; + } + if(writer_impl->buffer) + { + xmlBufferFree(writer_impl->buffer); + writer_impl->buffer = NULL; + } + if(writer_impl->encoding) + { + AXIS2_FREE(env->allocator, writer_impl->encoding); + writer_impl->encoding = NULL; + } + if(writer_impl->uri_prefix_map) + { + axutil_hash_free(writer_impl->uri_prefix_map, env); + writer_impl->uri_prefix_map = NULL; + } + if(writer_impl->stack) + { + axutil_stack_free(writer_impl->stack, env); + writer_impl->stack = NULL; + } + if(writer_impl->default_lang_namespace) + { + uri_prefix_element_free(writer_impl->default_lang_namespace, env); + writer_impl->default_lang_namespace = NULL; + } + + AXIS2_FREE(env->allocator, writer_impl); + writer_impl = NULL; + return; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_start_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname) +{ + int status = 0; + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + writer_impl->in_start_element = AXIS2_TRUE; + + status = xmlTextWriterStartElement(writer_impl->xml_writer, (xmlChar *)localname); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_START_ELEMENT, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_end_start_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + /* nothing to do , + it is automatically taken care by the libxml2 writer */ + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_start_element_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + status = xmlTextWriterStartElementNS(writer_impl->xml_writer, + NULL, BAD_CAST localname, NULL); + + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_START_ELEMENT_WITH_NAMESPACE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_start_element_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE); + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + writer_impl->in_start_element = AXIS2_TRUE; + + status = xmlTextWriterStartElementNS(writer_impl->xml_writer, + BAD_CAST prefix, + BAD_CAST localname, BAD_CAST NULL); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_START_ELEMENT_WITH_NAMESPACE_PREFIX, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_empty_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname) +{ + int status = 0; + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + status = xmlTextWriterStartElement(writer_impl->xml_writer, (xmlChar *)localname); + + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_EMPTY_ELEMENT, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + status = xmlTextWriterEndElement(writer_impl->xml_writer); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_EMPTY_ELEMENT, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_empty_element_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + status = xmlTextWriterStartElementNS(writer_impl->xml_writer, + NULL, BAD_CAST localname, + BAD_CAST namespace_uri); + + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_EMPTY_ELEMENT_WITH_NAMESPACE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + status = xmlTextWriterEndElement(writer_impl->xml_writer); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_EMPTY_ELEMENT_WITH_NAMESPACE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_empty_element_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE); + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + status = xmlTextWriterStartElementNS(writer_impl->xml_writer, + BAD_CAST prefix, + BAD_CAST localname, BAD_CAST NULL); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_START_ELEMENT_WITH_NAMESPACE_PREFIX, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + status = xmlTextWriterEndElement(writer_impl->xml_writer); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_EMPTY_ELEMENT_WITH_NAMESPACE_PREFIX, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_end_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + writer_impl->in_start_element = AXIS2_FALSE; + /* write an empty element in case the element is empty, + status = xmlTextWriterFullEndElement(writer_impl->xml_writer); + Above call write it like <a></a>. + Call below will write it like <a/> */ + status = xmlTextWriterEndElement(writer_impl->xml_writer); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_END_ELEMENT, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_end_document( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + status = xmlTextWriterEndDocument(writer_impl->xml_writer); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_END_DOCUMENT, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_attribute( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + if(!value) + { + value = ""; + } + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + status = xmlTextWriterWriteAttribute(writer_impl->xml_writer, + BAD_CAST localname, BAD_CAST value); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_ATTRIBUTE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_attribute_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + + if(!value) + { + value = ""; + } + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + status = xmlTextWriterWriteAttributeNS(writer_impl->xml_writer, + NULL, BAD_CAST localname, + BAD_CAST NULL, BAD_CAST value); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_ATTRIBUTE_WITH_NAMESPACE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_attribute_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri, + axis2_char_t * prefix) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, localname, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE); + + if(!value) + { + value = ""; + } + writer_impl = AXIS2_INTF_TO_IMPL(writer); + status = xmlTextWriterWriteAttributeNS(writer_impl->xml_writer, + BAD_CAST prefix, BAD_CAST localname, + BAD_CAST NULL, BAD_CAST value); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_ATTRIBUTE_WITH_NAMESPACE_PREFIX, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +/** need to work on this */ +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * namespace_uri) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + char *xmlnsprefix = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE); + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + if(prefix && (axutil_strcmp(prefix, "") != 0)) + { + xmlnsprefix = (axis2_char_t *)AXIS2_MALLOC(env->allocator, (sizeof(char) * (axutil_strlen( + prefix) + 7))); + sprintf(xmlnsprefix, "xmlns:%s", prefix); + } + else + { + xmlnsprefix = axutil_strdup(env, "xmlns"); + } + + status = xmlTextWriterWriteAttribute(writer_impl->xml_writer, + BAD_CAST xmlnsprefix, + BAD_CAST namespace_uri); + AXIS2_FREE(env->allocator, xmlnsprefix); + xmlnsprefix = NULL; + + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_ATTRIBUTE_WITH_NAMESPACE_PREFIX, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + + AXIS2_FREE(env->allocator, xmlnsprefix); + xmlnsprefix = NULL; + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_default_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * namespace_uri) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + axis2_char_t *xmlns = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, namespace_uri, AXIS2_FAILURE) + xmlns = AXIS2_MALLOC(env->allocator, + sizeof(axis2_char_t) * (strlen("xmlns") + 1)); + sprintf(xmlns, "xmlns"); + status = xmlTextWriterWriteAttribute(writer_impl->xml_writer, + (const xmlChar *) xmlns, + BAD_CAST namespace_uri); + + if(xmlns) + { + AXIS2_FREE(env->allocator, xmlns); + xmlns = NULL; + } + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_DEFAULT_NAMESPACE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_comment( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * value) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE); + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + status = xmlTextWriterWriteComment(writer_impl->xml_writer, BAD_CAST value); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_COMMENT, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_processing_instruction( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, target, AXIS2_FAILURE); + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + status = xmlTextWriterStartPI(writer_impl->xml_writer, BAD_CAST target); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_PROCESSING_INSTRUCTION, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_processing_instruction_data( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target, + axis2_char_t * data) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, target, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, data, AXIS2_FAILURE); + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + status = xmlTextWriterWritePI(writer_impl->xml_writer, + BAD_CAST target, BAD_CAST data); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_PROCESSING_INSTRUCTION, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_cdata( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * data) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, data, AXIS2_FAILURE); + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + status = xmlTextWriterWriteCDATA(writer_impl->xml_writer, BAD_CAST data); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_CDATA, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_dtd( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * dtd) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, dtd, AXIS2_FAILURE); + + status = xmlTextWriterStartDTD(writer_impl->xml_writer, + BAD_CAST dtd, NULL, NULL); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_DTD, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_entity_ref( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * name) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, name, AXIS2_FAILURE); + return AXIS2_FAILURE; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_start_document( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + axis2_libxml2_writer_wrapper_impl_t *wrapper_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + wrapper_impl = AXIS2_INTF_TO_IMPL(writer); + status = xmlTextWriterStartDocument(wrapper_impl->xml_writer, NULL, NULL, NULL); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_START_DOCUMENT, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_start_document_with_version( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * version) +{ + axis2_libxml2_writer_wrapper_impl_t *wrapper_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, version, AXIS2_FAILURE); + + wrapper_impl = AXIS2_INTF_TO_IMPL(writer); + status = xmlTextWriterStartDocument(wrapper_impl->xml_writer, version, NULL, NULL); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_START_DOCUMENT, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_start_document_with_version_encoding( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * encoding, + axis2_char_t * version) +{ + axis2_libxml2_writer_wrapper_impl_t *wrapper_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + wrapper_impl = AXIS2_INTF_TO_IMPL(writer); + status = xmlTextWriterStartDocument(wrapper_impl->xml_writer, version, encoding, NULL); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_START_DOCUMENT, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_characters( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, text, AXIS2_FAILURE); + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + status = xmlTextWriterWriteString(writer_impl->xml_writer, BAD_CAST text); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_START_DOCUMENT, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +axis2_char_t *AXIS2_CALL +axis2_libxml2_writer_wrapper_get_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + AXIS2_PARAM_CHECK(env->error, uri, NULL); + writer_impl = AXIS2_INTF_TO_IMPL(writer); + if(!uri || axutil_strcmp(uri, "") == 0) + { + return NULL; + } + return axis2_libxml2_writer_wrapper_find_prefix(writer, env, uri); +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_set_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * uri) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + + axis2_bool_t is_declared = AXIS2_FALSE; + axis2_char_t key[1024]; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, uri, AXIS2_FAILURE); + writer_impl = AXIS2_INTF_TO_IMPL(writer); + if(axutil_strcmp(uri, "") == 0) + { + return AXIS2_FAILURE; + } + + create_key_from_uri_prefix(env, uri, prefix, key); + + is_declared = axis2_libxml2_writer_wrapper_is_namespace_declared(writer, env, key); + if(!is_declared) + { + return axis2_libxml2_writer_wrapper_push(writer, env, uri, prefix); + } + return AXIS2_FAILURE; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_set_default_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri) +{ + axis2_bool_t is_declared = AXIS2_FALSE; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, uri, AXIS2_FAILURE); + if(axutil_strcmp(uri, "") == 0) + { + return AXIS2_FAILURE; + } + is_declared = axis2_libxml2_writer_wrapper_is_namespace_declared(writer, env, uri); + if(!is_declared) + { + return axis2_libxml2_writer_wrapper_push(writer, env, uri, NULL); + } + return AXIS2_FAILURE; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_encoded( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text, + int in_attr) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, text, AXIS2_FAILURE); + writer_impl = AXIS2_INTF_TO_IMPL(writer); + return AXIS2_FAILURE; +} + +void *AXIS2_CALL +axis2_libxml2_writer_wrapper_get_xml( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + writer_impl = AXIS2_INTF_TO_IMPL(writer); + if(writer_impl->writer_type == AXIS2_XML_PARSER_TYPE_BUFFER) + { + int output_bytes = 0; + output_bytes = xmlTextWriterFlush(writer_impl->xml_writer); + return writer_impl->buffer->content; + } + else if(writer_impl->writer_type == AXIS2_XML_PARSER_TYPE_DOC) + { + return (void *)writer_impl->doc; + } + else if(writer_impl->writer_type == AXIS2_XML_PARSER_TYPE_FILE) + { + return NULL; + } + + return NULL; +} + +unsigned int AXIS2_CALL +axis2_libxml2_writer_wrapper_get_xml_size( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + if(writer_impl->writer_type == AXIS2_XML_PARSER_TYPE_BUFFER) + { + return writer_impl->buffer->use; + } + else + { + return 0; + } +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_flush( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + writer_impl = AXIS2_INTF_TO_IMPL(writer); + if(writer_impl->xml_writer) + { + int ret = 0; + ret = xmlTextWriterFlush(writer_impl->xml_writer); + if(ret > -1) + return AXIS2_SUCCESS; + } + + return AXIS2_FAILURE; +} + +int AXIS2_CALL +axis2_libxml2_writer_wrapper_get_type( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + return writer_impl->writer_type; +} + +static axis2_status_t +axis2_libxml2_writer_wrapper_push( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + const axis2_char_t * uri, + const axis2_char_t * prefix) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + axutil_array_list_t *current_list = NULL; + axis2_char_t key[1024]; + const axis2_char_t *temp_prefix = NULL; + writer_impl = AXIS2_INTF_TO_IMPL(writer); + if(!prefix || axutil_strcmp(prefix, "") == 0) + { + temp_prefix = "default"; + } + else + { + temp_prefix = prefix; + } + + if(writer_impl->stack) + { + current_list = (axutil_array_list_t *)axutil_stack_get(writer_impl->stack, env); + + if(current_list) + { + uri_prefix_element_t *ele = NULL; + create_key_from_uri_prefix(env, uri, prefix, key); + + ele = uri_prefix_element_create(env, uri, temp_prefix, prefix, key); + if(ele) + { + axutil_array_list_add(current_list, env, ele); + axutil_hash_set(writer_impl->uri_prefix_map, ele->key, AXIS2_HASH_KEY_STRING, + ele->prefix); + } + } + } + return AXIS2_SUCCESS; +} + +static axis2_bool_t +axis2_libxml2_writer_wrapper_is_namespace_declared( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * key) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FALSE); + writer_impl = AXIS2_INTF_TO_IMPL(writer); + if(writer_impl->uri_prefix_map && NULL != key) + { + void *ret = NULL; + ret = axutil_hash_get(writer_impl->uri_prefix_map, key, AXIS2_HASH_KEY_STRING); + if(ret) + { + return AXIS2_TRUE; + } + } + return AXIS2_FALSE; +} + +static void +uri_prefix_element_free( + uri_prefix_element_t * up_element, + const axutil_env_t * env) +{ + if(up_element) + { + if(up_element->uri) + { + AXIS2_FREE(env->allocator, up_element->uri); + up_element->uri = NULL; + } + if(up_element->prefix) + { + AXIS2_FREE(env->allocator, up_element->prefix); + up_element->prefix = NULL; + } + if(up_element->key) + { + AXIS2_FREE(env->allocator, up_element->key); + up_element->key = NULL; + } + if(up_element->real_prefix) + { + AXIS2_FREE(env->allocator, up_element->real_prefix); + up_element->real_prefix = NULL; + } + AXIS2_FREE(env->allocator, up_element); + up_element = NULL; + } + return; +} + +static uri_prefix_element_t * +uri_prefix_element_create( + const axutil_env_t * env, + const axis2_char_t * uri, + const axis2_char_t * prefix, + const axis2_char_t * real_prefix, + const axis2_char_t * key) +{ + uri_prefix_element_t *up_element = NULL; + up_element = (uri_prefix_element_t *)AXIS2_MALLOC(env->allocator, sizeof(uri_prefix_element_t)); + + if(!uri) + { + return NULL; + } + + if(!up_element) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create URI prefix element %s", + uri); + return NULL; + } + up_element->key = NULL; + up_element->prefix = NULL; + up_element->uri = NULL; + up_element->real_prefix = NULL; + + up_element->uri = axutil_strdup(env, uri); + if(!up_element->uri) + { + uri_prefix_element_free(up_element, env); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + up_element->prefix = axutil_strdup(env, prefix); + if(prefix && !up_element->prefix) + { + uri_prefix_element_free(up_element, env); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + up_element->key = axutil_strdup(env, key); + if(key && !up_element->key) + { + uri_prefix_element_free(up_element, env); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + up_element->real_prefix = axutil_strdup(env, real_prefix); + + return up_element; +} + +static void +create_key_from_uri_prefix( + const axutil_env_t * env, + const axis2_char_t * uri, + const axis2_char_t * prefix, + axis2_char_t * array) +{ + if(!prefix) + { + prefix = ""; + } + sprintf(array, "%s%s%s", uri, "|", prefix); +} + +static axis2_char_t * +axis2_libxml2_writer_wrapper_find_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int size = 0; + int i = 0; + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + + if(!writer_impl->stack) + { + return NULL; + } + size = axutil_stack_size(writer_impl->stack, env); + if(size <= 0) + { + return NULL; + } + + for(i = size - 1; i < 0; i--) + { + axutil_array_list_t *context = NULL; + void *value = NULL; + value = axutil_stack_get_at(writer_impl->stack, env, i); + if(value) + { + uri_prefix_element_t *up_ele = NULL; + context = (axutil_array_list_t *)value; + up_ele = axis2_libxml2_writer_wrapper_find_prefix_in_context(context, env, uri); + if(up_ele) + { + return up_ele->real_prefix; + } + } + } + return NULL; +} + +static uri_prefix_element_t * +axis2_libxml2_writer_wrapper_find_prefix_in_context( + axutil_array_list_t * context, + const axutil_env_t * env, + axis2_char_t * uri) +{ + int size = 0; + int i = 0; + if(!context) + { + return NULL; + } + size = axutil_array_list_size(context, env); + for(i = 0; i < size; i++) + { + uri_prefix_element_t *ele = NULL; + void *value = NULL; + value = axutil_array_list_get(context, env, i); + if(value) + { + ele = (uri_prefix_element_t *)value; + if(ele->uri && axutil_strcmp(uri, ele->uri)) + { + return ele; + } + } + } + return NULL; +} + +axis2_status_t AXIS2_CALL +axis2_libxml2_writer_wrapper_write_raw( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * content) +{ + axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL; + int status = 0; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, content, AXIS2_FAILURE); + + writer_impl = AXIS2_INTF_TO_IMPL(writer); + status = xmlTextWriterWriteRaw(writer_impl->xml_writer, BAD_CAST content); + if(status < 0) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_DATA_SOURCE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} diff --git a/axiom/src/parser/xml_reader.c b/axiom/src/parser/xml_reader.c new file mode 100644 index 0000000..47e2334 --- /dev/null +++ b/axiom/src/parser/xml_reader.c @@ -0,0 +1,203 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_xml_reader.h> + +AXIS2_EXTERN int AXIS2_CALL +axiom_xml_reader_next( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return (parser)->ops->next(parser, env); +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_xml_reader_free( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + (parser)->ops->free(parser, env); +} + +AXIS2_EXTERN int AXIS2_CALL +axiom_xml_reader_get_attribute_count( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return (parser)->ops->get_attribute_count(parser, env); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_attribute_name_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + return (parser)->ops->get_attribute_name_by_number(parser, env, i); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_attribute_prefix_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + return (parser)->ops->get_attribute_prefix_by_number(parser, env, i); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_attribute_value_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + return (parser)->ops->get_attribute_value_by_number(parser, env, i); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_attribute_namespace_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + return (parser)->ops->get_attribute_namespace_by_number(parser, env, i); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_value( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return (parser)->ops->get_value(parser, env); +} + +AXIS2_EXTERN int AXIS2_CALL +axiom_xml_reader_get_namespace_count( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return (parser)->ops->get_namespace_count(parser, env); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_namespace_uri_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + return (parser)->ops->get_namespace_uri_by_number(parser, env, i); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_namespace_prefix_by_number( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + int i) +{ + return (parser)->ops->get_namespace_prefix_by_number(parser, env, i); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_prefix( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return (parser)->ops->get_prefix(parser, env); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_name( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return (parser)->ops->get_name(parser, env); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_pi_target( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return (parser)->ops->get_pi_target(parser, env); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_pi_data( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return (parser)->ops->get_pi_data(parser, env); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_dtd( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return (parser)->ops->get_dtd(parser, env); +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_xml_reader_xml_free( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + void *data) +{ + (parser)->ops->xml_free(parser, env, data); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_char_set_encoding( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return (parser)->ops->get_char_set_encoding(parser, env); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_namespace_uri( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return (parser)->ops->get_namespace_uri(parser, env); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_namespace_uri_by_prefix( + axiom_xml_reader_t * parser, + const axutil_env_t * env, + axis2_char_t * prefix) +{ + return (parser)->ops->get_namespace_uri_by_prefix(parser, env, prefix); +} + +AXIS2_EXTERN void *AXIS2_CALL +axiom_xml_reader_get_context( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return (parser)->ops->get_context(parser, env); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_reader_get_current_buffer( + axiom_xml_reader_t * parser, + const axutil_env_t * env) +{ + return (parser)->ops->get_current_buffer(parser, env); +} + diff --git a/axiom/src/parser/xml_writer.c b/axiom/src/parser/xml_writer.c new file mode 100644 index 0000000..cefaeae --- /dev/null +++ b/axiom/src/parser/xml_writer.c @@ -0,0 +1,337 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_xml_writer.h> + +AXIS2_EXTERN void AXIS2_CALL +axiom_xml_writer_free( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + (writer)->ops->free(writer, env); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_start_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname) +{ + return (writer)->ops->write_start_element(writer, env, localname); + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_end_start_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + return (writer)->ops->end_start_element(writer, env); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_start_element_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri) +{ + return (writer)->ops->write_start_element_with_namespace(writer, env, localname, namespace_uri); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_start_element_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix) +{ + return (writer)->ops->write_start_element_with_namespace_prefix(writer, env, localname, + namespace_uri, prefix); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_empty_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname) +{ + return (writer)->ops->write_empty_element(writer, env, localname); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_empty_element_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri) +{ + return (writer)->ops->write_empty_element_with_namespace(writer, env, localname, namespace_uri); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_empty_element_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * namespace_uri, + axis2_char_t * prefix) +{ + return (writer)->ops->write_empty_element_with_namespace_prefix(writer, env, localname, + namespace_uri, prefix); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_end_element( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + return (writer)->ops->write_end_element(writer, env); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_end_document( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + return (writer)->ops->write_end_document(writer, env); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_attribute( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value) +{ + return (writer)->ops->write_attribute(writer, env, localname, value); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_attribute_with_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri) +{ + return (writer)->ops->write_attribute_with_namespace(writer, env, localname, value, + namespace_uri); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_attribute_with_namespace_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * localname, + axis2_char_t * value, + axis2_char_t * namespace_uri, + axis2_char_t * prefix) +{ + return (writer)->ops->write_attribute_with_namespace_prefix(writer, env, localname, value, + namespace_uri, prefix); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * namespace_uri) +{ + return (writer)->ops->write_namespace(writer, env, prefix, namespace_uri); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_default_namespace( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * namespace_uri) +{ + return (writer)->ops->write_default_namespace(writer, env, namespace_uri); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_comment( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * value) +{ + return (writer)->ops->write_comment(writer, env, value); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_processing_instruction( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target) +{ + return (writer)->ops->write_processing_instruction(writer, env, target); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_processing_instruction_data( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * target, + axis2_char_t * data) +{ + return (writer)->ops->write_processing_instruction_data(writer, env, target, data); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_cdata( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * data) +{ + return (writer)->ops->write_cdata(writer, env, data); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_dtd( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * dtd) +{ + return (writer)->ops->write_cdata(writer, env, dtd); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_entity_ref( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * name) +{ + return (writer)->ops->write_entity_ref(writer, env, name); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_start_document( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + return (writer)->ops->write_start_document(writer, env); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_start_document_with_version( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * version) +{ + return (writer)->ops->write_start_document_with_version(writer, env, version); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_start_document_with_version_encoding( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * version, + axis2_char_t * encoding) +{ + return (writer)->ops->write_start_document_with_version_encoding(writer, env, encoding, version); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_characters( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text) +{ + return (writer)->ops->write_characters(writer, env, text); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_xml_writer_get_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri) +{ + return (writer)->ops->get_prefix(writer, env, uri); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_set_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * prefix, + axis2_char_t * uri) +{ + return (writer)->ops->set_prefix(writer, env, prefix, uri); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_set_default_prefix( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * uri) +{ + return (writer)->ops->set_default_prefix(writer, env, uri); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_encoded( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * text, + int in_attr) +{ + return (writer)->ops->write_encoded(writer, env, text, in_attr); +} + +AXIS2_EXTERN void *AXIS2_CALL +axiom_xml_writer_get_xml( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + return (writer)->ops->get_xml(writer, env); +} + +AXIS2_EXTERN unsigned int AXIS2_CALL +axiom_xml_writer_get_xml_size( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + return (writer)->ops->get_xml_size(writer, env); +} + +AXIS2_EXTERN int AXIS2_CALL +axiom_xml_writer_get_type( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + return (writer)->ops->get_type(writer, env); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_write_raw( + axiom_xml_writer_t * writer, + const axutil_env_t * env, + axis2_char_t * content) +{ + return (writer)->ops->write_raw(writer, env, content); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_xml_writer_flush( + axiom_xml_writer_t * writer, + const axutil_env_t * env) +{ + return (writer)->ops->flush(writer, env); +} diff --git a/axiom/src/soap/Makefile.am b/axiom/src/soap/Makefile.am new file mode 100644 index 0000000..5b53ba8 --- /dev/null +++ b/axiom/src/soap/Makefile.am @@ -0,0 +1,33 @@ +noinst_LTLIBRARIES = libaxis2_soap.la +libaxis2_soap_la_SOURCES = soap_fault.c \ + soap_fault_code.c \ + soap_fault_detail.c \ + soap_fault_node.c \ + soap_fault_reason.c \ + soap_fault_role.c \ + soap_fault_sub_code.c \ + soap_fault_text.c \ + soap_fault_value.c \ + soap_header_block.c \ + soap_header.c \ + soap_body.c \ + soap_envelope.c \ + soap_builder.c \ + soap11_builder_helper.c \ + soap12_builder_helper.c + +libaxis2_soap_la_LIBADD = +INCLUDES = -I$(top_builddir)/include \ + -I$(top_builddir)/src/parser \ + -I$(top_builddir)/src/om \ + -I ../../../util/include + +EXTRA_DIST = axiom_soap11_builder_helper.h \ + _axiom_soap_fault_code.h _axiom_soap_fault_reason.h \ + _axiom_soap_fault_value.h axiom_soap12_builder_helper.h \ + _axiom_soap_fault_detail.h _axiom_soap_fault_role.h \ + _axiom_soap_header_block.h _axiom_soap_body.h \ + _axiom_soap_fault.h _axiom_soap_fault_sub_code.h \ + _axiom_soap_header.h _axiom_soap_envelope.h \ + _axiom_soap_fault_node.h _axiom_soap_fault_text.h + diff --git a/axiom/src/soap/_axiom_soap_body.h b/axiom/src/soap/_axiom_soap_body.h new file mode 100644 index 0000000..bb25b84 --- /dev/null +++ b/axiom/src/soap/_axiom_soap_body.h @@ -0,0 +1,69 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef _AXIOM_SOAP_BODY_H +#define _AXIOM_SOAP_BODY_H + +/** @defgroup axiom_soap AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_soap_body.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap_body Soap Body + * @ingroup axiom_soap + * @{ + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_body_set_base_node( + axiom_soap_body_t * body, + const axutil_env_t * env, + axiom_node_t * om_node); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_body_set_builder( + axiom_soap_body_t * body, + const axutil_env_t * env, + struct axiom_soap_builder *builder); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_body_set_fault( + axiom_soap_body_t * body, + const axutil_env_t * env, + struct axiom_soap_fault *soap_fault); + + AXIS2_EXTERN axiom_soap_body_t *AXIS2_CALL + axiom_soap_body_create( + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** _AXIOM_SOAP_BODY_H */ diff --git a/axiom/src/soap/_axiom_soap_envelope.h b/axiom/src/soap/_axiom_soap_envelope.h new file mode 100644 index 0000000..1c446cc --- /dev/null +++ b/axiom/src/soap/_axiom_soap_envelope.h @@ -0,0 +1,84 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef _AXIOM_SOAP_ENVELOPE_H +#define _AXIOM_SOAP_ENVELOPE_H + +/** @defgroup axiom_soap AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_soap_envelope.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap_envelope Soap Envelope + * @ingroup axiom_soap + * @{ + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_envelope_set_base_node( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env, + axiom_node_t * om_node); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_envelope_set_body( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env, + struct axiom_soap_body *body); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_envelope_set_header( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env, + struct axiom_soap_header *header); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_envelope_set_builder( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env, + struct axiom_soap_builder *soap_builder); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_envelope_set_soap_version_internal( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env, + int soap_version); + + AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL + + axiom_soap_envelope_create_null( + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** _AXIOM_SOAP_ENVELOPE_H */ diff --git a/axiom/src/soap/_axiom_soap_fault.h b/axiom/src/soap/_axiom_soap_fault.h new file mode 100644 index 0000000..2f0c410 --- /dev/null +++ b/axiom/src/soap/_axiom_soap_fault.h @@ -0,0 +1,105 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef _AXIOM_SOAP_FAULT_H +#define _AXIOM_SOAP_FAULT_H + +/** @defgroup axiom_soap AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_soap_fault.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap_fault Soap fault + * @ingroup axiom_soap + * @{ + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_set_code( + axiom_soap_fault_t * fault, + const axutil_env_t * env, + struct axiom_soap_fault_code *code); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_set_reason( + axiom_soap_fault_t * fault, + const axutil_env_t * env, + struct axiom_soap_fault_reason *reason); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_set_node( + axiom_soap_fault_t * fault, + const axutil_env_t * env, + struct axiom_soap_fault_node *node); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_set_role( + axiom_soap_fault_t * fault, + const axutil_env_t * env, + struct axiom_soap_fault_role *role); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_set_detail( + axiom_soap_fault_t * fault, + const axutil_env_t * env, + struct axiom_soap_fault_detail *detail); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_set_base_node( + axiom_soap_fault_t * fault, + const axutil_env_t * env, + axiom_node_t * node); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_set_builder( + axiom_soap_fault_t * fault, + const axutil_env_t * env, + struct axiom_soap_builder *builder); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_set_soap_version( + axiom_soap_fault_t * fault, + const axutil_env_t * env, + int soap_version); + + AXIS2_EXTERN int AXIS2_CALL + axiom_soap_fault_get_soap_version( + axiom_soap_fault_t * fault, + const axutil_env_t * env); + + AXIS2_EXTERN axiom_soap_fault_t *AXIS2_CALL + axiom_soap_fault_create( + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** _AXIOM_SOAP_FAULT_H */ diff --git a/axiom/src/soap/_axiom_soap_fault_code.h b/axiom/src/soap/_axiom_soap_fault_code.h new file mode 100644 index 0000000..3905a18 --- /dev/null +++ b/axiom/src/soap/_axiom_soap_fault_code.h @@ -0,0 +1,91 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef _AXIOM_SOAP_FAULT_CODE_H +#define _AXIOM_SOAP_FAULT_CODE_H + +/** @defgroup axiom_soap AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_soap_fault_code.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap_fault_code Soap fault code + * @ingroup axiom_soap + * @{ + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_code_set_value( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env, + struct axiom_soap_fault_value *fault_val); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_code_set_sub_code( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env, + struct axiom_soap_fault_sub_code *fault_subcode); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_code_set_base_node( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env, + axiom_node_t * node); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_fault_code_set_builder( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env, + struct axiom_soap_builder *soap_builder); + + AXIS2_EXTERN int AXIS2_CALL + axiom_soap_fault_code_get_soap_version( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_code_set_soap_version( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env, + int soap_version); + + AXIS2_EXTERN axiom_soap_fault_code_t *AXIS2_CALL + + axiom_soap_fault_code_create( + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** _AXIOM_SOAP_FAULT_CODE_H */ diff --git a/axiom/src/soap/_axiom_soap_fault_detail.h b/axiom/src/soap/_axiom_soap_fault_detail.h new file mode 100644 index 0000000..69369ca --- /dev/null +++ b/axiom/src/soap/_axiom_soap_fault_detail.h @@ -0,0 +1,60 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef _AXIOM_SOAP_FAULT_DETAIL_H +#define _AXIOM_SOAP_FAULT_DETAIL_H + +/** @defgroup axiom_soap AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_soap_fault_detail.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap_fault_detail soap fault detail + * @ingroup axiom_soap + * @{ + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_detail_set_base_node( + axiom_soap_fault_detail_t * fault_detail, + const axutil_env_t * env, + axiom_node_t * node); + + AXIS2_EXTERN axiom_soap_fault_detail_t *AXIS2_CALL + + axiom_soap_fault_detail_create( + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** _AXIOM_SOAP_FAULT_DETAIL_H */ diff --git a/axiom/src/soap/_axiom_soap_fault_node.h b/axiom/src/soap/_axiom_soap_fault_node.h new file mode 100644 index 0000000..94ddad7 --- /dev/null +++ b/axiom/src/soap/_axiom_soap_fault_node.h @@ -0,0 +1,60 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef _AXIOM_SOAP_FAULT_NODE_H +#define _AXIOM_SOAP_FAULT_NODE_H + +/** @defgroup axiom_soap AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_soap_fault_node.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap_fault_node Soap fault_node + * @ingroup axiom_soap + * @{ + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_node_set_base_node( + axiom_soap_fault_node_t * fault_node, + const axutil_env_t * env, + axiom_node_t * node); + + AXIS2_EXTERN axiom_soap_fault_node_t *AXIS2_CALL + + axiom_soap_fault_node_create( + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** _AXIOM_SOAP_FAULT_NODE_H */ diff --git a/axiom/src/soap/_axiom_soap_fault_reason.h b/axiom/src/soap/_axiom_soap_fault_reason.h new file mode 100644 index 0000000..2307a31 --- /dev/null +++ b/axiom/src/soap/_axiom_soap_fault_reason.h @@ -0,0 +1,87 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef _AXIOM_SOAP_FAULT_REASON_H +#define _AXIOM_SOAP_FAULT_REASON_H + +/** @defgroup axiom_soap AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_soap_fault_reason.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap_fault_reason Soap Reason + * @ingroup axiom_soap + * @{ + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_reason_set_builder( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env, + struct axiom_soap_builder *builder); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_reason_set_base_node( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env, + axiom_node_t * node); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_reason_set_soap_fault_text( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env, + struct axiom_soap_fault_text *soap_text); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_reason_set_soap_version( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env, + int soap_version); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_reason_get_soap_version( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env); + + AXIS2_EXTERN axiom_soap_fault_reason_t *AXIS2_CALL + + axiom_soap_fault_reason_create( + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** _AXIOM_SOAP_FAULT_REASON_H */ diff --git a/axiom/src/soap/_axiom_soap_fault_role.h b/axiom/src/soap/_axiom_soap_fault_role.h new file mode 100644 index 0000000..9c4ec4b --- /dev/null +++ b/axiom/src/soap/_axiom_soap_fault_role.h @@ -0,0 +1,60 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef _AXIOM_SOAP_FAULT_ROLE_H +#define _AXIOM_SOAP_FAULT_ROLE_H + +/** @defgroup axiom_soap AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_soap_fault_role.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap_fault_role Soap_fault_role + * @ingroup axiom_soap + * @{ + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_role_set_base_node( + axiom_soap_fault_role_t * fault_role, + const axutil_env_t * env, + axiom_node_t * node); + + AXIS2_EXTERN axiom_soap_fault_role_t *AXIS2_CALL + + axiom_soap_fault_role_create( + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** _AXIOM_SOAP_FAULT_ROLE_H */ diff --git a/axiom/src/soap/_axiom_soap_fault_sub_code.h b/axiom/src/soap/_axiom_soap_fault_sub_code.h new file mode 100644 index 0000000..878d4e6 --- /dev/null +++ b/axiom/src/soap/_axiom_soap_fault_sub_code.h @@ -0,0 +1,93 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef _AXIOM_SOAP_FAULT_CODE_SUB_CODE_H +#define _AXIOM_SOAP_FAULT_CODE_SUB_CODE_H + +/** @defgroup axiom_soap AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_soap_fault_sub_code.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap_fault_sub_code Soap_fault_code + * @ingroup axiom_soap + * @{ + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_sub_code_set_sub_code( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env, + axiom_soap_fault_sub_code_t * sub_code); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_sub_code_set_value( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env, + struct axiom_soap_fault_value *fault_sub_code_val); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_sub_code_set_base_node( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env, + axiom_node_t * node); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_sub_code_set_builder( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env, + struct axiom_soap_builder *builder); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_sub_code_set_soap_version( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env, + int soap_version); + + AXIS2_EXTERN int AXIS2_CALL + axiom_soap_fault_sub_code_get_soap_version( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env); + + AXIS2_EXTERN axiom_soap_fault_sub_code_t *AXIS2_CALL + + axiom_soap_fault_sub_code_create( + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** _AXIOM_SOAP_FAULT_CODE_SUB_CODE_H */ diff --git a/axiom/src/soap/_axiom_soap_fault_text.h b/axiom/src/soap/_axiom_soap_fault_text.h new file mode 100644 index 0000000..dfc8772 --- /dev/null +++ b/axiom/src/soap/_axiom_soap_fault_text.h @@ -0,0 +1,60 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef _AXIOM_SOAP_FAULT_TEXT_H +#define _AXIOM_SOAP_FAULT_TEXT_H + +/** @defgroup axiom_soap AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_soap_fault_text.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap_fault_text soap fault text + * @ingroup axiom_soap + * @{ + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_text_set_base_node( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env, + axiom_node_t * node); + + AXIS2_EXTERN axiom_soap_fault_text_t *AXIS2_CALL + + axiom_soap_fault_text_create( + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** _AXIOM_SOAP_FAULT_TEXT_H */ diff --git a/axiom/src/soap/_axiom_soap_fault_value.h b/axiom/src/soap/_axiom_soap_fault_value.h new file mode 100644 index 0000000..a524f7f --- /dev/null +++ b/axiom/src/soap/_axiom_soap_fault_value.h @@ -0,0 +1,60 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef _AXIOM_SOAP_FAULT_VALUE_H +#define _AXIOM_SOAP_FAULT_VALUE_H + +/** @defgroup axiom_soap AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_soap_fault_value.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap_fault_value Soap Fault Value + * @ingroup axiom_soap + * @{ + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_fault_value_set_base_node( + axiom_soap_fault_value_t * fault_value, + const axutil_env_t * env, + axiom_node_t * node); + + AXIS2_EXTERN axiom_soap_fault_value_t *AXIS2_CALL + + axiom_soap_fault_value_create( + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** _AXIOM_SOAP_FAULT_VALUE_H */ diff --git a/axiom/src/soap/_axiom_soap_header.h b/axiom/src/soap/_axiom_soap_header.h new file mode 100644 index 0000000..7571aa6 --- /dev/null +++ b/axiom/src/soap/_axiom_soap_header.h @@ -0,0 +1,77 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef _AXIOM_SOAP_HEADER_H +#define _AXIOM_SOAP_HEADER_H + +/** @defgroup axiom_soap AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_soap_header.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap_header Soap header + * @ingroup axiom_soap + * @{ + */ + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_header_set_base_node( + axiom_soap_header_t * header, + const axutil_env_t * env, + axiom_node_t * node); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_header_set_soap_version( + axiom_soap_header_t * header, + const axutil_env_t * env, + int soap_version); + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_header_set_header_block( + axiom_soap_header_t * header, + const axutil_env_t * env, + struct axiom_soap_header_block *header_block); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + axiom_soap_header_set_builder( + axiom_soap_header_t * header, + const axutil_env_t * env, + struct axiom_soap_builder *builder); + + AXIS2_EXTERN axiom_soap_header_t *AXIS2_CALL + axiom_soap_header_create( + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** _AXIOM_SOAP_HEADER_H */ diff --git a/axiom/src/soap/_axiom_soap_header_block.h b/axiom/src/soap/_axiom_soap_header_block.h new file mode 100644 index 0000000..65cb3ab --- /dev/null +++ b/axiom/src/soap/_axiom_soap_header_block.h @@ -0,0 +1,66 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef _AXIOM_SOAP_HEADER_BLOCK_H +#define _AXIOM_SOAP_HEADER_BLOCK_H + +/** @defgroup axiom_soap AXIOM (Axis Object Model) + * @ingroup axis2 + * @{ + */ + +/** @} */ + +#include <axiom_soap_header_block.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_soap_header_block Soap header block + * @ingroup axiom_soap + * @{ + */ + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_header_block_set_soap_version( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + int soap_version); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap_header_block_set_base_node( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + axiom_node_t * node); + + AXIS2_EXTERN axiom_soap_header_block_t *AXIS2_CALL + + axiom_soap_header_block_create( + const axutil_env_t * env); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /** _AXIOM_SOAP_HEADER_BLOCK_H */ diff --git a/axiom/src/soap/axiom_soap11_builder_helper.h b/axiom/src/soap/axiom_soap11_builder_helper.h new file mode 100644 index 0000000..13e914a --- /dev/null +++ b/axiom/src/soap/axiom_soap11_builder_helper.h @@ -0,0 +1,71 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP11_BUILDER_HELPER_H +#define AXIOM_SOAP11_BUILDER_HELPER_H + +/** + * @file axiom_soap_11_builder_helper.h + * @brief axiom_soap11_builder_helper + */ +#include <axiom_soap_builder.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap11_builder_helper + axiom_soap11_builder_helper_t; + + /** + * @defgroup axiom_soap11_builder_helper + * @ingroup axiom_soap + * @{ + */ + + /** + * creates a soap11_builder_helper_create + * @param env Environment. MUST NOT be NULL + */ + AXIS2_EXTERN axiom_soap11_builder_helper_t *AXIS2_CALL + + axiom_soap11_builder_helper_create( + const axutil_env_t * env, + axiom_soap_builder_t * soap_builder, + axiom_stax_builder_t * om_builder); + + AXIS2_EXTERN void AXIS2_CALL + axiom_soap11_builder_helper_free( + axiom_soap11_builder_helper_t * builder_helper, + const axutil_env_t * env); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap11_builder_helper_handle_event( + axiom_soap11_builder_helper_t * builder_helper, + const axutil_env_t * env, + axiom_node_t * om_element_node, + int element_level); + + /** @} */ +#ifdef __cplusplus +} +#endif + +#endif /* AXIOM_SOAP11_BUILDER_HELPER_H */ diff --git a/axiom/src/soap/axiom_soap12_builder_helper.h b/axiom/src/soap/axiom_soap12_builder_helper.h new file mode 100644 index 0000000..e901627 --- /dev/null +++ b/axiom/src/soap/axiom_soap12_builder_helper.h @@ -0,0 +1,71 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_SOAP12_BUILDER_HELPER_H +#define AXIOM_SOAP12_BUILDER_HELPER_H + +#include <axiom_soap_builder.h> + +/** + * @file axiom_soap_12_builder_helper.h + * @brief axiom_soap12_builder_helper + */ + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct axiom_soap12_builder_helper + axiom_soap12_builder_helper_t; + + /** + * @defgroup axiom_soap12_builder_helper + * @ingroup axiom_soap + * @{ + */ + + /** + * creates a soap12_builder_helper_create + * @param env Environment. MUST NOT be NULL + */ + AXIS2_EXTERN axiom_soap12_builder_helper_t *AXIS2_CALL + + axiom_soap12_builder_helper_create( + const axutil_env_t * env, + axiom_soap_builder_t * soap_builder); + + AXIS2_EXTERN void AXIS2_CALL + axiom_soap12_builder_helper_free( + axiom_soap12_builder_helper_t * builder_helper, + const axutil_env_t * env); + + AXIS2_EXTERN axis2_status_t AXIS2_CALL + + axiom_soap12_builder_helper_handle_event( + axiom_soap12_builder_helper_t * builder_helper, + const axutil_env_t * env, + axiom_node_t * om_element_node, + int element_level); + + /** @} */ +#ifdef __cplusplus +} +#endif + +#endif /*AXIOM_SOAP11_BUILDER_HELPER_H */ diff --git a/axiom/src/soap/soap11_builder_helper.c b/axiom/src/soap/soap11_builder_helper.c new file mode 100644 index 0000000..ab2e4d8 --- /dev/null +++ b/axiom/src/soap/soap11_builder_helper.c @@ -0,0 +1,340 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap11_builder_helper.h" +#include <axiom_stax_builder.h> +#include <axiom_soap_builder.h> +#include <axiom_soap_const.h> +#include "_axiom_soap_fault_code.h" +#include "_axiom_soap_fault_value.h" +#include "_axiom_soap_fault_reason.h" +#include "_axiom_soap_fault.h" +#include "_axiom_soap_body.h" +#include "_axiom_soap_fault_detail.h" +#include <axiom_soap_fault_text.h> +#include "_axiom_soap_fault_role.h" +#include <axiom_stax_builder_internal.h> +#include <axiom_node_internal.h> + +static axis2_status_t +axiom_soap11_builder_helper_process_text( + axiom_soap11_builder_helper_t * builder_helper, + const axutil_env_t * env); + +struct axiom_soap11_builder_helper +{ + axiom_soap_builder_t *soap_builder; + + axis2_bool_t fault_code_present; + + axis2_bool_t fault_string_present; + + axiom_stax_builder_t *om_builder; + + axiom_node_t *last_processed_node; + +}; + +AXIS2_EXTERN axiom_soap11_builder_helper_t *AXIS2_CALL +axiom_soap11_builder_helper_create( + const axutil_env_t * env, + axiom_soap_builder_t * soap_builder, + axiom_stax_builder_t * om_builder) +{ + axiom_soap11_builder_helper_t *builder_helper = NULL; + + AXIS2_PARAM_CHECK(env->error, soap_builder, NULL); + AXIS2_PARAM_CHECK(env->error, om_builder, NULL); + + builder_helper = (axiom_soap11_builder_helper_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_soap11_builder_helper_t)); + + if(!builder_helper) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create SOAP 1.1 builder helper"); + return NULL; + } + + builder_helper->fault_code_present = AXIS2_FALSE; + builder_helper->fault_string_present = AXIS2_FALSE; + builder_helper->last_processed_node = NULL; + builder_helper->soap_builder = soap_builder; + builder_helper->om_builder = om_builder; + + return builder_helper; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap11_builder_helper_free( + axiom_soap11_builder_helper_t * builder_helper, + const axutil_env_t * env) +{ + + AXIS2_FREE(env->allocator, builder_helper); + builder_helper = NULL; + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap11_builder_helper_handle_event( + axiom_soap11_builder_helper_t * builder_helper, + const axutil_env_t * env, + axiom_node_t * om_element_node, + int element_level) +{ + axiom_element_t *om_ele = NULL; + axis2_char_t *ele_localname = NULL; + axiom_soap_envelope_t *soap_envelope = NULL; + axiom_soap_body_t *soap_body = NULL; + axiom_soap_fault_t *soap_fault = NULL; + + AXIS2_PARAM_CHECK(env->error, om_element_node, AXIS2_FAILURE); + + om_ele = (axiom_element_t *)axiom_node_get_data_element(om_element_node, env); + + ele_localname = axiom_element_get_localname(om_ele, env); + if(!ele_localname) + { + return AXIS2_FAILURE; + } + + soap_envelope = axiom_soap_builder_get_soap_envelope(builder_helper->soap_builder, env); + + if(!soap_envelope) + { + return AXIS2_FAILURE; + } + + soap_body = axiom_soap_envelope_get_body(soap_envelope, env); + if(!soap_body) + { + return AXIS2_FAILURE; + } + + soap_fault = axiom_soap_body_get_fault(soap_body, env); + if(!soap_fault) + { + return AXIS2_FAILURE; + } + + if(element_level == 4) + { + axiom_soap_fault_code_t *fault_code = NULL; + axiom_soap_fault_value_t *fault_value = NULL; + axiom_node_t *fault_value_node = NULL; + axiom_element_t *fault_value_ele = NULL; + + if(axutil_strcmp(ele_localname, AXIOM_SOAP11_SOAP_FAULT_CODE_LOCAL_NAME) == 0) + { + axis2_status_t status = AXIS2_SUCCESS; + + if(builder_helper->fault_string_present) + { + axiom_soap_builder_set_bool_processing_mandatory_fault_elements( + builder_helper->soap_builder, env, AXIS2_FALSE); + } + + fault_code = axiom_soap_fault_code_create(env); + if(!fault_code) + { + return AXIS2_FAILURE; + } + axiom_soap_fault_code_set_base_node(fault_code, env, om_element_node); + + axiom_soap_fault_set_code(soap_fault, env, fault_code); + + axiom_soap_fault_code_set_builder(fault_code, env, builder_helper->soap_builder); + + axiom_element_set_localname(om_ele, env, AXIOM_SOAP12_SOAP_FAULT_CODE_LOCAL_NAME); + + fault_value = axiom_soap_fault_value_create_with_code(env, fault_code); + if(!fault_value) + { + return AXIS2_FAILURE; + } + fault_value_node = axiom_soap_fault_value_get_base_node(fault_value, env); + if(!fault_value_node) + { + return AXIS2_FAILURE; + } + fault_value_ele = (axiom_element_t *)axiom_node_get_data_element(fault_value_node, env); + + axiom_stax_builder_set_lastnode(builder_helper->om_builder, env, fault_value_node); + + status = axiom_soap11_builder_helper_process_text(builder_helper, env); + if(status == AXIS2_FAILURE) + { + return AXIS2_FAILURE; + } + axiom_stax_builder_set_lastnode(builder_helper->om_builder, env, om_element_node); + axiom_node_set_complete(om_element_node, env, AXIS2_TRUE); + + axiom_stax_builder_set_element_level(builder_helper->om_builder, env, (element_level + - 1)); + builder_helper->fault_code_present = AXIS2_TRUE; + } + else if(axutil_strcmp(AXIOM_SOAP11_SOAP_FAULT_STRING_LOCAL_NAME, ele_localname) == 0) + { + + axiom_soap_fault_reason_t *fault_reason = NULL; + axiom_soap_fault_text_t *fault_text = NULL; + axiom_node_t *fault_text_node = NULL; + int status = AXIS2_SUCCESS; + if(builder_helper->fault_code_present) + { + axiom_soap_builder_set_bool_processing_mandatory_fault_elements( + builder_helper->soap_builder, env, AXIS2_FALSE); + } + + axiom_element_set_localname(om_ele, env, AXIOM_SOAP12_SOAP_FAULT_REASON_LOCAL_NAME); + + fault_reason = axiom_soap_fault_reason_create(env); + if(!fault_reason) + { + return AXIS2_FAILURE; + } + axiom_soap_fault_reason_set_base_node(fault_reason, env, om_element_node); + + axiom_soap_fault_set_reason(soap_fault, env, fault_reason); + + fault_text = axiom_soap_fault_text_create_with_parent(env, fault_reason); + if(!fault_text) + { + return AXIS2_FAILURE; + } + fault_text_node = axiom_soap_fault_text_get_base_node(fault_text, env); + if(!fault_text_node) + { + return AXIS2_FAILURE; + } + axiom_stax_builder_set_lastnode(builder_helper->om_builder, env, fault_text_node); + + status = axiom_soap11_builder_helper_process_text(builder_helper, env); + if(status == AXIS2_FAILURE) + { + return AXIS2_FAILURE; + } + axiom_stax_builder_set_lastnode(builder_helper->om_builder, env, om_element_node); + + axiom_node_set_complete(om_element_node, env, AXIS2_TRUE); + + axiom_stax_builder_set_element_level(builder_helper->om_builder, env, (element_level + - 1)); + + builder_helper->fault_string_present = AXIS2_TRUE; + + } + else if(axutil_strcmp(AXIOM_SOAP11_SOAP_FAULT_ACTOR_LOCAL_NAME, ele_localname) == 0) + { + axiom_soap_fault_role_t *fault_role = NULL; + fault_role = axiom_soap_fault_role_create(env); + if(!fault_role) + { + return AXIS2_FAILURE; + } + axiom_element_set_localname(om_ele, env, AXIOM_SOAP12_SOAP_FAULT_ROLE_LOCAL_NAME); + + axiom_soap_fault_role_set_base_node(fault_role, env, om_element_node); + + axiom_soap_fault_set_role(soap_fault, env, fault_role); + /* + Role element may not have a namespace associated, hence commented, else it segfaults here - Samisa + status = axiom_soap_builder_process_namespace_data( + builder_helper->soap_builder, env, om_element_node, AXIS2_TRUE); + if(status == AXIS2_FAILURE) + return AXIS2_FAILURE; */ + } + else if(axutil_strcmp(AXIOM_SOAP11_SOAP_FAULT_DETAIL_LOCAL_NAME, ele_localname) == 0) + { + axiom_soap_fault_detail_t *fault_detail = NULL; + fault_detail = axiom_soap_fault_detail_create(env); + if(!fault_detail) + { + return AXIS2_FAILURE; + } + axiom_element_set_localname(om_ele, env, AXIOM_SOAP12_SOAP_FAULT_DETAIL_LOCAL_NAME); + + axiom_soap_fault_detail_set_base_node(fault_detail, env, om_element_node); + + axiom_soap_fault_set_detail(soap_fault, env, fault_detail); + } + else + { + return AXIS2_SUCCESS; + } + } + else if(element_level == 5) + { + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_element = NULL; + axis2_char_t *parent_localname = NULL; + + parent_node = axiom_node_get_parent(om_element_node, env); + if(!parent_node) + { + return AXIS2_FAILURE; + } + parent_element = (axiom_element_t *)axiom_node_get_data_element(om_element_node, env); + parent_localname = axiom_element_get_localname(parent_element, env); + + if(!parent_localname) + { + return AXIS2_FAILURE; + } + if(axutil_strcmp(parent_localname, AXIOM_SOAP12_SOAP_FAULT_ROLE_LOCAL_NAME) == 0) + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_SOAP11_FAULT_ACTOR_SHOULD_NOT_HAVE_CHILD_ELEMENTS, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "SOAP 1.1 Actor should not have child elements"); + return AXIS2_FAILURE; + } + } + return AXIS2_SUCCESS; +} + +static axis2_status_t +axiom_soap11_builder_helper_process_text( + axiom_soap11_builder_helper_t * builder_helper, + const axutil_env_t * env) +{ + int token = 0; + + token = axiom_stax_builder_next_with_token(builder_helper->om_builder, env); + + if(token == -1) + { + return AXIS2_FAILURE; + } + while(token != AXIOM_XML_READER_END_ELEMENT) + { + if(token != AXIOM_XML_READER_CHARACTER) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_ONLY_CHARACTERS_ARE_ALLOWED_HERE, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "Unidentified character in SOAP 1.1 builder helper processing"); + return AXIS2_FAILURE; + + } + token = axiom_stax_builder_next_with_token(builder_helper->om_builder, env); + if(token == -1) + { + return AXIS2_FAILURE; + } + } + return AXIS2_SUCCESS; +} diff --git a/axiom/src/soap/soap12_builder_helper.c b/axiom/src/soap/soap12_builder_helper.c new file mode 100644 index 0000000..179d26d --- /dev/null +++ b/axiom/src/soap/soap12_builder_helper.c @@ -0,0 +1,718 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap12_builder_helper.h" +#include <axutil_array_list.h> +#include "_axiom_soap_body.h" +#include "_axiom_soap_fault.h" +#include "_axiom_soap_envelope.h" +#include "_axiom_soap_fault_code.h" +#include "_axiom_soap_fault_sub_code.h" +#include "_axiom_soap_fault_node.h" +#include "_axiom_soap_fault_detail.h" +#include "_axiom_soap_fault_reason.h" +#include "_axiom_soap_fault_role.h" +#include "_axiom_soap_fault_value.h" +#include "_axiom_soap_fault_text.h" + +struct axiom_soap12_builder_helper +{ + axiom_soap_builder_t *soap_builder; + + axis2_bool_t code_present; + + axis2_bool_t reason_present; + + axis2_bool_t node_present; + + axis2_bool_t role_present; + + axis2_bool_t detail_present; + + axis2_bool_t subcode_value_present; + + axis2_bool_t value_present; + + axis2_bool_t sub_code_present; + + axis2_bool_t sub_sub_code_present; + + axis2_bool_t code_processing; + + axis2_bool_t sub_code_processing; + + axis2_bool_t reason_processing; + + axutil_array_list_t *detail_element_names; +}; + +AXIS2_EXTERN axiom_soap12_builder_helper_t *AXIS2_CALL +axiom_soap12_builder_helper_create( + const axutil_env_t * env, + axiom_soap_builder_t * soap_builder) +{ + axiom_soap12_builder_helper_t *builder_helper = NULL; + AXIS2_ENV_CHECK(env, NULL); + AXIS2_PARAM_CHECK(env->error, soap_builder, NULL); + + builder_helper = (axiom_soap12_builder_helper_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_soap12_builder_helper_t)); + if(!builder_helper) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create SOAP 1.1 builder helper"); + return NULL; + } + + builder_helper->code_present = AXIS2_FALSE; + builder_helper->detail_present = AXIS2_FALSE; + builder_helper->reason_present = AXIS2_FALSE; + builder_helper->role_present = AXIS2_FALSE; + builder_helper->sub_code_present = AXIS2_FALSE; + builder_helper->reason_processing = AXIS2_FALSE; + builder_helper->code_processing = AXIS2_FALSE; + builder_helper->sub_code_processing = AXIS2_FALSE; + builder_helper->detail_element_names = NULL; + builder_helper->node_present = AXIS2_FALSE; + builder_helper->soap_builder = soap_builder; + builder_helper->sub_sub_code_present = AXIS2_FALSE; + builder_helper->value_present = AXIS2_FALSE; + builder_helper->subcode_value_present = AXIS2_FALSE; + + return builder_helper; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap12_builder_helper_free( + axiom_soap12_builder_helper_t * builder_helper, + const axutil_env_t * env) +{ + AXIS2_ENV_CHECK(env, void); + + if(builder_helper->detail_element_names) + { + axutil_array_list_free(builder_helper->detail_element_names, env); + builder_helper->detail_element_names = NULL; + } + + AXIS2_FREE(env->allocator, builder_helper); + builder_helper = NULL; + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap12_builder_helper_handle_event( + axiom_soap12_builder_helper_t * builder_helper, + const axutil_env_t * env, + axiom_node_t * om_ele_node, + int element_level) +{ + axis2_char_t *ele_localname = NULL; + axiom_element_t *om_ele = NULL; + + axiom_soap_body_t *soap_body = NULL; + axiom_soap_fault_t *soap_fault = NULL; + axiom_soap_envelope_t *soap_envelope = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_ele_node, AXIS2_FAILURE); + + om_ele = (axiom_element_t *)axiom_node_get_data_element(om_ele_node, env); + if(!om_ele) + { + return AXIS2_FAILURE; + } + + ele_localname = axiom_element_get_localname(om_ele, env); + if(!ele_localname) + { + return AXIS2_FAILURE; + } + + soap_envelope = axiom_soap_builder_get_soap_envelope(builder_helper->soap_builder, env); + if(!soap_envelope) + { + return AXIS2_FAILURE; + } + + soap_body = axiom_soap_envelope_get_body(soap_envelope, env); + if(!soap_body) + { + return AXIS2_FAILURE; + } + + soap_fault = axiom_soap_body_get_fault(soap_body, env); + if(!soap_fault) + { + return AXIS2_FAILURE; + } + + if(element_level == 4) + { + if(axutil_strcmp(AXIOM_SOAP12_SOAP_FAULT_CODE_LOCAL_NAME, ele_localname) == 0) + { + if(builder_helper->code_present) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_MULTIPLE_CODE_ELEMENTS_ENCOUNTERED, + AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "Multiple fault code elements encountered in SOAP fault"); + return AXIS2_FAILURE; + } + else + { + axiom_soap_fault_code_t *soap_fault_code = NULL; + soap_fault_code = axiom_soap_fault_code_create(env); + if(!soap_fault_code) + { + return AXIS2_FAILURE; + } + axiom_soap_fault_code_set_base_node(soap_fault_code, env, om_ele_node); + + axiom_soap_fault_code_set_builder(soap_fault_code, env, + builder_helper->soap_builder); + + axiom_soap_fault_set_code(soap_fault, env, soap_fault_code); + + builder_helper->code_present = AXIS2_TRUE; + builder_helper->code_processing = AXIS2_TRUE; + } + } + else if(axutil_strcmp(AXIOM_SOAP12_SOAP_FAULT_REASON_LOCAL_NAME, ele_localname) == 0) + { + if(!(builder_helper->code_processing) && !(builder_helper->sub_code_processing)) + { + if(builder_helper->code_present) + { + if(builder_helper->reason_present) + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_MULTIPLE_REASON_ELEMENTS_ENCOUNTERED, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "Multiple fault reason elements encountered in SOAP fault"); + + return AXIS2_FAILURE; + } + else + { + axiom_soap_fault_reason_t *fault_reason = NULL; + fault_reason = axiom_soap_fault_reason_create(env); + if(!fault_reason) + { + return AXIS2_FAILURE; + } + + axiom_soap_fault_reason_set_base_node(fault_reason, env, om_ele_node); + + axiom_soap_fault_set_reason(soap_fault, env, fault_reason); + + axiom_soap_fault_reason_set_builder(fault_reason, env, + builder_helper-> soap_builder); + + builder_helper->reason_present = AXIS2_TRUE; + builder_helper->reason_processing = AXIS2_TRUE; + } + } + else + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_WRONG_ELEMENT_ORDER_ENCOUNTERED, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + } + else + { + if(builder_helper->code_processing) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SOAP_FAULT_CODE_DOES_NOT_HAVE_A_VALUE, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + else + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SOAP_FAULT_CODE_DOES_NOT_HAVE_A_VALUE, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + } + } + else if(axutil_strcmp(ele_localname, AXIOM_SOAP12_SOAP_FAULT_NODE_LOCAL_NAME) == 0) + { + if(!(builder_helper->reason_processing)) + { + if(builder_helper->reason_present && !(builder_helper->role_present) + && !(builder_helper->detail_present)) + { + if(builder_helper->node_present) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_MULTIPLE_NODE_ELEMENTS_ENCOUNTERED, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + else + { + axiom_soap_fault_node_t *soap_fault_node = NULL; + soap_fault_node = axiom_soap_fault_node_create(env); + if(!soap_fault_node) + { + return AXIS2_FAILURE; + } + + axiom_soap_fault_node_set_base_node(soap_fault_node, env, om_ele_node); + + axiom_soap_fault_set_node(soap_fault, env, soap_fault_node); + + builder_helper->node_present = AXIS2_TRUE; + } + } + else + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_WRONG_ELEMENT_ORDER_ENCOUNTERED, + AXIS2_FALSE); + + return AXIS2_FAILURE; + } + } + else + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_SOAP_FAULT_REASON_ELEMENT_SHOULD_HAVE_A_TEXT, AXIS2_FALSE); + return AXIS2_FAILURE; + } + + } + else if(axutil_strcmp(ele_localname, AXIOM_SOAP12_SOAP_FAULT_ROLE_LOCAL_NAME) == 0) + { + if(!(builder_helper->reason_processing)) + { + if(builder_helper->reason_present && !(builder_helper->detail_present)) + { + if(builder_helper->role_present) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_MULTIPLE_ROLE_ELEMENTS_ENCOUNTERED, + AXIS2_FAILURE); + + return AXIS2_FAILURE; + } + else + { + axiom_soap_fault_role_t *soap_fault_role = NULL; + soap_fault_role = axiom_soap_fault_role_create(env); + if(!soap_fault_role) + return AXIS2_FAILURE; + + axiom_soap_fault_role_set_base_node(soap_fault_role, env, om_ele_node); + + axiom_soap_fault_set_role(soap_fault, env, soap_fault_role); + builder_helper->role_present = AXIS2_TRUE; + } + } + else + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_WRONG_ELEMENT_ORDER_ENCOUNTERED, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + } + else + { + + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SOAP_FAULT_ROLE_ELEMENT_SHOULD_HAVE_A_TEXT, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + } + else if(axutil_strcmp(ele_localname, AXIOM_SOAP12_SOAP_FAULT_DETAIL_LOCAL_NAME) == 0) + { + if(!(builder_helper->reason_processing)) + { + if(builder_helper->reason_present) + { + if(builder_helper->detail_present) + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_MULTIPLE_DETAIL_ELEMENTS_ENCOUNTERED, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + else + { + + axiom_soap_fault_detail_t *soap_fault_detail = NULL; + soap_fault_detail = axiom_soap_fault_detail_create(env); + if(!soap_fault_detail) + return AXIS2_FAILURE; + + axiom_soap_fault_detail_set_base_node(soap_fault_detail, env, om_ele_node); + + axiom_soap_fault_set_detail(soap_fault, env, soap_fault_detail); + builder_helper->detail_present = AXIS2_TRUE; + } + } + else + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_WRONG_ELEMENT_ORDER_ENCOUNTERED, + AXIS2_FAILURE); + + return AXIS2_FAILURE; + + } + } + else + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_SOAP_FAULT_REASON_ELEMENT_SHOULD_HAVE_A_TEXT, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + + } + else + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_UNSUPPORTED_ELEMENT_IN_SOAP_FAULT_ELEMENT, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + } + else if(element_level == 5) + { + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + axis2_char_t *parent_localname = NULL; + parent_node = axiom_node_get_parent(om_ele_node, env); + if(!parent_node) + { + return AXIS2_FAILURE; + } + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + if(!parent_ele) + { + return AXIS2_FAILURE; + } + parent_localname = axiom_element_get_localname(parent_ele, env); + if(!parent_localname) + { + return AXIS2_FAILURE; + } + + if(axutil_strcmp(parent_localname, AXIOM_SOAP12_SOAP_FAULT_CODE_LOCAL_NAME) == 0) + { + if(axutil_strcmp(ele_localname, AXIOM_SOAP12_SOAP_FAULT_VALUE_LOCAL_NAME) == 0) + { + if(!(builder_helper->value_present)) + { + axiom_soap_fault_value_t *soap_fault_value = NULL; + axiom_soap_fault_code_t *parent_fcode = NULL; + + soap_fault_value = axiom_soap_fault_value_create(env); + if(!soap_fault_value) + { + return AXIS2_FAILURE; + } + axiom_soap_fault_value_set_base_node(soap_fault_value, env, om_ele_node); + + parent_fcode = axiom_soap_fault_get_code(soap_fault, env); + if(!parent_fcode) + { + return AXIS2_FAILURE; + } + axiom_soap_fault_code_set_value(parent_fcode, env, soap_fault_value); + + builder_helper->value_present = AXIS2_TRUE; + builder_helper->code_processing = AXIS2_FALSE; + + } + else + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_MULTIPLE_VALUE_ENCOUNTERED_IN_CODE_ELEMENT, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + } + else if(axutil_strcmp(ele_localname, AXIOM_SOAP12_SOAP_FAULT_SUB_CODE_LOCAL_NAME) == 0) + { + if(!(builder_helper->sub_code_present)) + { + if(builder_helper->value_present) + { + + axiom_soap_fault_sub_code_t *fault_subcode = NULL; + axiom_soap_fault_code_t *fault_code = NULL; + + fault_subcode = axiom_soap_fault_sub_code_create(env); + if(!fault_subcode) + { + return AXIS2_FAILURE; + } + axiom_soap_fault_sub_code_set_base_node(fault_subcode, env, om_ele_node); + + fault_code = axiom_soap_fault_get_code(soap_fault, env); + if(!fault_code) + { + return AXIS2_FAILURE; + } + axiom_soap_fault_code_set_sub_code(fault_code, env, fault_subcode); + + axiom_soap_fault_sub_code_set_builder(fault_subcode, env, + builder_helper-> soap_builder); + + builder_helper->sub_code_present = AXIS2_TRUE; + builder_helper->sub_code_processing = AXIS2_TRUE; + } + else + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_SOAP_FAULT_VALUE_SHOULD_BE_PRESENT_BEFORE_SUB_CODE, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + } + else + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_MULTIPLE_SUB_CODE_VALUES_ENCOUNTERED, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + } + else + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_THIS_LOCALNAME_NOT_SUPPORTED_INSIDE_THE_CODE_ELEMENT, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + } + else if(axutil_strcmp(parent_localname, AXIOM_SOAP12_SOAP_FAULT_REASON_LOCAL_NAME) == 0) + { + if(axutil_strcmp(ele_localname, AXIOM_SOAP12_SOAP_FAULT_TEXT_LOCAL_NAME) == 0) + { + axiom_soap_fault_text_t *soap_fault_text = NULL; + axiom_soap_fault_reason_t *fault_reason = NULL; + + soap_fault_text = axiom_soap_fault_text_create(env); + if(!soap_fault_text) + { + return AXIS2_FAILURE; + } + axiom_soap_fault_text_set_base_node(soap_fault_text, env, om_ele_node); + + fault_reason = axiom_soap_fault_get_reason(soap_fault, env); + if(!fault_reason) + { + return AXIS2_FAILURE; + } + + axiom_soap_fault_reason_add_soap_fault_text(fault_reason, env, soap_fault_text); + builder_helper->reason_processing = AXIS2_FALSE; + + axiom_soap_builder_set_bool_processing_mandatory_fault_elements( + builder_helper->soap_builder, env, AXIS2_FALSE); + + } + else + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_THIS_LOCALNAME_IS_NOT_SUPPORTED_INSIDE_THE_REASON_ELEMENT, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + + } + else if(axutil_strcmp(parent_localname, AXIOM_SOAP12_SOAP_FAULT_DETAIL_LOCAL_NAME) == 0) + { + axiom_soap_builder_set_processing_detail_elements(builder_helper-> soap_builder, env, + AXIS2_TRUE); + + if(!(builder_helper->detail_element_names)) + { + builder_helper->detail_element_names = axutil_array_list_create(env, 20); + } + + axutil_array_list_add(builder_helper->detail_element_names, env, ele_localname); + + } + else + { + + return AXIS2_FAILURE; + } + + } + else if(element_level > 5) + { + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + axis2_char_t *parent_localname = NULL; + + parent_node = axiom_node_get_parent(om_ele_node, env); + if(!parent_node) + { + return AXIS2_FAILURE; + } + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + if(!parent_ele) + { + return AXIS2_FAILURE; + } + + parent_localname = axiom_element_get_localname(parent_ele, env); + if(!parent_localname) + { + return AXIS2_FAILURE; + } + if(axutil_strcmp(parent_localname, AXIOM_SOAP12_SOAP_FAULT_SUB_CODE_LOCAL_NAME) == 0) + { + if(axutil_strcmp(ele_localname, AXIOM_SOAP12_SOAP_FAULT_VALUE_LOCAL_NAME) == 0) + { + if(builder_helper->subcode_value_present) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_MULTIPLE_SUB_CODE_VALUES_ENCOUNTERED, + AXIS2_FAILURE); + return AXIS2_FAILURE; + } + else + { + + axiom_soap_fault_sub_code_t *sub_code = NULL; + axiom_soap_fault_code_t *code = NULL; + axiom_soap_fault_value_t *value = NULL; + code = axiom_soap_fault_get_code(soap_fault, env); + + if(!code) + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, + "fault code null when it should not be null"); + return AXIS2_FAILURE; + } + + sub_code = axiom_soap_fault_code_get_sub_code(code, env); + if(!sub_code) + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, + "fault subcode null when it should not be null"); + return AXIS2_FAILURE; + } + value = axiom_soap_fault_value_create(env); + if(!value) + { + return AXIS2_FAILURE; + } + + axiom_soap_fault_value_set_base_node(value, env, om_ele_node); + + axiom_soap_fault_sub_code_set_value(sub_code, env, value); + + builder_helper->subcode_value_present = AXIS2_TRUE; + builder_helper->sub_sub_code_present = AXIS2_FALSE; + builder_helper->sub_code_processing = AXIS2_FALSE; + } + } + else if(axutil_strcmp(ele_localname, AXIOM_SOAP12_SOAP_FAULT_SUB_CODE_LOCAL_NAME) == 0) + { + if(builder_helper->subcode_value_present) + { + if(!(builder_helper->sub_sub_code_present)) + { + axiom_soap_fault_code_t *fault_code = NULL; + axiom_soap_fault_sub_code_t *parent_subcode = NULL; + axiom_soap_fault_sub_code_t *subcode = NULL; + + subcode = axiom_soap_fault_sub_code_create(env); + if(!subcode) + { + return AXIS2_FAILURE; + } + + axiom_soap_fault_sub_code_set_base_node(subcode, env, om_ele_node); + + fault_code = axiom_soap_fault_get_code(soap_fault, env); + if(!fault_code) + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, + "fault code null when it should not be null"); + return AXIS2_FAILURE; + } + parent_subcode = axiom_soap_fault_code_get_sub_code(fault_code, env); + if(!parent_subcode) + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, + "fault subcode null when it should not be null"); + return AXIS2_FAILURE; + } + + axiom_soap_fault_sub_code_set_sub_code(parent_subcode, env, subcode); + + builder_helper->subcode_value_present = AXIS2_FALSE; + builder_helper->sub_sub_code_present = AXIS2_TRUE; + builder_helper->sub_code_processing = AXIS2_TRUE; + } + else + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_MULTIPLE_SUB_CODE_VALUES_ENCOUNTERED, AXIS2_FAILURE); + + return AXIS2_FAILURE; + } + } + else + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_SOAP_FAULT_VALUE_SHOULD_BE_PRESENT_BEFORE_SUB_CODE, + AXIS2_FAILURE); + + return AXIS2_FAILURE; + + } + } + else + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_THIS_LOCALNAME_IS_NOT_SUPPORTED_INSIDE_THE_SUB_CODE_ELEMENT, + AXIS2_FAILURE); + + return AXIS2_FAILURE; + } + } + else if(axiom_soap_builder_is_processing_detail_elements(builder_helper->soap_builder, env)) + { + + int detail_element_level = 0; + axis2_bool_t local_name_exists = AXIS2_FALSE; + int i = 0; + if(!(builder_helper->detail_element_names)) + { + return AXIS2_FAILURE; + } + + for(i = 0; i < axutil_array_list_size(builder_helper->detail_element_names, env); i++) + { + if(axutil_strcmp(parent_localname, axutil_array_list_get( + builder_helper->detail_element_names, env, i)) == 0) + { + local_name_exists = AXIS2_TRUE; + detail_element_level = i + 1; + } + } + if(local_name_exists) + { + axutil_array_list_add(builder_helper->detail_element_names, env, ele_localname); + } + else + { + return AXIS2_FAILURE; + } + } + } + return AXIS2_SUCCESS; +} diff --git a/axiom/src/soap/soap_body.c b/axiom/src/soap/soap_body.c new file mode 100644 index 0000000..8fb7d8f --- /dev/null +++ b/axiom/src/soap/soap_body.c @@ -0,0 +1,547 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_envelope.h" +#include "_axiom_soap_body.h" +#include <axutil_hash.h> +#include <axiom_soap_const.h> +#include <axiom_soap_builder.h> +#include <axiom_soap_fault_code.h> +#include <axiom_soap_fault_reason.h> +#include <axiom_soap_fault_detail.h> +#include <axiom_soap_fault_role.h> +#include "_axiom_soap_fault_value.h" +#include "_axiom_soap_fault_text.h" +#include <axiom_util.h> + +struct axiom_soap_body +{ + axiom_node_t *om_ele_node; + + axis2_bool_t has_fault; + + axiom_soap_fault_t *soap_fault; + + axiom_soap_builder_t *soap_builder; + + int soap_version; +}; + +AXIS2_EXTERN axiom_soap_body_t *AXIS2_CALL +axiom_soap_body_create( + const axutil_env_t * env) +{ + axiom_soap_body_t *soap_body = NULL; + + soap_body = (axiom_soap_body_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_soap_body_t)); + + if(!soap_body) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + soap_body->om_ele_node = NULL; + soap_body->soap_builder = NULL; + soap_body->has_fault = AXIS2_FALSE; + soap_body->soap_fault = NULL; + + return soap_body; +} + +AXIS2_EXTERN axiom_soap_body_t *AXIS2_CALL +axiom_soap_body_create_with_parent( + const axutil_env_t * env, + axiom_soap_envelope_t * envelope) +{ + axiom_soap_body_t *soap_body = NULL; + axiom_element_t *ele = NULL; + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + axiom_namespace_t *om_ns = NULL; + + AXIS2_PARAM_CHECK(env->error, envelope, NULL); + + soap_body = axiom_soap_body_create(env); + if(!soap_body) + { + return NULL; + } + + /*get parent node from SOAP envelope */ + parent_node = axiom_soap_envelope_get_base_node(envelope, env); + if(!parent_node) + { + axiom_soap_body_free(soap_body, env); + return NULL; + } + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + + if(!parent_ele) + { + axiom_soap_body_free(soap_body, env); + return NULL; + } + + om_ns = axiom_element_get_namespace(parent_ele, env, parent_node); + + ele = axiom_element_create(env, parent_node, AXIOM_SOAP_BODY_LOCAL_NAME, om_ns, + &(soap_body->om_ele_node)); + if(!ele) + { + axiom_soap_body_free(soap_body, env); + return NULL; + } + + axiom_soap_envelope_set_body(envelope, env, soap_body); + + return soap_body; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_body_free( + axiom_soap_body_t * soap_body, + const axutil_env_t * env) +{ + + if(soap_body->soap_fault) + { + axiom_soap_fault_free(soap_body->soap_fault, env); + soap_body->soap_fault = NULL; + } + AXIS2_FREE(env->allocator, soap_body); + soap_body = NULL; + return; +} + +/** + * Indicates whether a soap fault is available with this soap body + * @param soap_body axiom_soap_body struct + * @param env environment must not be null + * @return AXIS2_TRUE if fault is available, AXIS2_FALSE otherwise + */ +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_soap_body_has_fault( + axiom_soap_body_t * soap_body, + const axutil_env_t * env) +{ + if(soap_body->soap_fault) + { + soap_body->has_fault = AXIS2_TRUE; + } + else + { + while(!axiom_node_is_complete(soap_body->om_ele_node, env)) + { + if(axiom_soap_builder_next(soap_body->soap_builder, env) != AXIS2_SUCCESS) + { + /* problem in building the SOAP body. Note that has_fault is about soap fault, + * not about problem in building the node. So, even though there is a problem + * building the body, has_fault should be AXIS2_FALSE + */ + break; + } + + if(soap_body->soap_fault) + { + soap_body->has_fault = AXIS2_TRUE; + break; + } + } + } + + return soap_body->has_fault; +} + +/** + * Returns the axiom_soap_fault_t struct in this axiom_soap_bodY_t + * struct + * + * @return the <code>SOAPFault</code> object in this <code>SOAPBody</code> + * object + */ +AXIS2_EXTERN axiom_soap_fault_t *AXIS2_CALL +axiom_soap_body_get_fault( + axiom_soap_body_t * soap_body, + const axutil_env_t * env) +{ + if(soap_body->soap_fault) + { + return soap_body->soap_fault; + } + else if(soap_body->soap_builder) + { + while(!(soap_body->soap_fault) && !(axiom_node_is_complete(soap_body->om_ele_node, env))) + { + int status = AXIS2_SUCCESS; + status = axiom_soap_builder_next(soap_body->soap_builder, env); + if(status == AXIS2_FAILURE) + { + return NULL; + } + } + if(soap_body->soap_fault) + { + soap_body->has_fault = AXIS2_TRUE; + return soap_body->soap_fault; + } + } + return NULL; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_soap_body_get_base_node( + axiom_soap_body_t * soap_body, + const axutil_env_t * env) +{ + return soap_body->om_ele_node; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_body_set_base_node( + axiom_soap_body_t * soap_body, + const axutil_env_t * env, + axiom_node_t * node) +{ + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + soap_body->om_ele_node = node; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_body_set_builder( + axiom_soap_body_t * soap_body, + const axutil_env_t * env, + axiom_soap_builder_t * builder) +{ + AXIS2_PARAM_CHECK(env->error, builder, AXIS2_FAILURE); + + soap_body->soap_builder = builder; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_soap_builder_t *AXIS2_CALL +axiom_soap_body_get_builder( + axiom_soap_body_t * soap_body, + const axutil_env_t * env) +{ + if(!soap_body) + { + return NULL; + } + return soap_body->soap_builder; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_body_build( + axiom_soap_body_t * soap_body, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + axiom_node_t *xop_node = NULL; + axis2_bool_t is_replaced = AXIS2_FALSE; + axiom_element_t *xop_element = NULL; + + if(soap_body->om_ele_node && soap_body->soap_builder) + { + xop_node + = axiom_util_get_node_by_local_name(env, soap_body->om_ele_node, AXIS2_XOP_INCLUDE); + + if(xop_node) + { + xop_element = (axiom_element_t *)axiom_node_get_data_element(xop_node, env); + if(xop_element) + { + is_replaced = axiom_soap_builder_replace_xop(soap_body->soap_builder, env, + xop_node, xop_element); + } + } + + while(axiom_node_is_complete(soap_body->om_ele_node, env) != AXIS2_TRUE) + { + status = axiom_soap_builder_next(soap_body->soap_builder, env); + if(status == AXIS2_FAILURE) + { + return AXIS2_FAILURE; + } + } + } + return AXIS2_SUCCESS; +} + +/** + This is an internal function + + */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_body_set_fault( + axiom_soap_body_t * soap_body, + const axutil_env_t * env, + axiom_soap_fault_t * soap_fault) +{ + AXIS2_PARAM_CHECK(env->error, soap_fault, AXIS2_FAILURE); + if(soap_body->soap_fault) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_ONLY_ONE_SOAP_FAULT_ALLOWED_IN_BODY, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + else + { + soap_body->soap_fault = soap_fault; + soap_body->has_fault = AXIS2_TRUE; + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_body_add_child( + axiom_soap_body_t * soap_body, + const axutil_env_t * env, + axiom_node_t * child) +{ + AXIS2_PARAM_CHECK(env->error, child, AXIS2_FAILURE); + + if(soap_body->om_ele_node) + { + return axiom_node_add_child(soap_body->om_ele_node, env, child); + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN int AXIS2_CALL +axiom_soap_body_get_soap_version( + axiom_soap_body_t * soap_body, + const axutil_env_t * env) +{ + axiom_element_t *body_ele = NULL; + axiom_namespace_t *om_ns = NULL; + axis2_char_t *uri = NULL; + + if(!soap_body->om_ele_node) + { + return AXIS2_FAILURE; + } + body_ele = axiom_node_get_data_element(soap_body->om_ele_node, env); + if(!body_ele) + { + return AXIS2_FAILURE; + } + om_ns = axiom_element_get_namespace(body_ele, env, soap_body->om_ele_node); + if(!om_ns) + { + return AXIS2_FAILURE; + } + uri = axiom_namespace_get_uri(om_ns, env); + if(uri) + { + if(axutil_strcmp(uri, AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI) == 0) + { + return AXIOM_SOAP11; + } + else if(axutil_strcmp(uri, AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI) == 0) + { + return AXIOM_SOAP12; + } + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_body_convert_fault_to_soap11( + axiom_soap_body_t * soap_body, + const axutil_env_t * env) +{ + if(soap_body) + { + axiom_soap_fault_t *soap_fault = NULL; + if(axiom_soap_body_has_fault(soap_body, env)) + { + soap_fault = axiom_soap_body_get_fault(soap_body, env); + if(soap_fault) + { + axiom_soap_fault_code_t *fault_code = NULL; + axiom_soap_fault_reason_t *fault_reason = NULL; + axiom_soap_fault_detail_t *fault_detail = NULL; + axiom_soap_fault_role_t *fault_role = NULL; + fault_code = axiom_soap_fault_get_code(soap_fault, env); + if(fault_code) + { + axiom_node_t *fault_code_om_node = NULL; + axiom_element_t *fault_code_om_ele = NULL; + axiom_node_t *fault_value_om_node = NULL; + axiom_element_t *fault_value_om_ele = NULL; + axiom_soap_fault_value_t *fault_value = NULL; + axis2_char_t *text = NULL; + + fault_code_om_node = axiom_soap_fault_code_get_base_node(fault_code, env); + if(fault_code_om_node) + { + fault_code_om_ele = (axiom_element_t *)axiom_node_get_data_element( + fault_code_om_node, env); + if(fault_code_om_ele) + { + axiom_element_set_localname(fault_code_om_ele, env, + AXIOM_SOAP11_SOAP_FAULT_CODE_LOCAL_NAME); + + fault_value = axiom_soap_fault_code_get_value(fault_code, env); + + if(fault_value) + { + fault_value_om_node = axiom_soap_fault_value_get_base_node( + fault_value, env); + if(fault_value_om_node) + { + fault_value_om_ele + = (axiom_element_t *)axiom_node_get_data_element( + fault_value_om_node, env); + if(fault_value_om_ele) + { + text = axiom_element_get_text(fault_value_om_ele, env, + fault_value_om_node); + if(text) + { + axiom_element_set_text(fault_code_om_ele, env, text, + fault_code_om_node); + } + } + axiom_node_free_tree(fault_value_om_node, env); + axiom_soap_fault_value_set_base_node(fault_value, env, NULL); + } + } + } + } + } + fault_reason = axiom_soap_fault_get_reason(soap_fault, env); + if(fault_reason) + { + axiom_node_t *fault_reason_om_node = NULL; + axiom_element_t *fault_reason_om_ele = NULL; + axiom_node_t *fault_text_om_node = NULL; + axiom_element_t *fault_text_om_ele = NULL; + axiom_soap_fault_text_t *fault_text = NULL; + axis2_char_t *text = NULL; + + fault_reason_om_node = axiom_soap_fault_reason_get_base_node(fault_reason, env); + if(fault_reason_om_node) + { + fault_reason_om_ele = (axiom_element_t *)axiom_node_get_data_element( + fault_reason_om_node, env); + + if(fault_reason_om_ele) + { + + axiom_element_set_localname(fault_reason_om_ele, env, + AXIOM_SOAP11_SOAP_FAULT_STRING_LOCAL_NAME); + + fault_text = axiom_soap_fault_reason_get_first_soap_fault_text( + fault_reason, env); + if(fault_text) + { + fault_text_om_node = axiom_soap_fault_text_get_base_node( + fault_text, env); + if(fault_text_om_node) + { + fault_text_om_ele + = (axiom_element_t *)axiom_node_get_data_element( + fault_text_om_node, env); + if(fault_text_om_ele) + { + text = axiom_element_get_text(fault_text_om_ele, env, + fault_text_om_node); + if(text) + { + axiom_element_set_text(fault_reason_om_ele, env, text, + fault_reason_om_node); + } + } + axiom_node_free_tree(fault_text_om_node, env); + axiom_soap_fault_text_set_base_node(fault_text, env, NULL); + } + } + } + } + } + + fault_role = axiom_soap_fault_get_role(soap_fault, env); + if(fault_role) + { + axiom_node_t *fault_role_om_node = NULL; + axiom_element_t *fault_role_om_ele = NULL; + + fault_role_om_node = axiom_soap_fault_role_get_base_node(fault_role, env); + if(fault_role_om_node) + { + fault_role_om_ele = (axiom_element_t *)axiom_node_get_data_element( + fault_role_om_node, env); + if(fault_role_om_ele) + { + axiom_element_set_localname(fault_role_om_ele, env, + AXIOM_SOAP11_SOAP_FAULT_ACTOR_LOCAL_NAME); + } + } + } + + fault_detail = axiom_soap_fault_get_detail(soap_fault, env); + if(fault_detail) + { + axiom_node_t *fault_detail_om_node = NULL; + axiom_element_t *fault_detail_om_ele = NULL; + fault_detail_om_node = axiom_soap_fault_detail_get_base_node(fault_detail, env); + if(fault_detail_om_node) + { + fault_detail_om_ele = (axiom_element_t *)axiom_node_get_data_element( + fault_detail_om_node, env); + if(fault_detail_om_ele) + { + axiom_element_set_localname(fault_detail_om_ele, env, + AXIOM_SOAP11_SOAP_FAULT_DETAIL_LOCAL_NAME); + } + } + } + } + } + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_body_process_attachments( + axiom_soap_body_t * soap_body, + const axutil_env_t * env, + void *user_pram, + axis2_char_t *callback_name) +{ + axis2_status_t status = AXIS2_FAILURE; + + status = axiom_soap_builder_create_attachments(soap_body->soap_builder, env, user_pram, + callback_name); + + if(status == AXIS2_FAILURE) + { + return status; + } + else + { + return axiom_soap_body_build(soap_body, env); + } +} + + diff --git a/axiom/src/soap/soap_builder.c b/axiom/src/soap/soap_builder.c new file mode 100644 index 0000000..6960c03 --- /dev/null +++ b/axiom/src/soap/soap_builder.c @@ -0,0 +1,1206 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_builder.h> +#include "_axiom_soap_envelope.h" +#include "_axiom_soap_header.h" +#include "axiom_soap11_builder_helper.h" +#include "axiom_soap12_builder_helper.h" +#include <axiom_soap_const.h> +#include "_axiom_soap_body.h" +#include "_axiom_soap_header_block.h" +#include <axiom_stax_builder_internal.h> +#include "_axiom_soap_fault.h" +#include <axutil_http_chunked_stream.h> + +static axis2_status_t +axiom_soap_builder_construct_node( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env, + axiom_node_t * om_element_node); + +static axis2_status_t +axiom_soap_builder_identify_soap_version( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env, + const axis2_char_t * soap_version_uri_from_transport); + +static axis2_status_t +axiom_soap_builder_parse_headers( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env); + +static axis2_status_t +axiom_soap_builder_process_namespace_data( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env, + axiom_node_t * om_node); + +static axis2_status_t +axiom_soap_builder_construct_soap_header( + axiom_soap_builder_t *soap_builder, + const axutil_env_t *env, + axiom_node_t *om_node); + +static axis2_status_t +axiom_soap_builder_construct_soap_body( + axiom_soap_builder_t *soap_builder, + const axutil_env_t *env, + axiom_node_t *om_node); + +static axis2_status_t +axiom_soap_builder_construct_soap_fault( + axiom_soap_builder_t *soap_builder, + const axutil_env_t *env, + axiom_node_t *om_node); + +static axis2_status_t +axiom_soap_builder_construct_xop_include( + axiom_soap_builder_t *soap_builder, + const axutil_env_t *env, + axiom_node_t *om_element_node); + +struct axiom_soap_builder +{ + axiom_stax_builder_t *om_builder; + + axiom_soap_envelope_t *soap_envelope; + + axis2_bool_t header_present; + + axis2_bool_t body_present; + + int element_level; + + axis2_bool_t processing_fault; + + axis2_bool_t processing_detail_elements; + + axis2_char_t *sender_fault_code; + + axis2_char_t *receiver_fault_code; + + axis2_bool_t processing_mandatory_fault_elements; + + void *builder_helper; + + axiom_namespace_t *envelope_ns; + + int soap_version; + + int last_node_status; + + axis2_bool_t done; + + axutil_hash_t *mime_body_parts; + + axiom_mime_parser_t *mime_parser; + + AXIS2_READ_INPUT_CALLBACK callback; + + void *callback_ctx; + +}; + +typedef enum axis2_builder_last_node_states +{ + AXIS2_BUILDER_LAST_NODE_NULL = 0, + AXIS2_BUILDER_LAST_NODE_NOT_NULL +} axis2_builder_last_node_states; + +#define AXIS2_MAX_EVENT 100 + +AXIS2_EXTERN axiom_soap_builder_t *AXIS2_CALL +axiom_soap_builder_create( + const axutil_env_t * env, + axiom_stax_builder_t * stax_builder, + const axis2_char_t * soap_version) +{ + axiom_soap_builder_t *soap_builder = NULL; + axis2_status_t status = AXIS2_SUCCESS; + + AXIS2_PARAM_CHECK(env->error, stax_builder, NULL); + + soap_builder = (axiom_soap_builder_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_soap_builder_t)); + + if(soap_builder == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + soap_builder->done = AXIS2_FALSE; + soap_builder->body_present = AXIS2_FALSE; + soap_builder->builder_helper = NULL; + soap_builder->element_level = 0; + soap_builder->header_present = AXIS2_FALSE; + soap_builder->processing_detail_elements = AXIS2_FALSE; + soap_builder->processing_fault = AXIS2_FALSE; + soap_builder->processing_mandatory_fault_elements = AXIS2_FALSE; + soap_builder->receiver_fault_code = NULL; + soap_builder->sender_fault_code = NULL; + soap_builder->soap_version = AXIOM_SOAP12; + soap_builder->last_node_status = -1; + soap_builder->envelope_ns = NULL; + soap_builder->soap_envelope = NULL; + soap_builder->mime_body_parts = NULL; + soap_builder->om_builder = stax_builder; + soap_builder->mime_parser = NULL; + soap_builder->callback = NULL; + soap_builder->callback_ctx = NULL; + + status = axiom_soap_builder_identify_soap_version(soap_builder, env, soap_version); + if(status == AXIS2_FAILURE) + { + axiom_soap_builder_free(soap_builder, env); + return NULL; + } + status = axiom_soap_builder_parse_headers(soap_builder, env); + if(status == AXIS2_FAILURE) + { + axiom_soap_builder_free(soap_builder, env); + return NULL; + } + return soap_builder; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_builder_free( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env) +{ + if(!soap_builder) + { + return; + } + if(soap_builder->builder_helper) + { + if(soap_builder->soap_version == AXIOM_SOAP11 && soap_builder->builder_helper) + { + axiom_soap11_builder_helper_free( + (axiom_soap11_builder_helper_t *)(soap_builder->builder_helper), env); + soap_builder->builder_helper = NULL; + } + else if(soap_builder->soap_version == AXIOM_SOAP12 && soap_builder->builder_helper) + { + axiom_soap12_builder_helper_free( + (axiom_soap12_builder_helper_t *)(soap_builder->builder_helper), env); + soap_builder->builder_helper = NULL; + } + } + + if(soap_builder->om_builder) + { + axiom_stax_builder_free(soap_builder->om_builder, env); + soap_builder->om_builder = NULL; + } + + if(soap_builder->mime_body_parts) + { + axutil_hash_index_t *hi = NULL; + void *val = NULL; + const void *key = NULL; + for(hi = axutil_hash_first(soap_builder->mime_body_parts, env); hi; hi = axutil_hash_next( + env, hi)) + { + axutil_hash_this(hi, &key, NULL, &val); + + if(key) + { + AXIS2_FREE(env->allocator, (char *)key); + } + + val = NULL; + key = NULL; + } + + axutil_hash_free(soap_builder->mime_body_parts, env); + soap_builder->mime_body_parts = NULL; + } + + if(soap_builder->mime_parser) + { + axiom_mime_parser_free(soap_builder->mime_parser, env); + soap_builder->mime_parser = NULL; + } + + if(soap_builder->callback_ctx) + { + axis2_callback_info_t *callback_info = NULL; + + callback_info = (axis2_callback_info_t *)(soap_builder->callback_ctx); + if(callback_info) + { + if(callback_info->chunked_stream) + { + axutil_http_chunked_stream_free(callback_info->chunked_stream, env); + callback_info->chunked_stream = NULL; + } + + AXIS2_FREE(env->allocator, callback_info); + callback_info = NULL; + soap_builder->callback_ctx = NULL; + } + } + + if(soap_builder) + { + AXIS2_FREE(env->allocator, soap_builder); + soap_builder = NULL; + } + + return; +} + +AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL +axiom_soap_builder_get_soap_envelope( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + + if(!soap_builder) + { + return NULL; + } + if(!(soap_builder->om_builder)) + { + return NULL; + } + while(!(soap_builder->soap_envelope) && !axiom_stax_builder_is_complete( + soap_builder->om_builder, env)) + { + status = axiom_soap_builder_next(soap_builder, env); + if(status == AXIS2_FAILURE) + { + break; + } + } + + return soap_builder->soap_envelope; +} + +AXIS2_EXTERN axiom_document_t *AXIS2_CALL axiom_soap_builder_get_document( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env) +{ + if (!soap_builder) + { + return NULL; + } + if (soap_builder->om_builder) + { + return axiom_stax_builder_get_document(soap_builder->om_builder, env); + } + else + return NULL; +} + +/** + * Builds next element of the OM structure + * @param builder pointer to the SOAP Builder struct + * @param env Environment. MUST NOT be NULL + * @return AXIS2_SUCCESS if the next element is present else AXIS2_FAILURE + */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_builder_next( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env) +{ + int current_event = AXIS2_MAX_EVENT; + int status = AXIS2_SUCCESS; + + if((!soap_builder) || (soap_builder->done) || (!soap_builder->om_builder)) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Invalid soap builder"); + return AXIS2_FAILURE; + } + + /* Get the status of previous node before building next node. We need the previous state of the + * node to identify very first element, which is SOAP Envelope. If last_node_status is + * AXIS2_BUILDER_LAST_NODE_NULL, then it means next node is SOAP Envelope + */ + if(axiom_stax_builder_get_lastnode(soap_builder->om_builder, env)) + { + soap_builder->last_node_status = AXIS2_BUILDER_LAST_NODE_NOT_NULL; + } + else + { + soap_builder->last_node_status = AXIS2_BUILDER_LAST_NODE_NULL; + } + + current_event = axiom_stax_builder_next_with_token(soap_builder->om_builder, env); + if(current_event == AXIOM_XML_READER_START_ELEMENT + || current_event == AXIOM_XML_READER_EMPTY_ELEMENT) + { + axiom_node_t *current_node = axiom_stax_builder_get_lastnode(soap_builder->om_builder, env); + if(current_node) + { + status = axiom_soap_builder_construct_node(soap_builder, env, current_node); + } + else + { + /* there is an error. So, don't continue building it */ + soap_builder->done = AXIS2_TRUE; + status = AXIS2_FAILURE; + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error occurred when building node"); + } + } + else if(current_event == -1) + { + /* there is an error. So, don't continue building it */ + soap_builder->done = AXIS2_TRUE; + status = AXIS2_FAILURE; + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error occurred when building node"); + } + + /* for any other event types, return AXIS2_SUCCESS as the return value. */ + + return status; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_soap_builder_get_document_element( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env) +{ + axiom_node_t *document_node = NULL; + if(soap_builder->soap_envelope) + { + document_node = axiom_soap_envelope_get_base_node(soap_builder->soap_envelope, env); + } + + return document_node; +} + +static axis2_status_t +axiom_soap_builder_construct_node( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env, + axiom_node_t * om_element_node) +{ + axiom_element_t *om_element = NULL; + const axis2_char_t *ele_localname = NULL; + int element_level = 0; + int status = AXIS2_SUCCESS; + axiom_node_t *parent = NULL; + + /* get OM element struct from node */ + om_element = (axiom_element_t *)axiom_node_get_data_element(om_element_node, env); + if(!om_element) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot construct node. Invalid element"); + return AXIS2_FAILURE; + } + + /* get element local name */ + ele_localname = axiom_element_get_localname(om_element, env); + if(!ele_localname) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot construct node. Invalid element name"); + return AXIS2_FAILURE; + } + + parent = axiom_node_get_parent(om_element_node, env); + if(!parent) + { + /* parent node doesn't exist means, this should be SOAP Envelope */ + if(soap_builder->last_node_status != AXIS2_BUILDER_LAST_NODE_NULL) + { + /* this means, there are two elements in the first level */ + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_SOAP_MESSAGE_FIRST_ELEMENT_MUST_CONTAIN_LOCAL_NAME, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "Soap message can contain only one SOAP Envelope as the top level element"); + return AXIS2_FAILURE; + } + + if(axutil_strcasecmp(ele_localname, AXIOM_SOAP_ENVELOPE_LOCAL_NAME) != 0) + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_SOAP_MESSAGE_FIRST_ELEMENT_MUST_CONTAIN_LOCAL_NAME, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "SOAP message first element must be Envelope"); + return AXIS2_FAILURE; + } + + /** create a null soap envelope struct */ + soap_builder->soap_envelope = axiom_soap_envelope_create_null(env); + if(!soap_builder->soap_envelope) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Unable to create SOAP Envelope"); + return AXIS2_FAILURE; + } + + /** wrap this OM node in it */ + axiom_soap_envelope_set_base_node(soap_builder->soap_envelope, env, om_element_node); + axiom_soap_envelope_set_builder(soap_builder->soap_envelope, env, soap_builder); + status = axiom_soap_builder_process_namespace_data(soap_builder, env, om_element_node); + if(status != AXIS2_SUCCESS) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "SOAP Envelope is having invalid namespace"); + } + + return status; + } + + /** a parent node exist , so not soap envelope. Can be either header/body/children of them */ + + /* get element level of this OM element. Envelope will be in element_level 1. Body and Header + * will be in element level 2. SOAP fault will be child of Body, so it will be in level 3*/ + element_level = axiom_stax_builder_get_element_level(soap_builder->om_builder, env); + if(axiom_stax_builder_get_current_event(soap_builder->om_builder, env) + == AXIOM_XML_READER_EMPTY_ELEMENT) + { + /* if it is an empty element, increase the element level. This is because the element level + * is incremented by STAX builder only if <element> tag is identified. It will not be + * incremented if <element/> tag is seen. But for our logic, even empty element should be + * considered as full element. so, <element/> = <element> </element>. */ + ++element_level; + } + + if(element_level == 2) + { + /* At this level, we can only have soap:Header or soap:Body */ + status = axiom_soap_builder_process_namespace_data(soap_builder, env, om_element_node); + if(status != AXIS2_SUCCESS) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "invalid SOAP namespace"); + return AXIS2_FAILURE; + } + + if(axutil_strcmp(ele_localname, AXIOM_SOAP_HEADER_LOCAL_NAME) == 0) + { + /* this is the soap header element */ + status = axiom_soap_builder_construct_soap_header(soap_builder, env, om_element_node); + } + else if(axutil_strcmp(ele_localname, AXIOM_SOAP_BODY_LOCAL_NAME) == 0) + { + /* This is the SOAP Body element */ + status = axiom_soap_builder_construct_soap_body(soap_builder, env, om_element_node); + } + else + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_SOAP_BUILDER_ENVELOPE_CAN_HAVE_ONLY_HEADER_AND_BODY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "SOAP builder found a child element other than header or body in envelope element"); + return AXIS2_FAILURE; + } + } + else if(element_level == 3) + { + axiom_element_t *parent_ele = NULL; + axis2_char_t *parent_localname = NULL; + + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent, env); + if(parent_ele) + { + parent_localname = axiom_element_get_localname(parent_ele, env); + } + + if(!parent_localname) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot identify parent element local name"); + return AXIS2_FAILURE; + } + + if(axutil_strcasecmp(parent_localname, AXIOM_SOAP_HEADER_LOCAL_NAME) == 0) + { + axiom_soap_header_block_t *header_block = NULL; + axiom_soap_header_t *soap_header = NULL; + + soap_header = axiom_soap_envelope_get_header(soap_builder->soap_envelope, env); + if(!soap_header) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot get SOAP Header from OM Envelope"); + return AXIS2_FAILURE; + } + + header_block = axiom_soap_header_block_create(env); + if(!header_block) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot create SOAP Header block"); + return AXIS2_FAILURE; + } + + axiom_soap_header_block_set_base_node(header_block, env, om_element_node); + axiom_soap_header_set_header_block(soap_header, env, header_block); + axiom_soap_header_block_set_soap_version(header_block, env, soap_builder->soap_version); + } + else if(axutil_strcasecmp(parent_localname, AXIOM_SOAP_BODY_LOCAL_NAME) == 0) + { + /* if the node is <xop:Include> or MTOM message */ + if(axutil_strcmp(ele_localname, AXIS2_XOP_INCLUDE) == 0) + { + return axiom_soap_builder_construct_xop_include(soap_builder, env, om_element_node); + } + + if(axutil_strcasecmp(ele_localname, AXIOM_SOAP_BODY_FAULT_LOCAL_NAME) == 0) + { + return axiom_soap_builder_construct_soap_fault(soap_builder, env, om_element_node); + } + + /* We don't need to process any other children of SOAP Body. */ + } + else + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_SOAP_BUILDER_ENVELOPE_CAN_HAVE_ONLY_HEADER_AND_BODY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "SOAP builder found a child element other than header or body in envelope element"); + return AXIS2_FAILURE; + } + + return AXIS2_SUCCESS; + } + else if(element_level > 3) + { + if(soap_builder->processing_fault) + { + if(soap_builder->soap_version == AXIOM_SOAP11) + { + status = axiom_soap11_builder_helper_handle_event((axiom_soap11_builder_helper_t *) + soap_builder->builder_helper, env, om_element_node, element_level); + } + else if(soap_builder->soap_version == AXIOM_SOAP12) + { + status = axiom_soap12_builder_helper_handle_event((axiom_soap12_builder_helper_t *) + soap_builder->builder_helper, env, om_element_node, element_level); + } + else + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Unknown SOAP Version"); + status = AXIS2_FAILURE; + } + } + + /* if the node is <xop:Include> or MTOM message */ + else if(axutil_strcmp(ele_localname, AXIS2_XOP_INCLUDE) == 0) + { + return axiom_soap_builder_construct_xop_include(soap_builder, env, om_element_node); + } + + /* we don't need to consider any other elements at this level. */ + } + return status; +} + +static axis2_status_t +axiom_soap_builder_construct_soap_header( + axiom_soap_builder_t *soap_builder, + const axutil_env_t *env, + axiom_node_t *om_node) +{ + axiom_soap_header_t *soap_header = NULL; + if(soap_builder->header_present) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SOAP_BUILDER_MULTIPLE_HEADERS_ENCOUNTERED, + AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "SOAP builder encountered multiple headers"); + return AXIS2_FAILURE; + } + if(soap_builder->body_present) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SOAP_BUILDER_HEADER_BODY_WRONG_ORDER, + AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "SOAP builder encountered body element first and header next"); + return AXIS2_FAILURE; + } + + soap_builder->header_present = AXIS2_TRUE; + soap_header = axiom_soap_header_create(env); + if(!soap_header) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Unable to create SOAP Header"); + return AXIS2_FAILURE; + } + + axiom_soap_header_set_base_node(soap_header, env, om_node); + axiom_soap_envelope_set_header(soap_builder->soap_envelope, env, soap_header); + axiom_soap_header_set_builder(soap_header, env, soap_builder); + axiom_soap_header_set_soap_version(soap_header, env, soap_builder->soap_version); + + return AXIS2_SUCCESS; +} + +static axis2_status_t +axiom_soap_builder_construct_soap_body( + axiom_soap_builder_t *soap_builder, + const axutil_env_t *env, + axiom_node_t *om_node) +{ + axiom_soap_body_t *soap_body = NULL; + if(soap_builder->body_present) + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_SOAP_BUILDER_MULTIPLE_BODY_ELEMENTS_ENCOUNTERED, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "SOAP builder multiple body elements encountered"); + return AXIS2_FAILURE; + } + + soap_builder->body_present = AXIS2_TRUE; + soap_body = axiom_soap_body_create(env); + if(!soap_body) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Unable to create SOAP Body"); + return AXIS2_FAILURE; + } + + axiom_soap_body_set_base_node(soap_body, env, om_node); + axiom_soap_body_set_builder(soap_body, env, soap_builder); + axiom_soap_envelope_set_body(soap_builder->soap_envelope, env, soap_body); + + return AXIS2_SUCCESS; +} + +static axis2_status_t +axiom_soap_builder_construct_soap_fault( + axiom_soap_builder_t *soap_builder, + const axutil_env_t *env, + axiom_node_t *om_node) +{ + axiom_soap_body_t *soap_body = NULL; + axiom_soap_fault_t *soap_fault = NULL; + axiom_namespace_t *env_ns = NULL; + + env_ns = axiom_soap_envelope_get_namespace(soap_builder->soap_envelope, env); + if(!env_ns) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot get soap envelope namespace"); + return AXIS2_FAILURE; + } + + soap_body = axiom_soap_envelope_get_body(soap_builder->soap_envelope, env); + if(!soap_body) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot get soap body from OM Envelope"); + return AXIS2_FAILURE; + } + + soap_fault = axiom_soap_fault_create(env); + if(!soap_fault) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot create SOAP Fault structure"); + return AXIS2_FAILURE; + } + + axiom_soap_fault_set_base_node(soap_fault, env, om_node); + axiom_soap_body_set_fault(soap_body, env, soap_fault); + axiom_soap_fault_set_builder(soap_fault, env, soap_builder); + soap_builder->processing_fault = AXIS2_TRUE; + soap_builder->processing_mandatory_fault_elements = AXIS2_TRUE; + + if(axutil_strcmp(AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI, + axiom_namespace_get_uri(env_ns, env)) == 0) + { + soap_builder->builder_helper = axiom_soap12_builder_helper_create(env, soap_builder); + } + else if(axutil_strcmp(AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, + axiom_namespace_get_uri(env_ns, env)) == 0) + { + soap_builder->builder_helper = axiom_soap11_builder_helper_create( + env, soap_builder,soap_builder->om_builder); + } + + if(!soap_builder->builder_helper) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot create soap builder helper"); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +static axis2_status_t +axiom_soap_builder_construct_xop_include( + axiom_soap_builder_t *soap_builder, + const axutil_env_t *env, + axiom_node_t *om_element_node) +{ + axiom_namespace_t *ns = NULL; + axis2_char_t *uri = NULL; + axiom_element_t *om_element = NULL; + axutil_qname_t *qname = NULL; + axis2_char_t *id = NULL; + + om_element = (axiom_element_t *)axiom_node_get_data_element(om_element_node, env); + ns = axiom_element_get_namespace(om_element, env, om_element_node); + if(!ns) + { + /* this is not a xop:include element. so, we can safely return success */ + return AXIS2_SUCCESS; + } + + uri = axiom_namespace_get_uri(ns, env); + if((!uri) || (axutil_strcmp(uri, AXIS2_XOP_NAMESPACE_URI) != 0)) + { + /* this is not a xop:include element. so, we can safely return success */ + return AXIS2_SUCCESS; + } + + qname = axutil_qname_create(env, "href", NULL, NULL); + if(!qname) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot create qname with value href"); + return AXIS2_FAILURE; + } + + id = axiom_element_get_attribute_value(om_element, env, qname); + axutil_qname_free(qname, env); + if(!id) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot get href ID of the xop:include element"); + return AXIS2_FAILURE; + } + + if(!axutil_strstr(id, "cid:")) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "ID of xop:include doesn't include 'cid:' part"); + return AXIS2_FAILURE; + } + + /* everything looks fine, so recursively build the OM tree, so that we can get data handlers */ + while(!axiom_node_is_complete(om_element_node, env)) + { + axiom_stax_builder_next_with_token(soap_builder->om_builder, env); + } + + if(soap_builder->mime_body_parts) + { + axiom_data_handler_t *data_handler = NULL; + axis2_char_t *id_decoded = NULL; + axiom_text_t *data_text = NULL; + axiom_node_t *data_om_node = NULL; + axiom_node_t *parent = NULL; + + /* Get the value of href id, after "cid:" */ + id += 4; + id_decoded = axutil_strdup(env, id); + axutil_url_decode(env, id_decoded, id_decoded); + + /* Find the data handler of given xop:include */ + data_handler = (axiom_data_handler_t *)axutil_hash_get( + soap_builder-> mime_body_parts, (void *)id_decoded, AXIS2_HASH_KEY_STRING); + if(!data_handler) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "Cannot find data handler corresponding to id %s", id_decoded); + AXIS2_FREE(env->allocator, id_decoded); + return AXIS2_FAILURE; + } + + /* remove the <xop:Include> element, and add the data handler as the child of + * xop:include's parent */ + parent = axiom_node_get_parent(om_element_node, env); + axiom_node_free_tree(om_element_node, env); + data_text = axiom_text_create_with_data_handler(env, parent, data_handler, &data_om_node); + axiom_text_set_content_id(data_text, env, id_decoded); + axiom_stax_builder_set_lastnode(soap_builder->om_builder,env, parent); + AXIS2_FREE(env->allocator, id_decoded); + } + else + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot find mime_body_part in soap builder"); + return AXIS2_FAILURE; + } + + return AXIS2_SUCCESS; +} + +/* check whether the namespace of given node is either SOAP11 or SOAP12 namespace */ +static axis2_status_t +axiom_soap_builder_process_namespace_data( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env, + axiom_node_t * om_node) +{ + axiom_element_t *om_ele = NULL; + axiom_namespace_t *om_ns = NULL; + + om_ele = (axiom_element_t *)axiom_node_get_data_element(om_node, env); + om_ns = axiom_element_get_namespace(om_ele, env, om_node); + if(om_ns) + { + axis2_char_t *ns_uri = NULL; + ns_uri = axiom_namespace_get_uri(om_ns, env); + if(ns_uri) + { + if((axutil_strcmp(ns_uri, AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI) == 0) + || (axutil_strcmp(ns_uri, AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI) == 0)) + { + return AXIS2_SUCCESS; + } + } + } + + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_SOAP_NAMESPACE_URI, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Invalid SOAP Namespace URI"); + return AXIS2_FAILURE; +} + +static axis2_status_t +axiom_soap_builder_identify_soap_version( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env, + const axis2_char_t * soap_version_uri_from_transport) +{ + axiom_namespace_t *om_ns = NULL; + axiom_node_t *envelope_node = NULL; + axiom_element_t *om_ele = NULL; + axis2_char_t *ns_uri = NULL; + + AXIS2_PARAM_CHECK(env->error, soap_version_uri_from_transport, AXIS2_FAILURE); + if(!soap_builder) + { + return AXIS2_FAILURE; + } + soap_builder->soap_envelope = axiom_soap_builder_get_soap_envelope(soap_builder, env); + + if(soap_builder->soap_envelope == NULL) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SOAP_MESSAGE_DOES_NOT_CONTAIN_AN_ENVELOPE, + AXIS2_FAILURE); + AXIS2_LOG_CRITICAL(env->log, AXIS2_LOG_SI, + "SOAP message does not have a SOAP envelope element "); + return AXIS2_FAILURE; + } + + envelope_node = axiom_soap_envelope_get_base_node(soap_builder->soap_envelope, env); + + if(!envelope_node) + { + return AXIS2_FAILURE; + } + om_ele = (axiom_element_t *)axiom_node_get_data_element(envelope_node, env); + if(!om_ele) + { + return AXIS2_FAILURE; + } + om_ns = axiom_element_get_namespace(om_ele, env, envelope_node); + if(!om_ns) + { + return AXIS2_FAILURE; + } + ns_uri = axiom_namespace_get_uri(om_ns, env); + + if(ns_uri) + { + if(soap_version_uri_from_transport + && axutil_strcmp(soap_version_uri_from_transport, ns_uri) != 0) + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_TRANSPORT_LEVEL_INFORMATION_DOES_NOT_MATCH_WITH_SOAP, AXIS2_FAILURE); + + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "AXIS2_ERROR_TRANSPORT_LEVEL_INFORMATION_DOES_NOT_MATCH_WITH_SOAP"); + return AXIS2_FAILURE; + } + if(axutil_strcmp(AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, ns_uri) == 0) + { + soap_builder->soap_version = AXIOM_SOAP11; + + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Identified soap version is soap11"); + + axiom_soap_envelope_set_soap_version_internal(soap_builder-> soap_envelope, env, + soap_builder-> soap_version); + + return AXIS2_SUCCESS; + } + else if(axutil_strcmp(AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI, ns_uri) == 0) + { + soap_builder->soap_version = AXIOM_SOAP12; + + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "identified soap version is soap12"); + + axiom_soap_envelope_set_soap_version_internal(soap_builder-> soap_envelope, env, + soap_builder-> soap_version); + + return AXIS2_SUCCESS; + } + } + return AXIS2_FAILURE; +} + +static axis2_status_t +axiom_soap_builder_parse_headers( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env) +{ + axiom_node_t *om_node = NULL; + axiom_soap_header_t *soap_header = NULL; + int status = AXIS2_SUCCESS; + if(!soap_builder) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Soap Builder is NULL"); + return AXIS2_FAILURE; + } + if(!soap_builder->soap_envelope) + { + return AXIS2_FAILURE; + } + soap_header = axiom_soap_envelope_get_header(soap_builder->soap_envelope, env); + + if(soap_header) + { + om_node = axiom_soap_header_get_base_node(soap_header, env); + if(om_node) + { + while(!axiom_node_is_complete(om_node, env)) + { + status = axiom_soap_builder_next(soap_builder, env); + if(status == AXIS2_FAILURE) + return AXIS2_FAILURE; + } + /*HACK: to fix AXIS2C-129 - Samisa */ + /* + axiom_stax_builder_set_element_level( + soap_builder->om_builder, env, 1); + */ + } + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_builder_set_bool_processing_mandatory_fault_elements( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env, + axis2_bool_t value) +{ + soap_builder->processing_mandatory_fault_elements = value; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_builder_set_processing_detail_elements( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env, + axis2_bool_t value) +{ + soap_builder->processing_detail_elements = value; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_soap_builder_is_processing_detail_elements( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env) +{ + return soap_builder->processing_detail_elements; +} + +AXIS2_EXTERN int AXIS2_CALL +axiom_soap_builder_get_soap_version( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env) +{ + return soap_builder->soap_version; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_builder_set_mime_body_parts( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env, + axutil_hash_t * map) +{ + soap_builder->mime_body_parts = map; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axutil_hash_t *AXIS2_CALL +axiom_soap_builder_get_mime_body_parts( + axiom_soap_builder_t * builder, + const axutil_env_t * env) +{ + return builder->mime_body_parts; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_builder_set_mime_parser( + axiom_soap_builder_t * builder, + const axutil_env_t * env, + axiom_mime_parser_t *mime_parser) +{ + builder->mime_parser = mime_parser; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_builder_set_callback_function( + axiom_soap_builder_t * builder, + const axutil_env_t * env, + AXIS2_READ_INPUT_CALLBACK callback) +{ + builder->callback = callback; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_builder_set_callback_ctx( + axiom_soap_builder_t * builder, + const axutil_env_t * env, + void *callback_ctx) +{ + builder->callback_ctx = callback_ctx; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_builder_create_attachments( + axiom_soap_builder_t * builder, + const axutil_env_t * env, + void *user_param, + axis2_char_t *callback_name) +{ + axutil_hash_t *attachments_map = NULL; + axis2_char_t *mime_boundary = NULL; + + if(builder->mime_parser) + { + if(builder->callback_ctx) + { + mime_boundary = axiom_mime_parser_get_mime_boundary(builder->mime_parser, env); + + if(mime_boundary) + { + if(callback_name) + { + axiom_mime_parser_set_caching_callback_name(builder->mime_parser, env, + callback_name); + } + attachments_map = axiom_mime_parser_parse_for_attachments(builder->mime_parser, + env, builder->callback, builder->callback_ctx, mime_boundary, user_param); + + if(attachments_map) + { + builder->mime_body_parts = attachments_map; + return AXIS2_SUCCESS; + } + else + { + return AXIS2_FAILURE; + } + } + else + { + return AXIS2_FAILURE; + } + } + else + { + return AXIS2_FAILURE; + } + } + else + { + return AXIS2_FAILURE; + } +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_soap_builder_replace_xop( + axiom_soap_builder_t * builder, + const axutil_env_t * env, + axiom_node_t *om_element_node, + axiom_element_t *om_element) +{ + axiom_namespace_t *ns = NULL; + axis2_bool_t is_replaced = AXIS2_FALSE; + + ns = axiom_element_get_namespace(om_element, env, om_element_node); + if(ns) + { + axis2_char_t *uri = axiom_namespace_get_uri(ns, env); + if(uri) + { + if(axutil_strcmp(uri, AXIS2_XOP_NAMESPACE_URI) == 0) + { + axutil_qname_t *qname = NULL; + qname = axutil_qname_create(env, "href", NULL, NULL); + if(qname) + { + axis2_char_t *id = NULL; + id = axiom_element_get_attribute_value(om_element, env, qname); + if(id) + { + axis2_char_t *pos = NULL; + pos = axutil_strstr(id, "cid:"); + if(pos) + { + axiom_data_handler_t *data_handler = NULL; + id += 4; + + if(builder->mime_body_parts) + { + + axis2_char_t *id_decoded = NULL; + + id_decoded = axutil_strdup(env, id); + + axutil_url_decode(env, id_decoded, id_decoded); + + data_handler = (axiom_data_handler_t *)axutil_hash_get( + builder-> mime_body_parts, (void *)id_decoded, + AXIS2_HASH_KEY_STRING); + if(data_handler) + { + axiom_text_t *data_text = NULL; + axiom_node_t *data_om_node = NULL; + axiom_node_t *parent = NULL; + + parent = axiom_node_get_parent(om_element_node, env); + + /*remove the <xop:Include> element */ + axiom_node_free_tree(om_element_node, env); + + data_text = axiom_text_create_with_data_handler(env, parent, + data_handler, &data_om_node); + + axiom_text_set_content_id(data_text, env, id_decoded); + /*axiom_stax_builder_set_lastnode + (soap_builder->om_builder, env, + parent);*/ + is_replaced = AXIS2_TRUE; + } + if(id_decoded) + { + AXIS2_FREE(env->allocator, id_decoded); + } + } + } + } + } + axutil_qname_free(qname, env); + } + } + } + + return is_replaced; +} + +AXIS2_EXTERN axiom_stax_builder_t *AXIS2_CALL +axiom_soap_builder_get_om_builder( + axiom_soap_builder_t * soap_builder, + const axutil_env_t * env) +{ + if(!soap_builder) + { + return NULL; + } + return soap_builder->om_builder; +} + diff --git a/axiom/src/soap/soap_envelope.c b/axiom/src/soap/soap_envelope.c new file mode 100644 index 0000000..48e10f7 --- /dev/null +++ b/axiom/src/soap/soap_envelope.c @@ -0,0 +1,631 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_envelope.h" +#include <axiom_soap_body.h> +#include <axiom_soap_header.h> +#include <axiom_soap_header_block.h> +#include <axutil_hash.h> +#include <axiom_soap_const.h> +#include <axiom_soap_builder.h> +#include <axiom_soap_fault_code.h> +#include <axiom_soap_fault_reason.h> +#include <axiom_soap_fault_detail.h> +#include <axiom_soap_fault_role.h> +#include <axiom_soap_fault_value.h> +#include <axiom_soap_fault_text.h> +#include <axiom_namespace_internal.h> + +struct axiom_soap_envelope +{ + /* corresponding om element node */ + axiom_node_t *om_ele_node; + /* soap version */ + int soap_version; + /* soap header */ + axiom_soap_header_t *header; + /* soap body */ + axiom_soap_body_t *body; + /* pointer to soap builder */ + axiom_soap_builder_t *soap_builder; + int ref; +}; +static axis2_status_t +check_and_set_soap_version( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env, + axiom_namespace_t * ns); + +AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL +axiom_soap_envelope_create_null( + const axutil_env_t * env) +{ + axiom_soap_envelope_t *soap_envelope = NULL; + + soap_envelope = (axiom_soap_envelope_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_soap_envelope_t)); + if(!soap_envelope) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create a SOAP Envelope"); + return NULL; + } + soap_envelope->om_ele_node = NULL; + soap_envelope->soap_version = AXIOM_SOAP12; + soap_envelope->header = NULL; + soap_envelope->body = NULL; + soap_envelope->ref = 1; + soap_envelope->soap_builder = NULL; + + return soap_envelope; +} + +AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL +axiom_soap_envelope_create( + const axutil_env_t * env, + axiom_namespace_t * ns) +{ + axiom_soap_envelope_t *soap_envelope = NULL; + axiom_element_t *ele = NULL; + int status = AXIS2_SUCCESS; + + AXIS2_PARAM_CHECK(env->error, ns, NULL); + + soap_envelope = axiom_soap_envelope_create_null(env); + if(!soap_envelope) + { + return NULL; + } + status = check_and_set_soap_version(soap_envelope, env, ns); + if(status == AXIS2_FAILURE) + { + AXIS2_FREE(env->allocator, soap_envelope); + return NULL; + } + + ele = axiom_element_create(env, NULL, AXIOM_SOAP_ENVELOPE_LOCAL_NAME, ns, + &(soap_envelope->om_ele_node)); + if(!ele) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create a SOAP element"); + axiom_soap_envelope_free(soap_envelope, env); + return NULL; + } + return soap_envelope; +} + +AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL +axiom_soap_envelope_create_with_soap_version_prefix( + const axutil_env_t * env, + int soap_version, + const axis2_char_t * prefix) +{ + axiom_namespace_t *ns = NULL; + const axis2_char_t *ns_prefix = NULL; + const axis2_char_t *ns_uri = NULL; + + if(soap_version == AXIOM_SOAP11) + { + ns_uri = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI; + } + else if(soap_version == AXIOM_SOAP12) + { + ns_uri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI; + } + else + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_SOAP_VERSION, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Invalid SOAP version"); + return NULL; + } + if(!prefix || axutil_strcmp(prefix, "") == 0) + { + ns_prefix = AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX; + } + else + { + ns_prefix = prefix; + } + + ns = axiom_namespace_create(env, ns_uri, ns_prefix); + if(!ns) + return NULL; + return axiom_soap_envelope_create(env, ns); +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_envelope_free( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env) +{ + if(--(soap_envelope->ref) > 0) + { + return; + } + if(soap_envelope->header) + { + axiom_soap_header_free(soap_envelope->header, env); + } + if(soap_envelope->body) + { + axiom_soap_body_free(soap_envelope->body, env); + } + if(soap_envelope->om_ele_node) + { + if(soap_envelope->soap_builder) + { + axiom_soap_builder_free(soap_envelope->soap_builder, env); + soap_envelope->om_ele_node = NULL; + } + else + { + axiom_node_free_tree(soap_envelope->om_ele_node, env); + } + } + + AXIS2_FREE(env->allocator, soap_envelope); + return; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_soap_envelope_get_base_node( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env) +{ + return soap_envelope->om_ele_node; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_envelope_set_base_node( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env, + axiom_node_t * node) +{ + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + soap_envelope->om_ele_node = node; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN int AXIS2_CALL +axiom_soap_envelope_get_soap_version( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env) +{ + return soap_envelope->soap_version; +} + +/** this is an internal function */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_envelope_set_soap_version_internal( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env, + int soap_version) +{ + soap_envelope->soap_version = soap_version; + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_soap_header_t *AXIS2_CALL +axiom_soap_envelope_get_header( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + + if(soap_envelope->header) + { + return soap_envelope->header; + } + else if(soap_envelope->soap_builder) + { + while(!(soap_envelope->header) && !(soap_envelope->body) && !axiom_node_is_complete( + soap_envelope->om_ele_node, env)) + { + status = axiom_soap_builder_next(soap_envelope->soap_builder, env); + if(status == AXIS2_FAILURE) + { + break; + } + } + } + + return soap_envelope->header; +} + +AXIS2_EXTERN axiom_soap_header_block_t *AXIS2_CALL +axiom_soap_envelope_add_header( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env, + axis2_char_t * namespace_uri, + axis2_char_t * name) +{ + axiom_namespace_t *ns = NULL; + + if(!soap_envelope->header) + { + return NULL; + } + if(namespace_uri) + { + ns = axiom_namespace_create(env, namespace_uri, NULL); + } + + return axiom_soap_header_block_create_with_parent(env, name, ns, soap_envelope->header); +} + +AXIS2_EXTERN axiom_soap_body_t *AXIS2_CALL +axiom_soap_envelope_get_body( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + + if(soap_envelope->body) + { + return soap_envelope->body; + } + else if(soap_envelope->soap_builder) + { + while(!(soap_envelope->body) && !axiom_node_is_complete(soap_envelope->om_ele_node, env)) + { + status = axiom_soap_builder_next(soap_envelope->soap_builder, env); + if(status == AXIS2_FAILURE) + { + return NULL; + } + } + } + return soap_envelope->body; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_envelope_serialize( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env, + axiom_output_t * om_output, + axis2_bool_t cache) +{ + AXIS2_PARAM_CHECK(env->error, soap_envelope, AXIS2_FAILURE); + AXIS2_PARAM_CHECK(env->error, om_output, AXIS2_FAILURE); + + /* + if soap version is soap11 we modify the soap fault part. + This is done because the builder construct a soap12 fault all + the time. So when serializing if the soap version is soap11 + we should convert it back to soap11 fault + */ + if(soap_envelope->soap_version == AXIOM_SOAP11) + { + axiom_soap_body_t *soap_body = NULL; + soap_body = axiom_soap_envelope_get_body(soap_envelope, env); + axiom_soap_body_convert_fault_to_soap11(soap_body, env); + } + /* write the xml version and encoding + These should be set to om output before calling the serialize function + Otherwise default values will be written + */ + axiom_output_get_content_type(om_output, env); + return axiom_node_serialize(soap_envelope->om_ele_node, env, om_output); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_envelope_set_body( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env, + axiom_soap_body_t * body) +{ + + if(!(soap_envelope->body)) + { + soap_envelope->body = body; + } + else + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "trying to set a soap bedy to soap_envelope when a soap body alrady exists"); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_envelope_set_header( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env, + axiom_soap_header_t * header) +{ + + if(!(soap_envelope->header)) + { + soap_envelope->header = header; + } + else + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + " trying to set a soap header to soap_envelope when a soap header alrady exists"); + return AXIS2_FAILURE; + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_namespace_t *AXIS2_CALL +axiom_soap_envelope_get_namespace( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env) +{ + + if(soap_envelope->om_ele_node) + { + axiom_element_t *ele = NULL; + if(axiom_node_get_node_type(soap_envelope->om_ele_node, env) == AXIOM_ELEMENT) + { + ele = (axiom_element_t *)axiom_node_get_data_element(soap_envelope-> om_ele_node, env); + if(ele) + { + return axiom_element_get_namespace(ele, env, soap_envelope->om_ele_node); + } + } + } + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_envelope_set_builder( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env, + axiom_soap_builder_t * soap_builder) +{ + AXIS2_PARAM_CHECK(env->error, soap_builder, AXIS2_FAILURE); + soap_envelope->soap_builder = soap_builder; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_soap_builder_t *AXIS2_CALL +axiom_soap_envelope_get_builder( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env) +{ + if(!soap_envelope) + { + return NULL; + } + return soap_envelope->soap_builder; +} + +AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL +axiom_soap_envelope_create_default_soap_envelope( + const axutil_env_t * env, + int soap_version) +{ + axiom_soap_envelope_t *soap_envelope = NULL; + axiom_soap_header_t *soap_header = NULL; + axiom_soap_body_t *soap_body = NULL; + axiom_namespace_t *om_ns = NULL; + + if(soap_version == AXIOM_SOAP11) + { + om_ns = axiom_namespace_create(env, AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, + AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX); + if(!om_ns) + { + return NULL; + } + soap_envelope = axiom_soap_envelope_create(env, om_ns); + + soap_header = axiom_soap_header_create_with_parent(env, soap_envelope); + soap_body = axiom_soap_body_create_with_parent(env, soap_envelope); + soap_envelope->body = soap_body; + soap_envelope->header = soap_header; + return soap_envelope; + } + else if(soap_version == AXIOM_SOAP12) + { + om_ns = axiom_namespace_create(env, AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI, + AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX); + if(!om_ns) + { + return NULL; + } + soap_envelope = axiom_soap_envelope_create(env, om_ns); + + soap_header = axiom_soap_header_create_with_parent(env, soap_envelope); + soap_body = axiom_soap_body_create_with_parent(env, soap_envelope); + soap_envelope->body = soap_body; + soap_envelope->header = soap_header; + return soap_envelope; + } + + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_SOAP_VERSION, AXIS2_FAILURE); + return NULL; +} + +AXIS2_EXTERN axiom_soap_envelope_t *AXIS2_CALL +axiom_soap_envelope_create_default_soap_fault_envelope( + const axutil_env_t * env, + const axis2_char_t * code_value, + const axis2_char_t * reason_text, + const int soap_version, + axutil_array_list_t * sub_codes, + axiom_node_t * detail_node) +{ + axiom_soap_envelope_t *soap_envelope = NULL; + axiom_soap_body_t *soap_body = NULL; + axiom_soap_fault_t *fault = NULL; + + if(AXIOM_SOAP11 != soap_version && AXIOM_SOAP12 != soap_version) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_SOAP_VERSION, AXIS2_FAILURE); + return NULL; + } + + soap_envelope = axiom_soap_envelope_create_default_soap_envelope(env, soap_version); + if(!soap_envelope) + { + return NULL; + } + + soap_body = axiom_soap_envelope_get_body(soap_envelope, env); + if(!soap_body) + { + axiom_soap_envelope_free(soap_envelope, env); + return NULL; + } + fault = axiom_soap_fault_create_default_fault(env, soap_body, code_value, reason_text, + soap_version); + if(!fault) + { + axiom_soap_envelope_free(soap_envelope, env); + return NULL; + } + + if(sub_codes) + { + int i = 0; + axiom_soap_fault_code_t *fault_code = NULL; + fault_code = axiom_soap_fault_get_code(fault, env); + if(fault_code) + { + for(i = 0; i < axutil_array_list_size(sub_codes, env); i++) + { + axis2_char_t *sub_code = (axis2_char_t *)axutil_array_list_get(sub_codes, env, i); + if(sub_code) + { + axiom_soap_fault_sub_code_create_with_parent_value(env, fault_code, sub_code); + } + } + } + } + + if(detail_node) + { + axiom_soap_fault_detail_t *detail = axiom_soap_fault_detail_create_with_parent(env, fault); + if(detail) + { + axiom_soap_fault_detail_add_detail_entry(detail, env, detail_node); + } + } + + return soap_envelope; + +} + +static axis2_status_t +check_and_set_soap_version( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env, + axiom_namespace_t * ns) +{ + axis2_char_t *uri = NULL; + if(!soap_envelope) + { + return AXIS2_FAILURE; + } + if(!ns) + { + return AXIS2_FAILURE; + } + uri = axiom_namespace_get_uri(ns, env); + if(!uri) + { + return AXIS2_FAILURE; + } + if(axutil_strcmp(uri, AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI) == 0) + { + soap_envelope->soap_version = AXIOM_SOAP11; + return AXIS2_SUCCESS; + } + else if(axutil_strcmp(uri, AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI) == 0) + { + soap_envelope->soap_version = AXIOM_SOAP12; + return AXIS2_SUCCESS; + } + else + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_SOAP_NAMESPACE_URI, AXIS2_FAILURE); + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_envelope_set_soap_version( + axiom_soap_envelope_t * soap_envelope, + const axutil_env_t * env, + int soap_version) +{ + axiom_element_t *env_ele = NULL; + axiom_namespace_t *env_ns = NULL; + const axis2_char_t *ns_uri = NULL; + int status = AXIS2_SUCCESS; + + if(soap_version == AXIOM_SOAP11) + { + ns_uri = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI; + } + else if(soap_version == AXIOM_SOAP12) + { + ns_uri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI; + } + else + { + return AXIS2_FAILURE; + } + + env_ele = (axiom_element_t *)axiom_node_get_data_element(soap_envelope->om_ele_node, env); + if(!env_ele) + { + return AXIS2_FAILURE; + } + + env_ns = axiom_element_get_namespace(env_ele, env, soap_envelope->om_ele_node); + if(!env_ns) + { + return AXIS2_FAILURE; + } + status = axiom_namespace_set_uri(env_ns, env, ns_uri); + if(status == AXIS2_SUCCESS) + { + axiom_soap_envelope_set_soap_version_internal(soap_envelope, env, soap_version); + return AXIS2_SUCCESS; + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_envelope_increment_ref( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env) +{ + envelope->ref++; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN struct axiom_soap_builder *AXIS2_CALL +axiom_soap_envelope_get_soap_builder( + axiom_soap_envelope_t * envelope, + const axutil_env_t * env) +{ + return envelope->soap_builder; +} + diff --git a/axiom/src/soap/soap_fault.c b/axiom/src/soap/soap_fault.c new file mode 100644 index 0000000..7ee69a8 --- /dev/null +++ b/axiom/src/soap/soap_fault.c @@ -0,0 +1,630 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_fault.h" +#include <axiom_soap_const.h> +#include "_axiom_soap_body.h" +#include <axiom_node.h> +#include <axiom_element.h> +#include <axiom_soap_fault_code.h> +#include <axiom_soap_fault_detail.h> +#include <axiom_soap_fault_value.h> +#include <axiom_soap_fault_text.h> +#include <axiom_soap_fault_reason.h> +#include <axiom_soap_fault_role.h> +#include <axiom_soap_fault_node.h> +#include <axiom_soap_builder.h> + +struct axiom_soap_fault +{ + /* om element node corresponding to soap soap_fault */ + axiom_node_t *om_ele_node; + + /* soap soap_fault code sub element */ + axiom_soap_fault_code_t *fcode; + /* soap soap_fault reason sub element */ + axiom_soap_fault_reason_t *freason; + /* soap soap_fault node sub element */ + axiom_soap_fault_node_t *fnode; + /* soap soap_fault role sub element */ + axiom_soap_fault_role_t *frole; + /* soap soap_fault detail sub element */ + axiom_soap_fault_detail_t *fdetail; + + axis2_char_t *exception; + /* reference to soap builder */ + axiom_soap_builder_t *soap_builder; + + int soap_version; +}; + +AXIS2_EXTERN axiom_soap_fault_t *AXIS2_CALL +axiom_soap_fault_create( + const axutil_env_t * env) +{ + axiom_soap_fault_t *soap_fault = NULL; + soap_fault = (axiom_soap_fault_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_soap_fault_t)); + if(!soap_fault) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create a SOAP fault"); + return NULL; + } + soap_fault->exception = NULL; + soap_fault->fcode = NULL; + soap_fault->fdetail = NULL; + soap_fault->fnode = NULL; + soap_fault->freason = NULL; + soap_fault->frole = NULL; + soap_fault->om_ele_node = NULL; + soap_fault->soap_builder = NULL; + soap_fault->soap_version = -1; + return soap_fault; +} + +AXIS2_EXTERN axiom_soap_fault_t *AXIS2_CALL +axiom_soap_fault_create_with_parent( + const axutil_env_t * env, + axiom_soap_body_t * body) +{ + axiom_soap_fault_t *soap_fault = NULL; + axiom_element_t *this_ele = NULL; + axiom_node_t *this_node = NULL; + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + axiom_namespace_t *parent_ns = NULL; + + AXIS2_PARAM_CHECK(env->error, body, NULL); + + soap_fault = axiom_soap_fault_create(env); + if(!soap_fault) + { + return NULL; + } + parent_node = axiom_soap_body_get_base_node(body, env); + if(!parent_node) + { + AXIS2_FREE(env->allocator, soap_fault); + return NULL; + } + soap_fault->soap_version = axiom_soap_body_get_soap_version(body, env); + + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + if(!parent_ele) + { + AXIS2_FREE(env->allocator, soap_fault); + return NULL; + } + parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node); + + this_ele = axiom_element_create(env, parent_node, AXIOM_SOAP_FAULT_LOCAL_NAME, parent_ns, + &this_node); + if(!this_ele) + { + AXIS2_FREE(env->allocator, soap_fault); + return NULL; + } + + soap_fault->om_ele_node = this_node; + axiom_soap_body_set_fault(body, env, soap_fault); + return soap_fault; +} + +AXIS2_EXTERN axiom_soap_fault_t *AXIS2_CALL +axiom_soap_fault_create_with_exception( + const axutil_env_t * env, + axiom_soap_body_t * body, + axis2_char_t * exception) +{ + axiom_soap_fault_t *soap_fault = NULL; + axis2_status_t status = AXIS2_SUCCESS; + AXIS2_PARAM_CHECK(env->error, body, NULL); + AXIS2_PARAM_CHECK(env->error, exception, NULL); + soap_fault = axiom_soap_fault_create_with_parent(env, body); + if(!soap_fault) + { + return NULL; + } + status = axiom_soap_fault_set_exception(soap_fault, env, exception); + if(status == AXIS2_FAILURE) + { + axiom_soap_fault_free(soap_fault, env); + return NULL; + } + return soap_fault; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_fault_free( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env) +{ + + if(soap_fault->fcode) + { + axiom_soap_fault_code_free(soap_fault->fcode, env); + soap_fault->fcode = NULL; + } + if(soap_fault->fdetail) + { + axiom_soap_fault_detail_free(soap_fault->fdetail, env); + soap_fault->fdetail = NULL; + } + if(soap_fault->fnode) + { + axiom_soap_fault_node_free(soap_fault->fnode, env); + soap_fault->fnode = NULL; + } + if(soap_fault->freason) + { + axiom_soap_fault_reason_free(soap_fault->freason, env); + soap_fault->freason = NULL; + } + if(soap_fault->frole) + { + axiom_soap_fault_role_free(soap_fault->frole, env); + soap_fault->frole = NULL; + } + AXIS2_FREE(env->allocator, soap_fault); + soap_fault = NULL; + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_set_code( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env, + axiom_soap_fault_code_t * code) +{ + AXIS2_PARAM_CHECK(env->error, code, AXIS2_FAILURE); + if(!(soap_fault->fcode)) + { + soap_fault->fcode = code; + return AXIS2_SUCCESS; + } + else + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, + "tring to set multiple code elements to soap_fault "); + + } + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_soap_fault_code_t *AXIS2_CALL +axiom_soap_fault_get_code( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + if(soap_fault->fcode) + { + return soap_fault->fcode; + } + else if(soap_fault->soap_builder) + { + while(!(soap_fault->fcode) && !(axiom_node_is_complete(soap_fault->om_ele_node, env))) + { + status = axiom_soap_builder_next(soap_fault->soap_builder, env); + if(status == AXIS2_FAILURE) + { + break; + } + } + } + return soap_fault->fcode; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_set_reason( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env, + axiom_soap_fault_reason_t * reason) +{ + AXIS2_PARAM_CHECK(env->error, reason, AXIS2_FAILURE); + if(!(soap_fault->freason)) + { + soap_fault->freason = reason; + return AXIS2_SUCCESS; + } + else + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "tring to set soap_fault reason twice"); + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axiom_soap_fault_reason_t *AXIS2_CALL +axiom_soap_fault_get_reason( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + if(soap_fault->freason) + { + return soap_fault->freason; + } + else if(soap_fault->soap_builder) + { + while(!(soap_fault->freason) && !(axiom_node_is_complete(soap_fault->om_ele_node, env))) + { + status = axiom_soap_builder_next(soap_fault->soap_builder, env); + if(status == AXIS2_FAILURE) + { + break; + } + } + } + return soap_fault->freason; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_set_node( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env, + axiom_soap_fault_node_t * node) +{ + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + if(!(soap_fault->fnode)) + { + soap_fault->fnode = node; + return AXIS2_SUCCESS; + } + else + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "tring to set soap_fault node more than once"); + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axiom_soap_fault_node_t *AXIS2_CALL +axiom_soap_fault_get_node( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + + if(soap_fault->fnode) + { + return soap_fault->fnode; + } + else if(soap_fault->soap_builder) + { + while(!(soap_fault->fnode) && !(axiom_node_is_complete(soap_fault->om_ele_node, env))) + { + status = axiom_soap_builder_next(soap_fault->soap_builder, env); + if(status == AXIS2_FAILURE) + { + break; + } + } + } + return soap_fault->fnode; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_set_role( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env, + axiom_soap_fault_role_t * role) +{ + AXIS2_PARAM_CHECK(env->error, role, AXIS2_FAILURE); + + if(!(soap_fault->frole)) + { + soap_fault->frole = role; + return AXIS2_FAILURE; + } + else + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "tring to set soap_fault role more than once "); + } + return AXIS2_FAILURE; + +} + +AXIS2_EXTERN axiom_soap_fault_role_t *AXIS2_CALL +axiom_soap_fault_get_role( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + if(soap_fault->frole) + { + return soap_fault->frole; + } + else if(soap_fault->soap_builder) + { + while(!(soap_fault->frole) && !(axiom_node_is_complete(soap_fault->om_ele_node, env))) + { + status = axiom_soap_builder_next(soap_fault->soap_builder, env); + if(status == AXIS2_FAILURE) + { + break; + } + } + } + return soap_fault->frole; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_set_detail( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env, + axiom_soap_fault_detail_t * detail) +{ + AXIS2_PARAM_CHECK(env->error, detail, AXIS2_FAILURE); + + if(!(soap_fault->fdetail)) + { + soap_fault->fdetail = detail; + return AXIS2_SUCCESS; + } + else + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, " tring to set soap_fault detail more than once"); + + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axiom_soap_fault_detail_t *AXIS2_CALL +axiom_soap_fault_get_detail( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + if(soap_fault->fdetail) + { + return soap_fault->fdetail; + } + else if(soap_fault->soap_builder) + { + while(!(soap_fault->fdetail) && !(axiom_node_is_complete(soap_fault->om_ele_node, env))) + { + status = axiom_soap_builder_next(soap_fault->soap_builder, env); + if(status == AXIS2_FAILURE) + { + break; + } + } + } + return soap_fault->fdetail; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_set_base_node( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env, + axiom_node_t * node) +{ + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + soap_fault->om_ele_node = node; + return AXIS2_SUCCESS; + +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_soap_fault_get_base_node( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env) +{ + return soap_fault->om_ele_node; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_soap_fault_get_exception( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env) +{ + axiom_soap_fault_detail_t *detail = NULL; + axiom_node_t *detail_node = NULL; + axiom_element_t *detail_ele = NULL; + axiom_node_t *exception_node = NULL; + axiom_element_t *exception_ele = NULL; + axutil_qname_t *qn = NULL; + axis2_char_t *excep = NULL; + + detail = axiom_soap_fault_get_detail(soap_fault, env); + if(!detail) + { + return NULL; + } + detail_node = axiom_soap_fault_detail_get_base_node(detail, env); + if(detail_node) + { + detail_ele = (axiom_element_t *)axiom_node_get_data_element(detail_node, env); + + qn = axutil_qname_create(env, AXIOM_SOAP_FAULT_DETAIL_EXCEPTION_ENTRY, NULL, NULL); + if(qn) + { + exception_ele = axiom_element_get_first_child_with_qname(detail_ele, env, qn, + detail_node, &exception_node); + axutil_qname_free(qn, env); + if(exception_ele) + { + excep = axiom_element_get_text(exception_ele, env, exception_node); + } + return excep; + } + } + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_set_exception( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env, + axis2_char_t * exception) +{ + axiom_soap_fault_detail_t *detail = NULL; + axiom_node_t *fault_detail_entry_node = NULL; + axiom_element_t *fault_detail_ele = NULL; + + AXIS2_PARAM_CHECK(env->error, exception, AXIS2_FAILURE); + + detail = axiom_soap_fault_get_detail(soap_fault, env); + + if(!detail) + { + detail = axiom_soap_fault_detail_create_with_parent(env, soap_fault); + if(!detail) + { + return AXIS2_FAILURE; + } + } + + /** create an om element with the exception enrty */ + + fault_detail_ele = axiom_element_create(env, NULL, AXIOM_SOAP_FAULT_DETAIL_EXCEPTION_ENTRY, + NULL, &fault_detail_entry_node); + if(!fault_detail_ele) + { + return AXIS2_FAILURE; + } + + /** set the exception string as a text node of newly created om element */ + axiom_element_set_text(fault_detail_ele, env, exception, fault_detail_entry_node); + + /** now add this om element as a child of soap soap_fault detail om element node */ + return axiom_soap_fault_detail_add_detail_entry(detail, env, fault_detail_entry_node); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_set_builder( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env, + axiom_soap_builder_t * builder) +{ + AXIS2_PARAM_CHECK(env->error, builder, AXIS2_FAILURE); + soap_fault->soap_builder = builder; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_soap_fault_t *AXIS2_CALL +axiom_soap_fault_create_default_fault( + const axutil_env_t * env, + struct axiom_soap_body * parent, + const axis2_char_t * code_value, + const axis2_char_t * reason_text, + const int soap_version) +{ + axiom_soap_fault_t *soap_fault = NULL; + axiom_node_t *fault_node = NULL; + + axiom_soap_fault_code_t *soap_fault_code = NULL; + axiom_soap_fault_value_t *soap_fault_value = NULL; + + axiom_soap_fault_reason_t *soap_fault_reason = NULL; + axiom_soap_fault_text_t *soap_fault_text = NULL; + + axiom_node_t *value_node = NULL; + axiom_element_t *value_ele = NULL; + + axiom_node_t *text_node = NULL; + axiom_element_t *text_ele = NULL; + + AXIS2_PARAM_CHECK(env->error, code_value, NULL); + AXIS2_PARAM_CHECK(env->error, reason_text, NULL); + + soap_fault = axiom_soap_fault_create_with_parent(env, parent); + if(!soap_fault) + { + return NULL; + } + fault_node = axiom_soap_fault_get_base_node(soap_fault, env); + if(!fault_node) + { + axiom_soap_fault_free(soap_fault, env); + return NULL; + } + + soap_fault_code = axiom_soap_fault_code_create_with_parent(env, soap_fault); + if(!soap_fault_code) + { + axiom_soap_fault_free(soap_fault, env); + axiom_node_free_tree(fault_node, env); + return NULL; + } + soap_fault_reason = axiom_soap_fault_reason_create_with_parent(env, soap_fault); + if(!soap_fault_reason) + { + axiom_soap_fault_free(soap_fault, env); + axiom_node_free_tree(fault_node, env); + return NULL; + } + + soap_fault_value = axiom_soap_fault_value_create_with_code(env, soap_fault_code); + if(!soap_fault_value) + { + axiom_soap_fault_free(soap_fault, env); + axiom_node_free_tree(fault_node, env); + return NULL; + } + + value_node = axiom_soap_fault_value_get_base_node(soap_fault_value, env); + if(!value_node) + { + return NULL; + } + value_ele = (axiom_element_t *)axiom_node_get_data_element(value_node, env); + + axiom_element_set_text(value_ele, env, code_value, value_node); + + soap_fault_text = axiom_soap_fault_text_create_with_parent(env, soap_fault_reason); + if(!soap_fault_text) + { + axiom_soap_fault_free(soap_fault, env); + axiom_node_free_tree(fault_node, env); + return NULL; + } + axiom_soap_fault_text_set_lang(soap_fault_text, env, "en"); + + text_node = axiom_soap_fault_text_get_base_node(soap_fault_text, env); + if(!text_node) + { + return NULL; + } + text_ele = (axiom_element_t *)axiom_node_get_data_element(text_node, env); + + axiom_element_set_text(text_ele, env, reason_text, text_node); + + return soap_fault; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_set_soap_version( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env, + int soap_version) +{ + soap_fault->soap_version = soap_version; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN int AXIS2_CALL +axiom_soap_fault_get_soap_version( + axiom_soap_fault_t * soap_fault, + const axutil_env_t * env) +{ + return soap_fault->soap_version; +} diff --git a/axiom/src/soap/soap_fault_code.c b/axiom/src/soap/soap_fault_code.c new file mode 100644 index 0000000..b0ded55 --- /dev/null +++ b/axiom/src/soap/soap_fault_code.c @@ -0,0 +1,308 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_fault_code.h" +#include <axiom_soap_fault_sub_code.h> +#include <axiom_soap_fault_value.h> +#include <axiom_soap_builder.h> +#include "_axiom_soap_fault.h" + +struct axiom_soap_fault_code +{ + axiom_node_t *om_ele_node; + + axiom_soap_fault_sub_code_t *subcode; + + axiom_soap_fault_value_t *value; + + axiom_soap_builder_t *builder; + + int soap_version; + +}; + +AXIS2_EXTERN axiom_soap_fault_code_t *AXIS2_CALL +axiom_soap_fault_code_create( + const axutil_env_t * env) +{ + axiom_soap_fault_code_t *fault_code = NULL; + fault_code = (axiom_soap_fault_code_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_soap_fault_code_t)); + + if(!fault_code) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create SOAP fault code"); + return NULL; + } + + fault_code->om_ele_node = NULL; + fault_code->subcode = NULL; + fault_code->value = NULL; + fault_code->builder = NULL; + fault_code->soap_version = AXIOM_SOAP_VERSION_NOT_SET; + + return fault_code; +} + +AXIS2_EXTERN axiom_soap_fault_code_t *AXIS2_CALL +axiom_soap_fault_code_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_t * fault) +{ + axiom_soap_fault_code_t *fault_code = NULL; + axiom_element_t *this_ele = NULL; + axiom_node_t *this_node = NULL; + + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + + axiom_namespace_t *parent_ns = NULL; + + AXIS2_PARAM_CHECK(env->error, fault, NULL); + + fault_code = axiom_soap_fault_code_create(env); + if(!fault_code) + { + return NULL; + } + + parent_node = axiom_soap_fault_get_base_node(fault, env); + if(!parent_node) + { + axiom_soap_fault_code_free(fault_code, env); + return NULL; + } + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + + if(!parent_ele) + { + axiom_soap_fault_code_free(fault_code, env); + return NULL; + } + fault_code->soap_version = axiom_soap_fault_get_soap_version(fault, env); + if(fault_code->soap_version == AXIOM_SOAP12) + { + parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node); + } + this_ele = axiom_element_create(env, parent_node, AXIOM_SOAP12_SOAP_FAULT_CODE_LOCAL_NAME, + parent_ns, &this_node); + + if(!this_ele) + { + axiom_soap_fault_code_free(fault_code, env); + return NULL; + } + + fault_code->om_ele_node = this_node; + + axiom_soap_fault_set_code(fault, env, fault_code); + + return fault_code; +} + +AXIS2_EXTERN axiom_soap_fault_code_t *AXIS2_CALL +axiom_soap_fault_code_create_with_parent_value( + const axutil_env_t * env, + axiom_soap_fault_t * fault, + axis2_char_t * value) +{ + axiom_soap_fault_code_t *fault_code = NULL; + axiom_soap_fault_value_t *fault_value = NULL; + AXIS2_PARAM_CHECK(env->error, value, NULL); + + fault_code = axiom_soap_fault_code_create_with_parent(env, fault); + if(!fault_code) + { + return NULL; + } + + fault_value = axiom_soap_fault_value_create_with_code(env, fault_code); + if(!fault_value) + { + axiom_soap_fault_code_free(fault_code, env); + return NULL; + } + axiom_soap_fault_value_set_text(fault_value, env, value); + return fault_code; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_fault_code_free( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env) +{ + + if(fault_code->subcode) + { + axiom_soap_fault_sub_code_free(fault_code->subcode, env); + } + if(fault_code->value) + { + axiom_soap_fault_value_free(fault_code->value, env); + } + + AXIS2_FREE(env->allocator, fault_code); + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_code_set_value( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env, + axiom_soap_fault_value_t * fault_val) +{ + + AXIS2_PARAM_CHECK(env->error, fault_val, AXIS2_FAILURE); + + if(!(fault_code->value)) + { + fault_code->value = fault_val; + return AXIS2_SUCCESS; + } + else + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, + "trying to set fault value to fault code more than once"); + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_code_set_sub_code( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env, + axiom_soap_fault_sub_code_t * fault_subcode) +{ + AXIS2_PARAM_CHECK(env->error, fault_subcode, AXIS2_FAILURE); + + if(!(fault_code->subcode)) + { + fault_code->subcode = fault_subcode; + return AXIS2_SUCCESS; + } + else + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, + "trying to set fault subcode to fault code more than once "); + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axiom_soap_fault_sub_code_t *AXIS2_CALL +axiom_soap_fault_code_get_sub_code( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + + if(fault_code->subcode) + { + return fault_code->subcode; + } + else if(fault_code->builder) + { + while(!(fault_code->subcode) && !(axiom_node_is_complete(fault_code->om_ele_node, env))) + { + status = axiom_soap_builder_next(fault_code->builder, env); + if(status == AXIS2_FAILURE) + { + break; + } + } + } + return fault_code->subcode; +} + +AXIS2_EXTERN axiom_soap_fault_value_t *AXIS2_CALL +axiom_soap_fault_code_get_value( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + + if(fault_code->value) + { + return fault_code->value; + } + else if(fault_code->builder) + { + while(!(fault_code->value) && !(axiom_node_is_complete(fault_code->om_ele_node, env))) + { + status = axiom_soap_builder_next(fault_code->builder, env); + if(status == AXIS2_FAILURE) + { + break; + } + } + } + return fault_code->value; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_code_set_base_node( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env, + axiom_node_t * node) +{ + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + fault_code->om_ele_node = node; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_soap_fault_code_get_base_node( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env) +{ + return fault_code->om_ele_node; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_code_set_builder( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env, + axiom_soap_builder_t * soap_builder) +{ + AXIS2_PARAM_CHECK(env->error, soap_builder, AXIS2_FAILURE); + fault_code->builder = soap_builder; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN int AXIS2_CALL +axiom_soap_fault_code_get_soap_version( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env) +{ + return fault_code->soap_version; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_code_set_soap_version( + axiom_soap_fault_code_t * fault_code, + const axutil_env_t * env, + int soap_version) +{ + fault_code->soap_version = soap_version; + return AXIS2_SUCCESS; +} diff --git a/axiom/src/soap/soap_fault_detail.c b/axiom/src/soap/soap_fault_detail.c new file mode 100644 index 0000000..0375767 --- /dev/null +++ b/axiom/src/soap/soap_fault_detail.c @@ -0,0 +1,160 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_fault.h" +#include <axiom_element.h> +#include <axiom_node.h> +#include "_axiom_soap_fault_detail.h" + +struct axiom_soap_fault_detail +{ + axiom_node_t *om_ele_node; +}; + +AXIS2_EXTERN axiom_soap_fault_detail_t *AXIS2_CALL +axiom_soap_fault_detail_create( + const axutil_env_t * env) +{ + axiom_soap_fault_detail_t *fault_detail = NULL; + + fault_detail = (axiom_soap_fault_detail_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_soap_fault_detail_t)); + if(!fault_detail) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create a fault detail"); + return NULL; + } + + fault_detail->om_ele_node = NULL; + + return fault_detail; +} + +AXIS2_EXTERN axiom_soap_fault_detail_t *AXIS2_CALL +axiom_soap_fault_detail_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_t * fault) +{ + axiom_soap_fault_detail_t *fault_detail = NULL; + axiom_element_t *this_ele = NULL; + axiom_node_t *this_node = NULL; + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + axiom_namespace_t *parent_ns = NULL; + int soap_version = -1; + + AXIS2_PARAM_CHECK(env->error, fault, NULL); + + fault_detail = axiom_soap_fault_detail_create(env); + if(!fault_detail) + { + return NULL; + } + parent_node = axiom_soap_fault_get_base_node(fault, env); + if(!parent_node) + { + return NULL; + } + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + if(!parent_ele) + { + return NULL; + } + soap_version = axiom_soap_fault_get_soap_version(fault, env); + if(soap_version == AXIOM_SOAP12) + { + parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node); + } + this_ele = axiom_element_create(env, parent_node, AXIOM_SOAP12_SOAP_FAULT_DETAIL_LOCAL_NAME, + parent_ns, &this_node); + + if(!this_ele) + { + axiom_soap_fault_detail_free(fault_detail, env); + return NULL; + } + fault_detail->om_ele_node = this_node; + axiom_soap_fault_set_detail(fault, env, fault_detail); + return fault_detail; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_fault_detail_free( + axiom_soap_fault_detail_t * fault_detail, + const axutil_env_t * env) +{ + AXIS2_FREE(env->allocator, fault_detail); + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_detail_add_detail_entry( + axiom_soap_fault_detail_t * fault_detail, + const axutil_env_t * env, + axiom_node_t * node) +{ + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_OM_ELEMENT_EXPECTED, AXIS2_FAILURE); + + return AXIS2_FAILURE; + } + + axiom_node_add_child(fault_detail->om_ele_node, env, node); + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_children_iterator_t *AXIS2_CALL +axiom_soap_fault_detail_get_all_detail_entries( + axiom_soap_fault_detail_t * fault_detail, + const axutil_env_t * env) +{ + axiom_element_t *om_ele = NULL; + if(fault_detail->om_ele_node) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(fault_detail->om_ele_node, env); + return axiom_element_get_children(om_ele, env, fault_detail->om_ele_node); + } + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_detail_set_base_node( + axiom_soap_fault_detail_t * fault_detail, + const axutil_env_t * env, + axiom_node_t * node) +{ + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + fault_detail->om_ele_node = node; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL axiom_soap_fault_detail_get_base_node( + axiom_soap_fault_detail_t * fault_detail, + const axutil_env_t * env) +{ + return fault_detail->om_ele_node; +} diff --git a/axiom/src/soap/soap_fault_node.c b/axiom/src/soap/soap_fault_node.c new file mode 100644 index 0000000..143bc87 --- /dev/null +++ b/axiom/src/soap/soap_fault_node.c @@ -0,0 +1,176 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_fault_node.h" +#include <axiom_node.h> +#include <axiom_element.h> +#include "_axiom_soap_fault.h" + +struct axiom_soap_fault_node +{ + axiom_node_t *om_ele_node; +}; + +AXIS2_EXTERN axiom_soap_fault_node_t *AXIS2_CALL +axiom_soap_fault_node_create( + const axutil_env_t * env) +{ + axiom_soap_fault_node_t *fault_node = NULL; + + fault_node = (axiom_soap_fault_node_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_soap_fault_node_t)); + + if(!fault_node) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create a SOAP fault node"); + return NULL; + } + fault_node->om_ele_node = NULL; + + return fault_node; +} + +AXIS2_EXTERN axiom_soap_fault_node_t *AXIS2_CALL +axiom_soap_fault_node_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_t * fault) +{ + axiom_soap_fault_node_t *fault_node = NULL; + axiom_element_t *this_ele = NULL; + axiom_node_t *this_node = NULL; + + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + + axiom_namespace_t *parent_ns = NULL; + + AXIS2_PARAM_CHECK(env->error, fault, NULL); + + fault_node = axiom_soap_fault_node_create(env); + if(!fault_node) + { + return NULL; + } + parent_node = axiom_soap_fault_get_base_node(fault, env); + if(!parent_node) + { + axiom_soap_fault_node_free(fault_node, env); + return NULL; + } + + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + if(!parent_ele) + { + axiom_soap_fault_node_free(fault_node, env); + return NULL; + } + + parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node); + + this_ele = axiom_element_create(env, parent_node, AXIOM_SOAP12_SOAP_FAULT_NODE_LOCAL_NAME, + parent_ns, &this_node); + + if(!this_ele) + { + axiom_soap_fault_node_free(fault_node, env); + return NULL; + } + + fault_node->om_ele_node = this_node; + + axiom_soap_fault_set_node(fault, env, fault_node); + + return fault_node; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_fault_node_free( + axiom_soap_fault_node_t * fault_node, + const axutil_env_t * env) +{ + AXIS2_FREE(env->allocator, fault_node); + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_node_set_value( + axiom_soap_fault_node_t * fault_node, + const axutil_env_t * env, + axis2_char_t * uri) +{ + axiom_element_t *om_ele = NULL; + + AXIS2_PARAM_CHECK(env->error, uri, AXIS2_FAILURE); + + if(fault_node->om_ele_node) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(fault_node-> om_ele_node, env); + + if(om_ele) + { + return axiom_element_set_text(om_ele, env, uri, fault_node->om_ele_node); + } + } + + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_soap_fault_node_get_value( + axiom_soap_fault_node_t * fault_node, + const axutil_env_t * env) +{ + axiom_element_t *om_ele = NULL; + + if(fault_node->om_ele_node) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(fault_node-> om_ele_node, env); + if(om_ele) + { + return axiom_element_get_text(om_ele, env, fault_node->om_ele_node); + } + + } + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_node_set_base_node( + axiom_soap_fault_node_t * fault_node, + const axutil_env_t * env, + axiom_node_t * node) +{ + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + + fault_node->om_ele_node = node; + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_soap_fault_node_get_base_node( + axiom_soap_fault_node_t * fault_node, + const axutil_env_t * env) +{ + return fault_node->om_ele_node; +} diff --git a/axiom/src/soap/soap_fault_reason.c b/axiom/src/soap/soap_fault_reason.c new file mode 100644 index 0000000..516d58c --- /dev/null +++ b/axiom/src/soap/soap_fault_reason.c @@ -0,0 +1,386 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_fault_reason.h> +#include "_axiom_soap_fault.h" +#include <axiom_element.h> +#include <axiom_soap_fault_text.h> +#include <axiom_soap_builder.h> +#include <axiom_soap_builder.h> + +struct axiom_soap_fault_reason +{ + /* corresponding om element node */ + axiom_node_t *om_ele_node; + + axutil_array_list_t *fault_texts; + /* pointer to soap builder */ + axiom_soap_builder_t *soap_builder; + + int soap_version; +}; + +static axis2_bool_t +axiom_soap_fault_reason_lang_exists( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env, + axis2_char_t * lang); + +AXIS2_EXTERN axiom_soap_fault_reason_t *AXIS2_CALL +axiom_soap_fault_reason_create( + const axutil_env_t * env) +{ + axiom_soap_fault_reason_t *fault_reason = NULL; + fault_reason = (axiom_soap_fault_reason_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_soap_fault_reason_t)); + if(!fault_reason) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create SOAP fault reason"); + return NULL; + } + + fault_reason->om_ele_node = NULL; + fault_reason->fault_texts = NULL; + fault_reason->soap_version = -1; + return fault_reason; +} + +AXIS2_EXTERN axiom_soap_fault_reason_t *AXIS2_CALL +axiom_soap_fault_reason_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_t * fault) +{ + axiom_soap_fault_reason_t *fault_reason = NULL; + axiom_element_t *this_ele = NULL; + axiom_node_t *this_node = NULL; + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + axiom_namespace_t *parent_ns = NULL; + + AXIS2_PARAM_CHECK(env->error, fault, NULL); + + fault_reason = axiom_soap_fault_reason_create(env); + if(!fault_reason) + { + return NULL; + } + parent_node = axiom_soap_fault_get_base_node(fault, env); + if(!parent_node) + { + return NULL; + } + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + if(!parent_ele) + { + return NULL; + } + fault_reason->soap_version = axiom_soap_fault_get_soap_version(fault, env); + if(fault_reason->soap_version == AXIOM_SOAP12) + { + parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node); + } + this_ele = axiom_element_create(env, parent_node, AXIOM_SOAP12_SOAP_FAULT_REASON_LOCAL_NAME, + parent_ns, &this_node); + if(!this_ele) + { + return NULL; + } + + fault_reason->om_ele_node = this_node; + + axiom_soap_fault_set_reason(fault, env, fault_reason); + return fault_reason; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_fault_reason_free( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env) +{ + + if(fault_reason->fault_texts) + { + int size = 0; + int i = 0; + size = axutil_array_list_size(fault_reason->fault_texts, env); + + for(i = 0; i < size; i++) + { + axiom_soap_fault_text_t *fault_text = NULL; + void *value = NULL; + value = axutil_array_list_get(fault_reason->fault_texts, env, i); + if(value) + { + fault_text = (axiom_soap_fault_text_t *)value; + axiom_soap_fault_text_free(fault_text, env); + fault_text = NULL; + } + } + axutil_array_list_free(fault_reason->fault_texts, env); + fault_reason->fault_texts = NULL; + } + + AXIS2_FREE(env->allocator, fault_reason); + + fault_reason = NULL; + + return; +} + +AXIS2_EXTERN axiom_soap_fault_text_t *AXIS2_CALL +axiom_soap_fault_reason_get_soap_fault_text( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env, + axis2_char_t * lang) +{ + int status = AXIS2_SUCCESS; + int size = 0; + int i = 0; + + AXIS2_PARAM_CHECK(env->error, fault_reason, NULL); + if(!lang || (axutil_strcmp(lang, "") == 0)) + { + return NULL; + } + /** Here we have to build the soap fault reason element completly */ + if(!fault_reason->fault_texts) + { + + if(fault_reason->soap_builder && !(axiom_node_is_complete(fault_reason->om_ele_node, env))) + { + while(!(axiom_node_is_complete(fault_reason->om_ele_node, env))) + { + status = axiom_soap_builder_next(fault_reason->soap_builder, env); + if(status == AXIS2_FAILURE) + { + return NULL; + } + } + } + } + + if(!fault_reason->fault_texts) + { + return NULL; + } + /** iterate the array list */ + size = axutil_array_list_size(fault_reason->fault_texts, env); + for(i = 0; i < size; i++) + { + axiom_soap_fault_text_t *fault_text = NULL; + void *value = NULL; + + value = axutil_array_list_get(fault_reason->fault_texts, env, i); + if(value) + { + axis2_char_t *fault_lang = NULL; + fault_text = (axiom_soap_fault_text_t *)value; + fault_lang = axiom_soap_fault_text_get_lang(fault_text, env); + if(fault_lang && axutil_strcmp(lang, fault_lang) == 0) + { + return fault_text; + } + } + } + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_reason_set_base_node( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env, + axiom_node_t * node) +{ + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + fault_reason->om_ele_node = node; + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL axiom_soap_fault_reason_get_base_node( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env) +{ + return fault_reason->om_ele_node; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_reason_set_builder( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env, + axiom_soap_builder_t * builder) +{ + AXIS2_PARAM_CHECK(env->error, builder, AXIS2_FAILURE); + + fault_reason->soap_builder = builder; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL +axiom_soap_fault_reason_get_all_soap_fault_texts( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + + if(!(fault_reason->fault_texts) && (fault_reason->soap_builder)) + { + if(!(axiom_node_is_complete(fault_reason->om_ele_node, env))) + { + while(!(axiom_node_is_complete(fault_reason->om_ele_node, env))) + { + status = axiom_soap_builder_next(fault_reason->soap_builder, env); + if(status == AXIS2_FAILURE) + { + return NULL; + } + } + } + } + return fault_reason->fault_texts; +} + +AXIS2_EXTERN axiom_soap_fault_text_t *AXIS2_CALL +axiom_soap_fault_reason_get_first_soap_fault_text( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + + if(!(fault_reason->fault_texts) && (fault_reason->soap_builder)) + { + if(!(axiom_node_is_complete(fault_reason->om_ele_node, env))) + { + while(!(axiom_node_is_complete(fault_reason->om_ele_node, env))) + { + status = axiom_soap_builder_next(fault_reason->soap_builder, env); + if(status == AXIS2_FAILURE) + { + return NULL; + } + } + } + } + if(fault_reason->fault_texts) + { + void *value = NULL; + value = axutil_array_list_get(fault_reason->fault_texts, env, 0); + if(value) + { + return (axiom_soap_fault_text_t *)value; + } + } + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_reason_add_soap_fault_text( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env, + axiom_soap_fault_text_t * fault_text) +{ + if(!fault_text) + { + return AXIS2_FAILURE; + } + if(!(fault_reason->fault_texts)) + { + fault_reason->fault_texts = axutil_array_list_create(env, 1); + if(!fault_reason->fault_texts) + { + return AXIS2_FAILURE; + } + axutil_array_list_add(fault_reason->fault_texts, env, fault_text); + } + else + { + axis2_char_t *lang = NULL; + axis2_bool_t is_exists = AXIS2_FALSE; + lang = axiom_soap_fault_text_get_lang(fault_text, env); + if(lang) + { + is_exists = axiom_soap_fault_reason_lang_exists(fault_reason, env, lang); + if(is_exists == AXIS2_TRUE) + { + return AXIS2_FAILURE; + } + /** this soap_fault text already exists */ + } + axutil_array_list_add(fault_reason->fault_texts, env, fault_text); + } + return AXIS2_SUCCESS; +} + +static axis2_bool_t +axiom_soap_fault_reason_lang_exists( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env, + axis2_char_t * lang) +{ + int size = 0; + int i = 0; + + if(!lang || (axutil_strcmp(lang, "") == 0) || !fault_reason->fault_texts) + { + return AXIS2_FALSE; + } + size = axutil_array_list_size(fault_reason->fault_texts, env); + for(i = 0; i < size; i++) + { + axiom_soap_fault_text_t *fault_text = NULL; + void *value = NULL; + value = axutil_array_list_get(fault_reason->fault_texts, env, i); + if(value) + { + axis2_char_t *text_lang = NULL; + fault_text = (axiom_soap_fault_text_t *)value; + + text_lang = axiom_soap_fault_text_get_lang(fault_text, env); + if(text_lang && (axutil_strcmp(lang, text_lang) == 0)) + { + return AXIS2_TRUE; + } + } + } + return AXIS2_FALSE; +} + +/** internal function */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_reason_set_soap_version( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env, + int soap_version) +{ + fault_reason->soap_version = soap_version; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_reason_get_soap_version( + axiom_soap_fault_reason_t * fault_reason, + const axutil_env_t * env) +{ + return fault_reason->soap_version; +} diff --git a/axiom/src/soap/soap_fault_role.c b/axiom/src/soap/soap_fault_role.c new file mode 100644 index 0000000..a438ea4 --- /dev/null +++ b/axiom/src/soap/soap_fault_role.c @@ -0,0 +1,180 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_fault_role.h> +#include "_axiom_soap_fault.h" +#include <axiom_soap_builder.h> +#include <axiom_element.h> + +struct axiom_soap_fault_role +{ + axiom_node_t *om_ele_node; +}; + +AXIS2_EXTERN axiom_soap_fault_role_t *AXIS2_CALL +axiom_soap_fault_role_create( + const axutil_env_t * env) +{ + axiom_soap_fault_role_t *fault_role = NULL; + + fault_role = (axiom_soap_fault_role_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_soap_fault_role_t)); + + if(!fault_role) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create SOAP fault role"); + return NULL; + } + + fault_role->om_ele_node = NULL; + + return fault_role; +} + +AXIS2_EXTERN axiom_soap_fault_role_t *AXIS2_CALL +axiom_soap_fault_role_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_t * fault) +{ + axiom_soap_fault_role_t *fault_role = NULL; + int soap_version = -1; + + axiom_element_t *this_ele = NULL; + axiom_node_t *this_node = NULL; + + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + + axiom_namespace_t *parent_ns = NULL; + + AXIS2_PARAM_CHECK(env->error, fault, NULL); + + fault_role = axiom_soap_fault_role_create(env); + if(!fault_role) + { + return NULL; + } + parent_node = axiom_soap_fault_get_base_node(fault, env); + if(!parent_node) + { + axiom_soap_fault_role_free(fault_role, env); + return NULL; + } + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + + if(!parent_ele) + { + axiom_soap_fault_role_free(fault_role, env); + return NULL; + } + soap_version = axiom_soap_fault_get_soap_version(fault, env); + if(soap_version == AXIOM_SOAP12) + { + parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node); + } + this_ele = axiom_element_create(env, parent_node, AXIOM_SOAP12_SOAP_FAULT_ROLE_LOCAL_NAME, + parent_ns, &this_node); + + if(!this_ele) + { + axiom_soap_fault_role_free(fault_role, env); + return NULL; + } + + fault_role->om_ele_node = this_node; + + axiom_soap_fault_set_role(fault, env, fault_role); + + return fault_role; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_fault_role_free( + axiom_soap_fault_role_t * fault_role, + const axutil_env_t * env) +{ + AXIS2_FREE(env->allocator, fault_role); + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_role_set_role_value( + axiom_soap_fault_role_t * fault_role, + const axutil_env_t * env, + axis2_char_t * uri) +{ + axiom_element_t *role_ele = NULL; + + AXIS2_PARAM_CHECK(env->error, uri, AXIS2_FAILURE); + + if(!fault_role->om_ele_node) + { + return AXIS2_FAILURE; + } + role_ele = (axiom_element_t *)axiom_node_get_data_element(fault_role->om_ele_node, env); + + if(role_ele) + { + return axiom_element_set_text(role_ele, env, uri, fault_role->om_ele_node); + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL axiom_soap_fault_role_get_role_value( + axiom_soap_fault_role_t * fault_role, + const axutil_env_t * env) +{ + axiom_element_t *role_ele = NULL; + + if (!fault_role->om_ele_node) + { + return NULL; + } + role_ele = (axiom_element_t *) axiom_node_get_data_element + (fault_role->om_ele_node, env); + + if (role_ele) + { + return axiom_element_get_text(role_ele, env, fault_role->om_ele_node); + } + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_role_set_base_node( + axiom_soap_fault_role_t * fault_role, + const axutil_env_t * env, + axiom_node_t * node) +{ + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + fault_role->om_ele_node = node; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL axiom_soap_fault_role_get_base_node( + axiom_soap_fault_role_t * fault_role, + const axutil_env_t * env) +{ + return fault_role->om_ele_node; +} diff --git a/axiom/src/soap/soap_fault_sub_code.c b/axiom/src/soap/soap_fault_sub_code.c new file mode 100644 index 0000000..904b406 --- /dev/null +++ b/axiom/src/soap/soap_fault_sub_code.c @@ -0,0 +1,298 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_fault_sub_code.h> +#include "_axiom_soap_fault_code.h" +#include <axiom_soap_fault_value.h> +#include <axiom_soap_builder.h> + +struct axiom_soap_fault_sub_code +{ + /* corresponding om element node */ + axiom_node_t *om_ele_node; + /* sub element fault value */ + axiom_soap_fault_value_t *value; + /* sub element fault subcode */ + axiom_soap_fault_sub_code_t *subcode; + /* pointer to soap builder */ + axiom_soap_builder_t *builder; + + int soap_version; +}; + +AXIS2_EXTERN axiom_soap_fault_sub_code_t *AXIS2_CALL +axiom_soap_fault_sub_code_create( + const axutil_env_t * env) +{ + axiom_soap_fault_sub_code_t *fault_sub_code = NULL; + AXIS2_ENV_CHECK(env, NULL); + fault_sub_code = (axiom_soap_fault_sub_code_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_soap_fault_sub_code_t)); + if(!fault_sub_code) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create SOAP fault sub-code"); + return NULL; + } + + fault_sub_code->om_ele_node = NULL; + fault_sub_code->value = NULL; + fault_sub_code->subcode = NULL; + fault_sub_code->builder = NULL; + + return fault_sub_code; +} + +AXIS2_EXTERN axiom_soap_fault_sub_code_t *AXIS2_CALL +axiom_soap_fault_sub_code_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_code_t * fault_code) +{ + axiom_soap_fault_sub_code_t *fault_sub_code = NULL; + axiom_element_t *this_ele = NULL; + axiom_node_t *this_node = NULL; + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + axiom_namespace_t *parent_ns = NULL; + + AXIS2_PARAM_CHECK(env->error, fault_code, NULL); + fault_sub_code = axiom_soap_fault_sub_code_create(env); + + if(!fault_sub_code) + { + return NULL; + } + parent_node = axiom_soap_fault_code_get_base_node(fault_code, env); + if(!parent_node) + { + axiom_soap_fault_sub_code_free(fault_sub_code, env); + return NULL; + } + + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + if(!parent_ele) + { + axiom_soap_fault_sub_code_free(fault_sub_code, env); + return NULL; + } + fault_sub_code->soap_version = axiom_soap_fault_code_get_soap_version(fault_code, env); + + if(fault_sub_code->soap_version == AXIOM_SOAP12) + { + parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node); + } + + this_ele = axiom_element_create(env, parent_node, AXIOM_SOAP12_SOAP_FAULT_SUB_CODE_LOCAL_NAME, + parent_ns, &this_node); + + if(!this_ele) + { + axiom_soap_fault_sub_code_free(fault_sub_code, env); + return NULL; + } + + fault_sub_code->om_ele_node = this_node; + + axiom_soap_fault_code_set_sub_code(fault_code, env, fault_sub_code); + + return fault_sub_code; +} + +AXIS2_EXTERN axiom_soap_fault_sub_code_t *AXIS2_CALL +axiom_soap_fault_sub_code_create_with_parent_value( + const axutil_env_t * env, + axiom_soap_fault_code_t * fault_code, + axis2_char_t * value) +{ + axiom_soap_fault_sub_code_t *fault_sub_code = NULL; + axiom_soap_fault_value_t *fault_value = NULL; + AXIS2_PARAM_CHECK(env->error, value, NULL); + + fault_sub_code = axiom_soap_fault_sub_code_create_with_parent(env, fault_code); + if(!fault_sub_code) + { + return NULL; + } + fault_value = axiom_soap_fault_value_create_with_subcode(env, fault_sub_code); + if(!fault_value) + { + axiom_soap_fault_sub_code_free(fault_sub_code, env); + return NULL; + } + + axiom_soap_fault_value_set_text(fault_value, env, value); + return fault_sub_code; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_fault_sub_code_free( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env) +{ + if(fault_sub_code->value) + { + axiom_soap_fault_value_free(fault_sub_code->value, env); + fault_sub_code->value = NULL; + } + if(fault_sub_code->subcode) + { + axiom_soap_fault_sub_code_free(fault_sub_code->subcode, env); + fault_sub_code->subcode = NULL; + } + AXIS2_FREE(env->allocator, fault_sub_code); + + fault_sub_code = NULL; + + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_sub_code_set_sub_code( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env, + axiom_soap_fault_sub_code_t * subcode) +{ + AXIS2_PARAM_CHECK(env->error, subcode, AXIS2_FAILURE); + + if(!(fault_sub_code->subcode)) + { + fault_sub_code->subcode = subcode; + return AXIS2_SUCCESS; + } + else + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "error tring to set fault subcode more than once"); + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axiom_soap_fault_value_t *AXIS2_CALL +axiom_soap_fault_sub_code_get_value( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + + if(fault_sub_code->builder) + { + while(!(fault_sub_code->value) && !axiom_node_is_complete(fault_sub_code->om_ele_node, env)) + { + status = axiom_soap_builder_next(fault_sub_code->builder, env); + if(status == AXIS2_FAILURE) + { + break; + } + } + } + return fault_sub_code->value; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_sub_code_set_value( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env, + axiom_soap_fault_value_t * fault_sub_code_val) +{ + AXIS2_PARAM_CHECK(env->error, fault_sub_code_val, AXIS2_FAILURE); + + if(!(fault_sub_code->value)) + { + fault_sub_code->value = fault_sub_code_val; + return AXIS2_SUCCESS; + } + else + { + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, + "error tring to set fault subcode value more than once"); + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axiom_soap_fault_sub_code_t *AXIS2_CALL +axiom_soap_fault_sub_code_get_subcode( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env) +{ + int status = AXIS2_SUCCESS; + + if(fault_sub_code->builder) + { + while(!(fault_sub_code->subcode) && !axiom_node_is_complete(fault_sub_code->om_ele_node, + env)) + { + status = axiom_soap_builder_next(fault_sub_code->builder, env); + if(status == AXIS2_FAILURE) + { + break; + } + } + } + return fault_sub_code->subcode; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_sub_code_set_base_node( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env, + axiom_node_t * node) +{ + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + fault_sub_code->om_ele_node = node; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL axiom_soap_fault_sub_code_get_base_node( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env) +{ + return fault_sub_code->om_ele_node; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_sub_code_set_builder( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env, + axiom_soap_builder_t * builder) +{ + AXIS2_PARAM_CHECK(env->error, builder, AXIS2_FAILURE); + + fault_sub_code->builder = builder; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_sub_code_set_soap_version( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env, + int soap_version) +{ + fault_sub_code->soap_version = soap_version; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN int AXIS2_CALL axiom_soap_fault_sub_code_get_soap_version( + axiom_soap_fault_sub_code_t * fault_sub_code, + const axutil_env_t * env) +{ + return fault_sub_code->soap_version; +} diff --git a/axiom/src/soap/soap_fault_text.c b/axiom/src/soap/soap_fault_text.c new file mode 100644 index 0000000..9c51821 --- /dev/null +++ b/axiom/src/soap/soap_fault_text.c @@ -0,0 +1,305 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_fault.h> +#include <axiom_element.h> +#include "_axiom_soap_fault_text.h" +#include "_axiom_soap_fault_reason.h" +#include <axiom_namespace.h> +#include <axutil_qname.h> + +struct axiom_soap_fault_text +{ + axiom_attribute_t *lang_attribute; + + axiom_namespace_t *lang_namespace; + + axiom_node_t *om_ele_node; + + axis2_bool_t lang_ns_used; +}; + +AXIS2_EXTERN axiom_soap_fault_text_t *AXIS2_CALL +axiom_soap_fault_text_create( + const axutil_env_t * env) +{ + axiom_soap_fault_text_t *fault_text = NULL; + + fault_text = (axiom_soap_fault_text_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_soap_fault_text_t)); + if(!fault_text) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create SOAP fault text"); + return NULL; + } + + fault_text->om_ele_node = NULL; + fault_text->lang_attribute = NULL; + fault_text->lang_namespace = NULL; + fault_text->lang_ns_used = AXIS2_FALSE; + + fault_text->lang_namespace = axiom_namespace_create(env, + AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_NS_URI, + AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX); + + if(!(fault_text->lang_namespace)) + { + return NULL; + } + + return fault_text; +} + +AXIS2_EXTERN axiom_soap_fault_text_t *AXIS2_CALL +axiom_soap_fault_text_create_with_parent( + const axutil_env_t * env, + axiom_soap_fault_reason_t * parent) +{ + axiom_soap_fault_text_t *fault_text = NULL; + axiom_element_t *this_ele = NULL; + int soap_version = -1; + axiom_node_t *this_node = NULL; + axiom_namespace_t *parent_ns = NULL; + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + + AXIS2_PARAM_CHECK(env->error, parent, NULL); + + fault_text = axiom_soap_fault_text_create(env); + + if(!fault_text) + { + return NULL; + } + + parent_node = axiom_soap_fault_reason_get_base_node(parent, env); + if(!parent_node) + { + axiom_soap_fault_text_free(fault_text, env); + return NULL; + } + + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + if(!parent_ele) + { + axiom_soap_fault_text_free(fault_text, env); + return NULL; + } + + soap_version = axiom_soap_fault_reason_get_soap_version(parent, env); + if(AXIOM_SOAP12 == soap_version) + { + parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node); + } + this_ele = axiom_element_create(env, parent_node, AXIOM_SOAP12_SOAP_FAULT_TEXT_LOCAL_NAME, + parent_ns, &this_node); + + if(!this_ele) + { + axiom_soap_fault_text_free(fault_text, env); + return NULL; + } + + fault_text->om_ele_node = this_node; + + axiom_soap_fault_reason_add_soap_fault_text(parent, env, fault_text); + + return fault_text; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_fault_text_free( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env) +{ + + if(fault_text->lang_ns_used == AXIS2_FALSE && fault_text->lang_namespace) + { + axiom_namespace_free(fault_text->lang_namespace, env); + fault_text->lang_namespace = NULL; + } + AXIS2_FREE(env->allocator, fault_text); + fault_text = NULL; + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_text_set_lang( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env, + const axis2_char_t * lang) +{ + int status = AXIS2_SUCCESS; + axiom_element_t *om_ele = NULL; + + AXIS2_PARAM_CHECK(env->error, lang, AXIS2_FAILURE); + + if(fault_text->lang_attribute) + { + axis2_char_t *attr_lang = NULL; + attr_lang = axiom_attribute_get_value(fault_text->lang_attribute, env); + if(attr_lang) + { + if(axutil_strcmp(attr_lang, lang) == 0) + { + + /** this attribute already exists */ + return AXIS2_SUCCESS; + } + } + axiom_attribute_set_value(fault_text->lang_attribute, env, lang); + return AXIS2_SUCCESS; + } + + fault_text->lang_attribute = axiom_attribute_create(env, + AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME, lang, fault_text-> lang_namespace); + if(!fault_text->lang_attribute) + { + return AXIS2_FAILURE; + } + + if(!fault_text->om_ele_node) + { + return AXIS2_FAILURE; + } + om_ele = (axiom_element_t *)axiom_node_get_data_element(fault_text->om_ele_node, env); + if(!om_ele) + { + return AXIS2_FAILURE; + } + + status = axiom_element_add_attribute(om_ele, env, fault_text->lang_attribute, + fault_text->om_ele_node); + + if(status == AXIS2_SUCCESS) + { + fault_text->lang_ns_used = AXIS2_TRUE; + } + else + { + axiom_attribute_free(fault_text->lang_attribute, env); + fault_text->lang_attribute = NULL; + } + return status; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_soap_fault_text_get_lang( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env) +{ + axiom_element_t *om_ele = NULL; + axutil_qname_t *tmp_qname = NULL; + + if(!fault_text->om_ele_node) + { + return NULL; + } + om_ele = (axiom_element_t *)axiom_node_get_data_element(fault_text->om_ele_node, env); + if(!om_ele) + { + return NULL; + } + if(!(fault_text->lang_attribute)) + { + + /* this logic need to be rechecked */ + tmp_qname = axutil_qname_create(env, AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME, + AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_NS_URI, + AXIOM_SOAP12_SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX); + + fault_text->lang_attribute = axiom_element_get_attribute(om_ele, env, tmp_qname); + axutil_qname_free(tmp_qname, env); + } + if(fault_text->lang_attribute) + { + return axiom_attribute_get_value(fault_text->lang_attribute, env); + } + else + return NULL; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_text_set_base_node( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env, + axiom_node_t * node) +{ + + if(node && (axiom_node_get_node_type(node, env) != AXIOM_ELEMENT)) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + fault_text->om_ele_node = node; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_soap_fault_text_get_base_node( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env) +{ + return fault_text->om_ele_node; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_text_set_text( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env, + axis2_char_t * value, + axis2_char_t * lang) +{ + AXIS2_PARAM_CHECK(env->error, value, AXIS2_FAILURE); + + if(fault_text->om_ele_node) + { + axiom_element_t *text_ele = NULL; + text_ele = (axiom_element_t *)axiom_node_get_data_element(fault_text->om_ele_node, env); + if(text_ele) + { + axiom_element_set_text(text_ele, env, value, fault_text->om_ele_node); + if(lang) + { + axiom_soap_fault_text_set_lang(fault_text, env, lang); + } + return AXIS2_SUCCESS; + } + } + return AXIS2_FAILURE; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_soap_fault_text_get_text( + axiom_soap_fault_text_t * fault_text, + const axutil_env_t * env) +{ + axis2_char_t *text = NULL; + + if(fault_text->om_ele_node) + { + axiom_element_t *text_ele = NULL; + text_ele = (axiom_element_t *)axiom_node_get_data_element(fault_text->om_ele_node, env); + if(text_ele) + { + text = axiom_element_get_text(text_ele, env, fault_text->om_ele_node); + return text; + } + } + return NULL; +} diff --git a/axiom/src/soap/soap_fault_value.c b/axiom/src/soap/soap_fault_value.c new file mode 100644 index 0000000..775cba4 --- /dev/null +++ b/axiom/src/soap/soap_fault_value.c @@ -0,0 +1,237 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_fault_value.h> +#include "_axiom_soap_fault_sub_code.h" +#include "_axiom_soap_fault_code.h" +#include <axiom_element.h> +#include <axiom_text.h> + +struct axiom_soap_fault_value +{ + + /** store om element node */ + axiom_node_t *om_ele_node; +}; + +AXIS2_EXTERN axiom_soap_fault_value_t *AXIS2_CALL +axiom_soap_fault_value_create( + const axutil_env_t * env) +{ + axiom_soap_fault_value_t *fault_value = NULL; + + fault_value = (axiom_soap_fault_value_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_soap_fault_value_t)); + + if(!fault_value) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create SOAP fault value"); + return NULL; + } + + fault_value->om_ele_node = NULL; + + return fault_value; +} + +AXIS2_EXTERN axiom_soap_fault_value_t *AXIS2_CALL +axiom_soap_fault_value_create_with_subcode( + const axutil_env_t * env, + axiom_soap_fault_sub_code_t * parent) +{ + axiom_soap_fault_value_t *fault_value = NULL; + + axiom_element_t *this_ele = NULL; + axiom_node_t *this_node = NULL; + axiom_namespace_t *parent_ns = NULL; + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + int soap_version = -1; + + AXIS2_PARAM_CHECK(env->error, parent, NULL); + + fault_value = axiom_soap_fault_value_create(env); + + if(!fault_value) + { + return NULL; + } + + parent_node = axiom_soap_fault_sub_code_get_base_node(parent, env); + + if(!parent_node) + { + axiom_soap_fault_value_free(fault_value, env); + return NULL; + } + + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + + if(!parent_ele) + { + axiom_soap_fault_value_free(fault_value, env); + return NULL; + } + soap_version = axiom_soap_fault_sub_code_get_soap_version(parent, env); + if(soap_version == AXIOM_SOAP12) + { + parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node); + } + + this_ele = axiom_element_create(env, parent_node, AXIOM_SOAP12_SOAP_FAULT_VALUE_LOCAL_NAME, + parent_ns, &this_node); + + if(!this_ele) + { + axiom_soap_fault_value_free(fault_value, env); + return NULL; + } + + fault_value->om_ele_node = this_node; + + axiom_soap_fault_sub_code_set_value(parent, env, fault_value); + + return fault_value; +} + +AXIS2_EXTERN axiom_soap_fault_value_t *AXIS2_CALL +axiom_soap_fault_value_create_with_code( + const axutil_env_t * env, + axiom_soap_fault_code_t * parent) +{ + axiom_soap_fault_value_t *fault_value = NULL; + int soap_version = -1; + axiom_element_t *this_ele = NULL; + axiom_node_t *this_node = NULL; + axiom_namespace_t *parent_ns = NULL; + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + + AXIS2_PARAM_CHECK(env->error, parent, NULL); + + fault_value = axiom_soap_fault_value_create(env); + + if(!fault_value) + { + return NULL; + } + + parent_node = axiom_soap_fault_code_get_base_node(parent, env); + if(!parent_node) + { + axiom_soap_fault_value_free(fault_value, env); + return NULL; + } + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + if(!parent_ele) + { + axiom_soap_fault_value_free(fault_value, env); + return NULL; + } + soap_version = axiom_soap_fault_code_get_soap_version(parent, env); + if(soap_version == AXIOM_SOAP12) + { + parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node); + } + this_ele = axiom_element_create(env, parent_node, AXIOM_SOAP12_SOAP_FAULT_VALUE_LOCAL_NAME, + parent_ns, &this_node); + + if(!this_ele) + { + axiom_soap_fault_value_free(fault_value, env); + return NULL; + } + fault_value->om_ele_node = this_node; + + axiom_soap_fault_code_set_value(parent, env, fault_value); + + return fault_value; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_fault_value_free( + axiom_soap_fault_value_t * fault_value, + const axutil_env_t * env) +{ + AXIS2_FREE(env->allocator, fault_value); + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_value_set_base_node( + axiom_soap_fault_value_t * fault_value, + const axutil_env_t * env, + axiom_node_t * node) +{ + + if(node && (axiom_node_get_node_type(node, env) != AXIOM_ELEMENT)) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + + fault_value->om_ele_node = node; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_soap_fault_value_get_base_node( + axiom_soap_fault_value_t * fault_value, + const axutil_env_t * env) +{ + return fault_value->om_ele_node; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_soap_fault_value_get_text( + axiom_soap_fault_value_t * fault_value, + const axutil_env_t * env) +{ + axiom_node_t *value_node = NULL; + axiom_element_t *value_element = NULL; + + value_node = axiom_soap_fault_value_get_base_node(fault_value, env); + + if(!value_node) + { + return NULL; + } + value_element = (axiom_element_t *)axiom_node_get_data_element(value_node, env); + + if(!value_element) + { + return NULL; + } + return axiom_element_get_text(value_element, env, value_node); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_fault_value_set_text( + axiom_soap_fault_value_t * fault_value, + const axutil_env_t * env, + axis2_char_t * text) +{ + AXIS2_PARAM_CHECK(env->error, text, AXIS2_FAILURE); + if(fault_value->om_ele_node && axiom_node_get_node_type(fault_value->om_ele_node, env) + == AXIOM_ELEMENT) + { + axiom_element_t *om_ele = NULL; + om_ele = (axiom_element_t *)axiom_node_get_data_element(fault_value->om_ele_node, env); + return axiom_element_set_text(om_ele, env, text, fault_value->om_ele_node); + } + return AXIS2_FAILURE; +} diff --git a/axiom/src/soap/soap_header.c b/axiom/src/soap/soap_header.c new file mode 100644 index 0000000..6c6a71c --- /dev/null +++ b/axiom/src/soap/soap_header.c @@ -0,0 +1,655 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_envelope.h" +#include "_axiom_soap_header.h" +#include "_axiom_soap_body.h" +#include <axiom_soap_header_block.h> +#include <axutil_hash.h> +#include <axiom_soap_const.h> +#include <axiom_soap_builder.h> +#include <stdio.h> +#include <axiom_node_internal.h> +#include <axutil_array_list.h> + +struct axiom_soap_header +{ + axiom_node_t *om_ele_node; + + int soap_version; + + axutil_hash_t *header_blocks; + + int hbnumber; + + axiom_soap_builder_t *soap_builder; + + axiom_soap_envelope_t *soap_envelope; + + axutil_array_list_t *header_block_keys; +}; + +static axis2_bool_t AXIS2_CALL axiom_soap_header_qname_matches( + const axutil_env_t * env, + axutil_qname_t * element_qname, + axutil_qname_t * qname_to_match); + +AXIS2_EXTERN axiom_soap_header_t *AXIS2_CALL +axiom_soap_header_create( + const axutil_env_t * env) +{ + axiom_soap_header_t *soap_header = NULL; + + soap_header = (axiom_soap_header_t *)AXIS2_MALLOC(env->allocator, sizeof(axiom_soap_header_t)); + if(!soap_header) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create SOAP header"); + return NULL; + } + + soap_header->om_ele_node = NULL; + soap_header->soap_envelope = NULL; + soap_header->hbnumber = 0; + soap_header->header_blocks = NULL; + + /** default value */ + soap_header->soap_version = AXIOM_SOAP12; + soap_header->header_block_keys = NULL; + + soap_header->header_block_keys = axutil_array_list_create(env, 10); + if(!soap_header->header_block_keys) + { + AXIS2_FREE(env->allocator, soap_header); + return NULL; + } + + return soap_header; +} + +AXIS2_EXTERN axiom_soap_header_t *AXIS2_CALL +axiom_soap_header_create_with_parent( + const axutil_env_t * env, + axiom_soap_envelope_t * envelope) +{ + axiom_soap_header_t *soap_header = NULL; + + /*axiom_element_t *this_ele = NULL; + axiom_node_t *this_node = NULL;*/ + axiom_node_t *body_node = NULL; + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + + /*axiom_namespace_t *parent_ns = NULL;*/ + + AXIS2_PARAM_CHECK(env->error, envelope, NULL); + + soap_header = axiom_soap_header_create(env); + if(!soap_header) + { + return NULL; + } + soap_header->soap_version = axiom_soap_envelope_get_soap_version(envelope, env); + + parent_node = axiom_soap_envelope_get_base_node(envelope, env); + + if(!parent_node || axiom_node_get_node_type(parent_node, env) != AXIOM_ELEMENT) + { + axiom_soap_header_free(soap_header, env); + return NULL; + } + + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + if(!parent_ele) + { + axiom_soap_header_free(soap_header, env); + return NULL; + } + if(axiom_node_get_first_element(parent_node, env)) + { + body_node = axiom_node_get_first_element(parent_node, env); + axiom_node_detach(body_node, env); + } + + /*parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node); + this_ele = axiom_element_create(env, parent_node, + AXIOM_SOAP_HEADER_LOCAL_NAME, parent_ns, + &this_node); + if (!this_ele) + { + axiom_soap_header_free(soap_header, env); + return NULL; + } + + soap_header->om_ele_node = this_node;*/ + + axiom_soap_envelope_set_header(envelope, env, soap_header); + + if(body_node) + { + axiom_node_add_child(parent_node, env, body_node); + } + + soap_header->soap_envelope = envelope; + + return soap_header; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_header_free( + axiom_soap_header_t * soap_header, + const axutil_env_t * env) +{ + + if(soap_header->header_blocks) + { + axutil_hash_index_t *hi = NULL; + void *val = NULL; + for(hi = axutil_hash_first(soap_header->header_blocks, env); hi; hi = axutil_hash_next(env, + hi)) + { + axutil_hash_this(hi, NULL, NULL, &val); + + if(val) + { + axiom_soap_header_block_free((axiom_soap_header_block_t *)val, env); + val = NULL; + } + } + + axutil_hash_free(soap_header->header_blocks, env); + } + if(soap_header->header_block_keys) + { + int size = 0; + void *val = NULL; + int i = 0; + size = axutil_array_list_size(soap_header->header_block_keys, env); + for(i = 0; i < size; i++) + { + val = axutil_array_list_get(soap_header->header_block_keys, env, i); + if(val) + { + AXIS2_FREE(env->allocator, (char *)val); + val = NULL; + } + } + axutil_array_list_free(soap_header->header_block_keys, env); + soap_header->header_block_keys = NULL; + } + AXIS2_FREE(env->allocator, soap_header); + + soap_header = NULL; + + return; +} + +AXIS2_EXTERN axiom_soap_header_block_t *AXIS2_CALL +axiom_soap_header_add_header_block( + axiom_soap_header_t * soap_header, + const axutil_env_t * env, + const axis2_char_t * localname, + axiom_namespace_t * ns) +{ + axiom_soap_header_block_t *header_block = NULL; + + axiom_namespace_t *cloned_ns = NULL; + + axiom_node_t *header_block_node = NULL; + + AXIS2_PARAM_CHECK(env->error, localname, NULL); + AXIS2_PARAM_CHECK(env->error, ns, NULL); + + cloned_ns = axiom_namespace_clone(ns, env); + if(!cloned_ns) + { + return NULL; + } + header_block = axiom_soap_header_block_create_with_parent(env, localname, cloned_ns, + soap_header); + + if(!header_block) + { + return NULL; + } + header_block_node = axiom_soap_header_block_get_base_node(header_block, env); + + if(header_block_node) + { + axiom_node_set_complete(header_block_node, env, AXIS2_TRUE); + + return header_block; + } + else + { + return NULL; + } +} +AXIS2_EXTERN axutil_hash_t *AXIS2_CALL axiom_soap_header_examine_header_blocks( + axiom_soap_header_t * soap_header, + const axutil_env_t * env, + axis2_char_t * param_role) +{ + AXIS2_PARAM_CHECK(env->error, param_role, NULL); + + return soap_header->header_blocks; +} + +AXIS2_EXTERN axiom_children_qname_iterator_t *AXIS2_CALL +axiom_soap_header_examine_all_header_blocks( + axiom_soap_header_t * soap_header, + const axutil_env_t * env) +{ + axiom_element_t *om_ele = NULL; + + if(!soap_header->om_ele_node) + { + return NULL; + } + om_ele = (axiom_element_t *)axiom_node_get_data_element(soap_header-> om_ele_node, env); + + if(om_ele) + { + return axiom_element_get_children_with_qname(om_ele, env, NULL, soap_header->om_ele_node); + } + else + return NULL; +} + +AXIS2_EXTERN axiom_children_with_specific_attribute_iterator_t *AXIS2_CALL +axiom_soap_header_extract_header_blocks( + axiom_soap_header_t * soap_header, + const axutil_env_t * env, + axis2_char_t * role) +{ + const axis2_char_t *localname = NULL; + const axis2_char_t *nsuri = NULL; + + axiom_node_t *first_node = NULL; + axiom_element_t *first_ele = NULL; + + axutil_qname_t *qn = NULL; + + axiom_element_t *header_om_ele = NULL; + axiom_children_with_specific_attribute_iterator_t *iter = NULL; + + if(soap_header->soap_version == AXIOM_SOAP_VERSION_NOT_SET) + { + return NULL; + } + if(soap_header->soap_version == AXIOM_SOAP11) + { + localname = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI; + nsuri = AXIOM_SOAP11_ATTR_ACTOR; + } + if(soap_header->soap_version == AXIOM_SOAP12) + { + localname = AXIOM_SOAP12_SOAP_ROLE; + nsuri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI; + } + + qn = axutil_qname_create(env, localname, nsuri, NULL); + if(!qn) + { + return NULL; + } + header_om_ele = (axiom_element_t *)axiom_node_get_data_element(soap_header->om_ele_node, env); + + if(header_om_ele) + { + first_ele = axiom_element_get_first_element(header_om_ele, env, soap_header->om_ele_node, + &first_node); + if(first_node) + { + return axiom_children_with_specific_attribute_iterator_create(env, first_node, qn, + role, AXIS2_TRUE); + } + } + + axutil_qname_free(qn, env); + + return iter; + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_header_set_base_node( + axiom_soap_header_t * soap_header, + const axutil_env_t * env, + axiom_node_t * node) +{ + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + + soap_header->om_ele_node = node; + + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_soap_header_get_base_node( + axiom_soap_header_t * soap_header, + const axutil_env_t * env) +{ + if(!soap_header->om_ele_node) + { + axiom_node_t *parent_node = NULL; + axiom_element_t *parent_ele = NULL; + axiom_namespace_t *parent_ns = NULL; + axiom_element_t *this_ele = NULL; + axiom_node_t *this_node = NULL; + axiom_soap_body_t *soap_body = NULL; + axiom_node_t *body_node = NULL; + + parent_node = axiom_soap_envelope_get_base_node(soap_header->soap_envelope, env); + + if(!parent_node || axiom_node_get_node_type(parent_node, env) != AXIOM_ELEMENT) + { + axiom_soap_header_free(soap_header, env); + return NULL; + } + + parent_ele = (axiom_element_t *)axiom_node_get_data_element(parent_node, env); + if(!parent_ele) + { + axiom_soap_header_free(soap_header, env); + return NULL; + } + + parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node); + this_ele = axiom_element_create(env, NULL, AXIOM_SOAP_HEADER_LOCAL_NAME, parent_ns, + &this_node); + if(!this_ele) + { + axiom_soap_header_free(soap_header, env); + return NULL; + } + + soap_body = axiom_soap_envelope_get_body(soap_header->soap_envelope, env); + if(soap_body) + { + body_node = axiom_soap_body_get_base_node(soap_body, env); + axiom_node_insert_sibling_before(body_node, env, this_node); + } + else + { + axiom_node_add_child(parent_node, env, this_node); + } + soap_header->om_ele_node = this_node; + } + + return soap_header->om_ele_node; +} + +/** + set soap version and get soap version are internal functions + + */ +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_header_get_soap_version( + axiom_soap_header_t * soap_header, + const axutil_env_t * env) +{ + return soap_header->soap_version; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_header_set_soap_version( + axiom_soap_header_t * soap_header, + const axutil_env_t * env, + int soap_version) +{ + soap_header->soap_version = soap_version; + return AXIS2_SUCCESS; + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_header_set_header_block( + axiom_soap_header_t * soap_header, + const axutil_env_t * env, + struct axiom_soap_header_block * header_block) +{ + axis2_char_t *key = NULL; + AXIS2_PARAM_CHECK(env->error, header_block, AXIS2_FAILURE); + + key = (axis2_char_t *)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * 10); + + if(!key) + { + return AXIS2_FAILURE; + } + sprintf(key, "%d", soap_header->hbnumber++); + + if(soap_header->header_blocks) + { + axutil_hash_set(soap_header->header_blocks, key, AXIS2_HASH_KEY_STRING, header_block); + } + else + { + soap_header->header_blocks = axutil_hash_make(env); + axutil_hash_set(soap_header->header_blocks, key, AXIS2_HASH_KEY_STRING, header_block); + } + if(soap_header->header_block_keys) + { + axutil_array_list_add(soap_header->header_block_keys, env, key); + } + return AXIS2_SUCCESS; + +} +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_header_set_builder( + axiom_soap_header_t * soap_header, + const axutil_env_t * env, + struct axiom_soap_builder * builder) +{ + AXIS2_PARAM_CHECK(env->error, builder, AXIS2_FAILURE); + + soap_header->soap_builder = builder; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL +axiom_soap_header_get_header_blocks_with_namespace_uri( + axiom_soap_header_t * soap_header, + const axutil_env_t * env, + const axis2_char_t * ns_uri) +{ + axutil_array_list_t *header_block_list = NULL; + axutil_hash_index_t *hash_index = NULL; + + axiom_soap_header_block_t *header_block = NULL; + + axiom_node_t *header_block_om_node = NULL; + axiom_element_t *header_block_om_ele = NULL; + + axiom_namespace_t *ns = NULL; + axis2_char_t *hb_namespace_uri = NULL; + + int found = 0; + void *hb = NULL; + + AXIS2_PARAM_CHECK(env->error, ns_uri, NULL); + + if(!(soap_header->header_blocks)) + { + return NULL; + } + header_block_list = axutil_array_list_create(env, 10); + if(!header_block_list) + { + return NULL; + } + for(hash_index = axutil_hash_first(soap_header->header_blocks, env); hash_index; hash_index + = axutil_hash_next(env, hash_index)) + { + axutil_hash_this(hash_index, NULL, NULL, &hb); + if(hb) + { + header_block = (axiom_soap_header_block_t *)hb; + + header_block_om_node = axiom_soap_header_block_get_base_node(header_block, env); + if(header_block_om_node) + { + header_block_om_ele = (axiom_element_t *)axiom_node_get_data_element( + header_block_om_node, env); + if(header_block_om_ele) + { + ns + = axiom_element_get_namespace(header_block_om_ele, env, + header_block_om_node); + if(ns) + { + hb_namespace_uri = axiom_namespace_get_uri(ns, env); + if(axutil_strcmp(hb_namespace_uri, ns_uri) == 0) + { + axutil_array_list_add(header_block_list, env, header_block); + found++; + } + } + } + } + hb = NULL; + header_block = NULL; + header_block_om_ele = NULL; + header_block_om_node = NULL; + ns = NULL; + hb_namespace_uri = NULL; + } + } + if(found > 0) + { + return header_block_list; + } + else + { + axutil_array_list_free(header_block_list, env); + } + return NULL; +} + +AXIS2_EXTERN axutil_hash_t *AXIS2_CALL +axiom_soap_header_get_all_header_blocks( + axiom_soap_header_t * soap_header, + const axutil_env_t * env) +{ + return soap_header->header_blocks; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_header_remove_header_block( + axiom_soap_header_t * soap_header, + const axutil_env_t * env, + axutil_qname_t * qname) +{ + axis2_char_t *qn_localname = NULL; + axis2_char_t *qname_ns = NULL; + axis2_char_t *qname_prefix = NULL; + axutil_hash_index_t *hi = NULL; + + AXIS2_PARAM_CHECK(env->error, qname, AXIS2_FAILURE); + + qn_localname = axutil_qname_get_localpart(qname, env); + qname_ns = axutil_qname_get_uri(qname, env); + qname_prefix = axutil_qname_get_prefix(qname, env); + + if(!soap_header->header_blocks) + { + return AXIS2_FAILURE; + } + for(hi = axutil_hash_first(soap_header->header_blocks, env); hi; hi = axutil_hash_next(env, hi)) + { + const void *key = NULL; + void *val = NULL; + + axutil_hash_this(hi, &key, NULL, &val); + if(val) + { + axiom_soap_header_block_t *header_block = NULL; + axiom_element_t *ele = NULL; + axiom_node_t *node = NULL; + + header_block = (axiom_soap_header_block_t *)val; + node = axiom_soap_header_block_get_base_node(header_block, env); + if(node) + { + axutil_qname_t *element_qname = NULL; + + ele = (axiom_element_t *)axiom_node_get_data_element(node, env); + element_qname = axiom_element_get_qname(ele, env, node); + if(axiom_soap_header_qname_matches(env, element_qname, qname) == AXIS2_TRUE) + { + axiom_node_detach(node, env); + /* axiom_node_free_tree(node, env); */ + axutil_hash_set(soap_header->header_blocks, key, AXIS2_HASH_KEY_STRING, NULL); + axiom_soap_header_block_free(header_block, env); + axiom_node_free_tree(node, env); + break; + } + } + } + } + + if(hi) + { + AXIS2_FREE(env->allocator, hi); + } + + return AXIS2_SUCCESS; +} + +static axis2_bool_t AXIS2_CALL +axiom_soap_header_qname_matches( + const axutil_env_t * env, + axutil_qname_t * element_qname, + axutil_qname_t * qname_to_match) +{ + int lparts_match = 0; + int uris_match = 0; + axis2_char_t *ele_lpart = NULL; + axis2_char_t *match_lpart = NULL; + axis2_char_t *ele_nsuri = NULL; + axis2_char_t *match_nsuri = NULL; + + if(!(qname_to_match)) + { + return AXIS2_TRUE; + } + if(qname_to_match) + { + match_lpart = axutil_qname_get_localpart(qname_to_match, env); + match_nsuri = axutil_qname_get_uri(qname_to_match, env); + } + if(element_qname) + { + ele_lpart = axutil_qname_get_localpart(element_qname, env); + ele_nsuri = axutil_qname_get_uri(element_qname, env); + } + + lparts_match = (!match_lpart || (axutil_strcmp(match_lpart, "") == 0) || (element_qname + && (axutil_strcmp(ele_lpart, match_lpart) == 0))); + + uris_match = (!match_nsuri || (axutil_strcmp(match_nsuri, "") == 0) || (element_qname + && (axutil_strcmp(ele_nsuri, match_nsuri) == 0))); + + return lparts_match && uris_match; +} diff --git a/axiom/src/soap/soap_header_block.c b/axiom/src/soap/soap_header_block.c new file mode 100644 index 0000000..6f80f3a --- /dev/null +++ b/axiom/src/soap/soap_header_block.c @@ -0,0 +1,460 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_soap_const.h> +#include "_axiom_soap_header_block.h" +#include "_axiom_soap_header.h" +#include <axiom_soap_envelope.h> +#include <axiom_soap_builder.h> + +struct axiom_soap_header_block +{ + + /** om_element node corresponding to this headerblock */ + axiom_node_t *om_ele_node; + + /** soap version */ + int soap_version; + axis2_bool_t processed; +}; + +AXIS2_EXTERN axiom_soap_header_block_t *AXIS2_CALL +axiom_soap_header_block_create( + const axutil_env_t * env) +{ + axiom_soap_header_block_t *header_block = NULL; + AXIS2_ENV_CHECK(env, NULL); + header_block = (axiom_soap_header_block_t *)AXIS2_MALLOC(env->allocator, + sizeof(axiom_soap_header_block_t)); + if(!header_block) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create SOAP header block"); + return NULL; + } + + header_block->om_ele_node = NULL; + header_block->soap_version = AXIOM_SOAP_VERSION_NOT_SET; + header_block->processed = AXIS2_FALSE; + + return header_block; +} + +AXIS2_EXTERN axiom_soap_header_block_t *AXIS2_CALL +axiom_soap_header_block_create_with_parent( + const axutil_env_t * env, + const axis2_char_t * localname, + axiom_namespace_t * ns, + axiom_soap_header_t * header) +{ + axiom_soap_header_block_t *header_block = NULL; + axiom_node_t *this_node = NULL; + axiom_node_t *parent_node = NULL; + axiom_element_t *om_ele = NULL; + AXIS2_PARAM_CHECK(env->error, localname, NULL); + + header_block = axiom_soap_header_block_create(env); + if(!header_block) + { + return NULL; + } + parent_node = axiom_soap_header_get_base_node(header, env); + if(!parent_node) + { + return NULL; + } + om_ele = axiom_element_create(env, parent_node, localname, ns, &this_node); + if(!om_ele) + { + axiom_soap_header_block_free(header_block, env); + return NULL; + } + header_block->om_ele_node = this_node; + + axiom_soap_header_set_header_block(header, env, header_block); + + header_block->soap_version = axiom_soap_header_get_soap_version(header, env); + + return header_block; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_soap_header_block_free( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env) +{ + AXIS2_FREE(env->allocator, header_block); + return; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_header_block_set_role( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + axis2_char_t * role_uri) +{ + const axis2_char_t *attr_localname = NULL; + const axis2_char_t *attr_nsuri = NULL; + + if(header_block->soap_version == AXIOM_SOAP_VERSION_NOT_SET) + { + return AXIS2_FAILURE; + } + if(header_block->soap_version == AXIOM_SOAP11) + { + attr_localname = AXIOM_SOAP11_ATTR_ACTOR; + attr_nsuri = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI; + } + if(header_block->soap_version == AXIOM_SOAP12) + { + attr_localname = AXIOM_SOAP12_SOAP_ROLE; + attr_nsuri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI; + } + axiom_soap_header_block_set_attribute(header_block, env, attr_localname, role_uri, attr_nsuri); + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL axiom_soap_header_block_get_role( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env) +{ + const axis2_char_t *attr_localname = NULL; + const axis2_char_t *attr_nsuri = NULL; + + if (header_block->soap_version == AXIOM_SOAP_VERSION_NOT_SET) + { + return NULL; + } + if (header_block->soap_version == AXIOM_SOAP11) + { + attr_localname = AXIOM_SOAP11_ATTR_ACTOR; + attr_nsuri = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI; + } + if (header_block->soap_version == AXIOM_SOAP12) + { + attr_localname = AXIOM_SOAP12_SOAP_ROLE; + attr_nsuri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI; + } + return axiom_soap_header_block_get_attribute(header_block, env, + attr_localname, attr_nsuri); +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_header_block_set_must_understand_with_bool( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + axis2_bool_t must_understand) +{ + const axis2_char_t *attr_nsuri = NULL; + const axis2_char_t *attr_value = NULL; + + if(header_block->soap_version == AXIOM_SOAP_VERSION_NOT_SET) + { + return AXIS2_FAILURE; + } + if(header_block->soap_version == AXIOM_SOAP11) + { + attr_nsuri = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI; + } + if(header_block->soap_version == AXIOM_SOAP12) + { + attr_nsuri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI; + } + if(must_understand) + { + attr_value = "1"; + } + else + { + attr_value = "0"; + } + return axiom_soap_header_block_set_attribute(header_block, env, + AXIOM_SOAP_ATTR_MUST_UNDERSTAND, attr_value, attr_nsuri); + +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_header_block_set_must_understand_with_string( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + axis2_char_t * must_understand) +{ + const axis2_char_t *attr_nsuri = NULL; + + AXIS2_PARAM_CHECK(env->error, must_understand, AXIS2_FAILURE); + + if(header_block->soap_version == AXIOM_SOAP_VERSION_NOT_SET) + { + return AXIS2_FAILURE; + } + if(header_block->soap_version == AXIOM_SOAP11) + { + attr_nsuri = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI; + } + if(header_block->soap_version == AXIOM_SOAP12) + { + attr_nsuri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI; + } + + if(axutil_strcmp(AXIOM_SOAP_ATTR_MUST_UNDERSTAND_TRUE, must_understand) == 0 || axutil_strcmp( + AXIOM_SOAP_ATTR_MUST_UNDERSTAND_FALSE, must_understand) == 0 || axutil_strcmp( + AXIOM_SOAP_ATTR_MUST_UNDERSTAND_0, must_understand) == 0 || axutil_strcmp( + AXIOM_SOAP_ATTR_MUST_UNDERSTAND_1, must_understand) == 0) + { + + axiom_soap_header_block_set_attribute(header_block, env, AXIOM_SOAP_ATTR_MUST_UNDERSTAND, + must_understand, attr_nsuri); + return AXIS2_SUCCESS; + } + else + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_MUST_UNDERSTAND_SHOULD_BE_1_0_TRUE_FALSE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_soap_header_block_get_must_understand( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env) +{ + const axis2_char_t *must_understand = NULL; + const axis2_char_t *attr_nsuri = NULL; + + if(header_block->soap_version == AXIOM_SOAP_VERSION_NOT_SET) + { + return AXIS2_FAILURE; + } + if(header_block->soap_version == AXIOM_SOAP11) + { + attr_nsuri = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI; + } + if(header_block->soap_version == AXIOM_SOAP12) + { + attr_nsuri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI; + } + must_understand = axiom_soap_header_block_get_attribute(header_block, env, + AXIOM_SOAP_ATTR_MUST_UNDERSTAND, attr_nsuri); + if(!must_understand) + { + return AXIS2_FALSE; + } + if(axutil_strcmp(must_understand, AXIOM_SOAP_ATTR_MUST_UNDERSTAND_1) == 0 || axutil_strcmp( + must_understand, AXIOM_SOAP_ATTR_MUST_UNDERSTAND_TRUE) == 0) + { + return AXIS2_TRUE; + } + else if(axutil_strcmp(must_understand, AXIOM_SOAP_ATTR_MUST_UNDERSTAND_0) == 0 + || axutil_strcmp(must_understand, AXIOM_SOAP_ATTR_MUST_UNDERSTAND_FALSE) == 0) + { + return AXIS2_FALSE; + } + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_VALUE_FOUND_IN_MUST_UNDERSTAND, AXIS2_FAILURE); + return AXIS2_FALSE; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_header_block_set_attribute( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + const axis2_char_t * attr_name, + const axis2_char_t * attr_value, + const axis2_char_t * soap_envelope_namespace_uri) +{ + axiom_attribute_t *om_attr = NULL; + axiom_node_t *header_node = NULL; + axiom_element_t *header_ele = NULL; + axiom_namespace_t *header_ns = NULL; + axis2_char_t *prefix = NULL; + axutil_qname_t *qn = NULL; + axiom_namespace_t *om_ns = NULL; + axiom_element_t *om_ele = NULL; + + AXIS2_PARAM_CHECK(env->error, attr_name, AXIS2_FAILURE); + + header_node = axiom_node_get_parent(header_block->om_ele_node, env); + if(!header_node) + { + return AXIS2_FAILURE; + } + if(axiom_node_get_node_type(header_node, env) == AXIOM_ELEMENT) + { + header_ele = (axiom_element_t *)axiom_node_get_data_element(header_node, env); + if(!header_ele) + { + return AXIS2_FAILURE; + } + header_ns = axiom_element_get_namespace(header_ele, env, header_node); + if(!header_ns) + { + return AXIS2_FAILURE; + } + prefix = axiom_namespace_get_prefix(header_ns, env); + } + + qn = axutil_qname_create(env, attr_name, soap_envelope_namespace_uri, prefix); + + if(!qn) + { + return AXIS2_FAILURE; + } + if(!header_block->om_ele_node) + { + return AXIS2_FAILURE; + } + om_ele = (axiom_element_t *)axiom_node_get_data_element(header_block-> om_ele_node, env); + + om_attr = axiom_element_get_attribute(om_ele, env, qn); + + axutil_qname_free(qn, env); + if(om_attr) + { + return axiom_attribute_set_value(om_attr, env, attr_value); + } + if(soap_envelope_namespace_uri) + { + if(prefix) + { + om_ns = axiom_namespace_create(env, soap_envelope_namespace_uri, prefix); + } + else + { + om_ns = axiom_namespace_create(env, soap_envelope_namespace_uri, + AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX); + } + } + om_attr = axiom_attribute_create(env, attr_name, attr_value, om_ns); + if(!om_attr && om_ns) + { + axiom_namespace_free(om_ns, env); + return AXIS2_FAILURE; + } + + return axiom_element_add_attribute(om_ele, env, om_attr, header_block->om_ele_node); +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_soap_header_block_get_attribute( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + const axis2_char_t * attr_name, + const axis2_char_t * soap_envelope_namespace_uri) +{ + axiom_attribute_t *om_attr = NULL; + axis2_char_t *attr_value = NULL; + axiom_node_t *header_node = NULL; + axiom_element_t *header_ele = NULL; + axiom_namespace_t *header_ns = NULL; + axis2_char_t *prefix = NULL; + axutil_qname_t *qn = NULL; + axiom_element_t *om_ele = NULL; + AXIS2_PARAM_CHECK(env->error, attr_name, NULL); + AXIS2_PARAM_CHECK(env->error, soap_envelope_namespace_uri, NULL); + + header_node = axiom_node_get_parent(header_block->om_ele_node, env); + if(!header_node) + { + return NULL; + } + if(axiom_node_get_node_type(header_node, env) == AXIOM_ELEMENT) + { + header_ele = (axiom_element_t *)axiom_node_get_data_element(header_node, env); + if(!header_ele) + { + return NULL; + } + header_ns = axiom_element_get_namespace(header_ele, env, header_node); + if(!header_ns) + { + return NULL; + } + prefix = axiom_namespace_get_prefix(header_ns, env); + } + qn = axutil_qname_create(env, attr_name, soap_envelope_namespace_uri, prefix); + if(!qn) + { + return NULL; + } + om_ele = (axiom_element_t *)axiom_node_get_data_element(header_block-> om_ele_node, env); + om_attr = axiom_element_get_attribute(om_ele, env, qn); + if(om_attr) + { + attr_value = axiom_attribute_get_value(om_attr, env); + } + axutil_qname_free(qn, env); + return attr_value; +} + +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_soap_header_block_is_processed( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env) +{ + return header_block->processed; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_header_block_set_processed( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env) +{ + header_block->processed = AXIS2_TRUE; + return AXIS2_SUCCESS; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_header_block_set_base_node( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + axiom_node_t * node) +{ + AXIS2_PARAM_CHECK(env->error, node, AXIS2_FAILURE); + + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_BASE_TYPE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + header_block->om_ele_node = node; + return AXIS2_SUCCESS; + +} + +AXIS2_EXTERN axiom_node_t *AXIS2_CALL axiom_soap_header_block_get_base_node( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env) +{ + return header_block->om_ele_node; +} + +AXIS2_EXTERN int AXIS2_CALL axiom_soap_header_block_get_soap_version( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env) +{ + return header_block->soap_version; +} + +AXIS2_EXTERN axis2_status_t AXIS2_CALL +axiom_soap_header_block_set_soap_version( + axiom_soap_header_block_t * header_block, + const axutil_env_t * env, + int soap_version) +{ + + header_block->soap_version = soap_version; + return AXIS2_SUCCESS; +} diff --git a/axiom/src/util/Makefile.am b/axiom/src/util/Makefile.am new file mode 100644 index 0000000..ea76b68 --- /dev/null +++ b/axiom/src/util/Makefile.am @@ -0,0 +1,8 @@ +noinst_LTLIBRARIES = libaxis2_axiom_util.la +libaxis2_axiom_util_la_SOURCES = om_util.c + +libaxis2_axiom_util_la_LIBADD = +INCLUDES = -I$(top_builddir)/include \ + -I$(top_builddir)/src/parser \ + -I$(top_builddir)/src/om \ + -I ../../../util/include diff --git a/axiom/src/util/om_util.c b/axiom/src/util/om_util.c new file mode 100644 index 0000000..fcdd90b --- /dev/null +++ b/axiom/src/util/om_util.c @@ -0,0 +1,1181 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_document.h> +#include <axutil_array_list.h> +#include <axutil_uri.h> +#include <axiom_util.h> + + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_util_get_child_text( + axiom_node_t *node, + const axutil_env_t * env) +{ + axiom_element_t *ele = NULL; + axis2_char_t *txt = NULL; + + ele = (axiom_element_t*)axiom_node_get_data_element(node, env); + txt = axiom_element_get_text(ele, env, node); + + return txt; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_first_child_element_with_uri( + axiom_node_t * ele_node, + const axutil_env_t * env, + axis2_char_t * uri, + axiom_node_t ** child) +{ + axiom_node_t *child_node = NULL; + + if(!ele_node || !uri) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Element node or uri is NULL"); + return NULL; + } + + child_node = axiom_node_get_first_child(ele_node, env); + while(child_node) + { + if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT) + { + axiom_element_t *child_ele = NULL; + axiom_namespace_t *ns = NULL; + + child_ele = (axiom_element_t *)axiom_node_get_data_element(child_node, env); + ns = axiom_element_get_namespace(child_ele, env, child_node); + if(ns) + { + axis2_char_t *child_uri = NULL; + child_uri = axiom_namespace_get_uri(ns, env); + if(child_uri && axutil_strcmp(child_uri, uri) == 0) + { + (*child) = child_node; + return child_ele; + } + } + } + child_node = axiom_node_get_next_sibling(child_node, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_next_sibling_element_with_uri( + axiom_node_t * ele_node, + const axutil_env_t * env, + axis2_char_t * uri, + axiom_node_t ** next_node) +{ + axiom_node_t *next_sib_node = NULL; + if(!ele_node || !uri) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE); + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Element node or uri is NULL"); + return NULL; + } + + next_sib_node = axiom_node_get_next_sibling(ele_node, env); + while(next_sib_node) + { + if(axiom_node_get_node_type(next_sib_node, env) == AXIOM_ELEMENT) + { + axiom_element_t *sib_ele = NULL; + axiom_namespace_t *ns = NULL; + + sib_ele = (axiom_element_t *)axiom_node_get_data_element(next_sib_node, env); + ns = axiom_element_get_namespace(sib_ele, env, next_sib_node); + if(ns) + { + axis2_char_t *sib_uri = NULL; + sib_uri = axiom_namespace_get_uri(ns, env); + if(sib_uri && axutil_strcmp(sib_uri, uri) == 0) + { + (*next_node) = next_sib_node; + return sib_ele; + } + } + } + next_sib_node = axiom_node_get_next_sibling(next_sib_node, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_first_child_element( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axiom_node_t ** child_node) +{ + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + AXIS2_PARAM_CHECK(env->error, child_node, NULL); + + return axiom_element_get_first_element(ele, env, ele_node, child_node); +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_last_child_element( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axiom_node_t ** child_node) +{ + axiom_node_t *last_node = NULL; + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + AXIS2_PARAM_CHECK(env->error, child_node, NULL); + + last_node = axiom_node_get_last_child(ele_node, env); + while(last_node) + { + if(axiom_node_get_node_type(last_node, env) == AXIOM_ELEMENT) + { + *child_node = last_node; + return (axiom_element_t *)axiom_node_get_data_element(last_node, env); + + } + last_node = axiom_node_get_previous_sibling(ele_node, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_next_sibling_element( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axiom_node_t ** next_node) +{ + axiom_node_t *next_sibling = NULL; + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + + next_sibling = axiom_node_get_next_sibling(ele_node, env); + while(next_sibling) + { + if(axiom_node_get_node_type(next_sibling, env) == AXIOM_ELEMENT) + { + *next_node = next_sibling; + return (axiom_element_t *)axiom_node_get_data_element(next_sibling, env); + } + next_sibling = axiom_node_get_next_sibling(next_sibling, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_first_child_element_with_localname( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axiom_node_t ** child_node) +{ + axiom_node_t *child = NULL; + axiom_node_t *next_sibling = NULL; + axis2_char_t *child_localname = NULL; + axiom_element_t *om_ele = NULL; + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + AXIS2_PARAM_CHECK(env->error, child_node, NULL); + AXIS2_PARAM_CHECK(env->error, localname, NULL); + + child = axiom_node_get_first_child(ele_node, env); + if(child) + { + if(axiom_node_get_node_type(child, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(child, env); + if(om_ele) + { + child_localname = axiom_element_get_localname(om_ele, env); + if(child_localname && axutil_strcmp(child_localname, localname) == 0) + { + *child_node = child; + return om_ele; + } + } + } + om_ele = NULL; + child_localname = NULL; + } + + next_sibling = axiom_node_get_next_sibling(child, env); + while(next_sibling) + { + if(axiom_node_get_node_type(next_sibling, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(next_sibling, env); + if(om_ele) + { + child_localname = axiom_element_get_localname(om_ele, env); + if(child_localname && axutil_strcmp(child_localname, localname) == 0) + { + *child_node = next_sibling; + return om_ele; + } + + } + om_ele = NULL; + child_localname = NULL; + } + next_sibling = axiom_node_get_next_sibling(next_sibling, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_last_child_element_with_localname( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axiom_node_t ** child_node) +{ + axiom_node_t *child = NULL; + axiom_element_t *om_ele = NULL; + axis2_char_t *child_localname = NULL; + + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + AXIS2_PARAM_CHECK(env->error, localname, NULL); + AXIS2_PARAM_CHECK(env->error, child_node, NULL); + + child = axiom_node_get_last_child(ele_node, env); + while(child) + { + if(axiom_node_get_node_type(child, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(ele_node, env); + if(om_ele) + { + child_localname = axiom_element_get_localname(om_ele, env); + if(child_localname && axutil_strcmp(child_localname, localname) == 0) + { + *child_node = child; + return om_ele; + } + + } + om_ele = NULL; + child_localname = NULL; + } + child = axiom_node_get_previous_sibling(child, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_next_siblng_element_with_localname( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axiom_node_t ** next_node) +{ + axiom_node_t *next_sibling = NULL; + axiom_element_t *om_ele = NULL; + axis2_char_t *ele_localname = NULL; + + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + + next_sibling = axiom_node_get_next_sibling(ele_node, env); + while(next_sibling) + { + if(axiom_node_get_node_type(next_sibling, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(next_sibling, env); + if(om_ele) + { + ele_localname = axiom_element_get_localname(om_ele, env); + if(ele_localname && axutil_strcmp(localname, ele_localname) == 0) + { + *next_node = next_sibling; + return om_ele; + } + } + om_ele = NULL; + ele_localname = NULL; + } + next_sibling = axiom_node_get_next_sibling(next_sibling, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_first_child_element_with_uri_localname( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axis2_char_t * uri, + axiom_node_t ** child_node) +{ + axiom_node_t *child = NULL; + axiom_node_t *next_sibling = NULL; + axis2_char_t *child_localname = NULL; + axiom_element_t *om_ele = NULL; + axiom_namespace_t *ns = NULL; + axis2_char_t *ns_uri = NULL; + + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + AXIS2_PARAM_CHECK(env->error, child_node, NULL); + AXIS2_PARAM_CHECK(env->error, localname, NULL); + AXIS2_PARAM_CHECK(env->error, uri, NULL); + + child = axiom_node_get_first_child(ele_node, env); + if(!child) + { + return NULL; + + } + if(axiom_node_get_node_type(ele_node, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(child, env); + if(om_ele) + { + child_localname = axiom_element_get_localname(om_ele, env); + ns = axiom_element_get_namespace(om_ele, env, child); + if(ns) + { + ns_uri = axiom_namespace_get_uri(ns, env); + } + + if((child_localname) && (axutil_strcmp(child_localname, localname) == 0) && (ns_uri) + && (axutil_strcmp(ns_uri, uri) == 0)) + { + *child_node = child; + return om_ele; + } + } + } + om_ele = NULL; + child_localname = NULL; + ns = NULL; + ns_uri = NULL; + + next_sibling = axiom_node_get_next_sibling(child, env); + while(next_sibling) + { + if(axiom_node_get_node_type(next_sibling, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(next_sibling, env); + if(om_ele) + { + child_localname = axiom_element_get_localname(om_ele, env); + ns = axiom_element_get_namespace(om_ele, env, next_sibling); + if(ns) + { + ns_uri = axiom_namespace_get_uri(ns, env); + } + + if((child_localname) && (axutil_strcmp(child_localname, localname) == 0) + && (ns_uri) && (axutil_strcmp(ns_uri, uri) == 0)) + { + *child_node = next_sibling; + return om_ele; + } + + } + om_ele = NULL; + child_localname = NULL; + ns = NULL; + ns_uri = NULL; + } + next_sibling = axiom_node_get_next_sibling(next_sibling, env); + } + return NULL; +} +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_last_child_element_with_uri_localname( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axis2_char_t * uri, + axiom_node_t ** child_node) +{ + axiom_node_t *child = NULL; + axiom_element_t *om_ele = NULL; + axis2_char_t *child_localname = NULL; + axiom_namespace_t *ns = NULL; + axis2_char_t *ns_uri = NULL; + + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + AXIS2_PARAM_CHECK(env->error, localname, NULL); + AXIS2_PARAM_CHECK(env->error, child_node, NULL); + AXIS2_PARAM_CHECK(env->error, uri, NULL); + + child = axiom_node_get_last_child(ele_node, env); + while(child) + { + if(axiom_node_get_node_type(child, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(ele_node, env); + if(om_ele) + { + ns = axiom_element_get_namespace(om_ele, env, ele_node); + if(ns) + { + ns_uri = axiom_namespace_get_uri(ns, env); + } + child_localname = axiom_element_get_localname(om_ele, env); + if(child_localname && (axutil_strcmp(child_localname, localname) == 0) && (ns_uri) + && (axutil_strcmp(ns_uri, uri) == 0)) + { + *child_node = child; + return om_ele; + } + } + om_ele = NULL; + child_localname = NULL; + ns = NULL; + ns_uri = NULL; + } + child = axiom_node_get_previous_sibling(child, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_next_sibling_element_with_uri_localname( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axis2_char_t * uri, + axiom_node_t ** next_node) +{ + axiom_node_t *next_sibling = NULL; + axiom_element_t *om_ele = NULL; + axis2_char_t *ele_localname = NULL; + axiom_namespace_t *ns = NULL; + axis2_char_t *ns_uri = NULL; + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + + next_sibling = axiom_node_get_next_sibling(ele_node, env); + while(next_sibling) + { + if(axiom_node_get_node_type(next_sibling, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(next_sibling, env); + if(om_ele) + { + ns = axiom_element_get_namespace(om_ele, env, next_sibling); + if(ns) + { + ns_uri = axiom_namespace_get_uri(ns, env); + } + ele_localname = axiom_element_get_localname(om_ele, env); + if(ele_localname && (axutil_strcmp(localname, ele_localname) == 0) && (ns) + && (axutil_strcmp(ns_uri, uri) == 0)) + { + *next_node = next_sibling; + return om_ele; + } + } + om_ele = NULL; + ele_localname = NULL; + ns_uri = NULL; + ns = NULL; + } + next_sibling = axiom_node_get_next_sibling(next_sibling, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_first_child_element_with_localnames( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axutil_array_list_t * names, + axiom_node_t ** child_node) +{ + axiom_node_t *child = NULL; + axiom_node_t *next_sibling = NULL; + axis2_char_t *child_localname = NULL; + axis2_char_t *given_localname = NULL; + axiom_element_t *om_ele = NULL; + int size = 0; + int i = 0; + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + AXIS2_PARAM_CHECK(env->error, child_node, NULL); + AXIS2_PARAM_CHECK(env->error, names, NULL); + + child = axiom_node_get_first_child(ele_node, env); + if(child) + { + if(axiom_node_get_node_type(child, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(child, env); + if(om_ele) + { + size = axutil_array_list_size(names, env); + child_localname = axiom_element_get_localname(om_ele, env); + + for(i = 0; i < size; i++) + { + given_localname = (axis2_char_t *)axutil_array_list_get(names, env, i); + + if((child_localname) && (NULL != given_localname) && axutil_strcmp( + child_localname, given_localname) == 0) + { + *child_node = child; + return om_ele; + } + given_localname = NULL; + } + } + } + om_ele = NULL; + child_localname = NULL; + given_localname = NULL; + size = 0; + } + + next_sibling = axiom_node_get_next_sibling(child, env); + while(next_sibling) + { + if(axiom_node_get_node_type(next_sibling, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(next_sibling, env); + if(om_ele) + { + size = axutil_array_list_size(names, env); + child_localname = axiom_element_get_localname(om_ele, env); + for(i = 0; i < size; i++) + { + given_localname = (axis2_char_t *)axutil_array_list_get(names, env, i); + if((child_localname) && (NULL != given_localname) && (axutil_strcmp( + child_localname, given_localname) == 0)) + { + *child_node = next_sibling; + return om_ele; + } + given_localname = NULL; + } + } + om_ele = NULL; + child_localname = NULL; + given_localname = NULL; + } + next_sibling = axiom_node_get_next_sibling(next_sibling, env); + } + return NULL; + +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_last_child_element_with_localnames( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axutil_array_list_t * names, + axiom_node_t ** child_node) +{ + axiom_node_t *child = NULL; + axiom_element_t *om_ele = NULL; + axis2_char_t *child_localname = NULL; + axis2_char_t *given_localname = NULL; + int size = 0; + int i = 0; + + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + AXIS2_PARAM_CHECK(env->error, names, NULL); + AXIS2_PARAM_CHECK(env->error, child_node, NULL); + + child = axiom_node_get_last_child(ele_node, env); + while(child) + { + if(axiom_node_get_node_type(child, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(ele_node, env); + if(om_ele) + { + size = axutil_array_list_size(names, env); + for(i = 0; i < size; i++) + { + given_localname = (axis2_char_t *)axutil_array_list_get(names, env, i); + child_localname = axiom_element_get_localname(om_ele, env); + if(child_localname && (NULL != given_localname) && (axutil_strcmp( + child_localname, given_localname) == 0)) + { + *child_node = child; + return om_ele; + } + } + } + om_ele = NULL; + child_localname = NULL; + given_localname = NULL; + } + child = axiom_node_get_previous_sibling(child, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_next_siblng_element_with_localnames( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axutil_array_list_t * names, + axiom_node_t ** next_node) +{ + axiom_node_t *next_sibling = NULL; + axiom_element_t *om_ele = NULL; + axis2_char_t *ele_localname = NULL; + axis2_char_t *given_localname = NULL; + int size = 0; + int i = 0; + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + AXIS2_PARAM_CHECK(env->error, names, NULL); + AXIS2_PARAM_CHECK(env->error, next_node, NULL); + + next_sibling = axiom_node_get_next_sibling(ele_node, env); + while(next_sibling) + { + if(axiom_node_get_node_type(next_sibling, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(next_sibling, env); + if(om_ele) + { + size = axutil_array_list_size(names, env); + for(i = 0; i < size; i++) + { + given_localname = (axis2_char_t *)axutil_array_list_get(names, env, i); + ele_localname = axiom_element_get_localname(om_ele, env); + if((ele_localname) && (NULL != given_localname) && (axutil_strcmp( + given_localname, ele_localname) == 0)) + { + *next_node = next_sibling; + return om_ele; + } + + } + } + om_ele = NULL; + ele_localname = NULL; + } + next_sibling = axiom_node_get_next_sibling(next_sibling, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_first_child_element_with_localname_attr( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axis2_char_t * attr_name, + axis2_char_t * attr_value, + axiom_node_t ** child_node) +{ + axiom_node_t *child = NULL; + axiom_node_t *next_sibling = NULL; + axis2_char_t *child_localname = NULL; + axiom_element_t *om_ele = NULL; + axiom_attribute_t *om_attr = NULL; + axutil_hash_t *attr_ht = NULL; + axutil_hash_index_t *hi = NULL; + axis2_char_t *om_attr_value = NULL; + axis2_char_t *om_attr_name = NULL; + + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + AXIS2_PARAM_CHECK(env->error, child_node, NULL); + AXIS2_PARAM_CHECK(env->error, localname, NULL); + AXIS2_PARAM_CHECK(env->error, attr_name, NULL); + AXIS2_PARAM_CHECK(env->error, attr_value, NULL); + + child = axiom_node_get_first_child(ele_node, env); + + if(child) + { + if(axiom_node_get_node_type(child, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(child, env); + if(om_ele) + { + + child_localname = axiom_element_get_localname(om_ele, env); + if(child_localname && axutil_strcmp(child_localname, localname) == 0) + { + attr_ht = axiom_element_get_all_attributes(om_ele, env); + if(attr_ht) + { + for(hi = axutil_hash_first(attr_ht, env); hi; hi + = axutil_hash_next(env, hi)) + { + void *val = NULL; + axutil_hash_this(hi, NULL, NULL, &val); + if(val) + { + om_attr = (axiom_attribute_t *)val; + om_attr_name = axiom_attribute_get_localname(om_attr, env); + + om_attr_value = axiom_attribute_get_value(om_attr, env); + if(om_attr_name && NULL != om_attr_value && axutil_strcmp( + om_attr_name, attr_name) == 0 && axutil_strcmp(om_attr_value, + attr_value) == 0) + { + AXIS2_FREE(env->allocator, hi); + *child_node = child; + return om_ele; + } + om_attr = NULL; + om_attr_name = NULL; + om_attr_value = NULL; + } + } + } + } + } + } + om_ele = NULL; + child_localname = NULL; + hi = NULL; + } + + next_sibling = axiom_node_get_next_sibling(child, env); + while(next_sibling) + { + if(axiom_node_get_node_type(next_sibling, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(next_sibling, env); + if(om_ele) + { + child_localname = axiom_element_get_localname(om_ele, env); + if(child_localname && axutil_strcmp(child_localname, localname) == 0) + { + attr_ht = axiom_element_get_all_attributes(om_ele, env); + if(attr_ht) + { + + for(hi = axutil_hash_first(attr_ht, env); hi; hi + = axutil_hash_next(env, hi)) + { + void *val = NULL; + axutil_hash_this(hi, NULL, NULL, &val); + if(val) + { + om_attr = (axiom_attribute_t *)val; + om_attr_name = axiom_attribute_get_localname(om_attr, env); + + om_attr_value = axiom_attribute_get_value(om_attr, env); + + if(om_attr_name && NULL != om_attr_value && axutil_strcmp( + om_attr_name, attr_name) == 0 && axutil_strcmp(om_attr_value, + attr_value) == 0) + { + *child_node = child; + return om_ele; + } + om_attr = NULL; + om_attr_name = NULL; + om_attr_value = NULL; + } + } + } + } + + } + om_ele = NULL; + child_localname = NULL; + } + next_sibling = axiom_node_get_next_sibling(next_sibling, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_last_child_element_with_localname_attr( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axis2_char_t * attr_name, + axis2_char_t * attr_value, + axiom_node_t ** child_node) +{ + axiom_node_t *child = NULL; + axiom_element_t *om_ele = NULL; + axis2_char_t *child_localname = NULL; + axiom_attribute_t *om_attr = NULL; + axis2_char_t *om_attr_name = NULL; + axis2_char_t *om_attr_value = NULL; + axutil_hash_index_t *hi = NULL; + axutil_hash_t *attr_ht = NULL; + + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + AXIS2_PARAM_CHECK(env->error, localname, NULL); + AXIS2_PARAM_CHECK(env->error, child_node, NULL); + + child = axiom_node_get_last_child(ele_node, env); + while(child) + { + if(axiom_node_get_node_type(child, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(ele_node, env); + if(om_ele) + { + child_localname = axiom_element_get_localname(om_ele, env); + if(child_localname && axutil_strcmp(child_localname, localname) == 0) + { + attr_ht = axiom_element_get_all_attributes(om_ele, env); + if(attr_ht) + { + for(hi = axutil_hash_first(attr_ht, env); hi; hi + = axutil_hash_next(env, hi)) + { + void *val = NULL; + axutil_hash_this(hi, NULL, NULL, &val); + if(val) + { + om_attr = (axiom_attribute_t *)val; + om_attr_name = axiom_attribute_get_localname(om_attr, env); + + om_attr_value = axiom_attribute_get_value(om_attr, env); + + if(om_attr_name && NULL != om_attr_value && axutil_strcmp( + om_attr_name, attr_name) == 0 && axutil_strcmp(om_attr_value, + attr_value) == 0) + { + AXIS2_FREE(env->allocator, hi); + *child_node = child; + return om_ele; + } + om_attr = NULL; + om_attr_name = NULL; + om_attr_value = NULL; + } + } + } + } + + } + om_ele = NULL; + child_localname = NULL; + } + child = axiom_node_get_previous_sibling(child, env); + } + return NULL; +} + +AXIS2_EXTERN axiom_element_t *AXIS2_CALL +axiom_util_get_next_siblng_element_with_localname_attr( + axiom_element_t * ele, + const axutil_env_t * env, + axiom_node_t * ele_node, + axis2_char_t * localname, + axis2_char_t * attr_name, + axis2_char_t * attr_value, + axiom_node_t ** child_node) +{ + axiom_node_t *next_sibling = NULL; + axiom_element_t *om_ele = NULL; + axis2_char_t *ele_localname = NULL; + axiom_attribute_t *om_attr = NULL; + axis2_char_t *om_attr_value = NULL; + axis2_char_t *om_attr_name = NULL; + axutil_hash_t *attr_ht = NULL; + axutil_hash_index_t *hi = NULL; + + AXIS2_PARAM_CHECK(env->error, ele_node, NULL); + + next_sibling = axiom_node_get_next_sibling(ele_node, env); + while(next_sibling) + { + if(axiom_node_get_node_type(next_sibling, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *)axiom_node_get_data_element(next_sibling, env); + if(om_ele) + { + ele_localname = axiom_element_get_localname(om_ele, env); + if(ele_localname && axutil_strcmp(localname, ele_localname) == 0) + { + attr_ht = axiom_element_get_all_attributes(om_ele, env); + if(attr_ht) + { + for(hi = axutil_hash_first(attr_ht, env); hi; hi + = axutil_hash_next(env, hi)) + { + void *val = NULL; + axutil_hash_this(hi, NULL, NULL, &val); + if(val) + { + om_attr = (axiom_attribute_t *)val; + om_attr_name = axiom_attribute_get_localname(om_attr, env); + + om_attr_value = axiom_attribute_get_value(om_attr, env); + + if(om_attr_name && NULL != om_attr_value && axutil_strcmp( + om_attr_name, attr_name) == 0 && axutil_strcmp(om_attr_value, + attr_value) == 0) + { + AXIS2_FREE(env->allocator, hi); + *child_node = next_sibling; + return om_ele; + } + om_attr = NULL; + om_attr_name = NULL; + om_attr_value = NULL; + } + } + } + } + } + om_ele = NULL; + ele_localname = NULL; + } + next_sibling = axiom_node_get_next_sibling(next_sibling, env); + } + return NULL; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_util_get_child_node_text( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + axiom_element_t *om_ele = NULL; + if(!om_node) + { + return NULL; + } + if(axiom_node_get_node_type(om_node, env) != AXIOM_ELEMENT) + { + return NULL; + } + + om_ele = (axiom_element_t *)axiom_node_get_data_element(om_node, env); + + if(om_ele) + { + return axiom_element_get_text(om_ele, env, om_node); + } + return NULL; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_util_get_localname( + axiom_node_t * node, + const axutil_env_t * env) +{ + axiom_element_t *om_ele = NULL; + + AXIS2_ENV_CHECK(env, NULL); + if(!node) + { + return NULL; + } + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + return NULL; + } + om_ele = (axiom_element_t *)axiom_node_get_data_element(node, env); + if(om_ele) + { + return axiom_element_get_localname(om_ele, env); + } + return NULL; +} + +AXIS2_EXTERN axis2_char_t *AXIS2_CALL +axiom_util_get_node_namespace_uri( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + axiom_element_t *om_ele = NULL; + axiom_namespace_t *om_ns = NULL; + if(!om_node) + { + return NULL; + } + if(axiom_node_get_node_type(om_node, env) == AXIOM_ELEMENT) + { + om_ele = axiom_node_get_data_element(om_node, env); + if(!om_ele) + { + return NULL; + } + om_ns = axiom_element_get_namespace(om_ele, env, om_node); + if(om_ns) + { + return axiom_namespace_get_uri(om_ns, env); + } + } + return NULL; +} + +AXIS2_EXTERN axiom_child_element_iterator_t *AXIS2_CALL +axiom_util_get_child_elements( + axiom_element_t * om_ele, + const axutil_env_t * env, + axiom_node_t * om_node) +{ + axiom_element_t *first_ele = NULL; + axiom_node_t *first_node = NULL; + AXIS2_PARAM_CHECK(env->error, om_node, NULL); + AXIS2_PARAM_CHECK(env->error, om_ele, NULL); + first_ele = axiom_element_get_first_element(om_ele, env, om_node, &first_node); + if(first_ele) + { + return axiom_child_element_iterator_create(env, first_node); + } + return NULL; +} + +AXIS2_EXTERN axiom_document_t *AXIS2_CALL +axiom_util_new_document( + const axutil_env_t * env, + const axutil_uri_t * uri) +{ + axis2_char_t *path = NULL; + axiom_xml_reader_t *reader = NULL; + axiom_stax_builder_t *om_builder = NULL; + axiom_document_t *doc = NULL; + + AXIS2_PARAM_CHECK(env->error, uri, NULL); + /* This is temporary code. Later complete the code to read from uri and build + * the document + */ + if(uri) + { + path = axutil_uri_get_path((axutil_uri_t *)uri, env); + } + else + { + return NULL; + } + if(path) + { + reader = axiom_xml_reader_create_for_file(env, path, NULL); + } + else + { + return NULL; + } + if(reader) + { + om_builder = axiom_stax_builder_create(env, reader); + } + else + { + return NULL; + } + if(om_builder) + { + doc = axiom_stax_builder_get_document(om_builder, env); + } + else + { + return NULL; + } + if(doc) + { + axiom_document_build_all(doc, env); + } + else + { + return NULL; + } + + return doc; +} + +AXIS2_EXTERN axiom_node_t* AXIS2_CALL +axiom_util_get_node_by_local_name( + const axutil_env_t *env, + axiom_node_t *node, + axis2_char_t *local_name) +{ + axis2_char_t *temp_name = NULL; + + if(!node) + { + return NULL; + } + + if(axiom_node_get_node_type(node, env) != AXIOM_ELEMENT) + { + return NULL; + } + + temp_name = axiom_util_get_localname(node, env); + AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[rampart]Checking node %s for %s", temp_name, + local_name); + + if(!axutil_strcmp(temp_name, local_name)) + { + /* Gottcha.. return this node */ + return node; + } + else + { + /* Doesn't match? Get the children and search for them */ + axiom_node_t *temp_node = NULL; + + temp_node = axiom_node_get_first_element(node, env); + while(temp_node) + { + axiom_node_t *res_node = NULL; + res_node = axiom_util_get_node_by_local_name(env, temp_node, local_name); + if(res_node) + { + return res_node; + } + temp_node = axiom_node_get_next_sibling(temp_node, env); + } + } + return NULL; +} + +/** + * Creates a clone of given node + * @param env environment, MUST not be NULL + * @param node node to be cloned + * @return cloned node + */ +AXIS2_EXTERN axiom_node_t *AXIS2_CALL +axiom_util_clone_node( + const axutil_env_t *env, + axiom_node_t *node) +{ + axis2_char_t* node_string = NULL; + axiom_node_t *clone = NULL; + + if(!node) + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, + "Could not be able to clone the node. Given node is not valid."); + return NULL; + } + + node_string = axiom_node_sub_tree_to_string(node, env); + clone = axiom_node_create_from_buffer(env, node_string); + + if(node_string) + { + AXIS2_FREE(env->allocator, node_string); + } + + return clone; +} diff --git a/axiom/src/xpath/Makefile.am b/axiom/src/xpath/Makefile.am new file mode 100644 index 0000000..5d4f42f --- /dev/null +++ b/axiom/src/xpath/Makefile.am @@ -0,0 +1,22 @@ +lib_LTLIBRARIES = libaxis2_xpath.la +libaxis2_xpath_la_SOURCES = xpath.c \ + xpath_functions.c \ + xpath_internals.c \ + xpath_internals_engine.c \ + xpath_internals_iterators.c \ + xpath_internals_parser.c \ + xpath_streaming.c + +libaxis2_xpath_la_LDFLAGS = -version-info $(VERSION_NO) + +libaxis2_xpath_la_LIBADD = +INCLUDES = -I$(top_builddir)/include \ + -I$(top_builddir)/src/parser \ + -I$(top_builddir)/src/om \ + -I ../../../util/include \ + -I ../../../include + +EXTRA_DIST = xpath_functions.h xpath_internals_engine.h \ + xpath_internals.h xpath_internals_iterators.h \ + xpath_internals_parser.h xpath_streaming.h + diff --git a/axiom/src/xpath/xpath.c b/axiom/src/xpath/xpath.c new file mode 100755 index 0000000..38f422c --- /dev/null +++ b/axiom/src/xpath/xpath.c @@ -0,0 +1,462 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_xpath.h> +#include "xpath_internals.h" +#include "xpath_internals_parser.h" +#include "xpath_internals_engine.h" +#include "xpath_functions.h" +#include "xpath_streaming.h" + +/* Create XPath context */ +AXIS2_EXTERN axiom_xpath_context_t * AXIS2_CALL +axiom_xpath_context_create( + const axutil_env_t *env, + axiom_node_t * root_node) +{ + axiom_xpath_context_t* context; + + /*HACK: xpath impl requires a dummy root node in order to process properly.*/ + axiom_node_t * dummy_root; + dummy_root = axiom_node_create(env); + axiom_node_add_child(dummy_root, env, root_node); + + context = AXIS2_MALLOC(env->allocator, + sizeof(axiom_xpath_context_t)); + + context->env = env; + context->root_node = dummy_root; + context->node = dummy_root; + context->expr = NULL; + context->attribute = NULL; + context->namespaces = NULL; + context->functions = NULL; + + axiom_xpath_register_default_functions_set(context); + + return context; +} + +/* Compile XPath expression */ +AXIS2_EXTERN axiom_xpath_expression_t * AXIS2_CALL +axiom_xpath_compile_expression( + const axutil_env_t *env, + const axis2_char_t* xpath_expr) +{ + axiom_xpath_expression_t* expr; + + expr = AXIS2_MALLOC(env->allocator, + sizeof(axiom_xpath_expression_t)); + + expr->expr_str = axutil_strdup(env, xpath_expr); + + if (axiom_xpath_compile(env, expr) == AXIOM_XPATH_PARSE_ERROR) + { + AXIS2_FREE(env->allocator, expr->expr_str); + AXIS2_FREE(env->allocator, expr); + + return NULL; + } + else + { + return expr; + } +} + +/* Evaluate compiled XPath expression */ +AXIS2_EXTERN axiom_xpath_result_t * AXIS2_CALL +axiom_xpath_evaluate( + axiom_xpath_context_t *context, + axiom_xpath_expression_t *xpath_expr) +{ + axiom_xpath_expression_copy(context, xpath_expr); + + context->streaming = AXIS2_FALSE; + + return axiom_xpath_run(context); +} + +AXIS2_EXTERN axiom_xpath_result_t * AXIS2_CALL +axiom_xpath_evaluate_streaming( + axiom_xpath_context_t *context, + axiom_xpath_expression_t *xpath_expr) +{ + axiom_xpath_result_t *res; + + axiom_xpath_expression_copy(context, xpath_expr); + + if (axiom_xpath_streaming_check(context->env, xpath_expr)) + { + context->streaming = AXIS2_TRUE; + return axiom_xpath_run(context); + } + else + { + res = AXIS2_MALLOC( + context->env->allocator, sizeof(axiom_xpath_result_t)); + res->nodes = NULL; + res->flag = AXIOM_XPATH_ERROR_STREAMING_NOT_SUPPORTED; + + return res; + } +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_xpath_register_default_functions_set( + axiom_xpath_context_t *context) +{ + axiom_xpath_register_function( + context, "count", axiom_xpath_function_count); +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_xpath_register_function( + axiom_xpath_context_t *context, + axis2_char_t *name, + axiom_xpath_function_t func) +{ + if (name && func) + { + if (!context->functions) + { + context->functions = axutil_hash_make(context->env); + } + + axutil_hash_set(context->functions, name, AXIS2_HASH_KEY_STRING, func); + } +} + +AXIS2_EXTERN axiom_xpath_function_t AXIS2_CALL +axiom_xpath_get_function( + axiom_xpath_context_t *context, + axis2_char_t *name) +{ + axiom_xpath_function_t func = NULL; + + if(context->functions) + { + func = axutil_hash_get(context->functions, name, AXIS2_HASH_KEY_STRING); + } + + return func; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_xpath_register_namespace( + axiom_xpath_context_t *context, + axiom_namespace_t *ns) +{ + axis2_char_t *prefix = NULL; + + if (!context->namespaces) + { + context->namespaces = axutil_hash_make(context->env); + } + + prefix = axiom_namespace_get_prefix(ns, context->env); + + if (prefix) + { + axutil_hash_set( + context->namespaces, prefix, AXIS2_HASH_KEY_STRING, ns); + } +} + +AXIS2_EXTERN axiom_namespace_t * AXIS2_CALL +axiom_xpath_get_namespace( + axiom_xpath_context_t *context, + axis2_char_t *prefix) +{ + axiom_namespace_t *ns = NULL; + + if (context->namespaces) + { + ns = axutil_hash_get(context->namespaces, prefix, AXIS2_HASH_KEY_STRING); + } + + return ns; +} + +AXIS2_EXTERN void AXIS2_CALL +axiom_xpath_clear_namespaces( + axiom_xpath_context_t *context) +{ + axutil_hash_index_t *hi; + void *val; + + if (context->namespaces) + { + for (hi = axutil_hash_first(context->namespaces, context->env); + hi; + hi = axutil_hash_next(context->env, hi)) + { + axutil_hash_this(hi, NULL, NULL, &val); + axiom_namespace_free((axiom_namespace_t *)val, context->env); + } + + axutil_hash_free(context->namespaces, context->env); + } + + context->namespaces = NULL; +} + +/* Cast to boolean */ +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_xpath_cast_node_to_boolean( + const axutil_env_t *env, + axiom_xpath_result_node_t * node) +{ + if(node->type == AXIOM_XPATH_TYPE_BOOLEAN) + { + return *(axis2_bool_t *)node->value; + } + else if(node->type == AXIOM_XPATH_TYPE_NUMBER) + { + /* Cannot evaluate as *(double *)(node->value) == 1e-12 + since there might be an precision error */ + if(*(double *)(node->value) > 1e-12 || *(double *)(node->value) < -1e-12) + { + return AXIS2_TRUE; + } + else + { + return AXIS2_FALSE; + } + } + else if(node->value) + { + return AXIS2_TRUE; + } + else + { + return AXIS2_FALSE; + } +} + +/* Cast to double */ +AXIS2_EXTERN double AXIS2_CALL +axiom_xpath_cast_node_to_number( + const axutil_env_t *env, + axiom_xpath_result_node_t * node) +{ + if (node->type == AXIOM_XPATH_TYPE_BOOLEAN) + { + if (*(axis2_bool_t *)(node->value) == AXIS2_TRUE) + { + return 1.0; + } + else + { + return 0.0; + } + } + else if (node->type == AXIOM_XPATH_TYPE_NUMBER) + { + return *(double *)node->value; + } + else if (node->value) + { + return 1.0; + } + else + { + return 0.0; + } +} + +/* Cast to text */ +AXIS2_EXTERN axis2_char_t * AXIS2_CALL +axiom_xpath_cast_node_to_string( + const axutil_env_t *env, + axiom_xpath_result_node_t * node) +{ + axiom_element_t *ele; + axis2_char_t *res; + + if (!node->value) + { + return NULL; + } + + if (node->type == AXIOM_XPATH_TYPE_BOOLEAN) + { + if (*(axis2_bool_t *)(node->value) == AXIS2_TRUE) + { + return axutil_strdup(env, "true"); + } + else + { + return axutil_strdup(env, "false"); + } + } + else if (node->type == AXIOM_XPATH_TYPE_NUMBER) + { + /* Allocate 50 bytes */ + res = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * 50); + + sprintf(res, "%lf", *(double *)(node->value)); + + return res; + } + else if (node->type == AXIOM_XPATH_TYPE_TEXT) + { + return (axis2_char_t *)node->value; + } + else if (node->type == AXIOM_XPATH_TYPE_NODE) + { + ele = (axiom_element_t *)axiom_node_get_data_element( + (axiom_node_t *)(node->value), env); + + if (ele) + { + return axiom_element_get_text( + ele, env, (axiom_node_t *)(node->value)); + } + else + { + return NULL; + } + } + else if (node->type == AXIOM_XPATH_TYPE_ATTRIBUTE) + { + return axiom_attribute_get_value( + (axiom_attribute_t *)(node->value), env); + } + else if (node->type == AXIOM_XPATH_TYPE_NAMESPACE) + { + return axiom_namespace_get_prefix( + (axiom_namespace_t *)(node->value), env); + } + + return NULL; +} + +/* Cast to axiom node */ +AXIS2_EXTERN axiom_node_t * AXIS2_CALL +axiom_xpath_cast_node2axiom_node( + const axutil_env_t *env, + axiom_xpath_result_node_t * node) +{ + if (node->type == AXIOM_XPATH_TYPE_NODE && node->value) + { + return (axiom_node_t *)node->value; + } + else + { + return NULL; + } +} + +/* Free context */ +AXIS2_EXTERN void AXIS2_CALL +axiom_xpath_free_context( + const axutil_env_t *env, + axiom_xpath_context_t *context) +{ + if (context) + { + /* Free the expression if not freed */ + if (context->expr) + { + /* axiom_xpath_free_expression(env, context->expr); */ + + context->expr = NULL; + } + + if (context->root_node) + { + axiom_node_detach(axiom_node_get_first_child(context->root_node, context->env), context->env); + axiom_node_free_tree(context->root_node, context->env); + context->root_node = NULL; + } + + if (context->functions) + { + axutil_hash_free(context->functions, context->env); + context->functions = NULL; + } + + if(context->namespaces) + { + axiom_xpath_clear_namespaces(context); + context->namespaces = NULL; + } + + AXIS2_FREE(env->allocator, context); + } +} + +/* Free expression */ +AXIS2_EXTERN void AXIS2_CALL +axiom_xpath_free_expression( + const axutil_env_t *env, + axiom_xpath_expression_t * xpath_expr) +{ + if (xpath_expr) + { + if (xpath_expr->expr_str) + { + AXIS2_FREE(env->allocator, xpath_expr->expr_str); + + xpath_expr->expr_str = NULL; + } + + if (xpath_expr->operations) + { + axutil_array_list_free(xpath_expr->operations, env); + xpath_expr->operations = NULL; + } + + AXIS2_FREE(env->allocator, xpath_expr); + } +} + +/* Free result set */ +AXIS2_EXTERN void AXIS2_CALL +axiom_xpath_free_result( + const axutil_env_t *env, + axiom_xpath_result_t* result) +{ + if (result) + { + if (result->nodes) + { + axutil_array_list_free(result->nodes, env); + } + + AXIS2_FREE(env->allocator, result); + } +} + +/* Check if the expression can be evaluated on streaming XML */ +AXIS2_EXTERN axis2_bool_t AXIS2_CALL +axiom_xpath_streaming_check( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + axiom_xpath_streaming_t r = AXIOM_XPATH_CHECK(expr->start); + + if(r == AXIOM_XPATH_STREAMING_NOT_SUPPORTED) + { + return AXIS2_FALSE; + } + else + { + return AXIS2_TRUE; + } +} + diff --git a/axiom/src/xpath/xpath_functions.c b/axiom/src/xpath/xpath_functions.c new file mode 100755 index 0000000..bdf65c2 --- /dev/null +++ b/axiom/src/xpath/xpath_functions.c @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_xpath.h> +#include "xpath_functions.h" +#include "xpath_internals_engine.h" + +int +axiom_xpath_function_count( + axiom_xpath_context_t *context, + int np) +{ + axiom_xpath_result_node_t *node; + double * v; + int i; + + node = AXIS2_MALLOC(context->env->allocator, sizeof(axiom_xpath_result_node_t)); + v = AXIS2_MALLOC(context->env->allocator, sizeof(double)); + + *v = np; + node->value = v; + node->type = AXIOM_XPATH_TYPE_NUMBER; + + for(i = 0; i < np; i++) + { + axutil_stack_pop(context->stack, context->env); + } + + axutil_stack_push(context->stack, context->env, node); + + return 1; +} diff --git a/axiom/src/xpath/xpath_functions.h b/axiom/src/xpath/xpath_functions.h new file mode 100755 index 0000000..d44f0a2 --- /dev/null +++ b/axiom/src/xpath/xpath_functions.h @@ -0,0 +1,47 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_XPATH_FUNCTIONS_H +#define AXIOM_XPATH_FUNCTIONS_H + +#include <axiom_xpath.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_xpath_functions functions + * @ingroup axiom_xpath + * @{ + */ + + /** + * count(node-set) function + * http://www.w3.org/TR/xpath#function-count + */ + int axiom_xpath_function_count(axiom_xpath_context_t *context, int np); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/axiom/src/xpath/xpath_internals.c b/axiom/src/xpath/xpath_internals.c new file mode 100755 index 0000000..c313baf --- /dev/null +++ b/axiom/src/xpath/xpath_internals.c @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_xpath.h> +#include "xpath_internals.h" + +/* Make a copy of the xpath expression */ +void +axiom_xpath_expression_copy( + axiom_xpath_context_t *context, + axiom_xpath_expression_t* expr) +{ + int i; + axiom_xpath_operation_t *op; + + context->expr = expr; + + /* Set value of pos in every operation to 0 */ + for(i = 0; i < axutil_array_list_size(expr->operations, context->env); i++) + { + op = AXIOM_XPATH_OPR_GET(i); + op->pos = 0; + } +} diff --git a/axiom/src/xpath/xpath_internals.h b/axiom/src/xpath/xpath_internals.h new file mode 100755 index 0000000..891d543 --- /dev/null +++ b/axiom/src/xpath/xpath_internals.h @@ -0,0 +1,199 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_XPATH_INTERNALS_H +#define AXIOM_XPATH_INTERNALS_H + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_xpath_internals internals + * @ingroup axiom_xpath + * @{ + */ + + + /** Get operation at index ind */ +#define AXIOM_XPATH_OPR_GET(ind) (axiom_xpath_operation_t *) \ + axutil_array_list_get(context->expr->operations, context->env, ind) + + /** + * An error has occured while parsing + */ +#define AXIOM_XPATH_PARSE_ERROR -2 + + /** + * XPath expression was successfully compiled + */ +#define AXIOM_XPATH_PARSE_SUCCESS 0 + + /** + * End of expression reached + */ +#define AXIOM_XPATH_PARSE_END -1 + + /* Types */ + + /** + * XPath operation + * Contains the operands and parameters + */ + typedef struct axiom_xpath_operation axiom_xpath_operation_t; + + /** + * XPath node test + * Stores the components of a node test + */ + typedef struct axiom_xpath_node_test axiom_xpath_node_test_t; + + /** + * Functions to process a XPath operator + */ + typedef int (*axiom_xpath_operator_t)(axiom_xpath_context_t *context, + axiom_xpath_operation_t * op); + + /** + * Functions to iterate through different XPath axes + */ + typedef int (*axiom_xpath_iterator_t)(axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** + * XPath node test types + */ + typedef enum axiom_xpath_node_test_type_t + { + AXIOM_XPATH_NODE_TEST_NONE = 0, + AXIOM_XPATH_NODE_TEST_ALL, + AXIOM_XPATH_NODE_TYPE_COMMENT, + AXIOM_XPATH_NODE_TYPE_NODE, + AXIOM_XPATH_NODE_TYPE_PI, + AXIOM_XPATH_NODE_TYPE_TEXT, + AXIOM_XPATH_NODE_TEST_STANDARD + } axiom_xpath_node_test_type_t; + + /** + * XPath operations + */ + typedef enum axiom_xpath_operation_type_t + { + AXIOM_XPATH_OPERATION_ROOT_NODE = 0, + AXIOM_XPATH_OPERATION_CONTEXT_NODE, + AXIOM_XPATH_OPERATION_NODE_TEST, + AXIOM_XPATH_OPERATION_STEP, + AXIOM_XPATH_OPERATION_RESULT, + AXIOM_XPATH_OPERATION_UNION, + AXIOM_XPATH_OPERATION_EQUAL_EXPR, + AXIOM_XPATH_OPERATION_AND_EXPR, + AXIOM_XPATH_OPERATION_OR_EXPR, + AXIOM_XPATH_OPERATION_PREDICATE, + AXIOM_XPATH_OPERATION_LITERAL, + AXIOM_XPATH_OPERATION_NUMBER, + AXIOM_XPATH_OPERATION_PATH_EXPRESSION, + AXIOM_XPATH_OPERATION_FUNCTION_CALL, + AXIOM_XPATH_OPERATION_ARGUMENT + } axiom_xpath_operation_type_t; + + /** + * XPath axes + */ + typedef enum axiom_xpath_axis_t + { + AXIOM_XPATH_AXIS_NONE = -1, + AXIOM_XPATH_AXIS_CHILD, + AXIOM_XPATH_AXIS_DESCENDANT, + AXIOM_XPATH_AXIS_PARENT, + AXIOM_XPATH_AXIS_ANCESTOR, + AXIOM_XPATH_AXIS_FOLLOWING_SIBLING, + AXIOM_XPATH_AXIS_PRECEDING_SIBLING, + AXIOM_XPATH_AXIS_FOLLOWING, + AXIOM_XPATH_AXIS_PRECEDING, + AXIOM_XPATH_AXIS_ATTRIBUTE, + AXIOM_XPATH_AXIS_NAMESPACE, + AXIOM_XPATH_AXIS_SELF, + AXIOM_XPATH_AXIS_DESCENDANT_OR_SELF, + AXIOM_XPATH_AXIS_ANCESTOR_OR_SELF + } axiom_xpath_axis_t; + + /** + * XPath node test structure + */ + struct axiom_xpath_node_test + { + /** Node test type */ + axiom_xpath_node_test_type_t type; + + /** Prefix + * NULL if no prefix + */ + axis2_char_t *prefix; + + /** Name */ + axis2_char_t *name; + + /** Literal for processing instruction (PI) */ + axis2_char_t *lit; + }; + + /** + * XPath operation structure + */ + struct axiom_xpath_operation + { + /** Type of operator */ + axiom_xpath_operation_type_t opr; + + /** Parameters of the operation */ + void *par1; + void *par2; + + /** Position: Used for predicate evaluation + */ + int pos; + + /** Operands pointing to other operations */ + int op1; + int op2; + }; + + /** + * Copies an XPath expression to a context + * + * No data is duplicated just the reference is assigned. + * Some parameters in the expression are reset. + * - pos in every operation + * + * @param context XPath context must not be NULL + * @param expr Expression to be copied + */ + void axiom_xpath_expression_copy( + axiom_xpath_context_t *context, + axiom_xpath_expression_t* expr); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/axiom/src/xpath/xpath_internals_engine.c b/axiom/src/xpath/xpath_internals_engine.c new file mode 100644 index 0000000..3c96d0e --- /dev/null +++ b/axiom/src/xpath/xpath_internals_engine.c @@ -0,0 +1,1203 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_xpath.h> +#include "xpath_internals.h" +#include "xpath_internals_engine.h" +#include "xpath_internals_iterators.h" + +/* Evaluates the expath expression */ +axiom_xpath_result_t * +axiom_xpath_run( + axiom_xpath_context_t *context) +{ + axiom_xpath_result_t* res; + + /* Initialize result ret */ + res = AXIS2_MALLOC(context->env->allocator, sizeof(axiom_xpath_result_t)); + + res->flag = 0; + + res->nodes = axutil_array_list_create(context->env, 0); + + /* Expression is empty */ + if(context->expr->start == AXIOM_XPATH_PARSE_END) + { + return res; + } + + context->stack = axutil_stack_create(context->env); + + axiom_xpath_evaluate_operation(context, context->expr->start); + + /* Add nodes to the result set from the stack */ + while(axutil_stack_size(context->stack, context->env) > 0) + { + axutil_array_list_add(res->nodes, context->env, + axutil_stack_pop(context->stack, context->env)); + } + + axutil_stack_free(context->stack, context->env); + + return res; +} + +/* Casting functions; these make use of the casting functions defined in xpath.h */ +void +axiom_xpath_cast_boolean( + axiom_xpath_result_node_t *node, + axiom_xpath_context_t *context) +{ + axis2_bool_t v = axiom_xpath_cast_node_to_boolean(context->env, node); + + AXIOM_XPATH_CAST_SET_VALUE(axis2_bool_t, v); + + node->type = AXIOM_XPATH_TYPE_BOOLEAN; +} + +void +axiom_xpath_cast_number( + axiom_xpath_result_node_t *node, + axiom_xpath_context_t *context) +{ + double v = axiom_xpath_cast_node_to_number(context->env, node); + + AXIOM_XPATH_CAST_SET_VALUE(double, v); + + node->type = AXIOM_XPATH_TYPE_NUMBER; +} + +void +axiom_xpath_cast_string( + axiom_xpath_result_node_t *node, + axiom_xpath_context_t *context) +{ + node->value = axiom_xpath_cast_node_to_string(context->env, node); + + node->type = AXIOM_XPATH_TYPE_TEXT; +} + +/* Evaluate whether two results are equal + + If either node is a boolean other is casted to a boolean; + Otherwise, if either node is a number other is casted to a number; + Otherwise, both nodes are casted to strings.*/ +axis2_bool_t +axiom_xpath_compare_equal( + axiom_xpath_result_node_t *node1, + axiom_xpath_result_node_t *node2, + axiom_xpath_context_t *context) +{ + if(node1->type == AXIOM_XPATH_TYPE_BOOLEAN || node2->type == AXIOM_XPATH_TYPE_BOOLEAN) + { + axiom_xpath_cast_boolean(node1, context); + axiom_xpath_cast_boolean(node2, context); + + if(*(axis2_bool_t*)(node1->value) == *(axis2_bool_t*)(node2->value)) + { + return AXIS2_TRUE; + } + else + { + return AXIS2_FALSE; + } + } + + if(node1->type == AXIOM_XPATH_TYPE_NUMBER || node2->type == AXIOM_XPATH_TYPE_NUMBER) + { + axiom_xpath_cast_number(node1, context); + axiom_xpath_cast_number(node2, context); + + if(*(double *)(node1->value) == *(double *)(node2->value)) + { + return AXIS2_TRUE; + } + else + { + return AXIS2_FALSE; + } + } + + axiom_xpath_cast_string(node1, context); + axiom_xpath_cast_string(node2, context); + + if(axutil_strcmp((axis2_char_t *)(node1->value), (axis2_char_t *)(node2->value)) == 0) + { + return AXIS2_TRUE; + } + else + { + return AXIS2_FALSE; + } +} + +/* Convert a node set to boolean */ +axis2_bool_t +axiom_xpath_convert_to_boolean( + axutil_array_list_t *node_set, + axiom_xpath_context_t *context) +{ + if(axutil_array_list_size(node_set, context->env) == 0) + { + return AXIS2_FALSE; + } + else if(axutil_array_list_size(node_set, context->env) >= 2) + { + return AXIS2_TRUE; + } + else + { + axiom_xpath_result_node_t *node = axutil_array_list_get(node_set, context->env, 0); + axiom_xpath_cast_boolean(node, context); + + return *(axis2_bool_t *)node->value; + } +} + +/* Operators */ + +/* Literal */ +int +axiom_xpath_literal_operator( + axiom_xpath_context_t *context, + axiom_xpath_operation_t * op) +{ + axiom_xpath_result_node_t *node; + + node = AXIS2_MALLOC(context->env->allocator, sizeof(axiom_xpath_result_node_t)); + + /* Set the context node to NULL */ + /* This is not required; it gives some problems */ + /* context->node = NULL;*/ + + node->value = op->par1; + node->type = AXIOM_XPATH_TYPE_TEXT; + + axutil_stack_push(context->stack, context->env, node); + + return 1; +} + +/* Number */ +int +axiom_xpath_number_operator( + axiom_xpath_context_t *context, + axiom_xpath_operation_t * op) +{ + axiom_xpath_result_node_t *node; + + node = AXIS2_MALLOC(context->env->allocator, sizeof(axiom_xpath_result_node_t)); + + /* Set the context node to NULL */ + /* This is not required; it gives some problems */ + /* context->node = NULL;*/ + + node->value = op->par1; + node->type = AXIOM_XPATH_TYPE_NUMBER; + + axutil_stack_push(context->stack, context->env, node); + + return 1; +} + +/* Path Expression */ +int +axiom_xpath_path_expression_operator( + axiom_xpath_context_t *context, + axiom_xpath_operation_t * op) +{ + int filter_res_n, n_nodes = 0; + axiom_xpath_operation_t *rel_loc_op; + axiom_xpath_operator_t rel_loc_func; + axutil_array_list_t *arr; + axiom_xpath_result_node_t *res_node; + int i; + + /* Filter operation */ + if(op->op1 == AXIOM_XPATH_PARSE_END) + { + return 0; + } + + filter_res_n = axiom_xpath_evaluate_operation(context, op->op1); + + /* Relative location path */ + if(op->op2 == AXIOM_XPATH_PARSE_END) + { + return filter_res_n; + } + + rel_loc_op = AXIOM_XPATH_OPR_GET(op->op2); + rel_loc_func = axiom_xpath_get_operator(rel_loc_op); + + /* Array list to add all results from the filter expression */ + arr = axutil_array_list_create(context->env, 0); + + for(i = 0; i < filter_res_n; i++) + { + axutil_array_list_add(arr, context->env, axutil_stack_pop(context->stack, context->env)); + } + + /* Evaluate relative location path for all results from the + filter expression */ + for(i = 0; i < axutil_array_list_size(arr, context->env); i++) + { + res_node = (axiom_xpath_result_node_t *)axutil_array_list_get(arr, context->env, i); + + if(res_node->type == AXIOM_XPATH_TYPE_NODE) + { + context->node = (axiom_node_t *)res_node->value; + context->position = i + 1; + context->size = filter_res_n; + + n_nodes += rel_loc_func(context, rel_loc_op); + } + + AXIS2_FREE(context->env->allocator, res_node); + } + + axutil_array_list_free(arr, context->env); + + return n_nodes; +} + +/* Or Expression */ +int +axiom_xpath_orexpr_operator( + axiom_xpath_context_t *context, + axiom_xpath_operation_t * op) +{ + axiom_xpath_result_node_t *node; + axiom_xpath_result_node_t *res_node; + int n_nodes[2]; + int i, j; + int op12[2]; + axutil_array_list_t *arr[2]; + + op12[0] = op->op1; + op12[1] = op->op2; + + /* Evaluate both operands and get number of results */ + for(i = 0; i < 2; i++) + { + if(op12[i] == AXIOM_XPATH_PARSE_END) + { + continue; + } + + n_nodes[i] = axiom_xpath_evaluate_operation(context, op12[i]); + } + + for(i = 1; i >= 0; i--) + { + arr[i] = axutil_array_list_create(context->env, 0); + + for(j = 0; j < n_nodes[i]; j++) + { + axutil_array_list_add(arr[i], context->env, axutil_stack_pop(context->stack, + context->env)); + } + } + + node = AXIS2_MALLOC(context->env->allocator, sizeof(axiom_xpath_result_node_t)); + + node->type = AXIOM_XPATH_TYPE_BOOLEAN; + node->value = NULL; + + /* Checking equality + - If any node from the first set is equal to any node from the second set + the result is true */ + if(axiom_xpath_convert_to_boolean(arr[0], context) || axiom_xpath_convert_to_boolean(arr[1], + context)) + { + AXIOM_XPATH_CAST_SET_VALUE(axis2_bool_t, AXIS2_TRUE); + + axutil_stack_push(context->stack, context->env, node); + } + else + { + AXIOM_XPATH_CAST_SET_VALUE(axis2_bool_t, AXIS2_FALSE); + + axutil_stack_push(context->stack, context->env, node); + } + + for (i = 1; i >= 0; i--) + { + for (j = 0; j < n_nodes[i]; j++) + { + res_node = (axiom_xpath_result_node_t *)axutil_array_list_get(arr[i], context->env, j); + AXIS2_FREE(context->env->allocator, res_node); + } + + axutil_array_list_free(arr[i], context->env); + } + + return 1; +} + +/* And Expression */ +int +axiom_xpath_andexpr_operator( + axiom_xpath_context_t *context, + axiom_xpath_operation_t * op) +{ + axiom_xpath_result_node_t *node; + axiom_xpath_result_node_t *res_node; + int n_nodes[2]; + int i, j; + int op12[2]; + axutil_array_list_t *arr[2]; + + op12[0] = op->op1; + op12[1] = op->op2; + + /* Evaluate both operands and get number of results */ + for(i = 0; i < 2; i++) + { + if(op12[i] == AXIOM_XPATH_PARSE_END) + { + continue; + } + + n_nodes[i] = axiom_xpath_evaluate_operation(context, op12[i]); + } + + for(i = 1; i >= 0; i--) + { + arr[i] = axutil_array_list_create(context->env, 0); + + for(j = 0; j < n_nodes[i]; j++) + { + axutil_array_list_add(arr[i], context->env, axutil_stack_pop(context->stack, + context->env)); + } + } + + node = AXIS2_MALLOC(context->env->allocator, sizeof(axiom_xpath_result_node_t)); + + node->type = AXIOM_XPATH_TYPE_BOOLEAN; + node->value = NULL; + + /* Checking equality + - If any node from the first set is equal to any node from the second set + the result is true */ + if(axiom_xpath_convert_to_boolean(arr[0], context) && axiom_xpath_convert_to_boolean(arr[1], + context)) + { + AXIOM_XPATH_CAST_SET_VALUE(axis2_bool_t, AXIS2_TRUE); + + axutil_stack_push(context->stack, context->env, node); + } + else + { + AXIOM_XPATH_CAST_SET_VALUE(axis2_bool_t, AXIS2_FALSE); + + axutil_stack_push(context->stack, context->env, node); + } + + for (i = 1; i >= 0; i--) + { + for (j = 0; j < n_nodes[i]; j++) + { + res_node = (axiom_xpath_result_node_t *)axutil_array_list_get(arr[i], context->env, j); + AXIS2_FREE(context->env->allocator, res_node); + } + + axutil_array_list_free(arr[i], context->env); + } + + return 1; +} + +/* Equal Expression */ +int +axiom_xpath_equalexpr_operator( + axiom_xpath_context_t *context, + axiom_xpath_operation_t * op) +{ + axiom_xpath_result_node_t *node; + axiom_xpath_result_node_t *res_node; + int n_nodes[2]; + int i, j; + int op12[2]; + axutil_array_list_t *arr[2]; + + op12[0] = op->op1; + op12[1] = op->op2; + + /* Evaluate both operands and get number of results */ + for(i = 0; i < 2; i++) + { + if(op12[i] == AXIOM_XPATH_PARSE_END) + { + continue; + } + + n_nodes[i] = axiom_xpath_evaluate_operation(context, op12[i]); + } + + for(i = 1; i >= 0; i--) + { + arr[i] = axutil_array_list_create(context->env, 0); + + for(j = 0; j < n_nodes[i]; j++) + { + axutil_array_list_add(arr[i], context->env, axutil_stack_pop(context->stack, + context->env)); + } + } + + node = AXIS2_MALLOC(context->env->allocator, sizeof(axiom_xpath_result_node_t)); + + node->type = AXIOM_XPATH_TYPE_BOOLEAN; + node->value = NULL; + + /* Checking equality + - If any node from the first set is equal to any node from the second set + the result is true */ + for(i = 0; i < n_nodes[0]; i++) + { + for(j = 0; j < n_nodes[1]; j++) + { + if(axiom_xpath_compare_equal(axutil_array_list_get(arr[0], context->env, i), + axutil_array_list_get(arr[1], context->env, j), context)) + { + AXIOM_XPATH_CAST_SET_VALUE(axis2_bool_t, AXIS2_TRUE); + + axutil_stack_push(context->stack, context->env, node); + + break; + } + } + + if(j < n_nodes[1]) + { + break; + } + } + + if(!node->value) + { + AXIOM_XPATH_CAST_SET_VALUE(axis2_bool_t, AXIS2_FALSE); + + axutil_stack_push(context->stack, context->env, node); + } + + for (i = 1; i >= 0; i--) + { + for (j = 0; j < n_nodes[i]; j++) + { + res_node =(axiom_xpath_result_node_t *)axutil_array_list_get(arr[i], context->env, j); + AXIS2_FREE(context->env->allocator, res_node); + } + + axutil_array_list_free(arr[i], context->env); + } + + return 1; +} + +/* Union */ +int +axiom_xpath_union_operator( + axiom_xpath_context_t *context, + axiom_xpath_operation_t * op) +{ + int n_nodes = 0; + int i; + int op12[2]; + + op12[0] = op->op1; + op12[1] = op->op2; + + for(i = 0; i < 2; i++) + { + if(op12[i] == AXIOM_XPATH_PARSE_END) + { + continue; + } + + n_nodes += axiom_xpath_evaluate_operation(context, op12[i]); + } + + return n_nodes; +} + +/* Set context node depending on whether relative or absolute location path */ +int +axiom_xpath_start_node_operator( + axiom_xpath_context_t *context, + axiom_xpath_operation_t * op) +{ + int n_nodes = 0; + + if(op->op1 == AXIOM_XPATH_PARSE_END) + { + return 0; + } + + if(op->opr == AXIOM_XPATH_OPERATION_ROOT_NODE) + { + context->node = context->root_node; + n_nodes += axiom_xpath_evaluate_operation(context, op->op1); + } + else if(op->opr == AXIOM_XPATH_OPERATION_CONTEXT_NODE) + { + n_nodes += axiom_xpath_evaluate_operation(context, op->op1); + } + + return n_nodes; +} + +/* Step */ +int +axiom_xpath_step_operator( + axiom_xpath_context_t *context, + axiom_xpath_operation_t * op) +{ + axiom_xpath_operation_t * node_test_op; + axiom_xpath_iterator_t iter; + axiom_xpath_axis_t axis; + + if(op->op1 == AXIOM_XPATH_PARSE_END) + { +#ifdef AXIOM_XPATH_DEBUG + printf("Node test operator empty\n"); +#endif + + return AXIOM_XPATH_EVALUATION_ERROR; + } + + if(op->op2 == AXIOM_XPATH_PARSE_END) + { + return 0; + } + + /* Get the name */ + node_test_op = AXIOM_XPATH_OPR_GET(op->op1); + + /* Get the axis */ + if(!node_test_op->par2) + { +#ifdef AXIOM_XPATH_DEBUG + printf("axis is NULL in the step operator\n"); +#endif + return AXIOM_XPATH_EVALUATION_ERROR; + } + axis = *((axiom_xpath_axis_t *)node_test_op->par2); + + /* Get the iteration for the axis */ + iter = axiom_xpath_get_iterator(axis); + + return iter(context, op->op1 /* node test */, op->op2 /* next step */, node_test_op->op1 /* predicate */); +} + +/* Predicates */ +axis2_bool_t +axiom_xpath_evaluate_predicate_condition( + axiom_xpath_context_t *context, + int n_nodes) +{ + axiom_xpath_result_node_t *res; + int i; + + if(n_nodes <= 0) + { + return AXIS2_FALSE; + } + else if(n_nodes > 1) + { + for(i = 0; i < n_nodes; i++) + { + res = (axiom_xpath_result_node_t *)axutil_stack_pop(context->stack, context->env); + + if (res->type > AXIOM_XPATH_TYPE_NAMESPACE) + { + AXIS2_FREE(context->env->allocator, res->value); + } + + AXIS2_FREE(context->env->allocator, res); + } + + return AXIS2_TRUE; + } + else + { + res = (axiom_xpath_result_node_t *)axutil_stack_pop(context->stack, context->env); + + if(res->type == AXIOM_XPATH_TYPE_NUMBER) + { + if(*(double *)(res->value) == context->position) + { + AXIS2_FREE(context->env->allocator, res); + return AXIS2_TRUE; + } + else + { + AXIS2_FREE(context->env->allocator, res); + return AXIS2_FALSE; + } + } + else if(res->type == AXIOM_XPATH_TYPE_BOOLEAN) + { + if(*(axis2_bool_t *)(res->value)) + { + AXIS2_FREE(context->env->allocator, res); + return AXIS2_TRUE; + } + else + { + AXIS2_FREE(context->env->allocator, res); + return AXIS2_FALSE; + } + } + else + { + AXIS2_FREE(context->env->allocator, res); + return AXIS2_TRUE; + } + } +} + +/* Predicate */ +int +axiom_xpath_evaluate_predicate( + axiom_xpath_context_t *context, + int op_next, + int op_predicate) +{ + int n_res; + axis2_bool_t res; + + axiom_xpath_operation_t * pred_op; + axiom_node_t *context_node = context->node; + + if(op_predicate == AXIOM_XPATH_PARSE_END) + { + return axiom_xpath_evaluate_operation(context, op_next); + } + else + { + pred_op = AXIOM_XPATH_OPR_GET(op_predicate); + + pred_op->pos++; + + /* Evaluate the predicate */ + if(pred_op->op1 != AXIOM_XPATH_PARSE_END) + { + n_res = axiom_xpath_evaluate_operation(context, pred_op->op1); + context->position = pred_op->pos; + + res = axiom_xpath_evaluate_predicate_condition(context, n_res); + } + else + { + res = AXIS2_TRUE; + } + /* A PredicateExpr is evaluated by evaluating the Expr and + converting the result to a boolean. If the result is a number, + the result will be converted to true if the number is equal to the + context position and will be converted to false otherwise; if the + result is not a number, then the result will be converted as if + by a call to the boolean function. */ + + /* Transform the result to number or boolean ? */ + + if(res) + { + context->node = context_node; + + return axiom_xpath_evaluate_predicate(context, op_next, pred_op->op2); + } + } + + return 0; +} + +/* Node test match */ +axis2_bool_t +axiom_xpath_node_test_match( + axiom_xpath_context_t *context, + axiom_xpath_node_test_t *node_test) +{ + axiom_types_t type; + axiom_element_t *element = NULL; + axis2_char_t *name = NULL; + axiom_namespace_t *ns = NULL, *xpath_ns = NULL; + + if(!context->node && !context->attribute && !context->ns) + { +#ifdef AXIOM_XPATH_DEBUG + printf("Both context node and attribute are NULL."); + printf(" May be a literal or a number.\n"); +#endif + return AXIS2_FALSE; + } + else if(context->node) + { + /* Test if the node matches */ + type = axiom_node_get_node_type(context->node, context->env); + + if(type == AXIOM_ELEMENT) + { + element = axiom_node_get_data_element(context->node, context->env); + + name = axiom_element_get_localname(element, context->env); + + ns = axiom_element_get_namespace(element, context->env, context->node); + } + + if(node_test->type == AXIOM_XPATH_NODE_TEST_NONE) + { + return AXIS2_FALSE; + } + else + { + if(node_test->type == AXIOM_XPATH_NODE_TEST_ALL || node_test->type + == AXIOM_XPATH_NODE_TEST_STANDARD) + { + if(type != AXIOM_ELEMENT) + { + return AXIS2_FALSE; + } + + /* Check namespace */ + if(node_test->type == AXIOM_XPATH_NODE_TEST_ALL) + { + if(!ns && node_test->prefix) + { + return AXIS2_FALSE; + } + } + else + { + if((ns && !node_test->prefix) || (!ns && node_test->prefix)) + { + return AXIS2_FALSE; + } + } + + if(ns && node_test->prefix) + { + xpath_ns = axiom_xpath_get_namespace(context, node_test->prefix); + + if(!xpath_ns) + { + return AXIS2_FALSE; + } + + if(axutil_strcmp(axiom_namespace_get_uri(ns, context->env), + axiom_namespace_get_uri(xpath_ns, context->env))) + { + return AXIS2_FALSE; + } + } + + /* Check local name */ + if(node_test->type == AXIOM_XPATH_NODE_TEST_ALL) + { + return AXIS2_TRUE; + } + else if(node_test->type == AXIOM_XPATH_NODE_TEST_STANDARD) + { + if(name && axutil_strcmp(node_test->name, name) == 0) + { + return AXIS2_TRUE; + } + else + { + return AXIS2_FALSE; + } + } + } + else if(node_test->type == AXIOM_XPATH_NODE_TYPE_COMMENT) + { + if(type == AXIOM_COMMENT) + { + return AXIS2_TRUE; + } + else + { + return AXIS2_FALSE; + } + } + else if(node_test->type == AXIOM_XPATH_NODE_TYPE_PI) + { + if(type == AXIOM_PROCESSING_INSTRUCTION) + { + return AXIS2_TRUE; + } + else + { + return AXIS2_FALSE; + } + } + else if(node_test->type == AXIOM_XPATH_NODE_TYPE_NODE) + { + if(type == AXIOM_ELEMENT) + { + return AXIS2_TRUE; + } + else + { + return AXIS2_FALSE; + } + } + else if(node_test->type == AXIOM_XPATH_NODE_TYPE_TEXT) + { + if(type == AXIOM_TEXT) + { + return AXIS2_TRUE; + } + else + { + return AXIS2_FALSE; + } + } + } + } + /* Attributes */ + else if(context->attribute) + { + name = axiom_attribute_get_localname(context->attribute, context->env); + ns = axiom_attribute_get_namespace(context->attribute, context->env); + + if(node_test->type == AXIOM_XPATH_NODE_TEST_NONE) + { + return AXIS2_FALSE; + } + else + { + /* Check namespace */ + if(node_test->type == AXIOM_XPATH_NODE_TEST_ALL) + { + if(!ns && node_test->prefix) + { + return AXIS2_FALSE; + } + } + else + { + if((ns && !node_test->prefix) || (!ns && node_test->prefix)) + { + return AXIS2_FALSE; + } + } + + if(ns && node_test->prefix) + { + xpath_ns = axiom_xpath_get_namespace(context, node_test->prefix); + + if(!xpath_ns) + { + return AXIS2_FALSE; + } + + if(axutil_strcmp(axiom_namespace_get_uri(ns, context->env), + axiom_namespace_get_uri(xpath_ns, context->env))) + { + return AXIS2_FALSE; + } + } + + /* Check local name */ + if(node_test->type == AXIOM_XPATH_NODE_TEST_ALL) + { + return AXIS2_TRUE; + } + else if(node_test->type == AXIOM_XPATH_NODE_TEST_STANDARD) + { + if(name && axutil_strcmp(node_test->name, name) == 0) + { + return AXIS2_TRUE; + } + else + { + return AXIS2_FALSE; + } + } + } + } + + /* Namespace */ + else if(context->ns) + { + /* Prefix is checked ??? If changed to uri the cast + method in xpath.c needs to be changed as well */ + name = axiom_namespace_get_prefix(context->ns, context->env); + ns = NULL; + + if(node_test->type == AXIOM_XPATH_NODE_TEST_NONE) + { + return AXIS2_FALSE; + } + else + { + /* Check namespace */ + if(node_test->type == AXIOM_XPATH_NODE_TEST_ALL) + { + if(!ns && node_test->prefix) + { + return AXIS2_FALSE; + } + } + else + { + if((ns && !node_test->prefix) || (!ns && node_test->prefix)) + { + return AXIS2_FALSE; + } + } + + if(ns && node_test->prefix) + { + xpath_ns = axiom_xpath_get_namespace(context, node_test->prefix); + + if(!xpath_ns) + { + return AXIS2_FALSE; + } + + if(axutil_strcmp(axiom_namespace_get_uri(ns, context->env), + axiom_namespace_get_uri(xpath_ns, context->env))) + { + return AXIS2_FALSE; + } + } + + /* Check local name */ + if(node_test->type == AXIOM_XPATH_NODE_TEST_ALL) + { + return AXIS2_TRUE; + } + else if(node_test->type == AXIOM_XPATH_NODE_TEST_STANDARD) + { + if(name && axutil_strcmp(node_test->name, name) == 0) + { + return AXIS2_TRUE; + } + else + { + return AXIS2_FALSE; + } + } + } + } + + return AXIS2_FALSE; +} + +int +axiom_xpath_function_call_operator( + axiom_xpath_context_t *context, + axiom_xpath_operation_t * op) +{ + axiom_xpath_function_t func = axiom_xpath_get_function(context, op->par1); + int n_args = 0; + + if(!func) + { +#ifdef AXIOM_XPATH_DEBUG + printf("Function %s not found\n", (char *)op->par1); +#endif + + return AXIOM_XPATH_EVALUATION_ERROR; + } + + if(op->op1 != AXIOM_XPATH_PARSE_END) + { + n_args = axiom_xpath_evaluate_operation(context, op->op1); + } + + return func(context, n_args); +} + +int +axiom_xpath_argument_operator( + axiom_xpath_context_t *context, + axiom_xpath_operation_t * op) +{ + int n_args = 0; + + if(op->op1 != AXIOM_XPATH_PARSE_END) + { + n_args += axiom_xpath_evaluate_operation(context, op->op1); + } + + if(op->op2 != AXIOM_XPATH_PARSE_END) + { + n_args += axiom_xpath_evaluate_operation(context, op->op1); + } + + return n_args; +} + +/* Collect the current node to the results list */ +int +axiom_xpath_collect_operator( + axiom_xpath_context_t *context, + axiom_xpath_operation_t * op) +{ + axiom_xpath_result_node_t *node; + + node = AXIS2_MALLOC(context->env->allocator, sizeof(axiom_xpath_result_node_t)); + + if(context->node) + { + node->value = context->node; + node->type = AXIOM_XPATH_TYPE_NODE; + } + else if(context->attribute) + { + node->value = context->attribute; + node->type = AXIOM_XPATH_TYPE_ATTRIBUTE; + } + else if(context->ns) + { + node->value = context->ns; + node->type = AXIOM_XPATH_TYPE_NAMESPACE; + } + + axutil_stack_push(context->stack, context->env, node); + + return 1; +} + +/* Returns a pointer to the respective processing function */ +axiom_xpath_operator_t +axiom_xpath_get_operator( + axiom_xpath_operation_t * op) +{ + switch(op->opr) + { + case AXIOM_XPATH_OPERATION_STEP: + return axiom_xpath_step_operator; + + case AXIOM_XPATH_OPERATION_ROOT_NODE: + case AXIOM_XPATH_OPERATION_CONTEXT_NODE: + return axiom_xpath_start_node_operator; + + case AXIOM_XPATH_OPERATION_RESULT: + return axiom_xpath_collect_operator; + + case AXIOM_XPATH_OPERATION_UNION: + return axiom_xpath_union_operator; + + case AXIOM_XPATH_OPERATION_OR_EXPR: + return axiom_xpath_orexpr_operator; + + case AXIOM_XPATH_OPERATION_AND_EXPR: + return axiom_xpath_andexpr_operator; + + case AXIOM_XPATH_OPERATION_EQUAL_EXPR: + return axiom_xpath_equalexpr_operator; + + case AXIOM_XPATH_OPERATION_LITERAL: + return axiom_xpath_literal_operator; + + case AXIOM_XPATH_OPERATION_NUMBER: + return axiom_xpath_number_operator; + + case AXIOM_XPATH_OPERATION_PATH_EXPRESSION: + return axiom_xpath_path_expression_operator; + + case AXIOM_XPATH_OPERATION_FUNCTION_CALL: + return axiom_xpath_function_call_operator; + + case AXIOM_XPATH_OPERATION_ARGUMENT: + return axiom_xpath_argument_operator; + + default: +#ifdef AXIOM_XPATH_DEBUG + printf("Unidentified operation.\n"); +#endif + + return NULL; + } +} + +/* Returns a pointer to the respective processing function */ +axiom_xpath_iterator_t +axiom_xpath_get_iterator( + axiom_xpath_axis_t axis) +{ + switch(axis) + { + case AXIOM_XPATH_AXIS_CHILD: + return axiom_xpath_child_iterator; + + case AXIOM_XPATH_AXIS_DESCENDANT: + return axiom_xpath_descendant_iterator; + + case AXIOM_XPATH_AXIS_PARENT: + return axiom_xpath_parent_iterator; + + case AXIOM_XPATH_AXIS_ANCESTOR: + return axiom_xpath_ancestor_iterator; + + case AXIOM_XPATH_AXIS_FOLLOWING_SIBLING: + return axiom_xpath_following_sibling_iterator; + + case AXIOM_XPATH_AXIS_PRECEDING_SIBLING: + return axiom_xpath_preceding_sibling_iterator; + + case AXIOM_XPATH_AXIS_FOLLOWING: + return axiom_xpath_following_iterator; + + case AXIOM_XPATH_AXIS_PRECEDING: + return axiom_xpath_preceding_iterator; + + case AXIOM_XPATH_AXIS_ATTRIBUTE: + return axiom_xpath_attribute_iterator; + + case AXIOM_XPATH_AXIS_NAMESPACE: + return axiom_xpath_namespace_iterator; + + case AXIOM_XPATH_AXIS_SELF: + return axiom_xpath_self_iterator; + + case AXIOM_XPATH_AXIS_DESCENDANT_OR_SELF: + return axiom_xpath_descendant_self_iterator; + + case AXIOM_XPATH_AXIS_ANCESTOR_OR_SELF: + return axiom_xpath_ancestor_self_iterator; + + default: +#ifdef AXIOM_XPATH_DEBUG + printf("Unidentified axis.\n"); +#endif + + return NULL; + } +} + +int +axiom_xpath_evaluate_operation( + axiom_xpath_context_t *context, + int op) +{ + axiom_xpath_operation_t * operation; + axiom_xpath_operator_t function; + + /* Get a pointer to the operation */ + operation = AXIOM_XPATH_OPR_GET(op); + + /* Get the funciton which processes the operations */ + function = axiom_xpath_get_operator(operation); + + return function(context, operation); +} diff --git a/axiom/src/xpath/xpath_internals_engine.h b/axiom/src/xpath/xpath_internals_engine.h new file mode 100755 index 0000000..bffc8a7 --- /dev/null +++ b/axiom/src/xpath/xpath_internals_engine.h @@ -0,0 +1,265 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_XPATH_INTERNALS_ENGINE_H +#define AXIOM_XPATH_INTERNALS_ENGINE_H + +#include "xpath_internals.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_xpath_engine engine + * @ingroup axiom_xpath + * @{ + */ + + + /* Macros */ + + /** Set node->value to _value */ +#define AXIOM_XPATH_CAST_SET_VALUE(_type, _value) { \ + _type * _var; \ + if(node->value \ + && node->type != AXIOM_XPATH_TYPE_NODE \ + && node->type != AXIOM_XPATH_TYPE_ATTRIBUTE \ + && node->type != AXIOM_XPATH_TYPE_NAMESPACE) \ + { AXIS2_FREE(context->env->allocator, node->value); } \ + _var = AXIS2_MALLOC(context->env->allocator, sizeof(_type)); \ + *_var = _value; \ + node->value = (void *) _var; \ +} + + /* Functions */ + + /** + * Evaluate an XPath context, which containes a parsed expression + * + * @param context XPath context + * @return Result set + */ + axiom_xpath_result_t* axiom_xpath_run(axiom_xpath_context_t *context); + + /** + * Finds the operator function for a given operation + * + * @param op Operation + * @return Pointer to the function which process the given operation + */ + axiom_xpath_operator_t axiom_xpath_get_operator(axiom_xpath_operation_t * op); + + /** + * Get the iterotor for give axis + * + * @param axis XPath axis + * @return Pointer to the function which iterater through the given axis + */ + axiom_xpath_iterator_t axiom_xpath_get_iterator(axiom_xpath_axis_t axis); + + /* Operators */ + + /** + * Select the start node depending on whether it is an absolute or relative location path + * + * @param context XPath context + * @param op XPath operation + * @return Number of nodes added to the stack + */ + int axiom_xpath_start_node_operator(axiom_xpath_context_t *context, axiom_xpath_operation_t * op); + + /** + * Add the context node or attribute to the results stack + * + * @param context XPath context + * @param op XPath operation + * @return Number of nodes added to the stack + */ + int axiom_xpath_collect_operator(axiom_xpath_context_t *context, axiom_xpath_operation_t * op); + + /** + * Process union operator + * + * @param context XPath context + * @param op XPath operation + * @return Number of nodes added to the stack + */ + int axiom_xpath_union_operator(axiom_xpath_context_t *context, axiom_xpath_operation_t * op); + + /** + * Perform or operation + * + * @param context XPath context + * @param op XPath operation + * @return Number of nodes added to the stack; which is one + */ + int axiom_xpath_orexpr_operator(axiom_xpath_context_t *context, axiom_xpath_operation_t * op); + + /** + * Perform and operation + * + * @param context XPath context + * @param op XPath operation + * @return Number of nodes added to the stack; which is one + */ + int axiom_xpath_andexpr_operator(axiom_xpath_context_t *context, axiom_xpath_operation_t * op); + + /** + * Perform equality test operation + * + * @param context XPath context + * @param op XPath operation + * @return Number of nodes added to the stack; which is one + */ + int axiom_xpath_equalexpr_operator(axiom_xpath_context_t *context, axiom_xpath_operation_t * op); + + /** + * Evaluate function call operation + * + * @param context XPath context + * @param op XPath operation + * @return Number of nodes added to the stack; which is one + */ + int axiom_xpath_function_call_operator(axiom_xpath_context_t *context, axiom_xpath_operation_t * op); + + /** + * Evaluate argument operation + * + * @param context XPath context + * @param op XPath operation + * @return Number of nodes added to the stack; which is one + */ + int axiom_xpath_argument_operator(axiom_xpath_context_t *context, axiom_xpath_operation_t * op); + + /** + * Process a path expression + * + * @param context XPath context + * @param op XPath operation + * @return Number of nodes added to the stack + */ + int axiom_xpath_path_expression_operator(axiom_xpath_context_t *context, axiom_xpath_operation_t * op); + + /** + * Process a number; push the value to the stack + * + * @param context XPath context + * @param op XPath operation + * @return Number of nodes added to the stack; which is one + */ + int axiom_xpath_number_operator(axiom_xpath_context_t *context, axiom_xpath_operation_t * op); + + /** + * Process a literal; push the string to the stack + * + * @param context XPath context + * @param op XPath operation + * @return Number of nodes added to the stack; which is one + */ + int axiom_xpath_literal_operator(axiom_xpath_context_t *context, axiom_xpath_operation_t * op); + + + /** + * Converts an XPath result to a boolean result + * + * @param node Result + * @param context XPath context + */ + void axiom_xpath_cast_boolean(axiom_xpath_result_node_t *node, axiom_xpath_context_t *context); + + /** + * Converts an XPath result to a number + * + * @param node Result + * @param context XPath context + */ + void axiom_xpath_cast_number(axiom_xpath_result_node_t *node, axiom_xpath_context_t *context); + + /** + * Converts an XPath result to a string + * + * @param node Result + * @param context XPath context + */ + void axiom_xpath_cast_string(axiom_xpath_result_node_t *node, axiom_xpath_context_t *context); + + /* Convert a node set to boolean */ + /** + * Convert a XPath node set to boolean + * + * @param node_set Node set + * @return AXIS2_TRUE if true; AXIS2_FALSE otherwise + */ + axis2_bool_t axiom_xpath_convert_to_boolean(axutil_array_list_t *node_set, axiom_xpath_context_t *context); + + /** + * Test if two result nodes are equal + * + * @param node1 First node + * @param node2 Second node + * @param context XPath context + * @return AXIS2_TRUE if equal; AXIS2_FALSE otherwise + */ + axis2_bool_t axiom_xpath_compare_equal(axiom_xpath_result_node_t *node1, axiom_xpath_result_node_t *node2, axiom_xpath_context_t *context); + + /** + * Test if the axiom node matches node test + * + * @param context XPath context + * @param node_test Node test + * @return AXIS2_TRUE if matches; AXIS2_FALSE otherwise + */ + axis2_bool_t axiom_xpath_node_test_match(axiom_xpath_context_t *context, axiom_xpath_node_test_t *node_test); + + /** + * Evaluate if the predicate is true + * + * @param context XPath context + * @param n_nodes Number of results after evaluating the expression in the predicate + * @return AXIS2_TRUE if matches; AXIS2_FALSE otherwise + */ + axis2_bool_t axiom_xpath_evaluate_predicate_condition(axiom_xpath_context_t *context, int n_nodes); + + /** + * Evaluate if the predicate(s) is true using axiom_xpath_evaluate_predicate_condition and executes the operation op_next + * + * @param context XPath context + * @param op_next The operation to be executed if all predicates are true + * @param op_predicate Reference to predicate + * @return Number of nodes added to the stack + */ + int axiom_xpath_evaluate_predicate(axiom_xpath_context_t *context, int op_next, int op_predicate); + + /** + * Evaluate operation pointed by op + * + * @param context XPath context + * @param op The index of the operation in the operations list + * @return Number of nodes added to the stack + */ + int axiom_xpath_evaluate_operation(axiom_xpath_context_t *context, int op); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/axiom/src/xpath/xpath_internals_iterators.c b/axiom/src/xpath/xpath_internals_iterators.c new file mode 100644 index 0000000..225bea6 --- /dev/null +++ b/axiom/src/xpath/xpath_internals_iterators.c @@ -0,0 +1,588 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_xpath.h> +#include "xpath_internals.h" +#include "xpath_internals_engine.h" +#include "xpath_internals_iterators.h" + + +/* child */ +int +axiom_xpath_child_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate) +{ + int n_nodes_tot = 0; + int n_nodes; + axiom_xpath_operation_t * node_test_op; + axiom_node_t *cur = NULL; + axiom_node_t *context_node = NULL; + /* For streaming */ + axiom_node_t *prev = NULL; + + AXIOM_XPATH_ITERATOR_INITIALIZE; + cur = axiom_node_get_first_child(context->node, context->env); + + while(cur != NULL) + { + n_nodes = 0; + context->node = cur; + prev = cur; + cur = axiom_node_get_next_sibling(cur, context->env); + if(axiom_xpath_node_test_match(context, (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes = axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + n_nodes_tot += n_nodes; + } + } + + /* Change the context node back to what it was */ + context->node = context_node; + + return n_nodes_tot; +} + +/* descendant */ +int +axiom_xpath_descendant_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate) +{ + int n_nodes = 0; + axiom_xpath_operation_t * node_test_op; + axiom_node_t *child = NULL; + axiom_node_t *context_node = NULL; + axutil_stack_t *stack; + + AXIOM_XPATH_ITERATOR_INITIALIZE; + + /* Setting up the stack */ + stack = axutil_stack_create(context->env); + + child = axiom_node_get_first_child(context->node, context->env); + while(child) + { + axutil_stack_push(stack, context->env, child); + child = axiom_node_get_first_child(child, context->env); + } + + /* Processing nodes */ + while(axutil_stack_size(stack, context->env) > 0) + { + child = (axiom_node_t *)axutil_stack_pop(stack, context->env); + + context->node = child; + if(axiom_xpath_node_test_match(context, (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes += axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + + child = axiom_node_get_next_sibling(child, context->env); + while(child) + { + axutil_stack_push(stack, context->env, child); + child = axiom_node_get_first_child(child, context->env); + } + } + + context->node = context_node; + + axutil_stack_free(stack, context->env); + + return n_nodes; +} + +/* parent */ +int +axiom_xpath_parent_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate) +{ + int n_nodes = 0; + axiom_xpath_operation_t * node_test_op; + axiom_node_t *parent = NULL; + axiom_node_t *context_node = NULL; + + AXIOM_XPATH_ITERATOR_INITIALIZE; + + parent = axiom_node_get_parent(context->node, context->env); + + if(parent != NULL) + { + context->node = parent; + if(axiom_xpath_node_test_match(context, (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes = axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + } + + /* Change the context node back to what it was */ + context->node = context_node; + + return n_nodes; +} + +/* ancestor axis */ +int +axiom_xpath_ancestor_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate) +{ + int n_nodes = 0; + axiom_xpath_operation_t * node_test_op; + axiom_node_t *cur = NULL; + axiom_node_t *context_node = NULL; + + AXIOM_XPATH_ITERATOR_INITIALIZE; + cur = axiom_node_get_parent(context->node, context->env); + + while(cur != NULL) + { + context->node = cur; + if(axiom_xpath_node_test_match(context, (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes += axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + + cur = axiom_node_get_parent(cur, context->env); + } + + /* Change the context node back to what it was */ + context->node = context_node; + + return n_nodes; +} + +/* following-sibling axis */ +int +axiom_xpath_following_sibling_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate) +{ + int n_nodes = 0; + axiom_xpath_operation_t * node_test_op; + axiom_node_t *cur = NULL; + axiom_node_t *context_node = NULL; + + AXIOM_XPATH_ITERATOR_INITIALIZE; + cur = axiom_node_get_next_sibling(context->node, context->env); + + while(cur != NULL) + { + context->node = cur; + if(axiom_xpath_node_test_match(context, (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes += axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + + cur = axiom_node_get_next_sibling(cur, context->env); + } + + /* Change the context node back to what it was */ + context->node = context_node; + + return n_nodes; +} + +/* preceding-sibling axis */ +int +axiom_xpath_preceding_sibling_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate) +{ + int n_nodes = 0; + axiom_xpath_operation_t * node_test_op; + axiom_node_t *cur = NULL; + axiom_node_t *context_node = NULL; + + AXIOM_XPATH_ITERATOR_INITIALIZE; + cur = axiom_node_get_previous_sibling(context->node, context->env); + + while(cur != NULL) + { + context->node = cur; + if(axiom_xpath_node_test_match(context, (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes += axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + + cur = axiom_node_get_previous_sibling(cur, context->env); + } + + /* Change the context node back to what it was */ + context->node = context_node; + + return n_nodes; +} + +/* following */ +int +axiom_xpath_following_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate) +{ + int n_nodes = 0; + axiom_xpath_operation_t * node_test_op; + axiom_node_t *child = NULL, *parent = NULL; + axiom_node_t *context_node = NULL; + axutil_stack_t *stack; + + AXIOM_XPATH_ITERATOR_INITIALIZE; + + /* Setting up the stack */ + stack = axutil_stack_create(context->env); + axutil_stack_push(stack, context->env, context->node); + + parent = context->node; + + while(parent) + { + axutil_stack_push(stack, context->env, parent); + + while(axutil_stack_size(stack, context->env) > 0) + { + child = (axiom_node_t *)axutil_stack_pop(stack, context->env); + + child = axiom_node_get_next_sibling(child, context->env); + + while(child) + { + context->node = child; + if(axiom_xpath_node_test_match(context, + (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes += axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + + axutil_stack_push(stack, context->env, child); + child = axiom_node_get_first_child(child, context->env); + } + } + parent = axiom_node_get_parent(parent, context->env); + } + + /* Change the context node back to what it was */ + context->node = context_node; + + axutil_stack_free(stack, context->env); + + return n_nodes; +} + +/* preceding */ +int +axiom_xpath_preceding_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate) +{ + int n_nodes = 0; + axiom_xpath_operation_t * node_test_op; + axiom_node_t *child = NULL, *parent = NULL; + axiom_node_t *context_node = NULL; + axutil_stack_t *stack; + + AXIOM_XPATH_ITERATOR_INITIALIZE; + + /* Setting up the stack */ + stack = axutil_stack_create(context->env); + + parent = context->node; + + while(parent) + { + axutil_stack_push(stack, context->env, parent); + + while(axutil_stack_size(stack, context->env) > 0) + { + child = (axiom_node_t *)axutil_stack_pop(stack, context->env); + + child = axiom_node_get_previous_sibling(child, context->env); + + while(child) + { + context->node = child; + if(axiom_xpath_node_test_match(context, + (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes += axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + + axutil_stack_push(stack, context->env, child); + + child = axiom_node_get_last_child(child, context->env); + } + } + parent = axiom_node_get_parent(parent, context->env); + } + + /* Change the context node back to what it was */ + context->node = context_node; + + axutil_stack_free(stack, context->env); + + return n_nodes; +} + +/* attribute axis */ +int +axiom_xpath_attribute_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate) +{ + int n_nodes = 0; + axiom_xpath_operation_t * node_test_op; + axiom_types_t type; + axiom_node_t *context_node = NULL; + axiom_element_t *element; + axutil_hash_t *ht; + axutil_hash_index_t *hi; + + /* void *key; + * axis2_ssize_t klen; + */ + void *attr; + + AXIOM_XPATH_ITERATOR_INITIALIZE; + + type = axiom_node_get_node_type(context_node, context->env); + + if(type != AXIOM_ELEMENT) + { + return 0; + } + + element = axiom_node_get_data_element(context_node, context->env); + + context->node = NULL; + + ht = axiom_element_get_all_attributes(element, context->env); + + if(ht) + { + for(hi = axutil_hash_first(ht, context->env); hi; hi = axutil_hash_next(context->env, hi)) + { + attr = &context->attribute; + axutil_hash_this(hi, NULL, NULL, attr); + + if(axiom_xpath_node_test_match(context, (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes += axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + } + } + + context->node = context_node; + context->attribute = NULL; + + return n_nodes; +} + +/* namespace axis */ +int +axiom_xpath_namespace_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate) +{ + int n_nodes = 0; + axiom_xpath_operation_t * node_test_op; + axiom_types_t type; + axiom_node_t *context_node = NULL; + axiom_element_t *element; + axutil_hash_t *ht; + axutil_hash_index_t *hi; + + /* void *key; + * axis2_ssize_t klen; + */ + + void *ns; + + AXIOM_XPATH_ITERATOR_INITIALIZE; + + type = axiom_node_get_node_type(context_node, context->env); + + if(type != AXIOM_ELEMENT) + { + return 0; + } + + element = axiom_node_get_data_element(context_node, context->env); + + context->node = NULL; + + ht = axiom_element_get_namespaces(element, context->env); + + if(ht) + { + for(hi = axutil_hash_first(ht, context->env); hi; hi = axutil_hash_next(context->env, hi)) + { + ns = &context->ns; + axutil_hash_this(hi, NULL, NULL, ns); + + if(axiom_xpath_node_test_match(context, (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes += axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + } + } + + context->node = context_node; + context->ns = NULL; + + return n_nodes; +} + +/* self axis */ +int +axiom_xpath_self_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate) +{ + int n_nodes = 0; + axiom_xpath_operation_t * node_test_op; + axiom_node_t *context_node = NULL; + + AXIOM_XPATH_ITERATOR_INITIALIZE; + if(axiom_xpath_node_test_match(context, (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes += axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + + context->node = context_node; + + return n_nodes; +} + +/* descendant-or-self axis */ +int +axiom_xpath_descendant_self_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate) +{ + int n_nodes = 0; + axiom_xpath_operation_t * node_test_op; + axiom_node_t *child = NULL; + axiom_node_t *context_node = NULL; + axutil_stack_t *stack; + + AXIOM_XPATH_ITERATOR_INITIALIZE; + + if(axiom_xpath_node_test_match(context, (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes += axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + + /* Setting up the stack */ + stack = axutil_stack_create(context->env); + + child = axiom_node_get_first_child(context->node, context->env); + while(child) + { + axutil_stack_push(stack, context->env, child); + child = axiom_node_get_first_child(child, context->env); + } + + /* Processing nodes */ + while(axutil_stack_size(stack, context->env) > 0) + { + child = (axiom_node_t *)axutil_stack_pop(stack, context->env); + + context->node = child; + if(axiom_xpath_node_test_match(context, (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes += axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + + child = axiom_node_get_next_sibling(child, context->env); + while(child) + { + axutil_stack_push(stack, context->env, child); + child = axiom_node_get_first_child(child, context->env); + } + } + + /* Change the context node back to what it was */ + context->node = context_node; + + axutil_stack_free(stack, context->env); + + return n_nodes; +} + +/* ancestor-or-self axis */ +int +axiom_xpath_ancestor_self_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate) +{ + int n_nodes = 0; + axiom_xpath_operation_t * node_test_op; + axiom_node_t *parent = NULL; + axiom_node_t *context_node = NULL; + + AXIOM_XPATH_ITERATOR_INITIALIZE; + + if(axiom_xpath_node_test_match(context, (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes += axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + + parent = axiom_node_get_parent(context->node, context->env); + + while(parent != NULL) + { + context->node = parent; + if(axiom_xpath_node_test_match(context, (axiom_xpath_node_test_t *)node_test_op->par1)) + { + n_nodes += axiom_xpath_evaluate_predicate(context, op_next, op_predicate); + } + + parent = axiom_node_get_parent(parent, context->env); + } + + /* Change the context node back to what it was */ + context->node = context_node; + + return n_nodes; +} diff --git a/axiom/src/xpath/xpath_internals_iterators.h b/axiom/src/xpath/xpath_internals_iterators.h new file mode 100755 index 0000000..67d06c4 --- /dev/null +++ b/axiom/src/xpath/xpath_internals_iterators.h @@ -0,0 +1,298 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_XPATH_INTERNALS_ITERATORS_H +#define AXIOM_XPATH_INTERNALS_ITERATORS_H + +#include <axiom_xpath.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_xpath_iterators iterators + * @ingroup axiom_xpath + * @{ + */ + + +#ifdef AXIOM_XPATH_DEBUG +#define AXIOM_XPATH_ITERATOR_INITIALIZE { \ + if(!context->node) { \ + printf("Context node NULL; cannot evaluate self or descendent axis.\n"); \ + return AXIOM_XPATH_EVALUATION_ERROR; } \ + node_test_op = AXIOM_XPATH_OPR_GET(op_node_test); \ + if(!node_test_op) { \ + printf("Node test not present.\n"); \ + return AXIOM_XPATH_EVALUATION_ERROR; } \ + context_node = context->node; \ +} +#else +#define AXIOM_XPATH_ITERATOR_INITIALIZE { \ + if(!context->node) { \ + return AXIOM_XPATH_EVALUATION_ERROR; } \ + node_test_op = AXIOM_XPATH_OPR_GET(op_node_test); \ + if(!node_test_op) { \ + return AXIOM_XPATH_EVALUATION_ERROR; } \ + context_node = context->node; \ +} +#endif + + /** + * Iterate through children + * + * @param context XPath context + * @param op_node_test Reference to the node test operation + * in the parsed expression + * @param op_next Reference to the next step in the location path, + * in the parsed expression + * @param op_predicate Reference to the first predicate in the + * parsed expression + * @return Number of nodes added to the stack + */ + int axiom_xpath_child_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** + * Iterate through descendents + * + * @param context XPath context + * @param op_node_test Reference to the node test operation + * in the parsed expression + * @param op_next Reference to the next step in the location path, + * in the parsed expression + * @param op_predicate Reference to the first predicate in the + * parsed expression + * @return Number of nodes added to the stack + */ + int axiom_xpath_descendant_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** + * Iterate through parent node. (Only one node) + * + * @param context XPath context + * @param op_node_test Reference to the node test operation + * in the parsed expression + * @param op_next Reference to the next step in the location path, + * in the parsed expression + * @param op_predicate Reference to the first predicate in the + * parsed expression + * @return Number of nodes added to the stack + */ + int axiom_xpath_parent_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** + * Iterate through ancestors + * + * @param context XPath context + * @param op_node_test Reference to the node test operation + * in the parsed expression + * @param op_next Reference to the next step in the location path, + * in the parsed expression + * @param op_predicate Reference to the first predicate in the + * parsed expression + * @return Number of nodes added to the stack + */ + int axiom_xpath_ancestor_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** + * Iterate through siblings following the context node + * + * @param context XPath context + * @param op_node_test Reference to the node test operation + * in the parsed expression + * @param op_next Reference to the next step in the location path, + * in the parsed expression + * @param op_predicate Reference to the first predicate in the + * parsed expression + * @return Number of nodes added to the stack + */ + int axiom_xpath_following_sibling_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** + * Iterate through sibling preceding the context node + * + * @param context XPath context + * @param op_node_test Reference to the node test operation + * in the parsed expression + * @param op_next Reference to the next step in the location path, + * in the parsed expression + * @param op_predicate Reference to the first predicate in the + * parsed expression + * @return Number of nodes added to the stack + */ + int axiom_xpath_preceding_sibling_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** + * Iterate through all nodes following the context node + * + * @param context XPath context + * @param op_node_test Reference to the node test operation + * in the parsed expression + * @param op_next Reference to the next step in the location path, + * in the parsed expression + * @param op_predicate Reference to the first predicate in the + * parsed expression + * @return Number of nodes added to the stack + */ + int axiom_xpath_following_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** + * Iterate through all nodes preceding the context node + * + * @param context XPath context + * @param op_node_test Reference to the node test operation + * in the parsed expression + * @param op_next Reference to the next step in the location path, + * in the parsed expression + * @param op_predicate Reference to the first predicate in the + * parsed expression + * @return Number of nodes added to the stack + */ + int axiom_xpath_preceding_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** + * Iterate through attributes + * + * @param context XPath context + * @param op_node_test Reference to the node test operation + * in the parsed expression + * @param op_next Reference to the next step in the location path, + * in the parsed expression + * @param op_predicate Reference to the first predicate in the + * parsed expression + * @return Number of nodes added to the stack + */ + int axiom_xpath_attribute_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** + * Iterate through namespaces defined in the context node + * + * @param context XPath context + * @param op_node_test Reference to the node test operation + * in the parsed expression + * @param op_next Reference to the next step in the location path, + * in the parsed expression + * @param op_predicate Reference to the first predicate in the + * parsed expression + * @return Number of nodes added to the stack + */ + int axiom_xpath_namespace_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** + * Iterate through self node (Only one node) + * + * @param context XPath context + * @param op_node_test Reference to the node test operation + * in the parsed expression + * @param op_next Reference to the next step in the location path, + * in the parsed expression + * @param op_predicate Reference to the first predicate in the + * parsed expression + * @return Number of nodes added to the stack + */ + int axiom_xpath_self_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** + * Iterate through descendents and context node + * + * @param context XPath context + * @param op_node_test Reference to the node test operation + * in the parsed expression + * @param op_next Reference to the next step in the location path, + * in the parsed expression + * @param op_predicate Reference to the first predicate in the + * parsed expression + * @return Number of nodes added to the stack + */ + int axiom_xpath_descendant_self_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** + * Iterate through ancestors and context node + * + * @param context XPath context + * @param op_node_test Reference to the node test operation + * in the parsed expression + * @param op_next Reference to the next step in the location path, + * in the parsed expression + * @param op_predicate Reference to the first predicate in the + * parsed expression + * @return Number of nodes added to the stack + */ + int axiom_xpath_ancestor_self_iterator( + axiom_xpath_context_t *context, + int op_node_test, + int op_next, + int op_predicate); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/axiom/src/xpath/xpath_internals_parser.c b/axiom/src/xpath/xpath_internals_parser.c new file mode 100755 index 0000000..a1ce79a --- /dev/null +++ b/axiom/src/xpath/xpath_internals_parser.c @@ -0,0 +1,1245 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_xpath.h> +#include "xpath_internals.h" +#include "xpath_internals_parser.h" +#include <ctype.h> + +/* Compile an XPath expression */ +int +axiom_xpath_compile( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + if(!expr || !expr->expr_str) + { +#ifdef AXIOM_XPATH_DEBUG + printf("Expression in NULL.\n"); +#endif + + return AXIS2_FAILURE; + } + + expr->expr_len = (int)axutil_strlen(expr->expr_str); + + expr->operations = axutil_array_list_create(env, 0); + + expr->expr_ptr = 0; + + expr->start = axiom_xpath_compile_orexpr(env, expr); + + if(expr->start == AXIOM_XPATH_PARSE_ERROR) + { + axutil_array_list_free(expr->operations, env); + + return AXIOM_XPATH_PARSE_ERROR; + } + else + { +#ifdef AXIOM_XPATH_DEBUG + printf("Expression successfully parsed\n"); +#endif + + return AXIOM_XPATH_PARSE_SUCCESS; + } +} + +/* Parse Or Expression */ +int +axiom_xpath_compile_orexpr( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + int op1, op2; + + if(!AXIOM_XPATH_HAS_MORE) + { + return AXIOM_XPATH_PARSE_END; + } + + op1 = axiom_xpath_compile_andexpr(env, expr); + + if(op1 == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: AndEpxr expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + AXIOM_XPATH_SKIP_WHITESPACES; + + while(AXIOM_XPATH_CURRENT == 'o' && AXIOM_XPATH_NEXT(1) == 'r') + { + AXIOM_XPATH_READ(2); + AXIOM_XPATH_SKIP_WHITESPACES; + + op2 = axiom_xpath_compile_andexpr(env, expr); + + if(op2 == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: AndEpxr expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + op1 = AXIOM_XPATH_PUSH(AXIOM_XPATH_OPERATION_OR_EXPR, op1, op2); + + AXIOM_XPATH_SKIP_WHITESPACES; + } + + return op1; +} + +/* Parse And Expression */ +int +axiom_xpath_compile_andexpr( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + int op1, op2; + + if(!AXIOM_XPATH_HAS_MORE) + { + return AXIOM_XPATH_PARSE_END; + } + + op1 = axiom_xpath_compile_equalexpr(env, expr); + + if(op1 == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: EqualityExpr expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + AXIOM_XPATH_SKIP_WHITESPACES; + + while(AXIOM_XPATH_CURRENT == 'a' && AXIOM_XPATH_NEXT(1) == 'n' && AXIOM_XPATH_NEXT(1) == 'd') + { + AXIOM_XPATH_READ(2); + AXIOM_XPATH_SKIP_WHITESPACES; + + op2 = axiom_xpath_compile_equalexpr(env, expr); + + if(op2 == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: EqualityExpr expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + op1 = AXIOM_XPATH_PUSH(AXIOM_XPATH_OPERATION_AND_EXPR, op1, op2); + + AXIOM_XPATH_SKIP_WHITESPACES; + } + + return op1; +} + +/* Parse Equality Expression */ +int +axiom_xpath_compile_equalexpr( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + int op1, op2; + + if(!AXIOM_XPATH_HAS_MORE) + { + return AXIOM_XPATH_PARSE_END; + } + + op1 = axiom_xpath_compile_union(env, expr); + + if(op1 == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: UnionExpr expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + while(AXIOM_XPATH_CURRENT == '=') + { + AXIOM_XPATH_SKIP_WHITESPACES; + AXIOM_XPATH_READ(1); + AXIOM_XPATH_SKIP_WHITESPACES; + + op2 = axiom_xpath_compile_union(env, expr); + + if(op2 == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: UnionExpr expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + op1 = AXIOM_XPATH_PUSH(AXIOM_XPATH_OPERATION_EQUAL_EXPR, op1, op2); + + AXIOM_XPATH_SKIP_WHITESPACES; + } + + return op1; +} + +/* Parse Union */ +int +axiom_xpath_compile_union( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + int op1, op2; + + if(!AXIOM_XPATH_HAS_MORE) + { + return AXIOM_XPATH_PARSE_END; + } + + op1 = axiom_xpath_compile_path_expression(env, expr); + + if(op1 == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: PathExpr expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + AXIOM_XPATH_SKIP_WHITESPACES; + + if(AXIOM_XPATH_CURRENT == '|') + { + AXIOM_XPATH_READ(1); + AXIOM_XPATH_SKIP_WHITESPACES; + op2 = axiom_xpath_compile_union(env, expr); + + if(op2 == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: UnionExpr expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + return AXIOM_XPATH_PUSH(AXIOM_XPATH_OPERATION_UNION, op1, op2); + } + + /* Just a location path */ + return op1; +} + +/* Compile Filter expression */ +int +axiom_xpath_compile_filter( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + int op = AXIOM_XPATH_PARSE_END; + + if(AXIOM_XPATH_CURRENT == '(') + { + AXIOM_XPATH_READ(1); + op = axiom_xpath_compile_orexpr(env, expr); + AXIOM_XPATH_SKIP_WHITESPACES; + if(AXIOM_XPATH_CURRENT == ')') + { + AXIOM_XPATH_READ(1); + return op; + } + else + { + return AXIOM_XPATH_PARSE_ERROR; + } + } + else if(AXIOM_XPATH_CURRENT == '\'' || AXIOM_XPATH_CURRENT == '\"') + { + return AXIOM_XPATH_PUSH_PAR(AXIOM_XPATH_OPERATION_LITERAL, axiom_xpath_compile_literal(env, + expr), NULL, AXIOM_XPATH_PARSE_END); + } + else if(isdigit(AXIOM_XPATH_CURRENT) || (AXIOM_XPATH_CURRENT == '.' && isdigit( + AXIOM_XPATH_NEXT(1)))) + { + return AXIOM_XPATH_PUSH_PAR(AXIOM_XPATH_OPERATION_NUMBER, axiom_xpath_compile_number(env, + expr), NULL, AXIOM_XPATH_PARSE_END); + } + else if(AXIOM_XPATH_CURRENT == '$') + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: Variables are not supported, yet - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + } + else + { + return axiom_xpath_compile_function_call(env, expr); + } + +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: Invalid Filter expression - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + /* TODO: functions and variables */ +} + +/* Parse Path expression (not a location path) */ +int +axiom_xpath_path_compile_path_expression_filter( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + int op_filter, op_next; + + op_filter = axiom_xpath_compile_filter(env, expr); + + if(op_filter == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: FilterExpr expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + AXIOM_XPATH_SKIP_WHITESPACES; + + if(AXIOM_XPATH_NEXT(0) == '/' && AXIOM_XPATH_NEXT(1) == '/') + { + AXIOM_XPATH_READ(2); + + op_next = axiom_xpath_compile_relative_location(env, expr); + + if(op_next == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: RelativeLocation expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + op_next = AXIOM_XPATH_WRAP_SELF_DESCENDANT(op_next); + } + else if(AXIOM_XPATH_NEXT(0) == '/') + { + AXIOM_XPATH_READ(1); + + op_next = axiom_xpath_compile_relative_location(env, expr); + + if(op_next == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: RelativeLocation expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + } + else + { + op_next = AXIOM_XPATH_PARSE_END; + } + + return AXIOM_XPATH_PUSH(AXIOM_XPATH_OPERATION_PATH_EXPRESSION, op_filter, op_next); +} + +/* Parse Path expression */ +int +axiom_xpath_compile_path_expression( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + int temp_ptr = expr->expr_ptr; + axis2_char_t *name; + axis2_char_t *node_types[] = { "comment", "node", "processing-instruction", "text" }; + axis2_char_t filter_start[] = { '$', '\'', '\"', '(' }; + int i; + + /* if | FilterExpr + | FilterExpr '/' RelativeLocationPath + | FilterExpr '//' RelativeLocationPath */ + for(i = 0; i < 4; i++) + { + if(AXIOM_XPATH_CURRENT == filter_start[i]) + { + return axiom_xpath_path_compile_path_expression_filter(env, expr); + } + } + + if(isdigit(AXIOM_XPATH_CURRENT) || (AXIOM_XPATH_CURRENT == '.' && isdigit(AXIOM_XPATH_NEXT(1)))) + { + return axiom_xpath_path_compile_path_expression_filter(env, expr); + } + + /* Funciton calls */ + name = axiom_xpath_compile_ncname(env, expr); + AXIOM_XPATH_SKIP_WHITESPACES; + + if(name != NULL && AXIOM_XPATH_CURRENT == '(') + { + expr->expr_ptr = temp_ptr; + for(i = 0; i < 4; i++) + { + /* If node type */ + if(axutil_strcmp(name, node_types[i]) == 0) + { + return axiom_xpath_compile_location_path(env, expr); + } + } + + return axiom_xpath_path_compile_path_expression_filter(env, expr); + } + + expr->expr_ptr = temp_ptr; + + return axiom_xpath_compile_location_path(env, expr); +} + +/* Parses Location Path */ +int +axiom_xpath_compile_location_path( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + int op1; + axiom_xpath_operation_type_t opr; + + if(!AXIOM_XPATH_HAS_MORE) + { + return AXIOM_XPATH_PARSE_END; + } + + if(AXIOM_XPATH_CURRENT == '/') + { + /* Descendent */ + if(AXIOM_XPATH_NEXT(1) == '/') + { + opr = AXIOM_XPATH_OPERATION_CONTEXT_NODE; + AXIOM_XPATH_READ(2); + AXIOM_XPATH_SKIP_WHITESPACES; + + op1 = axiom_xpath_compile_relative_location(env, expr); + + if(op1 == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: RelativeLocation expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + op1 = AXIOM_XPATH_WRAP_SELF_DESCENDANT(op1); + } + else + { + opr = AXIOM_XPATH_OPERATION_ROOT_NODE; + AXIOM_XPATH_READ(1); + + op1 = axiom_xpath_compile_relative_location(env, expr); + + if(op1 == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: RelativeLocation expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + } + } + else + { + opr = AXIOM_XPATH_OPERATION_CONTEXT_NODE; + + op1 = axiom_xpath_compile_relative_location(env, expr); + + if(op1 == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: RelativeLocation expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + } + + if(op1 == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: RelativeLocation expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + return AXIOM_XPATH_PUSH(opr, op1, AXIOM_XPATH_PARSE_END); +} + +/* Parses Relative Location Path */ +int +axiom_xpath_compile_relative_location( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + int op_step, op_next; + + if(!AXIOM_XPATH_HAS_MORE) + { + return AXIOM_XPATH_PARSE_END; + } + + op_step = axiom_xpath_compile_step(env, expr); + op_next = AXIOM_XPATH_PARSE_END; /* Will change if there are more steps */ + + if(op_step == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: Step expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + AXIOM_XPATH_SKIP_WHITESPACES; + + if(AXIOM_XPATH_NEXT(0) == '/' && AXIOM_XPATH_NEXT(1) == '/') + { + AXIOM_XPATH_READ(2); + + op_next = axiom_xpath_compile_relative_location(env, expr); + + if(op_next == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: RelativeLocation expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + op_next = AXIOM_XPATH_WRAP_SELF_DESCENDANT(op_next); + } + else if(AXIOM_XPATH_NEXT(0) == '/') + { + AXIOM_XPATH_READ(1); + + op_next = axiom_xpath_compile_relative_location(env, expr); + + if(op_next == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: RelativeLocation expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + } + + /* End of the location path */ + if(op_next == AXIOM_XPATH_PARSE_END) + { + op_next = AXIOM_XPATH_PUSH(AXIOM_XPATH_OPERATION_RESULT, AXIOM_XPATH_PARSE_END, + AXIOM_XPATH_PARSE_END); + } + + return AXIOM_XPATH_PUSH(AXIOM_XPATH_OPERATION_STEP, op_step, op_next); +} + +/* Parses Step */ +int +axiom_xpath_compile_step( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + int op_predicate = AXIOM_XPATH_PARSE_END; + axiom_xpath_node_test_t *node_test; + int temp_ptr; + axis2_char_t *name = NULL; + axiom_xpath_axis_t axis = AXIOM_XPATH_AXIS_NONE; + + AXIOM_XPATH_SKIP_WHITESPACES; + + /* . and .. */ + if(AXIOM_XPATH_CURRENT == '.') + { + if(AXIOM_XPATH_NEXT(1) == '.') + { + AXIOM_XPATH_READ(2); + axis = AXIOM_XPATH_AXIS_PARENT; + } + else + { + AXIOM_XPATH_READ(1); + axis = AXIOM_XPATH_AXIS_SELF; + } + + return AXIOM_XPATH_PUSH_PAR(AXIOM_XPATH_OPERATION_NODE_TEST, + axiom_xpath_create_node_test_node(env), axiom_xpath_create_axis(env, axis), + op_predicate); + } + else if(AXIOM_XPATH_CURRENT == '@') + { + axis = AXIOM_XPATH_AXIS_ATTRIBUTE; + + AXIOM_XPATH_READ(1); + AXIOM_XPATH_SKIP_WHITESPACES; + } + else + { + temp_ptr = expr->expr_ptr; + + name = axiom_xpath_compile_ncname(env, expr); + + if(name) + { + AXIOM_XPATH_SKIP_WHITESPACES; + + /* An axis */ + if(AXIOM_XPATH_CURRENT == ':' && AXIOM_XPATH_NEXT(1) == ':') + { + axis = axiom_xpath_get_axis(env, name); + + if(axis == AXIOM_XPATH_AXIS_NONE) + { +#ifdef AXIOM_XPATH_DEBUG + printf("Parse error: Invalid axis - %s\n", name); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + AXIOM_XPATH_READ(2); + AXIOM_XPATH_SKIP_WHITESPACES; + } + else + { + axis = AXIOM_XPATH_AXIS_CHILD; + + expr->expr_ptr = temp_ptr; + } + } + else + { + axis = AXIOM_XPATH_AXIS_CHILD; + + expr->expr_ptr = temp_ptr; + } + } + + node_test = axiom_xpath_compile_node_test(env, expr); + + if(!node_test) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: NodeTest expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + op_predicate = axiom_xpath_compile_predicate(env, expr); + + if(op_predicate == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: Predicate expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + return AXIOM_XPATH_PUSH_PAR(AXIOM_XPATH_OPERATION_NODE_TEST, node_test, + axiom_xpath_create_axis(env, axis), op_predicate); +} + +axiom_xpath_node_test_t* +axiom_xpath_compile_node_test( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + axis2_char_t* name; + axiom_xpath_node_test_t *node_test; + + node_test = AXIS2_MALLOC(env->allocator, sizeof(axiom_xpath_node_test_t)); + node_test->type = AXIOM_XPATH_NODE_TEST_NONE; + node_test->prefix = NULL; + node_test->name = NULL; + node_test->lit = NULL; + + if(AXIOM_XPATH_CURRENT == '*') + { + AXIOM_XPATH_READ(1); + + node_test->type = AXIOM_XPATH_NODE_TEST_ALL; + + return node_test; + } + + name = axiom_xpath_compile_ncname(env, expr); + + if(!name) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: NCName expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + AXIS2_FREE(env->allocator, node_test); + + return NULL; + } + + /* Node type */ + + if(AXIOM_XPATH_CURRENT == '(') + { + AXIOM_XPATH_READ(1); + + if(axutil_strcmp(name, "comment") == 0) + { + node_test->type = AXIOM_XPATH_NODE_TYPE_COMMENT; + } + if(axutil_strcmp(name, "node") == 0) + { + node_test->type = AXIOM_XPATH_NODE_TYPE_NODE; + } + if(axutil_strcmp(name, "processing-instruction") == 0) + { + node_test->type = AXIOM_XPATH_NODE_TYPE_PI; + + node_test->lit = axiom_xpath_compile_literal(env, expr); + } + if(axutil_strcmp(name, "text") == 0) + { + node_test->type = AXIOM_XPATH_NODE_TYPE_TEXT; + } + + AXIOM_XPATH_SKIP_WHITESPACES; + + if(node_test->type == AXIOM_XPATH_NODE_TEST_NONE || AXIOM_XPATH_CURRENT != ')') + { +#ifdef AXIOM_XPATH_DEBUG + printf("Parse error: Invalid node type - %s\n", name); +#endif + + AXIS2_FREE(env->allocator, node_test); + + return NULL; + } + + AXIOM_XPATH_READ(1); + } + else + { + node_test->type = AXIOM_XPATH_NODE_TEST_STANDARD; + + if(AXIOM_XPATH_CURRENT == ':') + { + AXIOM_XPATH_READ(1); + + node_test->prefix = name; + + if(AXIOM_XPATH_CURRENT == '*') + { + AXIOM_XPATH_READ(1); + + node_test->type = AXIOM_XPATH_NODE_TEST_ALL; + + return node_test; + } + + node_test->name = axiom_xpath_compile_ncname(env, expr); + + if(!node_test->name) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: NCName expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + AXIS2_FREE(env->allocator, node_test); + + return NULL; + } + } + else + { + node_test->name = name; + } + } + + return node_test; +} + +int +axiom_xpath_compile_function_call( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + axis2_char_t *name; + int op1 = AXIOM_XPATH_PARSE_END; + + name = axiom_xpath_compile_ncname(env, expr); + + if(!name) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: NCName expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + if(AXIOM_XPATH_CURRENT != '(') + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: '(' expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + AXIOM_XPATH_READ(1); + + AXIOM_XPATH_SKIP_WHITESPACES; + + if(AXIOM_XPATH_CURRENT != ')') + { + op1 = axiom_xpath_compile_argument(env, expr); + } + + if(AXIOM_XPATH_CURRENT != ')') + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: ')' expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + AXIOM_XPATH_READ(1); + + return AXIOM_XPATH_PUSH_PAR(AXIOM_XPATH_OPERATION_FUNCTION_CALL, name, NULL, op1); +} + +int +axiom_xpath_compile_argument( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + int op1 = AXIOM_XPATH_PARSE_END; + int op2 = AXIOM_XPATH_PARSE_END; + + op1 = axiom_xpath_compile_orexpr(env, expr); + + AXIOM_XPATH_SKIP_WHITESPACES; + + if(AXIOM_XPATH_CURRENT == ',') + { + op2 = axiom_xpath_compile_argument(env, expr); + } + + return AXIOM_XPATH_PUSH(AXIOM_XPATH_OPERATION_ARGUMENT, op1, op2); +} + +axiom_xpath_node_test_t* +axiom_xpath_create_node_test_all( + const axutil_env_t *env) +{ + axiom_xpath_node_test_t *node_test; + + node_test = AXIS2_MALLOC(env->allocator, sizeof(axiom_xpath_node_test_t)); + node_test->type = AXIOM_XPATH_NODE_TEST_ALL; + node_test->prefix = NULL; + node_test->name = NULL; + node_test->lit = NULL; + + return node_test; +} + +axiom_xpath_node_test_t* +axiom_xpath_create_node_test_node( + const axutil_env_t *env) +{ + axiom_xpath_node_test_t *node_test; + + node_test = AXIS2_MALLOC(env->allocator, sizeof(axiom_xpath_node_test_t)); + node_test->type = AXIOM_XPATH_NODE_TYPE_NODE; + node_test->prefix = NULL; + node_test->name = NULL; + node_test->lit = NULL; + + return node_test; +} + +double* +axiom_xpath_compile_number( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + double *ret = AXIS2_MALLOC(env->allocator, sizeof(double)); + double res = 0, dec = 0.1; + axis2_bool_t dot = AXIS2_FALSE; + + *ret = 0; + + while(1) + { + if(isdigit(AXIOM_XPATH_CURRENT)) + { + if(!dot) + { + res = res * 10 + (AXIOM_XPATH_CURRENT - '0'); + } + else + { + res += dec * (AXIOM_XPATH_CURRENT - '0'); + dec /= 10; + } + } + else if(AXIOM_XPATH_CURRENT == '.') + { + if(dot) + { + return ret; + } + else + { + dot = AXIS2_TRUE; + dec = 0.1; + } + } + else + { + break; + } + + AXIOM_XPATH_READ(1); + } + + *ret = res; + return ret; +} + +axis2_char_t* +axiom_xpath_compile_literal( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + axis2_char_t lit[255]; + int i = 0; + axis2_char_t del; + + if(AXIOM_XPATH_CURRENT == '\"') + { + del = '\"'; + } + else if(AXIOM_XPATH_CURRENT == '\'') + { + del = '\''; + } + else + return NULL; + + AXIOM_XPATH_READ(1); + + while(AXIOM_XPATH_HAS_MORE && AXIOM_XPATH_CURRENT != del) + { + lit[i] = AXIOM_XPATH_CURRENT; + AXIOM_XPATH_READ(1); + ++i; + } + + if(AXIOM_XPATH_HAS_MORE) + { + AXIOM_XPATH_READ(1); + } + + lit[i] = '\0'; + + return axutil_strdup(env, lit); + +} + +/* Get axis for name */ +axiom_xpath_axis_t +axiom_xpath_get_axis( + const axutil_env_t *env, + axis2_char_t* name) +{ + if(axutil_strcmp(name, "child") == 0) + { + return AXIOM_XPATH_AXIS_CHILD; + } + else if(axutil_strcmp(name, "descendant") == 0) + { + return AXIOM_XPATH_AXIS_DESCENDANT; + } + else if(axutil_strcmp(name, "parent") == 0) + { + return AXIOM_XPATH_AXIS_PARENT; + } + else if(axutil_strcmp(name, "ancestor") == 0) + { + return AXIOM_XPATH_AXIS_ANCESTOR; + } + else if(axutil_strcmp(name, "following-sibling") == 0) + { + return AXIOM_XPATH_AXIS_FOLLOWING_SIBLING; + } + else if(axutil_strcmp(name, "preceding-sibling") == 0) + { + return AXIOM_XPATH_AXIS_PRECEDING_SIBLING; + } + else if(axutil_strcmp(name, "following") == 0) + { + return AXIOM_XPATH_AXIS_FOLLOWING; + } + else if(axutil_strcmp(name, "preceding") == 0) + { + return AXIOM_XPATH_AXIS_PRECEDING; + } + else if(axutil_strcmp(name, "attribute") == 0) + { + return AXIOM_XPATH_AXIS_ATTRIBUTE; + } + else if(axutil_strcmp(name, "namespace") == 0) + { + return AXIOM_XPATH_AXIS_NAMESPACE; + } + else if(axutil_strcmp(name, "self") == 0) + { + return AXIOM_XPATH_AXIS_SELF; + } + else if(axutil_strcmp(name, "descendant-or-self") == 0) + { + return AXIOM_XPATH_AXIS_DESCENDANT_OR_SELF; + } + else if(axutil_strcmp(name, "ancestor-or-self") == 0) + { + return AXIOM_XPATH_AXIS_ANCESTOR_OR_SELF; + } + else + { +#ifdef AXIOM_XPATH_DEBUG + printf("Unidentified axis name.\n"); +#endif + + return AXIOM_XPATH_AXIS_NONE; + } +} + +/* Parse Predicate */ +int +axiom_xpath_compile_predicate( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + int op1, op_next_predicate; + + AXIOM_XPATH_SKIP_WHITESPACES; + + if(!AXIOM_XPATH_HAS_MORE || AXIOM_XPATH_CURRENT != '[') + { + return AXIOM_XPATH_PARSE_END; + } + + AXIOM_XPATH_READ(1); + AXIOM_XPATH_SKIP_WHITESPACES; + + /* A PredicateExpr is evaluated by evaluating the Expr and converting the result to a boolean. + If the result is a number, the result will be converted to true if the number is equal to the + context position and will be converted to false otherwise; if the result is not a number, + then the result will be converted as if by a call to the boolean function. */ + + op1 = axiom_xpath_compile_orexpr(env, expr); + + if(op1 == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: EqualExpr expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + AXIOM_XPATH_SKIP_WHITESPACES; + + if(AXIOM_XPATH_CURRENT != ']') + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: ] expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + AXIOM_XPATH_READ(1); + + op_next_predicate = axiom_xpath_compile_predicate(env, expr); + + if(op_next_predicate == AXIOM_XPATH_PARSE_ERROR) + { +#ifdef AXIOM_XPATH_DEBUG + printf( + "Parse error: Predicate expected - %s\n", + expr->expr_str + expr->expr_ptr); +#endif + + return AXIOM_XPATH_PARSE_ERROR; + } + + return AXIOM_XPATH_PUSH(AXIOM_XPATH_OPERATION_PREDICATE, op1, op_next_predicate); +} + +/* Parse Node Test */ +axis2_char_t * +axiom_xpath_compile_ncname( + const axutil_env_t *env, + axiom_xpath_expression_t* expr) +{ + axis2_char_t name[255]; + int i = 0; + + if(!isalpha(AXIOM_XPATH_CURRENT) && AXIOM_XPATH_CURRENT != '_') + { + return NULL; + } + + /* TODO: Add CombiningChar and Extender + * Link http://www.w3.org/TR/REC-xml/#NT-NameChar */ + while(AXIOM_XPATH_HAS_MORE && (isalnum(AXIOM_XPATH_CURRENT) || AXIOM_XPATH_CURRENT == '_' + || AXIOM_XPATH_CURRENT == '.' || AXIOM_XPATH_CURRENT == '-')) + { + name[i] = AXIOM_XPATH_CURRENT; + AXIOM_XPATH_READ(1); + ++i; + } + + name[i] = '\0'; + + return axutil_strdup(env, name); +} + +/* Supporting functions */ +int +axiom_xpath_add_operation( + const axutil_env_t *env, + axiom_xpath_expression_t* expr, + axiom_xpath_operation_type_t op_type, + int op1, + int op2, + void *par1, + void *par2) +{ + axiom_xpath_operation_t *op; + + op = AXIS2_MALLOC(env->allocator, sizeof(axiom_xpath_operation_t)); + op->opr = op_type; + op->op1 = op1; + op->op2 = op2; + + op->pos = 0; + + op->par1 = par1; + op->par2 = par2; + + axutil_array_list_add(expr->operations, env, op); + + return axutil_array_list_size(expr->operations, env) - 1; +} + +axiom_xpath_axis_t * +axiom_xpath_create_axis( + const axutil_env_t *env, + axiom_xpath_axis_t axis) +{ + axiom_xpath_axis_t *axis_p = AXIS2_MALLOC(env->allocator, sizeof(axiom_xpath_axis_t)); + + *axis_p = axis; + return axis_p; +} diff --git a/axiom/src/xpath/xpath_internals_parser.h b/axiom/src/xpath/xpath_internals_parser.h new file mode 100755 index 0000000..7d1a2d0 --- /dev/null +++ b/axiom/src/xpath/xpath_internals_parser.h @@ -0,0 +1,421 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_XPATH_INTERNALS_PARSER_H +#define AXIOM_XPATH_INTERNALS_PARSER_H + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_xpath_parser parser + * @ingroup axiom_xpath + * @{ + */ + + + /* Macros */ + + /** Get the current character in the expression */ +#define AXIOM_XPATH_CURRENT (expr->expr_ptr < expr->expr_len ? \ + expr->expr_str[expr->expr_ptr] : -1) + + /** Get a character after the current */ +#define AXIOM_XPATH_NEXT(ind) (expr->expr_ptr + ind < expr->expr_len ? \ + expr->expr_str[expr->expr_ptr + ind] : -1) + + /** Increment the pointer to the expression */ +#define AXIOM_XPATH_READ(n) (expr->expr_ptr += n) + + /** Check if expression has finished parsing */ +#define AXIOM_XPATH_HAS_MORE (expr->expr_ptr < expr->expr_len) + + /** Skip white spaces */ +#define AXIOM_XPATH_SKIP_WHITESPACES \ + { while(AXIOM_XPATH_CURRENT == ' ') \ + AXIOM_XPATH_READ(1); \ + } + + /** Wrape an operation in a self_or_descendent step; used to handle '//' */ +#define AXIOM_XPATH_WRAP_SELF_DESCENDANT(_op2) \ + axiom_xpath_add_operation(env, expr, AXIOM_XPATH_OPERATION_STEP, \ + axiom_xpath_add_operation(env, expr, AXIOM_XPATH_OPERATION_NODE_TEST, \ + AXIOM_XPATH_PARSE_END, AXIOM_XPATH_PARSE_END, \ + axiom_xpath_create_node_test_node(env), \ + axiom_xpath_create_axis(env, AXIOM_XPATH_AXIS_DESCENDANT_OR_SELF)), \ + _op2, NULL, NULL) + + /** Adds an operation */ +#define AXIOM_XPATH_PUSH(_opr, _op1, _op2) axiom_xpath_add_operation( \ + env, expr, _opr, _op1, _op2, NULL, NULL) + + /** Adds an operation with parameters */ +#define AXIOM_XPATH_PUSH_PAR(_opr, _par1, _par2, _op1) axiom_xpath_add_operation( \ + env, expr, _opr, _op1, AXIOM_XPATH_PARSE_END, (void *)_par1, (void *)_par2) + + /* Functions */ + + /** + * Add an operation to the operations array + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @param op_type Type of the operation + * @param op1 First operand + * @param op2 Second operand + * @param par1 First parameter + * @param par2 Second parameter + * @return Index of the operation in the array + */ + int axiom_xpath_add_operation( + const axutil_env_t *env, + axiom_xpath_expression_t* expr, + axiom_xpath_operation_type_t op_type, + int op1, + int op2, + void *par1, + void *par2); + + /** + * Compile a XPath expression + * + * [14] Expr ::= OrExpr + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the main operation in the array + */ + int axiom_xpath_compile( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compile an equals expression + * + * ***Not completed*** + * [23] EqualityExpr ::= UnionExpr '=' UnionExpr + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + int axiom_xpath_compile_equalexpr( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compile an union + * + * [18] UnionExpr ::= PathExpr + * | UnionExpr '|' PathExpr + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + int axiom_xpath_compile_union( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compile a path expression + * + * [19] PathExpr ::= LocationPath + * | FilterExpr + * | FilterExpr '/' RelativeLocationPath + * | FilterExpr '//' RelativeLocationPath + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + int axiom_xpath_compile_path_expression( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compile a path expression with a filter + * + * [19] PathExpr ::= FilterExpr + * | FilterExpr '/' RelativeLocationPath + * | FilterExpr '//' RelativeLocationPath + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + int axiom_xpath_path_compile_path_expression_filter( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compile a filter expression + * + * 20] FilterExpr ::= PrimaryExpr + * | FilterExpr Predicate + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + int axiom_xpath_compile_filter( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compile a location path + * + * [1] LocationPath ::= RelativeLocationPath + * | AbsoluteLocationPath + * [2] AbsoluteLocationPath ::= '/' RelativeLocationPath? + * | AbbreviatedAbsoluteLocationPath + * + * [10] AbbreviatedAbsoluteLocationPath ::= '//' RelativeLocationPath + * [11] AbbreviatedRelativeLocationPath ::= RelativeLocationPath '//' Step + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + int axiom_xpath_compile_location_path( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compile a relative location + * + * [3] RelativeLocationPath ::= Step + * | RelativeLocationPath '/' Step + * | AbbreviatedRelativeLocationPath + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + int axiom_xpath_compile_relative_location( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compile a step + * + * [4] Step ::= AxisSpecifier NodeTest Predicate* + * | AbbreviatedStep + * [5] AxisSpecifier ::= AxisName '::' + * | AbbreviatedAxisSpecifier + * + * [12] AbbreviatedStep ::= '.' | '..' + * [13] AbbreviatedAxisSpecifier ::= '@'? + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + int axiom_xpath_compile_step( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compiles an OrExpr. + * + * [21] OrExpr ::= AndExpr + * | OrExpr 'or' AndExpr + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + int axiom_xpath_compile_orexpr( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compiles an AndExpr. + * + * [22] AndExpr ::= EqualityExpr + * | AndExpr 'and' EqualityExpr + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + int axiom_xpath_compile_andexpr( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + + /** + * Compiles a FunctionCall + * + * [16] FunctionCall ::= FunctionName '(' ( Argument ( ',' Argument )* )? ')' + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + int axiom_xpath_compile_function_call( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compiles an Argument. + * + * [17] Argument ::= Expr + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + int axiom_xpath_compile_argument( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compile a node test + * + * [7] NodeTest ::= NameTest + * | NodeType '(' ')' + * | 'processing-instruction' '(' Literal ')' + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + axiom_xpath_node_test_t* axiom_xpath_compile_node_test( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compile a predicate(s) + * + * [8] Predicate ::= '[' PredicateExpr ']' + * [9] PredicateExpr ::= Expr + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return Index of the operation in the array + */ + int axiom_xpath_compile_predicate( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + + + /** + * Compile a literal + * + * [29] Literal ::= '"' [^"]* '"' + * | "'" [^']* "'" + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return The literal parsed + */ + axis2_char_t* axiom_xpath_compile_literal( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compile a number + * + * [30] Number ::= Digits ('.' Digits?)? + * | '.' Digits + * [31] Digits ::= [0-9]+ + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return The number parsed + */ + double* axiom_xpath_compile_number( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + /** + * Compile a ncname + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @return The ncname parsed + */ + axis2_char_t* axiom_xpath_compile_ncname( + const axutil_env_t *env, + axiom_xpath_expression_t* expr); + + + + /** + * Get the XPath axis by axis name + * + * [6] AxisName ::= 'ancestor' + * | 'ancestor-or-self' + * | 'attribute' + * | 'child' + * | 'descendant' + * | 'descendant-or-self' + * | 'following' + * | 'following-sibling' + * | 'namespace' + * | 'parent' + * | 'preceding' + * | 'preceding-sibling' + * | 'self' + * + * @param env Environment must not be null + * @param name Name of the axis + * @return XPath axis; returns AXIOM_XPATH_AXIS_NONE if invalid name + */ + axiom_xpath_axis_t axiom_xpath_get_axis( + const axutil_env_t *env, + axis2_char_t* name); + + /** + * Create a node test which matches all nodes (*) + * + * @param env Environment must not be null + * @return Node test + */ + axiom_xpath_node_test_t* axiom_xpath_create_node_test_all( + const axutil_env_t *env); + + /** + * Create a node test which matches all nodes (nodes()) + * + * @param env Environment must not be null + * @return Node test + */ + axiom_xpath_node_test_t* axiom_xpath_create_node_test_node( + const axutil_env_t *env); + + /** + * Create a pointer to an axis; allocate memory using the allocator + * + * @param env Environment must not be null + * @param axis XPath axis + * @return Pointer to the axis created + */ + axiom_xpath_axis_t *axiom_xpath_create_axis( + const axutil_env_t *env, + axiom_xpath_axis_t axis); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/axiom/src/xpath/xpath_streaming.c b/axiom/src/xpath/xpath_streaming.c new file mode 100755 index 0000000..0488d5f --- /dev/null +++ b/axiom/src/xpath/xpath_streaming.c @@ -0,0 +1,213 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_xpath.h> +#include "xpath_streaming.h" +#include "xpath_internals.h" +#include "xpath_internals_engine.h" + +axiom_xpath_streaming_t +axiom_xpath_streaming_check_operation( + const axutil_env_t *env, + axiom_xpath_expression_t* expr, + int op_p) +{ + axiom_xpath_operation_t *op; + + if(op_p == AXIOM_XPATH_PARSE_END) + { + return AXIOM_XPATH_STREAMING_CONSTANT; + } + + op = AXIOM_XPATH_OPR_EXPR_GET(op_p); + + switch(op->opr) + { + case AXIOM_XPATH_OPERATION_CONTEXT_NODE: + case AXIOM_XPATH_OPERATION_ROOT_NODE: + return axiom_xpath_streaming_combine_dependent(AXIOM_XPATH_CHECK(op->op1), + AXIOM_XPATH_STREAMING_CONSTANT); + + case AXIOM_XPATH_OPERATION_STEP: + return axiom_xpath_streaming_combine_dependent(AXIOM_XPATH_CHECK(op->op1), + AXIOM_XPATH_CHECK(op->op2)); + + case AXIOM_XPATH_OPERATION_RESULT: + return AXIOM_XPATH_STREAMING_CONSTANT; + + case AXIOM_XPATH_OPERATION_UNION: + return axiom_xpath_streaming_combine_independent(AXIOM_XPATH_CHECK(op->op1), + AXIOM_XPATH_CHECK(op->op2)); + + case AXIOM_XPATH_OPERATION_EQUAL_EXPR: + return axiom_xpath_streaming_combine_independent(AXIOM_XPATH_CHECK(op->op1), + AXIOM_XPATH_CHECK(op->op2)); + + case AXIOM_XPATH_OPERATION_LITERAL: + return AXIOM_XPATH_STREAMING_CONSTANT; + + case AXIOM_XPATH_OPERATION_NUMBER: + return AXIOM_XPATH_STREAMING_CONSTANT; + + case AXIOM_XPATH_OPERATION_PATH_EXPRESSION: + return axiom_xpath_streaming_combine_dependent(AXIOM_XPATH_CHECK(op->op1), + AXIOM_XPATH_CHECK(op->op2)); + + case AXIOM_XPATH_OPERATION_NODE_TEST: + return axiom_xpath_streaming_check_node_test(env, expr, op); + + case AXIOM_XPATH_OPERATION_PREDICATE: + return axiom_xpath_streaming_check_predicate(env, expr, op_p); + + default: +#ifdef AXIOM_XPATH_DEBUG + printf("Unidentified operation.\n"); +#endif + + return AXIOM_XPATH_STREAMING_NOT_SUPPORTED; + } +} + +axiom_xpath_streaming_t +axiom_xpath_streaming_check_predicate( + const axutil_env_t *env, + axiom_xpath_expression_t* expr, + int op_p) +{ + axiom_xpath_operation_t *op; + + if(op_p == AXIOM_XPATH_PARSE_END) + { + return AXIOM_XPATH_STREAMING_CONSTANT; + } + + op = AXIOM_XPATH_OPR_EXPR_GET(op_p); + + return axiom_xpath_streaming_combine_dependent(AXIOM_XPATH_CHECK(op->op1), AXIOM_XPATH_CHECK( + op->op2)); +} + +axiom_xpath_streaming_t +axiom_xpath_streaming_check_node_test( + const axutil_env_t *env, + axiom_xpath_expression_t* expr, + axiom_xpath_operation_t *op) +{ + axiom_xpath_axis_t axis = AXIOM_XPATH_AXIS_NONE; + axiom_xpath_streaming_t r; + + if(!op->par2) + { +#ifdef AXIOM_XPATH_DEBUG + printf("axis is NULL in the step operator\n"); +#endif + return AXIOM_XPATH_STREAMING_NOT_SUPPORTED; + } + + axis = *((axiom_xpath_axis_t *)op->par2); + + switch(axis) + { + case AXIOM_XPATH_AXIS_ATTRIBUTE: + case AXIOM_XPATH_AXIS_CHILD: + break; + + default: + return AXIOM_XPATH_STREAMING_NOT_SUPPORTED; + } + + r = axiom_xpath_streaming_check_predicate(env, expr, op->op1); + + if(r != AXIOM_XPATH_STREAMING_ATTRIBUTE && r != AXIOM_XPATH_STREAMING_CONSTANT) + { + return AXIOM_XPATH_STREAMING_NOT_SUPPORTED; + } + + if(axis == AXIOM_XPATH_AXIS_ATTRIBUTE) + { + return AXIOM_XPATH_STREAMING_ATTRIBUTE; + } + else + { + return AXIOM_XPATH_STREAMING_SUPPORTED; + } +} + +axiom_xpath_streaming_t +axiom_xpath_streaming_combine_dependent( + axiom_xpath_streaming_t r1, + axiom_xpath_streaming_t r2) +{ + if(r1 == AXIOM_XPATH_STREAMING_NOT_SUPPORTED || r2 == AXIOM_XPATH_STREAMING_NOT_SUPPORTED) + { + return AXIOM_XPATH_STREAMING_NOT_SUPPORTED; + } + else if(r1 == AXIOM_XPATH_STREAMING_SUPPORTED || r2 == AXIOM_XPATH_STREAMING_SUPPORTED) + { + return AXIOM_XPATH_STREAMING_SUPPORTED; + } + else if(r1 == AXIOM_XPATH_STREAMING_ATTRIBUTE || r2 == AXIOM_XPATH_STREAMING_ATTRIBUTE) + { + return AXIOM_XPATH_STREAMING_ATTRIBUTE; + } + else + { + return AXIOM_XPATH_STREAMING_CONSTANT; + } +} + +axiom_xpath_streaming_t +axiom_xpath_streaming_combine_independent( + axiom_xpath_streaming_t r1, + axiom_xpath_streaming_t r2) +{ + if(r1 == AXIOM_XPATH_STREAMING_NOT_SUPPORTED || r2 == AXIOM_XPATH_STREAMING_NOT_SUPPORTED) + { + return AXIOM_XPATH_STREAMING_NOT_SUPPORTED; + } + else if(r1 == AXIOM_XPATH_STREAMING_CONSTANT || r2 == AXIOM_XPATH_STREAMING_CONSTANT) + { + if(r1 == AXIOM_XPATH_STREAMING_SUPPORTED || r2 == AXIOM_XPATH_STREAMING_SUPPORTED) + { + return AXIOM_XPATH_STREAMING_SUPPORTED; + } + else if(r1 == AXIOM_XPATH_STREAMING_ATTRIBUTE || r2 == AXIOM_XPATH_STREAMING_ATTRIBUTE) + { + return AXIOM_XPATH_STREAMING_ATTRIBUTE; + } + else + { + return AXIOM_XPATH_STREAMING_CONSTANT; + } + } + else if(r1 == AXIOM_XPATH_STREAMING_ATTRIBUTE || r2 == AXIOM_XPATH_STREAMING_ATTRIBUTE) + { + if(r1 == AXIOM_XPATH_STREAMING_SUPPORTED || r2 == AXIOM_XPATH_STREAMING_SUPPORTED) + { + return AXIOM_XPATH_STREAMING_SUPPORTED; + } + else + { + return AXIOM_XPATH_STREAMING_ATTRIBUTE; + } + } + else + { + return AXIOM_XPATH_STREAMING_NOT_SUPPORTED; + } +} + diff --git a/axiom/src/xpath/xpath_streaming.h b/axiom/src/xpath/xpath_streaming.h new file mode 100755 index 0000000..63b1ee5 --- /dev/null +++ b/axiom/src/xpath/xpath_streaming.h @@ -0,0 +1,126 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +#ifndef AXIOM_XPATH_STREAMING_H +#define AXIOM_XPATH_STREAMING_H + +#include "xpath_internals.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup axiom_xpath_streaming streaming + * @ingroup axiom_xpath + * @{ + */ + + + /** + * XPath streaming support + */ + typedef enum axiom_xpath_streaming_t + { + AXIOM_XPATH_STREAMING_NOT_SUPPORTED = 0, + AXIOM_XPATH_STREAMING_SUPPORTED, + AXIOM_XPATH_STREAMING_CONSTANT, + AXIOM_XPATH_STREAMING_ATTRIBUTE + } axiom_xpath_streaming_t; + + /** Check whether the given expression is supported on streaming XML */ +#define AXIOM_XPATH_CHECK(op) axiom_xpath_streaming_check_operation(env, expr, op) + + /** Get an operation from the list of operations */ +#define AXIOM_XPATH_OPR_EXPR_GET(ind) (axiom_xpath_operation_t *) \ + axutil_array_list_get(expr->operations, env, ind) + + /** + * Checks whether the given expression is supported on streaming XML + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @param op_p Index of the operation in the list of operations + * @return Whether the given operation can be evaluated on streaming XML + */ + axiom_xpath_streaming_t axiom_xpath_streaming_check_operation( + const axutil_env_t *env, + axiom_xpath_expression_t* expr, + int op_p); + + /** + * Checks whether the predicate is supported on streaming XML. + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @param op_p Index of the operation in the list of operations + * @return Whether the given operation can be evaluated on streaming XML + */ + axiom_xpath_streaming_t axiom_xpath_streaming_check_predicate( + const axutil_env_t *env, + axiom_xpath_expression_t* expr, + int op_p); + + /** + * Checks whether the predicate is supported on streaming XML. + * + * @param env Environment must not be null + * @param expr A pointer to the XPath expression + * @param op Index of the operation in the list of operations + * @return Whether the given operation can be evaluated on streaming XML + */ + axiom_xpath_streaming_t axiom_xpath_streaming_check_node_test( + const axutil_env_t *env, + axiom_xpath_expression_t* expr, + axiom_xpath_operation_t* op); + + + /** + * Checks whether the two operations can be evaluated on streaming XML + * sequencially (one after the other), where the result of the first + * operation is the context of the next + * + * @param r1 Type of first operation + * @param r2 Type of second operation + * @return Whether the given operations can be evaluated on streaming XML + */ + axiom_xpath_streaming_t axiom_xpath_streaming_combine_dependent( + axiom_xpath_streaming_t r1, + axiom_xpath_streaming_t r2); + + + /** + * Checks whether the two operations can be evaluated on streaming XML + * simultaneousy + * + * @param r1 Type of first operation + * @param r2 Type of second operation + * @return Whether the given operations can be evaluated on streaming XML + */ + axiom_xpath_streaming_t axiom_xpath_streaming_combine_independent( + axiom_xpath_streaming_t r1, + axiom_xpath_streaming_t r2); + + /** @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/axiom/test/Makefile.am b/axiom/test/Makefile.am new file mode 100644 index 0000000..5a5b493 --- /dev/null +++ b/axiom/test/Makefile.am @@ -0,0 +1,3 @@ +TESTS = +SUBDIRS = om soap util xpath +EXTRA_DIST = resources diff --git a/axiom/test/om/Makefile.am b/axiom/test/om/Makefile.am new file mode 100644 index 0000000..7736221 --- /dev/null +++ b/axiom/test/om/Makefile.am @@ -0,0 +1,13 @@ +TESTS = +noinst_PROGRAMS = test_om +check_PROGRAMS = test_om +SUBDIRS = +AM_CFLAGS = -g -O2 -pthread +test_om_SOURCES = test_om.c + +test_om_LDADD = ../../../util/src/libaxutil.la \ + $(top_builddir)/src/om/libaxis2_axiom.la + +INCLUDES = -I$(top_builddir)/include \ + -I$(top_builddir)/src/parser \ + -I ../../../util/include diff --git a/axiom/test/om/test_om.c b/axiom/test/om/test_om.c new file mode 100644 index 0000000..c0d41b9 --- /dev/null +++ b/axiom/test/om/test_om.c @@ -0,0 +1,402 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_stax_builder.h> +#include <axiom_document.h> +#include <axiom_node.h> +#include <axiom_element.h> +#include <axiom_text.h> +#include <axiom_data_source.h> +#include <axutil_stream.h> +#include <axutil_log_default.h> +#include <axutil_error_default.h> +#include <axiom_xml_reader.h> +#include <stdio.h> +#include <axiom_xml_writer.h> +#include <axutil_env.h> + +/** + Define the environment related variables globally so that they are available + for both functions +*/ + +axutil_allocator_t *allocator = NULL; +axutil_env_t *environment = NULL; +axutil_stream_t *stream = NULL; +axutil_error_t *error = NULL; +axutil_log_t *axis_log = NULL; +FILE *f = NULL; + +/** a method that demonstrate creating a om model using an xml file */ + +int AXIS2_CALL +read_input( + char *buffer, + int size, + void *ctx) +{ + int len = 0; + char *pos = NULL; + len = fread(buffer, sizeof(char), size, f); + if (buffer) + pos = strstr(buffer, "---"); + if (pos) + { + len = pos - buffer; + *pos = '\0'; + } + return len; +} + +int +test_om_build( + const char *filename) +{ + axiom_element_t *ele1 = NULL, + *ele2 = NULL; + axiom_stax_builder_t *builder = NULL; + axiom_text_t *text = NULL; + axiom_document_t *document = NULL; + axiom_node_t *node1 = NULL, + *node2 = NULL; + axiom_node_t *node3 = NULL; + axiom_output_t *om_output = NULL; + axiom_namespace_t *ns = NULL; + axiom_xml_reader_t *reader = NULL; + axiom_xml_writer_t *writer = NULL; + + char *buffer = NULL; + axutil_hash_t* hash = NULL; + + printf("\nstart test_om_build\n"); + + f = fopen(filename, "r"); + if (!f) + return -1; + + /** create pull parser */ + reader = + axiom_xml_reader_create_for_io(environment, read_input, NULL, NULL, + NULL); + + if (!reader) + { + printf("ERROR CREATING PULLPARSER"); + return -1; + } + + /** create axiom_stax_builder by parsing pull_parser struct */ + + builder = axiom_stax_builder_create(environment, reader); + + if (!builder) + { + printf("ERROR CREATING PULL PARSER"); + return -1; + } + + /** + create an om document + document is the container of om model created using builder + */ + + document = axiom_stax_builder_get_document(builder, environment); + + /** + get root element , building starts hear + */ + if (!document) + return -1; + + node1 = axiom_document_get_root_element(document, environment); + if (!node1) + { + printf(" root element null "); + axiom_stax_builder_free(builder, environment); + return -1; + } + if (node1) + { + + /** print root node information */ + + ele1 = axiom_node_get_data_element(node1, environment); + if (ele1) + { + printf("root localname %s\n", + axiom_element_get_localname(ele1, environment)); + + hash = axiom_element_get_all_attributes(ele1,environment); + if(hash) + { + axutil_hash_index_t *hi; + const void *key= NULL; + void *val = NULL; + for (hi = axutil_hash_first(hash,environment); hi; hi = axutil_hash_next(environment, hi)) + { + axutil_hash_this(hi, &key, NULL,&val); + if(val) + { + printf(" Attribute name: %s", + axiom_attribute_get_localname((axiom_attribute_t *)val,environment)); + printf(" value: %s\n", + axiom_attribute_get_value((axiom_attribute_t *)val,environment)); + } + } + } + } + + ns = axiom_element_get_namespace(ele1, environment, node1); + + if (ns) + { + printf("root ns prefix %s\n", + axiom_namespace_get_prefix(ns, environment)); + printf("root ns uri %s\n", + axiom_namespace_get_uri(ns, environment)); + printf("============================================="); + + } + else + printf("============================================="); + + } + + /** build the document continuously untill all the xml file is built in to a om model */ + + node2 = axiom_document_build_next(document, environment); + do + { + + if (!node2) + break; + + switch (axiom_node_get_node_type(node2, environment)) + { + case AXIOM_ELEMENT: + ele2 = + (axiom_element_t *) axiom_node_get_data_element(node2, + environment); + printf("============================================="); + if (ele2 && axiom_element_get_localname(ele2, environment)) + { + printf("\n localname %s\n", + axiom_element_get_localname(ele2, environment)); + hash = axiom_element_get_all_attributes(ele2,environment); + if(hash) + { + axutil_hash_index_t *hi; + const void *key= NULL; + void *val = NULL; + for (hi = axutil_hash_first(hash,environment); hi; hi = axutil_hash_next(environment, hi)) + { + axutil_hash_this(hi, &key, NULL,&val); + if(val) + { + printf(" Attribute name: %s", + axiom_attribute_get_localname((axiom_attribute_t *)val,environment)); + printf(" value: %s\n", + axiom_attribute_get_value((axiom_attribute_t *)val,environment)); + } + } + } + + } + + + + if (!node3) + node3 = node2; + + break; + case AXIOM_TEXT: + + text = + (axiom_text_t *) axiom_node_get_data_element(node2, + environment); + if (text && axiom_text_get_value(text, environment)) + printf("\n text value %s \n", + axiom_text_get_value(text, environment)); + break; + + default: + break; + } + + node2 = axiom_document_build_next(document, environment); + } + while (node2); + printf("END: pull document\n"); + + printf("Serialize pulled document\n"); + + writer = + axiom_xml_writer_create_for_memory(environment, NULL, AXIS2_TRUE, 0, + AXIS2_XML_PARSER_TYPE_BUFFER); + om_output = axiom_output_create(environment, writer); + + axiom_node_serialize_sub_tree(node3, environment, om_output); + + buffer = (axis2_char_t *) axiom_xml_writer_get_xml(writer, environment); + + if (buffer) + printf("Sub Tree = %s\n", buffer); + + axiom_output_free(om_output, environment); + + axiom_stax_builder_free(builder, environment); + +/* if (buffer) */ + +/* AXIS2_FREE(environment->allocator, buffer); */ + printf("\nend test_om_build\n"); + fclose(f); + return 0; +} + +int +test_om_serialize( + ) +{ + + /* + <book xmlns:axiomc="http://ws.apache.org/axis2/c/om" xmlns:isbn="urn:ISBN:0-395-74341-6"> + <title>Axis2/C OM HOWTO</title> + <isbn:number>1748491379</isbn:number> + <author title="Mr" name="Axitoc Oman" /> + <notes> + <p xmlns="urn:w3-org-ns:HTML"> + This is <i>vey good</i> book on OM! + </p> + </notes> + </book> + */ + int status; + axiom_element_t *ele1 = NULL, + *ele2 = NULL, + *ele3 = NULL, + *ele4 = NULL; + axiom_node_t *node1 = NULL, + *node2 = NULL, + *node3 = NULL, + *node4 = NULL, + *node5 = NULL, + *node6 = NULL; + axiom_data_source_t *data_source = NULL; + axutil_stream_t *stream = NULL; + axiom_attribute_t *attr1 = NULL, + *attr2 = NULL; + axiom_namespace_t *ns1 = NULL, + *ns2 = NULL; + axiom_text_t *text1 = NULL; + axiom_output_t *om_output = NULL; + axiom_xml_writer_t *writer = NULL; + axis2_char_t *output_buffer = NULL; + + printf("\nstart test_om_serialize\n"); + + ns1 = + axiom_namespace_create(environment, + "http://ws.apache.org/axis2/c/om", "axiom"); + ns2 = axiom_namespace_create(environment, "urn:ISBN:0-395-74341-6", "isbn"); + ele1 = axiom_element_create(environment, NULL, "book", ns1, &node1); + axiom_element_declare_namespace(ele1, environment, node1, ns2); + + ele2 = axiom_element_create(environment, node1, "title", ns1, &node2); + attr1 = axiom_attribute_create(environment, "title22", NULL, NULL); + + axiom_element_add_attribute(ele2, environment, attr1, node2); + + text1 = axiom_text_create(environment, node2, "Axis2/C OM HOWTO", &node3); + + ele3 = axiom_element_create(environment, node1, "number", ns2, &node4); + + text1 = axiom_text_create(environment, node4, "1748491379", &node5); + + ele4 = axiom_element_create(environment, node1, "author", ns1, &node6); + + attr1 = axiom_attribute_create(environment, "title", "Mr", ns1); + + axiom_element_add_attribute(ele4, environment, attr1, node6); + + attr2 = axiom_attribute_create(environment, "name", "Axitoc Oman", ns1); + + axiom_element_add_attribute(ele4, environment, attr2, node6); + + data_source = axiom_data_source_create(environment, node1, &node6); + stream = axiom_data_source_get_stream(data_source, environment); + if (stream) + { + axutil_stream_write(stream, environment, + "<this xmlns:axiom=\"http://ws.apache.org/axis2/c/om\">is a test</this>", + axutil_strlen + ("<this xmlns:axiom=\"http://ws.apache.org/axis2/c/om\">is a test</this>")); + } + + /* serializing stuff */ + writer = + axiom_xml_writer_create_for_memory(environment, NULL, AXIS2_TRUE, 0, + AXIS2_XML_PARSER_TYPE_BUFFER); + om_output = axiom_output_create(environment, writer); + + printf("Serialize built document\n"); + status = axiom_node_serialize(node1, environment, om_output); + if (status != AXIS2_SUCCESS) + { + printf("\naxiom_node_serialize failed\n"); + return status; + } + else + printf("\naxiom_node_serialize success\n"); + /* end serializing stuff */ + + axiom_node_free_tree(node1, environment); + output_buffer = + (axis2_char_t *) axiom_xml_writer_get_xml(writer, environment); + + axiom_output_free(om_output, environment); + /* if (output_buffer) */ + /* { */ + /* printf("%s", output_buffer); */ + /* AXIS2_FREE(environment->allocator, output_buffer); */ + /* } */ + + printf("\nend test_om_serialize\n"); + + return 0; +} + +int +main( + int argc, + char *argv[]) + { + const char *file_name = "../../resources/xml/om/test.xml"; + if (argc > 1) + file_name = argv[1]; + allocator = axutil_allocator_init(NULL); + axis_log = axutil_log_create(allocator, NULL, NULL); + error = axutil_error_create(allocator); + + environment = axutil_env_create_with_error_log(allocator, error, axis_log); + test_om_build(file_name); + test_om_serialize(); + + axutil_env_free(environment); + return 0; +} diff --git a/axiom/test/resources/wsdl/Attachment1.wsdl b/axiom/test/resources/wsdl/Attachment1.wsdl new file mode 100644 index 0000000..0fc52d0 --- /dev/null +++ b/axiom/test/resources/wsdl/Attachment1.wsdl @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions targetNamespace="http://attachment1" + xmlns:impl="http://attachment1" + xmlns:intf="http://attachment1" + xmlns:tns2="http://xml.apache.org/xml-soap" + 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://attachment1" + xmlns="http://www.w3.org/2001/XMLSchema" + xmlns:impl="http://attachment1" + xmlns:intf="http://attachment1" + xmlns:tns2="http://xml.apache.org/xml-soap" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <import namespace="http://xml.apache.org/xml-soap"/> + <element name="put"> + <complexType> + <sequence> + <element name="arg1" type="tns2:Image"/> + <element name="arg2" type="tns2:PlainText"/> + <element name="arg3" type="tns2:Source"/> + <element name="arg4" type="tns2:octet-stream"/> + <element name="arg5" type="tns2:DataHandler"/> + <!-- element name="arg6" type="tns2:MimeMultipart"/ --> + <element name="arg7" nillable="true" type="tns2:DataHandler"/> + <element name="arg8" nillable="true" type="tns2:DataHandler"/> + </sequence> + </complexType> + </element> + <element name="putResponse"> + <complexType> + <sequence> + <element name="putReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="putRequest"> + <wsdl:part element="impl:put" name="parameters"/> + </wsdl:message> + <wsdl:message name="putResponse"> + <wsdl:part element="impl:putResponse" name="parameters"/> + </wsdl:message> + + <wsdl:portType name="AttachmentBindingImpl"> + <wsdl:operation name="put"> + <wsdl:input message="impl:putRequest" name="putRequest"/> + <wsdl:output message="impl:putResponse" name="putResponse"/> + </wsdl:operation> + </wsdl:portType> + + <wsdl:binding name="Attachment1SoapBinding" type="impl:AttachmentBindingImpl"> + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="put"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="putRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="putResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + + <wsdl:service name="AttachmentBindingImplService"> + <wsdl:port binding="impl:Attachment1SoapBinding" name="Attachment1"> + <wsdlsoap:address location="http://localhost:9080/Attachment1/services/Attachment1"/> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/AttachmentService.wsdl b/axiom/test/resources/wsdl/AttachmentService.wsdl new file mode 100644 index 0000000..b94b757 --- /dev/null +++ b/axiom/test/resources/wsdl/AttachmentService.wsdl @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions targetNamespace="http://attachment.test.org" xmlns:impl="http://attachment.test.org" xmlns:intf="http://attachment.test.org" xmlns:tns2="http://xml.apache.org/xml-soap" 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://attachment.test.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://attachment.test.org" xmlns:intf="http://attachment.test.org" xmlns:tns2="http://xml.apache.org/xml-soap" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <import namespace="http://xml.apache.org/xml-soap"/> + <element name="multiAttachment"> + <complexType> + <sequence> + <element name="arg_0_0" nillable="true" type="tns2:DataHandler"/> + <element name="arg_1_0" nillable="true" type="tns2:DataHandler"/> + <element name="arg_2_0" nillable="true" type="tns2:Image"/> + <element name="arg_3_0" nillable="true" type="tns2:DataHandler"/> + </sequence> + </complexType> + </element> + <element name="multiAttachmentResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="multiAttachmentReturn" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="nillableAttachment"> + <complexType> + <sequence> + <element name="arg_0_1" nillable="true" type="tns2:DataHandler"/> + <element name="arg_1_1" nillable="true" type="tns2:Image"/> + <element name="arg_2_1" nillable="true" type="tns2:Source"/> + <element name="arg_3_1" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="nillableAttachmentResponse"> + <complexType> + <sequence> + <element name="nillableAttachmentReturn" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="multiAttachmentResponse"> + + <wsdl:part element="impl:multiAttachmentResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="nillableAttachmentRequest"> + + <wsdl:part element="impl:nillableAttachment" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="nillableAttachmentResponse"> + + <wsdl:part element="impl:nillableAttachmentResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="multiAttachmentRequest"> + + <wsdl:part element="impl:multiAttachment" name="parameters"/> + + </wsdl:message> + + <wsdl:portType name="AttachmentService"> + + <wsdl:operation name="multiAttachment"> + + <wsdl:input message="impl:multiAttachmentRequest" name="multiAttachmentRequest"/> + + <wsdl:output message="impl:multiAttachmentResponse" name="multiAttachmentResponse"/> + + </wsdl:operation> + + <wsdl:operation name="nillableAttachment"> + + <wsdl:input message="impl:nillableAttachmentRequest" name="nillableAttachmentRequest"/> + + <wsdl:output message="impl:nillableAttachmentResponse" name="nillableAttachmentResponse"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="AttachmentServiceSoapBinding" type="impl:AttachmentService"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="multiAttachment"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="multiAttachmentRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="multiAttachmentResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="nillableAttachment"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="nillableAttachmentRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="nillableAttachmentResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="AttachmentServiceService"> + + <wsdl:port binding="impl:AttachmentServiceSoapBinding" name="AttachmentService"> + + <wsdlsoap:address location="http://localhost:9080/AttachmentService/services/AttachmentService"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/AxisBench.wsdl b/axiom/test/resources/wsdl/AxisBench.wsdl new file mode 100644 index 0000000..3138179 --- /dev/null +++ b/axiom/test/resources/wsdl/AxisBench.wsdl @@ -0,0 +1,108 @@ +<?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://axisbench.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:intf="http://axisbench.test.apache.org" + xmlns:impl="http://axisbench.test.apache.org" + xmlns:apachesoap="http://xml.apache.org/xml-soap" + xmlns="http://schemas.xmlsoap.org/wsdl/"> + <wsdl:types> + <schema + elementFormDefault="qualified" + targetNamespace="http://axisbench.test.apache.org" + xmlns="http://www.w3.org/2001/XMLSchema"> + <complexType name="BenchBasicDataType"> + <sequence> + <element name="StringType" type="xsd:string"/> + <element name="IntType" type="xsd:int"/> + <element name="BooleanType" type="xsd:boolean"/> + <element name="DoubleType" type="xsd:double"/> + <element name="DateTimeType" type="xsd:dateTime"/> + <element name="DateType" type="xsd:date"/> + <element name="TimeType" type="xsd:time"/> + <element name="Base64BinaryType" type="xsd:base64Binary"/> + <element name="ByteType" type="xsd:byte"/> + <element name="DecimalType" type="xsd:decimal"/> + <element name="FloatType" type="xsd:float"/> + <element name="HexBinary" type="xsd:hexBinary"/> + <element name="IntegerType" type="xsd:integer"/> + <element name="LongType" type="xsd:long"/> + <element name="QNameType" type="xsd:QName"/> + <element name="ShortType" type="xsd:short"/> + + <!-- Not tested yet + --> + + </sequence> + </complexType> + <complexType name="BenchDataType"> + <sequence> + <element name="count" type="xsd:int"/> + <element maxOccurs="unbounded" name="infos" type="impl:BenchBasicDataType"/> + </sequence> + </complexType> + + <element name="doBenchRequest"> + <complexType> + <sequence> + <element name="doBench" type="impl:BenchDataType"/> + </sequence> + </complexType> + </element> + + <element name="doBenchRequestResponse"> + <complexType> + <sequence> + <element name="doBench" nillable="true" type="impl:BenchDataType"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + <wsdl:message name="doBenchRequest"> + <wsdl:part name="parameters" element="intf:doBenchRequest"/> + </wsdl:message> + <wsdl:message name="doBenchResponse"> + <wsdl:part name="parameters" element="intf:doBenchRequestResponse"/> + </wsdl:message> + <wsdl:portType name="AxisBench"> + <wsdl:operation name="doBenchRequest"> + <wsdl:input name="doBenchRequest" message="intf:doBenchRequest"/> + <wsdl:output name="doBenchResponse" message="intf:doBenchResponse"/> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="AxisBenchSoapBinding" type="intf:AxisBench"> + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="doBenchRequest"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="doBenchRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="doBenchResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="AxisBenchSoapSvc"> + <wsdl:port name="AxisBenchSoapImpl" binding="intf:AxisBenchSoapBinding"> + <wsdlsoap:address location="http://localhost:9080/AxisBench/services/AxisBenchSoapImpl"/> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/BasicAllTest.wsdl b/axiom/test/resources/wsdl/BasicAllTest.wsdl new file mode 100644 index 0000000..13e2a79 --- /dev/null +++ b/axiom/test/resources/wsdl/BasicAllTest.wsdl @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="utf-8"?> +<definitions xmlns:s1="http://soapinterop.org/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://soapinterop.org/" xmlns:s3="http://soapinterop.org/echoheader/" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://soapinterop.org" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/"> + <s:import namespace="http://soapinterop.org/xsd" /> + <s:import namespace="http://soapinterop.org/echoheader/" /> + + + + <s:element name="echoAll"> + <s:complexType> + <s:sequence> + <s:element name="inputAll" type="s1:AllComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="echoAllResponse"> + <s:complexType> + <s:sequence> + <s:element name="return" type="s1:AllComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + + + + </s:schema> + + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd"> + <s:import namespace="http://soapinterop.org/" /> + + <s:complexType name="AllComplexType"> + <s:all> + <s:element minOccurs="0" name="IntValue" type="s:int" /> + <s:element minOccurs="0" name="StringValue" type="s:string" /> + </s:all> + </s:complexType> + </s:schema> + + </types> + + + + <message name="echoAllSoapIn"> + <part name="parameters" element="s0:echoAll" /> + </message> + <message name="echoAllSoapOut"> + <part name="parameters" element="s0:echoAllResponse" /> + </message> + + <portType name="AllTestSoap"> + + + <operation name="echoAll"> + <input message="s0:echoAllSoapIn" /> + <output message="s0:echoAllSoapOut" /> + </operation> + + </portType> + + + <binding name="AllTestSoap" type="s0:AllTestSoap"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + <operation name="echoAll"> + <soap:operation soapAction="SimpleAllTest#echoAll" style="document" /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + + </binding> + +<binding name="AllTestSoap12" type="s0:AllTestSoap"> + <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + + <operation name="echoAll"> + <soap12:operation soapAction="All#echoAll" style="document" /> + <input> + <soap12:body use="literal" /> + </input> + <output> + <soap12:body use="literal" /> + </output> + </operation> + + </binding> + +<service name="AllTest"> + <documentation>These operations implement DOC/LIT SOAP operations, for interop testing. Please email johnko@microsoft.com with any questions/coments.</documentation> + <port name="AllTestSoap" binding="s0:AllTestSoap"> + <soap:address location="http://localhost:90/axis/All" /> + </port> + <port name="AllTestSoap12" binding="s0:AllTestSoap12"> + <soap12:address location="http://localhost:90/axis/All" /> + </port> + </service> +</definitions>
\ No newline at end of file diff --git a/axiom/test/resources/wsdl/BasicChoice.wsdl b/axiom/test/resources/wsdl/BasicChoice.wsdl new file mode 100644 index 0000000..25c6123 --- /dev/null +++ b/axiom/test/resources/wsdl/BasicChoice.wsdl @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8"?> +<definitions xmlns:s1="http://soapinterop.org/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://soapinterop.org/" xmlns:s3="http://soapinterop.org/echoheader/" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://soapinterop.org" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/"> + <s:import namespace="http://soapinterop.org/xsd" /> + <s:import namespace="http://soapinterop.org/echoheader/" /> + + + + <s:element name="echoChoice"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="inputChoice" type="s1:ChoiceComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="echoChoiceResponse"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:ChoiceComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + + + + </s:schema> + + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd"> + <s:import namespace="http://soapinterop.org/" /> + + <s:complexType name="ChoiceComplexType"> + <s:sequence> + <s:choice minOccurs="1" maxOccurs="1"> + <s:element minOccurs="0" maxOccurs="1" name="name0" type="s:string" /> + <s:element minOccurs="0" maxOccurs="1" name="name1" type="s:string" /> + </s:choice> + </s:sequence> + </s:complexType> + </s:schema> + + </types> + + + + <message name="echoChoiceSoapIn"> + <part name="parameters" element="s0:echoChoice" /> + </message> + <message name="echoChoiceSoapOut"> + <part name="parameters" element="s0:echoChoiceResponse" /> + </message> + + <portType name="ChoiceTestSoap"> + + + <operation name="echoChoice"> + <input message="s0:echoChoiceSoapIn" /> + <output message="s0:echoChoiceSoapOut" /> + </operation> + + </portType> + + + <binding name="ChoiceTestSoap" type="s0:ChoiceTestSoap"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + <operation name="echoChoice"> + <soap:operation soapAction="Choice#echoChoice" style="document" /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + + </binding> + +<binding name="ChoiceTestSoap12" type="s0:ChoiceTestSoap"> + <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + + <operation name="echoChoice"> + <soap12:operation soapAction="Choice#echoChoice" style="document" /> + <input> + <soap12:body use="literal" /> + </input> + <output> + <soap12:body use="literal" /> + </output> + </operation> + + </binding> + +<service name="ChoiceTest"> + <documentation>These operations implement DOC/LIT SOAP operations, for interop testing. Please email johnko@microsoft.com with any questions/coments.</documentation> + <port name="ChoiceTestSoap" binding="s0:ChoiceTestSoap"> + <soap:address location="http://localhost:90/axis/Choice" /> + </port> + <port name="ChoiceTestSoap12" binding="s0:ChoiceTestSoap12"> + <soap12:address location="http://localhost:90/axis/Choice" /> + </port> + </service> +</definitions>
\ No newline at end of file diff --git a/axiom/test/resources/wsdl/Calculator.wsdl b/axiom/test/resources/wsdl/Calculator.wsdl new file mode 100644 index 0000000..c7d1243 --- /dev/null +++ b/axiom/test/resources/wsdl/Calculator.wsdl @@ -0,0 +1,135 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright 2003-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. --> + +<wsdl:definitions targetNamespace="http://localhost/axis/Calculator" +xmlns="http://schemas.xmlsoap.org/wsdl/" +xmlns:apachesoap="http://xml.apache.org/xml-soap" +xmlns:impl="http://localhost/axis/Calculator" +xmlns:intf="http://localhost/axis/Calculator" +xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" +xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" +xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" +xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <wsdl:message name="addRequest"> + <wsdl:part name="in0" type="xsd:int"/> + <wsdl:part name="in1" type="xsd:int"/> + </wsdl:message> + <wsdl:message name="addResponse"> + <wsdl:part name="addReturn" type="xsd:int"/> + </wsdl:message> + <wsdl:message name="subResponse"> + <wsdl:part name="subReturn" type="xsd:int"/> + </wsdl:message> + <wsdl:message name="subRequest"> + <wsdl:part name="in0" type="xsd:int"/> + <wsdl:part name="in1" type="xsd:int"/> + </wsdl:message> + <wsdl:message name="mulRequest"> + <wsdl:part name="in0" type="xsd:int"/> + <wsdl:part name="in1" type="xsd:int"/> + </wsdl:message> + <wsdl:message name="mulResponse"> + <wsdl:part name="addReturn" type="xsd:int"/> + </wsdl:message> + <wsdl:message name="divRequest"> + <wsdl:part name="in0" type="xsd:int"/> + <wsdl:part name="in1" type="xsd:int"/> + </wsdl:message> + <wsdl:message name="divResponse"> + <wsdl:part name="addReturn" type="xsd:int"/> + </wsdl:message> + <wsdl:portType name="Calculator"> + <wsdl:operation name="add" parameterOrder="in0 in1"> + <wsdl:input message="intf:addRequest" name="addRequest"/> + <wsdl:output message="intf:addResponse" name="addResponse"/> + </wsdl:operation> + <wsdl:operation name="sub" parameterOrder="in0 in1"> + <wsdl:input message="intf:subRequest" name="subRequest"/> + <wsdl:output message="intf:subResponse" name="subResponse"/> + </wsdl:operation> + <wsdl:operation name="mul" parameterOrder="in0 in1"> + <wsdl:input message="intf:mulRequest" name="mulRequest"/> + <wsdl:output message="intf:mulResponse" name="mulResponse"/> + </wsdl:operation> + <wsdl:operation name="div" parameterOrder="in0 in1"> + <wsdl:input message="intf:divRequest" name="divRequest"/> + <wsdl:output message="intf:divResponse" name="divResponse"/> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="CalculatorSoapBinding" type="intf:Calculator"> + <wsdlsoap:binding style="rpc" + transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="add"> + <wsdlsoap:operation soapAction="Calculator#add"/> + <wsdl:input name="addRequest"> + <wsdlsoap:body + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/Calculator" + use="encoded"/> + </wsdl:input> + <wsdl:output name="addResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/Calculator" + use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="sub"> + <wsdlsoap:operation soapAction="Calculator#sub"/> + <wsdl:input name="subRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/Calculator" + use="encoded"/> + </wsdl:input> + <wsdl:output name="subResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/Calculator" + use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="mul"> + <wsdlsoap:operation soapAction="Calculator#mul"/> + <wsdl:input name="mulRequest"> + <wsdlsoap:body + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/Calculator" + use="encoded"/> + </wsdl:input> + <wsdl:output name="mulResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/Calculator" + use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="div"> + <wsdlsoap:operation soapAction="Calculator#div"/> + <wsdl:input name="divRequest"> + <wsdlsoap:body + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/Calculator" + use="encoded"/> + </wsdl:input> + <wsdl:output name="divResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/Calculator" + use="encoded"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="Calculator"> + <wsdl:port binding="intf:CalculatorSoapBinding" name="Calculator"> + <wsdlsoap:address location="http://localhost/axis/Calculator"/> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/CalculatorDoc.wsdl b/axiom/test/resources/wsdl/CalculatorDoc.wsdl new file mode 100644 index 0000000..5600279 --- /dev/null +++ b/axiom/test/resources/wsdl/CalculatorDoc.wsdl @@ -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> diff --git a/axiom/test/resources/wsdl/Choice.wsdl b/axiom/test/resources/wsdl/Choice.wsdl new file mode 100644 index 0000000..25c6123 --- /dev/null +++ b/axiom/test/resources/wsdl/Choice.wsdl @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8"?> +<definitions xmlns:s1="http://soapinterop.org/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://soapinterop.org/" xmlns:s3="http://soapinterop.org/echoheader/" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://soapinterop.org" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/"> + <s:import namespace="http://soapinterop.org/xsd" /> + <s:import namespace="http://soapinterop.org/echoheader/" /> + + + + <s:element name="echoChoice"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="inputChoice" type="s1:ChoiceComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="echoChoiceResponse"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:ChoiceComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + + + + </s:schema> + + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd"> + <s:import namespace="http://soapinterop.org/" /> + + <s:complexType name="ChoiceComplexType"> + <s:sequence> + <s:choice minOccurs="1" maxOccurs="1"> + <s:element minOccurs="0" maxOccurs="1" name="name0" type="s:string" /> + <s:element minOccurs="0" maxOccurs="1" name="name1" type="s:string" /> + </s:choice> + </s:sequence> + </s:complexType> + </s:schema> + + </types> + + + + <message name="echoChoiceSoapIn"> + <part name="parameters" element="s0:echoChoice" /> + </message> + <message name="echoChoiceSoapOut"> + <part name="parameters" element="s0:echoChoiceResponse" /> + </message> + + <portType name="ChoiceTestSoap"> + + + <operation name="echoChoice"> + <input message="s0:echoChoiceSoapIn" /> + <output message="s0:echoChoiceSoapOut" /> + </operation> + + </portType> + + + <binding name="ChoiceTestSoap" type="s0:ChoiceTestSoap"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + <operation name="echoChoice"> + <soap:operation soapAction="Choice#echoChoice" style="document" /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + + </binding> + +<binding name="ChoiceTestSoap12" type="s0:ChoiceTestSoap"> + <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + + <operation name="echoChoice"> + <soap12:operation soapAction="Choice#echoChoice" style="document" /> + <input> + <soap12:body use="literal" /> + </input> + <output> + <soap12:body use="literal" /> + </output> + </operation> + + </binding> + +<service name="ChoiceTest"> + <documentation>These operations implement DOC/LIT SOAP operations, for interop testing. Please email johnko@microsoft.com with any questions/coments.</documentation> + <port name="ChoiceTestSoap" binding="s0:ChoiceTestSoap"> + <soap:address location="http://localhost:90/axis/Choice" /> + </port> + <port name="ChoiceTestSoap12" binding="s0:ChoiceTestSoap12"> + <soap12:address location="http://localhost:90/axis/Choice" /> + </port> + </service> +</definitions>
\ No newline at end of file diff --git a/axiom/test/resources/wsdl/CombinedAllTest.wsdl b/axiom/test/resources/wsdl/CombinedAllTest.wsdl new file mode 100644 index 0000000..640ea4a --- /dev/null +++ b/axiom/test/resources/wsdl/CombinedAllTest.wsdl @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="utf-8"?> +<definitions xmlns:s1="http://soapinterop.org/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://soapinterop.org/" xmlns:s3="http://soapinterop.org/echoheader/" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://soapinterop.org" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/"> + <s:import namespace="http://soapinterop.org/xsd" /> + <s:import namespace="http://soapinterop.org/echoheader/" /> + + + + <s:element name="echoAll"> + <s:complexType> + <s:sequence> + <s:element name="inputAll" type="s1:AllComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="echoAllResponse"> + <s:complexType> + <s:sequence> + <s:element name="return" type="s1:AllComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + + + + </s:schema> + + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd"> + <s:import namespace="http://soapinterop.org/" /> + + <s:complexType name="AllComplexType"> + <s:sequence> + <s:element minOccurs="1" maxOccurs="1" name="NonAllIntValue" type="s:int" /> + </s:sequence> + <s:all> + <s:element name="Value0" type="s:int" /> + <s:element minOccurs="0" name="Value1" type="s:int" /> + <s:element minOccurs="0" name="Value2" type="s:string" /> + </s:all> + <s:sequence> + <s:element minOccurs="1" maxOccurs="1" name="NonAllStringValue" type="s:string" /> + </s:sequence> + </s:complexType> + </s:schema> + + </types> + + + + <message name="echoAllSoapIn"> + <part name="parameters" element="s0:echoAll" /> + </message> + <message name="echoAllSoapOut"> + <part name="parameters" element="s0:echoAllResponse" /> + </message> + + <portType name="AllTestSoap"> + + + <operation name="echoAll"> + <input message="s0:echoAllSoapIn" /> + <output message="s0:echoAllSoapOut" /> + </operation> + + </portType> + + + <binding name="AllTestSoap" type="s0:AllTestSoap"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + <operation name="echoAll"> + <soap:operation soapAction="SimpleAllTest#echoAll" style="document" /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + + </binding> + +<binding name="AllTestSoap12" type="s0:AllTestSoap"> + <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + + <operation name="echoAll"> + <soap12:operation soapAction="All#echoAll" style="document" /> + <input> + <soap12:body use="literal" /> + </input> + <output> + <soap12:body use="literal" /> + </output> + </operation> + + </binding> + +<service name="AllTest"> + <documentation>These operations implement DOC/LIT SOAP operations, for interop testing. Please email johnko@microsoft.com with any questions/coments.</documentation> + <port name="AllTestSoap" binding="s0:AllTestSoap"> + <soap:address location="http://localhost:90/axis/All" /> + </port> + <port name="AllTestSoap12" binding="s0:AllTestSoap12"> + <soap12:address location="http://localhost:90/axis/All" /> + </port> + </service> +</definitions>
\ No newline at end of file diff --git a/axiom/test/resources/wsdl/CombinedChoice.wsdl b/axiom/test/resources/wsdl/CombinedChoice.wsdl new file mode 100644 index 0000000..d4f2541 --- /dev/null +++ b/axiom/test/resources/wsdl/CombinedChoice.wsdl @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="utf-8"?> +<definitions xmlns:s1="http://soapinterop.org/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://soapinterop.org/" xmlns:s3="http://soapinterop.org/echoheader/" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://soapinterop.org" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/"> + <s:import namespace="http://soapinterop.org/xsd" /> + <s:import namespace="http://soapinterop.org/echoheader/" /> + + + + <s:element name="echoChoice"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="inputChoice" type="s1:ChoiceComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="echoChoiceResponse"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:ChoiceComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + + + + </s:schema> + + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd"> + <s:import namespace="http://soapinterop.org/" /> + + <s:complexType name="ChoiceComplexType"> + <s:sequence> + + <s:element minOccurs="1" maxOccurs="1" name="NonChoiceIntValue" type="s:int" /> + + <s:choice minOccurs="1" maxOccurs="1"> + <s:element minOccurs="0" maxOccurs="1" name="IntValue" type="s:int" /> + <s:element minOccurs="0" maxOccurs="1" name="StringValue" type="s:string" /> + </s:choice> + + <s:element minOccurs="1" maxOccurs="1" name="NonChoiceStringValue" type="s:string" /> + + </s:sequence> + </s:complexType> + </s:schema> + + </types> + + + + <message name="echoChoiceSoapIn"> + <part name="parameters" element="s0:echoChoice" /> + </message> + <message name="echoChoiceSoapOut"> + <part name="parameters" element="s0:echoChoiceResponse" /> + </message> + + <portType name="ChoiceTestSoap"> + + + <operation name="echoChoice"> + <input message="s0:echoChoiceSoapIn" /> + <output message="s0:echoChoiceSoapOut" /> + </operation> + + </portType> + + + <binding name="ChoiceTestSoap" type="s0:ChoiceTestSoap"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + <operation name="echoChoice"> + <soap:operation soapAction="SimpleChoiceTest#echoChoice" style="document" /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + + </binding> + +<binding name="ChoiceTestSoap12" type="s0:ChoiceTestSoap"> + <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + + <operation name="echoChoice"> + <soap12:operation soapAction="Choice#echoChoice" style="document" /> + <input> + <soap12:body use="literal" /> + </input> + <output> + <soap12:body use="literal" /> + </output> + </operation> + + </binding> + +<service name="ChoiceTest"> + <documentation>These operations implement DOC/LIT SOAP operations, for interop testing. Please email johnko@microsoft.com with any questions/coments.</documentation> + <port name="ChoiceTestSoap" binding="s0:ChoiceTestSoap"> + <soap:address location="http://localhost:90/axis/Choice" /> + </port> + <port name="ChoiceTestSoap12" binding="s0:ChoiceTestSoap12"> + <soap12:address location="http://localhost:90/axis/Choice" /> + </port> + </service> +</definitions>
\ No newline at end of file diff --git a/axiom/test/resources/wsdl/ComplexLists.wsdl b/axiom/test/resources/wsdl/ComplexLists.wsdl new file mode 100644 index 0000000..21674dc --- /dev/null +++ b/axiom/test/resources/wsdl/ComplexLists.wsdl @@ -0,0 +1,192 @@ +<?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://complexlist.test.apache.org" xmlns:impl="http://complexlist.test.apache.org" xmlns:intf="http://complexlist.test.apache.org" xmlns:tns2="http://complexlistservice.test.apache.org" 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://complexlistservice.test.apache.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://complexlistImpl.test.apache.org" xmlns:intf="http://complexlistIntf.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <complexType name="m_list"> + <sequence> + <element maxOccurs="unbounded" name="item" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + <complexType name="attrlist"> + <sequence> + <element maxOccurs="unbounded" name="item" nillable="true" type="tns2:namepair"/> + </sequence> + </complexType> + <complexType name="namepair"> + <sequence> + <element name="m_list" nillable="true" type="tns2:m_list"/> + <element name="name" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + <complexType name="attrlisterr"> + <sequence> + <element name="attrlist" nillable="true" type="tns2:attrlist"/> + <element name="errorcode" type="xsd:int"/> + <element name="errortext" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </schema> + <schema elementFormDefault="qualified" targetNamespace="http://complexlist.test.apache.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://complexlistImpl2.test.apache.org" xmlns:intf="http://complexlistIntf2.test.apache.org" xmlns:tns2="http://complexlistservice.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <import namespace="http://complexlistservice.test.apache.org"/> + <element name="multilist"> + <complexType> + <sequence> + <element name="arg_0_0" nillable="true" type="tns2:m_list"/> + <element name="arg_1_0" nillable="true" type="tns2:attrlist"/> + </sequence> + </complexType> + </element> + <element name="multilistResponse"> + <complexType> + <sequence> + <element name="multilistReturn" nillable="true" type="tns2:attrlisterr"/> + </sequence> + </complexType> + </element> + <element name="multilistnil"> + <complexType> + <sequence> + <element name="arg_0_3" nillable="true" type="tns2:m_list"/> + <element name="arg_1_3" nillable="true" type="tns2:attrlist"/> + </sequence> + </complexType> + </element> + <element name="multilistnilResponse"> + <complexType> + <sequence> + <element name="multilistnilReturn" nillable="true" type="tns2:attrlisterr"/> + </sequence> + </complexType> + </element> + <element name="complexlist"> + <complexType> + <sequence> + <element name="arg_0_2" nillable="true" type="tns2:attrlist"/> + <element name="arg_1_2" nillable="true" type="xsd:string"/> + <element name="arg_2_2" nillable="true" type="tns2:attrlist"/> + </sequence> + </complexType> + </element> + <element name="complexlistResponse"> + <complexType> + <sequence> + <element name="complexlistReturn" nillable="true" type="tns2:attrlisterr"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="complexlistResponse"> + + <wsdl:part element="impl:complexlistResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="complexlistRequest"> + + <wsdl:part element="impl:complexlist" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="multilistRequest"> + <wsdl:part element="impl:multilist" name="parameters"/> + </wsdl:message> + + <wsdl:message name="multilistResponse"> + <wsdl:part element="impl:multilistResponse" name="parameters"/> + </wsdl:message> + + <wsdl:message name="multilistnilRequest"> + <wsdl:part element="impl:multilistnil" name="parameters"/> + </wsdl:message> + + <wsdl:message name="multilistnilResponse"> + <wsdl:part element="impl:multilistnilResponse" name="parameters"/> + </wsdl:message> + + <wsdl:portType name="ComplexLists"> + + <wsdl:operation name="multilist"> + <wsdl:input message="impl:multilistRequest" name="multilistRequest"/> + <wsdl:output message="impl:multilistResponse" name="multilistResponse"/> + </wsdl:operation> + + <wsdl:operation name="multilistnil"> + <wsdl:input message="impl:multilistnilRequest" name="multilistnilRequest"/> + <wsdl:output message="impl:multilistnilResponse" name="multilistnilResponse"/> + </wsdl:operation> + + <wsdl:operation name="complexlist"> + + <wsdl:input message="impl:complexlistRequest" name="complexlistRequest"/> + + <wsdl:output message="impl:complexlistResponse" name="complexlistResponse"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="ComplexListsSoapBinding" type="impl:ComplexLists"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="multilist"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="multilistRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="multilistResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <wsdl:operation name="multilistnil"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="multilistnilRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="multilistnilResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <wsdl:operation name="complexlist"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="complexlistRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="complexlistResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="ComplexListsService"> + + <wsdl:port binding="impl:ComplexListsSoapBinding" name="ComplexLists"> + + <wsdlsoap:address location="http://localhost:9080/ComplexLists/services/ComplexLists"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> + diff --git a/axiom/test/resources/wsdl/ComplexTypeAll.wsdl b/axiom/test/resources/wsdl/ComplexTypeAll.wsdl new file mode 100644 index 0000000..2703344 --- /dev/null +++ b/axiom/test/resources/wsdl/ComplexTypeAll.wsdl @@ -0,0 +1,81 @@ +<?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. --> + +<definitions name="Service" + targetNamespace="http://complextype.test.apache.org" + xmlns:tns="http://complextype.test.apache.org" + xmlns="http://schemas.xmlsoap.org/wsdl/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <types> + <xsd:schema elementFormDefault="qualified" + targetNamespace="http://complextype.test.apache.org" + xmlns:tns="http://complextype.test.apache.org"> + <xsd:element name="myOperation"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="aType" type="tns:aRecord"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="aRecord"> + <xsd:all> + <xsd:element name="field1" type="xsd:string" nillable="true"/> + <xsd:element name="field2" type="xsd:string" fixed="field2Value"/> + <xsd:element name="field3" type="xsd:string" nillable="false"/> + </xsd:all> + </xsd:complexType> + + <xsd:element name="myOperationResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="result" type="xsd:boolean"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </types> + <message name="request"> + <part name="parameters" element="tns:myOperation"/> + </message> + <message name="response"> + <part name="parameters" element="tns:myOperationResponse"/> + </message> + <portType name="operations"> + <operation name="myOperation"> + <input message="tns:request"/> + <output message="tns:response"/> + </operation> + </portType> + <binding name="operationsBinding" type="tns:operations"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> + <operation name="myOperation"> + <soap:operation soapAction="http://complextype.test.apache.org"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + </binding> + <service name="TestServices"> + <port name="Service" binding="tns:operationsBinding"> + <soap:address location="http://localhost:9080/ComplexTypeAll/services/Service"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/DIClientDoc.wsdl b/axiom/test/resources/wsdl/DIClientDoc.wsdl new file mode 100644 index 0000000..972e768 --- /dev/null +++ b/axiom/test/resources/wsdl/DIClientDoc.wsdl @@ -0,0 +1,96 @@ +<?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> + </schema> + </wsdl:types> + + <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: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="http://localhost:9090/axis2/services/math/add"/> + + <wsdl:input name="addRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="addResponse"> + + <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:9090/axis2/services/math"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/DataHandlerService.wsdl b/axiom/test/resources/wsdl/DataHandlerService.wsdl new file mode 100644 index 0000000..41fcec4 --- /dev/null +++ b/axiom/test/resources/wsdl/DataHandlerService.wsdl @@ -0,0 +1,291 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions targetNamespace="http://datahandler.attachment.test.org" xmlns:impl="http://datahandler.attachment.test.org" xmlns:intf="http://datahandler.attachment.test.org" xmlns:tns2="http://xml.apache.org/xml-soap" 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://datahandler.attachment.test.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://datahandler.attachment.test.org" xmlns:intf="http://datahandler.attachment.test.org" xmlns:tns2="http://xml.apache.org/xml-soap" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <import namespace="http://xml.apache.org/xml-soap"/> + <element name="getContentType"> + <complexType> + <sequence> + <element name="arg_0_0" nillable="true" type="tns2:DataHandler"/> + </sequence> + </complexType> + </element> + <element name="getContentTypeResponse"> + <complexType> + <sequence> + <element name="getContentTypeReturn" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="saveContent"> + <complexType> + <sequence> + <element name="arg_0_1" nillable="true" type="tns2:DataHandler"/> + <element name="arg_1_1" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="saveContentResponse"> + <complexType> + <sequence> + <element name="saveContentReturn" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="echoContent"> + <complexType> + <sequence> + <element name="arg_0_2" nillable="true" type="tns2:DataHandler"/> + </sequence> + </complexType> + </element> + <element name="echoContentResponse"> + <complexType> + <sequence> + <element name="echoContentReturn" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="getNoOfBytes"> + <complexType> + <sequence> + <element name="arg_0_3" nillable="true" type="tns2:DataHandler"/> + </sequence> + </complexType> + </element> + <element name="getNoOfBytesResponse"> + <complexType> + <sequence> + <element name="getNoOfBytesReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="executeClass"> + <complexType> + <sequence> + <element name="arg_0_4" nillable="true" type="tns2:DataHandler"/> + <element name="arg_1_4" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="executeClassResponse"> + <complexType> + <sequence> + <element name="executeClassReturn" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="echoContentRequest"> + + <wsdl:part element="impl:echoContent" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getContentTypeRequest"> + + <wsdl:part element="impl:getContentType" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getContentTypeResponse"> + + <wsdl:part element="impl:getContentTypeResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="executeClassResponse"> + + <wsdl:part element="impl:executeClassResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getNoOfBytesResponse"> + + <wsdl:part element="impl:getNoOfBytesResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="executeClassRequest"> + + <wsdl:part element="impl:executeClass" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="saveContentResponse"> + + <wsdl:part element="impl:saveContentResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="saveContentRequest"> + + <wsdl:part element="impl:saveContent" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getNoOfBytesRequest"> + + <wsdl:part element="impl:getNoOfBytes" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoContentResponse"> + + <wsdl:part element="impl:echoContentResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:portType name="DataHandlerService"> + + <wsdl:operation name="getContentType"> + + <wsdl:input message="impl:getContentTypeRequest" name="getContentTypeRequest"/> + + <wsdl:output message="impl:getContentTypeResponse" name="getContentTypeResponse"/> + + </wsdl:operation> + + <wsdl:operation name="saveContent"> + + <wsdl:input message="impl:saveContentRequest" name="saveContentRequest"/> + + <wsdl:output message="impl:saveContentResponse" name="saveContentResponse"/> + + </wsdl:operation> + + <wsdl:operation name="echoContent"> + + <wsdl:input message="impl:echoContentRequest" name="echoContentRequest"/> + + <wsdl:output message="impl:echoContentResponse" name="echoContentResponse"/> + + </wsdl:operation> + + <wsdl:operation name="getNoOfBytes"> + + <wsdl:input message="impl:getNoOfBytesRequest" name="getNoOfBytesRequest"/> + + <wsdl:output message="impl:getNoOfBytesResponse" name="getNoOfBytesResponse"/> + + </wsdl:operation> + + <wsdl:operation name="executeClass"> + + <wsdl:input message="impl:executeClassRequest" name="executeClassRequest"/> + + <wsdl:output message="impl:executeClassResponse" name="executeClassResponse"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="DataHandlerServiceSoapBinding" type="impl:DataHandlerService"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="getContentType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="getContentTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="getContentTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="saveContent"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="saveContentRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="saveContentResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoContent"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoContentRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoContentResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="getNoOfBytes"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="getNoOfBytesRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="getNoOfBytesResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="executeClass"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="executeClassRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="executeClassResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="DataHandlerServiceService"> + + <wsdl:port binding="impl:DataHandlerServiceSoapBinding" name="DataHandlerService"> + + <wsdlsoap:address location="http://localhost:9080/DataHandlerService/services/DataHandlerService"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/Enumeration.wsdl b/axiom/test/resources/wsdl/Enumeration.wsdl new file mode 100644 index 0000000..15f72ce --- /dev/null +++ b/axiom/test/resources/wsdl/Enumeration.wsdl @@ -0,0 +1,108 @@ +<?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. --> + +<definitions targetNamespace="http://enumeration.test.apache.org" xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://enumeration.test.apache.org" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://enumeration.test.apache.org" xmlns:tns="http://enumeration.test.apache.org"> + + <xsd:element name="getInput"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="type" maxOccurs="1" minOccurs="0" type="tns:Type1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:element name="getInputResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="type" maxOccurs="1" minOccurs="0" type="tns:Type1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="Type1"> + <xsd:sequence> + <xsd:element name="enum_int" maxOccurs="1" minOccurs="0" type="tns:TypeInt" /> + <xsd:element name="enum_string" maxOccurs="1" minOccurs="0" type="tns:TypeString" /> + </xsd:sequence> + <xsd:attribute name="att_enum_int" type="tns:TypeInt"/> + <xsd:attribute name="att_enum_string" type="tns:TypeString"/> + <xsd:attribute name="att_enum_kind"> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="CHEQUE" /> + <xsd:enumeration value="CREDIT_CARD" /> + <xsd:enumeration value="TRANSFER" /> + <xsd:enumeration value="WITHDRAWAL" /> + <xsd:enumeration value="AUTOMATIC" /> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + + <xsd:simpleType name="TypeInt"> + <xsd:restriction base="xsd:int"> + <xsd:enumeration value="0" /> + <xsd:enumeration value="1" /> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="TypeString"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="one" /> + <xsd:enumeration value="two" /> + </xsd:restriction> + </xsd:simpleType> + + </xsd:schema> + </types> + + + <message name="input"> + <part name="parameters" element="tns:getInput" /> + </message> + + <message name="output"> + <part name="parameters" element="tns:getInputResponse" /> + </message> + + <portType name="EnumerationWS"> + <operation name="getInput"> + <input message="tns:input" /> + <output message="tns:output" /> + </operation> + </portType> + + <binding name="EnumerationWSBinding" type="tns:EnumerationWS"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> + <operation name="getInput"> + <soap:operation /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + </binding> + + <service name="EnumerationWSService"> + <port name="sampleWS" binding="tns:EnumerationWSBinding"> + <soap:address location="http://localhost:9080/Enumeration/services/sampleWS" /> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/ExceptionTest.wsdl b/axiom/test/resources/wsdl/ExceptionTest.wsdl new file mode 100644 index 0000000..557ed0f --- /dev/null +++ b/axiom/test/resources/wsdl/ExceptionTest.wsdl @@ -0,0 +1,97 @@ +<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://soapinterop.org/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" targetNamespace="http://soapinterop.org/wsdl"> +<!-- Copyright 2003-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. --> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://soapinterop.org/types"> + <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="DivByZeroStruct"> + <sequence> + <element name="varString" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="varFloat" type="xsd:float"/> + </sequence> + </complexType> + <complexType name="SpecialDetailStruct"> + <sequence> + <element name="varString" type="xsd:string"/> + </sequence> + </complexType> + <complexType name="OutOfBoundStruct"> + <sequence> + <element name="varString" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="specialDetail" type="tns:SpecialDetailStruct"/> + </sequence> + </complexType> + </schema> + </types> + <message name="DivByZeroFault"> + <part name="faultstruct1" type="ns2:DivByZeroStruct"/> + </message> + <message name="OutOfBoundFault"> + <part name="faultstruct1" type="ns2:OutOfBoundStruct"/> + </message> + <message name="SpecialDetailFault"> + <part name="faultstruct1" type="ns2:SpecialDetailStruct"/> + </message> + <message name="divRequest"> + <part name="int0" type="xsd:int"/> + <part name="int1" type="xsd:int"/> + </message> + <message name="divResponse"> + <part name="addReturn" type="xsd:int"/> + </message> + <portType name="MathOps"> + <operation name="div" parameterOrder ="int0 int1"> + <input message="tns:divRequest"/> + <output message="tns:divResponse"/> + <fault name="DivByZero" message="tns:DivByZeroFault"/> + <fault name="OutOfBound" message="tns:OutOfBoundFault"/> + <fault name="NormalDetail" message="tns:SpecialDetailFault"/> + </operation> + </portType> + <binding name="MathOpsBinding" type="tns:MathOps"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="div"> + <soap:operation soapAction="MathOps#div"/> + <input name="divRequest"> + <soap:body + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/MathOps" + use="encoded"/> + </input> + <output name="divResponse"> + <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/MathOps" + use="encoded"/> + </output> + <fault name="DivByZero"> + <soap:fault name="DivByZero" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soapinterop.org/wsdl"/> + </fault> + <fault name="OutOfBound"> + <soap:fault name="OutOfBound" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soapinterop.org/wsdl"/> + </fault> + <fault name="NormalDetail"> + <soap:fault name="NormalDetail" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soapinterop.org/wsdl"/> + </fault> + </operation> + </binding> + <service name="MathOpsService"> + <port name="MathOps" binding="tns:MathOpsBinding"> + <soap:address location="http://localhost/axis/MathOps"/> + </port> + </service> + <!-- Fault messages --> +</definitions> diff --git a/axiom/test/resources/wsdl/ExceptionTestDoc.wsdl b/axiom/test/resources/wsdl/ExceptionTestDoc.wsdl new file mode 100644 index 0000000..e51b20f --- /dev/null +++ b/axiom/test/resources/wsdl/ExceptionTestDoc.wsdl @@ -0,0 +1,160 @@ +<?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://soapinterop.org/wsdl" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org/wsdl" xmlns:intf="http://soapinterop.org/wsdl" 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://soapinterop.org/wsdl" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org/wsdl" xmlns:intf="http://soapinterop.org/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <element name="div"> + <complexType> + <sequence> + <element name="arg_0_0" type="xsd:int"/> + <element name="arg_1_0" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="divResponse"> + <complexType> + <sequence> + <element name="divReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + <complexType name="OutOfBoundStruct"> + <sequence> + <element name="varString" nillable="true" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="specialDetail" nillable="true" type="impl:SpecialDetailStruct"/> + </sequence> + </complexType> + <complexType name="SpecialDetailStruct"> + <sequence> + <element name="varString" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + <element name="OutOfBoundStruct" nillable="true" type="impl:OutOfBoundStruct"/> + <complexType name="DivByZeroStruct"> + <sequence> + <element name="varString" nillable="true" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="varFloat" type="xsd:float"/> + </sequence> + </complexType> + <element name="DivByZeroStruct" nillable="true" type="impl:DivByZeroStruct"/> + <element name="SpecialDetailStruct" nillable="true" type="impl:SpecialDetailStruct"/> + </schema> + </wsdl:types> + + <wsdl:message name="OutOfBoundStruct"> + + <wsdl:part element="impl:OutOfBoundStruct" name="fault"/> + + </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="DivByZeroStruct"> + + <wsdl:part element="impl:DivByZeroStruct" name="fault"/> + + </wsdl:message> + + <wsdl:message name="SpecialDetailStruct"> + + <wsdl:part element="impl:SpecialDetailStruct" name="fault"/> + + </wsdl:message> + + <wsdl:portType name="MathOps"> + + <wsdl:operation name="div"> + + <wsdl:input message="impl:divRequest" name="divRequest"/> + + <wsdl:output message="impl:divResponse" name="divResponse"/> + + <wsdl:fault message="impl:DivByZeroStruct" name="DivByZeroStruct"/> + + <wsdl:fault message="impl:SpecialDetailStruct" name="SpecialDetailStruct"/> + + <wsdl:fault message="impl:OutOfBoundStruct" name="OutOfBoundStruct"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="MathOpsSoapBinding" type="impl:MathOps"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="div"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="divRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="divResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + <wsdl:fault name="DivByZeroStruct"> + + <wsdlsoap:fault name="DivByZeroStruct" use="literal"/> + + </wsdl:fault> + + <wsdl:fault name="SpecialDetailStruct"> + + <wsdlsoap:fault name="SpecialDetailStruct" use="literal"/> + + </wsdl:fault> + + <wsdl:fault name="OutOfBoundStruct"> + + <wsdlsoap:fault name="OutOfBoundStruct" use="literal"/> + + </wsdl:fault> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="MathOpsService"> + + <wsdl:port binding="impl:MathOpsSoapBinding" name="MathOps"> + + <wsdlsoap:address location="http://localhost/axis/MathOps"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/ExtensibilityQuery.wsdl b/axiom/test/resources/wsdl/ExtensibilityQuery.wsdl new file mode 100644 index 0000000..27a2738 --- /dev/null +++ b/axiom/test/resources/wsdl/ExtensibilityQuery.wsdl @@ -0,0 +1,154 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright 2003-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. --> + + +<definitions name="ExtensibilityQuery" targetNamespace="urn:ExtensibilityQuery" + +xmlns="http://schemas.xmlsoap.org/wsdl/" + +xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + +xmlns:tns="urn:ExtensibilityQuery" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + + <types> + + <xsd:schema attributeFormDefault="qualified" + + elementFormDefault="qualified" targetNamespace="urn:ExtensibilityQuery"> + + + + <xsd:complexType name="ExtensibilityType"> + + <xsd:sequence> + + <xsd:any namespace="##any"/> + + </xsd:sequence> + + </xsd:complexType> + + + + <xsd:element name="query"> + + <xsd:complexType> + + <xsd:sequence> + + <xsd:any namespace="##any" /> + + </xsd:sequence> + + </xsd:complexType> + + </xsd:element> + + + + <xsd:element name="queryResponse"> + + <xsd:complexType> + + <xsd:sequence> + + <xsd:any namespace="##any" /> + + </xsd:sequence> + + </xsd:complexType> + + </xsd:element> + + + + </xsd:schema> + + </types> + + + + <message name="queryIn"> + + <part element="tns:query" name="parameters" /> + + </message> + + + + <message name="queryOut"> + + <part element="tns:queryResponse" name="parameters" /> + + </message> + + + + <portType name="ExtensibilityQueryPortType"> + + <operation name="query"> + + <input message="tns:queryIn" /> + + <output message="tns:queryOut" /> + + </operation> + + </portType> + + + + <binding name="ExtensibilityQueryBinding" type="tns:ExtensibilityQueryPortType"> + + <soap:binding style="document" + + transport="http://schemas.xmlsoap.org/soap/http" /> + + <operation name="query"> + + <soap:operation soapAction="ExtensibilityQuery#query" /> + + <input> + + <soap:body use="literal" /> + + </input> + + <output> + + <soap:body use="literal" /> + + </output> + + </operation> + + </binding> + + + + <service name="ExtensibilityQuery"> + + <port binding="tns:ExtensibilityQueryBinding" name="ExtensibilityQueryPort"> + + <soap:address location="http://localhost:8080/axis/testXSDANY"/> + + </port> + + </service> + +</definitions> + + + diff --git a/axiom/test/resources/wsdl/FaultMapping.wsdl b/axiom/test/resources/wsdl/FaultMapping.wsdl new file mode 100644 index 0000000..557ed0f --- /dev/null +++ b/axiom/test/resources/wsdl/FaultMapping.wsdl @@ -0,0 +1,97 @@ +<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://soapinterop.org/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" targetNamespace="http://soapinterop.org/wsdl"> +<!-- Copyright 2003-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. --> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://soapinterop.org/types"> + <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="DivByZeroStruct"> + <sequence> + <element name="varString" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="varFloat" type="xsd:float"/> + </sequence> + </complexType> + <complexType name="SpecialDetailStruct"> + <sequence> + <element name="varString" type="xsd:string"/> + </sequence> + </complexType> + <complexType name="OutOfBoundStruct"> + <sequence> + <element name="varString" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="specialDetail" type="tns:SpecialDetailStruct"/> + </sequence> + </complexType> + </schema> + </types> + <message name="DivByZeroFault"> + <part name="faultstruct1" type="ns2:DivByZeroStruct"/> + </message> + <message name="OutOfBoundFault"> + <part name="faultstruct1" type="ns2:OutOfBoundStruct"/> + </message> + <message name="SpecialDetailFault"> + <part name="faultstruct1" type="ns2:SpecialDetailStruct"/> + </message> + <message name="divRequest"> + <part name="int0" type="xsd:int"/> + <part name="int1" type="xsd:int"/> + </message> + <message name="divResponse"> + <part name="addReturn" type="xsd:int"/> + </message> + <portType name="MathOps"> + <operation name="div" parameterOrder ="int0 int1"> + <input message="tns:divRequest"/> + <output message="tns:divResponse"/> + <fault name="DivByZero" message="tns:DivByZeroFault"/> + <fault name="OutOfBound" message="tns:OutOfBoundFault"/> + <fault name="NormalDetail" message="tns:SpecialDetailFault"/> + </operation> + </portType> + <binding name="MathOpsBinding" type="tns:MathOps"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="div"> + <soap:operation soapAction="MathOps#div"/> + <input name="divRequest"> + <soap:body + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/MathOps" + use="encoded"/> + </input> + <output name="divResponse"> + <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/MathOps" + use="encoded"/> + </output> + <fault name="DivByZero"> + <soap:fault name="DivByZero" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soapinterop.org/wsdl"/> + </fault> + <fault name="OutOfBound"> + <soap:fault name="OutOfBound" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soapinterop.org/wsdl"/> + </fault> + <fault name="NormalDetail"> + <soap:fault name="NormalDetail" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soapinterop.org/wsdl"/> + </fault> + </operation> + </binding> + <service name="MathOpsService"> + <port name="MathOps" binding="tns:MathOpsBinding"> + <soap:address location="http://localhost/axis/MathOps"/> + </port> + </service> + <!-- Fault messages --> +</definitions> diff --git a/axiom/test/resources/wsdl/FaultMappingDoc.wsdl b/axiom/test/resources/wsdl/FaultMappingDoc.wsdl new file mode 100644 index 0000000..e51b20f --- /dev/null +++ b/axiom/test/resources/wsdl/FaultMappingDoc.wsdl @@ -0,0 +1,160 @@ +<?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://soapinterop.org/wsdl" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org/wsdl" xmlns:intf="http://soapinterop.org/wsdl" 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://soapinterop.org/wsdl" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org/wsdl" xmlns:intf="http://soapinterop.org/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <element name="div"> + <complexType> + <sequence> + <element name="arg_0_0" type="xsd:int"/> + <element name="arg_1_0" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="divResponse"> + <complexType> + <sequence> + <element name="divReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + <complexType name="OutOfBoundStruct"> + <sequence> + <element name="varString" nillable="true" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="specialDetail" nillable="true" type="impl:SpecialDetailStruct"/> + </sequence> + </complexType> + <complexType name="SpecialDetailStruct"> + <sequence> + <element name="varString" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + <element name="OutOfBoundStruct" nillable="true" type="impl:OutOfBoundStruct"/> + <complexType name="DivByZeroStruct"> + <sequence> + <element name="varString" nillable="true" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="varFloat" type="xsd:float"/> + </sequence> + </complexType> + <element name="DivByZeroStruct" nillable="true" type="impl:DivByZeroStruct"/> + <element name="SpecialDetailStruct" nillable="true" type="impl:SpecialDetailStruct"/> + </schema> + </wsdl:types> + + <wsdl:message name="OutOfBoundStruct"> + + <wsdl:part element="impl:OutOfBoundStruct" name="fault"/> + + </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="DivByZeroStruct"> + + <wsdl:part element="impl:DivByZeroStruct" name="fault"/> + + </wsdl:message> + + <wsdl:message name="SpecialDetailStruct"> + + <wsdl:part element="impl:SpecialDetailStruct" name="fault"/> + + </wsdl:message> + + <wsdl:portType name="MathOps"> + + <wsdl:operation name="div"> + + <wsdl:input message="impl:divRequest" name="divRequest"/> + + <wsdl:output message="impl:divResponse" name="divResponse"/> + + <wsdl:fault message="impl:DivByZeroStruct" name="DivByZeroStruct"/> + + <wsdl:fault message="impl:SpecialDetailStruct" name="SpecialDetailStruct"/> + + <wsdl:fault message="impl:OutOfBoundStruct" name="OutOfBoundStruct"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="MathOpsSoapBinding" type="impl:MathOps"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="div"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="divRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="divResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + <wsdl:fault name="DivByZeroStruct"> + + <wsdlsoap:fault name="DivByZeroStruct" use="literal"/> + + </wsdl:fault> + + <wsdl:fault name="SpecialDetailStruct"> + + <wsdlsoap:fault name="SpecialDetailStruct" use="literal"/> + + </wsdl:fault> + + <wsdl:fault name="OutOfBoundStruct"> + + <wsdlsoap:fault name="OutOfBoundStruct" use="literal"/> + + </wsdl:fault> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="MathOpsService"> + + <wsdl:port binding="impl:MathOpsSoapBinding" name="MathOps"> + + <wsdlsoap:address location="http://localhost/axis/MathOps"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/FourLevelTestDoc.wsdl b/axiom/test/resources/wsdl/FourLevelTestDoc.wsdl new file mode 100644 index 0000000..7c82a05 --- /dev/null +++ b/axiom/test/resources/wsdl/FourLevelTestDoc.wsdl @@ -0,0 +1,73 @@ +<?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. --> + +<definitions name="LicenseUsageHistoryService" targetNamespace="urn:org.apache:ws-axis/c/test/v1_0" xmlns:impl="urn:org.apache:ws-axis/c/test/v1_0" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"> + <types> + <schema targetNamespace="urn:org.apache:ws-axis/c/test/v1_0" xmlns:impl="urn:org.apache:ws-axis/c/test/v1_0" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified"> + <complexType name="FourthLevelElemType"> + <sequence> + <element name="SampleString" type="xsd:string"/> + <element name="SampleInt" type="xsd:int"/> + </sequence> + </complexType> + <complexType name="ThirdLevelElemType"> + <sequence> + <element name="FourthLevelElem" type="impl:FourthLevelElemType" maxOccurs="unbounded"/> + </sequence> + </complexType> + <complexType name="SecondLevelElemType"> + <sequence> + <element name="ThirdLevelElem" type="impl:ThirdLevelElemType" maxOccurs="unbounded"/> + </sequence> + </complexType> + <complexType name="FirstLevelElemType"> + <sequence> + <element name="SecondLevelElem" type="impl:SecondLevelElemType" maxOccurs="unbounded"/> + </sequence> + </complexType> + <element name="FirstLevelElem" type="impl:FirstLevelElemType"/> + </schema> + </types> + <message name="TestDocRequest"> + <part element="impl:FirstLevelElem" name="inputPart"/> + </message> + <message name="TestDocResponse"> + <part element="impl:FirstLevelElem" name="outputPart"/> + </message> + <portType name="FourLevelTestDocInterface"> + <operation name="RetrieveTestDoc"> + <input message="impl:TestDocRequest" name="TestDocRequest"/> + <output message="impl:TestDocResponse" name="TestDocResponse"/> + </operation> + </portType> + <binding name="FourLevelTestDocBinding" type="impl:FourLevelTestDocInterface"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="RetrieveTestDoc"> + <soap:operation soapAction="FourLevelTestDocService#RetrieveTestDoc" style="document"/> + <input name="TestDocRequest"> + <soap:body namespace="urn:org.apache:ws-axis/c/test/v1_0" use="literal"/> + </input> + <output name="TestDocResponse"> + <soap:body namespace="urn:org.apache:ws-axis/c/test/v1_0" use="literal"/> + </output> + </operation> + </binding> + <service name="FourLevelTestDocService"> + <port binding="impl:FourLevelTestDocBinding" name="FourLevelTestDoc"> + <soap:address location="http://localhost:80/axis/FourLevelTestDoc"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/InOut.wsdl b/axiom/test/resources/wsdl/InOut.wsdl new file mode 100644 index 0000000..11f6afa --- /dev/null +++ b/axiom/test/resources/wsdl/InOut.wsdl @@ -0,0 +1,429 @@ +<?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://complexissues.test.apache.org" xmlns:impl="http://complexissues.test.apache.org" xmlns:intf="http://complexissues.test.apache.org" 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://complexissues.test.apache.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://complexissues.test.apache.org" xmlns:intf="http://complexissues.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <element name="noParametersNoReturn"> + <complexType> + <sequence/> + </complexType> + </element> + <element name="noParametersNoReturnResponse"> + <complexType> + <sequence/> + </complexType> + </element> + <element name="noParametersIntReturn"> + <complexType> + <sequence/> + </complexType> + </element> + <element name="noParametersIntReturnResponse"> + <complexType> + <sequence> + <element name="noParametersIntReturnReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="multiParametersNoReturn"> + <complexType> + <sequence> + <element name="arg_0_2" nillable="true" type="xsd:string"/> + <element name="arg_1_2" type="xsd:int"/> + <element name="arg_2_2" type="xsd:double"/> + </sequence> + </complexType> + </element> + <element name="multiParametersNoReturnResponse"> + <complexType> + <sequence/> + </complexType> + </element> + <element name="multiComplexParametersIntReturn"> + <complexType> + <sequence> + <element name="arg_0_3" nillable="true" type="xsd:string"/> + <element name="arg_1_3" nillable="true" type="impl:ComplexType1"/> + <element name="arg_2_3" type="xsd:int"/> + <element name="arg_3_3" type="xsd:double"/> + <element maxOccurs="unbounded" name="arg_4_3" type="xsd:string"/> + </sequence> + </complexType> + </element> + <complexType name="ComplexType1"> + <sequence> + <element name="ctLong" type="xsd:long"/> + <element maxOccurs="unbounded" name="ctIntArray" type="xsd:int"/> + <element name="ctString" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + <complexType name="ComplexType2"> + <sequence> + <element name="ctLong" type="xsd:long"/> + <element maxOccurs="unbounded" name="ctIntArray" type="xsd:int"/> + <element name="ctString" nillable="true" type="xsd:string"/> + <element name="ctComplex" nillable="true" type="impl:ComplexType1"/> + </sequence> + </complexType> + <element name="complexParameterComplexReturn"> + <complexType> + <sequence> + <element name="complexRequest" nillable="true" type="impl:ComplexType2"/> + </sequence> + </complexType> + </element> + <element name="complexParameterComplexReturnResponse"> + <complexType> + <sequence> + <element name="complexResponse" nillable="true" type="impl:ComplexType2"/> + </sequence> + </complexType> + </element> + <element name="multiComplexParametersIntReturnResponse"> + <complexType> + <sequence> + <element name="multiComplexParametersIntReturnReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="multiComplexParametersNilIntReturn"> + <complexType> + <sequence> + <element name="arg_0_4" nillable="true" type="xsd:string"/> + <element name="arg_1_4" nillable="true" type="impl:ComplexNilType1"/> + <element name="arg_2_4" nillable="true" type="xsd:int"/> + <element name="arg_3_4" nillable="true" type="xsd:double"/> + <element maxOccurs="unbounded" name="arg_4_4" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + <complexType name="ComplexNilType1"> + <sequence> + <element name="ctLong" nillable="true" type="xsd:long"/> + <element maxOccurs="unbounded" name="ctIntArray" nillable="true" type="xsd:int"/> + <element name="ctString" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + <element name="multiComplexParametersNilIntReturnResponse"> + <complexType> + <sequence> + <element name="multiComplexParametersNilIntReturnReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="multiArrayParametersIntReturn"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="arg_0_5" type="xsd:int"/> + <element maxOccurs="unbounded" minOccurs="0" name="arg_1_5" type="xsd:double"/> + <element maxOccurs="unbounded" minOccurs="0" name="arg_2_5" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="multiArrayParametersIntReturnResponse"> + <complexType> + <sequence> + <element name="multiArrayParametersIntReturnReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="noParametersIntReturnResponse"> + + <wsdl:part element="impl:noParametersIntReturnResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="noParametersNoReturnRequest"> + + <wsdl:part element="impl:noParametersNoReturn" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="multiComplexParametersIntReturnResponse"> + + <wsdl:part element="impl:multiComplexParametersIntReturnResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="multiArrayParametersIntReturnRequest"> + + <wsdl:part element="impl:multiArrayParametersIntReturn" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="multiComplexParametersNilIntReturnResponse"> + + <wsdl:part element="impl:multiComplexParametersNilIntReturnResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="noParametersNoReturnResponse"> + + <wsdl:part element="impl:noParametersNoReturnResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="multiParametersNoReturnRequest"> + + <wsdl:part element="impl:multiParametersNoReturn" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="complexParameterComplexReturnRequest"> + <wsdl:part element="impl:complexParameterComplexReturn" name="parameters"/> + </wsdl:message> + <wsdl:message name="complexParameterComplexReturnResponse"> + <wsdl:part element="impl:complexParameterComplexReturnResponse" name="parameters"/> + </wsdl:message> + + <wsdl:message name="noParametersIntReturnRequest"> + + <wsdl:part element="impl:noParametersIntReturn" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="multiComplexParametersIntReturnRequest"> + + <wsdl:part element="impl:multiComplexParametersIntReturn" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="multiComplexParametersNilIntReturnRequest"> + + <wsdl:part element="impl:multiComplexParametersNilIntReturn" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="multiArrayParametersIntReturnResponse"> + + <wsdl:part element="impl:multiArrayParametersIntReturnResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="multiParametersNoReturnResponse"> + + <wsdl:part element="impl:multiParametersNoReturnResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:portType name="InOut"> + + <wsdl:operation name="noParametersNoReturn"> + + <wsdl:input message="impl:noParametersNoReturnRequest" name="noParametersNoReturnRequest"/> + + <wsdl:output message="impl:noParametersNoReturnResponse" name="noParametersNoReturnResponse"/> + + </wsdl:operation> + + <wsdl:operation name="noParametersIntReturn"> + + <wsdl:input message="impl:noParametersIntReturnRequest" name="noParametersIntReturnRequest"/> + + <wsdl:output message="impl:noParametersIntReturnResponse" name="noParametersIntReturnResponse"/> + + </wsdl:operation> + + <wsdl:operation name="multiParametersNoReturn"> + + <wsdl:input message="impl:multiParametersNoReturnRequest" name="multiParametersNoReturnRequest"/> + + <wsdl:output message="impl:multiParametersNoReturnResponse" name="multiParametersNoReturnResponse"/> + + </wsdl:operation> + + <wsdl:operation name="complexParameterComplexReturn"> + + <wsdl:input message="impl:complexParameterComplexReturnRequest" name="complexParameterComplexReturnRequest"/> + + <wsdl:output message="impl:complexParameterComplexReturnResponse" name="complexParameterComplexReturnResponse"/> + + </wsdl:operation> + + <wsdl:operation name="multiComplexParametersIntReturn"> + + <wsdl:input message="impl:multiComplexParametersIntReturnRequest" name="multiComplexParametersIntReturnRequest"/> + + <wsdl:output message="impl:multiComplexParametersIntReturnResponse" name="multiComplexParametersIntReturnResponse"/> + + </wsdl:operation> + + <wsdl:operation name="multiComplexParametersNilIntReturn"> + + <wsdl:input message="impl:multiComplexParametersNilIntReturnRequest" name="multiComplexParametersNilIntReturnRequest"/> + + <wsdl:output message="impl:multiComplexParametersNilIntReturnResponse" name="multiComplexParametersNilIntReturnResponse"/> + + </wsdl:operation> + + <wsdl:operation name="multiArrayParametersIntReturn"> + + <wsdl:input message="impl:multiArrayParametersIntReturnRequest" name="multiArrayParametersIntReturnRequest"/> + + <wsdl:output message="impl:multiArrayParametersIntReturnResponse" name="multiArrayParametersIntReturnResponse"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="InOutSoapBinding" type="impl:InOut"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="noParametersNoReturn"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="noParametersNoReturnRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="noParametersNoReturnResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="noParametersIntReturn"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="noParametersIntReturnRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="noParametersIntReturnResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="multiParametersNoReturn"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="multiParametersNoReturnRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="multiParametersNoReturnResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="complexParameterComplexReturn"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="complexParameterComplexReturnRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="complexParameterComplexReturnResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="multiComplexParametersIntReturn"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="multiComplexParametersIntReturnRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="multiComplexParametersIntReturnResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="multiComplexParametersNilIntReturn"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="multiComplexParametersNilIntReturnRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="multiComplexParametersNilIntReturnResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="multiArrayParametersIntReturn"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="multiArrayParametersIntReturnRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="multiArrayParametersIntReturnResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="InOutService"> + + <wsdl:port binding="impl:InOutSoapBinding" name="InOut"> + + <wsdlsoap:address location="http://localhost:9080/InOut/services/InOut"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> + diff --git a/axiom/test/resources/wsdl/InteropTestRound1.wsdl b/axiom/test/resources/wsdl/InteropTestRound1.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/InteropTestRound1.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/InteropTestRound1Doc.wsdl b/axiom/test/resources/wsdl/InteropTestRound1Doc.wsdl new file mode 100644 index 0000000..be1d09b --- /dev/null +++ b/axiom/test/resources/wsdl/InteropTestRound1Doc.wsdl @@ -0,0 +1,774 @@ +<?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://soapinterop.org" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org" xmlns:intf="http://soapinterop.org" 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://soapinterop.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org" xmlns:intf="http://soapinterop.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <element name="echoString"> + <complexType> + <sequence> + <element name="arg_0_0" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="echoStringResponse"> + <complexType> + <sequence> + <element name="echoStringReturn" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="echoStringArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" name="arg_0_1" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="echoStringArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" name="echoStringArrayReturn" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="echoInteger"> + <complexType> + <sequence> + <element name="arg_0_2" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="echoIntegerResponse"> + <complexType> + <sequence> + <element name="echoIntegerReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="echoIntegerArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" name="arg_0_3" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="echoIntegerArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" name="echoIntegerArrayReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="echoFloat"> + <complexType> + <sequence> + <element name="arg_0_4" type="xsd:float"/> + </sequence> + </complexType> + </element> + <element name="echoFloatResponse"> + <complexType> + <sequence> + <element name="echoFloatReturn" type="xsd:float"/> + </sequence> + </complexType> + </element> + <element name="echoFloatArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" name="arg_0_5" type="xsd:float"/> + </sequence> + </complexType> + </element> + <element name="echoFloatArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" name="echoFloatArrayReturn" type="xsd:float"/> + </sequence> + </complexType> + </element> + <complexType name="SOAPStruct"> + <sequence> + <element name="varString" nillable="true" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="varFloat" type="xsd:float"/> + </sequence> + </complexType> + <element name="echoStruct"> + <complexType> + <sequence> + <element name="arg_0_6" nillable="true" type="impl:SOAPStruct"/> + </sequence> + </complexType> + </element> + <element name="echoStructResponse"> + <complexType> + <sequence> + <element name="echoStructReturn" nillable="true" type="impl:SOAPStruct"/> + </sequence> + </complexType> + </element> + <element name="echoStructArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" name="arg_0_7" type="impl:SOAPStruct"/> + </sequence> + </complexType> + </element> + <element name="echoStructArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" name="echoStructArrayReturn" type="impl:SOAPStruct"/> + </sequence> + </complexType> + </element> + <element name="echoVoid"> + <complexType> + <sequence/> + </complexType> + </element> + <element name="echoVoidResponse"> + <complexType> + <sequence/> + </complexType> + </element> + <element name="echoBase64"> + <complexType> + <sequence> + <element name="arg_0_9" type="xsd:base64Binary"/> + </sequence> + </complexType> + </element> + <element name="echoBase64Response"> + <complexType> + <sequence> + <element name="echoBase64Return" type="xsd:base64Binary"/> + </sequence> + </complexType> + </element> + <element name="echoDate"> + <complexType> + <sequence> + <element name="arg_0_10" nillable="true" type="xsd:dateTime"/> + </sequence> + </complexType> + </element> + <element name="echoDateResponse"> + <complexType> + <sequence> + <element name="echoDateReturn" nillable="true" type="xsd:dateTime"/> + </sequence> + </complexType> + </element> + <element name="echoHexBinary"> + <complexType> + <sequence> + <element name="arg_0_11" type="xsd:hexBinary"/> + </sequence> + </complexType> + </element> + <element name="echoHexBinaryResponse"> + <complexType> + <sequence> + <element name="echoHexBinaryReturn" type="xsd:hexBinary"/> + </sequence> + </complexType> + </element> + <element name="echoDecimal"> + <complexType> + <sequence> + <element name="arg_0_12" nillable="true" type="xsd:decimal"/> + </sequence> + </complexType> + </element> + <element name="echoDecimalResponse"> + <complexType> + <sequence> + <element name="echoDecimalReturn" nillable="true" type="xsd:decimal"/> + </sequence> + </complexType> + </element> + <element name="echoBoolean"> + <complexType> + <sequence> + <element name="arg_0_13" type="xsd:boolean"/> + </sequence> + </complexType> + </element> + <element name="echoBooleanResponse"> + <complexType> + <sequence> + <element name="echoBooleanReturn" type="xsd:boolean"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="echoBooleanResponse"> + + <wsdl:part element="impl:echoBooleanResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoBase64Response"> + + <wsdl:part element="impl:echoBase64Response" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoVoidRequest"> + + <wsdl:part element="impl:echoVoid" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoStringArrayRequest"> + + <wsdl:part element="impl:echoStringArray" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoDecimalResponse"> + + <wsdl:part element="impl:echoDecimalResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoFloatResponse"> + + <wsdl:part element="impl:echoFloatResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoBase64Request"> + + <wsdl:part element="impl:echoBase64" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoDateResponse"> + + <wsdl:part element="impl:echoDateResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoBooleanRequest"> + + <wsdl:part element="impl:echoBoolean" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoHexBinaryRequest"> + + <wsdl:part element="impl:echoHexBinary" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoHexBinaryResponse"> + + <wsdl:part element="impl:echoHexBinaryResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoFloatRequest"> + + <wsdl:part element="impl:echoFloat" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoIntegerResponse"> + + <wsdl:part element="impl:echoIntegerResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoFloatArrayRequest"> + + <wsdl:part element="impl:echoFloatArray" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoStringArrayResponse"> + + <wsdl:part element="impl:echoStringArrayResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoStructArrayRequest"> + + <wsdl:part element="impl:echoStructArray" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoStructRequest"> + + <wsdl:part element="impl:echoStruct" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoIntegerRequest"> + + <wsdl:part element="impl:echoInteger" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoDateRequest"> + + <wsdl:part element="impl:echoDate" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoIntegerArrayRequest"> + + <wsdl:part element="impl:echoIntegerArray" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoDecimalRequest"> + + <wsdl:part element="impl:echoDecimal" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoStructResponse"> + + <wsdl:part element="impl:echoStructResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoFloatArrayResponse"> + + <wsdl:part element="impl:echoFloatArrayResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoStringResponse"> + + <wsdl:part element="impl:echoStringResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoVoidResponse"> + + <wsdl:part element="impl:echoVoidResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoStructArrayResponse"> + + <wsdl:part element="impl:echoStructArrayResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoIntegerArrayResponse"> + + <wsdl:part element="impl:echoIntegerArrayResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoStringRequest"> + + <wsdl:part element="impl:echoString" name="parameters"/> + + </wsdl:message> + + <wsdl:portType name="InteropTestPortTypeDoc"> + + <wsdl:operation name="echoString"> + + <wsdl:input message="impl:echoStringRequest" name="echoStringRequest"/> + + <wsdl:output message="impl:echoStringResponse" name="echoStringResponse"/> + + </wsdl:operation> + + <wsdl:operation name="echoStringArray"> + + <wsdl:input message="impl:echoStringArrayRequest" name="echoStringArrayRequest"/> + + <wsdl:output message="impl:echoStringArrayResponse" name="echoStringArrayResponse"/> + + </wsdl:operation> + + <wsdl:operation name="echoInteger"> + + <wsdl:input message="impl:echoIntegerRequest" name="echoIntegerRequest"/> + + <wsdl:output message="impl:echoIntegerResponse" name="echoIntegerResponse"/> + + </wsdl:operation> + + <wsdl:operation name="echoIntegerArray"> + + <wsdl:input message="impl:echoIntegerArrayRequest" name="echoIntegerArrayRequest"/> + + <wsdl:output message="impl:echoIntegerArrayResponse" name="echoIntegerArrayResponse"/> + + </wsdl:operation> + + <wsdl:operation name="echoFloat"> + + <wsdl:input message="impl:echoFloatRequest" name="echoFloatRequest"/> + + <wsdl:output message="impl:echoFloatResponse" name="echoFloatResponse"/> + + </wsdl:operation> + + <wsdl:operation name="echoFloatArray"> + + <wsdl:input message="impl:echoFloatArrayRequest" name="echoFloatArrayRequest"/> + + <wsdl:output message="impl:echoFloatArrayResponse" name="echoFloatArrayResponse"/> + + </wsdl:operation> + + <wsdl:operation name="echoStruct"> + + <wsdl:input message="impl:echoStructRequest" name="echoStructRequest"/> + + <wsdl:output message="impl:echoStructResponse" name="echoStructResponse"/> + + </wsdl:operation> + + <wsdl:operation name="echoStructArray"> + + <wsdl:input message="impl:echoStructArrayRequest" name="echoStructArrayRequest"/> + + <wsdl:output message="impl:echoStructArrayResponse" name="echoStructArrayResponse"/> + + </wsdl:operation> + + <wsdl:operation name="echoVoid"> + + <wsdl:input message="impl:echoVoidRequest" name="echoVoidRequest"/> + + <wsdl:output message="impl:echoVoidResponse" name="echoVoidResponse"/> + + </wsdl:operation> + + <wsdl:operation name="echoBase64"> + + <wsdl:input message="impl:echoBase64Request" name="echoBase64Request"/> + + <wsdl:output message="impl:echoBase64Response" name="echoBase64Response"/> + + </wsdl:operation> + + <wsdl:operation name="echoDate"> + + <wsdl:input message="impl:echoDateRequest" name="echoDateRequest"/> + + <wsdl:output message="impl:echoDateResponse" name="echoDateResponse"/> + + </wsdl:operation> + + <wsdl:operation name="echoHexBinary"> + + <wsdl:input message="impl:echoHexBinaryRequest" name="echoHexBinaryRequest"/> + + <wsdl:output message="impl:echoHexBinaryResponse" name="echoHexBinaryResponse"/> + + </wsdl:operation> + + <wsdl:operation name="echoDecimal"> + + <wsdl:input message="impl:echoDecimalRequest" name="echoDecimalRequest"/> + + <wsdl:output message="impl:echoDecimalResponse" name="echoDecimalResponse"/> + + </wsdl:operation> + + <wsdl:operation name="echoBoolean"> + + <wsdl:input message="impl:echoBooleanRequest" name="echoBooleanRequest"/> + + <wsdl:output message="impl:echoBooleanResponse" name="echoBooleanResponse"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="InteropBaseSoapBinding" type="impl:InteropTestPortTypeDoc"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="echoString"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoStringRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoStringResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoStringArray"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoStringArrayRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoStringArrayResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoInteger"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoIntegerRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoIntegerResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoIntegerArray"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoIntegerArrayRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoIntegerArrayResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoFloat"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoFloatRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoFloatResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoFloatArray"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoFloatArrayRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoFloatArrayResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoStruct"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoStructRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoStructResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoStructArray"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoStructArrayRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoStructArrayResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoVoid"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoVoidRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoVoidResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoBase64"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoBase64Request"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoBase64Response"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoDate"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoDateRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoDateResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoHexBinary"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoHexBinaryRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoHexBinaryResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoDecimal"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoDecimalRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoDecimalResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="echoBoolean"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoBooleanRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoBooleanResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="InteropTestPortTypeDocService"> + + <wsdl:port binding="impl:InteropBaseSoapBinding" name="InteropBaseDoc"> + + <wsdlsoap:address location="http://localhost/axis/InteropBaseDoc"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/LargeReturningString.wsdl b/axiom/test/resources/wsdl/LargeReturningString.wsdl new file mode 100644 index 0000000..9b031da --- /dev/null +++ b/axiom/test/resources/wsdl/LargeReturningString.wsdl @@ -0,0 +1,95 @@ +<?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://largereturningstring.test.apache.org" xmlns:impl="http://largereturningstring.test.apache.org" xmlns:intf="http://largereturningstring.test.apache.org" 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://largereturningstring.test.apache.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://largereturningstring.test.apache.org" xmlns:intf="http://largereturningstring.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <element name="getLargeString"> + <complexType> + <sequence> + <element name="size" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="getLargeStringResponse"> + <complexType> + <sequence> + <element name="getLargeStringReturn" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="getLargeStringRequest"> + + <wsdl:part element="intf:getLargeString" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getLargeStringResponse"> + + <wsdl:part element="intf:getLargeStringResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:portType name="LargeReturningString"> + + <wsdl:operation name="getLargeString"> + + <wsdl:input message="intf:getLargeStringRequest" name="getLargeStringRequest"/> + + <wsdl:output message="intf:getLargeStringResponse" name="getLargeStringResponse"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="LargeReturningStringSoapBinding" type="intf:LargeReturningString"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="getLargeString"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="getLargeStringRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="getLargeStringResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="LargeReturningStringService"> + + <wsdl:port binding="intf:LargeReturningStringSoapBinding" name="LargeReturningString"> + + <wsdlsoap:address location="http://localhost:9080/LargeReturningString/services/LargeReturningString"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/LimitedAllTest.wsdl b/axiom/test/resources/wsdl/LimitedAllTest.wsdl new file mode 100644 index 0000000..81522f6 --- /dev/null +++ b/axiom/test/resources/wsdl/LimitedAllTest.wsdl @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<definitions xmlns:s1="http://soapinterop.org/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://soapinterop.org/" xmlns:s3="http://soapinterop.org/echoheader/" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://soapinterop.org" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/"> + <s:import namespace="http://soapinterop.org/xsd" /> + <s:import namespace="http://soapinterop.org/echoheader/" /> + + + + <s:element name="echoAll"> + <s:complexType> + <s:sequence> + <s:element name="inputAll" type="s1:AllComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="echoAllResponse"> + <s:complexType> + <s:sequence> + <s:element name="return" type="s1:AllComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + + + + </s:schema> + + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd"> + <s:import namespace="http://soapinterop.org/" /> + + <s:complexType name="AllComplexType"> + <s:all> + <s:element name="Value0" type="s:int" /> + <s:element minOccurs="0" name="Value1" type="s:int" /> + <s:element minOccurs="0" name="Value2" type="s:string" /> + </s:all> + </s:complexType> + </s:schema> + + </types> + + + + <message name="echoAllSoapIn"> + <part name="parameters" element="s0:echoAll" /> + </message> + <message name="echoAllSoapOut"> + <part name="parameters" element="s0:echoAllResponse" /> + </message> + + <portType name="AllTestSoap"> + + + <operation name="echoAll"> + <input message="s0:echoAllSoapIn" /> + <output message="s0:echoAllSoapOut" /> + </operation> + + </portType> + + + <binding name="AllTestSoap" type="s0:AllTestSoap"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + <operation name="echoAll"> + <soap:operation soapAction="SimpleAllTest#echoAll" style="document" /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + + </binding> + +<binding name="AllTestSoap12" type="s0:AllTestSoap"> + <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + + <operation name="echoAll"> + <soap12:operation soapAction="All#echoAll" style="document" /> + <input> + <soap12:body use="literal" /> + </input> + <output> + <soap12:body use="literal" /> + </output> + </operation> + + </binding> + +<service name="AllTest"> + <documentation>These operations implement DOC/LIT SOAP operations, for interop testing. Please email johnko@microsoft.com with any questions/coments.</documentation> + <port name="AllTestSoap" binding="s0:AllTestSoap"> + <soap:address location="http://localhost:90/axis/All" /> + </port> + <port name="AllTestSoap12" binding="s0:AllTestSoap12"> + <soap12:address location="http://localhost:90/axis/All" /> + </port> + </service> +</definitions>
\ No newline at end of file diff --git a/axiom/test/resources/wsdl/ManyTypeRefRoot.wsdl b/axiom/test/resources/wsdl/ManyTypeRefRoot.wsdl new file mode 100644 index 0000000..13dec3d --- /dev/null +++ b/axiom/test/resources/wsdl/ManyTypeRefRoot.wsdl @@ -0,0 +1,89 @@ +<?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. --> + +<definitions + targetNamespace="http://manytyperefroot.test.apache.org" + xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:tns="http://manytyperefroot.test.apache.org" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + targetNamespace="http://manytyperefroot.test.apache.org" + xmlns:tns="http://manytyperefroot.test.apache.org"> + + <xsd:element name="getInput"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="types" maxOccurs="unbounded" minOccurs="0" type="tns:Type1"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:element name="getInputResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="Type1" maxOccurs="unbounded" minOccurs="0" type="tns:Type1"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="Type1"> + <xsd:sequence> + <xsd:element name="kind" minOccurs="0" type="xsd:string"/> + <xsd:element name="index" minOccurs="0" type="xsd:int"/> + </xsd:sequence> + </xsd:complexType> + + </xsd:schema> + </types> + + + <message name="input"> + <part name="parameters" element="tns:getInput" /> + </message> + + <message name="output"> + <part name="parameters" element="tns:getInputResponse" /> + </message> + + <portType name="ManyTypeRefRoot"> + <operation name="getInput"> + <input message="tns:input" /> + <output message="tns:output" /> + </operation> + </portType> + + <binding name="ManyTypeRefRootBinding" type="tns:ManyTypeRefRoot"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> + <operation name="getInput"> + <soap:operation/> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + </binding> + + <service name="ManyTypeRefRootService"> + <port name="sampleWS" binding="tns:ManyTypeRefRootBinding"> + <soap:address location="http://localhost:9080/ManyTypeRefRoot/services/sampleWS" /> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/MathOps.wsdl b/axiom/test/resources/wsdl/MathOps.wsdl new file mode 100644 index 0000000..f7f810f --- /dev/null +++ b/axiom/test/resources/wsdl/MathOps.wsdl @@ -0,0 +1,71 @@ +<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://soapinterop.org/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" targetNamespace="http://soapinterop.org/wsdl"> +<!-- Copyright 2003-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. --> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://soapinterop.org/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://soapinterop.org/types"> + <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="DivByZeroStruct"> + <sequence> + <element name="varString" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="varFloat" type="xsd:float"/> + </sequence> + </complexType> + </schema> + </types> + <message name="DivByZeroFault"> + <part name="faultstruct1" type="ns2:DivByZeroStruct"/> + </message> + <message name="divRequest"> + <part name="int0" type="xsd:int"/> + <part name="int1" type="xsd:int"/> + </message> + <message name="divResponse"> + <part name="addReturn" type="xsd:int"/> + </message> + <portType name="MathOps"> + <operation name="div" parameterOrder ="int0 int1"> + <input message="tns:divRequest"/> + <output message="tns:divResponse"/> + <fault name="DivByZero" message="tns:DivByZeroFault"/> + </operation> + </portType> + <binding name="MathOpsBinding" type="tns:MathOps"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="div"> + <soap:operation soapAction="MathOps#div"/> + <input name="divRequest"> + <soap:body + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/MathOps" + use="encoded"/> + </input> + <output name="divResponse"> + <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://localhost/axis/MathOps" + use="encoded"/> + </output> + <fault name="DivByZero"> + <soap:fault name="DivByZero" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soapinterop.org/wsdl"/> + </fault> + </operation> + </binding> + <service name="MathOpsService"> + <port name="MathOps" binding="tns:MathOpsBinding"> + <soap:address location="http://localhost/axis/MathOps"/> + </port> + </service> + <!-- Fault messages --> +</definitions> diff --git a/axiom/test/resources/wsdl/MathOpsDoc.wsdl b/axiom/test/resources/wsdl/MathOpsDoc.wsdl new file mode 100644 index 0000000..e85ae96 --- /dev/null +++ b/axiom/test/resources/wsdl/MathOpsDoc.wsdl @@ -0,0 +1,118 @@ +<?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://soapinterop.org" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org" xmlns:intf="http://soapinterop.org" 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://soapinterop.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org" xmlns:intf="http://soapinterop.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <element name="div"> + <complexType> + <sequence> + <element name="arg_0_0" type="xsd:int"/> + <element name="arg_1_0" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="divResponse"> + <complexType> + <sequence> + <element name="divReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + <complexType name="DivByZeroStruct"> + <sequence> + <element name="varString" nillable="true" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="varFloat" type="xsd:float"/> + </sequence> + </complexType> + <element name="DivByZeroStruct" nillable="true" type="impl:DivByZeroStruct"/> + </schema> + </wsdl:types> + + <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="DivByZeroStruct"> + + <wsdl:part element="impl:DivByZeroStruct" name="fault"/> + + </wsdl:message> + + <wsdl:portType name="MathOps"> + + <wsdl:operation name="div"> + + <wsdl:input message="impl:divRequest" name="divRequest"/> + + <wsdl:output message="impl:divResponse" name="divResponse"/> + + <wsdl:fault message="impl:DivByZeroStruct" name="DivByZeroStruct"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="MathOpsSoapBinding" type="impl:MathOps"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="div"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="divRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="divResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + <wsdl:fault name="DivByZeroStruct"> + + <wsdlsoap:fault name="DivByZeroStruct" use="literal"/> + + </wsdl:fault> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="MathOpsService"> + + <wsdl:port binding="impl:MathOpsSoapBinding" name="MathOps"> + + <wsdlsoap:address location="http://localhost/axis/MathOps"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/MinOccurTest.wsdl b/axiom/test/resources/wsdl/MinOccurTest.wsdl new file mode 100644 index 0000000..2fe8308 --- /dev/null +++ b/axiom/test/resources/wsdl/MinOccurTest.wsdl @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="utf-8"?> +<definitions xmlns:s1="http://soapinterop.org/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://soapinterop.org/" xmlns:s3="http://soapinterop.org/echoheader/" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://soapinterop.org" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/"> + <s:import namespace="http://soapinterop.org/xsd" /> + <s:import namespace="http://soapinterop.org/echoheader/" /> + + + + <s:element name="echoAll"> + <s:complexType> + <s:sequence> + <s:element name="inputAll" type="s1:AllComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="echoAllResponse"> + <s:complexType> + <s:sequence> + <s:element name="return" type="s1:AllComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + + + + </s:schema> + + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd"> + <s:import namespace="http://soapinterop.org/" /> + + <s:complexType name="AllComplexType"> + <s:sequence> + <s:element minOccurs="1" maxOccurs="1" name="Value0" type="s:int" /> + <s:element name="Value1" type="s:int" /> + <s:element minOccurs="0" name="Value2" type="s:int" /> + <s:element minOccurs="0" name="Value3" type="s:string" nillable="true" /> + <s:element minOccurs="0" name="Value4" type="s:int" nillable="true" /> + <s:element minOccurs="0" name="Value5" type="s:string" /> + <s:element minOccurs="1" maxOccurs="1" name="Value6" type="s:string" /> + </s:sequence> + </s:complexType> + </s:schema> + + </types> + + + + <message name="echoAllSoapIn"> + <part name="parameters" element="s0:echoAll" /> + </message> + <message name="echoAllSoapOut"> + <part name="parameters" element="s0:echoAllResponse" /> + </message> + + <portType name="AllTestSoap"> + + + <operation name="echoAll"> + <input message="s0:echoAllSoapIn" /> + <output message="s0:echoAllSoapOut" /> + </operation> + + </portType> + + + <binding name="AllTestSoap" type="s0:AllTestSoap"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + <operation name="echoAll"> + <soap:operation soapAction="SimpleAllTest#echoAll" style="document" /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + + </binding> + +<binding name="AllTestSoap12" type="s0:AllTestSoap"> + <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + + <operation name="echoAll"> + <soap12:operation soapAction="All#echoAll" style="document" /> + <input> + <soap12:body use="literal" /> + </input> + <output> + <soap12:body use="literal" /> + </output> + </operation> + + </binding> + +<service name="AllTest"> + <documentation>These operations implement DOC/LIT SOAP operations, for interop testing. Please email johnko@microsoft.com with any questions/coments.</documentation> + <port name="AllTestSoap" binding="s0:AllTestSoap"> + <soap:address location="http://localhost:90/axis/All" /> + </port> + <port name="AllTestSoap12" binding="s0:AllTestSoap12"> + <soap12:address location="http://localhost:90/axis/All" /> + </port> + </service> +</definitions>
\ No newline at end of file diff --git a/axiom/test/resources/wsdl/MultiOut.wsdl b/axiom/test/resources/wsdl/MultiOut.wsdl new file mode 100644 index 0000000..9590b29 --- /dev/null +++ b/axiom/test/resources/wsdl/MultiOut.wsdl @@ -0,0 +1,139 @@ +<?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/MultiOut" + xmlns:apachesoap="http://xml.apache.org/xml-soap" + xmlns:impl="http://localhost/axis/MultiOut" + xmlns:intf="http://localhost/axis/MultiOut" + 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/MultiOut" + xmlns="http://www.w3.org/2001/XMLSchema" + xmlns:apachesoap="http://xml.apache.org/xml-soap" + xmlns:impl="http://localhost/axis/MultiOut" + xmlns:intf="http://localhost/axis/MultiOut" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <element name="get0"> + <complexType> + <sequence> + </sequence> + </complexType> + </element> + + <element name="get"> + <complexType> + <sequence> + <element name="out1" type="xsd:string"/> + <element nillable="true" name="out14" type="xsd:integer"/> + <element name="out15" type="xsd:int"/> + <element name="out16" type="xsd:long"/> + <element name="out17" type="xsd:short"/> + <element name="out18" type="xsd:decimal"/> + <element name="out19" type="xsd:float"/> + <element name="out20" type="xsd:double"/> + <element name="out21" type="xsd:boolean"/> + <element name="out22" type="xsd:byte"/> + +<!-- + <element name="out1" type="xsd:string"/> + <element name="out2" type="xsd:normalizedString"/> + <element name="out3" type="xsd:token"/> + <element name="out4" type="xsd:language"/> + <element name="out5" type="xsd:Name"/> + <element name="out6" type="xsd:NCName"/> + <element name="out7" type="xsd:ID"/> + <element name="out8" type="xsd:IDREF"/> + <element name="out9" type="xsd:IDREFS"/> + <element name="out10" type="xsd:ENTITY"/> + <element name="out11" type="xsd:ENTITIES"/> + <element name="out12" type="xsd:NMTOKEN"/> + <element name="out13" type="xsd:NMTOKENS"/> + <element name="out14" type="xsd:integer"/> + <element name="out15" type="xsd:int"/> + <element name="out16" type="xsd:long"/> + <element name="out17" type="xsd:short"/> + <element name="out18" type="xsd:decimal"/> + <element name="out19" type="xsd:float"/> + <element name="out20" type="xsd:double"/> + <element name="out21" type="xsd:boolean"/> + <element name="out22" type="xsd:byte"/> + <element name="out23" type="xsd:QName"/> + <element name="out24" type="xsd:NOTATION"/> + <element name="out25" type="xsd:dateTime"/> + <element name="out26" type="xsd:date"/> + <element name="out27" type="xsd:time"/> + <element name="out28" type="xsd:gYearMonth"/> + <element name="out29" type="xsd:gYear"/> + <element name="out30" type="xsd:gMonthDay"/> + <element name="out31" type="xsd:gDay"/> + <element name="out32" type="xsd:gMonth"/> + <element name="out33" type="xsd:duration"/> + <element name="out34" type="xsd:nonNegativeInteger"/> + <element name="out35" type="xsd:unsignedByte"/> + <element name="out36" type="xsd:unsignedInt"/> + <element name="out37" type="xsd:unsignedLong"/> + <element name="out38" type="xsd:unsignedShort"/> + <element name="out39" type="xsd:nonPositiveInteger"/> + <element name="out40" type="xsd:positiveInteger"/> + <element name="out41" type="xsd:negativeInteger"/> + <element name="out42" type="xsd:base64Binary"/> + <element name="out43" type="xsd:hexBinary"/> + <element name="out44" type="xsd:anyURI"/> +--> + + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="get0"> + <wsdl:part element="impl:get0" name="parameters"/> + </wsdl:message> + <wsdl:message name="get"> + <wsdl:part element="impl:get" name="parameters"/> + </wsdl:message> + + <wsdl:portType name="MultiOut"> + <wsdl:operation name="get"> + <wsdl:input message="impl:get0" name="get0"/> + <wsdl:output message="impl:get" name="get"/> + </wsdl:operation> + </wsdl:portType> + + <wsdl:binding name="MultiOutSoapBinding" type="impl:MultiOut"> + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="get"> + <wsdlsoap:operation soapAction="MultiOut#get"/> + <wsdl:input name="get0"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="get"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + + <wsdl:service name="MultiOut"> + <wsdl:port binding="impl:MultiOutSoapBinding" name="MultiOut"> + <wsdlsoap:address location="http://localhost/axis/MultiOut"/> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/NestedArrays.wsdl b/axiom/test/resources/wsdl/NestedArrays.wsdl new file mode 100644 index 0000000..17760b7 --- /dev/null +++ b/axiom/test/resources/wsdl/NestedArrays.wsdl @@ -0,0 +1,105 @@ +<?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://complexissues.test.apache.org" xmlns:impl="http://complexissues.test.apache.org" xmlns:intf="http://complexissues.test.apache.org" 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://complexissues.test.apache.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://complexissues.test.apache.org" xmlns:intf="http://complexissues.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <complexType name="ArrayOfArrayOf_xsd_int"> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true" type="impl:ArrayOf_xsd_int"/> + </sequence> + </complexType> + <complexType name="ArrayOf_xsd_int"> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true" type="xsd:int"/> + </sequence> + </complexType> + <element name="sendNestedArrays"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="arg_0_0" type="impl:ArrayOfArrayOf_xsd_int"/> + </sequence> + </complexType> + </element> + <element name="sendNestedArraysResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="sendNestedArraysReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="sendNestedArraysResponse"> + + <wsdl:part element="impl:sendNestedArraysResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="sendNestedArraysRequest"> + + <wsdl:part element="impl:sendNestedArrays" name="parameters"/> + + </wsdl:message> + + <wsdl:portType name="NestedArrays"> + + <wsdl:operation name="sendNestedArrays"> + + <wsdl:input message="impl:sendNestedArraysRequest" name="sendNestedArraysRequest"/> + + <wsdl:output message="impl:sendNestedArraysResponse" name="sendNestedArraysResponse"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="NestedArraysSoapBinding" type="impl:NestedArrays"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="sendNestedArrays"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="sendNestedArraysRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="sendNestedArraysResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="NestedArraysService"> + + <wsdl:port binding="impl:NestedArraysSoapBinding" name="NestedArrays"> + + <wsdlsoap:address location="http://lion:9080/NestedArrays/services/NestedArrays"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/NestedComplex.wsdl b/axiom/test/resources/wsdl/NestedComplex.wsdl new file mode 100644 index 0000000..6384ce1 --- /dev/null +++ b/axiom/test/resources/wsdl/NestedComplex.wsdl @@ -0,0 +1,130 @@ +<?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://nestedcomplex.test.apache.org" xmlns:impl="http://nestedcomplex.test.apache.org" xmlns:intf="http://nestedcomplex.test.apache.org" 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://nestedcomplex.test.apache.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://nestedcomplex.test.apache.org" xmlns:intf="http://nestedcomplex.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <complexType name="ComplexType2"> + <sequence> + <element maxOccurs="unbounded" name="complexType1Array" nillable="true" type="impl:ComplexType1"/> + </sequence> + </complexType> + <complexType name="ComplexType1"> + <sequence> + <element name="simpleArrays" nillable="true" type="impl:SimpleArrays"/> + <element name="ct1_string" nillable="true" type="xsd:string"/> + <element name="ct1_int" type="xsd:int"/> + </sequence> + </complexType> + <complexType name="SimpleArrays"> + <sequence> + <element maxOccurs="unbounded" name="intArray" type="xsd:int"/> + <element maxOccurs="unbounded" name="stringArray" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + <element name="echoNestedComplex"> + <complexType> + <sequence> + <element name="arg_0_0" nillable="true" type="impl:ComplexType2"/> + </sequence> + </complexType> + </element> + <element name="echoNestedComplexResponse"> + <complexType> + <sequence> + <element name="echoNestedComplexReturn" nillable="true" type="impl:ComplexType2"/> + </sequence> + </complexType> + </element> + <element name="echoNestedComplexArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="arg_0_1" type="impl:ComplexType1"/> + </sequence> + </complexType> + </element> + <element name="echoNestedComplexArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="echoNestedComplexArrayReturn" type="impl:ComplexType1"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="echoNestedComplexArrayResponse"> + <wsdl:part element="impl:echoNestedComplexArrayResponse" name="parameters"/> + </wsdl:message> + + <wsdl:message name="echoNestedComplexArrayRequest"> + <wsdl:part element="impl:echoNestedComplexArray" name="parameters"/> + </wsdl:message> + + <wsdl:message name="echoNestedComplexResponse"> + <wsdl:part element="impl:echoNestedComplexResponse" name="parameters"/> + </wsdl:message> + + <wsdl:message name="echoNestedComplexRequest"> + <wsdl:part element="impl:echoNestedComplex" name="parameters"/> + </wsdl:message> + + <wsdl:portType name="NestedComplex"> + <wsdl:operation name="echoNestedComplex"> + <wsdl:input message="impl:echoNestedComplexRequest" name="echoNestedComplexRequest"/> + <wsdl:output message="impl:echoNestedComplexResponse" name="echoNestedComplexResponse"/> + </wsdl:operation> + + <wsdl:operation name="echoNestedComplexArray"> + <wsdl:input message="impl:echoNestedComplexArrayRequest" name="echoNestedComplexArrayRequest"/> + <wsdl:output message="impl:echoNestedComplexArrayResponse" name="echoNestedComplexArrayResponse"/> + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="NestedComplexSoapBinding" type="impl:NestedComplex"> + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="echoNestedComplex"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoNestedComplexRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoNestedComplexResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <wsdl:operation name="echoNestedComplexArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoNestedComplexArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoNestedComplexArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="NestedComplexService"> + <wsdl:port binding="impl:NestedComplexSoapBinding" name="NestedComplex"> + <wsdlsoap:address location="http://tiger:7001/NestedComplex/services/NestedComplex"/> + </wsdl:port> + </wsdl:service> + +</wsdl:definitions> + diff --git a/axiom/test/resources/wsdl/NillableArrays.wsdl b/axiom/test/resources/wsdl/NillableArrays.wsdl new file mode 100644 index 0000000..42028f0 --- /dev/null +++ b/axiom/test/resources/wsdl/NillableArrays.wsdl @@ -0,0 +1,266 @@ +<?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://arrays.test.apache.org" xmlns:impl="http://arrays.test.apache.org" xmlns:intf="http://arrays.test.apache.org" 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://arrays.test.apache.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://arrays.test.apache.org" xmlns:intf="http://arrays.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <element name="echoBooleanArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_0" type="xsd:boolean"/> + </sequence> + </complexType> + </element> + <element name="echoBooleanArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="echoBooleanArrayReturn" type="xsd:boolean"/> + </sequence> + </complexType> + </element> + <element name="echoShortArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_2" type="xsd:short"/> + </sequence> + </complexType> + </element> + <element name="echoShortArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="echoShortArrayReturn" type="xsd:short"/> + </sequence> + </complexType> + </element> + <element name="echoIntArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_3" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="echoIntArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="echoIntArrayReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="echoLongArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_4" type="xsd:long"/> + </sequence> + </complexType> + </element> + <element name="echoLongArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="echoLongArrayReturn" type="xsd:long"/> + </sequence> + </complexType> + </element> + <element name="echoFloatArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_5" type="xsd:float"/> + </sequence> + </complexType> + </element> + <element name="echoFloatArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="echoFloatArrayReturn" type="xsd:float"/> + </sequence> + </complexType> + </element> + <element name="echoDoubleArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_6" type="xsd:double"/> + </sequence> + </complexType> + </element> + <element name="echoDoubleArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="echoDoubleArrayReturn" type="xsd:double"/> + </sequence> + </complexType> + </element> + <element name="echoStringArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="arg_0_7" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="echoStringArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" nillable="true" name="echoStringArrayReturn" type="xsd:string"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + <wsdl:message name="echoDoubleArrayRequest"> + <wsdl:part element="impl:echoDoubleArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoIntArrayResponse"> + <wsdl:part element="impl:echoIntArrayResponse" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoShortArrayRequest"> + <wsdl:part element="impl:echoShortArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoShortArrayResponse"> + <wsdl:part element="impl:echoShortArrayResponse" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoIntArrayRequest"> + <wsdl:part element="impl:echoIntArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoDoubleArrayResponse"> + <wsdl:part element="impl:echoDoubleArrayResponse" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoBooleanArrayResponse"> + <wsdl:part element="impl:echoBooleanArrayResponse" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoBooleanArrayRequest"> + <wsdl:part element="impl:echoBooleanArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoLongArrayRequest"> + <wsdl:part element="impl:echoLongArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoFloatArrayRequest"> + <wsdl:part element="impl:echoFloatArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoStringArrayRequest"> + <wsdl:part element="impl:echoStringArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoLongArrayResponse"> + <wsdl:part element="impl:echoLongArrayResponse" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoStringArrayResponse"> + <wsdl:part element="impl:echoStringArrayResponse" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoFloatArrayResponse"> + <wsdl:part element="impl:echoFloatArrayResponse" name="parameters"/> + </wsdl:message> + + <wsdl:portType name="NillableArrays"> + <wsdl:operation name="echoBooleanArray"> + <wsdl:input message="impl:echoBooleanArrayRequest" name="echoBooleanArrayRequest"/> + <wsdl:output message="impl:echoBooleanArrayResponse" name="echoBooleanArrayResponse"/> + </wsdl:operation> + <wsdl:operation name="echoShortArray"> + <wsdl:input message="impl:echoShortArrayRequest" name="echoShortArrayRequest"/> + <wsdl:output message="impl:echoShortArrayResponse" name="echoShortArrayResponse"/> + </wsdl:operation> + <wsdl:operation name="echoIntArray"> + <wsdl:input message="impl:echoIntArrayRequest" name="echoIntArrayRequest"/> + <wsdl:output message="impl:echoIntArrayResponse" name="echoIntArrayResponse"/> + </wsdl:operation> + <wsdl:operation name="echoLongArray"> + <wsdl:input message="impl:echoLongArrayRequest" name="echoLongArrayRequest"/> + <wsdl:output message="impl:echoLongArrayResponse" name="echoLongArrayResponse"/> + </wsdl:operation> + <wsdl:operation name="echoFloatArray"> + <wsdl:input message="impl:echoFloatArrayRequest" name="echoFloatArrayRequest"/> + <wsdl:output message="impl:echoFloatArrayResponse" name="echoFloatArrayResponse"/> + </wsdl:operation> + <wsdl:operation name="echoDoubleArray"> + <wsdl:input message="impl:echoDoubleArrayRequest" name="echoDoubleArrayRequest"/> + <wsdl:output message="impl:echoDoubleArrayResponse" name="echoDoubleArrayResponse"/> + </wsdl:operation> + <wsdl:operation name="echoStringArray"> + <wsdl:input message="impl:echoStringArrayRequest" name="echoStringArrayRequest"/> + <wsdl:output message="impl:echoStringArrayResponse" name="echoStringArrayResponse"/> + </wsdl:operation> + </wsdl:portType> + + <wsdl:binding name="NillableArraysSoapBinding" type="impl:NillableArrays"> + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="echoBooleanArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoBooleanArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoBooleanArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="echoShortArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoShortArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoShortArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="echoIntArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoIntArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoIntArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="echoLongArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoLongArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoLongArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="echoFloatArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoFloatArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoFloatArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="echoDoubleArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoDoubleArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoDoubleArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="echoStringArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoStringArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoStringArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + + <wsdl:service name="NillableArraysService"> + <wsdl:port binding="impl:NillableArraysSoapBinding" name="NillableArraysPort"> + <wsdlsoap:address location="http://lion:9080/NillableArrays/services/NillableArraysPort"/> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/OtherFaultException.wsdl b/axiom/test/resources/wsdl/OtherFaultException.wsdl new file mode 100644 index 0000000..56b66d1 --- /dev/null +++ b/axiom/test/resources/wsdl/OtherFaultException.wsdl @@ -0,0 +1,97 @@ +<?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://soapinterop.org/wsdl" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org/wsdl" xmlns:intf="http://soapinterop.org/wsdl" 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://soapinterop.org/wsdl" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org/wsdl" xmlns:intf="http://soapinterop.org/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <element name="div"> + <complexType> + <sequence> + <element name="arg_0_0" type="xsd:int"/> + <element name="arg_1_0" 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="divRequest"> + + <wsdl:part element="impl:div" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="divResponse"> + + <wsdl:part element="impl:divResponse" name="parameters"/> + + </wsdl:message> + + + <wsdl:portType name="MathOps"> + + <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="MathOpsSoapBinding" type="impl:MathOps"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="div"> + + <wsdlsoap:operation soapAction=""/> + + <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="MathOpsService"> + + <wsdl:port binding="impl:MathOpsSoapBinding" name="MathOps"> + + <wsdlsoap:address location="http://localhost/axis/MathOps"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/PlainTextAttachment.wsdl b/axiom/test/resources/wsdl/PlainTextAttachment.wsdl new file mode 100644 index 0000000..d0a9c8d --- /dev/null +++ b/axiom/test/resources/wsdl/PlainTextAttachment.wsdl @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions targetNamespace="http://PlainTextAttachment" + xmlns:impl="http://PlainTextAttachment" + xmlns:intf="http://PlainTextAttachment" + xmlns:tns2="http://xml.apache.org/xml-soap" + 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://PlainTextAttachment" + xmlns="http://www.w3.org/2001/XMLSchema" + xmlns:impl="http://PlainTextAttachment" + xmlns:intf="http://PlainTextAttachment" + xmlns:tns2="http://xml.apache.org/xml-soap" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <import namespace="http://xml.apache.org/xml-soap"/> + <element name="echoText"> + <complexType> + <sequence> + <element name="arg2" nillable="true" type="tns2:PlainText"/> + </sequence> + </complexType> + </element> + <element name="echoTextResponse"> + <complexType> + <sequence> + <element name="echoTextReturn" type="xsd:string"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="echoTextRequest"> + <wsdl:part element="impl:echoText" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoTextResponse"> + <wsdl:part element="impl:echoTextResponse" name="parameters"/> + </wsdl:message> + + <wsdl:portType name="AttachmentBindingImpl"> + <wsdl:operation name="echoText"> + <wsdl:input message="impl:echoTextRequest" name="echoTextRequest"/> + <wsdl:output message="impl:echoTextResponse" name="echoTextResponse"/> + </wsdl:operation> + </wsdl:portType> + + <wsdl:binding name="PlainTextAttachmentSoapBinding" type="impl:AttachmentBindingImpl"> + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="echoText"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoTextRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoTextResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + + <wsdl:service name="AttachmentBindingImplService"> + <wsdl:port binding="impl:PlainTextAttachmentSoapBinding" name="PlainTextAttachment"> + <wsdlsoap:address location="http://localhost:9080/PlainTextAttachment/services/PlainTextAttachment"/> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/PrimitiveAndArray.wsdl b/axiom/test/resources/wsdl/PrimitiveAndArray.wsdl new file mode 100644 index 0000000..083cbca --- /dev/null +++ b/axiom/test/resources/wsdl/PrimitiveAndArray.wsdl @@ -0,0 +1,155 @@ +<?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://complexissues.test.apache.org" xmlns:impl="http://complexissues.test.apache.org" xmlns:intf="http://complexissues.test.apache.org" 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://complexissues.test.apache.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://complexissues.test.apache.org" xmlns:intf="http://complexissues.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <element name="sendPrimitiveAndArray"> + <complexType> + <sequence> + <element name="arg_0_0" type="xsd:int"/> + <element maxOccurs="unbounded" minOccurs="0" name="arg_1_0" type="xsd:int"/> + </sequence> + </complexType> + </element> + <complexType name="ComplexReturn"> + <sequence> + <element name="returnInt" type="xsd:int"/> + <element maxOccurs="unbounded" name="returnArray" type="xsd:int"/> + </sequence> + </complexType> + <element name="sendPrimitiveAndArrayResponse"> + <complexType> + <sequence> + <element name="sendPrimitiveAndArrayReturn" nillable="true" type="impl:ComplexReturn"/> + </sequence> + </complexType> + </element> + <element name="sendArrayAndPrimitive"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="arg_0_1" type="xsd:int"/> + <element name="arg_1_1" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="sendArrayAndPrimitiveResponse"> + <complexType> + <sequence> + <element name="sendArrayAndPrimitiveReturn" nillable="true" type="impl:ComplexReturn"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="sendPrimitiveAndArrayResponse"> + + <wsdl:part element="impl:sendPrimitiveAndArrayResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="sendPrimitiveAndArrayRequest"> + + <wsdl:part element="impl:sendPrimitiveAndArray" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="sendArrayAndPrimitiveResponse"> + + <wsdl:part element="impl:sendArrayAndPrimitiveResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="sendArrayAndPrimitiveRequest"> + + <wsdl:part element="impl:sendArrayAndPrimitive" name="parameters"/> + + </wsdl:message> + + <wsdl:portType name="PrimitiveAndArray"> + + <wsdl:operation name="sendPrimitiveAndArray"> + + <wsdl:input message="impl:sendPrimitiveAndArrayRequest" name="sendPrimitiveAndArrayRequest"/> + + <wsdl:output message="impl:sendPrimitiveAndArrayResponse" name="sendPrimitiveAndArrayResponse"/> + + </wsdl:operation> + + <wsdl:operation name="sendArrayAndPrimitive"> + + <wsdl:input message="impl:sendArrayAndPrimitiveRequest" name="sendArrayAndPrimitiveRequest"/> + + <wsdl:output message="impl:sendArrayAndPrimitiveResponse" name="sendArrayAndPrimitiveResponse"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="PrimitiveAndArraySoapBinding" type="impl:PrimitiveAndArray"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="sendPrimitiveAndArray"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="sendPrimitiveAndArrayRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="sendPrimitiveAndArrayResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="sendArrayAndPrimitive"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="sendArrayAndPrimitiveRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="sendArrayAndPrimitiveResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="PrimitiveAndArrayService"> + + <wsdl:port binding="impl:PrimitiveAndArraySoapBinding" name="PrimitiveAndArray"> + + <wsdlsoap:address location="http://lion:9080/PrimitiveAndArray/services/PrimitiveAndArray"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/RPCAllTest.wsdl b/axiom/test/resources/wsdl/RPCAllTest.wsdl new file mode 100644 index 0000000..1a86d52 --- /dev/null +++ b/axiom/test/resources/wsdl/RPCAllTest.wsdl @@ -0,0 +1,101 @@ +<?xml version="1.0"?> + +<!-- WSDL description of the MAST ADEC TWIG api. --> + +<definitions name="urn:ADEC_MAST" + targetNamespace="urn:ADEC_MAST" + xmlns:typens="urn:ADEC_MAST" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns="http://schemas.xmlsoap.org/wsdl/"> + + <!-- Types for search - result elements, directory categories --> + + <types> + <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ADEC_MAST"> + + <xsd:complexType name="SummaryResult"> + <xsd:sequence> + <xsd:element minOccurs="1" maxOccurs="1" name="NonAllIntValue" type="xsd:int" /> + <xsd:element minOccurs="1" maxOccurs="1" name="NonAllDoubleValue" type="xsd:double" /> + </xsd:sequence> + <xsd:all> + <xsd:element name="length" type="xsd:int"/> + <xsd:element minOccurs="0" name="width" type="xsd:int"/> + <xsd:element minOccurs="0" name="depth" type="xsd:double"/> + <xsd:element minOccurs="0" name="color" type="xsd:string"/> + </xsd:all> + <xsd:sequence> + <xsd:element minOccurs="1" maxOccurs="1" name="NonAllStringValue" type="xsd:string" /> + </xsd:sequence> + </xsd:complexType> + + <xsd:complexType name="SummaryResultArray"> + <xsd:complexContent> + <xsd:restriction base="soapenc:Array"> + <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:SummaryResult[]"/> + </xsd:restriction> + </xsd:complexContent> + + </xsd:complexType> + + </xsd:schema> + </types> + + <!-- Messages for ADEC MAST Web APIs - get summary by position. --> + + <message name="doGetSummary"> + <part name="length" type="xsd:int"/> + <part name="width" type="xsd:int"/> + <part name="depth" type="xsd:double"/> + <part name="color" type="xsd:string"/> + </message> + + <message name="doGetSummaryResponse"> + <part name="return" type="typens:SummaryResult"/> + </message> + + <!-- Port for ADEC MAST Web APIs, "ADEC_MAST" --> + + <portType name="ADEC_MAST_Port"> + + <operation name="doGetSummary"> + <input message="typens:doGetSummary"/> + <output message="typens:doGetSummaryResponse"/> + </operation> + + </portType> + + + <!-- Binding for ADEC MAST Web APIs - RPC, SOAP over HTTP --> + + <binding name="ADEC_MAST_Binding" type="typens:ADEC_MAST_Port"> + <soap:binding style="rpc" + transport="http://schemas.xmlsoap.org/soap/http"/> + + <operation name="doGetSummary"> + <soap:operation soapAction="urn:ADEC_MAST#doGetSummary"/> + <input> + <soap:body use="encoded" + namespace="urn:ADEC_MAST" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" + namespace="urn:ADEC_MAST" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + + </binding> + + <!-- Endpoint for ADEC MAST Web APIs --> + <service name="ADEC_MAST_Service"> + <port name="ADEC_MAST_Port" binding="typens:ADEC_MAST_Binding"> + <soap:address location="http://faxafloi.stsci.edu:4547/soap/"/> + </port> + </service> + +</definitions> diff --git a/axiom/test/resources/wsdl/RecurseTypes.wsdl b/axiom/test/resources/wsdl/RecurseTypes.wsdl new file mode 100644 index 0000000..4c3546a --- /dev/null +++ b/axiom/test/resources/wsdl/RecurseTypes.wsdl @@ -0,0 +1,101 @@ +<?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. --> + +<definitions + targetNamespace="http://recursetypes.test.apache.org" + xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:tns="http://recursetypes.test.apache.org" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <xsd:schema elementFormDefault="qualified" + targetNamespace="http://recursetypes.test.apache.org" + xmlns="http://www.w3.org/2001/XMLSchema" + > + <xsd:element name="getInput"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="type" type="tns:Type1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:element name="getInputResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="type" type="tns:Type1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="Type1"> + <xsd:sequence> + <xsd:element name="followings" maxOccurs="unbounded" minOccurs="0" type="tns:Type1" /> + <xsd:element name="kind" type="xsd:string" /> + <xsd:element name="index" type="xsd:int" /> + </xsd:sequence> + <xsd:attribute name="att_kind" type="tns:Kind" /> + </xsd:complexType> + + <xsd:simpleType name="Kind"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="CHEQUE" /> + <xsd:enumeration value="CREDIT_CARD" /> + <xsd:enumeration value="TRANSFER" /> + <xsd:enumeration value="WITHDRAWAL" /> + <xsd:enumeration value="AUTOMATIC" /> + </xsd:restriction> + </xsd:simpleType> + + </xsd:schema> + </types> + + + <message name="input"> + <part name="parameters" element="tns:getInput" /> + </message> + + <message name="output"> + <part name="parameters" element="tns:getInputResponse" /> + </message> + + <portType name="RecurseTypesWS"> + <operation name="getInput"> + <input message="tns:input" /> + <output message="tns:output" /> + </operation> + </portType> + + <binding name="RecurseTypesWSBinding" type="tns:RecurseTypesWS"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> + <operation name="getInput"> + <soap:operation /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + </binding> + + <service name="RecurseTypesWSService"> + <port name="sampleWS" binding="tns:RecurseTypesWSBinding"> + <soap:address location="http://localhost:9080/RecurseTypes/services/sampleWS" /> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcHttpHeaderTest1.wsdl b/axiom/test/resources/wsdl/RpcHttpHeaderTest1.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcHttpHeaderTest1.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcHttpHeaderTest2.wsdl b/axiom/test/resources/wsdl/RpcHttpHeaderTest2.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcHttpHeaderTest2.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcHttpHeaderTest3.wsdl b/axiom/test/resources/wsdl/RpcHttpHeaderTest3.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcHttpHeaderTest3.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcHttpHeaderTest4.wsdl b/axiom/test/resources/wsdl/RpcHttpHeaderTest4.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcHttpHeaderTest4.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcHttpHeaderTest5.wsdl b/axiom/test/resources/wsdl/RpcHttpHeaderTest5.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcHttpHeaderTest5.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcHttpHeaderTest7.wsdl b/axiom/test/resources/wsdl/RpcHttpHeaderTest7.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcHttpHeaderTest7.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcHttpHeaderTest8.wsdl b/axiom/test/resources/wsdl/RpcHttpHeaderTest8.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcHttpHeaderTest8.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcSoapHeaderTest1.wsdl b/axiom/test/resources/wsdl/RpcSoapHeaderTest1.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcSoapHeaderTest1.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcSoapHeaderTest10.wsdl b/axiom/test/resources/wsdl/RpcSoapHeaderTest10.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcSoapHeaderTest10.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcSoapHeaderTest2.wsdl b/axiom/test/resources/wsdl/RpcSoapHeaderTest2.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcSoapHeaderTest2.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcSoapHeaderTest3.wsdl b/axiom/test/resources/wsdl/RpcSoapHeaderTest3.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcSoapHeaderTest3.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcSoapHeaderTest4.wsdl b/axiom/test/resources/wsdl/RpcSoapHeaderTest4.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcSoapHeaderTest4.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcSoapHeaderTest6.wsdl b/axiom/test/resources/wsdl/RpcSoapHeaderTest6.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcSoapHeaderTest6.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcSoapHeaderTest8.wsdl b/axiom/test/resources/wsdl/RpcSoapHeaderTest8.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcSoapHeaderTest8.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/RpcSoapHeaderTest9.wsdl b/axiom/test/resources/wsdl/RpcSoapHeaderTest9.wsdl new file mode 100644 index 0000000..f7d1945 --- /dev/null +++ b/axiom/test/resources/wsdl/RpcSoapHeaderTest9.wsdl @@ -0,0 +1,333 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="ArrayOfstring"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfint"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOffloat"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="ArrayOfSOAPStruct"> + <complexContent> + <restriction base="SOAP-ENC:Array"> + <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/> + </restriction> + </complexContent> + </complexType> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="string"/> + <element name="varInt" type="int"/> + <element name="varFloat" type="float"/> + </all> + </complexType> + </schema> + </types> + + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="s:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="s:ArrayOfstring"/> + </message> + <message name="echoIntegerRequest"> + <part name="inputInteger" type="xsd:int"/> + </message> + <message name="echoIntegerResponse"> + <part name="return" type="xsd:int"/> + </message> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="s:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="s:ArrayOfint"/> + </message> + <message name="echoFloatRequest"> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoFloatResponse"> + <part name="return" type="xsd:float"/> + </message> + <message name="echoFloatArrayRequest"> + <part name="inputFloatArray" type="s:ArrayOffloat"/> + </message> + <message name="echoFloatArrayResponse"> + <part name="return" type="s:ArrayOffloat"/> + </message> + <message name="echoStructRequest"> + <part name="inputStruct" type="s:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="s:SOAPStruct"/> + </message> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="s:ArrayOfSOAPStruct"/> + </message> + <message name="echoVoidRequest"/> + <message name="echoVoidResponse"/> + <message name="echoBase64Request"> + <part name="inputBase64" type="xsd:base64Binary"/> + </message> + <message name="echoBase64Response"> + <part name="return" type="xsd:base64Binary"/> + </message> + <message name="echoDateRequest"> + <part name="inputDate" type="xsd:dateTime"/> + </message> + <message name="echoDateResponse"> + <part name="return" type="xsd:dateTime"/> + </message> + <message name="echoHexBinaryRequest"> + <part name="inputHexBinary" type="xsd:hexBinary"/> + </message> + <message name="echoHexBinaryResponse"> + <part name="return" type="xsd:hexBinary"/> + </message> + <message name="echoDecimalRequest"> + <part name="inputDecimal" type="xsd:decimal"/> + </message> + <message name="echoDecimalResponse"> + <part name="return" type="xsd:decimal"/> + </message> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <portType name="InteropTestPortType"> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + <operation name="echoInteger" parameterOrder="inputInteger"> + <input message="tns:echoIntegerRequest"/> + <output message="tns:echoIntegerResponse"/> + </operation> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + <operation name="echoFloat" parameterOrder="inputFloat"> + <input message="tns:echoFloatRequest"/> + <output message="tns:echoFloatResponse"/> + </operation> + <operation name="echoFloatArray" parameterOrder="inputFloatArray"> + <input message="tns:echoFloatArrayRequest"/> + <output message="tns:echoFloatArrayResponse"/> + </operation> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + <operation name="echoVoid"> + <input message="tns:echoVoidRequest"/> + <output message="tns:echoVoidResponse"/> + </operation> + <operation name="echoBase64" parameterOrder="inputBase64"> + <input message="tns:echoBase64Request"/> + <output message="tns:echoBase64Response"/> + </operation> + <operation name="echoDate" parameterOrder="inputDate"> + <input message="tns:echoDateRequest"/> + <output message="tns:echoDateResponse"/> + </operation> + <operation name="echoHexBinary" parameterOrder="inputHexBinary"> + <input message="tns:echoHexBinaryRequest"/> + <output message="tns:echoHexBinaryResponse"/> + </operation> + <operation name="echoDecimal" parameterOrder="inputDecimal"> + <input message="tns:echoDecimalRequest"/> + <output message="tns:echoDecimalResponse"/> + </operation> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + </portType> + + <binding name="InteropTestSoapBinding" type="tns:InteropTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoString"> + <soap:operation soapAction="InteropBase#echoString"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStringArray"> + <soap:operation soapAction="InteropBase#echoStringArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoInteger"> + <soap:operation soapAction="InteropBase#echoInteger"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoIntegerArray"> + <soap:operation soapAction="InteropBase#echoIntegerArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloat"> + <soap:operation soapAction="InteropBase#echoFloat"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoFloatArray"> + <soap:operation soapAction="InteropBase#echoFloatArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStruct"> + <soap:operation soapAction="InteropBase#echoStruct"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoStructArray"> + <soap:operation soapAction="InteropBase#echoStructArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoVoid"> + <soap:operation soapAction="InteropBase#echoVoid"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBase64"> + <soap:operation soapAction="InteropBase#echoBase64"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDate"> + <soap:operation soapAction="InteropBase#echoDate"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoHexBinary"> + <soap:operation soapAction="InteropBase#echoHexBinary"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoDecimal"> + <soap:operation soapAction="InteropBase#echoDecimal"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="echoBoolean"> + <soap:operation soapAction="InteropBase#echoBoolean"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + <service name="InteropBase"> + <port binding="tns:InteropTestSoapBinding" name="InteropBaseTest"> + <soap:address location="http://localhost/axis/InteropBase"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/SimpleArray.wsdl b/axiom/test/resources/wsdl/SimpleArray.wsdl new file mode 100644 index 0000000..ef42ca1 --- /dev/null +++ b/axiom/test/resources/wsdl/SimpleArray.wsdl @@ -0,0 +1,64 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + + <element name="intItem" type="int" /> + <complexType name="intArrayType"> + <sequence> + <element ref="s:intItem" minOccurs="0" maxOccurs="unbounded" /> + </sequence> + </complexType> + + + </schema> + </types> + <message name="echoIntArrayRequest"> + <part name ="inputIntArrayType" type="s:intArrayType"/> + </message> + <message name="echoIntArrayResponse"> + <part name ="return" type="s:intArrayType"/> + </message> + + <portType name="ArrayTestPortType"> + <operation name="echoIntArray" parameterOrder="inputIntArrayType"> + <input message="tns:echoIntArrayRequest"/> + <output message="tns:echoIntArrayResponse"/> + </operation> + </portType> + + <binding name="ArrayTestSoapBinding" type="tns:ArrayTestPortType"> + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="echoIntArray"> + <soap:operation soapAction="array#echoIntArray"/> + <input> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + + </binding> + <service name="array"> + <port binding="tns:ArrayTestSoapBinding" name="arrayTest"> + <soap:address location="http://localhost/axis/array"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/SimpleArrayDoc.wsdl b/axiom/test/resources/wsdl/SimpleArrayDoc.wsdl new file mode 100644 index 0000000..d079513 --- /dev/null +++ b/axiom/test/resources/wsdl/SimpleArrayDoc.wsdl @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions targetNamespace="http://soapinterop.org" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org" xmlns:intf="http://soapinterop.org" 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://soapinterop.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org" xmlns:intf="http://soapinterop.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <complexType name="intArrayType"> + <sequence> + <element maxOccurs="unbounded" name="intItem" type="xsd:int"/> + </sequence> + </complexType> + <element name="echoIntArray"> + <complexType> + <sequence> + <element name="arg_0_0" nillable="true" type="impl:intArrayType"/> + </sequence> + </complexType> + </element> + <element name="echoIntArrayResponse"> + <complexType> + <sequence> + <element name="echoIntArrayReturn" nillable="true" type="impl:intArrayType"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="echoIntArrayRequest"> + + <wsdl:part element="impl:echoIntArray" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoIntArrayResponse"> + + <wsdl:part element="impl:echoIntArrayResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:portType name="ArrayTestPortType"> + + <wsdl:operation name="echoIntArray"> + + <wsdl:input message="impl:echoIntArrayRequest" name="echoIntArrayRequest"/> + + <wsdl:output message="impl:echoIntArrayResponse" name="echoIntArrayResponse"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="arrayTestSoapBinding" type="impl:ArrayTestPortType"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="echoIntArray"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoIntArrayRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoIntArrayResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="array"> + + <wsdl:port binding="impl:arrayTestSoapBinding" name="arrayTest"> + + <wsdlsoap:address location="http://localhost/axis/array"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/SimpleArrays.wsdl b/axiom/test/resources/wsdl/SimpleArrays.wsdl new file mode 100644 index 0000000..ae60352 --- /dev/null +++ b/axiom/test/resources/wsdl/SimpleArrays.wsdl @@ -0,0 +1,299 @@ +<?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://arrays.test.apache.org" xmlns:impl="http://arrays.test.apache.org" xmlns:intf="http://arrays.test.apache.org" 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://arrays.test.apache.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://arrays.test.apache.org" xmlns:intf="http://arrays.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <element name="echoBooleanArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="arg_0_0" type="xsd:boolean"/> + </sequence> + </complexType> + </element> + <element name="echoBooleanArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="echoBooleanArrayReturn" type="xsd:boolean"/> + </sequence> + </complexType> + </element> + <element name="echoByteArray"> + <complexType> + <sequence> + <element name="arg_0_1" type="xsd:base64Binary"/> + </sequence> + </complexType> + </element> + <element name="echoByteArrayResponse"> + <complexType> + <sequence> + <element name="echoByteArrayReturn" type="xsd:base64Binary"/> + </sequence> + </complexType> + </element> + <element name="echoShortArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="arg_0_2" type="xsd:short"/> + </sequence> + </complexType> + </element> + <element name="echoShortArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="echoShortArrayReturn" type="xsd:short"/> + </sequence> + </complexType> + </element> + <element name="echoIntArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="arg_0_3" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="echoIntArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="echoIntArrayReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="echoLongArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="arg_0_4" type="xsd:long"/> + </sequence> + </complexType> + </element> + <element name="echoLongArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="echoLongArrayReturn" type="xsd:long"/> + </sequence> + </complexType> + </element> + <element name="echoFloatArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="arg_0_5" type="xsd:float"/> + </sequence> + </complexType> + </element> + <element name="echoFloatArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="echoFloatArrayReturn" type="xsd:float"/> + </sequence> + </complexType> + </element> + <element name="echoDoubleArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="arg_0_6" type="xsd:double"/> + </sequence> + </complexType> + </element> + <element name="echoDoubleArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="echoDoubleArrayReturn" type="xsd:double"/> + </sequence> + </complexType> + </element> + <element name="echoStringArray"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="arg_0_7" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="echoStringArrayResponse"> + <complexType> + <sequence> + <element maxOccurs="unbounded" minOccurs="0" name="echoStringArrayReturn" type="xsd:string"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + <wsdl:message name="echoDoubleArrayRequest"> + <wsdl:part element="impl:echoDoubleArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoIntArrayResponse"> + <wsdl:part element="impl:echoIntArrayResponse" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoByteArrayRequest"> + <wsdl:part element="impl:echoByteArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoShortArrayRequest"> + <wsdl:part element="impl:echoShortArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoShortArrayResponse"> + <wsdl:part element="impl:echoShortArrayResponse" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoIntArrayRequest"> + <wsdl:part element="impl:echoIntArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoDoubleArrayResponse"> + <wsdl:part element="impl:echoDoubleArrayResponse" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoBooleanArrayResponse"> + <wsdl:part element="impl:echoBooleanArrayResponse" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoBooleanArrayRequest"> + <wsdl:part element="impl:echoBooleanArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoLongArrayRequest"> + <wsdl:part element="impl:echoLongArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoFloatArrayRequest"> + <wsdl:part element="impl:echoFloatArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoByteArrayResponse"> + <wsdl:part element="impl:echoByteArrayResponse" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoStringArrayRequest"> + <wsdl:part element="impl:echoStringArray" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoLongArrayResponse"> + <wsdl:part element="impl:echoLongArrayResponse" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoStringArrayResponse"> + <wsdl:part element="impl:echoStringArrayResponse" name="parameters"/> + </wsdl:message> + <wsdl:message name="echoFloatArrayResponse"> + <wsdl:part element="impl:echoFloatArrayResponse" name="parameters"/> + </wsdl:message> + + <wsdl:portType name="SimpleArrays"> + <wsdl:operation name="echoBooleanArray"> + <wsdl:input message="impl:echoBooleanArrayRequest" name="echoBooleanArrayRequest"/> + <wsdl:output message="impl:echoBooleanArrayResponse" name="echoBooleanArrayResponse"/> + </wsdl:operation> + <wsdl:operation name="echoByteArray"> + <wsdl:input message="impl:echoByteArrayRequest" name="echoByteArrayRequest"/> + <wsdl:output message="impl:echoByteArrayResponse" name="echoByteArrayResponse"/> + </wsdl:operation> + <wsdl:operation name="echoShortArray"> + <wsdl:input message="impl:echoShortArrayRequest" name="echoShortArrayRequest"/> + <wsdl:output message="impl:echoShortArrayResponse" name="echoShortArrayResponse"/> + </wsdl:operation> + <wsdl:operation name="echoIntArray"> + <wsdl:input message="impl:echoIntArrayRequest" name="echoIntArrayRequest"/> + <wsdl:output message="impl:echoIntArrayResponse" name="echoIntArrayResponse"/> + </wsdl:operation> + <wsdl:operation name="echoLongArray"> + <wsdl:input message="impl:echoLongArrayRequest" name="echoLongArrayRequest"/> + <wsdl:output message="impl:echoLongArrayResponse" name="echoLongArrayResponse"/> + </wsdl:operation> + <wsdl:operation name="echoFloatArray"> + <wsdl:input message="impl:echoFloatArrayRequest" name="echoFloatArrayRequest"/> + <wsdl:output message="impl:echoFloatArrayResponse" name="echoFloatArrayResponse"/> + </wsdl:operation> + <wsdl:operation name="echoDoubleArray"> + <wsdl:input message="impl:echoDoubleArrayRequest" name="echoDoubleArrayRequest"/> + <wsdl:output message="impl:echoDoubleArrayResponse" name="echoDoubleArrayResponse"/> + </wsdl:operation> + <wsdl:operation name="echoStringArray"> + <wsdl:input message="impl:echoStringArrayRequest" name="echoStringArrayRequest"/> + <wsdl:output message="impl:echoStringArrayResponse" name="echoStringArrayResponse"/> + </wsdl:operation> + </wsdl:portType> + + <wsdl:binding name="SimpleArraysSoapBinding" type="impl:SimpleArrays"> + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="echoBooleanArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoBooleanArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoBooleanArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="echoByteArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoByteArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoByteArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="echoShortArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoShortArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoShortArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="echoIntArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoIntArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoIntArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="echoLongArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoLongArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoLongArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="echoFloatArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoFloatArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoFloatArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="echoDoubleArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoDoubleArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoDoubleArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="echoStringArray"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoStringArrayRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="echoStringArrayResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + + <wsdl:service name="SimpleArraysService"> + <wsdl:port binding="impl:SimpleArraysSoapBinding" name="SimpleArraysPort"> + <wsdlsoap:address location="http://lion:9080/SimpleArrays/services/SimpleArraysPort"/> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/SimpleChoice.wsdl b/axiom/test/resources/wsdl/SimpleChoice.wsdl new file mode 100644 index 0000000..b2b357f --- /dev/null +++ b/axiom/test/resources/wsdl/SimpleChoice.wsdl @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8"?> +<definitions xmlns:s1="http://soapinterop.org/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://soapinterop.org/" xmlns:s3="http://soapinterop.org/echoheader/" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://soapinterop.org" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/"> + <s:import namespace="http://soapinterop.org/xsd" /> + <s:import namespace="http://soapinterop.org/echoheader/" /> + + + + <s:element name="echoChoice"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="inputChoice" type="s1:ChoiceComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="echoChoiceResponse"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:ChoiceComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + + + + </s:schema> + + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd"> + <s:import namespace="http://soapinterop.org/" /> + + <s:complexType name="ChoiceComplexType"> + <s:sequence> + <s:choice minOccurs="1" maxOccurs="1"> + <s:element minOccurs="0" maxOccurs="1" name="IntValue" type="s:int" /> + <s:element minOccurs="0" maxOccurs="1" name="StringValue" type="s:string" /> + </s:choice> + </s:sequence> + </s:complexType> + </s:schema> + + </types> + + + + <message name="echoChoiceSoapIn"> + <part name="parameters" element="s0:echoChoice" /> + </message> + <message name="echoChoiceSoapOut"> + <part name="parameters" element="s0:echoChoiceResponse" /> + </message> + + <portType name="ChoiceTestSoap"> + + + <operation name="echoChoice"> + <input message="s0:echoChoiceSoapIn" /> + <output message="s0:echoChoiceSoapOut" /> + </operation> + + </portType> + + + <binding name="ChoiceTestSoap" type="s0:ChoiceTestSoap"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + <operation name="echoChoice"> + <soap:operation soapAction="SimpleChoiceTest#echoChoice" style="document" /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + + </binding> + +<binding name="ChoiceTestSoap12" type="s0:ChoiceTestSoap"> + <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + + <operation name="echoChoice"> + <soap12:operation soapAction="Choice#echoChoice" style="document" /> + <input> + <soap12:body use="literal" /> + </input> + <output> + <soap12:body use="literal" /> + </output> + </operation> + + </binding> + +<service name="ChoiceTest"> + <documentation>These operations implement DOC/LIT SOAP operations, for interop testing. Please email johnko@microsoft.com with any questions/coments.</documentation> + <port name="ChoiceTestSoap" binding="s0:ChoiceTestSoap"> + <soap:address location="http://localhost:90/axis/Choice" /> + </port> + <port name="ChoiceTestSoap12" binding="s0:ChoiceTestSoap12"> + <soap12:address location="http://localhost:90/axis/Choice" /> + </port> + </service> +</definitions>
\ No newline at end of file diff --git a/axiom/test/resources/wsdl/SimpleRef.wsdl b/axiom/test/resources/wsdl/SimpleRef.wsdl new file mode 100644 index 0000000..58e2a99 --- /dev/null +++ b/axiom/test/resources/wsdl/SimpleRef.wsdl @@ -0,0 +1,114 @@ +<?xml version="1.0"?> +<!-- Copyright 2003-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. --> + + +<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + + + <types> + + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd"> + + <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/> + + + + <element name="intItem" type="int" /> + + <complexType name="intType"> + + <sequence> + + <element ref="s:intItem" /> + + </sequence> + + </complexType> + + + + + + </schema> + + </types> + + <message name="echoIntRequest"> + + <part name ="inputIntType" type="s:intType"/> + + </message> + + <message name="echoIntResponse"> + + <part name ="return" type="s:intType"/> + + </message> + + + + <portType name="RefTestPortType"> + + <operation name="echoInt" parameterOrder="inputIntType"> + + <input message="tns:echoIntRequest"/> + + <output message="tns:echoIntResponse"/> + + </operation> + + </portType> + + + + <binding name="RefTestSoapBinding" type="tns:RefTestPortType"> + + <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + + <operation name="echoInt"> + + <soap:operation soapAction="ref#echoInt"/> + + <input> + + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + + </input> + + <output> + + <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + + </output> + + </operation> + + + + </binding> + + <service name="ref"> + + <port binding="tns:RefTestSoapBinding" name="RefTest"> + + <soap:address location="http://localhost/axis/ref"/> + + </port> + + </service> + +</definitions> + diff --git a/axiom/test/resources/wsdl/SimpleRefDoc.wsdl b/axiom/test/resources/wsdl/SimpleRefDoc.wsdl new file mode 100644 index 0000000..543a472 --- /dev/null +++ b/axiom/test/resources/wsdl/SimpleRefDoc.wsdl @@ -0,0 +1,100 @@ +<?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://soapinterop.org" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org" xmlns:intf="http://soapinterop.org" 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://soapinterop.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapinterop.org" xmlns:intf="http://soapinterop.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <complexType name="intType"> + <sequence> + <element name="intItem" type="xsd:int"/> + </sequence> + </complexType> + <element name="echoInt"> + <complexType> + <sequence> + <element name="arg_0_0" nillable="true" type="impl:intType"/> + </sequence> + </complexType> + </element> + <element name="echoIntResponse"> + <complexType> + <sequence> + <element name="echoIntReturn" nillable="true" type="impl:intType"/> + </sequence> + </complexType> + </element> + </schema> + </wsdl:types> + + <wsdl:message name="echoIntRequest"> + + <wsdl:part element="impl:echoInt" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="echoIntResponse"> + + <wsdl:part element="impl:echoIntResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:portType name="RefTestPortType"> + + <wsdl:operation name="echoInt"> + + <wsdl:input message="impl:echoIntRequest" name="echoIntRequest"/> + + <wsdl:output message="impl:echoIntResponse" name="echoIntResponse"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="refSoapBinding" type="impl:RefTestPortType"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="echoInt"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="echoIntRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="echoIntResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="ref"> + + <wsdl:port binding="impl:refSoapBinding" name="RefTest"> + + <wsdlsoap:address location="http://localhost/axis/ref"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/SimpleTypeArray.wsdl b/axiom/test/resources/wsdl/SimpleTypeArray.wsdl new file mode 100644 index 0000000..410ec86 --- /dev/null +++ b/axiom/test/resources/wsdl/SimpleTypeArray.wsdl @@ -0,0 +1,75 @@ +<?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. --> + +<definitions targetNamespace="http://simpletypearray.test.apache.org" xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://simpletypearray.test.apache.org" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <xsd:schema targetNamespace="http://simpletypearray.test.apache.org" xmlns:tns="http://simpletypearray.test.apache.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + + <xsd:element name="getInput"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="input" type="tns:Type"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="Type"> + <xsd:sequence> + <xsd:element maxOccurs="unbounded" minOccurs="0" name="item" type="xsd:int"/> + </xsd:sequence> + </xsd:complexType> + + + <xsd:element name="getInputResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="input" type="tns:Type"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + </xsd:schema> + </types> + <message name="output"> + <part name="parameters" element="tns:getInputResponse"/> + </message> + <message name="input"> + <part name="parameters" element="tns:getInput"/> + </message> + <portType name="SimpleTypeArrayWS"> + <operation name="getInput"> + <input message="tns:input"/> + <output message="tns:output"/> + </operation> + </portType> + <binding name="SimpleTypeArrayWSBinding" type="tns:SimpleTypeArrayWS"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="getInput"> + <soap:operation/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + </binding> + <service name="SimpleTypeArrayWSService"> + <port name="sampleWS" binding="tns:SimpleTypeArrayWSBinding"> + <soap:address location="http://localhost:9080/SimpleTypeArray/services/sampleWS"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/SimpleTypeInnerUnbounded.wsdl b/axiom/test/resources/wsdl/SimpleTypeInnerUnbounded.wsdl new file mode 100644 index 0000000..15e4eba --- /dev/null +++ b/axiom/test/resources/wsdl/SimpleTypeInnerUnbounded.wsdl @@ -0,0 +1,113 @@ +<?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. --> + +<definitions targetNamespace="http://simpletypeinnerunbounded.test.apache.org" xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://simpletypeinnerunbounded.test.apache.org" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://simpletypeinnerunbounded.test.apache.org" xmlns:tns="http://simpletypeinnerunbounded.test.apache.org"> + + <xsd:element name="getInput"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="type" maxOccurs="1" minOccurs="0" type="tns:Type1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:element name="getInputResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="type" maxOccurs="1" minOccurs="0" type="tns:Type1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="Type1"> + <xsd:sequence> + <xsd:element name="enum_int" maxOccurs="1" minOccurs="0" type="tns:TypeInt" /> + <xsd:element name="enum_string" maxOccurs="1" minOccurs="0" type="tns:TypeString" /> + <xsd:element maxOccurs="100" minOccurs="1" name="ident"> + <xsd:simpleType> + <xsd:restriction base="xsd:string"/> + </xsd:simpleType> + </xsd:element> + </xsd:sequence> + <xsd:attribute name="att_enum_int" type="tns:TypeInt"/> + <xsd:attribute name="att_enum_string" type="tns:TypeString"/> + <xsd:attribute name="att_enum_kind"> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="CHEQUE" /> + <xsd:enumeration value="CREDIT_CARD" /> + <xsd:enumeration value="TRANSFER" /> + <xsd:enumeration value="WITHDRAWAL" /> + <xsd:enumeration value="AUTOMATIC" /> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute> + </xsd:complexType> + + <xsd:simpleType name="TypeInt"> + <xsd:restriction base="xsd:int"> + <xsd:enumeration value="0" /> + <xsd:enumeration value="1" /> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="TypeString"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="one" /> + <xsd:enumeration value="two" /> + </xsd:restriction> + </xsd:simpleType> + + </xsd:schema> + </types> + + + <message name="input"> + <part name="parameters" element="tns:getInput" /> + </message> + + <message name="output"> + <part name="parameters" element="tns:getInputResponse" /> + </message> + + <portType name="SimpleTypeInnerUnboundedWS"> + <operation name="getInput"> + <input message="tns:input" /> + <output message="tns:output" /> + </operation> + </portType> + + <binding name="SimpleTypeInnerUnboundedWSBinding" type="tns:SimpleTypeInnerUnboundedWS"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> + <operation name="getInput"> + <soap:operation /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + </binding> + + <service name="SimpleTypeInnerUnboundedWSService"> + <port name="sampleWS" binding="tns:SimpleTypeInnerUnboundedWSBinding"> + <soap:address location="http://localhost:9080/SimpleTypeInnerUnbounded/services/sampleWS"/> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/SimpleTypeInnerUnboundedInOutput.wsdl b/axiom/test/resources/wsdl/SimpleTypeInnerUnboundedInOutput.wsdl new file mode 100644 index 0000000..3aceb9f --- /dev/null +++ b/axiom/test/resources/wsdl/SimpleTypeInnerUnboundedInOutput.wsdl @@ -0,0 +1,113 @@ +<?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. --> + +<definitions targetNamespace="http://simpletypeinnerunboundedinoutput.test.apache.org" xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://simpletypeinnerunboundedinoutput.test.apache.org" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://simpletypeinnerunboundedinoutput.test.apache.org" xmlns:tns="http://simpletypeinnerunboundedinoutput.test.apache.org"> + + <xsd:element name="getInput"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="type" maxOccurs="1" minOccurs="0" type="xsd:int" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:element name="getInputResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="type" maxOccurs="1" minOccurs="0" type="tns:Type1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:complexType name="Type1"> + <xsd:sequence> + <!--xsd:element name="enum_int" maxOccurs="1" minOccurs="0" type="tns:TypeInt" /> + <xsd:element name="enum_string" maxOccurs="1" minOccurs="0" type="tns:TypeString" /--> + <xsd:element maxOccurs="100" minOccurs="1" name="ident"> + <xsd:simpleType> + <xsd:restriction base="xsd:string"/> + </xsd:simpleType> + </xsd:element> + </xsd:sequence> + <!--xsd:attribute name="att_enum_int" type="tns:TypeInt"/> + <xsd:attribute name="att_enum_string" type="tns:TypeString"/> + <xsd:attribute name="att_enum_kind"> + <xsd:simpleType> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="CHEQUE" /> + <xsd:enumeration value="CREDIT_CARD" /> + <xsd:enumeration value="TRANSFER" /> + <xsd:enumeration value="WITHDRAWAL" /> + <xsd:enumeration value="AUTOMATIC" /> + </xsd:restriction> + </xsd:simpleType> + </xsd:attribute--> + </xsd:complexType> + + <xsd:simpleType name="TypeInt"> + <xsd:restriction base="xsd:int"> + <xsd:enumeration value="0" /> + <xsd:enumeration value="1" /> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="TypeString"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="one" /> + <xsd:enumeration value="two" /> + </xsd:restriction> + </xsd:simpleType> + + </xsd:schema> + </types> + + + <message name="input"> + <part name="parameters" element="tns:getInput" /> + </message> + + <message name="output"> + <part name="parameters" element="tns:getInputResponse" /> + </message> + + <portType name="SimpleTypeInnerUnboundedInOutputWS"> + <operation name="getInput"> + <input message="tns:input" /> + <output message="tns:output" /> + </operation> + </portType> + + <binding name="SimpleTypeInnerUnboundedInOutputWSBinding" type="tns:SimpleTypeInnerUnboundedInOutputWS"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> + <operation name="getInput"> + <soap:operation /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + </binding> + + <service name="SimpleTypeInnerUnboundedInOutputWSService"> + <port name="sampleWS" binding="tns:SimpleTypeInnerUnboundedInOutputWSBinding"> + <soap:address location="http://localhost:9080/SimpleTypeInnerUnboundedInOutput/services/sampleWS" /> + </port> + </service> +</definitions> diff --git a/axiom/test/resources/wsdl/StockQuotes.wsdl b/axiom/test/resources/wsdl/StockQuotes.wsdl new file mode 100644 index 0000000..a5be851 --- /dev/null +++ b/axiom/test/resources/wsdl/StockQuotes.wsdl @@ -0,0 +1,48 @@ +<?xml version='1.0' encoding='UTF-8'?>
+<definitions name='net.xmethods.services.stockquote.StockQuote'
+ targetNamespace='http://www.themindelectric.com/wsdl/net.xmethods.services.stockquote.StockQuote/'
+ xmlns:tns='http://www.themindelectric.com/wsdl/net.xmethods.services.stockquote.StockQuote/'
+ xmlns:electric='http://www.themindelectric.com/'
+ xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'
+ xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
+ xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
+ xmlns='http://schemas.xmlsoap.org/wsdl/'>
+
+<message name='getQuoteResponse1'>
+ <part name='Result' type='xsd:float'/>
+</message>
+<message name='getQuoteRequest1'>
+ <part name='symbol' type='xsd:string'/>
+</message>
+
+<portType name='net.xmethods.services.stockquote.StockQuotePortType'>
+ <operation name='getQuote' parameterOrder='symbol'>
+ <input message='tns:getQuoteRequest1'/>
+ <output message='tns:getQuoteResponse1'/>
+ </operation>
+</portType>
+
+<binding name='net.xmethods.services.stockquote.StockQuoteBinding'
+ type='tns:net.xmethods.services.stockquote.StockQuotePortType'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='getQuote'>
+ <soap:operation soapAction='urn:xmethods-delayed-quotes#getQuote'/>
+ <input>
+ <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes'
+ encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
+ </input>
+ <output><soap:body use='encoded' namespace='urn:xmethods-delayed-quotes'
+ encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
+ </output>
+ </operation>
+</binding>
+
+<service name='net.xmethods.services.stockquote.StockQuoteService'>
+ <documentation>net.xmethods.services.stockquote.StockQuote web service</documentation>
+ <port name='net.xmethods.services.stockquote.StockQuotePort'
+ binding='tns:net.xmethods.services.stockquote.StockQuoteBinding'>
+ <soap:address location='http://64.124.140.30:9090/soap'/>
+ </port></service>
+
+</definitions>
diff --git a/axiom/test/resources/wsdl/TestTransportTimeout.wsdl b/axiom/test/resources/wsdl/TestTransportTimeout.wsdl new file mode 100644 index 0000000..9a469d6 --- /dev/null +++ b/axiom/test/resources/wsdl/TestTransportTimeout.wsdl @@ -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="Timeout"> + + <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="TestTransportTimeoutSoapBinding" type="impl:Timeout"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="add"> + + <wsdlsoap:operation soapAction=""/> + + <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=""/> + + <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=""/> + + <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=""/> + + <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="TestTransportTimeout"> + + <wsdl:port binding="impl:TestTransportTimeoutSoapBinding" name="TestTransportTimeoutPort"> + + <wsdlsoap:address location="http://localhost/axis/TestTransportTimeout"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/UDDI.wsdl b/axiom/test/resources/wsdl/UDDI.wsdl new file mode 100644 index 0000000..6d3c738 --- /dev/null +++ b/axiom/test/resources/wsdl/UDDI.wsdl @@ -0,0 +1,32 @@ +<?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 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://tempuri.org/UDDI/" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + name="UDDI" + targetNamespace="http://tempuri.org/UDDI/" + xmlns:wsdl1="urn:uddi-org:inquiry_v2"> + + <wsdl:import namespace="urn:uddi-org:inquiry_v2" location="inquire_v2.wsdl" /> + + <wsdl:service name="UDDI"> + <wsdl:port binding="wsdl1:InquireSoap" name="UDDIinquire"> + <soap:address location="http://tempuri.org" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/UnboundedChoice.wsdl b/axiom/test/resources/wsdl/UnboundedChoice.wsdl new file mode 100644 index 0000000..3becac9 --- /dev/null +++ b/axiom/test/resources/wsdl/UnboundedChoice.wsdl @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8"?> +<definitions xmlns:s1="http://soapinterop.org/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://soapinterop.org/" xmlns:s3="http://soapinterop.org/echoheader/" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://soapinterop.org" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/"> + <s:import namespace="http://soapinterop.org/xsd" /> + <s:import namespace="http://soapinterop.org/echoheader/" /> + + + + <s:element name="echoChoice"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="inputChoice" type="s1:ChoiceComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="echoChoiceResponse"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:ChoiceComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + + + + </s:schema> + + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd"> + <s:import namespace="http://soapinterop.org/" /> + + <s:complexType name="ChoiceComplexType"> + <s:sequence> + <s:choice minOccurs="1" maxOccurs="1"> + <s:element minOccurs="0" maxOccurs="unbounded" name="IntValue" type="s:int" /> + <s:element minOccurs="0" maxOccurs="1" name="StringValue" type="s:string" /> + </s:choice> + </s:sequence> + </s:complexType> + </s:schema> + + </types> + + + + <message name="echoChoiceSoapIn"> + <part name="parameters" element="s0:echoChoice" /> + </message> + <message name="echoChoiceSoapOut"> + <part name="parameters" element="s0:echoChoiceResponse" /> + </message> + + <portType name="ChoiceTestSoap"> + + + <operation name="echoChoice"> + <input message="s0:echoChoiceSoapIn" /> + <output message="s0:echoChoiceSoapOut" /> + </operation> + + </portType> + + + <binding name="ChoiceTestSoap" type="s0:ChoiceTestSoap"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + <operation name="echoChoice"> + <soap:operation soapAction="SimpleChoiceTest#echoChoice" style="document" /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + + </binding> + +<binding name="ChoiceTestSoap12" type="s0:ChoiceTestSoap"> + <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + + <operation name="echoChoice"> + <soap12:operation soapAction="Choice#echoChoice" style="document" /> + <input> + <soap12:body use="literal" /> + </input> + <output> + <soap12:body use="literal" /> + </output> + </operation> + + </binding> + +<service name="ChoiceTest"> + <documentation>These operations implement DOC/LIT SOAP operations, for interop testing. Please email johnko@microsoft.com with any questions/coments.</documentation> + <port name="ChoiceTestSoap" binding="s0:ChoiceTestSoap"> + <soap:address location="http://localhost:90/axis/Choice" /> + </port> + <port name="ChoiceTestSoap12" binding="s0:ChoiceTestSoap12"> + <soap12:address location="http://localhost:90/axis/Choice" /> + </port> + </service> +</definitions>
\ No newline at end of file diff --git a/axiom/test/resources/wsdl/UnboundedStringChoice.wsdl b/axiom/test/resources/wsdl/UnboundedStringChoice.wsdl new file mode 100644 index 0000000..f752eca --- /dev/null +++ b/axiom/test/resources/wsdl/UnboundedStringChoice.wsdl @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8"?> +<definitions xmlns:s1="http://soapinterop.org/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://soapinterop.org/" xmlns:s3="http://soapinterop.org/echoheader/" xmlns:soap12enc="http://www.w3.org/2002/06/soap-envelope" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s2="http://soapinterop.org" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/"> + <types> + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/"> + <s:import namespace="http://soapinterop.org/xsd" /> + <s:import namespace="http://soapinterop.org/echoheader/" /> + + + + <s:element name="echoChoice"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="inputChoice" type="s1:ChoiceComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + <s:element name="echoChoiceResponse"> + <s:complexType> + <s:sequence> + <s:element minOccurs="0" maxOccurs="1" name="return" type="s1:ChoiceComplexType" /> + </s:sequence> + </s:complexType> + </s:element> + + + + </s:schema> + + <s:schema elementFormDefault="qualified" targetNamespace="http://soapinterop.org/xsd"> + <s:import namespace="http://soapinterop.org/" /> + + <s:complexType name="ChoiceComplexType"> + <s:sequence> + <s:choice minOccurs="1" maxOccurs="1"> + <s:element minOccurs="0" maxOccurs="1" name="IntValue" type="s:int" /> + <s:element minOccurs="0" maxOccurs="5" name="StringValue" type="s:string" /> + </s:choice> + </s:sequence> + </s:complexType> + </s:schema> + + </types> + + + + <message name="echoChoiceSoapIn"> + <part name="parameters" element="s0:echoChoice" /> + </message> + <message name="echoChoiceSoapOut"> + <part name="parameters" element="s0:echoChoiceResponse" /> + </message> + + <portType name="ChoiceTestSoap"> + + + <operation name="echoChoice"> + <input message="s0:echoChoiceSoapIn" /> + <output message="s0:echoChoiceSoapOut" /> + </operation> + + </portType> + + + <binding name="ChoiceTestSoap" type="s0:ChoiceTestSoap"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + <operation name="echoChoice"> + <soap:operation soapAction="SimpleChoiceTest#echoChoice" style="document" /> + <input> + <soap:body use="literal" /> + </input> + <output> + <soap:body use="literal" /> + </output> + </operation> + + </binding> + +<binding name="ChoiceTestSoap12" type="s0:ChoiceTestSoap"> + <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> + + + <operation name="echoChoice"> + <soap12:operation soapAction="Choice#echoChoice" style="document" /> + <input> + <soap12:body use="literal" /> + </input> + <output> + <soap12:body use="literal" /> + </output> + </operation> + + </binding> + +<service name="ChoiceTest"> + <documentation>These operations implement DOC/LIT SOAP operations, for interop testing. Please email johnko@microsoft.com with any questions/coments.</documentation> + <port name="ChoiceTestSoap" binding="s0:ChoiceTestSoap"> + <soap:address location="http://localhost:90/axis/Choice" /> + </port> + <port name="ChoiceTestSoap12" binding="s0:ChoiceTestSoap12"> + <soap12:address location="http://localhost:90/axis/Choice" /> + </port> + </service> +</definitions>
\ No newline at end of file diff --git a/axiom/test/resources/wsdl/XSDAttribute.wsdl b/axiom/test/resources/wsdl/XSDAttribute.wsdl new file mode 100644 index 0000000..2c3f44f --- /dev/null +++ b/axiom/test/resources/wsdl/XSDAttribute.wsdl @@ -0,0 +1,1046 @@ +<?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://xsdattribute.test.apache.org" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://xsdattribute.test.apache.org" 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://xsdattribute.test.apache.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://xsdattribute.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <!-- ############################################ --> + <!-- Define the operation elements and data types --> + <!-- ############################################ --> + + <!-- test boolean as attribute --> + <xsd:element name="getDataBoolean"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeBoolean" maxOccurs="1" minOccurs="0" type="impl:BooleanType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataBooleanResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeBoolean" maxOccurs="1" minOccurs="0" type="impl:BooleanType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="BooleanType"> + <xsd:attribute name="booleanType" type="xsd:boolean"/> + </xsd:complexType> + + <!-- test byte as attribute --> + <xsd:element name="getDataByte"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeByte" maxOccurs="1" minOccurs="0" type="impl:ByteType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataByteResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeByte" maxOccurs="1" minOccurs="0" type="impl:ByteType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="ByteType"> + <xsd:attribute name="byteType" type="xsd:byte"/> + </xsd:complexType> + + <!-- test unsigned_byte as attribute --> + <xsd:element name="getDataUnsignedByte"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeUnsignedByte" maxOccurs="1" minOccurs="0" type="impl:UnsignedByteType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataUnsignedByteResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeUnsignedByte" maxOccurs="1" minOccurs="0" type="impl:UnsignedByteType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="UnsignedByteType"> + <xsd:attribute name="unsignedByteType" type="xsd:unsignedByte"/> + </xsd:complexType> + + <!-- test short as attribute --> + <xsd:element name="getDataShort"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeShort" maxOccurs="1" minOccurs="0" type="impl:ShortType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataShortResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeShort" maxOccurs="1" minOccurs="0" type="impl:ShortType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="ShortType"> + <xsd:attribute name="shortType" type="xsd:short"/> + </xsd:complexType> + + <!-- test unsigned_short as attribute --> + <xsd:element name="getDataUnsignedShort"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeUnsignedShort" maxOccurs="1" minOccurs="0" type="impl:UnsignedShortType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataUnsignedShortResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeUnsignedShort" maxOccurs="1" minOccurs="0" type="impl:UnsignedShortType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="UnsignedShortType"> + <xsd:attribute name="unsignedShortType" type="xsd:unsignedShort"/> + </xsd:complexType> + + <!-- test int as attribute --> + <xsd:element name="getDataInt"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeInt" maxOccurs="1" minOccurs="0" type="impl:IntType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataIntResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeInt" maxOccurs="1" minOccurs="0" type="impl:IntType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="IntType"> + <xsd:attribute name="intType" type="xsd:int"/> + </xsd:complexType> + + <!-- test unsigned_int as attribute --> + <xsd:element name="getDataUnsignedInt"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeUnsignedInt" maxOccurs="1" minOccurs="0" type="impl:UnsignedIntType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataUnsignedIntResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeUnsignedInt" maxOccurs="1" minOccurs="0" type="impl:UnsignedIntType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="UnsignedIntType"> + <xsd:attribute name="unsignedIntType" type="xsd:unsignedInt"/> + </xsd:complexType> + + <!-- test long as attribute --> + <xsd:element name="getDataLong"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeLong" maxOccurs="1" minOccurs="0" type="impl:LongType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataLongResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeLong" maxOccurs="1" minOccurs="0" type="impl:LongType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="LongType"> + <xsd:attribute name="longType" type="xsd:long"/> + </xsd:complexType> + + <!-- test unsigned_long as attribute --> + <xsd:element name="getDataUnsignedLong"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeUnsignedLong" maxOccurs="1" minOccurs="0" type="impl:UnsignedLongType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataUnsignedLongResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeUnsignedLong" maxOccurs="1" minOccurs="0" type="impl:UnsignedLongType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="UnsignedLongType"> + <xsd:attribute name="unsignedLongType" type="xsd:unsignedLong"/> + </xsd:complexType> + + <!-- test float as attribute --> + <xsd:element name="getDataFloat"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeFloat" maxOccurs="1" minOccurs="0" type="impl:FloatType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataFloatResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeFloat" maxOccurs="1" minOccurs="0" type="impl:FloatType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="FloatType"> + <xsd:attribute name="floatType" type="xsd:float"/> + </xsd:complexType> + + <!-- test double as attribute --> + <xsd:element name="getDataDouble"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeDouble" maxOccurs="1" minOccurs="0" type="impl:DoubleType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataDoubleResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeDouble" maxOccurs="1" minOccurs="0" type="impl:DoubleType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="DoubleType"> + <xsd:attribute name="doubleType" type="xsd:double"/> + </xsd:complexType> + + <!-- test string as attribute --> + <xsd:element name="getDataString"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeString" maxOccurs="1" minOccurs="0" type="impl:StringType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataStringResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeString" maxOccurs="1" minOccurs="0" type="impl:StringType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="StringType"> + <xsd:attribute name="stringType" type="xsd:string"/> + </xsd:complexType> + + <!-- test date as attribute --> + <xsd:element name="getDataDate"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeDate" maxOccurs="1" minOccurs="0" type="impl:DateType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataDateResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeDate" maxOccurs="1" minOccurs="0" type="impl:DateType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="DateType"> + <xsd:attribute name="dateType" type="xsd:date"/> + </xsd:complexType> + + <!-- test dateTime as attribute --> + <xsd:element name="getDataDateTime"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeDateTime" maxOccurs="1" minOccurs="0" type="impl:DateTimeType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataDateTimeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeDateTime" maxOccurs="1" minOccurs="0" type="impl:DateTimeType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="DateTimeType"> + <xsd:attribute name="dateTimeType" type="xsd:dateTime"/> + </xsd:complexType> + + <!-- test time as attribute --> + <xsd:element name="getDataTime"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeTime" maxOccurs="1" minOccurs="0" type="impl:TimeType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataTimeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeTime" maxOccurs="1" minOccurs="0" type="impl:TimeType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="TimeType"> + <xsd:attribute name="timeType" type="xsd:time"/> + </xsd:complexType> + + + <!-- test duration as attribute --> +<!-- + <xsd:element name="getDataDuration"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeDuration" maxOccurs="1" minOccurs="0" type="impl:DurationType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataDurationResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeDuration" maxOccurs="1" minOccurs="0" type="impl:DurationType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="DurationType"> + <xsd:attribute name="durationType" type="xsd:duration"/> + </xsd:complexType> +--> + + <!-- test base64Binary as attribute --> + <xsd:element name="getDataBase64Binary"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeBase64Binary" maxOccurs="1" minOccurs="0" type="impl:Base64BinaryType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataBase64BinaryResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeBase64Binary" maxOccurs="1" minOccurs="0" type="impl:Base64BinaryType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="Base64BinaryType"> + <xsd:attribute name="base64BinaryType" type="xsd:base64Binary"/> + </xsd:complexType> + + <!-- test hexBinary as attribute --> + <xsd:element name="getDataHexBinary"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeHexBinary" maxOccurs="1" minOccurs="0" type="impl:HexBinaryType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataHexBinaryResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeHexBinary" maxOccurs="1" minOccurs="0" type="impl:HexBinaryType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="HexBinaryType"> + <xsd:attribute name="hexBinaryType" type="xsd:hexBinary"/> + </xsd:complexType> + + <!-- test integer as attribute --> + <xsd:element name="getDataInteger"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeInteger" maxOccurs="1" minOccurs="0" type="impl:IntegerType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataIntegerResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeInteger" maxOccurs="1" minOccurs="0" type="impl:IntegerType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="IntegerType"> + <xsd:attribute name="integerType" type="xsd:integer"/> + </xsd:complexType> + + <!-- test decimal as attribute --> + <xsd:element name="getDataDecimal"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeDecimal" maxOccurs="1" minOccurs="0" type="impl:DecimalType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataDecimalResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeDecimal" maxOccurs="1" minOccurs="0" type="impl:DecimalType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="DecimalType"> + <xsd:attribute name="decimalType" type="xsd:decimal"/> + </xsd:complexType> + + <!-- test QName as attribute --> + <xsd:element name="getDataQName"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeQName" maxOccurs="1" minOccurs="0" type="impl:QNameType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataQNameResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeQName" maxOccurs="1" minOccurs="0" type="impl:QNameType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="QNameType"> + <xsd:attribute name="qnameType" type="xsd:QName"/> + </xsd:complexType> + + <!-- test anyURI as attribute --> + <xsd:element name="getDataAnyURI"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeAnyURI" maxOccurs="1" minOccurs="0" type="impl:AnyURIType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="getDataAnyURIResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="TypeAnyURI" maxOccurs="1" minOccurs="0" type="impl:AnyURIType" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="AnyURIType"> + <xsd:attribute name="anyURIType" type="xsd:anyURI"/> + </xsd:complexType> + + </schema> + + </wsdl:types> + + + <!-- ############################################ --> + <!-- Define the message elements and data types --> + <!-- ############################################ --> + + <!-- test boolean as attribute --> + <wsdl:message name="getDataBooleanRequest"> + <wsdl:part element="impl:getDataBoolean" name="gdboolean"/> + </wsdl:message> + <wsdl:message name="getDataBooleanResponse"> + <wsdl:part element="impl:getDataBooleanResponse" name="gdbooleanr"/> + </wsdl:message> + + <!-- test byte as attribute --> + <wsdl:message name="getDataByteRequest"> + <wsdl:part element="impl:getDataByte" name="gdbyte"/> + </wsdl:message> + <wsdl:message name="getDataByteResponse"> + <wsdl:part element="impl:getDataByteResponse" name="gdbyter"/> + </wsdl:message> + + <!-- test unsigned_byte as attribute --> + <wsdl:message name="getDataUnsignedByteRequest"> + <wsdl:part element="impl:getDataUnsignedByte" name="gdubyte"/> + </wsdl:message> + <wsdl:message name="getDataUnsignedByteResponse"> + <wsdl:part element="impl:getDataUnsignedByteResponse" name="gdubyter"/> + </wsdl:message> + + <!-- test short as attribute --> + <wsdl:message name="getDataShortRequest"> + <wsdl:part element="impl:getDataShort" name="gdshort"/> + </wsdl:message> + <wsdl:message name="getDataShortResponse"> + <wsdl:part element="impl:getDataShortResponse" name="gdshortr"/> + </wsdl:message> + + <!-- test unsigned_short as attribute --> + <wsdl:message name="getDataUnsignedShortRequest"> + <wsdl:part element="impl:getDataUnsignedShort" name="gdushort"/> + </wsdl:message> + <wsdl:message name="getDataUnsignedShortResponse"> + <wsdl:part element="impl:getDataUnsignedShortResponse" name="gdushortr"/> + </wsdl:message> + + <!-- test int as attribute --> + <wsdl:message name="getDataIntRequest"> + <wsdl:part element="impl:getDataInt" name="gdint"/> + </wsdl:message> + <wsdl:message name="getDataIntResponse"> + <wsdl:part element="impl:getDataIntResponse" name="gdintr"/> + </wsdl:message> + + <!-- test unsigned_int as attribute --> + <wsdl:message name="getDataUnsignedIntRequest"> + <wsdl:part element="impl:getDataUnsignedInt" name="gduint"/> + </wsdl:message> + <wsdl:message name="getDataUnsignedIntResponse"> + <wsdl:part element="impl:getDataUnsignedIntResponse" name="gduintr"/> + </wsdl:message> + + <!-- test long as attribute --> + <wsdl:message name="getDataLongRequest"> + <wsdl:part element="impl:getDataLong" name="gdlong"/> + </wsdl:message> + <wsdl:message name="getDataLongResponse"> + <wsdl:part element="impl:getDataLongResponse" name="gdlongr"/> + </wsdl:message> + + <!-- test unsigned_long as attribute --> + <wsdl:message name="getDataUnsignedLongRequest"> + <wsdl:part element="impl:getDataUnsignedLong" name="gdulong"/> + </wsdl:message> + <wsdl:message name="getDataUnsignedLongResponse"> + <wsdl:part element="impl:getDataUnsignedLongResponse" name="gdulongr"/> + </wsdl:message> + + <!-- test float as attribute --> + <wsdl:message name="getDataFloatRequest"> + <wsdl:part element="impl:getDataFloat" name="gdfloat"/> + </wsdl:message> + <wsdl:message name="getDataFloatResponse"> + <wsdl:part element="impl:getDataFloatResponse" name="gdfloatr"/> + </wsdl:message> + + <!-- test double as attribute --> + <wsdl:message name="getDataDoubleRequest"> + <wsdl:part element="impl:getDataDouble" name="gddouble"/> + </wsdl:message> + <wsdl:message name="getDataDoubleResponse"> + <wsdl:part element="impl:getDataDoubleResponse" name="gddoubler"/> + </wsdl:message> + + <!-- test string as attribute --> + <wsdl:message name="getDataStringRequest"> + <wsdl:part element="impl:getDataString" name="gdstring"/> + </wsdl:message> + <wsdl:message name="getDataStringResponse"> + <wsdl:part element="impl:getDataStringResponse" name="gdstringr"/> + </wsdl:message> + + <!-- test date as attribute --> + <wsdl:message name="getDataDateRequest"> + <wsdl:part element="impl:getDataDate" name="gddate"/> + </wsdl:message> + <wsdl:message name="getDataDateResponse"> + <wsdl:part element="impl:getDataDateResponse" name="gddater"/> + </wsdl:message> + + <!-- test dateTime as attribute --> + <wsdl:message name="getDataDateTimeRequest"> + <wsdl:part element="impl:getDataDateTime" name="gddatetime"/> + </wsdl:message> + <wsdl:message name="getDataDateTimeResponse"> + <wsdl:part element="impl:getDataDateTimeResponse" name="gddatetimer"/> + </wsdl:message> + + <!-- test time as attribute --> + <wsdl:message name="getDataTimeRequest"> + <wsdl:part element="impl:getDataTime" name="gdtime"/> + </wsdl:message> + <wsdl:message name="getDataTimeResponse"> + <wsdl:part element="impl:getDataTimeResponse" name="gdtimer"/> + </wsdl:message> + + <!-- test duration as attribute --> +<!-- + <wsdl:message name="getDataDurationRequest"> + <wsdl:part element="impl:getDataDuration" name="gdduration"/> + </wsdl:message> + <wsdl:message name="getDataDurationResponse"> + <wsdl:part element="impl:getDataDurationResponse" name="gddurationr"/> + </wsdl:message> +--> + + <!-- test base64Binary as attribute --> + <wsdl:message name="getDataBase64BinaryRequest"> + <wsdl:part element="impl:getDataBase64Binary" name="gdbase64binary"/> + </wsdl:message> + <wsdl:message name="getDataBase64BinaryResponse"> + <wsdl:part element="impl:getDataBase64BinaryResponse" name="gdbase64binaryr"/> + </wsdl:message> + + <!-- test hexBinary as attribute --> + <wsdl:message name="getDataHexBinaryRequest"> + <wsdl:part element="impl:getDataHexBinary" name="gdhexbinary"/> + </wsdl:message> + <wsdl:message name="getDataHexBinaryResponse"> + <wsdl:part element="impl:getDataHexBinaryResponse" name="gdbhexbinaryr"/> + </wsdl:message> + + <!-- test integer as attribute --> + <wsdl:message name="getDataIntegerRequest"> + <wsdl:part element="impl:getDataInteger" name="gdinteger"/> + </wsdl:message> + <wsdl:message name="getDataIntegerResponse"> + <wsdl:part element="impl:getDataIntegerResponse" name="gdintegerr"/> + </wsdl:message> + + <!-- test decimal as attribute --> + <wsdl:message name="getDataDecimalRequest"> + <wsdl:part element="impl:getDataDecimal" name="gddecimal"/> + </wsdl:message> + <wsdl:message name="getDataDecimalResponse"> + <wsdl:part element="impl:getDataDecimalResponse" name="gddecimalr"/> + </wsdl:message> + + <!-- test QName as attribute --> + <wsdl:message name="getDataQNameRequest"> + <wsdl:part element="impl:getDataQName" name="gdqname"/> + </wsdl:message> + <wsdl:message name="getDataQNameResponse"> + <wsdl:part element="impl:getDataQNameResponse" name="gdqnamer"/> + </wsdl:message> + + <!-- test anyURI as attribute --> + <wsdl:message name="getDataAnyURIRequest"> + <wsdl:part element="impl:getDataAnyURI" name="gdanyuri"/> + </wsdl:message> + <wsdl:message name="getDataAnyURIResponse"> + <wsdl:part element="impl:getDataAnyURIResponse" name="gdanyurir"/> + </wsdl:message> + + + <!-- ############################################ --> + <!-- Define the operations and messages --> + <!-- ############################################ --> + + <wsdl:portType name="XSDAttribute"> + + <!-- test boolean as attribute --> + <wsdl:operation name="getDataBoolean"> + <wsdl:input message="impl:getDataBooleanRequest" name="getDataBooleanRequest"/> + <wsdl:output message="impl:getDataBooleanResponse" name="getDataBooleanResponse"/> + </wsdl:operation> + + <!-- test byte as attribute --> + <wsdl:operation name="getDataByte"> + <wsdl:input message="impl:getDataByteRequest" name="getDataByteRequest"/> + <wsdl:output message="impl:getDataByteResponse" name="getDataByteResponse"/> + </wsdl:operation> + + <!-- test unsigned_byte as attribute --> + <wsdl:operation name="getDataUnsignedByte"> + <wsdl:input message="impl:getDataUnsignedByteRequest" name="getDataUnsignedByteRequest"/> + <wsdl:output message="impl:getDataUnsignedByteResponse" name="getDataUnsignedByteResponse"/> + </wsdl:operation> + + <!-- test short as attribute --> + <wsdl:operation name="getDataShort"> + <wsdl:input message="impl:getDataShortRequest" name="getDataShortRequest"/> + <wsdl:output message="impl:getDataShortResponse" name="getDataShortResponse"/> + </wsdl:operation> + + <!-- test unsigned_short as attribute --> + <wsdl:operation name="getDataUnsignedShort"> + <wsdl:input message="impl:getDataUnsignedShortRequest" name="getDataUnsignedShortRequest"/> + <wsdl:output message="impl:getDataUnsignedShortResponse" name="getDataUnsignedShortResponse"/> + </wsdl:operation> + + <!-- test int as attribute --> + <wsdl:operation name="getDataInt"> + <wsdl:input message="impl:getDataIntRequest" name="getDataIntRequest"/> + <wsdl:output message="impl:getDataIntResponse" name="getDataIntResponse"/> + </wsdl:operation> + + <!-- test unsigned_int as attribute --> + <wsdl:operation name="getDataUnsignedInt"> + <wsdl:input message="impl:getDataUnsignedIntRequest" name="getDataUnsignedIntRequest"/> + <wsdl:output message="impl:getDataUnsignedIntResponse" name="getDataUnsignedIntResponse"/> + </wsdl:operation> + + <!-- test long as attribute --> + <wsdl:operation name="getDataLong"> + <wsdl:input message="impl:getDataLongRequest" name="getDataLongRequest"/> + <wsdl:output message="impl:getDataLongResponse" name="getDataLongResponse"/> + </wsdl:operation> + + <!-- test unsigned_long as attribute --> + <wsdl:operation name="getDataUnsignedLong"> + <wsdl:input message="impl:getDataUnsignedLongRequest" name="getDataUnsignedLongRequest"/> + <wsdl:output message="impl:getDataUnsignedLongResponse" name="getDataUnsignedLongResponse"/> + </wsdl:operation> + + <!-- test float as attribute --> + <wsdl:operation name="getDataFloat"> + <wsdl:input message="impl:getDataFloatRequest" name="getDataFloatRequest"/> + <wsdl:output message="impl:getDataFloatResponse" name="getDataFloatResponse"/> + </wsdl:operation> + + <!-- test double as attribute --> + <wsdl:operation name="getDataDouble"> + <wsdl:input message="impl:getDataDoubleRequest" name="getDataDoubleRequest"/> + <wsdl:output message="impl:getDataDoubleResponse" name="getDataDoubleResponse"/> + </wsdl:operation> + + <!-- test string as attribute --> + <wsdl:operation name="getDataString"> + <wsdl:input message="impl:getDataStringRequest" name="getDataStringRequest"/> + <wsdl:output message="impl:getDataStringResponse" name="getDataStringResponse"/> + </wsdl:operation> + + <!-- test date as attribute --> + <wsdl:operation name="getDataDate"> + <wsdl:input message="impl:getDataDateRequest" name="getDataDateRequest"/> + <wsdl:output message="impl:getDataDateResponse" name="getDataDateResponse"/> + </wsdl:operation> + + <!-- test dateTime as attribute --> + <wsdl:operation name="getDataDateTime"> + <wsdl:input message="impl:getDataDateTimeRequest" name="getDataDateTimeRequest"/> + <wsdl:output message="impl:getDataDateTimeResponse" name="getDataDateTimeResponse"/> + </wsdl:operation> + + <!-- test time as attribute --> + <wsdl:operation name="getDataTime"> + <wsdl:input message="impl:getDataTimeRequest" name="getDataTimeRequest"/> + <wsdl:output message="impl:getDataTimeResponse" name="getDataTimeResponse"/> + </wsdl:operation> + + <!-- test duration as attribute --> +<!-- + <wsdl:operation name="getDataDuration"> + <wsdl:input message="impl:getDataDurationRequest" name="getDataDurationRequest"/> + <wsdl:output message="impl:getDataDurationResponse" name="getDataDurationResponse"/> + </wsdl:operation> +--> + + <!-- test base64Binary as attribute --> + <wsdl:operation name="getDataBase64Binary"> + <wsdl:input message="impl:getDataBase64BinaryRequest" name="getDataBase64BinaryRequest"/> + <wsdl:output message="impl:getDataBase64BinaryResponse" name="getDataBase64BinaryResponse"/> + </wsdl:operation> + + <!-- test hexBinary as attribute --> + <wsdl:operation name="getDataHexBinary"> + <wsdl:input message="impl:getDataHexBinaryRequest" name="getDataHexBinaryRequest"/> + <wsdl:output message="impl:getDataHexBinaryResponse" name="getDataHexBinaryResponse"/> + </wsdl:operation> + + <!-- test integer as attribute --> + <wsdl:operation name="getDataInteger"> + <wsdl:input message="impl:getDataIntegerRequest" name="getDataIntegerRequest"/> + <wsdl:output message="impl:getDataIntegerResponse" name="getDataIntegerResponse"/> + </wsdl:operation> + + <!-- test decimal as attribute --> + <wsdl:operation name="getDataDecimal"> + <wsdl:input message="impl:getDataDecimalRequest" name="getDataDecimalRequest"/> + <wsdl:output message="impl:getDataDecimalResponse" name="getDataDecimalResponse"/> + </wsdl:operation> + + <!-- test QName as attribute --> + <wsdl:operation name="getDataQName"> + <wsdl:input message="impl:getDataQNameRequest" name="getDataQNameRequest"/> + <wsdl:output message="impl:getDataQNameResponse" name="getDataQNameResponse"/> + </wsdl:operation> + + <!-- test anyURI as attribute --> + <wsdl:operation name="getDataAnyURI"> + <wsdl:input message="impl:getDataAnyURIRequest" name="getDataAnyURIRequest"/> + <wsdl:output message="impl:getDataAnyURIResponse" name="getDataAnyURIResponse"/> + </wsdl:operation> + + </wsdl:portType> + + + + <!-- ############################################ --> + <!-- Define the operation bindings --> + <!-- ############################################ --> + + <wsdl:binding name="XSDAttributeSoapBinding" type="impl:XSDAttribute"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <!-- test boolean as attribute --> + <wsdl:operation name="getDataBoolean"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataBooleanRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataBooleanResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test byte as attribute --> + <wsdl:operation name="getDataByte"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataByteRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataByteResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test unsigned_byte as attribute --> + <wsdl:operation name="getDataUnsignedByte"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataUnsignedByteRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataUnsignedByteResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test short as attribute --> + <wsdl:operation name="getDataShort"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataShortRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataShortResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test unsigned_short as attribute --> + <wsdl:operation name="getDataUnsignedShort"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataUnsignedShortRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataUnsignedShortResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test int as attribute --> + <wsdl:operation name="getDataInt"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataIntRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataIntResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test unsigned_int as attribute --> + <wsdl:operation name="getDataUnsignedInt"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataUnsignedIntRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataUnsignedIntResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test long as attribute --> + <wsdl:operation name="getDataLong"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataLongRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataLongResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test unsigned_long as attribute --> + <wsdl:operation name="getDataUnsignedLong"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataUnsignedLongRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataUnsignedLongResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test float as attribute --> + <wsdl:operation name="getDataFloat"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataFloatRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataFloatResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test double as attribute --> + <wsdl:operation name="getDataDouble"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataDoubleRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataDoubleResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test string as attribute --> + <wsdl:operation name="getDataString"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataStringRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataStringResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test date as attribute --> + <wsdl:operation name="getDataDate"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataDateRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataDateResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test dateTime as attribute --> + <wsdl:operation name="getDataDateTime"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataDateTimeRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataDateTimeResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test time as attribute --> + <wsdl:operation name="getDataTime"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataTimeRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataTimeResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test duration as attribute --> +<!-- + <wsdl:operation name="getDataDuration"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataDurationRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataDurationResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> +--> + + <!-- test base64Binary as attribute --> + <wsdl:operation name="getDataBase64Binary"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataBase64BinaryRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataBase64BinaryResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test hexBinary as attribute --> + <wsdl:operation name="getDataHexBinary"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataHexBinaryRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataHexBinaryResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test integer as attribute --> + <wsdl:operation name="getDataInteger"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataIntegerRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataIntegerResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test decimal as attribute --> + <wsdl:operation name="getDataDecimal"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataDecimalRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataDecimalResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test QName as attribute --> + <wsdl:operation name="getDataQName"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataQNameRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataQNameResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + <!-- test anyURI as attribute --> + <wsdl:operation name="getDataAnyURI"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="getDataAnyURIRequest"> + <wsdlsoap:body use="literal"/> + </wsdl:input> + <wsdl:output name="getDataAnyURIResponse"> + <wsdlsoap:body use="literal"/> + </wsdl:output> + </wsdl:operation> + + </wsdl:binding> + + + + <!-- ############################################ --> + <!-- Define the Service --> + <!-- ############################################ --> + + <wsdl:service name="XSDAttributeService"> + <wsdl:port binding="impl:XSDAttributeSoapBinding" name="XSDAttributePort"> + <wsdlsoap:address location="http://localhost:9080/XSDAttribute/services/XSDAttributePort"/> + </wsdl:port> + </wsdl:service> + +</wsdl:definitions> + diff --git a/axiom/test/resources/wsdl/XSDElement.wsdl b/axiom/test/resources/wsdl/XSDElement.wsdl new file mode 100644 index 0000000..13309e6 --- /dev/null +++ b/axiom/test/resources/wsdl/XSDElement.wsdl @@ -0,0 +1,1422 @@ +<?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://xsdelement.test.apache.org" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://xsdelement.test.apache.org" xmlns:intf="http://xsdelement.test.apache.org" xmlns:tns2="http://complextypes.test.apache.org" 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://xsdelement.test.apache.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://xsdelement.test.apache.org" xmlns:intf="http://xsdelement.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <element name="setGetDataInt"> + <complexType> + <sequence> + <element name="arg_0_2" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="setGetDataIntResponse"> + <complexType> + <sequence> + <element name="setGetDataIntReturn" type="xsd:int"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataUnsignedInt"> + <complexType> + <sequence> + <element name="arg_0_u2" type="xsd:unsignedInt"/> + </sequence> + </complexType> + </element> + <element name="setGetDataUnsignedIntResponse"> + <complexType> + <sequence> + <element name="setGetDataUnsignedIntReturn" type="xsd:unsignedInt"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataLong"> + <complexType> + <sequence> + <element name="arg_0_5" type="xsd:long"/> + </sequence> + </complexType> + </element> + <element name="setGetDataLongResponse"> + <complexType> + <sequence> + <element name="setGetDataLongReturn" type="xsd:long"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataUnsignedLong"> + <complexType> + <sequence> + <element name="arg_0_u5" type="xsd:unsignedLong"/> + </sequence> + </complexType> + </element> + <element name="setGetDataUnsignedLongResponse"> + <complexType> + <sequence> + <element name="setGetDataUnsignedLongReturn" type="xsd:unsignedLong"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataByte"> + <complexType> + <sequence> + <element name="arg_0_14" type="xsd:byte"/> + </sequence> + </complexType> + </element> + <element name="setGetDataByteResponse"> + <complexType> + <sequence> + <element name="setGetDataByteReturn" type="xsd:byte"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataUnsignedByte"> + <complexType> + <sequence> + <element name="arg_0_u14" type="xsd:unsignedByte"/> + </sequence> + </complexType> + </element> + <element name="setGetDataUnsignedByteResponse"> + <complexType> + <sequence> + <element name="setGetDataUnsignedByteReturn" type="xsd:unsignedByte"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataShort"> + <complexType> + <sequence> + <element name="arg_0_26" type="xsd:short"/> + </sequence> + </complexType> + </element> + <element name="setGetDataShortResponse"> + <complexType> + <sequence> + <element name="setGetDataShortReturn" type="xsd:short"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataUnsignedShort"> + <complexType> + <sequence> + <element name="arg_0_u26" type="xsd:unsignedShort"/> + </sequence> + </complexType> + </element> + <element name="setGetDataUnsignedShortResponse"> + <complexType> + <sequence> + <element name="setGetDataUnsignedShortReturn" type="xsd:unsignedShort"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataBoolean"> + <complexType> + <sequence> + <element name="arg_0_17" type="xsd:boolean"/> + </sequence> + </complexType> + </element> + <element name="setGetDataBooleanResponse"> + <complexType> + <sequence> + <element name="setGetDataBooleanReturn" type="xsd:boolean"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataDouble"> + <complexType> + <sequence> + <element name="arg_0_8" type="xsd:double"/> + </sequence> + </complexType> + </element> + <element name="setGetDataDoubleResponse"> + <complexType> + <sequence> + <element name="setGetDataDoubleReturn" type="xsd:double"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataFloat"> + <complexType> + <sequence> + <element name="arg_0_11" type="xsd:float"/> + </sequence> + </complexType> + </element> + <element name="setGetDataFloatResponse"> + <complexType> + <sequence> + <element name="setGetDataFloatReturn" type="xsd:float"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataString"> + <complexType> + <sequence> + <element name="arg_0_23" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="setGetDataStringResponse"> + <complexType> + <sequence> + <element name="setGetDataStringReturn" type="xsd:string"/> + </sequence> + </complexType> + </element> + + <element name="setGetDateTimeType"> + <complexType> + <sequence> + <element name="arg_0_32" type="xsd:dateTime"/> + </sequence> + </complexType> + </element> + <element name="setGetDateTimeTypeResponse"> + <complexType> + <sequence> + <element name="setGetDateTimeTypeReturn" type="xsd:dateTime"/> + </sequence> + </complexType> + </element> + + <element name="setGetDateType"> + <complexType> + <sequence> + <element name="arg_0_35" type="xsd:date"/> + </sequence> + </complexType> + </element> + <element name="setGetDateTypeResponse"> + <complexType> + <sequence> + <element name="setGetDateTypeReturn" type="xsd:date"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataDurationType"> + <complexType> + <sequence> + <element name="arg_0_d35" type="xsd:duration"/> + </sequence> + </complexType> + </element> + <element name="setGetDataDurationTypeResponse"> + <complexType> + <sequence> + <element name="setGetDataDurationTypeReturn" type="xsd:duration"/> + </sequence> + </complexType> + </element> + + <element name="setGetTimeType"> + <complexType> + <sequence> + <element name="arg_0_38" type="xsd:time"/> + </sequence> + </complexType> + </element> + <element name="setGetTimeTypeResponse"> + <complexType> + <sequence> + <element name="setGetTimeTypeReturn" type="xsd:time"/> + </sequence> + </complexType> + </element> + + <element name="setGetBase64BinaryType"> + <complexType> + <sequence> + <element name="arg_0_41" type="xsd:base64Binary"/> + </sequence> + </complexType> + </element> + <element name="setGetBase64BinaryTypeResponse"> + <complexType> + <sequence> + <element name="setGetBase64BinaryTypeReturn" type="xsd:base64Binary"/> + </sequence> + </complexType> + </element> + + <element name="setGetHexBinary"> + <complexType> + <sequence> + <element name="arg_0_44" type="xsd:hexBinary"/> + </sequence> + </complexType> + </element> + <element name="setGetHexBinaryResponse"> + <complexType> + <sequence> + <element name="setGetHexBinaryReturn" type="xsd:hexBinary"/> + </sequence> + </complexType> + </element> + + <element name="setGetDecimalType"> + <complexType> + <sequence> + <element name="arg_0_47" type="xsd:decimal"/> + </sequence> + </complexType> + </element> + <element name="setGetDecimalTypeResponse"> + <complexType> + <sequence> + <element name="setGetDecimalTypeReturn" type="xsd:decimal"/> + </sequence> + </complexType> + </element> + + <element name="setGetIntegerType"> + <complexType> + <sequence> + <element name="arg_0_50" type="xsd:integer"/> + </sequence> + </complexType> + </element> + <element name="setGetIntegerTypeResponse"> + <complexType> + <sequence> + <element name="setGetIntegerTypeReturn" type="xsd:integer"/> + </sequence> + </complexType> + </element> + + <element name="getQNameType"> + <complexType> + <sequence/> + </complexType> + </element> + <element name="getQNameTypeResponse"> + <complexType> + <sequence> + <element name="getQNameTypeReturn" type="xsd:QName"/> + </sequence> + </complexType> + </element> + <element name="setQNameType"> + <complexType> + <sequence> + <element name="arg_0_52" type="xsd:QName"/> + </sequence> + </complexType> + </element> + <element name="setQNameTypeResponse"> + <complexType> + <sequence/> + </complexType> + </element> + + <element name="getAnyURIType"> + <complexType> + <sequence/> + </complexType> + </element> + <element name="getAnyURITypeResponse"> + <complexType> + <sequence> + <element name="getAnyURITypeReturn" type="xsd:anyURI"/> + </sequence> + </complexType> + </element> + <element name="setAnyURIType"> + <complexType> + <sequence> + <element name="arg_0_a52" type="xsd:anyURI"/> + </sequence> + </complexType> + </element> + <element name="setAnyURITypeResponse"> + <complexType> + <sequence/> + </complexType> + </element> + + </schema> + + </wsdl:types> + + + + <wsdl:message name="setGetDataIntRequest"> + + <wsdl:part element="impl:setGetDataInt" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataUnsignedIntRequest"> + + <wsdl:part element="impl:setGetDataUnsignedInt" name="parameters"/> + + </wsdl:message> + + + + + + <wsdl:message name="setGetDataIntResponse"> + + <wsdl:part element="impl:setGetDataIntResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setGetDataUnsignedIntResponse"> + + <wsdl:part element="impl:setGetDataUnsignedIntResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataByteRequest"> + + <wsdl:part element="impl:setGetDataByte" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataUnsignedByteRequest"> + + <wsdl:part element="impl:setGetDataUnsignedByte" name="parameters"/> + + </wsdl:message> + + + <wsdl:message name="setGetDataByteResponse"> + + <wsdl:part element="impl:setGetDataByteResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setGetDataUnsignedByteResponse"> + + <wsdl:part element="impl:setGetDataUnsignedByteResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setGetDataLongRequest"> + + <wsdl:part element="impl:setGetDataLong" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataLongResponse"> + + <wsdl:part element="impl:setGetDataLongResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataUnsignedLongRequest"> + + <wsdl:part element="impl:setGetDataUnsignedLong" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataUnsignedLongResponse"> + + <wsdl:part element="impl:setGetDataUnsignedLongResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataShortRequest"> + + <wsdl:part element="impl:setGetDataShort" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataShortResponse"> + + <wsdl:part element="impl:setGetDataShortResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataUnsignedShortRequest"> + + <wsdl:part element="impl:setGetDataUnsignedShort" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataUnsignedShortResponse"> + + <wsdl:part element="impl:setGetDataUnsignedShortResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataBooleanRequest"> + + <wsdl:part element="impl:setGetDataBoolean" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataBooleanResponse"> + + <wsdl:part element="impl:setGetDataBooleanResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataFloatRequest"> + + <wsdl:part element="impl:setGetDataFloat" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataFloatResponse"> + + <wsdl:part element="impl:setGetDataFloatResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataDoubleRequest"> + + <wsdl:part element="impl:setGetDataDouble" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataDoubleResponse"> + + <wsdl:part element="impl:setGetDataDoubleResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDecimalTypeRequest"> + + <wsdl:part element="impl:setGetDecimalType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDecimalTypeResponse"> + + <wsdl:part element="impl:setGetDecimalTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetHexBinaryRequest"> + + <wsdl:part element="impl:setGetHexBinary" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetHexBinaryResponse"> + + <wsdl:part element="impl:setGetHexBinaryResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetBase64BinaryTypeRequest"> + + <wsdl:part element="impl:setGetBase64BinaryType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetBase64BinaryTypeResponse"> + + <wsdl:part element="impl:setGetBase64BinaryTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDateTimeTypeRequest"> + + <wsdl:part element="impl:setGetDateTimeType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDateTimeTypeResponse"> + + <wsdl:part element="impl:setGetDateTimeTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetIntegerTypeRequest"> + + <wsdl:part element="impl:setGetIntegerType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetIntegerTypeResponse"> + + <wsdl:part element="impl:setGetIntegerTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataStringRequest"> + + <wsdl:part element="impl:setGetDataString" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataStringResponse"> + + <wsdl:part element="impl:setGetDataStringResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setAnyURITypeRequest"> + + <wsdl:part element="impl:setAnyURIType" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getAnyURITypeRequest"> + + <wsdl:part element="impl:getAnyURIType" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setAnyURITypeResponse"> + + <wsdl:part element="impl:setAnyURITypeResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getAnyURITypeResponse"> + + <wsdl:part element="impl:getAnyURITypeResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setQNameTypeRequest"> + + <wsdl:part element="impl:setQNameType" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getQNameTypeRequest"> + + <wsdl:part element="impl:getQNameType" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setQNameTypeResponse"> + + <wsdl:part element="impl:setQNameTypeResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getQNameTypeResponse"> + + <wsdl:part element="impl:getQNameTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDateTypeRequest"> + + <wsdl:part element="impl:setGetDateType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDateTypeResponse"> + + <wsdl:part element="impl:setGetDateTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataDurationTypeRequest"> + + <wsdl:part element="impl:setGetDataDurationType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataDurationTypeResponse"> + + <wsdl:part element="impl:setGetDataDurationTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetTimeTypeRequest"> + + <wsdl:part element="impl:setGetTimeType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetTimeTypeResponse"> + + <wsdl:part element="impl:setGetTimeTypeResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:portType name="XSDElement"> + + + + <wsdl:operation name="setGetDataInt"> + + <wsdl:input message="impl:setGetDataIntRequest" name="setGetDataIntRequest"/> + + <wsdl:output message="impl:setGetDataIntResponse" name="setGetDataIntResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataUnsignedInt"> + + <wsdl:input message="impl:setGetDataUnsignedIntRequest" name="setGetDataUnsignedIntRequest"/> + + <wsdl:output message="impl:setGetDataUnsignedIntResponse" name="setGetDataUnsignedIntResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataLong"> + + <wsdl:input message="impl:setGetDataLongRequest" name="setGetDataLongRequest"/> + + <wsdl:output message="impl:setGetDataLongResponse" name="setGetDataLongResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataUnsignedLong"> + + <wsdl:input message="impl:setGetDataUnsignedLongRequest" name="setGetDataUnsignedLongRequest"/> + + <wsdl:output message="impl:setGetDataUnsignedLongResponse" name="setGetDataUnsignedLongResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataDouble"> + + <wsdl:input message="impl:setGetDataDoubleRequest" name="setGetDataDoubleRequest"/> + + <wsdl:output message="impl:setGetDataDoubleResponse" name="setGetDataDoubleResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataFloat"> + + <wsdl:input message="impl:setGetDataFloatRequest" name="setGetDataFloatRequest"/> + + <wsdl:output message="impl:setGetDataFloatResponse" name="setGetDataFloatResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataByte"> + + <wsdl:input message="impl:setGetDataByteRequest" name="setGetDataByteRequest"/> + + <wsdl:output message="impl:setGetDataByteResponse" name="setGetDataByteResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataUnsignedByte"> + + <wsdl:input message="impl:setGetDataUnsignedByteRequest" name="setGetDataUnsignedByteRequest"/> + + <wsdl:output message="impl:setGetDataUnsignedByteResponse" name="setGetDataUnsignedByteResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataBoolean"> + + <wsdl:input message="impl:setGetDataBooleanRequest" name="setGetDataBooleanRequest"/> + + <wsdl:output message="impl:setGetDataBooleanResponse" name="setGetDataBooleanResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataString"> + + <wsdl:input message="impl:setGetDataStringRequest" name="setGetDataStringRequest"/> + + <wsdl:output message="impl:setGetDataStringResponse" name="setGetDataStringResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataShort"> + + <wsdl:input message="impl:setGetDataShortRequest" name="setGetDataShortRequest"/> + + <wsdl:output message="impl:setGetDataShortResponse" name="setGetDataShortResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataUnsignedShort"> + + <wsdl:input message="impl:setGetDataUnsignedShortRequest" name="setGetDataUnsignedShortRequest"/> + + <wsdl:output message="impl:setGetDataUnsignedShortResponse" name="setGetDataUnsignedShortResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDateTimeType"> + + <wsdl:input message="impl:setGetDateTimeTypeRequest" name="setGetDateTimeTypeRequest"/> + + <wsdl:output message="impl:setGetDateTimeTypeResponse" name="setGetDateTimeTypeResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDateType"> + + <wsdl:input message="impl:setGetDateTypeRequest" name="setGetDateTypeRequest"/> + + <wsdl:output message="impl:setGetDateTypeResponse" name="setGetDateTypeResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataDurationType"> + + <wsdl:input message="impl:setGetDataDurationTypeRequest" name="setGetDataDurationTypeRequest"/> + + <wsdl:output message="impl:setGetDataDurationTypeResponse" name="setGetDataDurationTypeResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetTimeType"> + + <wsdl:input message="impl:setGetTimeTypeRequest" name="setGetTimeTypeRequest"/> + + <wsdl:output message="impl:setGetTimeTypeResponse" name="setGetTimeTypeResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetBase64BinaryType"> + + <wsdl:input message="impl:setGetBase64BinaryTypeRequest" name="setGetBase64BinaryTypeRequest"/> + + <wsdl:output message="impl:setGetBase64BinaryTypeResponse" name="setGetBase64BinaryTypeResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetHexBinary"> + + <wsdl:input message="impl:setGetHexBinaryRequest" name="setGetHexBinaryRequest"/> + + <wsdl:output message="impl:setGetHexBinaryResponse" name="setGetHexBinaryResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDecimalType"> + + <wsdl:input message="impl:setGetDecimalTypeRequest" name="setGetDecimalTypeRequest"/> + + <wsdl:output message="impl:setGetDecimalTypeResponse" name="setGetDecimalTypeResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetIntegerType"> + + <wsdl:input message="impl:setGetIntegerTypeRequest" name="setGetIntegerTypeRequest"/> + + <wsdl:output message="impl:setGetIntegerTypeResponse" name="setGetIntegerTypeResponse"/> + + </wsdl:operation> + + <wsdl:operation name="setQNameType"> + + <wsdl:input message="impl:setQNameTypeRequest" name="setQNameTypeRequest"/> + + <wsdl:output message="impl:setQNameTypeResponse" name="setQNameTypeResponse"/> + + </wsdl:operation> + + <wsdl:operation name="getQNameType"> + + <wsdl:input message="impl:getQNameTypeRequest" name="getQNameTypeRequest"/> + + <wsdl:output message="impl:getQNameTypeResponse" name="getQNameTypeResponse"/> + + </wsdl:operation> + + <wsdl:operation name="setAnyURIType"> + + <wsdl:input message="impl:setAnyURITypeRequest" name="setAnyURITypeRequest"/> + + <wsdl:output message="impl:setAnyURITypeResponse" name="setAnyURITypeResponse"/> + + </wsdl:operation> + + <wsdl:operation name="getAnyURIType"> + + <wsdl:input message="impl:getAnyURITypeRequest" name="getAnyURITypeRequest"/> + + <wsdl:output message="impl:getAnyURITypeResponse" name="getAnyURITypeResponse"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="XSDElementSoapBinding" type="impl:XSDElement"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="setGetDataInt"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataIntRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataIntResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataUnsignedInt"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataUnsignedIntRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataUnsignedIntResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataLong"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataLongRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataLongResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataUnsignedLong"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataUnsignedLongRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataUnsignedLongResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataDouble"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataDoubleRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataDoubleResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataFloat"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataFloatRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataFloatResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataByte"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataByteRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataByteResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataUnsignedByte"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataUnsignedByteRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataUnsignedByteResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataBoolean"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataBooleanRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataBooleanResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataString"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataStringRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataStringResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataShort"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataShortRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataShortResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataUnsignedShort"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataUnsignedShortRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataUnsignedShortResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDateTimeType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDateTimeTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDateTimeTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDateType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDateTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDateTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataDurationType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataDurationTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataDurationTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetTimeType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetTimeTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetTimeTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetBase64BinaryType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetBase64BinaryTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetBase64BinaryTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetHexBinary"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetHexBinaryRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetHexBinaryResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDecimalType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDecimalTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDecimalTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetIntegerType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetIntegerTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetIntegerTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="getQNameType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="getQNameTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="getQNameTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setQNameType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setQNameTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setQNameTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="getAnyURIType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="getAnyURITypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="getAnyURITypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setAnyURIType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setAnyURITypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setAnyURITypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="XSDElementService"> + + <wsdl:port binding="impl:XSDElementSoapBinding" name="XSDElementPort"> + + <wsdlsoap:address location="http://localhost:9080/XSDElement/services/XSDElementPort"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSDElementNil.wsdl b/axiom/test/resources/wsdl/XSDElementNil.wsdl new file mode 100644 index 0000000..153530b --- /dev/null +++ b/axiom/test/resources/wsdl/XSDElementNil.wsdl @@ -0,0 +1,1414 @@ +<?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://xsdelement.test.apache.org" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://xsdelement.test.apache.org" xmlns:intf="http://xsdelement.test.apache.org" xmlns:tns2="http://complextypes.test.apache.org" 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://xsdelement.test.apache.org" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://xsdelement.test.apache.org" xmlns:intf="http://xsdelement.test.apache.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + + <element name="setGetDataInt"> + <complexType> + <sequence> + <element name="arg_0_2" nillable="true" type="xsd:int"/> + </sequence> + </complexType> + </element> + <element name="setGetDataIntResponse"> + <complexType> + <sequence> + <element name="setGetDataIntReturn" nillable="true" type="xsd:int"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataUnsignedInt"> + <complexType> + <sequence> + <element name="arg_0_u2" nillable="true" type="xsd:unsignedInt"/> + </sequence> + </complexType> + </element> + <element name="setGetDataUnsignedIntResponse"> + <complexType> + <sequence> + <element name="setGetDataUnsignedIntReturn" nillable="true" type="xsd:unsignedInt"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataLong"> + <complexType> + <sequence> + <element name="arg_0_5" nillable="true" type="xsd:long"/> + </sequence> + </complexType> + </element> + <element name="setGetDataLongResponse"> + <complexType> + <sequence> + <element name="setGetDataLongReturn" nillable="true" type="xsd:long"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataUnsignedLong"> + <complexType> + <sequence> + <element name="arg_0_u5" nillable="true" type="xsd:unsignedLong"/> + </sequence> + </complexType> + </element> + <element name="setGetDataUnsignedLongResponse"> + <complexType> + <sequence> + <element name="setGetDataUnsignedLongReturn" nillable="true" type="xsd:unsignedLong"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataByte"> + <complexType> + <sequence> + <element name="arg_0_14" nillable="true" type="xsd:byte"/> + </sequence> + </complexType> + </element> + <element name="setGetDataByteResponse"> + <complexType> + <sequence> + <element name="setGetDataByteReturn" nillable="true" type="xsd:byte"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataUnsignedByte"> + <complexType> + <sequence> + <element name="arg_0_u14" nillable="true" type="xsd:unsignedByte"/> + </sequence> + </complexType> + </element> + <element name="setGetDataUnsignedByteResponse"> + <complexType> + <sequence> + <element name="setGetDataUnsignedByteReturn" nillable="true" type="xsd:unsignedByte"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataShort"> + <complexType> + <sequence> + <element name="arg_0_26" nillable="true" type="xsd:short"/> + </sequence> + </complexType> + </element> + <element name="setGetDataShortResponse"> + <complexType> + <sequence> + <element name="setGetDataShortReturn" nillable="true" type="xsd:short"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataUnsignedShort"> + <complexType> + <sequence> + <element name="arg_0_u26" nillable="true" type="xsd:unsignedShort"/> + </sequence> + </complexType> + </element> + <element name="setGetDataUnsignedShortResponse"> + <complexType> + <sequence> + <element name="setGetDataUnsignedShortReturn" nillable="true" type="xsd:unsignedShort"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataBoolean"> + <complexType> + <sequence> + <element name="arg_0_17" nillable="true" type="xsd:boolean"/> + </sequence> + </complexType> + </element> + <element name="setGetDataBooleanResponse"> + <complexType> + <sequence> + <element name="setGetDataBooleanReturn" nillable="true" type="xsd:boolean"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataDouble"> + <complexType> + <sequence> + <element name="arg_0_8" nillable="true" type="xsd:double"/> + </sequence> + </complexType> + </element> + <element name="setGetDataDoubleResponse"> + <complexType> + <sequence> + <element name="setGetDataDoubleReturn" nillable="true" type="xsd:double"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataFloat"> + <complexType> + <sequence> + <element name="arg_0_11" nillable="true" type="xsd:float"/> + </sequence> + </complexType> + </element> + <element name="setGetDataFloatResponse"> + <complexType> + <sequence> + <element name="setGetDataFloatReturn" nillable="true" type="xsd:float"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataString"> + <complexType> + <sequence> + <element name="arg_0_23" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + <element name="setGetDataStringResponse"> + <complexType> + <sequence> + <element name="setGetDataStringReturn" nillable="true" type="xsd:string"/> + </sequence> + </complexType> + </element> + + <element name="setGetDateTimeType"> + <complexType> + <sequence> + <element name="arg_0_32" nillable="true" type="xsd:dateTime"/> + </sequence> + </complexType> + </element> + <element name="setGetDateTimeTypeResponse"> + <complexType> + <sequence> + <element name="setGetDateTimeTypeReturn" nillable="true" type="xsd:dateTime"/> + </sequence> + </complexType> + </element> + + <element name="setGetDateType"> + <complexType> + <sequence> + <element name="arg_0_35" nillable="true" type="xsd:date"/> + </sequence> + </complexType> + </element> + <element name="setGetDateTypeResponse"> + <complexType> + <sequence> + <element name="setGetDateTypeReturn" nillable="true" type="xsd:date"/> + </sequence> + </complexType> + </element> + + <element name="setGetDataDurationType"> + <complexType> + <sequence> + <element name="arg_0_d35" nillable="true" type="xsd:duration"/> + </sequence> + </complexType> + </element> + <element name="setGetDataDurationTypeResponse"> + <complexType> + <sequence> + <element name="setGetDataDurationTypeReturn" nillable="true" type="xsd:duration"/> + </sequence> + </complexType> + </element> + + <element name="setGetTimeType"> + <complexType> + <sequence> + <element name="arg_0_38" nillable="true" type="xsd:time"/> + </sequence> + </complexType> + </element> + <element name="setGetTimeTypeResponse"> + <complexType> + <sequence> + <element name="setGetTimeTypeReturn" nillable="true" type="xsd:time"/> + </sequence> + </complexType> + </element> + + <element name="setGetBase64BinaryType"> + <complexType> + <sequence> + <element name="arg_0_41" nillable="true" type="xsd:base64Binary"/> + </sequence> + </complexType> + </element> + <element name="setGetBase64BinaryTypeResponse"> + <complexType> + <sequence> + <element name="setGetBase64BinaryTypeReturn" nillable="true" type="xsd:base64Binary"/> + </sequence> + </complexType> + </element> + + <element name="setGetHexBinary"> + <complexType> + <sequence> + <element name="arg_0_44" nillable="true" type="xsd:hexBinary"/> + </sequence> + </complexType> + </element> + <element name="setGetHexBinaryResponse"> + <complexType> + <sequence> + <element name="setGetHexBinaryReturn" nillable="true" type="xsd:hexBinary"/> + </sequence> + </complexType> + </element> + + <element name="setGetDecimalType"> + <complexType> + <sequence> + <element name="arg_0_47" nillable="true" type="xsd:decimal"/> + </sequence> + </complexType> + </element> + <element name="setGetDecimalTypeResponse"> + <complexType> + <sequence> + <element name="setGetDecimalTypeReturn" nillable="true" type="xsd:decimal"/> + </sequence> + </complexType> + </element> + + <element name="setGetIntegerType"> + <complexType> + <sequence> + <element name="arg_0_50" nillable="true" type="xsd:integer"/> + </sequence> + </complexType> + </element> + <element name="setGetIntegerTypeResponse"> + <complexType> + <sequence> + <element name="setGetIntegerTypeReturn" nillable="true" type="xsd:integer"/> + </sequence> + </complexType> + </element> + + <element name="getQNameType"> + <complexType> + <sequence/> + </complexType> + </element> + <element name="getQNameTypeResponse"> + <complexType> + <sequence> + <element name="getQNameTypeReturn" nillable="true" type="xsd:QName"/> + </sequence> + </complexType> + </element> + <element name="setQNameType"> + <complexType> + <sequence> + <element name="arg_0_52" nillable="true" type="xsd:QName"/> + </sequence> + </complexType> + </element> + <element name="setQNameTypeResponse"> + <complexType> + <sequence/> + </complexType> + </element> + + <element name="getAnyURIType"> + <complexType> + <sequence/> + </complexType> + </element> + <element name="getAnyURITypeResponse"> + <complexType> + <sequence> + <element name="getAnyURITypeReturn" nillable="true" type="xsd:anyURI"/> + </sequence> + </complexType> + </element> + <element name="setAnyURIType"> + <complexType> + <sequence> + <element name="arg_0_a52" nillable="true" type="xsd:anyURI"/> + </sequence> + </complexType> + </element> + <element name="setAnyURITypeResponse"> + <complexType> + <sequence/> + </complexType> + </element> + + </schema> + + </wsdl:types> + + + + <wsdl:message name="setGetDataIntRequest"> + + <wsdl:part element="impl:setGetDataInt" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataUnsignedIntRequest"> + + <wsdl:part element="impl:setGetDataUnsignedInt" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setGetDataIntResponse"> + + <wsdl:part element="impl:setGetDataIntResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setGetDataUnsignedIntResponse"> + + <wsdl:part element="impl:setGetDataUnsignedIntResponse" name="parameters"/> + + </wsdl:message> + + + <wsdl:message name="setGetDataByteRequest"> + + <wsdl:part element="impl:setGetDataByte" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataUnsignedByteRequest"> + + <wsdl:part element="impl:setGetDataUnsignedByte" name="parameters"/> + + </wsdl:message> + + + <wsdl:message name="setGetDataByteResponse"> + + <wsdl:part element="impl:setGetDataByteResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setGetDataUnsignedByteResponse"> + + <wsdl:part element="impl:setGetDataUnsignedByteResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setGetDataLongRequest"> + + <wsdl:part element="impl:setGetDataLong" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataLongResponse"> + + <wsdl:part element="impl:setGetDataLongResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataUnsignedLongRequest"> + + <wsdl:part element="impl:setGetDataUnsignedLong" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataUnsignedLongResponse"> + + <wsdl:part element="impl:setGetDataUnsignedLongResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataShortRequest"> + + <wsdl:part element="impl:setGetDataShort" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataShortResponse"> + + <wsdl:part element="impl:setGetDataShortResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataUnsignedShortRequest"> + + <wsdl:part element="impl:setGetDataUnsignedShort" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataUnsignedShortResponse"> + + <wsdl:part element="impl:setGetDataUnsignedShortResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataBooleanRequest"> + + <wsdl:part element="impl:setGetDataBoolean" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataBooleanResponse"> + + <wsdl:part element="impl:setGetDataBooleanResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataFloatRequest"> + + <wsdl:part element="impl:setGetDataFloat" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataFloatResponse"> + + <wsdl:part element="impl:setGetDataFloatResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataDoubleRequest"> + + <wsdl:part element="impl:setGetDataDouble" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataDoubleResponse"> + + <wsdl:part element="impl:setGetDataDoubleResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDecimalTypeRequest"> + + <wsdl:part element="impl:setGetDecimalType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDecimalTypeResponse"> + + <wsdl:part element="impl:setGetDecimalTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetHexBinaryRequest"> + + <wsdl:part element="impl:setGetHexBinary" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetHexBinaryResponse"> + + <wsdl:part element="impl:setGetHexBinaryResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetBase64BinaryTypeRequest"> + + <wsdl:part element="impl:setGetBase64BinaryType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetBase64BinaryTypeResponse"> + + <wsdl:part element="impl:setGetBase64BinaryTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDateTimeTypeRequest"> + + <wsdl:part element="impl:setGetDateTimeType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDateTimeTypeResponse"> + + <wsdl:part element="impl:setGetDateTimeTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetIntegerTypeRequest"> + + <wsdl:part element="impl:setGetIntegerType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetIntegerTypeResponse"> + + <wsdl:part element="impl:setGetIntegerTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataStringRequest"> + + <wsdl:part element="impl:setGetDataString" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataStringResponse"> + + <wsdl:part element="impl:setGetDataStringResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setAnyURITypeRequest"> + + <wsdl:part element="impl:setAnyURIType" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getAnyURITypeRequest"> + + <wsdl:part element="impl:getAnyURIType" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setAnyURITypeResponse"> + + <wsdl:part element="impl:setAnyURITypeResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getAnyURITypeResponse"> + + <wsdl:part element="impl:getAnyURITypeResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setQNameTypeRequest"> + + <wsdl:part element="impl:setQNameType" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getQNameTypeRequest"> + + <wsdl:part element="impl:getQNameType" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="setQNameTypeResponse"> + + <wsdl:part element="impl:setQNameTypeResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:message name="getQNameTypeResponse"> + + <wsdl:part element="impl:getQNameTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDateTypeRequest"> + + <wsdl:part element="impl:setGetDateType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDateTypeResponse"> + + <wsdl:part element="impl:setGetDateTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataDurationTypeRequest"> + + <wsdl:part element="impl:setGetDataDurationType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetDataDurationTypeResponse"> + + <wsdl:part element="impl:setGetDataDurationTypeResponse" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetTimeTypeRequest"> + + <wsdl:part element="impl:setGetTimeType" name="parameters"/> + + </wsdl:message> + + + + <wsdl:message name="setGetTimeTypeResponse"> + + <wsdl:part element="impl:setGetTimeTypeResponse" name="parameters"/> + + </wsdl:message> + + <wsdl:portType name="XSDElementNil"> + + <wsdl:operation name="setGetDataInt"> + + <wsdl:input message="impl:setGetDataIntRequest" name="setGetDataIntRequest"/> + + <wsdl:output message="impl:setGetDataIntResponse" name="setGetDataIntResponse"/> + + </wsdl:operation> + + <wsdl:operation name="setGetDataUnsignedInt"> + + <wsdl:input message="impl:setGetDataUnsignedIntRequest" name="setGetDataUnsignedIntRequest"/> + + <wsdl:output message="impl:setGetDataUnsignedIntResponse" name="setGetDataUnsignedIntResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataLong"> + + <wsdl:input message="impl:setGetDataLongRequest" name="setGetDataLongRequest"/> + + <wsdl:output message="impl:setGetDataLongResponse" name="setGetDataLongResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataUnsignedLong"> + + <wsdl:input message="impl:setGetDataUnsignedLongRequest" name="setGetDataUnsignedLongRequest"/> + + <wsdl:output message="impl:setGetDataUnsignedLongResponse" name="setGetDataUnsignedLongResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataDouble"> + + <wsdl:input message="impl:setGetDataDoubleRequest" name="setGetDataDoubleRequest"/> + + <wsdl:output message="impl:setGetDataDoubleResponse" name="setGetDataDoubleResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataFloat"> + + <wsdl:input message="impl:setGetDataFloatRequest" name="setGetDataFloatRequest"/> + + <wsdl:output message="impl:setGetDataFloatResponse" name="setGetDataFloatResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataByte"> + + <wsdl:input message="impl:setGetDataByteRequest" name="setGetDataByteRequest"/> + + <wsdl:output message="impl:setGetDataByteResponse" name="setGetDataByteResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataUnsignedByte"> + + <wsdl:input message="impl:setGetDataUnsignedByteRequest" name="setGetDataUnsignedByteRequest"/> + + <wsdl:output message="impl:setGetDataUnsignedByteResponse" name="setGetDataUnsignedByteResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataBoolean"> + + <wsdl:input message="impl:setGetDataBooleanRequest" name="setGetDataBooleanRequest"/> + + <wsdl:output message="impl:setGetDataBooleanResponse" name="setGetDataBooleanResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataString"> + + <wsdl:input message="impl:setGetDataStringRequest" name="setGetDataStringRequest"/> + + <wsdl:output message="impl:setGetDataStringResponse" name="setGetDataStringResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataShort"> + + <wsdl:input message="impl:setGetDataShortRequest" name="setGetDataShortRequest"/> + + <wsdl:output message="impl:setGetDataShortResponse" name="setGetDataShortResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataUnsignedShort"> + + <wsdl:input message="impl:setGetDataUnsignedShortRequest" name="setGetDataUnsignedShortRequest"/> + + <wsdl:output message="impl:setGetDataUnsignedShortResponse" name="setGetDataUnsignedShortResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDateTimeType"> + + <wsdl:input message="impl:setGetDateTimeTypeRequest" name="setGetDateTimeTypeRequest"/> + + <wsdl:output message="impl:setGetDateTimeTypeResponse" name="setGetDateTimeTypeResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDateType"> + + <wsdl:input message="impl:setGetDateTypeRequest" name="setGetDateTypeRequest"/> + + <wsdl:output message="impl:setGetDateTypeResponse" name="setGetDateTypeResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDataDurationType"> + + <wsdl:input message="impl:setGetDataDurationTypeRequest" name="setGetDataDurationTypeRequest"/> + + <wsdl:output message="impl:setGetDataDurationTypeResponse" name="setGetDataDurationTypeResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetTimeType"> + + <wsdl:input message="impl:setGetTimeTypeRequest" name="setGetTimeTypeRequest"/> + + <wsdl:output message="impl:setGetTimeTypeResponse" name="setGetTimeTypeResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetBase64BinaryType"> + + <wsdl:input message="impl:setGetBase64BinaryTypeRequest" name="setGetBase64BinaryTypeRequest"/> + + <wsdl:output message="impl:setGetBase64BinaryTypeResponse" name="setGetBase64BinaryTypeResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetHexBinary"> + + <wsdl:input message="impl:setGetHexBinaryRequest" name="setGetHexBinaryRequest"/> + + <wsdl:output message="impl:setGetHexBinaryResponse" name="setGetHexBinaryResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetDecimalType"> + + <wsdl:input message="impl:setGetDecimalTypeRequest" name="setGetDecimalTypeRequest"/> + + <wsdl:output message="impl:setGetDecimalTypeResponse" name="setGetDecimalTypeResponse"/> + + </wsdl:operation> + + + + <wsdl:operation name="setGetIntegerType"> + + <wsdl:input message="impl:setGetIntegerTypeRequest" name="setGetIntegerTypeRequest"/> + + <wsdl:output message="impl:setGetIntegerTypeResponse" name="setGetIntegerTypeResponse"/> + + </wsdl:operation> + + <wsdl:operation name="setQNameType"> + + <wsdl:input message="impl:setQNameTypeRequest" name="setQNameTypeRequest"/> + + <wsdl:output message="impl:setQNameTypeResponse" name="setQNameTypeResponse"/> + + </wsdl:operation> + + <wsdl:operation name="getQNameType"> + + <wsdl:input message="impl:getQNameTypeRequest" name="getQNameTypeRequest"/> + + <wsdl:output message="impl:getQNameTypeResponse" name="getQNameTypeResponse"/> + + </wsdl:operation> + + <wsdl:operation name="setAnyURIType"> + + <wsdl:input message="impl:setAnyURITypeRequest" name="setAnyURITypeRequest"/> + + <wsdl:output message="impl:setAnyURITypeResponse" name="setAnyURITypeResponse"/> + + </wsdl:operation> + + <wsdl:operation name="getAnyURIType"> + + <wsdl:input message="impl:getAnyURITypeRequest" name="getAnyURITypeRequest"/> + + <wsdl:output message="impl:getAnyURITypeResponse" name="getAnyURITypeResponse"/> + + </wsdl:operation> + + </wsdl:portType> + + <wsdl:binding name="XSDElementNilSoapBinding" type="impl:XSDElementNil"> + + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + + <wsdl:operation name="setGetDataInt"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataIntRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataIntResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataUnsignedInt"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataUnsignedIntRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataUnsignedIntResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataLong"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataLongRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataLongResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataUnsignedLong"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataUnsignedLongRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataUnsignedLongResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataDouble"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataDoubleRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataDoubleResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataFloat"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataFloatRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataFloatResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataByte"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataByteRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataByteResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataUnsignedByte"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataUnsignedByteRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataUnsignedByteResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataBoolean"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataBooleanRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataBooleanResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataString"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataStringRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataStringResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataShort"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataShortRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataShortResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataUnsignedShort"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataUnsignedShortRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataUnsignedShortResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDateTimeType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDateTimeTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDateTimeTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDateType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDateTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDateTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDataDurationType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDataDurationTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDataDurationTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetTimeType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetTimeTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetTimeTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetBase64BinaryType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetBase64BinaryTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetBase64BinaryTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetHexBinary"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetHexBinaryRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetHexBinaryResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetDecimalType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetDecimalTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetDecimalTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setGetIntegerType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setGetIntegerTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setGetIntegerTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="getQNameType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="getQNameTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="getQNameTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setQNameType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setQNameTypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setQNameTypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="getAnyURIType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="getAnyURITypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="getAnyURITypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + <wsdl:operation name="setAnyURIType"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="setAnyURITypeRequest"> + + <wsdlsoap:body use="literal"/> + + </wsdl:input> + + <wsdl:output name="setAnyURITypeResponse"> + + <wsdlsoap:body use="literal"/> + + </wsdl:output> + + </wsdl:operation> + + </wsdl:binding> + + <wsdl:service name="XSDElementNilService"> + + <wsdl:port binding="impl:XSDElementNilSoapBinding" name="XSDElementNilPort"> + + <wsdlsoap:address location="http://localhost:9080/XSDElement/services/XSDElementNilPort"/> + + </wsdl:port> + + </wsdl:service> + +</wsdl:definitions> + diff --git a/axiom/test/resources/wsdl/XSD_ENTITIES.wsdl b/axiom/test/resources/wsdl/XSD_ENTITIES.wsdl new file mode 100644 index 0000000..56628fb --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_ENTITIES.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_ENTITIES.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_ENTITIES" + targetNamespace="http://xsd_ENTITIES.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_ENTITIES.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:ENTITIES" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:ENTITIES" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:ENTITIES" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:ENTITIES" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:ENTITIES" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:ENTITIES" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:ENTITIES" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:ENTITIES" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:ENTITIES" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_ENTITIESPort"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_ENTITIESSOAP" type="tns:XSD_ENTITIESPort"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_ENTITIESPort#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_ENTITIESPort#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_ENTITIESPort#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_ENTITIESPort#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_ENTITIESPort#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_ENTITIESPort#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_ENTITIES"> + <wsdl:port binding="tns:XSD_ENTITIESSOAP" + name="XSD_ENTITIESSOAP"> + <soap:address + location="http://localhost:9080/XSD_ENTITIES/services/XSD_ENTITIESPort" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_ENTITY.wsdl b/axiom/test/resources/wsdl/XSD_ENTITY.wsdl new file mode 100644 index 0000000..e18be29 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_ENTITY.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_ENTITY.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_ENTITY" + targetNamespace="http://xsd_ENTITY.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_ENTITY.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:ENTITY" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:ENTITY" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:ENTITY" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:ENTITY" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:ENTITY" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:ENTITY" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:ENTITY" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:ENTITY" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:ENTITY" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_ENTITYPort"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_ENTITYSOAP" type="tns:XSD_ENTITYPort"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_ENTITYPort#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_ENTITYPort#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_ENTITYPort#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_ENTITYPort#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_ENTITYPort#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_ENTITYPort#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_ENTITY"> + <wsdl:port binding="tns:XSD_ENTITYSOAP" + name="XSD_ENTITYSOAP"> + <soap:address + location="http://localhost:9080/XSD_ENTITY/services/XSD_ENTITYPort" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_ID.wsdl b/axiom/test/resources/wsdl/XSD_ID.wsdl new file mode 100644 index 0000000..06f931b --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_ID.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_ID.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_ID" + targetNamespace="http://xsd_ID.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_ID.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:ID" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:ID" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:ID" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:ID" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:ID" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:ID" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:ID" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:ID" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:ID" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_IDPort"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_IDSOAP" type="tns:XSD_IDPort"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_IDPort#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_IDPort#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_IDPort#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_IDPort#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_IDPort#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_IDPort#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_ID"> + <wsdl:port binding="tns:XSD_IDSOAP" + name="XSD_IDSOAP"> + <soap:address + location="http://localhost:9080/XSD_ID/services/XSD_IDPort" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_IDREF.wsdl b/axiom/test/resources/wsdl/XSD_IDREF.wsdl new file mode 100644 index 0000000..8306b44 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_IDREF.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_IDREF.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_IDREF" + targetNamespace="http://xsd_IDREF.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_IDREF.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:IDREF" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:IDREF" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:IDREF" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:IDREF" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:IDREF" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:IDREF" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:IDREF" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:IDREF" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:IDREF" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_IDREFPort"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_IDREFSOAP" type="tns:XSD_IDREFPort"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_IDREFPort#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_IDREFPort#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_IDREFPort#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_IDREFPort#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_IDREFPort#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_IDREFPort#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_IDREF"> + <wsdl:port binding="tns:XSD_IDREFSOAP" + name="XSD_IDREFSOAP"> + <soap:address + location="http://localhost:9080/XSD_IDREF/services/XSD_IDREFPort" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_IDREFS.wsdl b/axiom/test/resources/wsdl/XSD_IDREFS.wsdl new file mode 100644 index 0000000..cdec7fb --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_IDREFS.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_IDREFS.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_IDREFS" + targetNamespace="http://xsd_IDREFS.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_IDREFS.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:IDREFS" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:IDREFS" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:IDREFS" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:IDREFS" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:IDREFS" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:IDREFS" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:IDREFS" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:IDREFS" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:IDREFS" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_IDREFSPort"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_IDREFSSOAP" type="tns:XSD_IDREFSPort"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_IDREFSPort#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_IDREFSPort#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_IDREFSPort#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_IDREFSPort#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_IDREFSPort#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_IDREFSPort#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_IDREFS"> + <wsdl:port binding="tns:XSD_IDREFSSOAP" + name="XSD_IDREFSSOAP"> + <soap:address + location="http://localhost:9080/XSD_IDREFS/services/XSD_IDREFSPort" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_NCName.wsdl b/axiom/test/resources/wsdl/XSD_NCName.wsdl new file mode 100644 index 0000000..b65e656 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_NCName.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_NCName.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_NCName" + targetNamespace="http://xsd_NCName.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_NCName.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:NCName" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:NCName" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:NCName" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:NCName" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:NCName" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:NCName" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:NCName" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:NCName" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:NCName" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_NCName"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_NCNameSOAP" type="tns:XSD_NCName"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_NCName#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_NCName#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_NCName#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_NCName#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_NCName#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_NCName#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_NCName"> + <wsdl:port binding="tns:XSD_NCNameSOAP" + name="XSD_NCNameSOAP"> + <soap:address + location="http://localhost:9080/XSD_NCName/services/XSD_NCName" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_NMTOKEN.wsdl b/axiom/test/resources/wsdl/XSD_NMTOKEN.wsdl new file mode 100644 index 0000000..184d47c --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_NMTOKEN.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_NMTOKEN.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_NMTOKEN" + targetNamespace="http://xsd_NMTOKEN.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_NMTOKEN.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:NMTOKEN" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:NMTOKEN" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:NMTOKEN" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:NMTOKEN" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:NMTOKEN" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:NMTOKEN" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:NMTOKEN" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:NMTOKEN" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:NMTOKEN" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_NMTOKENPort"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_NMTOKENSOAP" type="tns:XSD_NMTOKENPort"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_NMTOKENPort#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_NMTOKENPort#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_NMTOKENPort#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_NMTOKENPort#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_NMTOKENPort#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_NMTOKENPort#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_NMTOKEN"> + <wsdl:port binding="tns:XSD_NMTOKENSOAP" + name="XSD_NMTOKENSOAP"> + <soap:address + location="http://localhost:9080/XSD_NMTOKEN/services/XSD_NMTOKENPort" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_NMTOKENS.wsdl b/axiom/test/resources/wsdl/XSD_NMTOKENS.wsdl new file mode 100644 index 0000000..6100b1a --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_NMTOKENS.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_NMTOKENS.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_NMTOKENS" + targetNamespace="http://xsd_NMTOKENS.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_NMTOKENS.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:NMTOKENS" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:NMTOKENS" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:NMTOKENS" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:NMTOKENS" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:NMTOKENS" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:NMTOKENS" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:NMTOKENS" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:NMTOKENS" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:NMTOKENS" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_NMTOKENSPort"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_NMTOKENSSOAP" type="tns:XSD_NMTOKENSPort"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_NMTOKENSPort#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_NMTOKENSPort#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_NMTOKENSPort#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_NMTOKENSPort#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_NMTOKENSPort#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_NMTOKENSPort#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_NMTOKENS"> + <wsdl:port binding="tns:XSD_NMTOKENSSOAP" + name="XSD_NMTOKENSSOAP"> + <soap:address + location="http://localhost:9080/XSD_NMTOKENS/services/XSD_NMTOKENSPort" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_NOTATION.wsdl b/axiom/test/resources/wsdl/XSD_NOTATION.wsdl new file mode 100644 index 0000000..564985c --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_NOTATION.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_NOTATION.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_NOTATION" + targetNamespace="http://xsd_NOTATION.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_NOTATION.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:NOTATION" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:NOTATION" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:NOTATION" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:NOTATION" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:NOTATION" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:NOTATION" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:NOTATION" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:NOTATION" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:NOTATION" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_NOTATIONPort"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_NOTATIONSOAP" type="tns:XSD_NOTATIONPort"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_NOTATIONPort#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_NOTATIONPort#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_NOTATIONPort#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_NOTATIONPort#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_NOTATIONPort#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_NOTATIONPort#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_NOTATION"> + <wsdl:port binding="tns:XSD_NOTATIONSOAP" + name="XSD_NOTATIONSOAP"> + <soap:address + location="http://localhost:9080/XSD_NOTATION/services/XSD_NOTATIONPort" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_Name.wsdl b/axiom/test/resources/wsdl/XSD_Name.wsdl new file mode 100644 index 0000000..5198b1c --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_Name.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_Name.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_Name" + targetNamespace="http://xsd_Name.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_Name.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:Name" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:Name" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:Name" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:Name" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:Name" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:Name" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:Name" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:Name" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:Name" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_Name"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_NameSOAP" type="tns:XSD_Name"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_Name#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_Name#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_Name#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_Name#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_Name#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_Name#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_Name"> + <wsdl:port binding="tns:XSD_NameSOAP" + name="XSD_NameSOAP"> + <soap:address + location="http://localhost:9080/XSD_Name/services/XSD_Name" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_QName.wsdl b/axiom/test/resources/wsdl/XSD_QName.wsdl new file mode 100644 index 0000000..7fca9ff --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_QName.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_QName.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_QName" + targetNamespace="http://xsd_QName.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_QName.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:QName" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:QName" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:QName" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:QName" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:QName" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:QName" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:QName" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:QName" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:QName" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_QName"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_QNameSOAP" type="tns:XSD_QName"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_QName#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_QName#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_QName#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_QName#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_QName#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_QName#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_QName"> + <wsdl:port binding="tns:XSD_QNameSOAP" + name="XSD_QNameSOAP"> + <soap:address + location="http://localhost:9080/XSD_QName/services/XSD_QName" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_anyURI.wsdl b/axiom/test/resources/wsdl/XSD_anyURI.wsdl new file mode 100644 index 0000000..73410d8 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_anyURI.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_anyURI.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_anyURI" + targetNamespace="http://xsd_anyURI.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_anyURI.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:anyURI" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:anyURI" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:anyURI" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:anyURI" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:anyURI" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:anyURI" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:anyURI" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:anyURI" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:anyURI" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_anyURI"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_anyURISOAP" type="tns:XSD_anyURI"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_anyURI#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_anyURI#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_anyURI#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_anyURI#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_anyURI#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_anyURI#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_anyURI"> + <wsdl:port binding="tns:XSD_anyURISOAP" + name="XSD_anyURISOAP"> + <soap:address + location="http://localhost:9080/XSD_anyURI/services/XSD_anyURI" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_base64Binary.wsdl b/axiom/test/resources/wsdl/XSD_base64Binary.wsdl new file mode 100644 index 0000000..e7b1ae8 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_base64Binary.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_base64Binary.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_base64Binary" + targetNamespace="http://xsd_base64Binary.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_base64Binary.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:base64Binary" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:base64Binary" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:base64Binary" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:base64Binary" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:base64Binary" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:base64Binary" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:base64Binary" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:base64Binary" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:base64Binary" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_base64Binary"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_base64BinarySOAP" type="tns:XSD_base64Binary"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_base64Binary#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_base64Binary#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_base64Binary#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_base64Binary#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_base64Binary#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_base64Binary#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_base64Binary"> + <wsdl:port binding="tns:XSD_base64BinarySOAP" + name="XSD_base64BinarySOAP"> + <soap:address + location="http://localhost:9080/XSD_base64Binary/services/XSD_base64Binary" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_boolean.wsdl b/axiom/test/resources/wsdl/XSD_boolean.wsdl new file mode 100644 index 0000000..906ba02 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_boolean.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_boolean.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_boolean" + targetNamespace="http://xsd_boolean.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_boolean.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:boolean" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:boolean" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:boolean" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:boolean" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:boolean" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:boolean" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:boolean" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:boolean" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:boolean" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_boolean"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_booleanSOAP" type="tns:XSD_boolean"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_boolean#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_boolean#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_boolean#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_boolean#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_boolean#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_boolean#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_boolean"> + <wsdl:port binding="tns:XSD_booleanSOAP" + name="XSD_booleanSOAP"> + <soap:address + location="http://localhost:9080/XSD_boolean/services/XSD_boolean" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_byte.wsdl b/axiom/test/resources/wsdl/XSD_byte.wsdl new file mode 100644 index 0000000..52aa1d3 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_byte.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_byte.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_byte" + targetNamespace="http://xsd_byte.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_byte.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:byte" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:byte" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:byte" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:byte" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:byte" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:byte" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:byte" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:byte" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:byte" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_byte"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_byteSOAP" type="tns:XSD_byte"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_byte#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_byte#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_byte#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_byte#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_byte#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_byte#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_byte"> + <wsdl:port binding="tns:XSD_byteSOAP" + name="XSD_byteSOAP"> + <soap:address + location="http://localhost:9080/XSD_byte/services/XSD_byte" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_date.wsdl b/axiom/test/resources/wsdl/XSD_date.wsdl new file mode 100644 index 0000000..013a3f9 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_date.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_date.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_date" + targetNamespace="http://xsd_date.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_date.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:date" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:date" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:date" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:date" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:date" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:date" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:date" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:date" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:date" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_date"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_dateSOAP" type="tns:XSD_date"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_date#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_date#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_date#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_date#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_date#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_date#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_date"> + <wsdl:port binding="tns:XSD_dateSOAP" + name="XSD_dateSOAP"> + <soap:address + location="http://localhost:9080/XSD_date/services/XSD_date" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_dateTime.wsdl b/axiom/test/resources/wsdl/XSD_dateTime.wsdl new file mode 100644 index 0000000..5031ca6 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_dateTime.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_dateTime.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_dateTime" + targetNamespace="http://xsd_dateTime.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_dateTime.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:dateTime" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:dateTime" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:dateTime" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:dateTime" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:dateTime" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:dateTime" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:dateTime" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:dateTime" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:dateTime" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_dateTime"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_dateTimeSOAP" type="tns:XSD_dateTime"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_dateTime#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_dateTime#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_dateTime#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_dateTime#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_dateTime#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_dateTime#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_dateTime"> + <wsdl:port binding="tns:XSD_dateTimeSOAP" + name="XSD_dateTimeSOAP"> + <soap:address + location="http://localhost:9080/XSD_dateTime/services/XSD_dateTime" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_decimal.wsdl b/axiom/test/resources/wsdl/XSD_decimal.wsdl new file mode 100644 index 0000000..587107a --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_decimal.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_decimal.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_decimal" + targetNamespace="http://xsd_decimal.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_decimal.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:decimal" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:decimal" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:decimal" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:decimal" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:decimal" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:decimal" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:decimal" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:decimal" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:decimal" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_decimal"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_decimalSOAP" type="tns:XSD_decimal"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_decimal#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_decimal#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_decimal#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_decimal#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_decimal#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_decimal#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_decimal"> + <wsdl:port binding="tns:XSD_decimalSOAP" + name="XSD_decimalSOAP"> + <soap:address + location="http://localhost:9080/XSD_decimal/services/XSD_decimal" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_double.wsdl b/axiom/test/resources/wsdl/XSD_double.wsdl new file mode 100644 index 0000000..51eb810 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_double.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_double.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_double" + targetNamespace="http://xsd_double.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_double.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:double" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:double" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:double" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:double" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:double" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:double" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:double" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:double" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:double" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_double"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_doubleSOAP" type="tns:XSD_double"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_double#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_double#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_double#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_double#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_double#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_double#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_double"> + <wsdl:port binding="tns:XSD_doubleSOAP" + name="XSD_doubleSOAP"> + <soap:address + location="http://localhost:9080/XSD_double/services/XSD_double" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_duration.wsdl b/axiom/test/resources/wsdl/XSD_duration.wsdl new file mode 100644 index 0000000..31a8b18 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_duration.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_duration.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_duration" + targetNamespace="http://xsd_duration.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_duration.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:duration" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:duration" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:duration" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:duration" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:duration" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:duration" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:duration" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:duration" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:duration" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_duration"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_durationSOAP" type="tns:XSD_duration"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_duration#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_duration#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_duration#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_duration#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_duration#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_duration#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_duration"> + <wsdl:port binding="tns:XSD_durationSOAP" + name="XSD_durationSOAP"> + <soap:address + location="http://localhost:9080/XSD_duration/services/XSD_duration" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_float.wsdl b/axiom/test/resources/wsdl/XSD_float.wsdl new file mode 100644 index 0000000..dcc7464 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_float.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_float.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_float" + targetNamespace="http://xsd_float.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_float.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:float" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:float" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:float" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:float" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:float" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:float" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:float" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:float" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:float" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_float"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_floatSOAP" type="tns:XSD_float"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_float#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_float#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_float#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_float#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_float#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_float#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_float"> + <wsdl:port binding="tns:XSD_floatSOAP" + name="XSD_floatSOAP"> + <soap:address + location="http://localhost:9080/XSD_float/services/XSD_float" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_gDay.wsdl b/axiom/test/resources/wsdl/XSD_gDay.wsdl new file mode 100644 index 0000000..2508f5d --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_gDay.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_gDay.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_gDay" + targetNamespace="http://xsd_gDay.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_gDay.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:gDay" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:gDay" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:gDay" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:gDay" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:gDay" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:gDay" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:gDay" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:gDay" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:gDay" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_gDay"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_gDaySOAP" type="tns:XSD_gDay"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_gDay#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_gDay#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_gDay#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_gDay#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_gDay#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_gDay#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_gDay"> + <wsdl:port binding="tns:XSD_gDaySOAP" + name="XSD_gDaySOAP"> + <soap:address + location="http://localhost:9080/XSD_gDay/services/XSD_gDay" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_gMonth.wsdl b/axiom/test/resources/wsdl/XSD_gMonth.wsdl new file mode 100644 index 0000000..1d05d42 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_gMonth.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_gMonth.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_gMonth" + targetNamespace="http://xsd_gMonth.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_gMonth.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:gMonth" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:gMonth" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:gMonth" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:gMonth" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:gMonth" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:gMonth" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:gMonth" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:gMonth" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:gMonth" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_gMonth"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_gMonthSOAP" type="tns:XSD_gMonth"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_gMonth#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_gMonth#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_gMonth#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_gMonth#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_gMonth#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_gMonth#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_gMonth"> + <wsdl:port binding="tns:XSD_gMonthSOAP" + name="XSD_gMonthSOAP"> + <soap:address + location="http://localhost:9080/XSD_gMonth/services/XSD_gMonth" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_gMonthDay.wsdl b/axiom/test/resources/wsdl/XSD_gMonthDay.wsdl new file mode 100644 index 0000000..6d06f45 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_gMonthDay.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_gMonthDay.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_gMonthDay" + targetNamespace="http://xsd_gMonthDay.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_gMonthDay.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:gMonthDay" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:gMonthDay" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:gMonthDay" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:gMonthDay" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:gMonthDay" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:gMonthDay" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:gMonthDay" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:gMonthDay" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:gMonthDay" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_gMonthDay"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_gMonthDaySOAP" type="tns:XSD_gMonthDay"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_gMonthDay#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_gMonthDay#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_gMonthDay#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_gMonthDay#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_gMonthDay#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_gMonthDay#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_gMonthDay"> + <wsdl:port binding="tns:XSD_gMonthDaySOAP" + name="XSD_gMonthDaySOAP"> + <soap:address + location="http://localhost:9080/XSD_gMonthDay/services/XSD_gMonthDay" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_gYear.wsdl b/axiom/test/resources/wsdl/XSD_gYear.wsdl new file mode 100644 index 0000000..0135260 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_gYear.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_gYear.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_gYear" + targetNamespace="http://xsd_gYear.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_gYear.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:gYear" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:gYear" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:gYear" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:gYear" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:gYear" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:gYear" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:gYear" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:gYear" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:gYear" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_gYear"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_gYearSOAP" type="tns:XSD_gYear"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_gYear#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_gYear#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_gYear#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_gYear#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_gYear#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_gYear#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_gYear"> + <wsdl:port binding="tns:XSD_gYearSOAP" + name="XSD_gYearSOAP"> + <soap:address + location="http://localhost:9080/XSD_gYear/services/XSD_gYear" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_gYearMonth.wsdl b/axiom/test/resources/wsdl/XSD_gYearMonth.wsdl new file mode 100644 index 0000000..d0bd3f1 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_gYearMonth.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_gYearMonth.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_gYearMonth" + targetNamespace="http://xsd_gYearMonth.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_gYearMonth.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:gYearMonth" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:gYearMonth" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:gYearMonth" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:gYearMonth" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:gYearMonth" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:gYearMonth" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:gYearMonth" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:gYearMonth" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:gYearMonth" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_gYearMonth"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_gYearMonthSOAP" type="tns:XSD_gYearMonth"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_gYearMonth#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_gYearMonth#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_gYearMonth#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_gYearMonth#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_gYearMonth#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_gYearMonth#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_gYearMonth"> + <wsdl:port binding="tns:XSD_gYearMonthSOAP" + name="XSD_gYearMonthSOAP"> + <soap:address + location="http://localhost:9080/XSD_gYearMonth/services/XSD_gYearMonth" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_hexBinary.wsdl b/axiom/test/resources/wsdl/XSD_hexBinary.wsdl new file mode 100644 index 0000000..1ace268 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_hexBinary.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_hexBinary.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_hexBinary" + targetNamespace="http://xsd_hexBinary.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_hexBinary.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:hexBinary" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:hexBinary" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:hexBinary" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:hexBinary" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:hexBinary" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:hexBinary" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:hexBinary" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:hexBinary" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:hexBinary" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_hexBinary"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_hexBinarySOAP" type="tns:XSD_hexBinary"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_hexBinary#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_hexBinary#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_hexBinary#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_hexBinary#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_hexBinary#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_hexBinary#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_hexBinary"> + <wsdl:port binding="tns:XSD_hexBinarySOAP" + name="XSD_hexBinarySOAP"> + <soap:address + location="http://localhost:9080/XSD_hexBinary/services/XSD_hexBinary" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_int.wsdl b/axiom/test/resources/wsdl/XSD_int.wsdl new file mode 100644 index 0000000..897ba94 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_int.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_int.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_int" + targetNamespace="http://xsd_int.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_int.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:int" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:int" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:int" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:int" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:int" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:int" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:int" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:int" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:int" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_int"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_intSOAP" type="tns:XSD_int"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_int#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_int#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_int#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_int#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_int#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_int#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_int"> + <wsdl:port binding="tns:XSD_intSOAP" + name="XSD_intSOAP"> + <soap:address + location="http://localhost:9080/XSD_int/services/XSD_int" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_integer.wsdl b/axiom/test/resources/wsdl/XSD_integer.wsdl new file mode 100644 index 0000000..162cc94 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_integer.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_integer.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_integer" + targetNamespace="http://xsd_integer.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_integer.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:integer" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:integer" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:integer" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:integer" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:integer" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:integer" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:integer" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:integer" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:integer" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_integer"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_integerSOAP" type="tns:XSD_integer"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_integer#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_integer#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_integer#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_integer#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_integer#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_integer#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_integer"> + <wsdl:port binding="tns:XSD_integerSOAP" + name="XSD_integerSOAP"> + <soap:address + location="http://localhost:9080/XSD_integer/services/XSD_integer" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_language.wsdl b/axiom/test/resources/wsdl/XSD_language.wsdl new file mode 100644 index 0000000..e69a08a --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_language.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_language.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_language" + targetNamespace="http://xsd_language.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_language.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:language" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:language" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:language" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:language" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:language" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:language" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:language" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:language" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:language" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_language"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_languageSOAP" type="tns:XSD_language"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_language#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_language#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_language#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_language#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_language#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_language#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_language"> + <wsdl:port binding="tns:XSD_languageSOAP" + name="XSD_languageSOAP"> + <soap:address + location="http://localhost:9080/XSD_language/services/XSD_language" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_long.wsdl b/axiom/test/resources/wsdl/XSD_long.wsdl new file mode 100644 index 0000000..8d9b562 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_long.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_long.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_long" + targetNamespace="http://xsd_long.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_long.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:long" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:long" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:long" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:long" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:long" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:long" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:long" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:long" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:long" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_long"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_longSOAP" type="tns:XSD_long"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_long#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_long#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_long#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_long#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_long#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_long#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_long"> + <wsdl:port binding="tns:XSD_longSOAP" + name="XSD_longSOAP"> + <soap:address + location="http://localhost:9080/XSD_long/services/XSD_long" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_negativeInteger.wsdl b/axiom/test/resources/wsdl/XSD_negativeInteger.wsdl new file mode 100644 index 0000000..70abcda --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_negativeInteger.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_negativeInteger.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_negativeInteger" + targetNamespace="http://xsd_negativeInteger.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_negativeInteger.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:negativeInteger" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:negativeInteger" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:negativeInteger" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:negativeInteger" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:negativeInteger" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:negativeInteger" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:negativeInteger" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:negativeInteger" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:negativeInteger" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_negativeInteger"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_negativeIntegerSOAP" type="tns:XSD_negativeInteger"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_negativeInteger#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_negativeInteger#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_negativeInteger#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_negativeInteger#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_negativeInteger#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_negativeInteger#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_negativeInteger"> + <wsdl:port binding="tns:XSD_negativeIntegerSOAP" + name="XSD_negativeIntegerSOAP"> + <soap:address + location="http://localhost:9080/XSD_negativeInteger/services/XSD_negativeInteger" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_nonNegativeInteger.wsdl b/axiom/test/resources/wsdl/XSD_nonNegativeInteger.wsdl new file mode 100644 index 0000000..b3baf36 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_nonNegativeInteger.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_nonNegativeInteger.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_nonNegativeInteger" + targetNamespace="http://xsd_nonNegativeInteger.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_nonNegativeInteger.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:nonNegativeInteger" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:nonNegativeInteger" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:nonNegativeInteger" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:nonNegativeInteger" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:nonNegativeInteger" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:nonNegativeInteger" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:nonNegativeInteger" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:nonNegativeInteger" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:nonNegativeInteger" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_nonNegativeInteger"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_nonNegativeIntegerSOAP" type="tns:XSD_nonNegativeInteger"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_nonNegativeInteger#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_nonNegativeInteger#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_nonNegativeInteger#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_nonNegativeInteger#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_nonNegativeInteger#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_nonNegativeInteger#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_nonNegativeInteger"> + <wsdl:port binding="tns:XSD_nonNegativeIntegerSOAP" + name="XSD_nonNegativeIntegerSOAP"> + <soap:address + location="http://localhost:9080/XSD_nonNegativeInteger/services/XSD_nonNegativeInteger" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_nonPositiveInteger.wsdl b/axiom/test/resources/wsdl/XSD_nonPositiveInteger.wsdl new file mode 100644 index 0000000..ab95c37 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_nonPositiveInteger.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_nonPositiveInteger.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_nonPositiveInteger" + targetNamespace="http://xsd_nonPositiveInteger.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_nonPositiveInteger.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:nonPositiveInteger" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:nonPositiveInteger" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:nonPositiveInteger" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:nonPositiveInteger" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:nonPositiveInteger" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:nonPositiveInteger" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:nonPositiveInteger" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:nonPositiveInteger" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:nonPositiveInteger" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_nonPositiveInteger"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_nonPositiveIntegerSOAP" type="tns:XSD_nonPositiveInteger"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_nonPositiveInteger#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_nonPositiveInteger#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_nonPositiveInteger#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_nonPositiveInteger#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_nonPositiveInteger#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_nonPositiveInteger#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_nonPositiveInteger"> + <wsdl:port binding="tns:XSD_nonPositiveIntegerSOAP" + name="XSD_nonPositiveIntegerSOAP"> + <soap:address + location="http://localhost:9080/XSD_nonPositiveInteger/services/XSD_nonPositiveInteger" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_normalizedString.wsdl b/axiom/test/resources/wsdl/XSD_normalizedString.wsdl new file mode 100644 index 0000000..4e44c2e --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_normalizedString.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_normalizedString.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_normalizedString" + targetNamespace="http://xsd_normalizedString.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_normalizedString.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:normalizedString" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:normalizedString" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:normalizedString" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:normalizedString" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:normalizedString" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:normalizedString" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:normalizedString" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:normalizedString" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:normalizedString" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_normalizedString"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_normalizedStringSOAP" type="tns:XSD_normalizedString"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_normalizedString#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_normalizedString#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_normalizedString#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_normalizedString#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_normalizedString#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_normalizedString#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_normalizedString"> + <wsdl:port binding="tns:XSD_normalizedStringSOAP" + name="XSD_normalizedStringSOAP"> + <soap:address + location="http://localhost:9080/XSD_normalizedString/services/XSD_normalizedString" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_positiveInteger.wsdl b/axiom/test/resources/wsdl/XSD_positiveInteger.wsdl new file mode 100644 index 0000000..ce5c1bb --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_positiveInteger.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_positiveInteger.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_positiveInteger" + targetNamespace="http://xsd_positiveInteger.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_positiveInteger.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:positiveInteger" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:positiveInteger" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:positiveInteger" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:positiveInteger" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:positiveInteger" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:positiveInteger" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:positiveInteger" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:positiveInteger" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:positiveInteger" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_positiveInteger"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_positiveIntegerSOAP" type="tns:XSD_positiveInteger"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_positiveInteger#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_positiveInteger#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_positiveInteger#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_positiveInteger#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_positiveInteger#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_positiveInteger#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_positiveInteger"> + <wsdl:port binding="tns:XSD_positiveIntegerSOAP" + name="XSD_positiveIntegerSOAP"> + <soap:address + location="http://localhost:9080/XSD_positiveInteger/services/XSD_positiveInteger" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_short.wsdl b/axiom/test/resources/wsdl/XSD_short.wsdl new file mode 100644 index 0000000..f707d77 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_short.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_short.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_short" + targetNamespace="http://xsd_short.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_short.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:short" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:short" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:short" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:short" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:short" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:short" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:short" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:short" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:short" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_short"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_shortSOAP" type="tns:XSD_short"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_short#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_short#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_short#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_short#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_short#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_short#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_short"> + <wsdl:port binding="tns:XSD_shortSOAP" + name="XSD_shortSOAP"> + <soap:address + location="http://localhost:9080/XSD_short/services/XSD_short" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_string.wsdl b/axiom/test/resources/wsdl/XSD_string.wsdl new file mode 100644 index 0000000..f325e17 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_string.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_string.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_string" + targetNamespace="http://xsd_string.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_string.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:string" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:string" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:string" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:string" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:string" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:string" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:string" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:string" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_string"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_stringSOAP" type="tns:XSD_string"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_string#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_string#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_string#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_string#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_string#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_string#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_string"> + <wsdl:port binding="tns:XSD_stringSOAP" + name="XSD_stringSOAP"> + <soap:address + location="http://localhost:9080/XSD_string/services/XSD_string" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_time.wsdl b/axiom/test/resources/wsdl/XSD_time.wsdl new file mode 100644 index 0000000..fc47d5a --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_time.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_time.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_time" + targetNamespace="http://xsd_time.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_time.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:time" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:time" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:time" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:time" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:time" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:time" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:time" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:time" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:time" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_time"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_timeSOAP" type="tns:XSD_time"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_time#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_time#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_time#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_time#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_time#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_time#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_time"> + <wsdl:port binding="tns:XSD_timeSOAP" + name="XSD_timeSOAP"> + <soap:address + location="http://localhost:9080/XSD_time/services/XSD_time" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_token.wsdl b/axiom/test/resources/wsdl/XSD_token.wsdl new file mode 100644 index 0000000..6ff5990 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_token.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_token.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_token" + targetNamespace="http://xsd_token.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_token.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:token" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:token" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:token" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:token" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:token" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:token" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:token" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:token" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:token" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_token"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_tokenSOAP" type="tns:XSD_token"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_token#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_token#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_token#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_token#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_token#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_token#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_token"> + <wsdl:port binding="tns:XSD_tokenSOAP" + name="XSD_tokenSOAP"> + <soap:address + location="http://localhost:9080/XSD_token/services/XSD_token" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_unsignedByte.wsdl b/axiom/test/resources/wsdl/XSD_unsignedByte.wsdl new file mode 100644 index 0000000..4b13551 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_unsignedByte.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_unsignedByte.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_unsignedByte" + targetNamespace="http://xsd_unsignedByte.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_unsignedByte.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:unsignedByte" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:unsignedByte" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:unsignedByte" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:unsignedByte" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:unsignedByte" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:unsignedByte" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:unsignedByte" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:unsignedByte" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:unsignedByte" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_unsignedByte"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_unsignedByteSOAP" type="tns:XSD_unsignedByte"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_unsignedByte#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_unsignedByte#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_unsignedByte#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_unsignedByte#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_unsignedByte#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_unsignedByte#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_unsignedByte"> + <wsdl:port binding="tns:XSD_unsignedByteSOAP" + name="XSD_unsignedByteSOAP"> + <soap:address + location="http://localhost:9080/XSD_unsignedByte/services/XSD_unsignedByte" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_unsignedInt.wsdl b/axiom/test/resources/wsdl/XSD_unsignedInt.wsdl new file mode 100644 index 0000000..2c60e37 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_unsignedInt.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_unsignedInt.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_unsignedInt" + targetNamespace="http://xsd_unsignedInt.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_unsignedInt.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:unsignedInt" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:unsignedInt" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:unsignedInt" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:unsignedInt" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:unsignedInt" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:unsignedInt" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:unsignedInt" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:unsignedInt" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:unsignedInt" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_unsignedInt"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_unsignedIntSOAP" type="tns:XSD_unsignedInt"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_unsignedInt#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_unsignedInt#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_unsignedInt#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_unsignedInt#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_unsignedInt#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_unsignedInt#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_unsignedInt"> + <wsdl:port binding="tns:XSD_unsignedIntSOAP" + name="XSD_unsignedIntSOAP"> + <soap:address + location="http://localhost:9080/XSD_unsignedInt/services/XSD_unsignedInt" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_unsignedLong.wsdl b/axiom/test/resources/wsdl/XSD_unsignedLong.wsdl new file mode 100644 index 0000000..04de8dd --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_unsignedLong.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_unsignedLong.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_unsignedLong" + targetNamespace="http://xsd_unsignedLong.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_unsignedLong.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:unsignedLong" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:unsignedLong" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:unsignedLong" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:unsignedLong" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:unsignedLong" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:unsignedLong" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:unsignedLong" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:unsignedLong" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:unsignedLong" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_unsignedLong"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_unsignedLongSOAP" type="tns:XSD_unsignedLong"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_unsignedLong#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_unsignedLong#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_unsignedLong#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_unsignedLong#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_unsignedLong#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_unsignedLong#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_unsignedLong"> + <wsdl:port binding="tns:XSD_unsignedLongSOAP" + name="XSD_unsignedLongSOAP"> + <soap:address + location="http://localhost:9080/XSD_unsignedLong/services/XSD_unsignedLong" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/XSD_unsignedShort.wsdl b/axiom/test/resources/wsdl/XSD_unsignedShort.wsdl new file mode 100644 index 0000000..9338c34 --- /dev/null +++ b/axiom/test/resources/wsdl/XSD_unsignedShort.wsdl @@ -0,0 +1,285 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:tns="http://xsd_unsignedShort.test.apache.org" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="XSD_unsignedShort" + targetNamespace="http://xsd_unsignedShort.test.apache.org"> + <wsdl:types> + <xsd:schema + targetNamespace="http://xsd_unsignedShort.test.apache.org" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="asNonNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:unsignedShort" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="AsNonNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nonNillableElement" + type="xsd:unsignedShort" nillable="false" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:unsignedShort" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asNillableElementRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="nillableElement" + type="xsd:unsignedShort" nillable="true" minOccurs="1" maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="RequiredAttributeElement"> + <xsd:attribute name="requiredAttribute" type="xsd:unsignedShort" + use="required" /> + </xsd:complexType> + <xsd:element name="asRequiredAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asRequiredAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="RequiredAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:RequiredAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="OptionalAttributeElement"> + <xsd:attribute name="optionalAttribute" type="xsd:unsignedShort" + use="optional" /> + </xsd:complexType> + <xsd:element name="asOptionalAttributeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asOptionalAttributeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="OptionalAttributeElement" + maxOccurs="1" minOccurs="1" type="tns:OptionalAttributeElement" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:unsignedShort" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asArrayRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="arrayElement" + type="xsd:unsignedShort" nillable="false" minOccurs="1" + maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:complexType name="SimpleComplexType"> + <xsd:sequence> + <xsd:element name="complexTypeElement" + type="xsd:unsignedShort" minOccurs="1" maxOccurs="1" nillable="false" /> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="asComplexTypeResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + <xsd:element name="asComplexTypeRequest"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="SimpleComplexType" + type="tns:SimpleComplexType" nillable="false" minOccurs="1" + maxOccurs="1" /> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types> + <wsdl:message name="asNonNillableElementResponse"> + <wsdl:part element="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:message> + <wsdl:message name="asNonNillableElementRequest"> + <wsdl:part element="tns:AsNonNillableElementRequest" + name="parameters" /> + </wsdl:message> + <wsdl:message name="asNillableElementResponse"> + <wsdl:part name="asNillableElementResponse" + element="tns:asNillableElementResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asNillableElementRequest"> + <wsdl:part name="asNillableElementRequest" + element="tns:asNillableElementRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeResponse"> + <wsdl:part name="asRequiredAttributeResponse" + element="tns:asRequiredAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asRequiredAttributeRequest"> + <wsdl:part name="asRequiredAttributeRequest" + element="tns:asRequiredAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeResponse"> + <wsdl:part name="asOptionalAttributeResponse" + element="tns:asOptionalAttributeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asOptionalAttributeRequest"> + <wsdl:part name="asOptionalAttributeRequest" + element="tns:asOptionalAttributeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayResponse"> + <wsdl:part name="asArrayResponse" + element="tns:asArrayResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asArrayRequest"> + <wsdl:part name="asArrayRequest" element="tns:asArrayRequest"></wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeResponse"> + <wsdl:part name="asComplexTypeResponse" + element="tns:asComplexTypeResponse"> + </wsdl:part> + </wsdl:message> + <wsdl:message name="asComplexTypeRequest"> + <wsdl:part name="asComplexTypeRequest" + element="tns:asComplexTypeRequest"> + </wsdl:part> + </wsdl:message> + <wsdl:portType name="XSD_unsignedShort"> + <wsdl:operation name="asNonNillableElement"> + <wsdl:input message="tns:asNonNillableElementRequest" + name="asNonNillableElementRequest" /> + <wsdl:output message="tns:asNonNillableElementResponse" + name="asNonNillableElementResponse" /> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <wsdl:input message="tns:asNillableElementRequest" + name="asNillableElementRequest"> + </wsdl:input> + <wsdl:output message="tns:asNillableElementResponse" + name="asNillableElementResponse"> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <wsdl:input message="tns:asRequiredAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asRequiredAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <wsdl:input message="tns:asOptionalAttributeRequest"></wsdl:input> + <wsdl:output message="tns:asOptionalAttributeResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <wsdl:input message="tns:asArrayRequest"></wsdl:input> + <wsdl:output message="tns:asArrayResponse"></wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <wsdl:input message="tns:asComplexTypeRequest"></wsdl:input> + <wsdl:output message="tns:asComplexTypeResponse"></wsdl:output> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="XSD_unsignedShortSOAP" type="tns:XSD_unsignedShort"> + <soap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http" /> + <wsdl:operation name="asNonNillableElement"> + <soap:operation + soapAction="XSD_unsignedShort#asNonNillableElement" style="document" /> + <wsdl:input name="asNonNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNonNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asNillableElement"> + <soap:operation soapAction="XSD_unsignedShort#asNillableElement" + style="document" /> + <wsdl:input name="asNillableElementRequest"> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output name="asNillableElementResponse"> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asRequiredAttribute"> + <soap:operation + soapAction="XSD_unsignedShort#asRequiredAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asOptionalAttribute"> + <soap:operation + soapAction="XSD_unsignedShort#asOptionalAttribute" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asArray"> + <soap:operation soapAction="XSD_unsignedShort#asArray" style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="asComplexType"> + <soap:operation soapAction="XSD_unsignedShort#asComplexType" + style="document" /> + <wsdl:input> + <soap:body use="literal" /> + </wsdl:input> + <wsdl:output> + <soap:body use="literal" /> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="XSD_unsignedShort"> + <wsdl:port binding="tns:XSD_unsignedShortSOAP" + name="XSD_unsignedShortSOAP"> + <soap:address + location="http://localhost:9080/XSD_unsignedShort/services/XSD_unsignedShort" /> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/wsdl/inquire_v2.wsdl b/axiom/test/resources/wsdl/inquire_v2.wsdl new file mode 100644 index 0000000..50b7674 --- /dev/null +++ b/axiom/test/resources/wsdl/inquire_v2.wsdl @@ -0,0 +1,275 @@ +<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:uddi-org:inquiry_v2" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:uddi="urn:uddi-org:api_v2" targetNamespace="urn:uddi-org:inquiry_v2" name="UDDI_Inquiry_API_V2"> +<!-- Copyright 2003-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. --> + + <documentation> + Copyright (c) 2000 - 2002 by Accenture, Ariba, Inc., Commerce One, Inc. + Fujitsu Limited, Hewlett-Packard Company, i2 Technologies, Inc., + Intel Corporation, International Business Machines Corporation, + Microsoft Corporation, Oracle Corporation, SAP AG, Sun Microsystems, Inc., + and VeriSign, Inc. All Rights Reserved. + + WSDL Service Interface for UDDI Inquiry API V2.0 + + This WSDL document defines the inquiry API calls for interacting with + the UDDI registry. The complete UDDI API specification is available + at http://www.uddi.org/specification.html. + </documentation> + <types> + <xsd:schema targetNamespace="urn:uddi-org:inquiry_v2" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:import namespace="urn:uddi-org:api_v2" schemaLocation="http://www.uddi.org/schema/uddi_v2.xsd"/> + </xsd:schema> + </types> + <message name="bindingDetail"> + <part name="body" element="uddi:bindingDetail"/> + </message> + <message name="businessDetail"> + <part name="body" element="uddi:businessDetail"/> + </message> + <message name="businessDetailExt"> + <part name="body" element="uddi:businessDetailExt"/> + </message> + <message name="businessList"> + <part name="body" element="uddi:businessList"/> + </message> + <message name="dispositionReport"> + <part name="body" element="uddi:dispositionReport"/> + </message> + <message name="find_binding"> + <part name="body" element="uddi:find_binding"/> + </message> + <message name="find_business"> + <part name="body" element="uddi:find_business"/> + </message> + <message name="find_relatedBusinesses"> + <part name="body" element="uddi:find_relatedBusinesses"/> + </message> + <message name="find_service"> + <part name="body" element="uddi:find_service"/> + </message> + <message name="find_tModel"> + <part name="body" element="uddi:find_tModel"/> + </message> + <message name="get_bindingDetail"> + <part name="body" element="uddi:get_bindingDetail"/> + </message> + <message name="get_businessDetail"> + <part name="body" element="uddi:get_businessDetail"/> + </message> + <message name="get_businessDetailExt"> + <part name="body" element="uddi:get_businessDetailExt"/> + </message> + <message name="get_serviceDetail"> + <part name="body" element="uddi:get_serviceDetail"/> + </message> + <message name="get_tModelDetail"> + <part name="body" element="uddi:get_tModelDetail"/> + </message> + <message name="relatedBusinessesList"> + <part name="body" element="uddi:relatedBusinessesList"/> + </message> + <message name="serviceDetail"> + <part name="body" element="uddi:serviceDetail"/> + </message> + <message name="serviceList"> + <part name="body" element="uddi:serviceList"/> + </message> + <message name="tModelDetail"> + <part name="body" element="uddi:tModelDetail"/> + </message> + <message name="tModelList"> + <part name="body" element="uddi:tModelList"/> + </message> + <portType name="Inquire"> + <documentation> + This portType defines all of the UDDI inquiry operations. + </documentation> + <operation name="find_binding"> + <input message="tns:find_binding"/> + <output message="tns:bindingDetail"/> + <fault name="error" message="tns:dispositionReport"/> + </operation> + <operation name="find_business"> + <input message="tns:find_business"/> + <output message="tns:businessList"/> + <fault name="error" message="tns:dispositionReport"/> + </operation> + <operation name="find_relatedBusinesses"> + <input message="tns:find_relatedBusinesses"/> + <output message="tns:relatedBusinessesList"/> + <fault name="error" message="tns:dispositionReport"/> + </operation> + <operation name="find_service"> + <input message="tns:find_service"/> + <output message="tns:serviceList"/> + <fault name="error" message="tns:dispositionReport"/> + </operation> + <operation name="find_tModel"> + <input message="tns:find_tModel"/> + <output message="tns:tModelList"/> + <fault name="error" message="tns:dispositionReport"/> + </operation> + <operation name="get_bindingDetail"> + <input message="tns:get_bindingDetail"/> + <output message="tns:bindingDetail"/> + <fault name="error" message="tns:dispositionReport"/> + </operation> + <operation name="get_businessDetail"> + <input message="tns:get_businessDetail"/> + <output message="tns:businessDetail"/> + <fault name="error" message="tns:dispositionReport"/> + </operation> + <operation name="get_businessDetailExt"> + <input message="tns:get_businessDetailExt"/> + <output message="tns:businessDetailExt"/> + <fault name="error" message="tns:dispositionReport"/> + </operation> + <operation name="get_serviceDetail"> + <input message="tns:get_serviceDetail"/> + <output message="tns:serviceDetail"/> + <fault name="error" message="tns:dispositionReport"/> + </operation> + <operation name="get_tModelDetail"> + <input message="tns:get_tModelDetail"/> + <output message="tns:tModelDetail"/> + <fault name="error" message="tns:dispositionReport"/> + </operation> + </portType> + <binding name="InquireSoap" type="tns:Inquire"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <documentation> + This is the SOAP binding for the UDDI inquiry operations. + </documentation> + <operation name="find_binding"> + <soap:operation soapAction="find_binding" style="document"/> + <input> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </input> + <output> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </output> + <fault name="error"> + <soap:fault name="error" use="literal"/> + </fault> + </operation> + <operation name="find_business"> + <soap:operation soapAction="find_business" style="document"/> + <input> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </input> + <output> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </output> + <fault name="error"> + <soap:fault name="error" use="literal"/> + </fault> + </operation> + <operation name="find_relatedBusinesses"> + <soap:operation soapAction="find_relatedBusinesses" style="document"/> + <input> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </input> + <output> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </output> + <fault name="error"> + <soap:fault name="error" use="literal"/> + </fault> + </operation> + <operation name="find_service"> + <soap:operation soapAction="find_service" style="document"/> + <input> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </input> + <output> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </output> + <fault name="error"> + <soap:fault name="error" use="literal"/> + </fault> + </operation> + <operation name="find_tModel"> + <soap:operation soapAction="find_tModel" style="document"/> + <input> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </input> + <output> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </output> + <fault name="error"> + <soap:fault name="error" use="literal"/> + </fault> + </operation> + <operation name="get_bindingDetail"> + <soap:operation soapAction="get_bindingDetail" style="document"/> + <input> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </input> + <output> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </output> + <fault name="error"> + <soap:fault name="error" use="literal"/> + </fault> + </operation> + <operation name="get_businessDetail"> + <soap:operation soapAction="get_businessDetail" style="document"/> + <input> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </input> + <output> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </output> + <fault name="error"> + <soap:fault name="error" use="literal"/> + </fault> + </operation> + <operation name="get_businessDetailExt"> + <soap:operation soapAction="get_businessDetailExt" style="document"/> + <input> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </input> + <output> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </output> + <fault name="error"> + <soap:fault name="error" use="literal"/> + </fault> + </operation> + <operation name="get_serviceDetail"> + <soap:operation soapAction="get_serviceDetail" style="document"/> + <input> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </input> + <output> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </output> + <fault name="error"> + <soap:fault name="error" use="literal"/> + </fault> + </operation> + <operation name="get_tModelDetail"> + <soap:operation soapAction="get_tModelDetail" style="document"/> + <input> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </input> + <output> + <soap:body parts="body" use="literal" namespace="urn:uddi-org:api_v2"/> + </output> + <fault name="error"> + <soap:fault name="error" use="literal"/> + </fault> + </operation> + </binding> +</definitions> diff --git a/axiom/test/resources/wsdl/nillableComplexType.wsdl b/axiom/test/resources/wsdl/nillableComplexType.wsdl new file mode 100644 index 0000000..ea224c2 --- /dev/null +++ b/axiom/test/resources/wsdl/nillableComplexType.wsdl @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2003-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. -->
+
+<wsdl:definitions targetNamespace="http://localhost/axis/nillableComplexType"
+xmlns="http://schemas.xmlsoap.org/wsdl/"
+xmlns:apachesoap="http://xml.apache.org/xml-soap"
+xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:impl="http://localhost/axis/nillableComplexType"
+xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:xs="nillableComplexType">
+ <wsdl:types>
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:import namespace="nillableComplexType" schemaLocation="nillableComplexType.xsd">
+ </xsd:import>
+ </xsd:schema>
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://localhost/axis/nillableComplexType">
+ <xsd:element name="ReportReturn">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="ReportReturn"
+ type="xsd:string">
+ </xsd:element> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + </xsd:schema> + </wsdl:types>
+
+ <wsdl:message name="ReportRequest">
+ <wsdl:part name="myClass" type="xs:MyClass"/>
+ </wsdl:message>
+
+ <wsdl:message name="ReportResponse">
+ <wsdl:part name="ReportReturn" element="impl:ReportReturn"/>
+ </wsdl:message>
+
+ <wsdl:portType name="nillableComplexType">
+ <wsdl:operation name="Report">
+ <wsdl:input message="impl:ReportRequest" name="ReportRequest"/>
+ <wsdl:output message="impl:ReportResponse" name="ReportResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="nillableComplexTypeSoapBinding" type="impl:nillableComplexType">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="Report">
+ <wsdlsoap:operation soapAction="nillableComplexType#Report" style="document"/>
+ <wsdl:input name="ReportRequest">
+ <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="http://localhost/axis/nillableComplexType"
+ use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="ReportResponse">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="nillableComplexType">
+ <wsdl:port binding="impl:nillableComplexTypeSoapBinding" name="nillableComplexType">
+ <wsdlsoap:address location="http://localhost/axis/nillableComplexType"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/axiom/test/resources/wsdl/nillableComplexType.xsd b/axiom/test/resources/wsdl/nillableComplexType.xsd new file mode 100644 index 0000000..765be56 --- /dev/null +++ b/axiom/test/resources/wsdl/nillableComplexType.xsd @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" ?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="nillableComplexType"
+ targetNamespace="nillableComplexType">
+
+<xs:complexType name="MyClass" mixed="true">
+ <xs:sequence>
+ <xs:element name="Name" form="unqualified" nillable="true" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="20"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Values" form="unqualified" nillable="true" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:base64Binary">
+ <xs:maxLength value="3"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:NMTOKEN" use="optional" form="unqualified"/>
+</xs:complexType>
+
+</xs:schema>
diff --git a/axiom/test/resources/wsdl/wsaTestService.wsdl b/axiom/test/resources/wsdl/wsaTestService.wsdl new file mode 100644 index 0000000..4ce8b12 --- /dev/null +++ b/axiom/test/resources/wsdl/wsaTestService.wsdl @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> +<wsdl:definitions targetNamespace="http://example.org/wsaTestService" xmlns:impl="http://example.org/wsaTestService" xmlns:intf="http://example.org/wsaTestService" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsaw="http://www.w3.org/2005/08/addressing/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns2="http://example.org/notify" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns1="http://example.org/echo"> + <wsdl:types> + <schema elementFormDefault="qualified" targetNamespace="http://example.org/echo" xmlns="http://www.w3.org/2001/XMLSchema"> + <element name="echoIn" type="xsd:string"/> + <element name="echoOut" type="xsd:string"/> + </schema> + <schema elementFormDefault="qualified" targetNamespace="http://example.org/notify" xmlns="http://www.w3.org/2001/XMLSchema"> + <element name="notify" type="xsd:string"/> + </schema> + </wsdl:types> + <wsdl:message name="wsaEchoOutMessage"> + <wsdl:part name="echoIn" element="tns1:echoIn"/> + </wsdl:message> + <wsdl:message name="wsaNotifyMessage"> + <wsdl:part name="notify" element="tns2:notify"/> + </wsdl:message> + <wsdl:message name="wsaEchoInMessage"> + <wsdl:part name="echoOut" element="tns1:echoOut"/> + </wsdl:message> + <wsdl:portType name="wsaTestPortType"> + <wsdl:operation name="echo"> + <wsdl:input name="echoInRequest" message="impl:wsaEchoOutMessage" wsaw:Action="http://example.org/action/echoIn"/> + <wsdl:output name="echoInResponse" message="impl:wsaEchoInMessage" wsaw:Action="http://example.org/action/echoOut"/> + </wsdl:operation> + <wsdl:operation name="notify"> + <wsdl:input name="notifyRequest" message="impl:wsaNotifyMessage" wsaw:Action="http://example.org/action/notify"/> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="wsaTestSoap11Binding" type="impl:wsaTestPortType"> + <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="echo"> + <wsdlsoap:operation soapAction="echo" style="document"/> + <wsdl:input> + <wsdlsoap:body use="literal" namespace="http://org.apache.axis2/"/> + </wsdl:input> + <wsdl:output> + <wsdlsoap:body use="literal" namespace="http://org.apache.axis2/"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="notify"> + <wsdlsoap:operation soapAction="notify" style="document"/> + <wsdl:input> + <wsdlsoap:body use="literal" namespace="http://org.apache.axis2/"/> + </wsdl:input> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="wsaTestService"> + <wsdl:port name="wsaTestServicePort0" binding="impl:wsaTestSoap11Binding"> + <wsdlsoap:address location="http://www-lk.wso2.com:5049/axis2/services/wsaTestService"/> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> diff --git a/axiom/test/resources/xml/om/axis.xml b/axiom/test/resources/xml/om/axis.xml new file mode 100644 index 0000000..bc996c5 --- /dev/null +++ b/axiom/test/resources/xml/om/axis.xml @@ -0,0 +1,25 @@ +<?xml version="1.0"?> + +<root> + + <a> + <a.1/> + <a.2/> + <a.3/> + <a.4/> + <a.5/> + </a> + + <b> + <b.1/> + <b.2/> + <b.3/> + <b.4/> + <b.5/> + <b.6/> + <b.7/> + <b.8/> + <b.9/> + </b> + +</root> diff --git a/axiom/test/resources/xml/om/basic.xml b/axiom/test/resources/xml/om/basic.xml new file mode 100644 index 0000000..88385fb --- /dev/null +++ b/axiom/test/resources/xml/om/basic.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<foo> + <bar> + <baz/> + <cheese/> + <baz/> + <cheese/> + <baz/> + </bar> +</foo> diff --git a/axiom/test/resources/xml/om/basicupdate.xml b/axiom/test/resources/xml/om/basicupdate.xml new file mode 100644 index 0000000..57d458c --- /dev/null +++ b/axiom/test/resources/xml/om/basicupdate.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<xu:modifications xmlns:xu="http://www.xmldb.org/xupdate"> + + <xu:append select="/foo/bar/cheese[1]"> + Goudse kaas + <edam type="jong belegen">Rond</edam> + </xu:append> + + <xu:remove select="/foo/bar/baz[2]"/> + + <xu:if test="/foo"> + <xu:insert-before select="/foo/bar/baz[2]"> + <cheese>More cheese!</cheese> + </xu:insert-before> + </xu:if> + + <xu:insert-before select="/foo/bar/baz[2]"> + <cheese>Even more cheese!</cheese> + </xu:insert-before> + + <xu:if test="/bar"> + <xu:insert-before select="/foo/bar/baz[2]"> + <sausages>No sausages today</sausages> + </xu:insert-before> + </xu:if> + + <xu:variable + xmlns:private="http://www.jaxen.org/private" + name="private:twice"> + <cracker/> + <!-- champagne --> + <?oisters with a bit of lemon?> + </xu:variable> + + <xu:variable name="twice" select="'Twice'"/> + + <xu:insert-after + select="/foo/bar" + xmlns:private="http://www.jaxen.org/private" + > + <xu:value-of select="$private:twice"/> + <xu:value-of select="$private:twice"/> + <xu:value-of select="$twice"/> + </xu:insert-after> + +</xu:modifications> diff --git a/axiom/test/resources/xml/om/contents.xml b/axiom/test/resources/xml/om/contents.xml new file mode 100644 index 0000000..35e3ac7 --- /dev/null +++ b/axiom/test/resources/xml/om/contents.xml @@ -0,0 +1,70 @@ +<?xml version="1.0"?> + +<?xml-stylesheet href="XSL\JavaXML.html.xsl" type="text/xsl"?> +<?xml-stylesheet href="XSL\JavaXML.wml.xsl" type="text/xsl" + media="wap"?> +<?cocoon-process type="xslt"?> + +<!-- Java and XML --> +<JavaXML:Book xmlns:JavaXML="http://www.oreilly.com/catalog/javaxml/" + xmlns:ora="http://www.oreilly.com" + xmlns:unused="http://www.unused.com" + ora:category="Java" +> + <!-- comment one --> + <!-- comment two --> + + <JavaXML:Title>Java and XML</JavaXML:Title> + <JavaXML:Contents xmlns:topic="http://www.oreilly.com/topics"> + <JavaXML:Chapter topic:focus="XML"> + <JavaXML:Heading>Introduction</JavaXML:Heading> + <JavaXML:Topic subSections="7"> + What Is It? + </JavaXML:Topic> + <JavaXML:Topic subSections="3"> + How Do I Use It? + </JavaXML:Topic> + <JavaXML:Topic subSections="4"> + Why Should I Use It? + </JavaXML:Topic> + <JavaXML:Topic subSections="0"> + What's Next? + </JavaXML:Topic> + </JavaXML:Chapter> + + <JavaXML:Chapter topic:focus="XML"> + <JavaXML:Heading>Creating XML</JavaXML:Heading> + <JavaXML:Topic subSections="0">An XML Document</JavaXML:Topic> + <JavaXML:Topic subSections="2">The Header</JavaXML:Topic> + <JavaXML:Topic subSections="6">The Content</JavaXML:Topic> + <JavaXML:Topic subSections="1">What's Next?</JavaXML:Topic> + </JavaXML:Chapter> + + <JavaXML:Chapter topic:focus="Java"> + <JavaXML:Heading>Parsing XML</JavaXML:Heading> + <JavaXML:Topic subSections="3">Getting Prepared</JavaXML:Topic> + <JavaXML:Topic subSections="3">SAX Readers</JavaXML:Topic> + <JavaXML:Topic subSections="9">Content Handlers</JavaXML:Topic> + <JavaXML:Topic subSections="4">Error Handlers</JavaXML:Topic> + <JavaXML:Topic subSections="0"> + A Better Way to Load a Parser + </JavaXML:Topic> + <JavaXML:Topic subSections="4">"Gotcha!"</JavaXML:Topic> + <JavaXML:Topic subSections="0">What's Next?</JavaXML:Topic> + </JavaXML:Chapter> + + <JavaXML:SectionBreak/> + + <JavaXML:Chapter topic:focus="Java"> + <JavaXML:Heading>Web Publishing Frameworks</JavaXML:Heading> + <JavaXML:Topic subSections="4">Selecting a Framework</JavaXML:Topic> + <JavaXML:Topic subSections="4">Installation</JavaXML:Topic> + <JavaXML:Topic subSections="3"> + Using a Publishing Framework + </JavaXML:Topic> + <JavaXML:Topic subSections="2">XSP</JavaXML:Topic> + <JavaXML:Topic subSections="3">Cocoon 2.0 and Beyond</JavaXML:Topic> + <JavaXML:Topic subSections="0">What's Next?</JavaXML:Topic> + </JavaXML:Chapter> + </JavaXML:Contents> +</JavaXML:Book> diff --git a/axiom/test/resources/xml/om/defaultNamespace.xml b/axiom/test/resources/xml/om/defaultNamespace.xml new file mode 100644 index 0000000..1e32981 --- /dev/null +++ b/axiom/test/resources/xml/om/defaultNamespace.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<a xmlns="http://dummyNamespace/"> + <b> + <c>Hello</c> + </b> +</a> diff --git a/axiom/test/resources/xml/om/evaluate.xml b/axiom/test/resources/xml/om/evaluate.xml new file mode 100644 index 0000000..90d06bd --- /dev/null +++ b/axiom/test/resources/xml/om/evaluate.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<evaluate> + <data> + <jumps> + <subject> + <the/> + <fox color="brown"/> + <speed category="quick"/> + </subject> + <over/> + <object> + <the/> + <dog color="unspecified"/> + <speed category="lazy"/> + </object> + </jumps> + </data> + + <!-- there is one element with attribute color="brown" should this + meta-test should succeed --> + + <metatest select="//@color">brown</metatest> + + <!-- there is no element with attribute category="moderate" --> + <metatest select="//speed/@category">moderate</metatest> + +</evaluate> diff --git a/axiom/test/resources/xml/om/fibo.xml b/axiom/test/resources/xml/om/fibo.xml new file mode 100644 index 0000000..9b5d0ec --- /dev/null +++ b/axiom/test/resources/xml/om/fibo.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Fibonacci_Numbers> + <fibonacci index="0">0</fibonacci> + <fibonacci index="1">1</fibonacci> + <fibonacci index="2">1</fibonacci> + <fibonacci index="3">2</fibonacci> + <fibonacci index="4">3</fibonacci> + <fibonacci index="5">5</fibonacci> + <fibonacci index="6">8</fibonacci> + <fibonacci index="7">13</fibonacci> + <fibonacci index="8">21</fibonacci> + <fibonacci index="9">34</fibonacci> + <fibonacci index="10">55</fibonacci> + <fibonacci index="11">89</fibonacci> + <fibonacci index="12">144</fibonacci> + <fibonacci index="13">233</fibonacci> + <fibonacci index="14">377</fibonacci> + <fibonacci index="15">610</fibonacci> + <fibonacci index="16">987</fibonacci> + <fibonacci index="17">1597</fibonacci> + <fibonacci index="18">2584</fibonacci> + <fibonacci index="19">4181</fibonacci> + <fibonacci index="20">6765</fibonacci> + <fibonacci index="21">10946</fibonacci> + <fibonacci index="22">17711</fibonacci> + <fibonacci index="23">28657</fibonacci> + <fibonacci index="24">46368</fibonacci> + <fibonacci index="25">75025</fibonacci> +</Fibonacci_Numbers> diff --git a/axiom/test/resources/xml/om/id.xml b/axiom/test/resources/xml/om/id.xml new file mode 100644 index 0000000..749ab20 --- /dev/null +++ b/axiom/test/resources/xml/om/id.xml @@ -0,0 +1,21 @@ +<?xml version="1.0"?> + +<!DOCTYPE foo [ + +<!ELEMENT foo (bar)> +<!ATTLIST foo id CDATA #IMPLIED> +<!ELEMENT bar (#PCDATA|cheese)*> +<!ATTLIST bar id ID #REQUIRED> +<!ELEMENT cheese (#PCDATA)> +<!ATTLIST cheese kind ID #IMPLIED> +]> + +<foo id="foobar"> + <bar id="fb1"> + baz + <cheese kind="edam">gouda</cheese> + baz + <cheese kind="gouda">cheddar</cheese> + baz + </bar> +</foo> diff --git a/axiom/test/resources/xml/om/jaxen24.xml b/axiom/test/resources/xml/om/jaxen24.xml new file mode 100644 index 0000000..9b81996 --- /dev/null +++ b/axiom/test/resources/xml/om/jaxen24.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<body><p><span></span></p><div></div></body> diff --git a/axiom/test/resources/xml/om/jaxen3.xml b/axiom/test/resources/xml/om/jaxen3.xml new file mode 100644 index 0000000..a87723a --- /dev/null +++ b/axiom/test/resources/xml/om/jaxen3.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Configuration> + <hostname> + <val>2</val> + <attrlist> + <hostname>CE-A</hostname> + </attrlist> + </hostname> + <hostname> + <val>1</val> + <attrlist> + <hostname>CE-B</hostname> + </attrlist> + </hostname> +</Configuration> diff --git a/axiom/test/resources/xml/om/lang.xml b/axiom/test/resources/xml/om/lang.xml new file mode 100644 index 0000000..49b45db --- /dev/null +++ b/axiom/test/resources/xml/om/lang.xml @@ -0,0 +1,11 @@ +<?xml version="1.0"?> +<e1 xml:lang="hr"> + <e2 xml:lang="en-US"> + <e3/> + </e2> + <e2 xml:lang="hu"> + <e3/> + <e3/> + <e3 xml:lang="es"/> + </e2> +</e1>
\ No newline at end of file diff --git a/axiom/test/resources/xml/om/message.xml b/axiom/test/resources/xml/om/message.xml new file mode 100644 index 0000000..3b81df2 --- /dev/null +++ b/axiom/test/resources/xml/om/message.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<message> + <header> + <service>lookupformservice</service> + <connectionid>9</connectionid> + <appid>stammdaten</appid> + <action>new</action> + </header> + <body> + <data> + <items> + <item> + <name>iteminfo</name> + <value>ELE</value> + </item> + <item> + <name>parentinfo</name> + <value>Pruefgebiete</value> + </item> + <item> + <name>id</name> + <value>1</value> + </item> + </items> + </data> + </body> +</message> diff --git a/axiom/test/resources/xml/om/moreover.xml b/axiom/test/resources/xml/om/moreover.xml new file mode 100644 index 0000000..38d4c4f --- /dev/null +++ b/axiom/test/resources/xml/om/moreover.xml @@ -0,0 +1,244 @@ +<?xml version="1.0" encoding="iso-8859-1"?> + <moreovernews> + <article code="13563275"> + <url>http://c.moreover.com/click/here.pl?x13563273</url> + <headline_text>e-Commerce Operators Present Version 1.0 of the XML Standard</headline_text> + <source>StockAccess</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://www.stockaccess.com/index.html</document_url> + <harvest_time>Dec 24 2000 6:28AM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13560996"> + <url>http://c.moreover.com/click/here.pl?x13560995</url> + <headline_text>W3C Publishes XML Protocol Requirements Document</headline_text> + <source>Xml</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://www.xml.com/</document_url> + <harvest_time>Dec 24 2000 12:22AM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13553522"> + <url>http://c.moreover.com/click/here.pl?x13553521</url> + <headline_text>Prowler: Open Source XML-Based Content Management Framework</headline_text> + <source>Xml</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://www.xml.com/</document_url> + <harvest_time>Dec 23 2000 2:05PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13549014"> + <url>http://c.moreover.com/click/here.pl?x13549013</url> + <headline_text>The Middleware Company Debuts Public Training Courses in Ejb, J2ee And Xml</headline_text> + <source>Java Industry Connection</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://industry.java.sun.com/javanews/more/hotnews/</document_url> + <harvest_time>Dec 23 2000 12:15PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13544468"> + <url>http://c.moreover.com/click/here.pl?x13544467</url> + <headline_text>Revised Working Draft for the W3C XML Information Set</headline_text> + <source>Xml</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://www.xml.com/</document_url> + <harvest_time>Dec 23 2000 5:50AM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13534837"> + <url>http://c.moreover.com/click/here.pl?x13534836</url> + <headline_text>XML: Its The Great Peacemaker</headline_text> + <source>ZDNet</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://www.zdnet.com/intweek/</document_url> + <harvest_time>Dec 22 2000 9:05PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13533486"> + <url>http://c.moreover.com/click/here.pl?x13533485</url> + <headline_text>Project eL - The XML Leningrad Codex Markup Project</headline_text> + <source>Xml</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://www.xml.com/</document_url> + <harvest_time>Dec 22 2000 8:34PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13533489"> + <url>http://c.moreover.com/click/here.pl?x13533488</url> + <headline_text>XML Linking Language (XLink) and XML Base Specifications Issued as W3C Proposed Recommenda</headline_text> + <source>Xml</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://www.xml.com/</document_url> + <harvest_time>Dec 22 2000 8:34PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13533493"> + <url>http://c.moreover.com/click/here.pl?x13533492</url> + <headline_text>W3C Releases XHTML Basic Specification as a W3C Recommendation</headline_text> + <source>Xml</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://www.xml.com/</document_url> + <harvest_time>Dec 22 2000 8:34PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13521835"> + <url>http://c.moreover.com/click/here.pl?x13521827</url> + <headline_text>Java, Xml And Oracle9i(TM) Make A Great Team</headline_text> + <source>Java Industry Connection</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://industry.java.sun.com/javanews/more/hotnews/</document_url> + <harvest_time>Dec 22 2000 3:21PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13512020"> + <url>http://c.moreover.com/click/here.pl?x13511233</url> + <headline_text>Competing initiatives to vie for security standard</headline_text> + <source>ZDNet</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://www.zdnet.com/eweek/filters/news/</document_url> + <harvest_time>Dec 22 2000 10:54AM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13492401"> + <url>http://c.moreover.com/click/here.pl?x13492397</url> + <headline_text>Oracle Provides Developers with Great Xml Reading This Holiday Season</headline_text> + <source>Java Industry Connection</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://industry.java.sun.com/javanews/more/hotnews/</document_url> + <harvest_time>Dec 21 2000 8:08PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13491296"> + <url>http://c.moreover.com/click/here.pl?x13491292</url> + <headline_text>XML as the great peacemaker - Extensible Markup Language Accomplished The Seemingly Impossible This Year: It B</headline_text> + <source>Hospitality Net</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://www.hospitalitynet.org/news/list.htm?c=2000</document_url> + <harvest_time>Dec 21 2000 7:45PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13484761"> + <url>http://c.moreover.com/click/here.pl?x13484758</url> + <headline_text>XML as the great peacemaker</headline_text> + <source>CNET</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://news.cnet.com/news/0-1003.html?tag=st.ne.1002.dir.1003</document_url> + <harvest_time>Dec 21 2000 4:41PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13480897"> + <url>http://c.moreover.com/click/here.pl?x13480896</url> + <headline_text>COOP Switzerland Selects Mercator as Integration Platform</headline_text> + <source>Stockhouse Canada</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://www.stockhouse.ca/news/</document_url> + <harvest_time>Dec 21 2000 1:55PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13471024"> + <url>http://c.moreover.com/click/here.pl?x13471023</url> + <headline_text>Competing XML Specs Move Toward a Union</headline_text> + <source>Internet World</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://www.internetworld.com/</document_url> + <harvest_time>Dec 21 2000 11:14AM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13452281"> + <url>http://c.moreover.com/click/here.pl?x13452280</url> + <headline_text>Next-generation XHTML stripped down for handhelds</headline_text> + <source>CNET</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://news.cnet.com/news/0-1005.html?tag=st.ne.1002.dir.1005</document_url> + <harvest_time>Dec 20 2000 9:11PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13451791"> + <url>http://c.moreover.com/click/here.pl?x13451789</url> + <headline_text>Xml Powers Oracle9i(TM) Dynamic Services</headline_text> + <source>Java Industry Connection</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://industry.java.sun.com/javanews/more/hotnews/</document_url> + <harvest_time>Dec 20 2000 9:05PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13442098"> + <url>http://c.moreover.com/click/here.pl?x13442097</url> + <headline_text>XML DOM reference guide</headline_text> + <source>ASPWire</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://aspwire.com/</document_url> + <harvest_time>Dec 20 2000 6:26PM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + <article code="13424118"> + <url>http://c.moreover.com/click/here.pl?x13424117</url> + <headline_text>Repeat/Xqsite And Bowstreet Team to Deliver Integrated Xml Solutions</headline_text> + <source>Java Industry Connection</source> + <media_type>text</media_type> + <cluster>moreover...</cluster> + <tagline> </tagline> + <document_url>http://industry.java.sun.com/javanews/more/hotnews/</document_url> + <harvest_time>Dec 20 2000 9:04AM</harvest_time> + <access_registration> </access_registration> + <access_status> </access_status> + </article> + </moreovernews> + diff --git a/axiom/test/resources/xml/om/much_ado.xml b/axiom/test/resources/xml/om/much_ado.xml new file mode 100644 index 0000000..f008fad --- /dev/null +++ b/axiom/test/resources/xml/om/much_ado.xml @@ -0,0 +1,6850 @@ +<?xml version="1.0"?> +<PLAY> +<TITLE>Much Ado about Nothing</TITLE> + +<FM> +<P>Text placed in the public domain by Moby Lexical Tools, 1992.</P> +<P>SGML markup by Jon Bosak, 1992-1994.</P> +<P>XML version by Jon Bosak, 1996-1998.</P> +<P>This work may be freely copied and distributed worldwide.</P> +</FM> + + +<PERSONAE> +<TITLE>Dramatis Personae</TITLE> + +<PERSONA>DON PEDRO, prince of Arragon.</PERSONA> +<PERSONA>DON JOHN, his bastard brother.</PERSONA> +<PERSONA>CLAUDIO, a young lord of Florence.</PERSONA> +<PERSONA>BENEDICK, a young lord of Padua.</PERSONA> +<PERSONA>LEONATO, governor of Messina.</PERSONA> +<PERSONA>ANTONIO, his brother.</PERSONA> +<PERSONA>BALTHASAR, attendant on Don Pedro.</PERSONA> + +<PGROUP> +<PERSONA>CONRADE</PERSONA> +<PERSONA>BORACHIO</PERSONA> +<GRPDESCR>followers of Don John.</GRPDESCR> +</PGROUP> + +<PERSONA>FRIAR FRANCIS</PERSONA> +<PERSONA>DOGBERRY, a constable.</PERSONA> +<PERSONA>VERGES, a headborough.</PERSONA> +<PERSONA>A Sexton.</PERSONA> +<PERSONA>A Boy.</PERSONA> +<PERSONA>HERO, daughter to Leonato.</PERSONA> +<PERSONA>BEATRICE, niece to Leonato.</PERSONA> + +<PGROUP> +<PERSONA>MARGARET</PERSONA> +<PERSONA>URSULA</PERSONA> +<GRPDESCR>gentlewomen attending on Hero.</GRPDESCR> +</PGROUP> + +<PERSONA>Messengers, Watch, Attendants, &c. </PERSONA> +</PERSONAE> + +<SCNDESCR>SCENE Messina.</SCNDESCR> + +<PLAYSUBT>MUCH ADO ABOUT NOTHING</PLAYSUBT> + +<ACT><TITLE>ACT I</TITLE> + +<SCENE><TITLE>SCENE I. Before LEONATO'S house.</TITLE> +<STAGEDIR>Enter LEONATO, HERO, and BEATRICE, with a +Messenger</STAGEDIR> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>I learn in this letter that Don Peter of Arragon</LINE> +<LINE>comes this night to Messina.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>He is very near by this: he was not three leagues off</LINE> +<LINE>when I left him.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>How many gentlemen have you lost in this action?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>But few of any sort, and none of name.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>A victory is twice itself when the achiever brings</LINE> +<LINE>home full numbers. I find here that Don Peter hath</LINE> +<LINE>bestowed much honour on a young Florentine called Claudio.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>Much deserved on his part and equally remembered by</LINE> +<LINE>Don Pedro: he hath borne himself beyond the</LINE> +<LINE>promise of his age, doing, in the figure of a lamb,</LINE> +<LINE>the feats of a lion: he hath indeed better</LINE> +<LINE>bettered expectation than you must expect of me to</LINE> +<LINE>tell you how.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>He hath an uncle here in Messina will be very much</LINE> +<LINE>glad of it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>I have already delivered him letters, and there</LINE> +<LINE>appears much joy in him; even so much that joy could</LINE> +<LINE>not show itself modest enough without a badge of</LINE> +<LINE>bitterness.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Did he break out into tears?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>In great measure.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>A kind overflow of kindness: there are no faces</LINE> +<LINE>truer than those that are so washed. How much</LINE> +<LINE>better is it to weep at joy than to joy at weeping!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>I pray you, is Signior Mountanto returned from the</LINE> +<LINE>wars or no?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>I know none of that name, lady: there was none such</LINE> +<LINE>in the army of any sort.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>What is he that you ask for, niece?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>My cousin means Signior Benedick of Padua.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>O, he's returned; and as pleasant as ever he was.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>He set up his bills here in Messina and challenged</LINE> +<LINE>Cupid at the flight; and my uncle's fool, reading</LINE> +<LINE>the challenge, subscribed for Cupid, and challenged</LINE> +<LINE>him at the bird-bolt. I pray you, how many hath he</LINE> +<LINE>killed and eaten in these wars? But how many hath</LINE> +<LINE>he killed? for indeed I promised to eat all of his killing.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Faith, niece, you tax Signior Benedick too much;</LINE> +<LINE>but he'll be meet with you, I doubt it not.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>He hath done good service, lady, in these wars.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>You had musty victual, and he hath holp to eat it:</LINE> +<LINE>he is a very valiant trencherman; he hath an</LINE> +<LINE>excellent stomach.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>And a good soldier too, lady.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>And a good soldier to a lady: but what is he to a lord?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>A lord to a lord, a man to a man; stuffed with all</LINE> +<LINE>honourable virtues.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>It is so, indeed; he is no less than a stuffed man:</LINE> +<LINE>but for the stuffing,--well, we are all mortal.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>You must not, sir, mistake my niece. There is a</LINE> +<LINE>kind of merry war betwixt Signior Benedick and her:</LINE> +<LINE>they never meet but there's a skirmish of wit</LINE> +<LINE>between them.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Alas! he gets nothing by that. In our last</LINE> +<LINE>conflict four of his five wits went halting off, and</LINE> +<LINE>now is the whole man governed with one: so that if</LINE> +<LINE>he have wit enough to keep himself warm, let him</LINE> +<LINE>bear it for a difference between himself and his</LINE> +<LINE>horse; for it is all the wealth that he hath left,</LINE> +<LINE>to be known a reasonable creature. Who is his</LINE> +<LINE>companion now? He hath every month a new sworn brother.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>Is't possible?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Very easily possible: he wears his faith but as</LINE> +<LINE>the fashion of his hat; it ever changes with the</LINE> +<LINE>next block.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>I see, lady, the gentleman is not in your books.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>No; an he were, I would burn my study. But, I pray</LINE> +<LINE>you, who is his companion? Is there no young</LINE> +<LINE>squarer now that will make a voyage with him to the devil?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>He is most in the company of the right noble Claudio.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>O Lord, he will hang upon him like a disease: he</LINE> +<LINE>is sooner caught than the pestilence, and the taker</LINE> +<LINE>runs presently mad. God help the noble Claudio! if</LINE> +<LINE>he have caught the Benedick, it will cost him a</LINE> +<LINE>thousand pound ere a' be cured.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>I will hold friends with you, lady.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Do, good friend.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>You will never run mad, niece.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>No, not till a hot January.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>Don Pedro is approached.</LINE> +</SPEECH> + + +<STAGEDIR>Enter DON PEDRO, DON JOHN, CLAUDIO, BENEDICK, +and BALTHASAR</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Good Signior Leonato, you are come to meet your</LINE> +<LINE>trouble: the fashion of the world is to avoid</LINE> +<LINE>cost, and you encounter it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Never came trouble to my house in the likeness of</LINE> +<LINE>your grace: for trouble being gone, comfort should</LINE> +<LINE>remain; but when you depart from me, sorrow abides</LINE> +<LINE>and happiness takes his leave.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>You embrace your charge too willingly. I think this</LINE> +<LINE>is your daughter.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Her mother hath many times told me so.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Were you in doubt, sir, that you asked her?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Signior Benedick, no; for then were you a child.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>You have it full, Benedick: we may guess by this</LINE> +<LINE>what you are, being a man. Truly, the lady fathers</LINE> +<LINE>herself. Be happy, lady; for you are like an</LINE> +<LINE>honourable father.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>If Signior Leonato be her father, she would not</LINE> +<LINE>have his head on her shoulders for all Messina, as</LINE> +<LINE>like him as she is.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>I wonder that you will still be talking, Signior</LINE> +<LINE>Benedick: nobody marks you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>What, my dear Lady Disdain! are you yet living?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Is it possible disdain should die while she hath</LINE> +<LINE>such meet food to feed it as Signior Benedick?</LINE> +<LINE>Courtesy itself must convert to disdain, if you come</LINE> +<LINE>in her presence.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Then is courtesy a turncoat. But it is certain I</LINE> +<LINE>am loved of all ladies, only you excepted: and I</LINE> +<LINE>would I could find in my heart that I had not a hard</LINE> +<LINE>heart; for, truly, I love none.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>A dear happiness to women: they would else have</LINE> +<LINE>been troubled with a pernicious suitor. I thank God</LINE> +<LINE>and my cold blood, I am of your humour for that: I</LINE> +<LINE>had rather hear my dog bark at a crow than a man</LINE> +<LINE>swear he loves me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>God keep your ladyship still in that mind! so some</LINE> +<LINE>gentleman or other shall 'scape a predestinate</LINE> +<LINE>scratched face.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Scratching could not make it worse, an 'twere such</LINE> +<LINE>a face as yours were.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Well, you are a rare parrot-teacher.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>A bird of my tongue is better than a beast of yours.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I would my horse had the speed of your tongue, and</LINE> +<LINE>so good a continuer. But keep your way, i' God's</LINE> +<LINE>name; I have done.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>You always end with a jade's trick: I know you of old.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>That is the sum of all, Leonato. Signior Claudio</LINE> +<LINE>and Signior Benedick, my dear friend Leonato hath</LINE> +<LINE>invited you all. I tell him we shall stay here at</LINE> +<LINE>the least a month; and he heartily prays some</LINE> +<LINE>occasion may detain us longer. I dare swear he is no</LINE> +<LINE>hypocrite, but prays from his heart.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>If you swear, my lord, you shall not be forsworn.</LINE> +<STAGEDIR>To DON JOHN</STAGEDIR> +<LINE>Let me bid you welcome, my lord: being reconciled to</LINE> +<LINE>the prince your brother, I owe you all duty.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>I thank you: I am not of many words, but I thank</LINE> +<LINE>you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Please it your grace lead on?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Your hand, Leonato; we will go together.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt all except BENEDICK and CLAUDIO</STAGEDIR> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Benedick, didst thou note the daughter of Signior Leonato?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I noted her not; but I looked on her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Is she not a modest young lady?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Do you question me, as an honest man should do, for</LINE> +<LINE>my simple true judgment; or would you have me speak</LINE> +<LINE>after my custom, as being a professed tyrant to their sex?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>No; I pray thee speak in sober judgment.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Why, i' faith, methinks she's too low for a high</LINE> +<LINE>praise, too brown for a fair praise and too little</LINE> +<LINE>for a great praise: only this commendation I can</LINE> +<LINE>afford her, that were she other than she is, she</LINE> +<LINE>were unhandsome; and being no other but as she is, I</LINE> +<LINE>do not like her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Thou thinkest I am in sport: I pray thee tell me</LINE> +<LINE>truly how thou likest her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Would you buy her, that you inquire after her?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Can the world buy such a jewel?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Yea, and a case to put it into. But speak you this</LINE> +<LINE>with a sad brow? or do you play the flouting Jack,</LINE> +<LINE>to tell us Cupid is a good hare-finder and Vulcan a</LINE> +<LINE>rare carpenter? Come, in what key shall a man take</LINE> +<LINE>you, to go in the song?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>In mine eye she is the sweetest lady that ever I</LINE> +<LINE>looked on.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I can see yet without spectacles and I see no such</LINE> +<LINE>matter: there's her cousin, an she were not</LINE> +<LINE>possessed with a fury, exceeds her as much in beauty</LINE> +<LINE>as the first of May doth the last of December. But I</LINE> +<LINE>hope you have no intent to turn husband, have you?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>I would scarce trust myself, though I had sworn the</LINE> +<LINE>contrary, if Hero would be my wife.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Is't come to this? In faith, hath not the world</LINE> +<LINE>one man but he will wear his cap with suspicion?</LINE> +<LINE>Shall I never see a bachelor of three-score again?</LINE> +<LINE>Go to, i' faith; an thou wilt needs thrust thy neck</LINE> +<LINE>into a yoke, wear the print of it and sigh away</LINE> +<LINE>Sundays. Look Don Pedro is returned to seek you.</LINE> +</SPEECH> + + +<STAGEDIR>Re-enter DON PEDRO</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>What secret hath held you here, that you followed</LINE> +<LINE>not to Leonato's?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I would your grace would constrain me to tell.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>I charge thee on thy allegiance.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>You hear, Count Claudio: I can be secret as a dumb</LINE> +<LINE>man; I would have you think so; but, on my</LINE> +<LINE>allegiance, mark you this, on my allegiance. He is</LINE> +<LINE>in love. With who? now that is your grace's part.</LINE> +<LINE>Mark how short his answer is;--With Hero, Leonato's</LINE> +<LINE>short daughter.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>If this were so, so were it uttered.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Like the old tale, my lord: 'it is not so, nor</LINE> +<LINE>'twas not so, but, indeed, God forbid it should be</LINE> +<LINE>so.'</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>If my passion change not shortly, God forbid it</LINE> +<LINE>should be otherwise.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Amen, if you love her; for the lady is very well worthy.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>You speak this to fetch me in, my lord.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>By my troth, I speak my thought.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>And, in faith, my lord, I spoke mine.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>And, by my two faiths and troths, my lord, I spoke mine.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>That I love her, I feel.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>That she is worthy, I know.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>That I neither feel how she should be loved nor</LINE> +<LINE>know how she should be worthy, is the opinion that</LINE> +<LINE>fire cannot melt out of me: I will die in it at the stake.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Thou wast ever an obstinate heretic in the despite</LINE> +<LINE>of beauty.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>And never could maintain his part but in the force</LINE> +<LINE>of his will.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>That a woman conceived me, I thank her; that she</LINE> +<LINE>brought me up, I likewise give her most humble</LINE> +<LINE>thanks: but that I will have a recheat winded in my</LINE> +<LINE>forehead, or hang my bugle in an invisible baldrick,</LINE> +<LINE>all women shall pardon me. Because I will not do</LINE> +<LINE>them the wrong to mistrust any, I will do myself the</LINE> +<LINE>right to trust none; and the fine is, for the which</LINE> +<LINE>I may go the finer, I will live a bachelor.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>I shall see thee, ere I die, look pale with love.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>With anger, with sickness, or with hunger, my lord,</LINE> +<LINE>not with love: prove that ever I lose more blood</LINE> +<LINE>with love than I will get again with drinking, pick</LINE> +<LINE>out mine eyes with a ballad-maker's pen and hang me</LINE> +<LINE>up at the door of a brothel-house for the sign of</LINE> +<LINE>blind Cupid.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Well, if ever thou dost fall from this faith, thou</LINE> +<LINE>wilt prove a notable argument.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>If I do, hang me in a bottle like a cat and shoot</LINE> +<LINE>at me; and he that hits me, let him be clapped on</LINE> +<LINE>the shoulder, and called Adam.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Well, as time shall try: 'In time the savage bull</LINE> +<LINE>doth bear the yoke.'</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>The savage bull may; but if ever the sensible</LINE> +<LINE>Benedick bear it, pluck off the bull's horns and set</LINE> +<LINE>them in my forehead: and let me be vilely painted,</LINE> +<LINE>and in such great letters as they write 'Here is</LINE> +<LINE>good horse to hire,' let them signify under my sign</LINE> +<LINE>'Here you may see Benedick the married man.'</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>If this should ever happen, thou wouldst be horn-mad.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Nay, if Cupid have not spent all his quiver in</LINE> +<LINE>Venice, thou wilt quake for this shortly.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I look for an earthquake too, then.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Well, you temporize with the hours. In the</LINE> +<LINE>meantime, good Signior Benedick, repair to</LINE> +<LINE>Leonato's: commend me to him and tell him I will</LINE> +<LINE>not fail him at supper; for indeed he hath made</LINE> +<LINE>great preparation.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I have almost matter enough in me for such an</LINE> +<LINE>embassage; and so I commit you--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>To the tuition of God: From my house, if I had it,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>The sixth of July: Your loving friend, Benedick.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Nay, mock not, mock not. The body of your</LINE> +<LINE>discourse is sometime guarded with fragments, and</LINE> +<LINE>the guards are but slightly basted on neither: ere</LINE> +<LINE>you flout old ends any further, examine your</LINE> +<LINE>conscience: and so I leave you.</LINE> +</SPEECH> + + +<STAGEDIR>Exit</STAGEDIR> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>My liege, your highness now may do me good.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>My love is thine to teach: teach it but how,</LINE> +<LINE>And thou shalt see how apt it is to learn</LINE> +<LINE>Any hard lesson that may do thee good.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Hath Leonato any son, my lord?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>No child but Hero; she's his only heir.</LINE> +<LINE>Dost thou affect her, Claudio?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>O, my lord,</LINE> +<LINE>When you went onward on this ended action,</LINE> +<LINE>I look'd upon her with a soldier's eye,</LINE> +<LINE>That liked, but had a rougher task in hand</LINE> +<LINE>Than to drive liking to the name of love:</LINE> +<LINE>But now I am return'd and that war-thoughts</LINE> +<LINE>Have left their places vacant, in their rooms</LINE> +<LINE>Come thronging soft and delicate desires,</LINE> +<LINE>All prompting me how fair young Hero is,</LINE> +<LINE>Saying, I liked her ere I went to wars.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Thou wilt be like a lover presently</LINE> +<LINE>And tire the hearer with a book of words.</LINE> +<LINE>If thou dost love fair Hero, cherish it,</LINE> +<LINE>And I will break with her and with her father,</LINE> +<LINE>And thou shalt have her. Was't not to this end</LINE> +<LINE>That thou began'st to twist so fine a story?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>How sweetly you do minister to love,</LINE> +<LINE>That know love's grief by his complexion!</LINE> +<LINE>But lest my liking might too sudden seem,</LINE> +<LINE>I would have salved it with a longer treatise.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>What need the bridge much broader than the flood?</LINE> +<LINE>The fairest grant is the necessity.</LINE> +<LINE>Look, what will serve is fit: 'tis once, thou lovest,</LINE> +<LINE>And I will fit thee with the remedy.</LINE> +<LINE>I know we shall have revelling to-night:</LINE> +<LINE>I will assume thy part in some disguise</LINE> +<LINE>And tell fair Hero I am Claudio,</LINE> +<LINE>And in her bosom I'll unclasp my heart</LINE> +<LINE>And take her hearing prisoner with the force</LINE> +<LINE>And strong encounter of my amorous tale:</LINE> +<LINE>Then after to her father will I break;</LINE> +<LINE>And the conclusion is, she shall be thine.</LINE> +<LINE>In practise let us put it presently.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> + +<SCENE><TITLE>SCENE II. A room in LEONATO's house.</TITLE> +<STAGEDIR>Enter LEONATO and ANTONIO, meeting</STAGEDIR> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>How now, brother! Where is my cousin, your son?</LINE> +<LINE>hath he provided this music?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>He is very busy about it. But, brother, I can tell</LINE> +<LINE>you strange news that you yet dreamt not of.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Are they good?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>As the event stamps them: but they have a good</LINE> +<LINE>cover; they show well outward. The prince and Count</LINE> +<LINE>Claudio, walking in a thick-pleached alley in mine</LINE> +<LINE>orchard, were thus much overheard by a man of mine:</LINE> +<LINE>the prince discovered to Claudio that he loved my</LINE> +<LINE>niece your daughter and meant to acknowledge it</LINE> +<LINE>this night in a dance: and if he found her</LINE> +<LINE>accordant, he meant to take the present time by the</LINE> +<LINE>top and instantly break with you of it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Hath the fellow any wit that told you this?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>A good sharp fellow: I will send for him; and</LINE> +<LINE>question him yourself.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>No, no; we will hold it as a dream till it appear</LINE> +<LINE>itself: but I will acquaint my daughter withal,</LINE> +<LINE>that she may be the better prepared for an answer,</LINE> +<LINE>if peradventure this be true. Go you and tell her of it.</LINE> +<STAGEDIR>Enter Attendants</STAGEDIR> +<LINE>Cousins, you know what you have to do. O, I cry you</LINE> +<LINE>mercy, friend; go you with me, and I will use your</LINE> +<LINE>skill. Good cousin, have a care this busy time.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> + +<SCENE><TITLE>SCENE III. The same.</TITLE> +<STAGEDIR>Enter DON JOHN and CONRADE</STAGEDIR> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>What the good-year, my lord! why are you thus out</LINE> +<LINE>of measure sad?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>There is no measure in the occasion that breeds;</LINE> +<LINE>therefore the sadness is without limit.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>You should hear reason.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>And when I have heard it, what blessing brings it?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>If not a present remedy, at least a patient</LINE> +<LINE>sufferance.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>I wonder that thou, being, as thou sayest thou art,</LINE> +<LINE>born under Saturn, goest about to apply a moral</LINE> +<LINE>medicine to a mortifying mischief. I cannot hide</LINE> +<LINE>what I am: I must be sad when I have cause and smile</LINE> +<LINE>at no man's jests, eat when I have stomach and wait</LINE> +<LINE>for no man's leisure, sleep when I am drowsy and</LINE> +<LINE>tend on no man's business, laugh when I am merry and</LINE> +<LINE>claw no man in his humour.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>Yea, but you must not make the full show of this</LINE> +<LINE>till you may do it without controlment. You have of</LINE> +<LINE>late stood out against your brother, and he hath</LINE> +<LINE>ta'en you newly into his grace; where it is</LINE> +<LINE>impossible you should take true root but by the</LINE> +<LINE>fair weather that you make yourself: it is needful</LINE> +<LINE>that you frame the season for your own harvest.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>I had rather be a canker in a hedge than a rose in</LINE> +<LINE>his grace, and it better fits my blood to be</LINE> +<LINE>disdained of all than to fashion a carriage to rob</LINE> +<LINE>love from any: in this, though I cannot be said to</LINE> +<LINE>be a flattering honest man, it must not be denied</LINE> +<LINE>but I am a plain-dealing villain. I am trusted with</LINE> +<LINE>a muzzle and enfranchised with a clog; therefore I</LINE> +<LINE>have decreed not to sing in my cage. If I had my</LINE> +<LINE>mouth, I would bite; if I had my liberty, I would do</LINE> +<LINE>my liking: in the meantime let me be that I am and</LINE> +<LINE>seek not to alter me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>Can you make no use of your discontent?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>I make all use of it, for I use it only.</LINE> +<LINE>Who comes here?</LINE> +<STAGEDIR>Enter BORACHIO</STAGEDIR> +<LINE>What news, Borachio?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>I came yonder from a great supper: the prince your</LINE> +<LINE>brother is royally entertained by Leonato: and I</LINE> +<LINE>can give you intelligence of an intended marriage.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Will it serve for any model to build mischief on?</LINE> +<LINE>What is he for a fool that betroths himself to</LINE> +<LINE>unquietness?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Marry, it is your brother's right hand.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Who? the most exquisite Claudio?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Even he.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>A proper squire! And who, and who? which way looks</LINE> +<LINE>he?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Marry, on Hero, the daughter and heir of Leonato.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>A very forward March-chick! How came you to this?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Being entertained for a perfumer, as I was smoking a</LINE> +<LINE>musty room, comes me the prince and Claudio, hand</LINE> +<LINE>in hand in sad conference: I whipt me behind the</LINE> +<LINE>arras; and there heard it agreed upon that the</LINE> +<LINE>prince should woo Hero for himself, and having</LINE> +<LINE>obtained her, give her to Count Claudio.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Come, come, let us thither: this may prove food to</LINE> +<LINE>my displeasure. That young start-up hath all the</LINE> +<LINE>glory of my overthrow: if I can cross him any way, I</LINE> +<LINE>bless myself every way. You are both sure, and will assist me?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>To the death, my lord.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Let us to the great supper: their cheer is the</LINE> +<LINE>greater that I am subdued. Would the cook were of</LINE> +<LINE>my mind! Shall we go prove what's to be done?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>We'll wait upon your lordship.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> + +</ACT> + +<ACT><TITLE>ACT II</TITLE> + +<SCENE><TITLE>SCENE I. A hall in LEONATO'S house.</TITLE> +<STAGEDIR>Enter LEONATO, ANTONIO, HERO, BEATRICE, and others</STAGEDIR> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Was not Count John here at supper?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>I saw him not.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>How tartly that gentleman looks! I never can see</LINE> +<LINE>him but I am heart-burned an hour after.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>He is of a very melancholy disposition.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>He were an excellent man that were made just in the</LINE> +<LINE>midway between him and Benedick: the one is too</LINE> +<LINE>like an image and says nothing, and the other too</LINE> +<LINE>like my lady's eldest son, evermore tattling.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Then half Signior Benedick's tongue in Count John's</LINE> +<LINE>mouth, and half Count John's melancholy in Signior</LINE> +<LINE>Benedick's face,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>With a good leg and a good foot, uncle, and money</LINE> +<LINE>enough in his purse, such a man would win any woman</LINE> +<LINE>in the world, if a' could get her good-will.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>By my troth, niece, thou wilt never get thee a</LINE> +<LINE>husband, if thou be so shrewd of thy tongue.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>In faith, she's too curst.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Too curst is more than curst: I shall lessen God's</LINE> +<LINE>sending that way; for it is said, 'God sends a curst</LINE> +<LINE>cow short horns;' but to a cow too curst he sends none.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>So, by being too curst, God will send you no horns.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Just, if he send me no husband; for the which</LINE> +<LINE>blessing I am at him upon my knees every morning and</LINE> +<LINE>evening. Lord, I could not endure a husband with a</LINE> +<LINE>beard on his face: I had rather lie in the woollen.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>You may light on a husband that hath no beard.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>What should I do with him? dress him in my apparel</LINE> +<LINE>and make him my waiting-gentlewoman? He that hath a</LINE> +<LINE>beard is more than a youth, and he that hath no</LINE> +<LINE>beard is less than a man: and he that is more than</LINE> +<LINE>a youth is not for me, and he that is less than a</LINE> +<LINE>man, I am not for him: therefore, I will even take</LINE> +<LINE>sixpence in earnest of the bear-ward, and lead his</LINE> +<LINE>apes into hell.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Well, then, go you into hell?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>No, but to the gate; and there will the devil meet</LINE> +<LINE>me, like an old cuckold, with horns on his head, and</LINE> +<LINE>say 'Get you to heaven, Beatrice, get you to</LINE> +<LINE>heaven; here's no place for you maids:' so deliver</LINE> +<LINE>I up my apes, and away to Saint Peter for the</LINE> +<LINE>heavens; he shows me where the bachelors sit, and</LINE> +<LINE>there live we as merry as the day is long.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE><STAGEDIR>To HERO</STAGEDIR> Well, niece, I trust you will be ruled</LINE> +<LINE>by your father.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Yes, faith; it is my cousin's duty to make curtsy</LINE> +<LINE>and say 'Father, as it please you.' But yet for all</LINE> +<LINE>that, cousin, let him be a handsome fellow, or else</LINE> +<LINE>make another curtsy and say 'Father, as it please</LINE> +<LINE>me.'</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Well, niece, I hope to see you one day fitted with a husband.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Not till God make men of some other metal than</LINE> +<LINE>earth. Would it not grieve a woman to be</LINE> +<LINE>overmastered with a pierce of valiant dust? to make</LINE> +<LINE>an account of her life to a clod of wayward marl?</LINE> +<LINE>No, uncle, I'll none: Adam's sons are my brethren;</LINE> +<LINE>and, truly, I hold it a sin to match in my kindred.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Daughter, remember what I told you: if the prince</LINE> +<LINE>do solicit you in that kind, you know your answer.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>The fault will be in the music, cousin, if you be</LINE> +<LINE>not wooed in good time: if the prince be too</LINE> +<LINE>important, tell him there is measure in every thing</LINE> +<LINE>and so dance out the answer. For, hear me, Hero:</LINE> +<LINE>wooing, wedding, and repenting, is as a Scotch jig,</LINE> +<LINE>a measure, and a cinque pace: the first suit is hot</LINE> +<LINE>and hasty, like a Scotch jig, and full as</LINE> +<LINE>fantastical; the wedding, mannerly-modest, as a</LINE> +<LINE>measure, full of state and ancientry; and then comes</LINE> +<LINE>repentance and, with his bad legs, falls into the</LINE> +<LINE>cinque pace faster and faster, till he sink into his grave.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Cousin, you apprehend passing shrewdly.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>I have a good eye, uncle; I can see a church by daylight.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>The revellers are entering, brother: make good room.</LINE> +</SPEECH> + +<STAGEDIR>All put on their masks</STAGEDIR> +<STAGEDIR>Enter DON PEDRO, CLAUDIO, BENEDICK, BALTHASAR, +DON JOHN, BORACHIO, MARGARET, URSULA and others, masked</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Lady, will you walk about with your friend?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>So you walk softly and look sweetly and say nothing,</LINE> +<LINE>I am yours for the walk; and especially when I walk away.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>With me in your company?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>I may say so, when I please.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>And when please you to say so?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>When I like your favour; for God defend the lute</LINE> +<LINE>should be like the case!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>My visor is Philemon's roof; within the house is Jove.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Why, then, your visor should be thatched.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Speak low, if you speak love.</LINE> +</SPEECH> + + +<STAGEDIR>Drawing her aside</STAGEDIR> + +<SPEECH> +<SPEAKER>BALTHASAR</SPEAKER> +<LINE>Well, I would you did like me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>So would not I, for your own sake; for I have many</LINE> +<LINE>ill-qualities.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BALTHASAR</SPEAKER> +<LINE>Which is one?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>I say my prayers aloud.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BALTHASAR</SPEAKER> +<LINE>I love you the better: the hearers may cry, Amen.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>God match me with a good dancer!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BALTHASAR</SPEAKER> +<LINE>Amen.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>And God keep him out of my sight when the dance is</LINE> +<LINE>done! Answer, clerk.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BALTHASAR</SPEAKER> +<LINE>No more words: the clerk is answered.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>I know you well enough; you are Signior Antonio.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>At a word, I am not.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>I know you by the waggling of your head.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>To tell you true, I counterfeit him.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>You could never do him so ill-well, unless you were</LINE> +<LINE>the very man. Here's his dry hand up and down: you</LINE> +<LINE>are he, you are he.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>At a word, I am not.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>Come, come, do you think I do not know you by your</LINE> +<LINE>excellent wit? can virtue hide itself? Go to,</LINE> +<LINE>mum, you are he: graces will appear, and there's an</LINE> +<LINE>end.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Will you not tell me who told you so?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>No, you shall pardon me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Nor will you not tell me who you are?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Not now.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>That I was disdainful, and that I had my good wit</LINE> +<LINE>out of the 'Hundred Merry Tales:'--well this was</LINE> +<LINE>Signior Benedick that said so.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>What's he?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>I am sure you know him well enough.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Not I, believe me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Did he never make you laugh?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I pray you, what is he?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Why, he is the prince's jester: a very dull fool;</LINE> +<LINE>only his gift is in devising impossible slanders:</LINE> +<LINE>none but libertines delight in him; and the</LINE> +<LINE>commendation is not in his wit, but in his villany;</LINE> +<LINE>for he both pleases men and angers them, and then</LINE> +<LINE>they laugh at him and beat him. I am sure he is in</LINE> +<LINE>the fleet: I would he had boarded me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>When I know the gentleman, I'll tell him what you say.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Do, do: he'll but break a comparison or two on me;</LINE> +<LINE>which, peradventure not marked or not laughed at,</LINE> +<LINE>strikes him into melancholy; and then there's a</LINE> +<LINE>partridge wing saved, for the fool will eat no</LINE> +<LINE>supper that night.</LINE> +<STAGEDIR>Music</STAGEDIR> +<LINE>We must follow the leaders.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>In every good thing.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Nay, if they lead to any ill, I will leave them at</LINE> +<LINE>the next turning.</LINE> +</SPEECH> + + +<STAGEDIR>Dance. Then exeunt all except DON JOHN, BORACHIO, +and CLAUDIO</STAGEDIR> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Sure my brother is amorous on Hero and hath</LINE> +<LINE>withdrawn her father to break with him about it.</LINE> +<LINE>The ladies follow her and but one visor remains.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>And that is Claudio: I know him by his bearing.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Are not you Signior Benedick?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>You know me well; I am he.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Signior, you are very near my brother in his love:</LINE> +<LINE>he is enamoured on Hero; I pray you, dissuade him</LINE> +<LINE>from her: she is no equal for his birth: you may</LINE> +<LINE>do the part of an honest man in it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>How know you he loves her?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>I heard him swear his affection.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>So did I too; and he swore he would marry her to-night.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Come, let us to the banquet.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt DON JOHN and BORACHIO</STAGEDIR> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Thus answer I in the name of Benedick,</LINE> +<LINE>But hear these ill news with the ears of Claudio.</LINE> +<LINE>'Tis certain so; the prince wooes for himself.</LINE> +<LINE>Friendship is constant in all other things</LINE> +<LINE>Save in the office and affairs of love:</LINE> +<LINE>Therefore, all hearts in love use their own tongues;</LINE> +<LINE>Let every eye negotiate for itself</LINE> +<LINE>And trust no agent; for beauty is a witch</LINE> +<LINE>Against whose charms faith melteth into blood.</LINE> +<LINE>This is an accident of hourly proof,</LINE> +<LINE>Which I mistrusted not. Farewell, therefore, Hero!</LINE> +</SPEECH> + + +<STAGEDIR>Re-enter BENEDICK</STAGEDIR> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Count Claudio?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Yea, the same.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Come, will you go with me?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Whither?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Even to the next willow, about your own business,</LINE> +<LINE>county. What fashion will you wear the garland of?</LINE> +<LINE>about your neck, like an usurer's chain? or under</LINE> +<LINE>your arm, like a lieutenant's scarf? You must wear</LINE> +<LINE>it one way, for the prince hath got your Hero.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>I wish him joy of her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Why, that's spoken like an honest drovier: so they</LINE> +<LINE>sell bullocks. But did you think the prince would</LINE> +<LINE>have served you thus?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>I pray you, leave me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Ho! now you strike like the blind man: 'twas the</LINE> +<LINE>boy that stole your meat, and you'll beat the post.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>If it will not be, I'll leave you.</LINE> +</SPEECH> + + +<STAGEDIR>Exit</STAGEDIR> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Alas, poor hurt fowl! now will he creep into sedges.</LINE> +<LINE>But that my Lady Beatrice should know me, and not</LINE> +<LINE>know me! The prince's fool! Ha? It may be I go</LINE> +<LINE>under that title because I am merry. Yea, but so I</LINE> +<LINE>am apt to do myself wrong; I am not so reputed: it</LINE> +<LINE>is the base, though bitter, disposition of Beatrice</LINE> +<LINE>that puts the world into her person and so gives me</LINE> +<LINE>out. Well, I'll be revenged as I may.</LINE> +</SPEECH> + + +<STAGEDIR>Re-enter DON PEDRO</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Now, signior, where's the count? did you see him?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Troth, my lord, I have played the part of Lady Fame.</LINE> +<LINE>I found him here as melancholy as a lodge in a</LINE> +<LINE>warren: I told him, and I think I told him true,</LINE> +<LINE>that your grace had got the good will of this young</LINE> +<LINE>lady; and I offered him my company to a willow-tree,</LINE> +<LINE>either to make him a garland, as being forsaken, or</LINE> +<LINE>to bind him up a rod, as being worthy to be whipped.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>To be whipped! What's his fault?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>The flat transgression of a schoolboy, who, being</LINE> +<LINE>overjoyed with finding a birds' nest, shows it his</LINE> +<LINE>companion, and he steals it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Wilt thou make a trust a transgression? The</LINE> +<LINE>transgression is in the stealer.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Yet it had not been amiss the rod had been made,</LINE> +<LINE>and the garland too; for the garland he might have</LINE> +<LINE>worn himself, and the rod he might have bestowed on</LINE> +<LINE>you, who, as I take it, have stolen his birds' nest.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>I will but teach them to sing, and restore them to</LINE> +<LINE>the owner.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>If their singing answer your saying, by my faith,</LINE> +<LINE>you say honestly.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>The Lady Beatrice hath a quarrel to you: the</LINE> +<LINE>gentleman that danced with her told her she is much</LINE> +<LINE>wronged by you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>O, she misused me past the endurance of a block!</LINE> +<LINE>an oak but with one green leaf on it would have</LINE> +<LINE>answered her; my very visor began to assume life and</LINE> +<LINE>scold with her. She told me, not thinking I had been</LINE> +<LINE>myself, that I was the prince's jester, that I was</LINE> +<LINE>duller than a great thaw; huddling jest upon jest</LINE> +<LINE>with such impossible conveyance upon me that I stood</LINE> +<LINE>like a man at a mark, with a whole army shooting at</LINE> +<LINE>me. She speaks poniards, and every word stabs:</LINE> +<LINE>if her breath were as terrible as her terminations,</LINE> +<LINE>there were no living near her; she would infect to</LINE> +<LINE>the north star. I would not marry her, though she</LINE> +<LINE>were endowed with all that Adam bad left him before</LINE> +<LINE>he transgressed: she would have made Hercules have</LINE> +<LINE>turned spit, yea, and have cleft his club to make</LINE> +<LINE>the fire too. Come, talk not of her: you shall find</LINE> +<LINE>her the infernal Ate in good apparel. I would to God</LINE> +<LINE>some scholar would conjure her; for certainly, while</LINE> +<LINE>she is here, a man may live as quiet in hell as in a</LINE> +<LINE>sanctuary; and people sin upon purpose, because they</LINE> +<LINE>would go thither; so, indeed, all disquiet, horror</LINE> +<LINE>and perturbation follows her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Look, here she comes.</LINE> +</SPEECH> + + +<STAGEDIR>Enter CLAUDIO, BEATRICE, HERO, and LEONATO</STAGEDIR> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Will your grace command me any service to the</LINE> +<LINE>world's end? I will go on the slightest errand now</LINE> +<LINE>to the Antipodes that you can devise to send me on;</LINE> +<LINE>I will fetch you a tooth-picker now from the</LINE> +<LINE>furthest inch of Asia, bring you the length of</LINE> +<LINE>Prester John's foot, fetch you a hair off the great</LINE> +<LINE>Cham's beard, do you any embassage to the Pigmies,</LINE> +<LINE>rather than hold three words' conference with this</LINE> +<LINE>harpy. You have no employment for me?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>None, but to desire your good company.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>O God, sir, here's a dish I love not: I cannot</LINE> +<LINE>endure my Lady Tongue.</LINE> +</SPEECH> + + +<STAGEDIR>Exit</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Come, lady, come; you have lost the heart of</LINE> +<LINE>Signior Benedick.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Indeed, my lord, he lent it me awhile; and I gave</LINE> +<LINE>him use for it, a double heart for his single one:</LINE> +<LINE>marry, once before he won it of me with false dice,</LINE> +<LINE>therefore your grace may well say I have lost it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>You have put him down, lady, you have put him down.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>So I would not he should do me, my lord, lest I</LINE> +<LINE>should prove the mother of fools. I have brought</LINE> +<LINE>Count Claudio, whom you sent me to seek.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Why, how now, count! wherefore are you sad?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Not sad, my lord.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>How then? sick?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Neither, my lord.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>The count is neither sad, nor sick, nor merry, nor</LINE> +<LINE>well; but civil count, civil as an orange, and</LINE> +<LINE>something of that jealous complexion.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>I' faith, lady, I think your blazon to be true;</LINE> +<LINE>though, I'll be sworn, if he be so, his conceit is</LINE> +<LINE>false. Here, Claudio, I have wooed in thy name, and</LINE> +<LINE>fair Hero is won: I have broke with her father,</LINE> +<LINE>and his good will obtained: name the day of</LINE> +<LINE>marriage, and God give thee joy!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Count, take of me my daughter, and with her my</LINE> +<LINE>fortunes: his grace hath made the match, and an</LINE> +<LINE>grace say Amen to it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Speak, count, 'tis your cue.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Silence is the perfectest herald of joy: I were</LINE> +<LINE>but little happy, if I could say how much. Lady, as</LINE> +<LINE>you are mine, I am yours: I give away myself for</LINE> +<LINE>you and dote upon the exchange.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Speak, cousin; or, if you cannot, stop his mouth</LINE> +<LINE>with a kiss, and let not him speak neither.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>In faith, lady, you have a merry heart.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Yea, my lord; I thank it, poor fool, it keeps on</LINE> +<LINE>the windy side of care. My cousin tells him in his</LINE> +<LINE>ear that he is in her heart.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>And so she doth, cousin.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Good Lord, for alliance! Thus goes every one to the</LINE> +<LINE>world but I, and I am sunburnt; I may sit in a</LINE> +<LINE>corner and cry heigh-ho for a husband!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Lady Beatrice, I will get you one.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>I would rather have one of your father's getting.</LINE> +<LINE>Hath your grace ne'er a brother like you? Your</LINE> +<LINE>father got excellent husbands, if a maid could come by them.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Will you have me, lady?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>No, my lord, unless I might have another for</LINE> +<LINE>working-days: your grace is too costly to wear</LINE> +<LINE>every day. But, I beseech your grace, pardon me: I</LINE> +<LINE>was born to speak all mirth and no matter.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Your silence most offends me, and to be merry best</LINE> +<LINE>becomes you; for, out of question, you were born in</LINE> +<LINE>a merry hour.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>No, sure, my lord, my mother cried; but then there</LINE> +<LINE>was a star danced, and under that was I born.</LINE> +<LINE>Cousins, God give you joy!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Niece, will you look to those things I told you of?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>I cry you mercy, uncle. By your grace's pardon.</LINE> +</SPEECH> + + +<STAGEDIR>Exit</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>By my troth, a pleasant-spirited lady.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>There's little of the melancholy element in her, my</LINE> +<LINE>lord: she is never sad but when she sleeps, and</LINE> +<LINE>not ever sad then; for I have heard my daughter say,</LINE> +<LINE>she hath often dreamed of unhappiness and waked</LINE> +<LINE>herself with laughing.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>She cannot endure to hear tell of a husband.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>O, by no means: she mocks all her wooers out of suit.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>She were an excellent wife for Benedict.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>O Lord, my lord, if they were but a week married,</LINE> +<LINE>they would talk themselves mad.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>County Claudio, when mean you to go to church?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>To-morrow, my lord: time goes on crutches till love</LINE> +<LINE>have all his rites.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Not till Monday, my dear son, which is hence a just</LINE> +<LINE>seven-night; and a time too brief, too, to have all</LINE> +<LINE>things answer my mind.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Come, you shake the head at so long a breathing:</LINE> +<LINE>but, I warrant thee, Claudio, the time shall not go</LINE> +<LINE>dully by us. I will in the interim undertake one of</LINE> +<LINE>Hercules' labours; which is, to bring Signior</LINE> +<LINE>Benedick and the Lady Beatrice into a mountain of</LINE> +<LINE>affection the one with the other. I would fain have</LINE> +<LINE>it a match, and I doubt not but to fashion it, if</LINE> +<LINE>you three will but minister such assistance as I</LINE> +<LINE>shall give you direction.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>My lord, I am for you, though it cost me ten</LINE> +<LINE>nights' watchings.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>And I, my lord.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>And you too, gentle Hero?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>I will do any modest office, my lord, to help my</LINE> +<LINE>cousin to a good husband.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>And Benedick is not the unhopefullest husband that</LINE> +<LINE>I know. Thus far can I praise him; he is of a noble</LINE> +<LINE>strain, of approved valour and confirmed honesty. I</LINE> +<LINE>will teach you how to humour your cousin, that she</LINE> +<LINE>shall fall in love with Benedick; and I, with your</LINE> +<LINE>two helps, will so practise on Benedick that, in</LINE> +<LINE>despite of his quick wit and his queasy stomach, he</LINE> +<LINE>shall fall in love with Beatrice. If we can do this,</LINE> +<LINE>Cupid is no longer an archer: his glory shall be</LINE> +<LINE>ours, for we are the only love-gods. Go in with me,</LINE> +<LINE>and I will tell you my drift.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> + +<SCENE><TITLE>SCENE II. The same.</TITLE> +<STAGEDIR>Enter DON JOHN and BORACHIO</STAGEDIR> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>It is so; the Count Claudio shall marry the</LINE> +<LINE>daughter of Leonato.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Yea, my lord; but I can cross it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Any bar, any cross, any impediment will be</LINE> +<LINE>medicinable to me: I am sick in displeasure to him,</LINE> +<LINE>and whatsoever comes athwart his affection ranges</LINE> +<LINE>evenly with mine. How canst thou cross this marriage?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Not honestly, my lord; but so covertly that no</LINE> +<LINE>dishonesty shall appear in me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Show me briefly how.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>I think I told your lordship a year since, how much</LINE> +<LINE>I am in the favour of Margaret, the waiting</LINE> +<LINE>gentlewoman to Hero.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>I remember.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>I can, at any unseasonable instant of the night,</LINE> +<LINE>appoint her to look out at her lady's chamber window.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>What life is in that, to be the death of this marriage?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>The poison of that lies in you to temper. Go you to</LINE> +<LINE>the prince your brother; spare not to tell him that</LINE> +<LINE>he hath wronged his honour in marrying the renowned</LINE> +<LINE>Claudio--whose estimation do you mightily hold</LINE> +<LINE>up--to a contaminated stale, such a one as Hero.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>What proof shall I make of that?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Proof enough to misuse the prince, to vex Claudio,</LINE> +<LINE>to undo Hero and kill Leonato. Look you for any</LINE> +<LINE>other issue?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Only to despite them, I will endeavour any thing.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Go, then; find me a meet hour to draw Don Pedro and</LINE> +<LINE>the Count Claudio alone: tell them that you know</LINE> +<LINE>that Hero loves me; intend a kind of zeal both to the</LINE> +<LINE>prince and Claudio, as,--in love of your brother's</LINE> +<LINE>honour, who hath made this match, and his friend's</LINE> +<LINE>reputation, who is thus like to be cozened with the</LINE> +<LINE>semblance of a maid,--that you have discovered</LINE> +<LINE>thus. They will scarcely believe this without trial:</LINE> +<LINE>offer them instances; which shall bear no less</LINE> +<LINE>likelihood than to see me at her chamber-window,</LINE> +<LINE>hear me call Margaret Hero, hear Margaret term me</LINE> +<LINE>Claudio; and bring them to see this the very night</LINE> +<LINE>before the intended wedding,--for in the meantime I</LINE> +<LINE>will so fashion the matter that Hero shall be</LINE> +<LINE>absent,--and there shall appear such seeming truth</LINE> +<LINE>of Hero's disloyalty that jealousy shall be called</LINE> +<LINE>assurance and all the preparation overthrown.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Grow this to what adverse issue it can, I will put</LINE> +<LINE>it in practise. Be cunning in the working this, and</LINE> +<LINE>thy fee is a thousand ducats.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Be you constant in the accusation, and my cunning</LINE> +<LINE>shall not shame me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>I will presently go learn their day of marriage.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> + +<SCENE><TITLE>SCENE III. LEONATO'S orchard.</TITLE> +<STAGEDIR>Enter BENEDICK</STAGEDIR> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Boy!</LINE> +</SPEECH> + + +<STAGEDIR>Enter Boy</STAGEDIR> + +<SPEECH> +<SPEAKER>Boy</SPEAKER> +<LINE>Signior?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>In my chamber-window lies a book: bring it hither</LINE> +<LINE>to me in the orchard.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Boy</SPEAKER> +<LINE>I am here already, sir.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I know that; but I would have thee hence, and here again.</LINE> +<STAGEDIR>Exit Boy</STAGEDIR> +<LINE>I do much wonder that one man, seeing how much</LINE> +<LINE>another man is a fool when he dedicates his</LINE> +<LINE>behaviors to love, will, after he hath laughed at</LINE> +<LINE>such shallow follies in others, become the argument</LINE> +<LINE>of his own scorn by failing in love: and such a man</LINE> +<LINE>is Claudio. I have known when there was no music</LINE> +<LINE>with him but the drum and the fife; and now had he</LINE> +<LINE>rather hear the tabour and the pipe: I have known</LINE> +<LINE>when he would have walked ten mile a-foot to see a</LINE> +<LINE>good armour; and now will he lie ten nights awake,</LINE> +<LINE>carving the fashion of a new doublet. He was wont to</LINE> +<LINE>speak plain and to the purpose, like an honest man</LINE> +<LINE>and a soldier; and now is he turned orthography; his</LINE> +<LINE>words are a very fantastical banquet, just so many</LINE> +<LINE>strange dishes. May I be so converted and see with</LINE> +<LINE>these eyes? I cannot tell; I think not: I will not</LINE> +<LINE>be sworn, but love may transform me to an oyster; but</LINE> +<LINE>I'll take my oath on it, till he have made an oyster</LINE> +<LINE>of me, he shall never make me such a fool. One woman</LINE> +<LINE>is fair, yet I am well; another is wise, yet I am</LINE> +<LINE>well; another virtuous, yet I am well; but till all</LINE> +<LINE>graces be in one woman, one woman shall not come in</LINE> +<LINE>my grace. Rich she shall be, that's certain; wise,</LINE> +<LINE>or I'll none; virtuous, or I'll never cheapen her;</LINE> +<LINE>fair, or I'll never look on her; mild, or come not</LINE> +<LINE>near me; noble, or not I for an angel; of good</LINE> +<LINE>discourse, an excellent musician, and her hair shall</LINE> +<LINE>be of what colour it please God. Ha! the prince and</LINE> +<LINE>Monsieur Love! I will hide me in the arbour.</LINE> +</SPEECH> + +<STAGEDIR>Withdraws</STAGEDIR> +<STAGEDIR>Enter DON PEDRO, CLAUDIO, and LEONATO</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Come, shall we hear this music?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Yea, my good lord. How still the evening is,</LINE> +<LINE>As hush'd on purpose to grace harmony!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>See you where Benedick hath hid himself?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>O, very well, my lord: the music ended,</LINE> +<LINE>We'll fit the kid-fox with a pennyworth.</LINE> +</SPEECH> + + +<STAGEDIR>Enter BALTHASAR with Music</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Come, Balthasar, we'll hear that song again.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BALTHASAR</SPEAKER> +<LINE>O, good my lord, tax not so bad a voice</LINE> +<LINE>To slander music any more than once.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>It is the witness still of excellency</LINE> +<LINE>To put a strange face on his own perfection.</LINE> +<LINE>I pray thee, sing, and let me woo no more.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BALTHASAR</SPEAKER> +<LINE>Because you talk of wooing, I will sing;</LINE> +<LINE>Since many a wooer doth commence his suit</LINE> +<LINE>To her he thinks not worthy, yet he wooes,</LINE> +<LINE>Yet will he swear he loves.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Now, pray thee, come;</LINE> +<LINE>Or, if thou wilt hold longer argument,</LINE> +<LINE>Do it in notes.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BALTHASAR</SPEAKER> +<LINE>Note this before my notes;</LINE> +<LINE>There's not a note of mine that's worth the noting.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Why, these are very crotchets that he speaks;</LINE> +<LINE>Note, notes, forsooth, and nothing.</LINE> +</SPEECH> + + +<STAGEDIR>Air</STAGEDIR> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Now, divine air! now is his soul ravished! Is it</LINE> +<LINE>not strange that sheeps' guts should hale souls out</LINE> +<LINE>of men's bodies? Well, a horn for my money, when</LINE> +<LINE>all's done.</LINE> +</SPEECH> + + +<STAGEDIR>The Song</STAGEDIR> + +<SPEECH> +<SPEAKER>BALTHASAR</SPEAKER> +<LINE>Sigh no more, ladies, sigh no more,</LINE> +<LINE>Men were deceivers ever,</LINE> +<LINE>One foot in sea and one on shore,</LINE> +<LINE>To one thing constant never:</LINE> +<LINE>Then sigh not so, but let them go,</LINE> +<LINE>And be you blithe and bonny,</LINE> +<LINE>Converting all your sounds of woe</LINE> +<LINE>Into Hey nonny, nonny.</LINE> +<LINE>Sing no more ditties, sing no moe,</LINE> +<LINE>Of dumps so dull and heavy;</LINE> +<LINE>The fraud of men was ever so,</LINE> +<LINE>Since summer first was leafy:</LINE> +<LINE>Then sigh not so, &c.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>By my troth, a good song.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BALTHASAR</SPEAKER> +<LINE>And an ill singer, my lord.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Ha, no, no, faith; thou singest well enough for a shift.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>An he had been a dog that should have howled thus,</LINE> +<LINE>they would have hanged him: and I pray God his bad</LINE> +<LINE>voice bode no mischief. I had as lief have heard the</LINE> +<LINE>night-raven, come what plague could have come after</LINE> +<LINE>it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Yea, marry, dost thou hear, Balthasar? I pray thee,</LINE> +<LINE>get us some excellent music; for to-morrow night we</LINE> +<LINE>would have it at the Lady Hero's chamber-window.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BALTHASAR</SPEAKER> +<LINE>The best I can, my lord.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Do so: farewell.</LINE> +<STAGEDIR>Exit BALTHASAR</STAGEDIR> +<LINE>Come hither, Leonato. What was it you told me of</LINE> +<LINE>to-day, that your niece Beatrice was in love with</LINE> +<LINE>Signior Benedick?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>O, ay: stalk on. stalk on; the fowl sits. I did</LINE> +<LINE>never think that lady would have loved any man.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>No, nor I neither; but most wonderful that she</LINE> +<LINE>should so dote on Signior Benedick, whom she hath in</LINE> +<LINE>all outward behaviors seemed ever to abhor.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Is't possible? Sits the wind in that corner?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>By my troth, my lord, I cannot tell what to think</LINE> +<LINE>of it but that she loves him with an enraged</LINE> +<LINE>affection: it is past the infinite of thought.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>May be she doth but counterfeit.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Faith, like enough.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>O God, counterfeit! There was never counterfeit of</LINE> +<LINE>passion came so near the life of passion as she</LINE> +<LINE>discovers it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Why, what effects of passion shows she?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Bait the hook well; this fish will bite.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>What effects, my lord? She will sit you, you heard</LINE> +<LINE>my daughter tell you how.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>She did, indeed.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>How, how, pray you? You amaze me: I would have I</LINE> +<LINE>thought her spirit had been invincible against all</LINE> +<LINE>assaults of affection.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>I would have sworn it had, my lord; especially</LINE> +<LINE>against Benedick.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I should think this a gull, but that the</LINE> +<LINE>white-bearded fellow speaks it: knavery cannot,</LINE> +<LINE>sure, hide himself in such reverence.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>He hath ta'en the infection: hold it up.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Hath she made her affection known to Benedick?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>No; and swears she never will: that's her torment.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>'Tis true, indeed; so your daughter says: 'Shall</LINE> +<LINE>I,' says she, 'that have so oft encountered him</LINE> +<LINE>with scorn, write to him that I love him?'</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>This says she now when she is beginning to write to</LINE> +<LINE>him; for she'll be up twenty times a night, and</LINE> +<LINE>there will she sit in her smock till she have writ a</LINE> +<LINE>sheet of paper: my daughter tells us all.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Now you talk of a sheet of paper, I remember a</LINE> +<LINE>pretty jest your daughter told us of.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>O, when she had writ it and was reading it over, she</LINE> +<LINE>found Benedick and Beatrice between the sheet?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>That.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>O, she tore the letter into a thousand halfpence;</LINE> +<LINE>railed at herself, that she should be so immodest</LINE> +<LINE>to write to one that she knew would flout her; 'I</LINE> +<LINE>measure him,' says she, 'by my own spirit; for I</LINE> +<LINE>should flout him, if he writ to me; yea, though I</LINE> +<LINE>love him, I should.'</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Then down upon her knees she falls, weeps, sobs,</LINE> +<LINE>beats her heart, tears her hair, prays, curses; 'O</LINE> +<LINE>sweet Benedick! God give me patience!'</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>She doth indeed; my daughter says so: and the</LINE> +<LINE>ecstasy hath so much overborne her that my daughter</LINE> +<LINE>is sometime afeared she will do a desperate outrage</LINE> +<LINE>to herself: it is very true.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>It were good that Benedick knew of it by some</LINE> +<LINE>other, if she will not discover it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>To what end? He would make but a sport of it and</LINE> +<LINE>torment the poor lady worse.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>An he should, it were an alms to hang him. She's an</LINE> +<LINE>excellent sweet lady; and, out of all suspicion,</LINE> +<LINE>she is virtuous.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>And she is exceeding wise.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>In every thing but in loving Benedick.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>O, my lord, wisdom and blood combating in so tender</LINE> +<LINE>a body, we have ten proofs to one that blood hath</LINE> +<LINE>the victory. I am sorry for her, as I have just</LINE> +<LINE>cause, being her uncle and her guardian.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>I would she had bestowed this dotage on me: I would</LINE> +<LINE>have daffed all other respects and made her half</LINE> +<LINE>myself. I pray you, tell Benedick of it, and hear</LINE> +<LINE>what a' will say.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Were it good, think you?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Hero thinks surely she will die; for she says she</LINE> +<LINE>will die, if he love her not, and she will die, ere</LINE> +<LINE>she make her love known, and she will die, if he woo</LINE> +<LINE>her, rather than she will bate one breath of her</LINE> +<LINE>accustomed crossness.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>She doth well: if she should make tender of her</LINE> +<LINE>love, 'tis very possible he'll scorn it; for the</LINE> +<LINE>man, as you know all, hath a contemptible spirit.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>He is a very proper man.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>He hath indeed a good outward happiness.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Before God! and, in my mind, very wise.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>He doth indeed show some sparks that are like wit.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>And I take him to be valiant.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>As Hector, I assure you: and in the managing of</LINE> +<LINE>quarrels you may say he is wise; for either he</LINE> +<LINE>avoids them with great discretion, or undertakes</LINE> +<LINE>them with a most Christian-like fear.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>If he do fear God, a' must necessarily keep peace:</LINE> +<LINE>if he break the peace, he ought to enter into a</LINE> +<LINE>quarrel with fear and trembling.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>And so will he do; for the man doth fear God,</LINE> +<LINE>howsoever it seems not in him by some large jests</LINE> +<LINE>he will make. Well I am sorry for your niece. Shall</LINE> +<LINE>we go seek Benedick, and tell him of her love?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Never tell him, my lord: let her wear it out with</LINE> +<LINE>good counsel.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Nay, that's impossible: she may wear her heart out first.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Well, we will hear further of it by your daughter:</LINE> +<LINE>let it cool the while. I love Benedick well; and I</LINE> +<LINE>could wish he would modestly examine himself, to see</LINE> +<LINE>how much he is unworthy so good a lady.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>My lord, will you walk? dinner is ready.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>If he do not dote on her upon this, I will never</LINE> +<LINE>trust my expectation.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Let there be the same net spread for her; and that</LINE> +<LINE>must your daughter and her gentlewomen carry. The</LINE> +<LINE>sport will be, when they hold one an opinion of</LINE> +<LINE>another's dotage, and no such matter: that's the</LINE> +<LINE>scene that I would see, which will be merely a</LINE> +<LINE>dumb-show. Let us send her to call him in to dinner.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt DON PEDRO, CLAUDIO, and LEONATO</STAGEDIR> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE><STAGEDIR>Coming forward</STAGEDIR> This can be no trick: the</LINE> +<LINE>conference was sadly borne. They have the truth of</LINE> +<LINE>this from Hero. They seem to pity the lady: it</LINE> +<LINE>seems her affections have their full bent. Love me!</LINE> +<LINE>why, it must be requited. I hear how I am censured:</LINE> +<LINE>they say I will bear myself proudly, if I perceive</LINE> +<LINE>the love come from her; they say too that she will</LINE> +<LINE>rather die than give any sign of affection. I did</LINE> +<LINE>never think to marry: I must not seem proud: happy</LINE> +<LINE>are they that hear their detractions and can put</LINE> +<LINE>them to mending. They say the lady is fair; 'tis a</LINE> +<LINE>truth, I can bear them witness; and virtuous; 'tis</LINE> +<LINE>so, I cannot reprove it; and wise, but for loving</LINE> +<LINE>me; by my troth, it is no addition to her wit, nor</LINE> +<LINE>no great argument of her folly, for I will be</LINE> +<LINE>horribly in love with her. I may chance have some</LINE> +<LINE>odd quirks and remnants of wit broken on me,</LINE> +<LINE>because I have railed so long against marriage: but</LINE> +<LINE>doth not the appetite alter? a man loves the meat</LINE> +<LINE>in his youth that he cannot endure in his age.</LINE> +<LINE>Shall quips and sentences and these paper bullets of</LINE> +<LINE>the brain awe a man from the career of his humour?</LINE> +<LINE>No, the world must be peopled. When I said I would</LINE> +<LINE>die a bachelor, I did not think I should live till I</LINE> +<LINE>were married. Here comes Beatrice. By this day!</LINE> +<LINE>she's a fair lady: I do spy some marks of love in</LINE> +<LINE>her.</LINE> +</SPEECH> + + +<STAGEDIR>Enter BEATRICE</STAGEDIR> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Against my will I am sent to bid you come in to dinner.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Fair Beatrice, I thank you for your pains.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>I took no more pains for those thanks than you take</LINE> +<LINE>pains to thank me: if it had been painful, I would</LINE> +<LINE>not have come.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>You take pleasure then in the message?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Yea, just so much as you may take upon a knife's</LINE> +<LINE>point and choke a daw withal. You have no stomach,</LINE> +<LINE>signior: fare you well.</LINE> +</SPEECH> + + +<STAGEDIR>Exit</STAGEDIR> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Ha! 'Against my will I am sent to bid you come in</LINE> +<LINE>to dinner;' there's a double meaning in that 'I took</LINE> +<LINE>no more pains for those thanks than you took pains</LINE> +<LINE>to thank me.' that's as much as to say, Any pains</LINE> +<LINE>that I take for you is as easy as thanks. If I do</LINE> +<LINE>not take pity of her, I am a villain; if I do not</LINE> +<LINE>love her, I am a Jew. I will go get her picture.</LINE> +</SPEECH> + + +<STAGEDIR>Exit</STAGEDIR> +</SCENE> + +</ACT> + +<ACT><TITLE>ACT III</TITLE> + +<SCENE><TITLE>SCENE I. LEONATO'S garden.</TITLE> +<STAGEDIR>Enter HERO, MARGARET, and URSULA</STAGEDIR> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Good Margaret, run thee to the parlor;</LINE> +<LINE>There shalt thou find my cousin Beatrice</LINE> +<LINE>Proposing with the prince and Claudio:</LINE> +<LINE>Whisper her ear and tell her, I and Ursula</LINE> +<LINE>Walk in the orchard and our whole discourse</LINE> +<LINE>Is all of her; say that thou overheard'st us;</LINE> +<LINE>And bid her steal into the pleached bower,</LINE> +<LINE>Where honeysuckles, ripen'd by the sun,</LINE> +<LINE>Forbid the sun to enter, like favourites,</LINE> +<LINE>Made proud by princes, that advance their pride</LINE> +<LINE>Against that power that bred it: there will she hide her,</LINE> +<LINE>To listen our purpose. This is thy office;</LINE> +<LINE>Bear thee well in it and leave us alone.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>I'll make her come, I warrant you, presently.</LINE> +</SPEECH> + + +<STAGEDIR>Exit</STAGEDIR> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Now, Ursula, when Beatrice doth come,</LINE> +<LINE>As we do trace this alley up and down,</LINE> +<LINE>Our talk must only be of Benedick.</LINE> +<LINE>When I do name him, let it be thy part</LINE> +<LINE>To praise him more than ever man did merit:</LINE> +<LINE>My talk to thee must be how Benedick</LINE> +<LINE>Is sick in love with Beatrice. Of this matter</LINE> +<LINE>Is little Cupid's crafty arrow made,</LINE> +<LINE>That only wounds by hearsay.</LINE> +<STAGEDIR>Enter BEATRICE, behind</STAGEDIR> +<LINE>Now begin;</LINE> +<LINE>For look where Beatrice, like a lapwing, runs</LINE> +<LINE>Close by the ground, to hear our conference.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>The pleasant'st angling is to see the fish</LINE> +<LINE>Cut with her golden oars the silver stream,</LINE> +<LINE>And greedily devour the treacherous bait:</LINE> +<LINE>So angle we for Beatrice; who even now</LINE> +<LINE>Is couched in the woodbine coverture.</LINE> +<LINE>Fear you not my part of the dialogue.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Then go we near her, that her ear lose nothing</LINE> +<LINE>Of the false sweet bait that we lay for it.</LINE> +<STAGEDIR>Approaching the bower</STAGEDIR> +<LINE>No, truly, Ursula, she is too disdainful;</LINE> +<LINE>I know her spirits are as coy and wild</LINE> +<LINE>As haggerds of the rock.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>But are you sure</LINE> +<LINE>That Benedick loves Beatrice so entirely?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>So says the prince and my new-trothed lord.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>And did they bid you tell her of it, madam?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>They did entreat me to acquaint her of it;</LINE> +<LINE>But I persuaded them, if they loved Benedick,</LINE> +<LINE>To wish him wrestle with affection,</LINE> +<LINE>And never to let Beatrice know of it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>Why did you so? Doth not the gentleman</LINE> +<LINE>Deserve as full as fortunate a bed</LINE> +<LINE>As ever Beatrice shall couch upon?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>O god of love! I know he doth deserve</LINE> +<LINE>As much as may be yielded to a man:</LINE> +<LINE>But Nature never framed a woman's heart</LINE> +<LINE>Of prouder stuff than that of Beatrice;</LINE> +<LINE>Disdain and scorn ride sparkling in her eyes,</LINE> +<LINE>Misprising what they look on, and her wit</LINE> +<LINE>Values itself so highly that to her</LINE> +<LINE>All matter else seems weak: she cannot love,</LINE> +<LINE>Nor take no shape nor project of affection,</LINE> +<LINE>She is so self-endeared.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>Sure, I think so;</LINE> +<LINE>And therefore certainly it were not good</LINE> +<LINE>She knew his love, lest she make sport at it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Why, you speak truth. I never yet saw man,</LINE> +<LINE>How wise, how noble, young, how rarely featured,</LINE> +<LINE>But she would spell him backward: if fair-faced,</LINE> +<LINE>She would swear the gentleman should be her sister;</LINE> +<LINE>If black, why, Nature, drawing of an antique,</LINE> +<LINE>Made a foul blot; if tall, a lance ill-headed;</LINE> +<LINE>If low, an agate very vilely cut;</LINE> +<LINE>If speaking, why, a vane blown with all winds;</LINE> +<LINE>If silent, why, a block moved with none.</LINE> +<LINE>So turns she every man the wrong side out</LINE> +<LINE>And never gives to truth and virtue that</LINE> +<LINE>Which simpleness and merit purchaseth.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>Sure, sure, such carping is not commendable.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>No, not to be so odd and from all fashions</LINE> +<LINE>As Beatrice is, cannot be commendable:</LINE> +<LINE>But who dare tell her so? If I should speak,</LINE> +<LINE>She would mock me into air; O, she would laugh me</LINE> +<LINE>Out of myself, press me to death with wit.</LINE> +<LINE>Therefore let Benedick, like cover'd fire,</LINE> +<LINE>Consume away in sighs, waste inwardly:</LINE> +<LINE>It were a better death than die with mocks,</LINE> +<LINE>Which is as bad as die with tickling.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>Yet tell her of it: hear what she will say.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>No; rather I will go to Benedick</LINE> +<LINE>And counsel him to fight against his passion.</LINE> +<LINE>And, truly, I'll devise some honest slanders</LINE> +<LINE>To stain my cousin with: one doth not know</LINE> +<LINE>How much an ill word may empoison liking.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>O, do not do your cousin such a wrong.</LINE> +<LINE>She cannot be so much without true judgment--</LINE> +<LINE>Having so swift and excellent a wit</LINE> +<LINE>As she is prized to have--as to refuse</LINE> +<LINE>So rare a gentleman as Signior Benedick.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>He is the only man of Italy.</LINE> +<LINE>Always excepted my dear Claudio.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>I pray you, be not angry with me, madam,</LINE> +<LINE>Speaking my fancy: Signior Benedick,</LINE> +<LINE>For shape, for bearing, argument and valour,</LINE> +<LINE>Goes foremost in report through Italy.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Indeed, he hath an excellent good name.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>His excellence did earn it, ere he had it.</LINE> +<LINE>When are you married, madam?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Why, every day, to-morrow. Come, go in:</LINE> +<LINE>I'll show thee some attires, and have thy counsel</LINE> +<LINE>Which is the best to furnish me to-morrow.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>She's limed, I warrant you: we have caught her, madam.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>If it proves so, then loving goes by haps:</LINE> +<LINE>Some Cupid kills with arrows, some with traps.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt HERO and URSULA</STAGEDIR> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE><STAGEDIR>Coming forward</STAGEDIR></LINE> +<LINE>What fire is in mine ears? Can this be true?</LINE> +<LINE>Stand I condemn'd for pride and scorn so much?</LINE> +<LINE>Contempt, farewell! and maiden pride, adieu!</LINE> +<LINE>No glory lives behind the back of such.</LINE> +<LINE>And, Benedick, love on; I will requite thee,</LINE> +<LINE>Taming my wild heart to thy loving hand:</LINE> +<LINE>If thou dost love, my kindness shall incite thee</LINE> +<LINE>To bind our loves up in a holy band;</LINE> +<LINE>For others say thou dost deserve, and I</LINE> +<LINE>Believe it better than reportingly.</LINE> +</SPEECH> + + +<STAGEDIR>Exit</STAGEDIR> +</SCENE> + +<SCENE><TITLE>SCENE II. A room in LEONATO'S house</TITLE> +<STAGEDIR>Enter DON PEDRO, CLAUDIO, BENEDICK, and LEONATO</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>I do but stay till your marriage be consummate, and</LINE> +<LINE>then go I toward Arragon.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>I'll bring you thither, my lord, if you'll</LINE> +<LINE>vouchsafe me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Nay, that would be as great a soil in the new gloss</LINE> +<LINE>of your marriage as to show a child his new coat</LINE> +<LINE>and forbid him to wear it. I will only be bold</LINE> +<LINE>with Benedick for his company; for, from the crown</LINE> +<LINE>of his head to the sole of his foot, he is all</LINE> +<LINE>mirth: he hath twice or thrice cut Cupid's</LINE> +<LINE>bow-string and the little hangman dare not shoot at</LINE> +<LINE>him; he hath a heart as sound as a bell and his</LINE> +<LINE>tongue is the clapper, for what his heart thinks his</LINE> +<LINE>tongue speaks.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Gallants, I am not as I have been.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>So say I methinks you are sadder.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>I hope he be in love.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Hang him, truant! there's no true drop of blood in</LINE> +<LINE>him, to be truly touched with love: if he be sad,</LINE> +<LINE>he wants money.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I have the toothache.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Draw it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Hang it!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>You must hang it first, and draw it afterwards.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>What! sigh for the toothache?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Where is but a humour or a worm.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Well, every one can master a grief but he that has</LINE> +<LINE>it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Yet say I, he is in love.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>There is no appearance of fancy in him, unless it be</LINE> +<LINE>a fancy that he hath to strange disguises; as, to be</LINE> +<LINE>a Dutchman today, a Frenchman to-morrow, or in the</LINE> +<LINE>shape of two countries at once, as, a German from</LINE> +<LINE>the waist downward, all slops, and a Spaniard from</LINE> +<LINE>the hip upward, no doublet. Unless he have a fancy</LINE> +<LINE>to this foolery, as it appears he hath, he is no</LINE> +<LINE>fool for fancy, as you would have it appear he is.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>If he be not in love with some woman, there is no</LINE> +<LINE>believing old signs: a' brushes his hat o'</LINE> +<LINE>mornings; what should that bode?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Hath any man seen him at the barber's?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>No, but the barber's man hath been seen with him,</LINE> +<LINE>and the old ornament of his cheek hath already</LINE> +<LINE>stuffed tennis-balls.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Indeed, he looks younger than he did, by the loss of a beard.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Nay, a' rubs himself with civet: can you smell him</LINE> +<LINE>out by that?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>That's as much as to say, the sweet youth's in love.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>The greatest note of it is his melancholy.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>And when was he wont to wash his face?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Yea, or to paint himself? for the which, I hear</LINE> +<LINE>what they say of him.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Nay, but his jesting spirit; which is now crept into</LINE> +<LINE>a lute-string and now governed by stops.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Indeed, that tells a heavy tale for him: conclude,</LINE> +<LINE>conclude he is in love.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Nay, but I know who loves him.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>That would I know too: I warrant, one that knows him not.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Yes, and his ill conditions; and, in despite of</LINE> +<LINE>all, dies for him.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>She shall be buried with her face upwards.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Yet is this no charm for the toothache. Old</LINE> +<LINE>signior, walk aside with me: I have studied eight</LINE> +<LINE>or nine wise words to speak to you, which these</LINE> +<LINE>hobby-horses must not hear.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt BENEDICK and LEONATO</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>For my life, to break with him about Beatrice.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>'Tis even so. Hero and Margaret have by this</LINE> +<LINE>played their parts with Beatrice; and then the two</LINE> +<LINE>bears will not bite one another when they meet.</LINE> +</SPEECH> + + +<STAGEDIR>Enter DON JOHN</STAGEDIR> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>My lord and brother, God save you!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Good den, brother.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>If your leisure served, I would speak with you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>In private?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>If it please you: yet Count Claudio may hear; for</LINE> +<LINE>what I would speak of concerns him.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>What's the matter?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE><STAGEDIR>To CLAUDIO</STAGEDIR> Means your lordship to be married</LINE> +<LINE>to-morrow?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>You know he does.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>I know not that, when he knows what I know.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>If there be any impediment, I pray you discover it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>You may think I love you not: let that appear</LINE> +<LINE>hereafter, and aim better at me by that I now will</LINE> +<LINE>manifest. For my brother, I think he holds you</LINE> +<LINE>well, and in dearness of heart hath holp to effect</LINE> +<LINE>your ensuing marriage;--surely suit ill spent and</LINE> +<LINE>labour ill bestowed.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Why, what's the matter?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>I came hither to tell you; and, circumstances</LINE> +<LINE>shortened, for she has been too long a talking of,</LINE> +<LINE>the lady is disloyal.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Who, Hero?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Even she; Leonato's Hero, your Hero, every man's Hero:</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Disloyal?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>The word is too good to paint out her wickedness; I</LINE> +<LINE>could say she were worse: think you of a worse</LINE> +<LINE>title, and I will fit her to it. Wonder not till</LINE> +<LINE>further warrant: go but with me to-night, you shall</LINE> +<LINE>see her chamber-window entered, even the night</LINE> +<LINE>before her wedding-day: if you love her then,</LINE> +<LINE>to-morrow wed her; but it would better fit your honour</LINE> +<LINE>to change your mind.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>May this be so?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>I will not think it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>If you dare not trust that you see, confess not</LINE> +<LINE>that you know: if you will follow me, I will show</LINE> +<LINE>you enough; and when you have seen more and heard</LINE> +<LINE>more, proceed accordingly.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>If I see any thing to-night why I should not marry</LINE> +<LINE>her to-morrow in the congregation, where I should</LINE> +<LINE>wed, there will I shame her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>And, as I wooed for thee to obtain her, I will join</LINE> +<LINE>with thee to disgrace her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>I will disparage her no farther till you are my</LINE> +<LINE>witnesses: bear it coldly but till midnight, and</LINE> +<LINE>let the issue show itself.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>O day untowardly turned!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>O mischief strangely thwarting!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>O plague right well prevented! so will you say when</LINE> +<LINE>you have seen the sequel.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> + +<SCENE><TITLE>SCENE III. A street.</TITLE> +<STAGEDIR>Enter DOGBERRY and VERGES with the Watch</STAGEDIR> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Are you good men and true?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>Yea, or else it were pity but they should suffer</LINE> +<LINE>salvation, body and soul.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Nay, that were a punishment too good for them, if</LINE> +<LINE>they should have any allegiance in them, being</LINE> +<LINE>chosen for the prince's watch.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>Well, give them their charge, neighbour Dogberry.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>First, who think you the most desertless man to be</LINE> +<LINE>constable?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>First Watchman</SPEAKER> +<LINE>Hugh Otecake, sir, or George Seacole; for they can</LINE> +<LINE>write and read.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Come hither, neighbour Seacole. God hath blessed</LINE> +<LINE>you with a good name: to be a well-favoured man is</LINE> +<LINE>the gift of fortune; but to write and read comes by nature.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Second Watchman</SPEAKER> +<LINE>Both which, master constable,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>You have: I knew it would be your answer. Well,</LINE> +<LINE>for your favour, sir, why, give God thanks, and make</LINE> +<LINE>no boast of it; and for your writing and reading,</LINE> +<LINE>let that appear when there is no need of such</LINE> +<LINE>vanity. You are thought here to be the most</LINE> +<LINE>senseless and fit man for the constable of the</LINE> +<LINE>watch; therefore bear you the lantern. This is your</LINE> +<LINE>charge: you shall comprehend all vagrom men; you are</LINE> +<LINE>to bid any man stand, in the prince's name.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Second Watchman</SPEAKER> +<LINE>How if a' will not stand?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Why, then, take no note of him, but let him go; and</LINE> +<LINE>presently call the rest of the watch together and</LINE> +<LINE>thank God you are rid of a knave.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>If he will not stand when he is bidden, he is none</LINE> +<LINE>of the prince's subjects.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>True, and they are to meddle with none but the</LINE> +<LINE>prince's subjects. You shall also make no noise in</LINE> +<LINE>the streets; for, for the watch to babble and to</LINE> +<LINE>talk is most tolerable and not to be endured.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Watchman</SPEAKER> +<LINE>We will rather sleep than talk: we know what</LINE> +<LINE>belongs to a watch.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Why, you speak like an ancient and most quiet</LINE> +<LINE>watchman; for I cannot see how sleeping should</LINE> +<LINE>offend: only, have a care that your bills be not</LINE> +<LINE>stolen. Well, you are to call at all the</LINE> +<LINE>ale-houses, and bid those that are drunk get them to bed.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Watchman</SPEAKER> +<LINE>How if they will not?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Why, then, let them alone till they are sober: if</LINE> +<LINE>they make you not then the better answer, you may</LINE> +<LINE>say they are not the men you took them for.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Watchman</SPEAKER> +<LINE>Well, sir.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>If you meet a thief, you may suspect him, by virtue</LINE> +<LINE>of your office, to be no true man; and, for such</LINE> +<LINE>kind of men, the less you meddle or make with them,</LINE> +<LINE>why the more is for your honesty.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Watchman</SPEAKER> +<LINE>If we know him to be a thief, shall we not lay</LINE> +<LINE>hands on him?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Truly, by your office, you may; but I think they</LINE> +<LINE>that touch pitch will be defiled: the most peaceable</LINE> +<LINE>way for you, if you do take a thief, is to let him</LINE> +<LINE>show himself what he is and steal out of your company.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>You have been always called a merciful man, partner.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Truly, I would not hang a dog by my will, much more</LINE> +<LINE>a man who hath any honesty in him.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>If you hear a child cry in the night, you must call</LINE> +<LINE>to the nurse and bid her still it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Watchman</SPEAKER> +<LINE>How if the nurse be asleep and will not hear us?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Why, then, depart in peace, and let the child wake</LINE> +<LINE>her with crying; for the ewe that will not hear her</LINE> +<LINE>lamb when it baes will never answer a calf when he bleats.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>'Tis very true.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>This is the end of the charge:--you, constable, are</LINE> +<LINE>to present the prince's own person: if you meet the</LINE> +<LINE>prince in the night, you may stay him.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>Nay, by'r our lady, that I think a' cannot.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Five shillings to one on't, with any man that knows</LINE> +<LINE>the statutes, he may stay him: marry, not without</LINE> +<LINE>the prince be willing; for, indeed, the watch ought</LINE> +<LINE>to offend no man; and it is an offence to stay a</LINE> +<LINE>man against his will.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>By'r lady, I think it be so.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Ha, ha, ha! Well, masters, good night: an there be</LINE> +<LINE>any matter of weight chances, call up me: keep your</LINE> +<LINE>fellows' counsels and your own; and good night.</LINE> +<LINE>Come, neighbour.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Watchman</SPEAKER> +<LINE>Well, masters, we hear our charge: let us go sit here</LINE> +<LINE>upon the church-bench till two, and then all to bed.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>One word more, honest neighbours. I pray you watch</LINE> +<LINE>about Signior Leonato's door; for the wedding being</LINE> +<LINE>there to-morrow, there is a great coil to-night.</LINE> +<LINE>Adieu: be vigitant, I beseech you.</LINE> +</SPEECH> + +<STAGEDIR>Exeunt DOGBERRY and VERGES</STAGEDIR> +<STAGEDIR>Enter BORACHIO and CONRADE</STAGEDIR> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>What Conrade!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Watchman</SPEAKER> +<LINE><STAGEDIR>Aside</STAGEDIR> Peace! stir not.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Conrade, I say!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>Here, man; I am at thy elbow.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Mass, and my elbow itched; I thought there would a</LINE> +<LINE>scab follow.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>I will owe thee an answer for that: and now forward</LINE> +<LINE>with thy tale.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Stand thee close, then, under this pent-house, for</LINE> +<LINE>it drizzles rain; and I will, like a true drunkard,</LINE> +<LINE>utter all to thee.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Watchman</SPEAKER> +<LINE><STAGEDIR>Aside</STAGEDIR> Some treason, masters: yet stand close.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Therefore know I have earned of Don John a thousand ducats.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>Is it possible that any villany should be so dear?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Thou shouldst rather ask if it were possible any</LINE> +<LINE>villany should be so rich; for when rich villains</LINE> +<LINE>have need of poor ones, poor ones may make what</LINE> +<LINE>price they will.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>I wonder at it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>That shows thou art unconfirmed. Thou knowest that</LINE> +<LINE>the fashion of a doublet, or a hat, or a cloak, is</LINE> +<LINE>nothing to a man.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>Yes, it is apparel.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>I mean, the fashion.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>Yes, the fashion is the fashion.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Tush! I may as well say the fool's the fool. But</LINE> +<LINE>seest thou not what a deformed thief this fashion</LINE> +<LINE>is?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Watchman</SPEAKER> +<LINE><STAGEDIR>Aside</STAGEDIR> I know that Deformed; a' has been a vile</LINE> +<LINE>thief this seven year; a' goes up and down like a</LINE> +<LINE>gentleman: I remember his name.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Didst thou not hear somebody?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>No; 'twas the vane on the house.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Seest thou not, I say, what a deformed thief this</LINE> +<LINE>fashion is? how giddily a' turns about all the hot</LINE> +<LINE>bloods between fourteen and five-and-thirty?</LINE> +<LINE>sometimes fashioning them like Pharaoh's soldiers</LINE> +<LINE>in the reeky painting, sometime like god Bel's</LINE> +<LINE>priests in the old church-window, sometime like the</LINE> +<LINE>shaven Hercules in the smirched worm-eaten tapestry,</LINE> +<LINE>where his codpiece seems as massy as his club?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>All this I see; and I see that the fashion wears</LINE> +<LINE>out more apparel than the man. But art not thou</LINE> +<LINE>thyself giddy with the fashion too, that thou hast</LINE> +<LINE>shifted out of thy tale into telling me of the fashion?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Not so, neither: but know that I have to-night</LINE> +<LINE>wooed Margaret, the Lady Hero's gentlewoman, by the</LINE> +<LINE>name of Hero: she leans me out at her mistress'</LINE> +<LINE>chamber-window, bids me a thousand times good</LINE> +<LINE>night,--I tell this tale vilely:--I should first</LINE> +<LINE>tell thee how the prince, Claudio and my master,</LINE> +<LINE>planted and placed and possessed by my master Don</LINE> +<LINE>John, saw afar off in the orchard this amiable encounter.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>And thought they Margaret was Hero?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Two of them did, the prince and Claudio; but the</LINE> +<LINE>devil my master knew she was Margaret; and partly</LINE> +<LINE>by his oaths, which first possessed them, partly by</LINE> +<LINE>the dark night, which did deceive them, but chiefly</LINE> +<LINE>by my villany, which did confirm any slander that</LINE> +<LINE>Don John had made, away went Claudio enraged; swore</LINE> +<LINE>he would meet her, as he was appointed, next morning</LINE> +<LINE>at the temple, and there, before the whole</LINE> +<LINE>congregation, shame her with what he saw o'er night</LINE> +<LINE>and send her home again without a husband.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>First Watchman</SPEAKER> +<LINE>We charge you, in the prince's name, stand!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Second Watchman</SPEAKER> +<LINE>Call up the right master constable. We have here</LINE> +<LINE>recovered the most dangerous piece of lechery that</LINE> +<LINE>ever was known in the commonwealth.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>First Watchman</SPEAKER> +<LINE>And one Deformed is one of them: I know him; a'</LINE> +<LINE>wears a lock.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>Masters, masters,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Second Watchman</SPEAKER> +<LINE>You'll be made bring Deformed forth, I warrant you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>Masters,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>First Watchman</SPEAKER> +<LINE>Never speak: we charge you let us obey you to go with us.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>We are like to prove a goodly commodity, being taken</LINE> +<LINE>up of these men's bills.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>A commodity in question, I warrant you. Come, we'll obey you.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> + +<SCENE><TITLE>SCENE IV. HERO's apartment.</TITLE> +<STAGEDIR>Enter HERO, MARGARET, and URSULA</STAGEDIR> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Good Ursula, wake my cousin Beatrice, and desire</LINE> +<LINE>her to rise.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>I will, lady.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>And bid her come hither.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>Well.</LINE> +</SPEECH> + + +<STAGEDIR>Exit</STAGEDIR> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>Troth, I think your other rabato were better.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>No, pray thee, good Meg, I'll wear this.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>By my troth, 's not so good; and I warrant your</LINE> +<LINE>cousin will say so.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>My cousin's a fool, and thou art another: I'll wear</LINE> +<LINE>none but this.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>I like the new tire within excellently, if the hair</LINE> +<LINE>were a thought browner; and your gown's a most rare</LINE> +<LINE>fashion, i' faith. I saw the Duchess of Milan's</LINE> +<LINE>gown that they praise so.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>O, that exceeds, they say.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>By my troth, 's but a night-gown in respect of</LINE> +<LINE>yours: cloth o' gold, and cuts, and laced with</LINE> +<LINE>silver, set with pearls, down sleeves, side sleeves,</LINE> +<LINE>and skirts, round underborne with a bluish tinsel:</LINE> +<LINE>but for a fine, quaint, graceful and excellent</LINE> +<LINE>fashion, yours is worth ten on 't.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>God give me joy to wear it! for my heart is</LINE> +<LINE>exceeding heavy.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>'Twill be heavier soon by the weight of a man.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Fie upon thee! art not ashamed?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>Of what, lady? of speaking honourably? Is not</LINE> +<LINE>marriage honourable in a beggar? Is not your lord</LINE> +<LINE>honourable without marriage? I think you would have</LINE> +<LINE>me say, 'saving your reverence, a husband:' and bad</LINE> +<LINE>thinking do not wrest true speaking, I'll offend</LINE> +<LINE>nobody: is there any harm in 'the heavier for a</LINE> +<LINE>husband'? None, I think, and it be the right husband</LINE> +<LINE>and the right wife; otherwise 'tis light, and not</LINE> +<LINE>heavy: ask my Lady Beatrice else; here she comes.</LINE> +</SPEECH> + + +<STAGEDIR>Enter BEATRICE</STAGEDIR> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Good morrow, coz.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Good morrow, sweet Hero.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Why how now? do you speak in the sick tune?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>I am out of all other tune, methinks.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>Clap's into 'Light o' love;' that goes without a</LINE> +<LINE>burden: do you sing it, and I'll dance it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Ye light o' love, with your heels! then, if your</LINE> +<LINE>husband have stables enough, you'll see he shall</LINE> +<LINE>lack no barns.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>O illegitimate construction! I scorn that with my heels.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>'Tis almost five o'clock, cousin; tis time you were</LINE> +<LINE>ready. By my troth, I am exceeding ill: heigh-ho!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>For a hawk, a horse, or a husband?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>For the letter that begins them all, H.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>Well, and you be not turned Turk, there's no more</LINE> +<LINE>sailing by the star.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>What means the fool, trow?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>Nothing I; but God send every one their heart's desire!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>These gloves the count sent me; they are an</LINE> +<LINE>excellent perfume.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>I am stuffed, cousin; I cannot smell.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>A maid, and stuffed! there's goodly catching of cold.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>O, God help me! God help me! how long have you</LINE> +<LINE>professed apprehension?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>Even since you left it. Doth not my wit become me rarely?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>It is not seen enough, you should wear it in your</LINE> +<LINE>cap. By my troth, I am sick.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>Get you some of this distilled Carduus Benedictus,</LINE> +<LINE>and lay it to your heart: it is the only thing for a qualm.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>There thou prickest her with a thistle.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Benedictus! why Benedictus? you have some moral in</LINE> +<LINE>this Benedictus.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>Moral! no, by my troth, I have no moral meaning; I</LINE> +<LINE>meant, plain holy-thistle. You may think perchance</LINE> +<LINE>that I think you are in love: nay, by'r lady, I am</LINE> +<LINE>not such a fool to think what I list, nor I list</LINE> +<LINE>not to think what I can, nor indeed I cannot think,</LINE> +<LINE>if I would think my heart out of thinking, that you</LINE> +<LINE>are in love or that you will be in love or that you</LINE> +<LINE>can be in love. Yet Benedick was such another, and</LINE> +<LINE>now is he become a man: he swore he would never</LINE> +<LINE>marry, and yet now, in despite of his heart, he eats</LINE> +<LINE>his meat without grudging: and how you may be</LINE> +<LINE>converted I know not, but methinks you look with</LINE> +<LINE>your eyes as other women do.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>What pace is this that thy tongue keeps?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>Not a false gallop.</LINE> +</SPEECH> + + +<STAGEDIR>Re-enter URSULA</STAGEDIR> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>Madam, withdraw: the prince, the count, Signior</LINE> +<LINE>Benedick, Don John, and all the gallants of the</LINE> +<LINE>town, are come to fetch you to church.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Help to dress me, good coz, good Meg, good Ursula.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> + +<SCENE><TITLE>SCENE V. Another room in LEONATO'S house.</TITLE> +<STAGEDIR>Enter LEONATO, with DOGBERRY and VERGES</STAGEDIR> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>What would you with me, honest neighbour?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Marry, sir, I would have some confidence with you</LINE> +<LINE>that decerns you nearly.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Brief, I pray you; for you see it is a busy time with me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Marry, this it is, sir.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>Yes, in truth it is, sir.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>What is it, my good friends?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Goodman Verges, sir, speaks a little off the</LINE> +<LINE>matter: an old man, sir, and his wits are not so</LINE> +<LINE>blunt as, God help, I would desire they were; but,</LINE> +<LINE>in faith, honest as the skin between his brows.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>Yes, I thank God I am as honest as any man living</LINE> +<LINE>that is an old man and no honester than I.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Comparisons are odorous: palabras, neighbour Verges.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Neighbours, you are tedious.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>It pleases your worship to say so, but we are the</LINE> +<LINE>poor duke's officers; but truly, for mine own part,</LINE> +<LINE>if I were as tedious as a king, I could find it in</LINE> +<LINE>my heart to bestow it all of your worship.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>All thy tediousness on me, ah?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Yea, an 'twere a thousand pound more than 'tis; for</LINE> +<LINE>I hear as good exclamation on your worship as of any</LINE> +<LINE>man in the city; and though I be but a poor man, I</LINE> +<LINE>am glad to hear it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>And so am I.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>I would fain know what you have to say.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>Marry, sir, our watch to-night, excepting your</LINE> +<LINE>worship's presence, ha' ta'en a couple of as arrant</LINE> +<LINE>knaves as any in Messina.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>A good old man, sir; he will be talking: as they</LINE> +<LINE>say, when the age is in, the wit is out: God help</LINE> +<LINE>us! it is a world to see. Well said, i' faith,</LINE> +<LINE>neighbour Verges: well, God's a good man; an two men</LINE> +<LINE>ride of a horse, one must ride behind. An honest</LINE> +<LINE>soul, i' faith, sir; by my troth he is, as ever</LINE> +<LINE>broke bread; but God is to be worshipped; all men</LINE> +<LINE>are not alike; alas, good neighbour!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Indeed, neighbour, he comes too short of you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Gifts that God gives.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>I must leave you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>One word, sir: our watch, sir, have indeed</LINE> +<LINE>comprehended two aspicious persons, and we would</LINE> +<LINE>have them this morning examined before your worship.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Take their examination yourself and bring it me: I</LINE> +<LINE>am now in great haste, as it may appear unto you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>It shall be suffigance.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Drink some wine ere you go: fare you well.</LINE> +</SPEECH> + + +<STAGEDIR>Enter a Messenger</STAGEDIR> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>My lord, they stay for you to give your daughter to</LINE> +<LINE>her husband.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>I'll wait upon them: I am ready.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt LEONATO and Messenger</STAGEDIR> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Go, good partner, go, get you to Francis Seacole;</LINE> +<LINE>bid him bring his pen and inkhorn to the gaol: we</LINE> +<LINE>are now to examination these men.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>And we must do it wisely.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>We will spare for no wit, I warrant you; here's</LINE> +<LINE>that shall drive some of them to a non-come: only</LINE> +<LINE>get the learned writer to set down our</LINE> +<LINE>excommunication and meet me at the gaol.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> + +</ACT> + +<ACT><TITLE>ACT IV</TITLE> + +<SCENE><TITLE>SCENE I. A church.</TITLE> +<STAGEDIR>Enter DON PEDRO, DON JOHN, LEONATO, FRIAR FRANCIS, +CLAUDIO, BENEDICK, HERO, BEATRICE, and Attendants</STAGEDIR> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Come, Friar Francis, be brief; only to the plain</LINE> +<LINE>form of marriage, and you shall recount their</LINE> +<LINE>particular duties afterwards.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>You come hither, my lord, to marry this lady.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>No.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>To be married to her: friar, you come to marry her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>Lady, you come hither to be married to this count.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>I do.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>If either of you know any inward impediment why you</LINE> +<LINE>should not be conjoined, charge you, on your souls,</LINE> +<LINE>to utter it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Know you any, Hero?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>None, my lord.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>Know you any, count?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>I dare make his answer, none.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>O, what men dare do! what men may do! what men daily</LINE> +<LINE>do, not knowing what they do!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>How now! interjections? Why, then, some be of</LINE> +<LINE>laughing, as, ah, ha, he!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Stand thee by, friar. Father, by your leave:</LINE> +<LINE>Will you with free and unconstrained soul</LINE> +<LINE>Give me this maid, your daughter?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>As freely, son, as God did give her me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>And what have I to give you back, whose worth</LINE> +<LINE>May counterpoise this rich and precious gift?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Nothing, unless you render her again.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Sweet prince, you learn me noble thankfulness.</LINE> +<LINE>There, Leonato, take her back again:</LINE> +<LINE>Give not this rotten orange to your friend;</LINE> +<LINE>She's but the sign and semblance of her honour.</LINE> +<LINE>Behold how like a maid she blushes here!</LINE> +<LINE>O, what authority and show of truth</LINE> +<LINE>Can cunning sin cover itself withal!</LINE> +<LINE>Comes not that blood as modest evidence</LINE> +<LINE>To witness simple virtue? Would you not swear,</LINE> +<LINE>All you that see her, that she were a maid,</LINE> +<LINE>By these exterior shows? But she is none:</LINE> +<LINE>She knows the heat of a luxurious bed;</LINE> +<LINE>Her blush is guiltiness, not modesty.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>What do you mean, my lord?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Not to be married,</LINE> +<LINE>Not to knit my soul to an approved wanton.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Dear my lord, if you, in your own proof,</LINE> +<LINE>Have vanquish'd the resistance of her youth,</LINE> +<LINE>And made defeat of her virginity,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>I know what you would say: if I have known her,</LINE> +<LINE>You will say she did embrace me as a husband,</LINE> +<LINE>And so extenuate the 'forehand sin:</LINE> +<LINE>No, Leonato,</LINE> +<LINE>I never tempted her with word too large;</LINE> +<LINE>But, as a brother to his sister, show'd</LINE> +<LINE>Bashful sincerity and comely love.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>And seem'd I ever otherwise to you?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Out on thee! Seeming! I will write against it:</LINE> +<LINE>You seem to me as Dian in her orb,</LINE> +<LINE>As chaste as is the bud ere it be blown;</LINE> +<LINE>But you are more intemperate in your blood</LINE> +<LINE>Than Venus, or those pamper'd animals</LINE> +<LINE>That rage in savage sensuality.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Is my lord well, that he doth speak so wide?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Sweet prince, why speak not you?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>What should I speak?</LINE> +<LINE>I stand dishonour'd, that have gone about</LINE> +<LINE>To link my dear friend to a common stale.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Are these things spoken, or do I but dream?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Sir, they are spoken, and these things are true.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>This looks not like a nuptial.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>True! O God!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Leonato, stand I here?</LINE> +<LINE>Is this the prince? is this the prince's brother?</LINE> +<LINE>Is this face Hero's? are our eyes our own?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>All this is so: but what of this, my lord?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Let me but move one question to your daughter;</LINE> +<LINE>And, by that fatherly and kindly power</LINE> +<LINE>That you have in her, bid her answer truly.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>I charge thee do so, as thou art my child.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>O, God defend me! how am I beset!</LINE> +<LINE>What kind of catechising call you this?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>To make you answer truly to your name.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Is it not Hero? Who can blot that name</LINE> +<LINE>With any just reproach?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Marry, that can Hero;</LINE> +<LINE>Hero itself can blot out Hero's virtue.</LINE> +<LINE>What man was he talk'd with you yesternight</LINE> +<LINE>Out at your window betwixt twelve and one?</LINE> +<LINE>Now, if you are a maid, answer to this.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>I talk'd with no man at that hour, my lord.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Why, then are you no maiden. Leonato,</LINE> +<LINE>I am sorry you must hear: upon mine honour,</LINE> +<LINE>Myself, my brother and this grieved count</LINE> +<LINE>Did see her, hear her, at that hour last night</LINE> +<LINE>Talk with a ruffian at her chamber-window</LINE> +<LINE>Who hath indeed, most like a liberal villain,</LINE> +<LINE>Confess'd the vile encounters they have had</LINE> +<LINE>A thousand times in secret.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Fie, fie! they are not to be named, my lord,</LINE> +<LINE>Not to be spoke of;</LINE> +<LINE>There is not chastity enough in language</LINE> +<LINE>Without offence to utter them. Thus, pretty lady,</LINE> +<LINE>I am sorry for thy much misgovernment.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>O Hero, what a Hero hadst thou been,</LINE> +<LINE>If half thy outward graces had been placed</LINE> +<LINE>About thy thoughts and counsels of thy heart!</LINE> +<LINE>But fare thee well, most foul, most fair! farewell,</LINE> +<LINE>Thou pure impiety and impious purity!</LINE> +<LINE>For thee I'll lock up all the gates of love,</LINE> +<LINE>And on my eyelids shall conjecture hang,</LINE> +<LINE>To turn all beauty into thoughts of harm,</LINE> +<LINE>And never shall it more be gracious.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Hath no man's dagger here a point for me?</LINE> +</SPEECH> + + +<STAGEDIR>HERO swoons</STAGEDIR> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Why, how now, cousin! wherefore sink you down?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON JOHN</SPEAKER> +<LINE>Come, let us go. These things, come thus to light,</LINE> +<LINE>Smother her spirits up.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt DON PEDRO, DON JOHN, and CLAUDIO</STAGEDIR> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>How doth the lady?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Dead, I think. Help, uncle!</LINE> +<LINE>Hero! why, Hero! Uncle! Signior Benedick! Friar!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>O Fate! take not away thy heavy hand.</LINE> +<LINE>Death is the fairest cover for her shame</LINE> +<LINE>That may be wish'd for.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>How now, cousin Hero!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>Have comfort, lady.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Dost thou look up?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>Yea, wherefore should she not?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Wherefore! Why, doth not every earthly thing</LINE> +<LINE>Cry shame upon her? Could she here deny</LINE> +<LINE>The story that is printed in her blood?</LINE> +<LINE>Do not live, Hero; do not ope thine eyes:</LINE> +<LINE>For, did I think thou wouldst not quickly die,</LINE> +<LINE>Thought I thy spirits were stronger than thy shames,</LINE> +<LINE>Myself would, on the rearward of reproaches,</LINE> +<LINE>Strike at thy life. Grieved I, I had but one?</LINE> +<LINE>Chid I for that at frugal nature's frame?</LINE> +<LINE>O, one too much by thee! Why had I one?</LINE> +<LINE>Why ever wast thou lovely in my eyes?</LINE> +<LINE>Why had I not with charitable hand</LINE> +<LINE>Took up a beggar's issue at my gates,</LINE> +<LINE>Who smirch'd thus and mired with infamy,</LINE> +<LINE>I might have said 'No part of it is mine;</LINE> +<LINE>This shame derives itself from unknown loins'?</LINE> +<LINE>But mine and mine I loved and mine I praised</LINE> +<LINE>And mine that I was proud on, mine so much</LINE> +<LINE>That I myself was to myself not mine,</LINE> +<LINE>Valuing of her,--why, she, O, she is fallen</LINE> +<LINE>Into a pit of ink, that the wide sea</LINE> +<LINE>Hath drops too few to wash her clean again</LINE> +<LINE>And salt too little which may season give</LINE> +<LINE>To her foul-tainted flesh!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Sir, sir, be patient.</LINE> +<LINE>For my part, I am so attired in wonder,</LINE> +<LINE>I know not what to say.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>O, on my soul, my cousin is belied!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Lady, were you her bedfellow last night?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>No, truly not; although, until last night,</LINE> +<LINE>I have this twelvemonth been her bedfellow.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Confirm'd, confirm'd! O, that is stronger made</LINE> +<LINE>Which was before barr'd up with ribs of iron!</LINE> +<LINE>Would the two princes lie, and Claudio lie,</LINE> +<LINE>Who loved her so, that, speaking of her foulness,</LINE> +<LINE>Wash'd it with tears? Hence from her! let her die.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>Hear me a little; for I have only been</LINE> +<LINE>Silent so long and given way unto</LINE> +<LINE>This course of fortune</LINE> +<LINE>By noting of the lady. I have mark'd</LINE> +<LINE>A thousand blushing apparitions</LINE> +<LINE>To start into her face, a thousand innocent shames</LINE> +<LINE>In angel whiteness beat away those blushes;</LINE> +<LINE>And in her eye there hath appear'd a fire,</LINE> +<LINE>To burn the errors that these princes hold</LINE> +<LINE>Against her maiden truth. Call me a fool;</LINE> +<LINE>Trust not my reading nor my observations,</LINE> +<LINE>Which with experimental seal doth warrant</LINE> +<LINE>The tenor of my book; trust not my age,</LINE> +<LINE>My reverence, calling, nor divinity,</LINE> +<LINE>If this sweet lady lie not guiltless here</LINE> +<LINE>Under some biting error.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Friar, it cannot be.</LINE> +<LINE>Thou seest that all the grace that she hath left</LINE> +<LINE>Is that she will not add to her damnation</LINE> +<LINE>A sin of perjury; she not denies it:</LINE> +<LINE>Why seek'st thou then to cover with excuse</LINE> +<LINE>That which appears in proper nakedness?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>Lady, what man is he you are accused of?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>They know that do accuse me; I know none:</LINE> +<LINE>If I know more of any man alive</LINE> +<LINE>Than that which maiden modesty doth warrant,</LINE> +<LINE>Let all my sins lack mercy! O my father,</LINE> +<LINE>Prove you that any man with me conversed</LINE> +<LINE>At hours unmeet, or that I yesternight</LINE> +<LINE>Maintain'd the change of words with any creature,</LINE> +<LINE>Refuse me, hate me, torture me to death!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>There is some strange misprision in the princes.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Two of them have the very bent of honour;</LINE> +<LINE>And if their wisdoms be misled in this,</LINE> +<LINE>The practise of it lives in John the bastard,</LINE> +<LINE>Whose spirits toil in frame of villanies.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>I know not. If they speak but truth of her,</LINE> +<LINE>These hands shall tear her; if they wrong her honour,</LINE> +<LINE>The proudest of them shall well hear of it.</LINE> +<LINE>Time hath not yet so dried this blood of mine,</LINE> +<LINE>Nor age so eat up my invention,</LINE> +<LINE>Nor fortune made such havoc of my means,</LINE> +<LINE>Nor my bad life reft me so much of friends,</LINE> +<LINE>But they shall find, awaked in such a kind,</LINE> +<LINE>Both strength of limb and policy of mind,</LINE> +<LINE>Ability in means and choice of friends,</LINE> +<LINE>To quit me of them throughly.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>Pause awhile,</LINE> +<LINE>And let my counsel sway you in this case.</LINE> +<LINE>Your daughter here the princes left for dead:</LINE> +<LINE>Let her awhile be secretly kept in,</LINE> +<LINE>And publish it that she is dead indeed;</LINE> +<LINE>Maintain a mourning ostentation</LINE> +<LINE>And on your family's old monument</LINE> +<LINE>Hang mournful epitaphs and do all rites</LINE> +<LINE>That appertain unto a burial.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>What shall become of this? what will this do?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>Marry, this well carried shall on her behalf</LINE> +<LINE>Change slander to remorse; that is some good:</LINE> +<LINE>But not for that dream I on this strange course,</LINE> +<LINE>But on this travail look for greater birth.</LINE> +<LINE>She dying, as it must so be maintain'd,</LINE> +<LINE>Upon the instant that she was accused,</LINE> +<LINE>Shall be lamented, pitied and excused</LINE> +<LINE>Of every hearer: for it so falls out</LINE> +<LINE>That what we have we prize not to the worth</LINE> +<LINE>Whiles we enjoy it, but being lack'd and lost,</LINE> +<LINE>Why, then we rack the value, then we find</LINE> +<LINE>The virtue that possession would not show us</LINE> +<LINE>Whiles it was ours. So will it fare with Claudio:</LINE> +<LINE>When he shall hear she died upon his words,</LINE> +<LINE>The idea of her life shall sweetly creep</LINE> +<LINE>Into his study of imagination,</LINE> +<LINE>And every lovely organ of her life</LINE> +<LINE>Shall come apparell'd in more precious habit,</LINE> +<LINE>More moving-delicate and full of life,</LINE> +<LINE>Into the eye and prospect of his soul,</LINE> +<LINE>Than when she lived indeed; then shall he mourn,</LINE> +<LINE>If ever love had interest in his liver,</LINE> +<LINE>And wish he had not so accused her,</LINE> +<LINE>No, though he thought his accusation true.</LINE> +<LINE>Let this be so, and doubt not but success</LINE> +<LINE>Will fashion the event in better shape</LINE> +<LINE>Than I can lay it down in likelihood.</LINE> +<LINE>But if all aim but this be levell'd false,</LINE> +<LINE>The supposition of the lady's death</LINE> +<LINE>Will quench the wonder of her infamy:</LINE> +<LINE>And if it sort not well, you may conceal her,</LINE> +<LINE>As best befits her wounded reputation,</LINE> +<LINE>In some reclusive and religious life,</LINE> +<LINE>Out of all eyes, tongues, minds and injuries.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Signior Leonato, let the friar advise you:</LINE> +<LINE>And though you know my inwardness and love</LINE> +<LINE>Is very much unto the prince and Claudio,</LINE> +<LINE>Yet, by mine honour, I will deal in this</LINE> +<LINE>As secretly and justly as your soul</LINE> +<LINE>Should with your body.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Being that I flow in grief,</LINE> +<LINE>The smallest twine may lead me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>'Tis well consented: presently away;</LINE> +<LINE>For to strange sores strangely they strain the cure.</LINE> +<LINE>Come, lady, die to live: this wedding-day</LINE> +<LINE>Perhaps is but prolong'd: have patience and endure.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt all but BENEDICK and BEATRICE</STAGEDIR> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Lady Beatrice, have you wept all this while?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Yea, and I will weep a while longer.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I will not desire that.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>You have no reason; I do it freely.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Surely I do believe your fair cousin is wronged.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Ah, how much might the man deserve of me that would right her!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Is there any way to show such friendship?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>A very even way, but no such friend.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>May a man do it?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>It is a man's office, but not yours.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I do love nothing in the world so well as you: is</LINE> +<LINE>not that strange?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>As strange as the thing I know not. It were as</LINE> +<LINE>possible for me to say I loved nothing so well as</LINE> +<LINE>you: but believe me not; and yet I lie not; I</LINE> +<LINE>confess nothing, nor I deny nothing. I am sorry for my cousin.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>By my sword, Beatrice, thou lovest me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Do not swear, and eat it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I will swear by it that you love me; and I will make</LINE> +<LINE>him eat it that says I love not you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Will you not eat your word?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>With no sauce that can be devised to it. I protest</LINE> +<LINE>I love thee.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Why, then, God forgive me!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>What offence, sweet Beatrice?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>You have stayed me in a happy hour: I was about to</LINE> +<LINE>protest I loved you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>And do it with all thy heart.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>I love you with so much of my heart that none is</LINE> +<LINE>left to protest.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Come, bid me do any thing for thee.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Kill Claudio.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Ha! not for the wide world.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>You kill me to deny it. Farewell.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Tarry, sweet Beatrice.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>I am gone, though I am here: there is no love in</LINE> +<LINE>you: nay, I pray you, let me go.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Beatrice,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>In faith, I will go.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>We'll be friends first.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>You dare easier be friends with me than fight with mine enemy.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Is Claudio thine enemy?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Is he not approved in the height a villain, that</LINE> +<LINE>hath slandered, scorned, dishonoured my kinswoman? O</LINE> +<LINE>that I were a man! What, bear her in hand until they</LINE> +<LINE>come to take hands; and then, with public</LINE> +<LINE>accusation, uncovered slander, unmitigated rancour,</LINE> +<LINE>--O God, that I were a man! I would eat his heart</LINE> +<LINE>in the market-place.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Hear me, Beatrice,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Talk with a man out at a window! A proper saying!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Nay, but, Beatrice,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Sweet Hero! She is wronged, she is slandered, she is undone.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Beat--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Princes and counties! Surely, a princely testimony,</LINE> +<LINE>a goodly count, Count Comfect; a sweet gallant,</LINE> +<LINE>surely! O that I were a man for his sake! or that I</LINE> +<LINE>had any friend would be a man for my sake! But</LINE> +<LINE>manhood is melted into courtesies, valour into</LINE> +<LINE>compliment, and men are only turned into tongue, and</LINE> +<LINE>trim ones too: he is now as valiant as Hercules</LINE> +<LINE>that only tells a lie and swears it. I cannot be a</LINE> +<LINE>man with wishing, therefore I will die a woman with grieving.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Tarry, good Beatrice. By this hand, I love thee.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Use it for my love some other way than swearing by it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Think you in your soul the Count Claudio hath wronged Hero?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Yea, as sure as I have a thought or a soul.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Enough, I am engaged; I will challenge him. I will</LINE> +<LINE>kiss your hand, and so I leave you. By this hand,</LINE> +<LINE>Claudio shall render me a dear account. As you</LINE> +<LINE>hear of me, so think of me. Go, comfort your</LINE> +<LINE>cousin: I must say she is dead: and so, farewell.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> + +<SCENE><TITLE>SCENE II. A prison.</TITLE> +<STAGEDIR>Enter DOGBERRY, VERGES, and Sexton, in gowns; and +the Watch, with CONRADE and BORACHIO</STAGEDIR> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Is our whole dissembly appeared?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>O, a stool and a cushion for the sexton.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Sexton</SPEAKER> +<LINE>Which be the malefactors?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Marry, that am I and my partner.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>Nay, that's certain; we have the exhibition to examine.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Sexton</SPEAKER> +<LINE>But which are the offenders that are to be</LINE> +<LINE>examined? let them come before master constable.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Yea, marry, let them come before me. What is your</LINE> +<LINE>name, friend?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Borachio.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Pray, write down, Borachio. Yours, sirrah?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>I am a gentleman, sir, and my name is Conrade.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Write down, master gentleman Conrade. Masters, do</LINE> +<LINE>you serve God?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Yea, sir, we hope.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Write down, that they hope they serve God: and</LINE> +<LINE>write God first; for God defend but God should go</LINE> +<LINE>before such villains! Masters, it is proved already</LINE> +<LINE>that you are little better than false knaves; and it</LINE> +<LINE>will go near to be thought so shortly. How answer</LINE> +<LINE>you for yourselves?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>Marry, sir, we say we are none.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>A marvellous witty fellow, I assure you: but I</LINE> +<LINE>will go about with him. Come you hither, sirrah; a</LINE> +<LINE>word in your ear: sir, I say to you, it is thought</LINE> +<LINE>you are false knaves.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Sir, I say to you we are none.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Well, stand aside. 'Fore God, they are both in a</LINE> +<LINE>tale. Have you writ down, that they are none?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Sexton</SPEAKER> +<LINE>Master constable, you go not the way to examine:</LINE> +<LINE>you must call forth the watch that are their accusers.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Yea, marry, that's the eftest way. Let the watch</LINE> +<LINE>come forth. Masters, I charge you, in the prince's</LINE> +<LINE>name, accuse these men.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>First Watchman</SPEAKER> +<LINE>This man said, sir, that Don John, the prince's</LINE> +<LINE>brother, was a villain.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Write down Prince John a villain. Why, this is flat</LINE> +<LINE>perjury, to call a prince's brother villain.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Master constable,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Pray thee, fellow, peace: I do not like thy look,</LINE> +<LINE>I promise thee.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Sexton</SPEAKER> +<LINE>What heard you him say else?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Second Watchman</SPEAKER> +<LINE>Marry, that he had received a thousand ducats of</LINE> +<LINE>Don John for accusing the Lady Hero wrongfully.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Flat burglary as ever was committed.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>Yea, by mass, that it is.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Sexton</SPEAKER> +<LINE>What else, fellow?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>First Watchman</SPEAKER> +<LINE>And that Count Claudio did mean, upon his words, to</LINE> +<LINE>disgrace Hero before the whole assembly. and not marry her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>O villain! thou wilt be condemned into everlasting</LINE> +<LINE>redemption for this.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Sexton</SPEAKER> +<LINE>What else?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Watchman</SPEAKER> +<LINE>This is all.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Sexton</SPEAKER> +<LINE>And this is more, masters, than you can deny.</LINE> +<LINE>Prince John is this morning secretly stolen away;</LINE> +<LINE>Hero was in this manner accused, in this very manner</LINE> +<LINE>refused, and upon the grief of this suddenly died.</LINE> +<LINE>Master constable, let these men be bound, and</LINE> +<LINE>brought to Leonato's: I will go before and show</LINE> +<LINE>him their examination.</LINE> +</SPEECH> + + +<STAGEDIR>Exit</STAGEDIR> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Come, let them be opinioned.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>Let them be in the hands--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>Off, coxcomb!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>God's my life, where's the sexton? let him write</LINE> +<LINE>down the prince's officer coxcomb. Come, bind them.</LINE> +<LINE>Thou naughty varlet!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CONRADE</SPEAKER> +<LINE>Away! you are an ass, you are an ass.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Dost thou not suspect my place? dost thou not</LINE> +<LINE>suspect my years? O that he were here to write me</LINE> +<LINE>down an ass! But, masters, remember that I am an</LINE> +<LINE>ass; though it be not written down, yet forget not</LINE> +<LINE>that I am an ass. No, thou villain, thou art full of</LINE> +<LINE>piety, as shall be proved upon thee by good witness.</LINE> +<LINE>I am a wise fellow, and, which is more, an officer,</LINE> +<LINE>and, which is more, a householder, and, which is</LINE> +<LINE>more, as pretty a piece of flesh as any is in</LINE> +<LINE>Messina, and one that knows the law, go to; and a</LINE> +<LINE>rich fellow enough, go to; and a fellow that hath</LINE> +<LINE>had losses, and one that hath two gowns and every</LINE> +<LINE>thing handsome about him. Bring him away. O that</LINE> +<LINE>I had been writ down an ass!</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> + +</ACT> + +<ACT><TITLE>ACT V</TITLE> + +<SCENE><TITLE>SCENE I. Before LEONATO'S house.</TITLE> +<STAGEDIR>Enter LEONATO and ANTONIO</STAGEDIR> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>If you go on thus, you will kill yourself:</LINE> +<LINE>And 'tis not wisdom thus to second grief</LINE> +<LINE>Against yourself.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>I pray thee, cease thy counsel,</LINE> +<LINE>Which falls into mine ears as profitless</LINE> +<LINE>As water in a sieve: give not me counsel;</LINE> +<LINE>Nor let no comforter delight mine ear</LINE> +<LINE>But such a one whose wrongs do suit with mine.</LINE> +<LINE>Bring me a father that so loved his child,</LINE> +<LINE>Whose joy of her is overwhelm'd like mine,</LINE> +<LINE>And bid him speak of patience;</LINE> +<LINE>Measure his woe the length and breadth of mine</LINE> +<LINE>And let it answer every strain for strain,</LINE> +<LINE>As thus for thus and such a grief for such,</LINE> +<LINE>In every lineament, branch, shape, and form:</LINE> +<LINE>If such a one will smile and stroke his beard,</LINE> +<LINE>Bid sorrow wag, cry 'hem!' when he should groan,</LINE> +<LINE>Patch grief with proverbs, make misfortune drunk</LINE> +<LINE>With candle-wasters; bring him yet to me,</LINE> +<LINE>And I of him will gather patience.</LINE> +<LINE>But there is no such man: for, brother, men</LINE> +<LINE>Can counsel and speak comfort to that grief</LINE> +<LINE>Which they themselves not feel; but, tasting it,</LINE> +<LINE>Their counsel turns to passion, which before</LINE> +<LINE>Would give preceptial medicine to rage,</LINE> +<LINE>Fetter strong madness in a silken thread,</LINE> +<LINE>Charm ache with air and agony with words:</LINE> +<LINE>No, no; 'tis all men's office to speak patience</LINE> +<LINE>To those that wring under the load of sorrow,</LINE> +<LINE>But no man's virtue nor sufficiency</LINE> +<LINE>To be so moral when he shall endure</LINE> +<LINE>The like himself. Therefore give me no counsel:</LINE> +<LINE>My griefs cry louder than advertisement.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>Therein do men from children nothing differ.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>I pray thee, peace. I will be flesh and blood;</LINE> +<LINE>For there was never yet philosopher</LINE> +<LINE>That could endure the toothache patiently,</LINE> +<LINE>However they have writ the style of gods</LINE> +<LINE>And made a push at chance and sufferance.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>Yet bend not all the harm upon yourself;</LINE> +<LINE>Make those that do offend you suffer too.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>There thou speak'st reason: nay, I will do so.</LINE> +<LINE>My soul doth tell me Hero is belied;</LINE> +<LINE>And that shall Claudio know; so shall the prince</LINE> +<LINE>And all of them that thus dishonour her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>Here comes the prince and Claudio hastily.</LINE> +</SPEECH> + + +<STAGEDIR>Enter DON PEDRO and CLAUDIO</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Good den, good den.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Good day to both of you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Hear you. my lords,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>We have some haste, Leonato.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Some haste, my lord! well, fare you well, my lord:</LINE> +<LINE>Are you so hasty now? well, all is one.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Nay, do not quarrel with us, good old man.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>If he could right himself with quarreling,</LINE> +<LINE>Some of us would lie low.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Who wrongs him?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Marry, thou dost wrong me; thou dissembler, thou:--</LINE> +<LINE>Nay, never lay thy hand upon thy sword;</LINE> +<LINE>I fear thee not.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Marry, beshrew my hand,</LINE> +<LINE>If it should give your age such cause of fear:</LINE> +<LINE>In faith, my hand meant nothing to my sword.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Tush, tush, man; never fleer and jest at me:</LINE> +<LINE>I speak not like a dotard nor a fool,</LINE> +<LINE>As under privilege of age to brag</LINE> +<LINE>What I have done being young, or what would do</LINE> +<LINE>Were I not old. Know, Claudio, to thy head,</LINE> +<LINE>Thou hast so wrong'd mine innocent child and me</LINE> +<LINE>That I am forced to lay my reverence by</LINE> +<LINE>And, with grey hairs and bruise of many days,</LINE> +<LINE>Do challenge thee to trial of a man.</LINE> +<LINE>I say thou hast belied mine innocent child;</LINE> +<LINE>Thy slander hath gone through and through her heart,</LINE> +<LINE>And she lies buried with her ancestors;</LINE> +<LINE>O, in a tomb where never scandal slept,</LINE> +<LINE>Save this of hers, framed by thy villany!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>My villany?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Thine, Claudio; thine, I say.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>You say not right, old man.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>My lord, my lord,</LINE> +<LINE>I'll prove it on his body, if he dare,</LINE> +<LINE>Despite his nice fence and his active practise,</LINE> +<LINE>His May of youth and bloom of lustihood.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Away! I will not have to do with you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Canst thou so daff me? Thou hast kill'd my child:</LINE> +<LINE>If thou kill'st me, boy, thou shalt kill a man.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>He shall kill two of us, and men indeed:</LINE> +<LINE>But that's no matter; let him kill one first;</LINE> +<LINE>Win me and wear me; let him answer me.</LINE> +<LINE>Come, follow me, boy; come, sir boy, come, follow me:</LINE> +<LINE>Sir boy, I'll whip you from your foining fence;</LINE> +<LINE>Nay, as I am a gentleman, I will.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Brother,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>Content yourself. God knows I loved my niece;</LINE> +<LINE>And she is dead, slander'd to death by villains,</LINE> +<LINE>That dare as well answer a man indeed</LINE> +<LINE>As I dare take a serpent by the tongue:</LINE> +<LINE>Boys, apes, braggarts, Jacks, milksops!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Brother Antony,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>Hold you content. What, man! I know them, yea,</LINE> +<LINE>And what they weigh, even to the utmost scruple,--</LINE> +<LINE>Scrambling, out-facing, fashion-monging boys,</LINE> +<LINE>That lie and cog and flout, deprave and slander,</LINE> +<LINE>Go anticly, show outward hideousness,</LINE> +<LINE>And speak off half a dozen dangerous words,</LINE> +<LINE>How they might hurt their enemies, if they durst;</LINE> +<LINE>And this is all.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>But, brother Antony,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>Come, 'tis no matter:</LINE> +<LINE>Do not you meddle; let me deal in this.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Gentlemen both, we will not wake your patience.</LINE> +<LINE>My heart is sorry for your daughter's death:</LINE> +<LINE>But, on my honour, she was charged with nothing</LINE> +<LINE>But what was true and very full of proof.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>My lord, my lord,--</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>I will not hear you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>No? Come, brother; away! I will be heard.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>And shall, or some of us will smart for it.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt LEONATO and ANTONIO</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>See, see; here comes the man we went to seek.</LINE> +</SPEECH> + + +<STAGEDIR>Enter BENEDICK</STAGEDIR> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Now, signior, what news?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Good day, my lord.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Welcome, signior: you are almost come to part</LINE> +<LINE>almost a fray.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>We had like to have had our two noses snapped off</LINE> +<LINE>with two old men without teeth.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Leonato and his brother. What thinkest thou? Had</LINE> +<LINE>we fought, I doubt we should have been too young for them.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>In a false quarrel there is no true valour. I came</LINE> +<LINE>to seek you both.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>We have been up and down to seek thee; for we are</LINE> +<LINE>high-proof melancholy and would fain have it beaten</LINE> +<LINE>away. Wilt thou use thy wit?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>It is in my scabbard: shall I draw it?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Dost thou wear thy wit by thy side?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Never any did so, though very many have been beside</LINE> +<LINE>their wit. I will bid thee draw, as we do the</LINE> +<LINE>minstrels; draw, to pleasure us.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>As I am an honest man, he looks pale. Art thou</LINE> +<LINE>sick, or angry?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>What, courage, man! What though care killed a cat,</LINE> +<LINE>thou hast mettle enough in thee to kill care.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Sir, I shall meet your wit in the career, and you</LINE> +<LINE>charge it against me. I pray you choose another subject.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Nay, then, give him another staff: this last was</LINE> +<LINE>broke cross.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>By this light, he changes more and more: I think</LINE> +<LINE>he be angry indeed.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>If he be, he knows how to turn his girdle.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Shall I speak a word in your ear?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>God bless me from a challenge!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE><STAGEDIR>Aside to CLAUDIO</STAGEDIR> You are a villain; I jest not:</LINE> +<LINE>I will make it good how you dare, with what you</LINE> +<LINE>dare, and when you dare. Do me right, or I will</LINE> +<LINE>protest your cowardice. You have killed a sweet</LINE> +<LINE>lady, and her death shall fall heavy on you. Let me</LINE> +<LINE>hear from you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Well, I will meet you, so I may have good cheer.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>What, a feast, a feast?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>I' faith, I thank him; he hath bid me to a calf's</LINE> +<LINE>head and a capon; the which if I do not carve most</LINE> +<LINE>curiously, say my knife's naught. Shall I not find</LINE> +<LINE>a woodcock too?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Sir, your wit ambles well; it goes easily.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>I'll tell thee how Beatrice praised thy wit the</LINE> +<LINE>other day. I said, thou hadst a fine wit: 'True,'</LINE> +<LINE>said she, 'a fine little one.' 'No,' said I, 'a</LINE> +<LINE>great wit:' 'Right,' says she, 'a great gross one.'</LINE> +<LINE>'Nay,' said I, 'a good wit:' 'Just,' said she, 'it</LINE> +<LINE>hurts nobody.' 'Nay,' said I, 'the gentleman</LINE> +<LINE>is wise:' 'Certain,' said she, 'a wise gentleman.'</LINE> +<LINE>'Nay,' said I, 'he hath the tongues:' 'That I</LINE> +<LINE>believe,' said she, 'for he swore a thing to me on</LINE> +<LINE>Monday night, which he forswore on Tuesday morning;</LINE> +<LINE>there's a double tongue; there's two tongues.' Thus</LINE> +<LINE>did she, an hour together, transshape thy particular</LINE> +<LINE>virtues: yet at last she concluded with a sigh, thou</LINE> +<LINE>wast the properest man in Italy.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>For the which she wept heartily and said she cared</LINE> +<LINE>not.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Yea, that she did: but yet, for all that, an if she</LINE> +<LINE>did not hate him deadly, she would love him dearly:</LINE> +<LINE>the old man's daughter told us all.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>All, all; and, moreover, God saw him when he was</LINE> +<LINE>hid in the garden.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>But when shall we set the savage bull's horns on</LINE> +<LINE>the sensible Benedick's head?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Yea, and text underneath, 'Here dwells Benedick the</LINE> +<LINE>married man'?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Fare you well, boy: you know my mind. I will leave</LINE> +<LINE>you now to your gossip-like humour: you break jests</LINE> +<LINE>as braggarts do their blades, which God be thanked,</LINE> +<LINE>hurt not. My lord, for your many courtesies I thank</LINE> +<LINE>you: I must discontinue your company: your brother</LINE> +<LINE>the bastard is fled from Messina: you have among</LINE> +<LINE>you killed a sweet and innocent lady. For my Lord</LINE> +<LINE>Lackbeard there, he and I shall meet: and, till</LINE> +<LINE>then, peace be with him.</LINE> +</SPEECH> + + +<STAGEDIR>Exit</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>He is in earnest.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>In most profound earnest; and, I'll warrant you, for</LINE> +<LINE>the love of Beatrice.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>And hath challenged thee.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Most sincerely.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>What a pretty thing man is when he goes in his</LINE> +<LINE>doublet and hose and leaves off his wit!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>He is then a giant to an ape; but then is an ape a</LINE> +<LINE>doctor to such a man.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>But, soft you, let me be: pluck up, my heart, and</LINE> +<LINE>be sad. Did he not say, my brother was fled?</LINE> +</SPEECH> + + +<STAGEDIR>Enter DOGBERRY, VERGES, and the Watch, with CONRADE +and BORACHIO</STAGEDIR> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Come you, sir: if justice cannot tame you, she</LINE> +<LINE>shall ne'er weigh more reasons in her balance: nay,</LINE> +<LINE>an you be a cursing hypocrite once, you must be looked to.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>How now? two of my brother's men bound! Borachio</LINE> +<LINE>one!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Hearken after their offence, my lord.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Officers, what offence have these men done?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Marry, sir, they have committed false report;</LINE> +<LINE>moreover, they have spoken untruths; secondarily,</LINE> +<LINE>they are slanders; sixth and lastly, they have</LINE> +<LINE>belied a lady; thirdly, they have verified unjust</LINE> +<LINE>things; and, to conclude, they are lying knaves.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>First, I ask thee what they have done; thirdly, I</LINE> +<LINE>ask thee what's their offence; sixth and lastly, why</LINE> +<LINE>they are committed; and, to conclude, what you lay</LINE> +<LINE>to their charge.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Rightly reasoned, and in his own division: and, by</LINE> +<LINE>my troth, there's one meaning well suited.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Who have you offended, masters, that you are thus</LINE> +<LINE>bound to your answer? this learned constable is</LINE> +<LINE>too cunning to be understood: what's your offence?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Sweet prince, let me go no farther to mine answer:</LINE> +<LINE>do you hear me, and let this count kill me. I have</LINE> +<LINE>deceived even your very eyes: what your wisdoms</LINE> +<LINE>could not discover, these shallow fools have brought</LINE> +<LINE>to light: who in the night overheard me confessing</LINE> +<LINE>to this man how Don John your brother incensed me</LINE> +<LINE>to slander the Lady Hero, how you were brought into</LINE> +<LINE>the orchard and saw me court Margaret in Hero's</LINE> +<LINE>garments, how you disgraced her, when you should</LINE> +<LINE>marry her: my villany they have upon record; which</LINE> +<LINE>I had rather seal with my death than repeat over</LINE> +<LINE>to my shame. The lady is dead upon mine and my</LINE> +<LINE>master's false accusation; and, briefly, I desire</LINE> +<LINE>nothing but the reward of a villain.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Runs not this speech like iron through your blood?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>I have drunk poison whiles he utter'd it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>But did my brother set thee on to this?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Yea, and paid me richly for the practise of it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>He is composed and framed of treachery:</LINE> +<LINE>And fled he is upon this villany.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Sweet Hero! now thy image doth appear</LINE> +<LINE>In the rare semblance that I loved it first.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Come, bring away the plaintiffs: by this time our</LINE> +<LINE>sexton hath reformed Signior Leonato of the matter:</LINE> +<LINE>and, masters, do not forget to specify, when time</LINE> +<LINE>and place shall serve, that I am an ass.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>VERGES</SPEAKER> +<LINE>Here, here comes master Signior Leonato, and the</LINE> +<LINE>Sexton too.</LINE> +</SPEECH> + + +<STAGEDIR>Re-enter LEONATO and ANTONIO, with the Sexton</STAGEDIR> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Which is the villain? let me see his eyes,</LINE> +<LINE>That, when I note another man like him,</LINE> +<LINE>I may avoid him: which of these is he?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>If you would know your wronger, look on me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Art thou the slave that with thy breath hast kill'd</LINE> +<LINE>Mine innocent child?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>Yea, even I alone.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>No, not so, villain; thou beliest thyself:</LINE> +<LINE>Here stand a pair of honourable men;</LINE> +<LINE>A third is fled, that had a hand in it.</LINE> +<LINE>I thank you, princes, for my daughter's death:</LINE> +<LINE>Record it with your high and worthy deeds:</LINE> +<LINE>'Twas bravely done, if you bethink you of it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>I know not how to pray your patience;</LINE> +<LINE>Yet I must speak. Choose your revenge yourself;</LINE> +<LINE>Impose me to what penance your invention</LINE> +<LINE>Can lay upon my sin: yet sinn'd I not</LINE> +<LINE>But in mistaking.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>By my soul, nor I:</LINE> +<LINE>And yet, to satisfy this good old man,</LINE> +<LINE>I would bend under any heavy weight</LINE> +<LINE>That he'll enjoin me to.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>I cannot bid you bid my daughter live;</LINE> +<LINE>That were impossible: but, I pray you both,</LINE> +<LINE>Possess the people in Messina here</LINE> +<LINE>How innocent she died; and if your love</LINE> +<LINE>Can labour ought in sad invention,</LINE> +<LINE>Hang her an epitaph upon her tomb</LINE> +<LINE>And sing it to her bones, sing it to-night:</LINE> +<LINE>To-morrow morning come you to my house,</LINE> +<LINE>And since you could not be my son-in-law,</LINE> +<LINE>Be yet my nephew: my brother hath a daughter,</LINE> +<LINE>Almost the copy of my child that's dead,</LINE> +<LINE>And she alone is heir to both of us:</LINE> +<LINE>Give her the right you should have given her cousin,</LINE> +<LINE>And so dies my revenge.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>O noble sir,</LINE> +<LINE>Your over-kindness doth wring tears from me!</LINE> +<LINE>I do embrace your offer; and dispose</LINE> +<LINE>For henceforth of poor Claudio.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>To-morrow then I will expect your coming;</LINE> +<LINE>To-night I take my leave. This naughty man</LINE> +<LINE>Shall face to face be brought to Margaret,</LINE> +<LINE>Who I believe was pack'd in all this wrong,</LINE> +<LINE>Hired to it by your brother.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BORACHIO</SPEAKER> +<LINE>No, by my soul, she was not,</LINE> +<LINE>Nor knew not what she did when she spoke to me,</LINE> +<LINE>But always hath been just and virtuous</LINE> +<LINE>In any thing that I do know by her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Moreover, sir, which indeed is not under white and</LINE> +<LINE>black, this plaintiff here, the offender, did call</LINE> +<LINE>me ass: I beseech you, let it be remembered in his</LINE> +<LINE>punishment. And also, the watch heard them talk of</LINE> +<LINE>one Deformed: they say be wears a key in his ear and</LINE> +<LINE>a lock hanging by it, and borrows money in God's</LINE> +<LINE>name, the which he hath used so long and never paid</LINE> +<LINE>that now men grow hard-hearted and will lend nothing</LINE> +<LINE>for God's sake: pray you, examine him upon that point.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>I thank thee for thy care and honest pains.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>Your worship speaks like a most thankful and</LINE> +<LINE>reverend youth; and I praise God for you.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>There's for thy pains.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>God save the foundation!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Go, I discharge thee of thy prisoner, and I thank thee.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DOGBERRY</SPEAKER> +<LINE>I leave an arrant knave with your worship; which I</LINE> +<LINE>beseech your worship to correct yourself, for the</LINE> +<LINE>example of others. God keep your worship! I wish</LINE> +<LINE>your worship well; God restore you to health! I</LINE> +<LINE>humbly give you leave to depart; and if a merry</LINE> +<LINE>meeting may be wished, God prohibit it! Come, neighbour.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt DOGBERRY and VERGES</STAGEDIR> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Until to-morrow morning, lords, farewell.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>Farewell, my lords: we look for you to-morrow.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>We will not fail.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>To-night I'll mourn with Hero.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE><STAGEDIR>To the Watch</STAGEDIR> Bring you these fellows on. We'll</LINE> +<LINE>talk with Margaret,</LINE> +<LINE>How her acquaintance grew with this lewd fellow.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt, severally</STAGEDIR> +</SCENE> + +<SCENE><TITLE>SCENE II. LEONATO'S garden.</TITLE> +<STAGEDIR>Enter BENEDICK and MARGARET, meeting</STAGEDIR> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Pray thee, sweet Mistress Margaret, deserve well at</LINE> +<LINE>my hands by helping me to the speech of Beatrice.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>Will you then write me a sonnet in praise of my beauty?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>In so high a style, Margaret, that no man living</LINE> +<LINE>shall come over it; for, in most comely truth, thou</LINE> +<LINE>deservest it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>To have no man come over me! why, shall I always</LINE> +<LINE>keep below stairs?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Thy wit is as quick as the greyhound's mouth; it catches.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>And yours as blunt as the fencer's foils, which hit,</LINE> +<LINE>but hurt not.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>A most manly wit, Margaret; it will not hurt a</LINE> +<LINE>woman: and so, I pray thee, call Beatrice: I give</LINE> +<LINE>thee the bucklers.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>Give us the swords; we have bucklers of our own.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>If you use them, Margaret, you must put in the</LINE> +<LINE>pikes with a vice; and they are dangerous weapons for maids.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>MARGARET</SPEAKER> +<LINE>Well, I will call Beatrice to you, who I think hath legs.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>And therefore will come.</LINE> +<STAGEDIR>Exit MARGARET</STAGEDIR> +<STAGEDIR>Sings</STAGEDIR> +<LINE>The god of love,</LINE> +<LINE>That sits above,</LINE> +<LINE>And knows me, and knows me,</LINE> +<LINE>How pitiful I deserve,--</LINE> +<LINE>I mean in singing; but in loving, Leander the good</LINE> +<LINE>swimmer, Troilus the first employer of panders, and</LINE> +<LINE>a whole bookful of these quondam carpet-mangers,</LINE> +<LINE>whose names yet run smoothly in the even road of a</LINE> +<LINE>blank verse, why, they were never so truly turned</LINE> +<LINE>over and over as my poor self in love. Marry, I</LINE> +<LINE>cannot show it in rhyme; I have tried: I can find</LINE> +<LINE>out no rhyme to 'lady' but 'baby,' an innocent</LINE> +<LINE>rhyme; for 'scorn,' 'horn,' a hard rhyme; for,</LINE> +<LINE>'school,' 'fool,' a babbling rhyme; very ominous</LINE> +<LINE>endings: no, I was not born under a rhyming planet,</LINE> +<LINE>nor I cannot woo in festival terms.</LINE> +<STAGEDIR>Enter BEATRICE</STAGEDIR> +<LINE>Sweet Beatrice, wouldst thou come when I called thee?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Yea, signior, and depart when you bid me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>O, stay but till then!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>'Then' is spoken; fare you well now: and yet, ere</LINE> +<LINE>I go, let me go with that I came; which is, with</LINE> +<LINE>knowing what hath passed between you and Claudio.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Only foul words; and thereupon I will kiss thee.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Foul words is but foul wind, and foul wind is but</LINE> +<LINE>foul breath, and foul breath is noisome; therefore I</LINE> +<LINE>will depart unkissed.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Thou hast frighted the word out of his right sense,</LINE> +<LINE>so forcible is thy wit. But I must tell thee</LINE> +<LINE>plainly, Claudio undergoes my challenge; and either</LINE> +<LINE>I must shortly hear from him, or I will subscribe</LINE> +<LINE>him a coward. And, I pray thee now, tell me for</LINE> +<LINE>which of my bad parts didst thou first fall in love with me?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>For them all together; which maintained so politic</LINE> +<LINE>a state of evil that they will not admit any good</LINE> +<LINE>part to intermingle with them. But for which of my</LINE> +<LINE>good parts did you first suffer love for me?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Suffer love! a good epithet! I do suffer love</LINE> +<LINE>indeed, for I love thee against my will.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>In spite of your heart, I think; alas, poor heart!</LINE> +<LINE>If you spite it for my sake, I will spite it for</LINE> +<LINE>yours; for I will never love that which my friend hates.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Thou and I are too wise to woo peaceably.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>It appears not in this confession: there's not one</LINE> +<LINE>wise man among twenty that will praise himself.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>An old, an old instance, Beatrice, that lived in</LINE> +<LINE>the lime of good neighbours. If a man do not erect</LINE> +<LINE>in this age his own tomb ere he dies, he shall live</LINE> +<LINE>no longer in monument than the bell rings and the</LINE> +<LINE>widow weeps.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>And how long is that, think you?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Question: why, an hour in clamour and a quarter in</LINE> +<LINE>rheum: therefore is it most expedient for the</LINE> +<LINE>wise, if Don Worm, his conscience, find no</LINE> +<LINE>impediment to the contrary, to be the trumpet of his</LINE> +<LINE>own virtues, as I am to myself. So much for</LINE> +<LINE>praising myself, who, I myself will bear witness, is</LINE> +<LINE>praiseworthy: and now tell me, how doth your cousin?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Very ill.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>And how do you?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Very ill too.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Serve God, love me and mend. There will I leave</LINE> +<LINE>you too, for here comes one in haste.</LINE> +</SPEECH> + + +<STAGEDIR>Enter URSULA</STAGEDIR> + +<SPEECH> +<SPEAKER>URSULA</SPEAKER> +<LINE>Madam, you must come to your uncle. Yonder's old</LINE> +<LINE>coil at home: it is proved my Lady Hero hath been</LINE> +<LINE>falsely accused, the prince and Claudio mightily</LINE> +<LINE>abused; and Don John is the author of all, who is</LINE> +<LINE>fed and gone. Will you come presently?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Will you go hear this news, signior?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I will live in thy heart, die in thy lap, and be</LINE> +<LINE>buried in thy eyes; and moreover I will go with</LINE> +<LINE>thee to thy uncle's.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> + +<SCENE><TITLE>SCENE III. A church.</TITLE> +<STAGEDIR>Enter DON PEDRO, CLAUDIO, and three or four +with tapers</STAGEDIR> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Is this the monument of Leonato?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>Lord</SPEAKER> +<LINE>It is, my lord.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE><STAGEDIR>Reading out of a scroll</STAGEDIR></LINE> +<LINE>Done to death by slanderous tongues</LINE> +<LINE>Was the Hero that here lies:</LINE> +<LINE>Death, in guerdon of her wrongs,</LINE> +<LINE>Gives her fame which never dies.</LINE> +<LINE>So the life that died with shame</LINE> +<LINE>Lives in death with glorious fame.</LINE> +<LINE>Hang thou there upon the tomb,</LINE> +<LINE>Praising her when I am dumb.</LINE> +<LINE>Now, music, sound, and sing your solemn hymn.</LINE> +<SUBHEAD>SONG.</SUBHEAD> +<LINE>Pardon, goddess of the night,</LINE> +<LINE>Those that slew thy virgin knight;</LINE> +<LINE>For the which, with songs of woe,</LINE> +<LINE>Round about her tomb they go.</LINE> +<LINE>Midnight, assist our moan;</LINE> +<LINE>Help us to sigh and groan,</LINE> +<LINE>Heavily, heavily:</LINE> +<LINE>Graves, yawn and yield your dead,</LINE> +<LINE>Till death be uttered,</LINE> +<LINE>Heavily, heavily.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Now, unto thy bones good night!</LINE> +<LINE>Yearly will I do this rite.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Good morrow, masters; put your torches out:</LINE> +<LINE>The wolves have prey'd; and look, the gentle day,</LINE> +<LINE>Before the wheels of Phoebus, round about</LINE> +<LINE>Dapples the drowsy east with spots of grey.</LINE> +<LINE>Thanks to you all, and leave us: fare you well.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Good morrow, masters: each his several way.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Come, let us hence, and put on other weeds;</LINE> +<LINE>And then to Leonato's we will go.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>And Hymen now with luckier issue speed's</LINE> +<LINE>Than this for whom we render'd up this woe.</LINE> +</SPEECH> + + +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> + +<SCENE><TITLE>SCENE IV. A room in LEONATO'S house.</TITLE> +<STAGEDIR>Enter LEONATO, ANTONIO, BENEDICK, BEATRICE, +MARGARET, URSULA, FRIAR FRANCIS, and HERO</STAGEDIR> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>Did I not tell you she was innocent?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>So are the prince and Claudio, who accused her</LINE> +<LINE>Upon the error that you heard debated:</LINE> +<LINE>But Margaret was in some fault for this,</LINE> +<LINE>Although against her will, as it appears</LINE> +<LINE>In the true course of all the question.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>Well, I am glad that all things sort so well.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>And so am I, being else by faith enforced</LINE> +<LINE>To call young Claudio to a reckoning for it.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Well, daughter, and you gentle-women all,</LINE> +<LINE>Withdraw into a chamber by yourselves,</LINE> +<LINE>And when I send for you, come hither mask'd.</LINE> +<STAGEDIR>Exeunt Ladies</STAGEDIR> +<LINE>The prince and Claudio promised by this hour</LINE> +<LINE>To visit me. You know your office, brother:</LINE> +<LINE>You must be father to your brother's daughter</LINE> +<LINE>And give her to young Claudio.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>Which I will do with confirm'd countenance.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Friar, I must entreat your pains, I think.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>To do what, signior?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>To bind me, or undo me; one of them.</LINE> +<LINE>Signior Leonato, truth it is, good signior,</LINE> +<LINE>Your niece regards me with an eye of favour.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>That eye my daughter lent her: 'tis most true.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>And I do with an eye of love requite her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>The sight whereof I think you had from me,</LINE> +<LINE>From Claudio and the prince: but what's your will?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Your answer, sir, is enigmatical:</LINE> +<LINE>But, for my will, my will is your good will</LINE> +<LINE>May stand with ours, this day to be conjoin'd</LINE> +<LINE>In the state of honourable marriage:</LINE> +<LINE>In which, good friar, I shall desire your help.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>My heart is with your liking.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>And my help.</LINE> +<LINE>Here comes the prince and Claudio.</LINE> +</SPEECH> + + +<STAGEDIR>Enter DON PEDRO and CLAUDIO, and two or +three others</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Good morrow to this fair assembly.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Good morrow, prince; good morrow, Claudio:</LINE> +<LINE>We here attend you. Are you yet determined</LINE> +<LINE>To-day to marry with my brother's daughter?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>I'll hold my mind, were she an Ethiope.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Call her forth, brother; here's the friar ready.</LINE> +</SPEECH> + + +<STAGEDIR>Exit ANTONIO</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>Good morrow, Benedick. Why, what's the matter,</LINE> +<LINE>That you have such a February face,</LINE> +<LINE>So full of frost, of storm and cloudiness?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>I think he thinks upon the savage bull.</LINE> +<LINE>Tush, fear not, man; we'll tip thy horns with gold</LINE> +<LINE>And all Europa shall rejoice at thee,</LINE> +<LINE>As once Europa did at lusty Jove,</LINE> +<LINE>When he would play the noble beast in love.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Bull Jove, sir, had an amiable low;</LINE> +<LINE>And some such strange bull leap'd your father's cow,</LINE> +<LINE>And got a calf in that same noble feat</LINE> +<LINE>Much like to you, for you have just his bleat.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>For this I owe you: here comes other reckonings.</LINE> +<STAGEDIR>Re-enter ANTONIO, with the Ladies masked</STAGEDIR> +<LINE>Which is the lady I must seize upon?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>ANTONIO</SPEAKER> +<LINE>This same is she, and I do give you her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Why, then she's mine. Sweet, let me see your face.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>No, that you shall not, till you take her hand</LINE> +<LINE>Before this friar and swear to marry her.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Give me your hand: before this holy friar,</LINE> +<LINE>I am your husband, if you like of me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>And when I lived, I was your other wife:</LINE> +<STAGEDIR>Unmasking</STAGEDIR> +<LINE>And when you loved, you were my other husband.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>Another Hero!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>Nothing certainer:</LINE> +<LINE>One Hero died defiled, but I do live,</LINE> +<LINE>And surely as I live, I am a maid.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>The former Hero! Hero that is dead!</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>She died, my lord, but whiles her slander lived.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>FRIAR FRANCIS</SPEAKER> +<LINE>All this amazement can I qualify:</LINE> +<LINE>When after that the holy rites are ended,</LINE> +<LINE>I'll tell you largely of fair Hero's death:</LINE> +<LINE>Meantime let wonder seem familiar,</LINE> +<LINE>And to the chapel let us presently.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Soft and fair, friar. Which is Beatrice?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE><STAGEDIR>Unmasking</STAGEDIR> I answer to that name. What is your will?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Do not you love me?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Why, no; no more than reason.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Why, then your uncle and the prince and Claudio</LINE> +<LINE>Have been deceived; they swore you did.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Do not you love me?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Troth, no; no more than reason.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>Why, then my cousin Margaret and Ursula</LINE> +<LINE>Are much deceived; for they did swear you did.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>They swore that you were almost sick for me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>They swore that you were well-nigh dead for me.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>'Tis no such matter. Then you do not love me?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>No, truly, but in friendly recompense.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>Come, cousin, I am sure you love the gentleman.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>And I'll be sworn upon't that he loves her;</LINE> +<LINE>For here's a paper written in his hand,</LINE> +<LINE>A halting sonnet of his own pure brain,</LINE> +<LINE>Fashion'd to Beatrice.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>HERO</SPEAKER> +<LINE>And here's another</LINE> +<LINE>Writ in my cousin's hand, stolen from her pocket,</LINE> +<LINE>Containing her affection unto Benedick.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>A miracle! here's our own hands against our hearts.</LINE> +<LINE>Come, I will have thee; but, by this light, I take</LINE> +<LINE>thee for pity.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BEATRICE</SPEAKER> +<LINE>I would not deny you; but, by this good day, I yield</LINE> +<LINE>upon great persuasion; and partly to save your life,</LINE> +<LINE>for I was told you were in a consumption.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Peace! I will stop your mouth.</LINE> +</SPEECH> + + +<STAGEDIR>Kissing her</STAGEDIR> + +<SPEECH> +<SPEAKER>DON PEDRO</SPEAKER> +<LINE>How dost thou, Benedick, the married man?</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>I'll tell thee what, prince; a college of</LINE> +<LINE>wit-crackers cannot flout me out of my humour. Dost</LINE> +<LINE>thou think I care for a satire or an epigram? No:</LINE> +<LINE>if a man will be beaten with brains, a' shall wear</LINE> +<LINE>nothing handsome about him. In brief, since I do</LINE> +<LINE>purpose to marry, I will think nothing to any</LINE> +<LINE>purpose that the world can say against it; and</LINE> +<LINE>therefore never flout at me for what I have said</LINE> +<LINE>against it; for man is a giddy thing, and this is my</LINE> +<LINE>conclusion. For thy part, Claudio, I did think to</LINE> +<LINE>have beaten thee, but in that thou art like to be my</LINE> +<LINE>kinsman, live unbruised and love my cousin.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>CLAUDIO</SPEAKER> +<LINE>I had well hoped thou wouldst have denied Beatrice,</LINE> +<LINE>that I might have cudgelled thee out of thy single</LINE> +<LINE>life, to make thee a double-dealer; which, out of</LINE> +<LINE>question, thou wilt be, if my cousin do not look</LINE> +<LINE>exceedingly narrowly to thee.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Come, come, we are friends: let's have a dance ere</LINE> +<LINE>we are married, that we may lighten our own hearts</LINE> +<LINE>and our wives' heels.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>LEONATO</SPEAKER> +<LINE>We'll have dancing afterward.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>First, of my word; therefore play, music. Prince,</LINE> +<LINE>thou art sad; get thee a wife, get thee a wife:</LINE> +<LINE>there is no staff more reverend than one tipped with horn.</LINE> +</SPEECH> + + +<STAGEDIR>Enter a Messenger</STAGEDIR> + +<SPEECH> +<SPEAKER>Messenger</SPEAKER> +<LINE>My lord, your brother John is ta'en in flight,</LINE> +<LINE>And brought with armed men back to Messina.</LINE> +</SPEECH> + +<SPEECH> +<SPEAKER>BENEDICK</SPEAKER> +<LINE>Think not on him till to-morrow:</LINE> +<LINE>I'll devise thee brave punishments for him.</LINE> +<LINE>Strike up, pipers.</LINE> +</SPEECH> + +<STAGEDIR>Dance</STAGEDIR> +<STAGEDIR>Exeunt</STAGEDIR> +</SCENE> +</ACT> +</PLAY> diff --git a/axiom/test/resources/xml/om/namespaces.xml b/axiom/test/resources/xml/om/namespaces.xml new file mode 100644 index 0000000..e8e4df8 --- /dev/null +++ b/axiom/test/resources/xml/om/namespaces.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<foo:a xmlns:foo="http://fooNamespace/"> + <b> + <c>Hello</c> + </b> + + <foo:d> + <foo:e>Hey</foo:e> + </foo:d> + + <bar:f xmlns:bar="http://barNamespace/"> + <bar:g>Hey2</bar:g> + </bar:f> + + <alias:x xmlns:alias="http://fooNamespace/"> + <alias:y>Hey3</alias:y> + </alias:x> +</foo:a> diff --git a/axiom/test/resources/xml/om/nitf.xml b/axiom/test/resources/xml/om/nitf.xml new file mode 100644 index 0000000..269d99e --- /dev/null +++ b/axiom/test/resources/xml/om/nitf.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<nitf> + + <!-- Example of markup of URLs (at the bottom of the story) --> + + <head> + <meta name="ap-cycle" content="AP"/> + <meta name="ap-online-code" content="1700"/> + <meta name="ap-company" content="CO:Media Metrix Inc;TS:MMXI;IG:SVC;"/> + <meta name="ap-routing" content="ENTITLEMENTS,pfONLINE,pf1700"/> + <meta name="ap-format" content="bx"/> + <meta name="ap-category" content="f"/> + <meta name="ap-selector" content="-----"/> + <meta name="ap-transref" content="V0347"/> + <docdata> + <doc-id regsrc="AP" id-string="D76UIMO80"/> + <urgency ed-urg="7"/> + <date.issue norm="20000911T185842Z"/> + <du-key key="Napster Traffic"/> + <doc.copyright holder="(AP)"/> + </docdata> + </head> + <body> + <body.head> + <hedline> + <hl1>Use of Napster Quadruples</hl1> + </hedline> + <byline>By PETER SVENSSON + <byttl>AP Business Writer</byttl> + </byline> + <distributor>The Associated Press</distributor> + <dateline> + <location>NEW YORK</location> + </dateline> + </body.head> + <body.content> + <block> + <p>Despite the uncertain legality of the Napster online music-sharing service, the number of people +using it more than quadrupled in just five months, Media Metrix said Monday.</p> + <p>That made Napster the fastest-growing software application ever recorded by the Internet research +company.</p> + <p>From 1.1 million home users in the United States in February, the first month Media Metrix +tracked the application, Napster use rocketed to 4.9 million users in July.</p> + <p>That represents 6 percent of U.S. home PC users who have modems, said Media Metrix, which pays +people to install monitoring software on their computers.</p> + <p>It estimates total usage from a panel of about 50,000 people in the United States.</p> + <p>Napster was also used at work by 887,000 people in July, Media Metrix said.</p> + <p>Napster Inc. has been sued by the recording industry for allegedly enabling copyright +infringement. The federal government weighed in on the case Friday, saying the service is not protected +under a key copyright law, as the San Mateo, Calif., company claims.</p> + <p>Bruce Ryon, head of Media Metrix's New Media Group, said Napster was used by "the full spectrum of PC users, not just the youth with time on their hands and a passion for music."</p> + <p>The Napster program allows users to copy digital music files from the hard drives of other +users over the Internet.</p> + <p>Napster Inc. said last week that 28 million people had downloaded its program. It does not reveal +its own figures for how many people actually use the software.</p> + <p>Because the program connects to the company's computers over the Internet every time +it is run, Napster Inc. can track usage exactly.</p> + <p>__</p> + <p>On the Net:</p> + <p><a href="http://www.napster.com"> +http://www.napster.com</a></p> + <p><a href="http://www.mediametrix.com"> +http://www.mediametrix.com</a></p> + </block> + </body.content> + </body> +</nitf> diff --git a/axiom/test/resources/xml/om/numbers.xml b/axiom/test/resources/xml/om/numbers.xml new file mode 100644 index 0000000..a1791cd --- /dev/null +++ b/axiom/test/resources/xml/om/numbers.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> + +<numbers> + <set> + <nr>3</nr> + <nr>24</nr> + <nr>55</nr> + <nr>11</nr> + <nr>2</nr> + <nr>-3</nr> + </set> + <set> + <nr value="66"/> + <nr value="123"/> + <nr value="55"/> + <nr value="9999"/> + </set> +</numbers> diff --git a/axiom/test/resources/xml/om/pi.xml b/axiom/test/resources/xml/om/pi.xml new file mode 100644 index 0000000..980bbf9 --- /dev/null +++ b/axiom/test/resources/xml/om/pi.xml @@ -0,0 +1,13 @@ +<?xml version="1.0"?> +<foo> + <?cheese is tasty?> + <bar> + <baz/> + <cheese/> + <baz/> + <?toast is tasty?> + <cheese/> + <baz/> + </bar> + <?cheese is gooey?> +</foo> diff --git a/axiom/test/resources/xml/om/pi2.xml b/axiom/test/resources/xml/om/pi2.xml new file mode 100644 index 0000000..46bce45 --- /dev/null +++ b/axiom/test/resources/xml/om/pi2.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<a> + <b>foo</b> + <?toc order-by="x"?> + <c>bar</c> +</a> diff --git a/axiom/test/resources/xml/om/simple.xml b/axiom/test/resources/xml/om/simple.xml new file mode 100644 index 0000000..3cff71a --- /dev/null +++ b/axiom/test/resources/xml/om/simple.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" ?> +<root><a>a</a><b>b</b><c><d>d</d></c></root> diff --git a/axiom/test/resources/xml/om/spaces.xml b/axiom/test/resources/xml/om/spaces.xml new file mode 100644 index 0000000..4c46c63 --- /dev/null +++ b/axiom/test/resources/xml/om/spaces.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<foo> + <bar>baz + <cheese id="3"/> + baz + <cheese/> + baz + </bar> + <doc><![CDATA[<foo>]]></doc> +</foo>
\ No newline at end of file diff --git a/axiom/test/resources/xml/om/test.xml b/axiom/test/resources/xml/om/test.xml new file mode 100644 index 0000000..a222795 --- /dev/null +++ b/axiom/test/resources/xml/om/test.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" ?> +<axiomc:book xmlns:axiomc="http://ws.apache.org/axis2/c/om" xmlns:isbn="urn:ISBN:0-395-74341-6" xmlns:bn="urn:BN"> + <axiomc:title><axiomc:a bn:test='attr'>Axis2C OM HOWTO</axiomc:a><isbn:number>1748491379</isbn:number></axiomc:title> + <isbn:number>1748491379</isbn:number> + <author title="Mr" name="Axitoc Oman"/> + <a> </a> + <notes> + <p xmlns="urn:w3-org-ns:HTML"> + This is vey good book on OM! + </p> + </notes> +</axiomc:book> diff --git a/axiom/test/resources/xml/om/testNamespaces.xml b/axiom/test/resources/xml/om/testNamespaces.xml new file mode 100644 index 0000000..50f7c93 --- /dev/null +++ b/axiom/test/resources/xml/om/testNamespaces.xml @@ -0,0 +1,22 @@ +<Template> + <Application1 xmlns:xplt="http://www.xxxx.com/" + xmlns:xpl="http://www.xxxx.com/" + version="3.0" + randomAttribute="foo" + > + <xpl:insertText/> + <xplt:anyElement> + <Name/> + </xplt:anyElement> + </Application1> + + <Application2 xmlns:xplt="http://www.xxxx.com/" + xmlns:xpl="http://www.xxxx.com/" + version="3.0" + > + <xpl:insertText/> + <xplt:anyElement> + <Name/> + </xplt:anyElement> + </Application2> +</Template> diff --git a/axiom/test/resources/xml/om/underscore.xml b/axiom/test/resources/xml/om/underscore.xml new file mode 100644 index 0000000..111446f --- /dev/null +++ b/axiom/test/resources/xml/om/underscore.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" ?> +<root a="1" _a="2"> + <b>1</b> + <_b>2</_b> +</root> + diff --git a/axiom/test/resources/xml/om/web.xml b/axiom/test/resources/xml/om/web.xml new file mode 100644 index 0000000..972cf5d --- /dev/null +++ b/axiom/test/resources/xml/om/web.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<web-app> + <servlet> + <servlet-name>snoop</servlet-name> + <servlet-class>SnoopServlet</servlet-class> + </servlet> + <servlet> + <servlet-name>file</servlet-name> + <servlet-class>ViewFile</servlet-class> + <init-param> + <param-name>initial</param-name> + <param-value> + 1000 + </param-value> + <description> + The initial value for the counter <!-- optional --> + </description> + </init-param> + </servlet> + <servlet-mapping> + <servlet-name> + mv + </servlet-name> + <url-pattern> + *.wm + </url-pattern> + </servlet-mapping> + + <distributed/> + + <security-role> + <role-name> + manager + </role-name> + <role-name> + director + </role-name> + <role-name> + president + </role-name> + </security-role> +</web-app> diff --git a/axiom/test/resources/xml/om/web2.xml b/axiom/test/resources/xml/om/web2.xml new file mode 100644 index 0000000..7d479d3 --- /dev/null +++ b/axiom/test/resources/xml/om/web2.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<root> + <b> + <d /> + </b> + <c /> +</root> diff --git a/axiom/test/resources/xml/soap/OMElementTest.xml b/axiom/test/resources/xml/soap/OMElementTest.xml new file mode 100644 index 0000000..9cd474c --- /dev/null +++ b/axiom/test/resources/xml/soap/OMElementTest.xml @@ -0,0 +1,22 @@ +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + <soapenv:Header> + <wsa:MessageID soapenv:mustUnderstand="0"> + uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID> + <wsa:To soapenv:mustUnderstand="0"> + http://localhost:8081/axis/services/BankPort</wsa:To> + <wsa:From soapenv:mustUnderstand="0"> + <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </wsa:From> + </soapenv:Header> + <soapenv:Body> + <axis2:echoVoid xmlns:axis2="http://ws.apache.org/axis2">This is some text + <axis2:input>2</axis2:input> + Some Other Text + </axis2:echoVoid> + </soapenv:Body> +</soapenv:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/badsoap/bodyNotQualified.xml b/axiom/test/resources/xml/soap/badsoap/bodyNotQualified.xml new file mode 100644 index 0000000..eef7895 --- /dev/null +++ b/axiom/test/resources/xml/soap/badsoap/bodyNotQualified.xml @@ -0,0 +1,19 @@ +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + <soapenv:Header> + <wsa:MessageID soapenv:mustUnderstand="0"> + uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID> + <wsa:To soapenv:mustUnderstand="0"> + http://localhost:8081/axis/services/BankPort</wsa:To> + <wsa:From soapenv:mustUnderstand="0"> + <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </wsa:From> + </soapenv:Header> + <soapenv:Body> + <echoVoid></echoVoid> + </soapenv:Body> +</soapenv:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/badsoap/envelopeMissing.xml b/axiom/test/resources/xml/soap/badsoap/envelopeMissing.xml new file mode 100644 index 0000000..4106495 --- /dev/null +++ b/axiom/test/resources/xml/soap/badsoap/envelopeMissing.xml @@ -0,0 +1,20 @@ +<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + <soapenv:Header> + <wsa:MessageID soapenv:mustUnderstand="0"> + uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID> + <wsa:To soapenv:mustUnderstand="0"> + http://localhost:8081/axis/services/BankPort</wsa:To> + <wsa:From soapenv:mustUnderstand="0"> + <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </wsa:From> + </soapenv:Header> + <soapenv:Body> + <axis2:echoVoid xmlns:axis2="http://ws.apache.org/axis2"> + </axis2:echoVoid> + </soapenv:Body> +</soapenv:Body>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/badsoap/haederBodyWrongOrder.xml b/axiom/test/resources/xml/soap/badsoap/haederBodyWrongOrder.xml new file mode 100644 index 0000000..e71c49a --- /dev/null +++ b/axiom/test/resources/xml/soap/badsoap/haederBodyWrongOrder.xml @@ -0,0 +1,20 @@ +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + <soapenv:Body> + <axis2:echoVoid xmlns:axis2="http://ws.apache.org/axis2"> + </axis2:echoVoid> + </soapenv:Body> + <soapenv:Header> + <wsa:MessageID soapenv:mustUnderstand="0"> + uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID> + <wsa:To soapenv:mustUnderstand="0"> + http://localhost:8081/axis/services/BankPort</wsa:To> + <wsa:From soapenv:mustUnderstand="0"> + <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </wsa:From> + </soapenv:Header> +</soapenv:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/badsoap/notnamespaceQualified.xml b/axiom/test/resources/xml/soap/badsoap/notnamespaceQualified.xml new file mode 100644 index 0000000..dfc013c --- /dev/null +++ b/axiom/test/resources/xml/soap/badsoap/notnamespaceQualified.xml @@ -0,0 +1,15 @@ +<Envelope> + <Header> + <MessageID mustUnderstand="0">uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5 + </MessageID> + <To mustUnderstand="0">http://localhost:8081/axis/services/BankPort</To> + <From mustUnderstand="0"> + <Address> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </From> + </Header> + <Body> + <echoVoid></echoVoid> + </Body> +</Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/badsoap/twoBodymessage.xml b/axiom/test/resources/xml/soap/badsoap/twoBodymessage.xml new file mode 100644 index 0000000..a96a401 --- /dev/null +++ b/axiom/test/resources/xml/soap/badsoap/twoBodymessage.xml @@ -0,0 +1,24 @@ +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + <soapenv:Header> + <wsa:MessageID soapenv:mustUnderstand="0"> + uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID> + <wsa:To soapenv:mustUnderstand="0"> + http://localhost:8081/axis/services/BankPort</wsa:To> + <wsa:From soapenv:mustUnderstand="0"> + <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </wsa:From> + </soapenv:Header> + <soapenv:Body> + <axis2:echoVoid xmlns:axis2="http://ws.apache.org/axis2"> + </axis2:echoVoid> + </soapenv:Body> + <soapenv:Body> + <axis2:echoVoid xmlns:axis2="http://ws.apache.org/axis2"> + </axis2:echoVoid> + </soapenv:Body> +</soapenv:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/badsoap/twoheaders.xml b/axiom/test/resources/xml/soap/badsoap/twoheaders.xml new file mode 100644 index 0000000..3064771 --- /dev/null +++ b/axiom/test/resources/xml/soap/badsoap/twoheaders.xml @@ -0,0 +1,29 @@ +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + <soapenv:Header> + <wsa:MessageID soapenv:mustUnderstand="0"> + uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID> + <wsa:To soapenv:mustUnderstand="0"> + http://localhost:8081/axis/services/BankPort</wsa:To> + <wsa:From soapenv:mustUnderstand="0"> + <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </wsa:From> + </soapenv:Header> + <soapenv:Header> + <wsa:MessageID soapenv:mustUnderstand="0"> + uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID> + <wsa:To soapenv:mustUnderstand="0"> + http://localhost:8081/axis/services/BankPort</wsa:To> + <wsa:From soapenv:mustUnderstand="0"> + <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </wsa:From> + </soapenv:Header> + <soapenv:Body> + </soapenv:Body> +</soapenv:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/badsoap/wrongSoapNs.xml b/axiom/test/resources/xml/soap/badsoap/wrongSoapNs.xml new file mode 100644 index 0000000..7d84398 --- /dev/null +++ b/axiom/test/resources/xml/soap/badsoap/wrongSoapNs.xml @@ -0,0 +1,20 @@ +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/badsoap/envelope/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + <soapenv:Header> + <wsa:MessageID soapenv:mustUnderstand="0"> + uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID> + <wsa:To soapenv:mustUnderstand="0"> + http://localhost:8081/axis/services/BankPort</wsa:To> + <wsa:From soapenv:mustUnderstand="0"> + <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </wsa:From> + </soapenv:Header> + <soapenv:Body> + <axis2:echoVoid xmlns:axis2="http://ws.apache.org/axis2"> + </axis2:echoVoid> + </soapenv:Body> +</soapenv:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/emtyBodymessage.xml b/axiom/test/resources/xml/soap/emtyBodymessage.xml new file mode 100644 index 0000000..ea20929 --- /dev/null +++ b/axiom/test/resources/xml/soap/emtyBodymessage.xml @@ -0,0 +1,18 @@ +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + <soapenv:Header> + <wsa:MessageID soapenv:mustUnderstand="0"> + uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID> + <wsa:To soapenv:mustUnderstand="0"> + http://localhost:8081/axis/services/BankPort</wsa:To> + <wsa:From soapenv:mustUnderstand="0"> + <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </wsa:From> + </soapenv:Header> + <soapenv:Body> + </soapenv:Body> +</soapenv:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/invalidMustUnderstandSOAP12.xml b/axiom/test/resources/xml/soap/invalidMustUnderstandSOAP12.xml new file mode 100644 index 0000000..1b5183f --- /dev/null +++ b/axiom/test/resources/xml/soap/invalidMustUnderstandSOAP12.xml @@ -0,0 +1,13 @@ +<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:xml="http://www.w3.org/XML/1998/namespace"> + <env:Header> + <test2:echoOk2 xmlns:test2="http://example2.org/ts-tests" + env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" + env:mustUnderstand="someOtherValue" + env:anyAttribute="any value"> + foo + </test2:echoOk2> + </env:Header> + <env:Body> + + </env:Body> +</env:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/minimalMessage.xml b/axiom/test/resources/xml/soap/minimalMessage.xml new file mode 100644 index 0000000..ea76d72 --- /dev/null +++ b/axiom/test/resources/xml/soap/minimalMessage.xml @@ -0,0 +1,4 @@ +<?xml version='1.0' ?> +<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> + <env:Body/> +</env:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/reallyReallyBigMessage.xml b/axiom/test/resources/xml/soap/reallyReallyBigMessage.xml new file mode 100644 index 0000000..687ed22 --- /dev/null +++ b/axiom/test/resources/xml/soap/reallyReallyBigMessage.xml @@ -0,0 +1,2529 @@ +<?xml version='1.0' ?> +<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + <env:Header> + + <wsdl:definitions targetNamespace="http://echo.services" + xmlns="http://schemas.xmlsoap.org/wsdl/" + xmlns:impl="http://echo.services-impl" + xmlns:intf="http://echo.services" + xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" + xmlns:tns1="http://types.echo.services" + 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 targetNamespace="http://types.echo.services" + xmlns="http://www.w3.org/2001/XMLSchema"> + <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="MyComplexType"> + <sequence> + <element name="simpleItem" nillable="true" + type="xsd:string"/> + </sequence> + </complexType> + <element name="MyElement" nillable="true" + type="tns1:MyComplexType"/> + </schema> + </wsdl:types> + <wsdl:message name="echoRequest"> + <wsdl:part element="tns1:MyElement" name="MyElement"/> + </wsdl:message> + <wsdl:message name="echoResponse"> + <wsdl:part element="tns1:MyElement" name="MyElement"/> + </wsdl:message> + <wsdl:portType name="Echo1"> + <wsdl:operation name="echo" parameterOrder="MyElement"> + <wsdl:input message="intf:echoRequest" name="echoRequest"/> + <wsdl:output message="intf:echoResponse" + name="echoResponse"/> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="ComplexEchoServiceSoapBinding" + type="intf:Echo1"> + <wsdlsoap:binding style="document" + transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="echo"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="echoRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + namespace="http://types.echo.services" + use="literal"/> + </wsdl:input> + <wsdl:output name="echoResponse"> + <wsdlsoap:body namespace="http://types.echo.services" + use="literal"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="ComplexEchoService"> + <wsdl:port binding="intf:ComplexEchoServiceSoapBinding" + name="ComplexEchoService"> + <wsdlsoap:address + location="http://localhost:8080/axis/services/ComplexEchoService"/> + </wsdl:port> + </wsdl:service> + </wsdl:definitions> + + + </env:Header> + <env:Body> + <definitions + name="comprehensive types test" + targetNamespace="urn:comprehensive-service.types.wsdl.test" + xmlns:tns="urn:comprehensive-service.types.wsdl.test" + xmlns:typens="urn:comprehensive-types.types.wsdl.test" + xmlns:typens2="urn:comprehensive-types2.types.wsdl.test" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" + xmlns="http://schemas.xmlsoap.org/wsdl/"> + + + <types> + <xsd:schema + targetNamespace="urn:comprehensive-types.types.wsdl.test" + xmlns:xsd="http://www.w3.org/1999/XMLSchema" + xmlns:xsd2="http://www.w3.org/2001/XMLSchema"> + + <xsd:simpleType name="simple"> + <xsd:restriction base="xsd:string"/> + </xsd:simpleType> + + <xsd:simpleType name="simpleDate"> + <xsd:restriction base="xsd:date"/> + </xsd:simpleType> + + <xsd:simpleType name="simpleDateTime"> + <xsd:restriction base="xsd2:dateTime"/> + </xsd:simpleType> + + <xsd:simpleType name="enum"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="one"/> + <xsd:enumeration value="two"/> + <xsd:enumeration value="three"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:complexType name="array"> + <xsd:complexContent> + <xsd:restriction base="soapenc:Array"> + <xsd:attribute ref="soapenc:arrayType" + wsdl:arrayType="xsd:string[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="array_of_base64"> + <xsd:complexContent> + <xsd:restriction base="soapenc:Array"> + <xsd:attribute ref="soapenc:arrayType" + wsdl:arrayType="xsd:base64Binary[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="complexAll"> + <xsd:all> + <xsd:element name="areaCode" type="xsd:int"/> + <xsd:element name="exchange" type="xsd:string"/> + <xsd:element name="number" type="xsd:string"/> + </xsd:all> + </xsd:complexType> + + <xsd:complexType name="complexSequence"> + <xsd:sequence> + <xsd:element name="areaCode" type="xsd:int"/> + <xsd:element name="exchange" type="xsd:string"/> + <xsd:element name="number" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + + <xsd:complexType name="complexChoice"> + <xsd:choice> + <xsd:element name="choiceA" type="xsd:int"/> + <xsd:element name="choiceB" type="xsd:string"/> + <xsd:element name="choiceC" type="xsd:string"/> + </xsd:choice> + </xsd:complexType> + + + <xsd:complexType name="Object"> + <xsd:sequence> + <xsd:element name="test" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + <xsd:complexType name="String"> + <xsd:sequence> + <xsd:element name="test" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + <xsd:complexType name="Class"> + <xsd:sequence> + <xsd:element name="test" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + + <xsd:element name="enumValue" type="typens:enum"/> + + <xsd:complexType name="time"> + <xsd:simpleContent> + <xsd:extension base="xsd:string"> + <xsd:attribute name="DST" type="xsd:boolean"/> + </xsd:extension> + </xsd:simpleContent> + </xsd:complexType> + + <xsd:complexType name="complexWComplex"> + <xsd:sequence> + <xsd:element name="stock_quote"> + <xsd:complexType> + <xsd:attribute name="symbol" + type="xsd:string"/> + <xsd:sequence> + + <xsd:element name="time" + type="typens:time"/> + <xsd:element name="change" + type="typens:simpleFwd"/> + <xsd:element name="pctchange" + type="xsd:string"/> + <xsd:element name="bid" + type="xsd:string"/> + <xsd:element name="ask" + type="xsd:string"/> + <xsd:element name="choice" + type="typens:complexChoice"/> + </xsd:sequence> + <xsd:attribute name="last" + type="xsd:string"/> + </xsd:complexType> + </xsd:element> + <xsd:element name="outside" type="xsd:int"/> + </xsd:sequence> + </xsd:complexType> + + <xsd:complexType name="emptyFault"> + <xsd:sequence/> + </xsd:complexType> + + <xsd:element name="faultElement" type="typens:faultType"/> + <xsd:complexType name="faultType"> + <xsd:sequence> + <xsd:element name="userData" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + + <xsd:complexType name="emptyComplexType"> + <xsd:sequence/> + </xsd:complexType> + + <xsd:simpleType name="simpleFwd"> + <xsd:restriction base="typens:simple"/> + </xsd:simpleType> + + + <xsd:complexType name="arrayM"> + <xsd:complexContent> + <xsd:restriction base="soapenc:Array"> + <xsd:attribute ref="soapenc:arrayType" + wsdl:arrayType="typens:arrayM2[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + <xsd:complexType name="arrayM2"> + <xsd:complexContent> + <xsd:restriction base="soapenc:Array"> + <xsd:attribute ref="soapenc:arrayType" + wsdl:arrayType="typens:arrayM3[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + <xsd:complexType name="arrayM3"> + <xsd:complexContent> + <xsd:restriction base="soapenc:Array"> + <xsd:attribute ref="soapenc:arrayType" + wsdl:arrayType="xsd:int[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + + <xsd:complexType name="Animal"> + <xsd:all> + <xsd:element name="Name" nillable="true" + type="xsd:string"/> + </xsd:all> + </xsd:complexType> + <xsd:element name="Animal" nillable="true" + type="typens:Animal"/> + <xsd:complexType name="Cat"> + <xsd:complexContent> + <xsd:extension base="typens:Animal"> + <xsd:all> + <xsd:element name="Purr" nillable="true" + type="xsd:string"/> + </xsd:all> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + <xsd:element name="Cat" nillable="true" type="typens:Cat"/> + + <xsd:complexType name="PersionCat"> + <xsd:complexContent> + <xsd:extension base="typens:Cat"> + <xsd:all> + <xsd:element name="Color" + type="xsd:string"/> + <xsd:element name="Toy"/> + </xsd:all> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="Yarn"> + <xsd:all> + <xsd:element name="Color" type="xsd:string"/> + </xsd:all> + </xsd:complexType> + + + <xsd:simpleType name="enumString"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="Ho Ho Ho"/> + <xsd:enumeration value="He He He"/> + <xsd:enumeration value="Ha Ha Ha"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="enumInt"> + <xsd:restriction base="xsd:int"> + <xsd:enumeration value="1"/> + <xsd:enumeration value="2"/> + <xsd:enumeration value="3"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="enumLong"> + <xsd:restriction base="xsd:long"> + <xsd:enumeration value="1"/> + <xsd:enumeration value="2"/> + <xsd:enumeration value="3"/> + <xsd:enumeration value="-9223372036854775808"/> + <xsd:enumeration value="9223372036854775807"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="enumShort"> + <xsd:restriction base="xsd:short"> + <xsd:enumeration value="1"/> + <xsd:enumeration value="2"/> + <xsd:enumeration value="3"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="enumFloat"> + <xsd:restriction base="xsd:float"> + <xsd:enumeration value="1.1"/> + <xsd:enumeration value="2.2"/> + <xsd:enumeration value="3.3"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="enumDouble"> + <xsd:restriction base="xsd:double"> + <xsd:enumeration value="1.1"/> + <xsd:enumeration value="2.2"/> + <xsd:enumeration value="3.3"/> + </xsd:restriction> + </xsd:simpleType> + <xsd:simpleType name="enumByte"> + <xsd:restriction base="xsd:byte"> + <xsd:enumeration value="1"/> + <xsd:enumeration value="2"/> + <xsd:enumeration value="3"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="enumInteger"> + <xsd:restriction base="xsd:integer"> + <xsd:enumeration value="1"/> + <xsd:enumeration value="2"/> + <xsd:enumeration value="3"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="flowDirectionType"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="in"/> + <xsd:enumeration value="inOut"/> + <xsd:enumeration value="out"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="enumNMTOKEN"> + <xsd:restriction base="xsd:NMTOKEN"> + <xsd:enumeration value="NameToken1"/> + <xsd:enumeration value="NameToken2"/> + <xsd:enumeration value="NameToken3"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="AIDType"> + <xsd:restriction base="xsd:hexBinary"> + <xsd:maxLength value="16"/> + <xsd:minLength value="5"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="passModeType"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="passByValue"/> + <xsd:enumeration value="passByReference"/> + </xsd:restriction> + </xsd:simpleType> + + + <xsd:element name="StringParameter" + type="typens:StringParameter"/> + <xsd:complexType name="StringParameter"> + <xsd:simpleContent> + <xsd:extension base="xsd:string"> + <xsd:attribute name="numBytes" + type="soapenc:int"/> + <xsd:attribute name="storageEncoding" + type="xsd:string"/> + <xsd:attribute name="direction" + type="typens:flowDirectionType"/> + <xsd:attribute name="passMode" + type="typens:passModeType"/> + <xsd:attribute name="description" + type="xsd:string"/> + </xsd:extension> + </xsd:simpleContent> + </xsd:complexType> + + </xsd:schema> + + + <xsd:schema + targetNamespace="urn:comprehensive-types2.types.wsdl.test" + xmlns:xsd="http://www.w3.org/1999/XMLSchema"> + <xsd:complexType name="fwd"> + <xsd:complexContent> + <xsd:restriction base="soapenc:Array"> + <xsd:attribute ref="soapenc:arrayType" + wsdl:arrayType="xsd:QName[]"/> + </xsd:restriction> + </xsd:complexContent> + </xsd:complexType> + + + <xsd:element name="three" type="typens:enum" + maxOccurs="unbounded"/> + + + <xsd:element name="a" type="xsd:short"/> + <xsd:complexType name="a"> + <xsd:sequence> + <xsd:element name="c" type="xsd:int"/> + </xsd:sequence> + </xsd:complexType> + <xsd:complexType name="b"> + <xsd:sequence> + <xsd:element name="d" type="typens2:a"/> + </xsd:sequence> + </xsd:complexType> + + + <xsd:complexType name="SimpleAnyURIType"> + <xsd:simpleContent> + <xsd:extension base="xsd:anyURI"> + </xsd:extension> + </xsd:simpleContent> + </xsd:complexType> + + </xsd:schema> + + </types> + + <message name="empty"/> + + <message name="allPrimitives"> + <part name="string" type="xsd:string"/> + <part name="integer" type="xsd:integer"/> + <part name="int" type="xsd:int"/> + <part name="long" type="xsd:long"/> + <part name="short" type="xsd:short"/> + <part name="decimal" type="xsd:decimal"/> + <part name="float" type="xsd:float"/> + <part name="double" type="xsd:double"/> + <part name="boolean" type="xsd:boolean"/> + <part name="byte" type="xsd:byte"/> + <part name="QName" type="xsd:QName"/> + <part name="dateTime" type="xsd:dateTime"/> + <part name="base64Binary" type="xsd:base64Binary"/> + <part name="hexBinary" type="xsd:hexBinary"/> + <part name="soapString" type="soapenc:string"/> + <part name="soapBoolean" type="soapenc:boolean"/> + <part name="soapFloat" type="soapenc:float"/> + <part name="soapDouble" type="soapenc:double"/> + <part name="soapDecimal" type="soapenc:decimal"/> + <part name="soapInt" type="soapenc:int"/> + <part name="soapShort" type="soapenc:short"/> + <part name="soapBase64" type="soapenc:base64"/> + <part name="time" type="xsd:time"/> + <part name="unsignedLong" type="xsd:unsignedLong"/> + <part name="unsignedInt" type="xsd:unsignedInt"/> + <part name="unsignedShort" type="xsd:unsignedShort"/> + <part name="unsignedByte" type="xsd:unsignedByte"/> + <part name="nonNegativeInteger" type="xsd:nonNegativeInteger"/> + <part name="positiveInteger" type="xsd:positiveInteger"/> + <part name="nonPositiveInteger" type="xsd:nonPositiveInteger"/> + <part name="negativeInteger" type="xsd:negativeInteger"/> + <part name="anyURI" type="xsd:anyURI"/> + <part name="gYear" type="xsd:gYear"/> + <part name="gMonth" type="xsd:gMonth"/> + <part name="gDay" type="xsd:gDay"/> + <part name="gYearMonth" type="xsd:gYearMonth"/> + <part name="gMonthDay" type="xsd:gMonthDay"/> + </message> + <message name="inputBoolean"> + <part name="inBoolean" type="xsd:boolean"/> + <part name="boolean" type="xsd:boolean"/> + </message> + + <message name="outputBoolean"> + <part name="outBoolean" type="xsd:boolean"/> + <part name="boolean" type="xsd:boolean"/> + </message> + + <message name="inputByte"> + <part name="inByte" type="xsd:byte"/> + <part name="byte" type="xsd:byte"/> + </message> + + <message name="outputByte"> + <part name="outByte" type="xsd:byte"/> + <part name="byte" type="xsd:byte"/> + </message> + + <message name="inputShort"> + <part name="inShort" type="xsd:short"/> + <part name="short" type="xsd:short"/> + </message> + + <message name="outputShort"> + <part name="outShort" type="xsd:short"/> + <part name="short" type="xsd:short"/> + </message> + + <message name="inputInt"> + <part name="inInt" type="xsd:int"/> + <part name="int" type="xsd:int"/> + </message> + + <message name="outputInt"> + <part name="outInt" type="xsd:int"/> + <part name="int" type="xsd:int"/> + </message> + + <message name="inputLong"> + <part name="inLong" type="xsd:long"/> + <part name="long" type="xsd:long"/> + </message> + + <message name="outputLong"> + <part name="outLong" type="xsd:long"/> + <part name="long" type="xsd:long"/> + </message> + + <message name="inputFloat"> + <part name="inFloat" type="xsd:float"/> + <part name="float" type="xsd:float"/> + </message> + + <message name="outputFloat"> + <part name="outFloat" type="xsd:float"/> + <part name="float" type="xsd:float"/> + </message> + + <message name="inputDouble"> + <part name="inDouble" type="xsd:double"/> + <part name="double" type="xsd:double"/> + </message> + + <message name="outputDouble"> + <part name="outDouble" type="xsd:double"/> + <part name="double" type="xsd:double"/> + </message> + + <message name="inputString"> + <part name="inString" type="xsd:string"/> + <part name="string" type="xsd:string"/> + </message> + + <message name="outputString"> + <part name="outString" type="xsd:string"/> + <part name="string" type="xsd:string"/> + </message> + + <message name="inputInteger"> + <part name="inInteger" type="xsd:integer"/> + <part name="integer" type="xsd:integer"/> + </message> + + <message name="outputInteger"> + <part name="outInteger" type="xsd:integer"/> + <part name="integer" type="xsd:integer"/> + </message> + + <message name="inputDecimal"> + <part name="inDecimal" type="xsd:decimal"/> + <part name="decimal" type="xsd:decimal"/> + </message> + + <message name="outputDecimal"> + <part name="outDecimal" type="xsd:decimal"/> + <part name="decimal" type="xsd:decimal"/> + </message> + + <message name="inputDateTime"> + <part name="inDateTime" type="xsd:dateTime"/> + <part name="dateTime" type="xsd:dateTime"/> + </message> + + <message name="outputDateTime"> + <part name="outDateTime" type="xsd:dateTime"/> + <part name="dateTime" type="xsd:dateTime"/> + </message> + + <message name="inputBase64Binary"> + <part name="inBase64Binary" type="xsd:base64Binary"/> + <part name="base64Binary" type="xsd:base64Binary"/> + </message> + + <message name="outputBase64Binary"> + <part name="outBase64Binary" type="xsd:base64Binary"/> + <part name="base64Binary" type="xsd:base64Binary"/> + </message> + + <message name="inputQName"> + <part name="inQName" type="xsd:QName"/> + <part name="qName" type="xsd:QName"/> + </message> + + <message name="outputQName"> + <part name="outQName" type="xsd:QName"/> + <part name="qName" type="xsd:QName"/> + </message> + + <message name="inputHexBinary"> + <part name="inHexBinary" type="xsd:hexBinary"/> + <part name="hexBinary" type="xsd:hexBinary"/> + </message> + + <message name="outputHexBinary"> + <part name="outHexBinary" type="xsd:hexBinary"/> + <part name="hexBinary" type="xsd:hexBinary"/> + </message> + + <message name="inputTime"> + <part name="inTime" type="xsd:time"/> + <part name="time" type="xsd:time"/> + </message> + + <message name="outputTime"> + <part name="outTime" type="xsd:time"/> + <part name="time" type="xsd:time"/> + </message> + + <message name="inputUnsignedLong"> + <part name="inUnsignedLong" type="xsd:unsignedLong"/> + <part name="unsignedLong" type="xsd:unsignedLong"/> + </message> + + <message name="outputUnsignedLong"> + <part name="outUnsignedLong" type="xsd:unsignedLong"/> + <part name="unsignedLong" type="xsd:unsignedLong"/> + </message> + + <message name="inputUnsignedInt"> + <part name="inUnsignedInt" type="xsd:unsignedInt"/> + <part name="unsignedInt" type="xsd:unsignedInt"/> + </message> + + <message name="outputUnsignedInt"> + <part name="outUnsignedInt" type="xsd:unsignedInt"/> + <part name="unsignedInt" type="xsd:unsignedInt"/> + </message> + + <message name="inputUnsignedShort"> + <part name="inUnsignedShort" type="xsd:unsignedShort"/> + <part name="unsignedShort" type="xsd:unsignedShort"/> + </message> + + <message name="outputUnsignedShort"> + <part name="outUnsignedShort" type="xsd:unsignedShort"/> + <part name="unsignedShort" type="xsd:unsignedShort"/> + </message> + + <message name="inputUnsignedByte"> + <part name="inUnsignedByte" type="xsd:unsignedByte"/> + <part name="unsignedByte" type="xsd:unsignedByte"/> + </message> + + <message name="outputUnsignedByte"> + <part name="outUnsignedByte" type="xsd:unsignedByte"/> + <part name="unsignedByte" type="xsd:unsignedByte"/> + </message> + + <message name="inputNonNegativeInteger"> + <part name="inNonNegativeInteger" + type="xsd:nonNegativeInteger"/> + <part name="NonNegativeInteger" type="xsd:nonNegativeInteger"/> + </message> + + <message name="outputNonNegativeInteger"> + <part name="outNonNegativeInteger" + type="xsd:nonNegativeInteger"/> + <part name="NonNegativeInteger" type="xsd:nonNegativeInteger"/> + </message> + + <message name="inputPositiveInteger"> + <part name="inPositiveInteger" type="xsd:positiveInteger"/> + <part name="PositiveInteger" type="xsd:positiveInteger"/> + </message> + + <message name="outputPositiveInteger"> + <part name="outPositiveInteger" type="xsd:positiveInteger"/> + <part name="PositiveInteger" type="xsd:positiveInteger"/> + </message> + + <message name="inputNonPositiveInteger"> + <part name="inNonPositiveInteger" + type="xsd:nonPositiveInteger"/> + <part name="NonPositiveInteger" type="xsd:nonPositiveInteger"/> + </message> + + <message name="outputNonPositiveInteger"> + <part name="outNonPositiveInteger" + type="xsd:nonPositiveInteger"/> + <part name="NonPositiveInteger" type="xsd:nonPositiveInteger"/> + </message> + + <message name="inputNegativeInteger"> + <part name="inNegativeInteger" type="xsd:negativeInteger"/> + <part name="NegativeInteger" type="xsd:negativeInteger"/> + </message> + + <message name="outputNegativeInteger"> + <part name="outNegativeInteger" type="xsd:negativeInteger"/> + <part name="NegativeInteger" type="xsd:negativeInteger"/> + </message> + + <message name="inputAnyURI"> + <part name="inAnyURI" type="xsd:anyURI"/> + <part name="anyURI" type="xsd:anyURI"/> + </message> + + <message name="outputAnyURI"> + <part name="outAnyURI" type="xsd:anyURI"/> + <part name="anyURI" type="xsd:anyURI"/> + </message> + + <message name="inputSimpleAnyURI"> + <part name="inAnyURI" type="typens2:SimpleAnyURIType"/> + <part name="anyURI" type="typens2:SimpleAnyURIType"/> + </message> + + <message name="outputSimpleAnyURI"> + <part name="outAnyURI" type="typens2:SimpleAnyURIType"/> + <part name="anyURI" type="typens2:SimpleAnyURIType"/> + </message> + + <message name="inputYear"> + <part name="inYear" type="xsd:gYear"/> + <part name="Year" type="xsd:gYear"/> + </message> + + <message name="outputYear"> + <part name="outYear" type="xsd:gYear"/> + <part name="Year" type="xsd:gYear"/> + </message> + + <message name="inputMonth"> + <part name="inMonth" type="xsd:gMonth"/> + <part name="Month" type="xsd:gMonth"/> + </message> + + <message name="outputMonth"> + <part name="outMonth" type="xsd:gMonth"/> + <part name="Month" type="xsd:gMonth"/> + </message> + + <message name="inputDay"> + <part name="inDay" type="xsd:gDay"/> + <part name="Day" type="xsd:gDay"/> + </message> + + <message name="outputDay"> + <part name="outDay" type="xsd:gDay"/> + <part name="Day" type="xsd:gDay"/> + </message> + + <message name="inputYearMonth"> + <part name="inYearMonth" type="xsd:gYearMonth"/> + <part name="YearMonth" type="xsd:gYearMonth"/> + </message> + + <message name="outputYearMonth"> + <part name="outYearMonth" type="xsd:gYearMonth"/> + <part name="YearMonth" type="xsd:gYearMonth"/> + </message> + + <message name="inputMonthDay"> + <part name="inMonthDay" type="xsd:gMonthDay"/> + <part name="MonthDay" type="xsd:gMonthDay"/> + </message> + + <message name="outputMonthDay"> + <part name="outMonthDay" type="xsd:gMonthDay"/> + <part name="MonthDay" type="xsd:gMonthDay"/> + </message> + + <message name="inputSoapString"> + <part name="inSoapString" type="soapenc:string"/> + <part name="soapencString" type="soapenc:string"/> + </message> + + <message name="outputSoapString"> + <part name="outSoapString" type="soapenc:string"/> + <part name="soapencString" type="soapenc:string"/> + </message> + + <message name="inputSoapBoolean"> + <part name="inSoapBoolean" type="soapenc:boolean"/> + <part name="soapencBoolean" type="soapenc:boolean"/> + </message> + + <message name="outputSoapBoolean"> + <part name="outSoapBoolean" type="soapenc:boolean"/> + <part name="soapencBoolean" type="soapenc:boolean"/> + </message> + + <message name="inputSoapFloat"> + <part name="inSoapFloat" type="soapenc:float"/> + <part name="soapencFloat" type="soapenc:float"/> + </message> + + <message name="outputSoapFloat"> + <part name="outSoapFloat" type="soapenc:float"/> + <part name="soapencFloat" type="soapenc:float"/> + </message> + + <message name="inputSoapDouble"> + <part name="inSoapDouble" type="soapenc:double"/> + <part name="soapencDouble" type="soapenc:double"/> + </message> + + <message name="outputSoapDouble"> + <part name="outSoapDouble" type="soapenc:double"/> + <part name="soapencDouble" type="soapenc:double"/> + </message> + + <message name="inputSoapDecimal"> + <part name="inSoapDecimal" type="soapenc:decimal"/> + <part name="soapencDecimal" type="soapenc:decimal"/> + </message> + + <message name="outputSoapDecimal"> + <part name="outSoapDecimal" type="soapenc:decimal"/> + <part name="soapencDecimal" type="soapenc:decimal"/> + </message> + + <message name="inputSoapInt"> + <part name="inSoapInt" type="soapenc:int"/> + <part name="soapencInt" type="soapenc:int"/> + </message> + + <message name="outputSoapInt"> + <part name="outSoapInt" type="soapenc:int"/> + <part name="soapencInt" type="soapenc:int"/> + </message> + + <message name="inputSoapShort"> + <part name="inSoapShort" type="soapenc:short"/> + <part name="soapencShort" type="soapenc:short"/> + </message> + + <message name="outputSoapShort"> + <part name="outSoapShort" type="soapenc:short"/> + <part name="soapencShort" type="soapenc:short"/> + </message> + + <message name="inputSoapBase64"> + <part name="inSoapBase64" type="soapenc:base64"/> + <part name="soapencBase64" type="soapenc:base64"/> + </message> + + <message name="outputSoapBase64"> + <part name="outSoapBase64" type="soapenc:base64"/> + <part name="soapencBase64" type="soapenc:base64"/> + </message> + + <message name="enum"> + <part name="enum" type="typens:enum"/> + </message> + + <message name="enumInt"> + <part name="enumInt" type="typens:enumInt"/> + </message> + + <message name="array"> + <part name="array" type="typens:array"/> + </message> + + <message name="arrayM"> + <part name="arrayM" type="typens:arrayM"/> + </message> + + <message name="complexAll"> + <part name="complexAll" type="typens:complexAll"/> + </message> + + <message name="complexSequence"> + <part name="complexSequence" type="typens:complexSequence"/> + </message> + + <message name="complexWComplex"> + <part name="complexWComplex" type="typens:complexWComplex"/> + </message> + + <message name="any"> + <part name="any" type="xsd:anyType"/> + </message> + + <message name="animal"> + <part name="animal" type="typens:Animal"/> + </message> + + <message name="cat"> + <part name="cat" type="typens:Cat"/> + </message> + + <message name="emptyFault"> + <part name="theFault" type="typens:emptyFault"/> + </message> + + <message name="faultWithElement"> + <part name="fault2" element="typens:faultElement"/> + </message> + + <message name="emptyComplexType"> + <part name="emptyComplexType" type="typens:emptyComplexType"/> + </message> + + + <portType name="TypeTest"> + <operation name="allPrimitivesIn"> + <input message="tns:allPrimitives"/> + <output message="tns:empty"/> + </operation> + <operation name="allPrimitivesInout"> + <input message="tns:allPrimitives"/> + <output message="tns:allPrimitives"/> + </operation> + <operation name="allPrimitivesOut"> + <input message="tns:empty"/> + <output message="tns:allPrimitives"/> + </operation> + <operation name="enumIn"> + <input message="tns:enum"/> + <output message="tns:empty"/> + </operation> + <operation name="enumInout"> + <input message="tns:enum"/> + <output message="tns:enum"/> + </operation> + <operation name="enumOut" parameterOrder="enum"> + <input message="tns:empty"/> + <output message="tns:enum"/> + </operation> + <operation name="enumReturn"> + <input message="tns:empty"/> + <output message="tns:enum"/> + </operation> + <operation name="enumIntIn"> + <input message="tns:enumInt"/> + <output message="tns:empty"/> + </operation> + <operation name="enumIntInout"> + <input message="tns:enumInt"/> + <output message="tns:enumInt"/> + </operation> + <operation name="enumIntOut" parameterOrder="enumInt"> + <input message="tns:empty"/> + <output message="tns:enumInt"/> + </operation> + <operation name="enumIntReturn"> + <input message="tns:empty"/> + <output message="tns:enumInt"/> + </operation> + <operation name="arrayIn"> + <input message="tns:array"/> + <output message="tns:empty"/> + </operation> + <operation name="arrayInout"> + <input message="tns:array"/> + <output message="tns:array"/> + </operation> + <operation name="arrayOut" parameterOrder="array"> + <input message="tns:empty"/> + <output message="tns:array"/> + </operation> + <operation name="arrayReturn"> + <input message="tns:empty"/> + <output message="tns:array"/> + </operation> + + <operation name="arrayMIn"> + <input message="tns:arrayM"/> + <output message="tns:empty"/> + </operation> + <operation name="arrayMInout"> + <input message="tns:arrayM"/> + <output message="tns:arrayM"/> + </operation> + <operation name="arrayMOut" parameterOrder="arrayM"> + <input message="tns:empty"/> + <output message="tns:arrayM"/> + </operation> + <operation name="arrayMReturn"> + <input message="tns:empty"/> + <output message="tns:arrayM"/> + </operation> + + <operation name="complexAllIn"> + <input message="tns:complexAll"/> + <output message="tns:empty"/> + </operation> + <operation name="complexAllInout"> + <input message="tns:complexAll"/> + <output message="tns:complexAll"/> + </operation> + <operation name="complexAllOut" parameterOrder="complexAll"> + <input message="tns:empty"/> + <output message="tns:complexAll"/> + </operation> + <operation name="complexAllReturn"> + <input message="tns:empty"/> + <output message="tns:complexAll"/> + </operation> + <operation name="complexSequenceIn"> + <input message="tns:complexSequence"/> + <output message="tns:empty"/> + </operation> + <operation name="complexSequenceInout"> + <input message="tns:complexSequence"/> + <output message="tns:complexSequence"/> + </operation> + <operation name="complexSequenceOut" + parameterOrder="complexSequence"> + <input message="tns:empty"/> + <output message="tns:complexSequence"/> + </operation> + <operation name="complexSequenceReturn"> + <input message="tns:empty"/> + <output message="tns:complexSequence"/> + </operation> + <operation name="complexWComplexIn"> + <input message="tns:complexWComplex"/> + <output message="tns:empty"/> + </operation> + <operation name="complexWComplexInout"> + <input message="tns:complexWComplex"/> + <output message="tns:complexWComplex"/> + </operation> + <operation name="complexWComplexOut" + parameterOrder="complexWComplex"> + <input message="tns:empty"/> + <output message="tns:complexWComplex"/> + </operation> + <operation name="complexWComplexReturn"> + <input message="tns:empty"/> + <output message="tns:complexWComplex"/> + </operation> + <operation name="emptyComplexTypeIn" + parameterOrder="emptyComplexType"> + <input message="tns:emptyComplexType"/> + <output message="tns:empty"/> + <fault name="emptyFault" message="tns:emptyFault"/> + </operation> + <operation name="emptyComplexTypeInout" + parameterOrder="emptyComplexType"> + <input message="tns:emptyComplexType"/> + <output message="tns:emptyComplexType"/> + <fault name="emptyFault" message="tns:emptyFault"/> + </operation> + <operation name="emptyComplexTypeOut" + parameterOrder="emptyComplexType"> + <input message="tns:empty"/> + <output message="tns:emptyComplexType"/> + <fault name="emptyFault" message="tns:emptyFault"/> + </operation> + <operation name="emptyComplexTypeReturn"> + <input message="tns:empty"/> + <output message="tns:emptyComplexType"/> + <fault name="emptyFault" message="tns:emptyFault"/> + </operation> + <operation name="anyIn"> + <input message="tns:any"/> + <output message="tns:empty"/> + </operation> + <operation name="anyInout"> + <input message="tns:any"/> + <output message="tns:any"/> + </operation> + <operation name="anyOut" parameterOrder="any"> + <input message="tns:empty"/> + <output message="tns:any"/> + </operation> + <operation name="anyReturn"> + <input message="tns:empty"/> + <output message="tns:any"/> + </operation> + <operation name="animalIn"> + <input message="tns:animal"/> + <output message="tns:empty"/> + </operation> + <operation name="animalInout"> + <input message="tns:animal"/> + <output message="tns:animal"/> + </operation> + <operation name="animalOut" parameterOrder="animal"> + <input message="tns:empty"/> + <output message="tns:animal"/> + </operation> + <operation name="animalReturn"> + <input message="tns:empty"/> + <output message="tns:animal"/> + </operation> + <operation name="catIn"> + <input message="tns:cat"/> + <output message="tns:empty"/> + </operation> + <operation name="catInout"> + <input message="tns:cat"/> + <output message="tns:cat"/> + </operation> + <operation name="catOut" parameterOrder="cat"> + <input message="tns:empty"/> + <output message="tns:cat"/> + </operation> + <operation name="catReturn"> + <input message="tns:empty"/> + <output message="tns:cat"/> + </operation> + <operation name="methodBoolean"> + <input message="tns:inputBoolean"/> + <output message="tns:outputBoolean"/> + </operation> + <operation name="methodByte"> + <input message="tns:inputByte"/> + <output message="tns:outputByte"/> + </operation> + <operation name="methodShort"> + <input message="tns:inputShort"/> + <output message="tns:outputShort"/> + </operation> + <operation name="methodInt"> + <input message="tns:inputInt"/> + <output message="tns:outputInt"/> + </operation> + <operation name="methodLong"> + <input message="tns:inputLong"/> + <output message="tns:outputLong"/> + </operation> + <operation name="methodFloat"> + <input message="tns:inputFloat"/> + <output message="tns:outputFloat"/> + </operation> + <operation name="methodDouble"> + <input message="tns:inputDouble"/> + <output message="tns:outputDouble"/> + </operation> + <operation name="methodString"> + <input message="tns:inputString"/> + <output message="tns:outputString"/> + </operation> + <operation name="methodInteger"> + <input message="tns:inputInteger"/> + <output message="tns:outputInteger"/> + </operation> + <operation name="methodDecimal"> + <input message="tns:inputDecimal"/> + <output message="tns:outputDecimal"/> + </operation> + <operation name="methodDateTime"> + <input message="tns:inputDateTime"/> + <output message="tns:outputDateTime"/> + </operation> + <operation name="methodQName"> + <input message="tns:inputQName"/> + <output message="tns:outputQName"/> + </operation> + <operation name="methodTime"> + <input message="tns:inputTime"/> + <output message="tns:outputTime"/> + </operation> + <operation name="methodUnsignedLong"> + <input message="tns:inputUnsignedLong"/> + <output message="tns:outputUnsignedLong"/> + </operation> + <operation name="methodUnsignedInt"> + <input message="tns:inputUnsignedInt"/> + <output message="tns:outputUnsignedInt"/> + </operation> + <operation name="methodUnsignedShort"> + <input message="tns:inputUnsignedShort"/> + <output message="tns:outputUnsignedShort"/> + </operation> + <operation name="methodUnsignedByte"> + <input message="tns:inputUnsignedByte"/> + <output message="tns:outputUnsignedByte"/> + </operation> + <operation name="methodNonNegativeInteger"> + <input message="tns:inputNonNegativeInteger"/> + <output message="tns:outputNonNegativeInteger"/> + </operation> + <operation name="methodPositiveInteger"> + <input message="tns:inputPositiveInteger"/> + <output message="tns:outputPositiveInteger"/> + </operation> + <operation name="methodNonPositiveInteger"> + <input message="tns:inputNonPositiveInteger"/> + <output message="tns:outputNonPositiveInteger"/> + </operation> + <operation name="methodNegativeInteger"> + <input message="tns:inputNegativeInteger"/> + <output message="tns:outputNegativeInteger"/> + </operation> + <operation name="methodAnyURI"> + <input message="tns:inputAnyURI"/> + <output message="tns:outputAnyURI"/> + </operation> + <operation name="methodSimpleAnyURI"> + <input message="tns:inputSimpleAnyURI"/> + <output message="tns:outputSimpleAnyURI"/> + </operation> + <operation name="methodYear"> + <input message="tns:inputYear"/> + <output message="tns:outputYear"/> + </operation> + <operation name="methodMonth"> + <input message="tns:inputMonth"/> + <output message="tns:outputMonth"/> + </operation> + <operation name="methodDay"> + <input message="tns:inputDay"/> + <output message="tns:outputDay"/> + </operation> + <operation name="methodYearMonth"> + <input message="tns:inputYearMonth"/> + <output message="tns:outputYearMonth"/> + </operation> + <operation name="methodMonthDay"> + <input message="tns:inputMonthDay"/> + <output message="tns:outputMonthDay"/> + </operation> + <operation name="methodSoapString"> + <input message="tns:inputSoapString"/> + <output message="tns:outputSoapString"/> + </operation> + <operation name="methodSoapBoolean"> + <input message="tns:inputSoapBoolean"/> + <output message="tns:outputSoapBoolean"/> + </operation> + <operation name="methodSoapFloat"> + <input message="tns:inputSoapFloat"/> + <output message="tns:outputSoapFloat"/> + </operation> + <operation name="methodSoapDouble"> + <input message="tns:inputSoapDouble"/> + <output message="tns:outputSoapDouble"/> + </operation> + <operation name="methodSoapDecimal"> + <input message="tns:inputSoapDecimal"/> + <output message="tns:outputSoapDecimal"/> + </operation> + <operation name="methodSoapInt"> + <input message="tns:inputSoapInt"/> + <output message="tns:outputSoapInt"/> + </operation> + <operation name="methodSoapShort"> + <input message="tns:inputSoapShort"/> + <output message="tns:outputSoapShort"/> + </operation> + </portType> + + + <binding name="TypeTestBinding" type="tns:TypeTest"> + <soap:binding + style="rpc" + transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="allPrimitivesIn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="allPrimitivesInout"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="allPrimitivesOut"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="enumIn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="enumInout"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="enumOut"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="enumReturn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="enumIntIn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="enumIntInout"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="enumIntOut"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="enumIntReturn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="arrayIn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="arrayInout"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="arrayOut"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="arrayReturn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + + <operation name="arrayMIn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="arrayMInout"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="arrayMOut"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="arrayMReturn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + + <operation name="complexAllIn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="complexAllInout"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="complexAllOut"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="complexAllReturn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="complexSequenceIn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="complexSequenceInout"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="complexSequenceOut"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="complexSequenceReturn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="complexWComplexIn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="complexWComplexInout"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="complexWComplexOut"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="complexWComplexReturn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="emptyComplexTypeIn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + <fault name="emptyFault"> + <soap:fault name="emptyFault" use="encoded"/> + </fault> + </operation> + <operation name="emptyComplexTypeInout"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + <fault name="emptyFault"> + <soap:fault name="emptyFault" use="encoded"/> + </fault> + </operation> + <operation name="emptyComplexTypeOut"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + <fault name="emptyFault"> + <soap:fault name="emptyFault" use="encoded"/> + </fault> + </operation> + <operation name="emptyComplexTypeReturn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + <fault name="emptyFault"> + <soap:fault name="emptyFault" use="encoded"/> + </fault> + </operation> + <operation name="anyIn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="anyInout"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="anyOut"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="anyReturn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="animalIn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="animalInout"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="animalOut"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="animalReturn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="catIn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="catInout"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="catOut"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="catReturn"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodBoolean"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodByte"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodShort"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodInt"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodLong"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodFloat"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodDouble"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodString"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodInteger"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodDecimal"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodDateTime"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodQName"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodTime"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodUnsignedLong"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodUnsignedInt"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodUnsignedShort"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodUnsignedByte"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodNonNegativeInteger"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodPositiveInteger"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodNonPositiveInteger"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodNegativeInteger"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + + <operation name="methodAnyURI"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodSimpleAnyURI"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodYear"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodMonth"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodDay"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodYearMonth"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodMonthDay"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodSoapString"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodSoapBoolean"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodSoapFloat"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodSoapDouble"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodSoapDecimal"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodSoapInt"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + <operation name="methodSoapShort"> + <soap:operation soapAction=""/> + <input> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </input> + <output> + <soap:body + use="encoded" + namespace="" + encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> + </output> + </operation> + </binding> + + + <service name="TypeTestService"> + <port name="TypeTest" binding="tns:TypeTestBinding"> + <soap:address location="http://localhost:8080/axis/services/TypeTest"/> + </port> + </service> + + </definitions> + + </env:Body> +</env:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/sample1.txt b/axiom/test/resources/xml/soap/sample1.txt new file mode 100644 index 0000000..a5f7560 --- /dev/null +++ b/axiom/test/resources/xml/soap/sample1.txt @@ -0,0 +1,12 @@ +POST /axis/services/EchoService HTTP/1.1 +Host: 127.0.0.1 +Content-Type: application/soap+xml; charset="utf-8" + +<?xml version='1.0' ?> +<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> + <env:Header> + </env:Header> + <env:Body> + <axis2:echoVoid xmlns:axis2="http://ws.apache.org/axis2" ></axis2:echoVoid> + </env:Body> +</env:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/sample1.xml b/axiom/test/resources/xml/soap/sample1.xml new file mode 100644 index 0000000..9d74dfe --- /dev/null +++ b/axiom/test/resources/xml/soap/sample1.xml @@ -0,0 +1,9 @@ +<?xml version='1.0' ?> +<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> + <env:Header> + </env:Header> + <env:Body> + <axis2:echoVoid xmlns:axis2="http://ws.apache.org/axis2"> + </axis2:echoVoid> + </env:Body> +</env:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/security2-soap.xml b/axiom/test/resources/xml/soap/security2-soap.xml new file mode 100644 index 0000000..4d6c272 --- /dev/null +++ b/axiom/test/resources/xml/soap/security2-soap.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:ds="http://www.w3.org/2000/09/xmldsig#" + xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext" + xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"> + <S:Header> + <m:path xmlns:m="http://schemas.xmlsoap.org/rp"> + <m:action>http://fabrikam123.com/getQuote</m:action> + <m:to>http://fabrikam123.com/stocks</m:to> + <m:from>mailto:johnsmith@fabrikam123.com</m:from> + <m:id>uuid:84b9f5d0-33fb-4a81-b02b-5b760641c1d6</m:id> + </m:path> + <wsse:Security> + <wsse:BinarySecurityToken + ValueType="wsse:X509v3" + EncodingType="wsse:Base64Binary" + Id="X509Token"> + MIIEZzCCA9CgAwIBAgIQEmtJZc0rqrKh5i... + </wsse:BinarySecurityToken> + <ds:Signature> + <ds:SignedInfo> + <ds:CanonicalizationMethod Algorithm= + "http://www.w3.org/2001/10/xml-exc-c14n#"/> + <ds:SignatureMethod Algorithm= + "http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> + <ds:Reference> + <ds:Transforms> + <ds:Transform Algorithm= + "http://...#RoutingTransform"/> + <ds:Transform Algorithm= + "http://www.w3.org/2001/10/xml-exc-c14n#"/> + </ds:Transforms> + <ds:DigestMethod Algorithm= + "http://www.w3.org/2000/09/xmldsig#sha1"/> + <ds:DigestValue>EULddytSo1...</ds:DigestValue> + </ds:Reference> + </ds:SignedInfo> + <ds:SignatureValue> + BL8jdfToEb1l/vXcMZNNjPOV... + </ds:SignatureValue> + <ds:KeyInfo> + <wsse:SecurityTokenReference> + <wsse:Reference URI="#X509Token"/> + </wsse:SecurityTokenReference> + </ds:KeyInfo> + </ds:Signature> + </wsse:Security> + </S:Header> + <S:Body> + <tru:StockSymbol xmlns:tru="http://fabrikam123.com/payloads"> + QQQ + </tru:StockSymbol> + </S:Body> +</S:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/soap11/soap11fault.xml b/axiom/test/resources/xml/soap/soap11/soap11fault.xml new file mode 100644 index 0000000..c9acd34 --- /dev/null +++ b/axiom/test/resources/xml/soap/soap11/soap11fault.xml @@ -0,0 +1,16 @@ + <SOAP-ENV:Envelope + xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> + <SOAP-ENV:Header> + <TestHeader>Test</TestHeader> + </SOAP-ENV:Header> + <SOAP-ENV:Body> + <SOAP-ENV:Fault> + <faultcode>SOAP-ENV:MustUnderstand</faultcode> + <faultstring>SOAP Must Understand Error</faultstring> + <faultactor>Actor</faultactor> + <detail>Detail text + <SomeElement>Some Element Text</SomeElement> + </detail> + </SOAP-ENV:Fault> + </SOAP-ENV:Body> + </SOAP-ENV:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/soap11/soap11message.xml b/axiom/test/resources/xml/soap/soap11/soap11message.xml new file mode 100644 index 0000000..8a0b231 --- /dev/null +++ b/axiom/test/resources/xml/soap/soap11/soap11message.xml @@ -0,0 +1,46 @@ +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + <soapenv:Header> + <wsa:From soapenv:mustUnderstand="0" + soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"> + <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </wsa:From> + <test:MessageID xmlns:test="http://example.org/ts-tests" + soapenv:mustUnderstand="1" + soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" + soapenv:anyAttribute="any value"> + uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5 + </test:MessageID> + <wsa:To soapenv:mustUnderstand="0" + soapenv:anyAttribute="any value"> + http://localhost:8081/axis/services/BankPort + </wsa:To> + </soapenv:Header> + <soapenv:Body> + <soapenv:Fault> + <soapenv:faultcode> + env:Sender + </soapenv:faultcode> + <soapenv:faultstring>Sender Timeout</soapenv:faultstring> + <soapenv:faultactor> + http://schemas.xmlsoap.org/soap/envelope/actor/ultimateReceiver + </soapenv:faultactor> + <soapenv:detail xmlns:m="http://www.sample.org"> + Details of error + <m:MaxTime m:detail="This is only a test"> + P5M + </m:MaxTime> + <m:AveTime> + <m:Time> + P3M + </m:Time> + </m:AveTime> + </soapenv:detail> + </soapenv:Fault> + </soapenv:Body> +</soapenv:Envelope> + diff --git a/axiom/test/resources/xml/soap/soap12message.xml b/axiom/test/resources/xml/soap/soap12message.xml new file mode 100644 index 0000000..5830e6c --- /dev/null +++ b/axiom/test/resources/xml/soap/soap12message.xml @@ -0,0 +1,58 @@ +<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:xml="http://www.w3.org/XML/1998/namespace"> + <env:Header> + <test:echoOk xmlns:test="http://example.org/ts-tests" + env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" + env:mustUnderstand="true" + env:anyAttribute="any value"> + foo + </test:echoOk> + <test1:echoOk1 xmlns:test1="http://example1.org/ts-tests" + env:role="http://www.w3.org/2003/05/soap-envelope/role/next" + env:mustUnderstand="false" + env:anyAttribute="any value"> + foo + </test1:echoOk1> + <test2:echoOk2 xmlns:test2="http://example2.org/ts-tests" + env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" + env:mustUnderstand="1" + env:anyAttribute="any value"> + foo + </test2:echoOk2> + </env:Header> + <env:Body> + <env:Fault> + <env:Code> + <env:Value>env:Sender</env:Value> + <env:Subcode> + <env:Value>m:MessageTimeout In First Subcode</env:Value> + <env:Subcode> + <env:Value>m:MessageTimeout In Second Subcode</env:Value> + <env:Subcode> + <env:Value>m:MessageTimeout In Third Subcode</env:Value> + </env:Subcode> + </env:Subcode> + </env:Subcode> + </env:Code> + <env:Reason> + <env:Text xml:lang="en">Sender Timeout</env:Text> + </env:Reason> + <env:Node> + http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver + </env:Node> + <env:Role> + ultimateReceiver + </env:Role> + <env:Detail xmlns:m="http:www.sample.org"> + Details of error + <m:MaxTime m:detail="This is only a test"> + P5M\n + </m:MaxTime> + <m:AveTime> + <m:Time> + P3M\n + </m:Time> + </m:AveTime> + </env:Detail> + </env:Fault> + </env:Body> +</env:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/soapmessage.txt b/axiom/test/resources/xml/soap/soapmessage.txt new file mode 100644 index 0000000..acae3b5 --- /dev/null +++ b/axiom/test/resources/xml/soap/soapmessage.txt @@ -0,0 +1,16 @@ +POST /axis/services/EchoService HTTP/1.1
+Host: 127.0.0.1
+Content-Type: application/soap+xml; charset="utf-8"
+
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+ <soapenv:Header>
+ <wsa:MessageID soapenv:mustUnderstand="0">uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID>
+ <wsa:To soapenv:mustUnderstand="0">http://localhost:8081/axis/services/BankPort</wsa:To>
+ <wsa:From soapenv:mustUnderstand="0">
+ <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing">http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</Address>
+ </wsa:From>
+ </soapenv:Header>
+ <soapenv:Body>
+ <axis2:echoVoid xmlns:axis2="http://ws.apache.org/axis2" ></axis2:echoVoid>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/soapmessage.xml b/axiom/test/resources/xml/soap/soapmessage.xml new file mode 100644 index 0000000..0f49778 --- /dev/null +++ b/axiom/test/resources/xml/soap/soapmessage.xml @@ -0,0 +1,20 @@ +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + <soapenv:Header> + <wsa:MessageID soapenv:mustUnderstand="0"> + uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID> + <wsa:To soapenv:mustUnderstand="0"> + http://localhost:8081/axis/services/BankPort</wsa:To> + <wsa:From soapenv:mustUnderstand="0"> + <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </wsa:From> + </soapenv:Header> + <soapenv:Body> + <axis2:echoVoid xmlns:axis2="http://ws.apache.org/axis2"> + </axis2:echoVoid> + </soapenv:Body> +</soapenv:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/soapmessage1.xml b/axiom/test/resources/xml/soap/soapmessage1.xml new file mode 100644 index 0000000..3d69585 --- /dev/null +++ b/axiom/test/resources/xml/soap/soapmessage1.xml @@ -0,0 +1,27 @@ +<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + <soapenv:Header> + <wsa:MessageID soapenv:mustUnderstand="0"> + uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID> + <wsa:To soapenv:mustUnderstand="0"> + http://localhost:8081/axis/services/BankPort</wsa:To> + <wsa:From soapenv:mustUnderstand="0"> + <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </wsa:From> + </soapenv:Header> + <soapenv:Body> + <ns1:getBalance soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + xmlns:ns1="http://localhost:8081/axis/services/BankPort"> + <ns1:accountNo href="#id0"/> + </ns1:getBalance> + <multiRef xmlns="tempUri" id="id0" soapenc:root="0" + soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" + xsi:type="xsd:int" + xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1001 + </multiRef> + </soapenv:Body> +</soapenv:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/test.xml b/axiom/test/resources/xml/soap/test.xml new file mode 100644 index 0000000..3a303d4 --- /dev/null +++ b/axiom/test/resources/xml/soap/test.xml @@ -0,0 +1,59 @@ +<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:xml="http://www.w3.org/XML/1998/namespace"> + <env:Header> + <test:echoOk xmlns:test="http://example.org/ts-tests" + env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" + env:mustUnderstand="true" + env:anyAttribute="any value"> + foo + </test:echoOk> + <test1:echoOk1 xmlns:test1="http://example1.org/ts-tests" + env:role="http://www.w3.org/2003/05/soap-envelope/role/next" + env:mustUnderstand="false" + env:anyAttribute="any value"> + foo + </test1:echoOk1> + <test2:echoOk2 xmlns:test2="http://example2.org/ts-tests" + env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" + env:mustUnderstand="1" + env:anyAttribute="any value"> + foo + </test2:echoOk2> + </env:Header> + <env:Body> + <env:Fault> + <env:Code> + <env:Value>env:Sender</env:Value> + <env:Subcode> + <env:Value>m:MessageTimeout In First Subcode</env:Value> + <env:Subcode> + <env:Value>m:MessageTimeout In Second Subcode</env:Value> + <env:Subcode> + <env:Value>m:MessageTimeout In Third Subcode</env:Value> + </env:Subcode> + </env:Subcode> + </env:Subcode> + </env:Code> + <env:Reason> + <env:Text xml:lang="en">Sender Timeout</env:Text> + </env:Reason> + <env:Node> + http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver + </env:Node> + <env:Role> + ultimateReceiver + </env:Role> + <env:Detail xmlns:m="http:www.sample.org"> + Details of error + <m:MaxTime m:detail="This is only a test"> + P5M\n + </m:MaxTime> + <m:AveTime> + <m:Time> + P3M\n + </m:Time> + </m:AveTime> + </env:Detail> + </env:Fault> + </env:Body> +</env:Envelope> + diff --git a/axiom/test/resources/xml/soap/whitespacedMessage.xml b/axiom/test/resources/xml/soap/whitespacedMessage.xml new file mode 100644 index 0000000..0af632b --- /dev/null +++ b/axiom/test/resources/xml/soap/whitespacedMessage.xml @@ -0,0 +1,27 @@ +<?xml version='1.0' ?> +<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + + <env:Header> + + + <wsa:MessageID env:mustUnderstand="0"> + uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID> + <wsa:To env:mustUnderstand="0"> + http://localhost:8081/axis/services/BankPort</wsa:To> + <wsa:From env:mustUnderstand="0"> + <Address xmlns="http://schemas.xmlsoap.org/ws/2004/03/addressing"> + http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous + </Address> + </wsa:From> + + </env:Header> + <env:Body> + + + <axis2:echoVoid xmlns:axis2="http://ws.apache.org/axis2"> + </axis2:echoVoid> + + + </env:Body> +</env:Envelope>
\ No newline at end of file diff --git a/axiom/test/resources/xml/soap/wrongEnvelopeNamespace.xml b/axiom/test/resources/xml/soap/wrongEnvelopeNamespace.xml new file mode 100644 index 0000000..ff81835 --- /dev/null +++ b/axiom/test/resources/xml/soap/wrongEnvelopeNamespace.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<soap:Envelope +xmlns:soap="http://www.w3.org/2001/12/soap-envelope" +soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> + + <soap:Body xmlns:m="http://www.stock.org/stock"> + <m:GetStockPrice> + <m:StockName>IBM</m:StockName> + </m:GetStockPrice> + </soap:Body> + +</soap:Envelope>
\ No newline at end of file diff --git a/axiom/test/soap/Makefile.am b/axiom/test/soap/Makefile.am new file mode 100644 index 0000000..fdf79a0 --- /dev/null +++ b/axiom/test/soap/Makefile.am @@ -0,0 +1,13 @@ +TESTS = test_soap +noinst_PROGRAMS = test_soap +check_PROGRAMS = test_soap +SUBDIRS = +AM_CFLAGS = -g -O2 -pthread +test_soap_SOURCES = test_soap.c + +test_soap_LDADD = ../../../util/src/libaxutil.la \ + $(top_builddir)/src/om/libaxis2_axiom.la + +INCLUDES = -I$(top_builddir)/include \ + -I$(top_builddir)/src/parser \ + -I ../../../util/include diff --git a/axiom/test/soap/test_soap.c b/axiom/test/soap/test_soap.c new file mode 100644 index 0000000..13f90e6 --- /dev/null +++ b/axiom/test/soap/test_soap.c @@ -0,0 +1,550 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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_stax_builder.h> +#include <axiom_document.h> +#include <axiom_node.h> +#include <axiom_element.h> +#include <axiom_text.h> +#include <axutil_stream.h> +#include <axutil_log_default.h> +#include <axutil_error_default.h> +#include <axiom_xml_reader.h> +#include <stdio.h> +#include <axiom_xml_writer.h> +#include <axiom_soap_builder.h> +#include <axiom_soap_const.h> +#include <axiom_soap_envelope.h> +#include <axiom_soap_body.h> +#include <axiom_soap_header.h> +#include <axiom_soap_header_block.h> +#include <axiom_soap_fault.h> +#include <axiom_soap_fault_code.h> +#include <axiom_soap_fault_role.h> +#include <axiom_soap_fault_value.h> +#include <axiom_soap_fault_detail.h> +#include <axiom_soap_fault_role.h> +#include <axiom_soap_fault_node.h> + +FILE *f = NULL; +int +read_soap( + char *buffer, + int size, + void *ctx) +{ + int len = 0; + char *pos = NULL; + len = fread(buffer, sizeof(char), size, f); + if (buffer) + pos = strstr(buffer, "---"); + if (pos) + { + len = pos - buffer; + *pos = '\0'; + } + printf("buffer = %s\n", buffer); + return len; +} + +/*int read_soap(char *buffer, int size, void *ctx) +{ + return fread(buffer, sizeof(char), size, f); +}*/ + +int +close_soap( + void *ctx) +{ + fclose(f); + return AXIS2_TRUE; +} + +int +printnode( + axiom_node_t * om_node, + const axutil_env_t * env) +{ + axiom_element_t *om_ele = NULL; + axis2_char_t *localname = NULL; + axiom_namespace_t *om_ns = NULL; + axis2_char_t *uri = NULL; + axis2_char_t *prefix = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + if (!om_node) + return AXIS2_FAILURE; + + if (axiom_node_get_node_type(om_node, env) == AXIOM_ELEMENT) + { + om_ele = (axiom_element_t *) axiom_node_get_data_element(om_node, env); + if (!om_ele) + return AXIS2_FAILURE; + + localname = axiom_element_get_localname(om_ele, env); + if (localname) + printf("\n %s \n", localname); + om_ns = axiom_element_get_namespace(om_ele, env, om_node); + + if (om_ns) + { + prefix = axiom_namespace_get_prefix(om_ns, env); + uri = axiom_namespace_get_uri(om_ns, env); + + printf("\n uri %s \n prefix %s \n", uri, prefix); + } + } + return 0; +} + +int +build_soap( + const axutil_env_t * env, + const char *filename, + const axis2_char_t * uri) +{ + axiom_stax_builder_t *om_builder = NULL; + + axiom_xml_reader_t *xml_reader = NULL; + + axiom_soap_builder_t *soap_builder = NULL; + axiom_soap_envelope_t *soap_envelope = NULL; + + axiom_node_t *om_node = NULL; + axis2_char_t *buffer = NULL; + + axiom_xml_writer_t *xml_writer = NULL; + axiom_output_t *om_output = NULL; + + axiom_soap_body_t *soap_body = NULL; + axiom_soap_header_t *soap_header = NULL; + axiom_children_qname_iterator_t *children_iter = NULL; + + int status = AXIS2_SUCCESS; + + if (!filename) + return -1; + f = fopen(filename, "r"); + if (!f) + return -1; + printf(" \n\n _________ Test SOAP BUILD ___________ \n\n "); + + xml_reader = + axiom_xml_reader_create_for_io(env, read_soap, close_soap, NULL, NULL); + if (!xml_reader) + { + printf("%s \n", axutil_error_get_message(env->error)); + return AXIS2_FAILURE; + } + + om_builder = axiom_stax_builder_create(env, xml_reader); + if (!om_builder) + { + axiom_xml_reader_free(xml_reader, env); + printf("%s \n", axutil_error_get_message(env->error)); + return AXIS2_FAILURE; + } + + soap_builder = axiom_soap_builder_create(env, om_builder, uri); + if (!soap_builder) + { + printf("%s \n", axutil_error_get_message(env->error)); + return AXIS2_FAILURE; + } + soap_envelope = axiom_soap_builder_get_soap_envelope(soap_builder, env); + if (!soap_envelope) + { + axiom_soap_builder_free(soap_builder, env); + printf("%s \n", axutil_error_get_message(env->error)); + return AXIS2_FAILURE; + } + + om_node = axiom_soap_envelope_get_base_node(soap_envelope, env); + + if (om_node) + printnode(om_node, env); + + soap_header = axiom_soap_envelope_get_header(soap_envelope, env); + if (soap_header) + { + om_node = axiom_soap_header_get_base_node(soap_header, env); + if (om_node) + printnode(om_node, env); + + children_iter = + axiom_soap_header_examine_all_header_blocks(soap_header, env); + if (children_iter) + { + /*while (axiom_children_iterator_has_next(children_iter, env)) + { + om_node = axiom_children_iterator_next(children_iter, env); + if (om_node) + printnode(om_node, env); + } */ + } + } + + soap_body = axiom_soap_envelope_get_body(soap_envelope, env); + if (soap_body) + { + if (axiom_soap_body_has_fault(soap_body, env)); + printf("axiom_soap_body_has_fault\n"); + om_node = axiom_soap_body_get_base_node(soap_body, env); + if (om_node) + printnode(om_node, env); + else + printf("\n\n soap body base node null \n\n"); + } + else + { + printf("%s \n", axutil_error_get_message(env->error)); + printf("\n\n ERROR soap_body NULL.\n\n"); + return AXIS2_FAILURE; + } + + if (axiom_soap_body_has_fault(soap_body, env)) + { + printf("\n\nsoap body has a fault element\n\n\n "); + } + + om_node = axiom_soap_body_get_base_node(soap_body, env); + if (om_node) + { + while (!(axiom_node_is_complete(om_node, env))) + { + status = axiom_soap_builder_next(soap_builder, env); + if (status == AXIS2_FAILURE) + { + printf("failure %s", axutil_error_get_message(env->error)); + return AXIS2_FAILURE; + } + } + } + + xml_writer = + axiom_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE, + AXIS2_XML_PARSER_TYPE_BUFFER); + if (!xml_writer) + { + axiom_soap_builder_free(soap_builder, env); + return AXIS2_FAILURE; + } + + om_output = axiom_output_create(env, xml_writer); + if (!om_output) + { + axiom_soap_builder_free(soap_builder, env); + axiom_xml_writer_free(xml_writer, env); + return AXIS2_FAILURE; + } + + axiom_soap_envelope_serialize(soap_envelope, env, om_output, AXIS2_FALSE); + + buffer = (axis2_char_t *) axiom_xml_writer_get_xml(xml_writer, env); + + printf("\n\nThe serialized xml is >>>>>>>>>>>>>\n\n\n%s \n\n\n", buffer); + + if (buffer) + AXIS2_FREE(env->allocator, buffer); + + axiom_soap_envelope_free(soap_envelope, env); + + printf(" \n __________ END TEST SOAP BUILD ____________ \n"); + + return AXIS2_SUCCESS; +} + +int +build_soap_programatically( + const axutil_env_t * env) +{ + axiom_soap_envelope_t *soap_envelope = NULL; + axiom_soap_body_t *soap_body = NULL; + axiom_soap_header_t *soap_header = NULL; + axiom_soap_fault_t *soap_fault = NULL; + axiom_soap_fault_code_t *fault_code = NULL; + axiom_soap_header_block_t *hb1 = NULL; + + axiom_namespace_t *env_ns = NULL; + axiom_namespace_t *test_ns = NULL; + axiom_namespace_t *role_ns = NULL; + + axiom_xml_writer_t *xml_writer = NULL; + axiom_output_t *om_output = NULL; + + axis2_char_t *buffer = NULL; + axiom_node_t *hb_node = NULL; + axiom_element_t *hb_ele = NULL; + + printf(" \n ____________ BUILD SOAP PROGRAMATICALLY _______________ \n"); + + env_ns = + axiom_namespace_create(env, "http://www.w3.org/2003/05/soap-envelope", + "env"); + if (!env_ns) + return AXIS2_FAILURE; + + soap_envelope = axiom_soap_envelope_create(env, env_ns); + if (!soap_envelope) + return AXIS2_FAILURE; + + soap_header = axiom_soap_header_create_with_parent(env, soap_envelope); + if (!soap_header) + return AXIS2_FAILURE; + + test_ns = + axiom_namespace_create(env, "http://example.org/ts-tests", "test"); + + role_ns = + axiom_namespace_create(env, + "http://www.w3.org/2003/05/soap-envelope/role/next", + "role"); + + hb1 = + axiom_soap_header_block_create_with_parent(env, "echoOk", role_ns, + soap_header); + + hb_node = axiom_soap_header_block_get_base_node(hb1, env); + + hb_ele = axiom_node_get_data_element(hb_node, env); + + axiom_element_set_namespace(hb_ele, env, test_ns, hb_node); + + soap_body = axiom_soap_body_create_with_parent(env, soap_envelope); + + soap_fault = axiom_soap_fault_create_with_parent(env, soap_body); + + fault_code = axiom_soap_fault_code_create_with_parent(env, soap_fault); + + 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_soap_envelope_serialize(soap_envelope, env, om_output, AXIS2_FALSE); + + buffer = (axis2_char_t *) axiom_xml_writer_get_xml(xml_writer, env); + + printf("%s \n", buffer); + + axiom_soap_envelope_free(soap_envelope, env); + + AXIS2_FREE(env->allocator, buffer); + + buffer = NULL; + + axiom_output_free(om_output, env); + + printf("\n __________ END BUILD SOAP PROGRAMATICALLY ____________\n"); + + return AXIS2_SUCCESS; +} + +int +create_soap_fault( + const axutil_env_t * env) +{ + axiom_soap_envelope_t *soap_envelope = NULL; + axiom_soap_body_t *soap_body = NULL; + axiom_soap_fault_t *soap_fault = NULL; + axiom_xml_writer_t *xml_writer = NULL; + axiom_output_t *om_output = NULL; + axis2_char_t *buffer = NULL; + axis2_char_t *exception_text = NULL; + axis2_status_t status = 0; + + soap_envelope = + axiom_soap_envelope_create_default_soap_fault_envelope(env, + "Fault Code", + "Fault Reason", + AXIOM_SOAP11, + NULL, NULL); + soap_body = axiom_soap_envelope_get_body(soap_envelope, env); + soap_fault = axiom_soap_body_get_fault(soap_body, env); + + axiom_soap_fault_detail_create_with_parent(env, soap_fault); + axiom_soap_fault_role_create_with_parent(env, soap_fault); + 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_soap_envelope_serialize(soap_envelope, env, om_output, AXIS2_FALSE); + buffer = (axis2_char_t *) axiom_xml_writer_get_xml(xml_writer, env); + printf("\n Testing Create soap fault \n %s \n", buffer); + + status = axiom_soap_fault_set_exception(soap_fault, env, "MyNewException"); + exception_text = axiom_soap_fault_get_exception(soap_fault, env); + + printf(" Testing soap fault set exception \n"); + printf("Actual = %s Expected = %s |", exception_text, "MyNewException"); + if (status && (0 == strcmp(exception_text, "MyNewException"))) + printf("SUCCESS\n"); + else + printf("FAILURE\n"); + + axiom_soap_envelope_free(soap_envelope, env); + axiom_output_free(om_output, env); + return 0; +} + +int +create_soap_fault_with_exception( + const axutil_env_t * env) +{ + axiom_soap_envelope_t *soap_envelope = NULL; + axiom_soap_body_t *soap_body = NULL; + axiom_soap_fault_t *soap_fault = NULL; + axiom_xml_writer_t *xml_writer = NULL; + axiom_output_t *om_output = NULL; + axis2_char_t *exception_text = NULL; + + soap_envelope = + axiom_soap_envelope_create_default_soap_fault_envelope(env, + "Fault Code", + "Fault Reason", + AXIOM_SOAP11, + NULL, NULL); + soap_body = axiom_soap_envelope_get_body(soap_envelope, env); + soap_fault = + axiom_soap_fault_create_with_exception(env, soap_body, "MyException"); + + axiom_soap_fault_detail_create_with_parent(env, soap_fault); + axiom_soap_fault_role_create_with_parent(env, soap_fault); + 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_soap_envelope_serialize(soap_envelope, env, om_output, AXIS2_FALSE); + + exception_text = axiom_soap_fault_get_exception(soap_fault, env); + printf(" Testing Create soap fault with exception \n"); + printf("Actual = %s Expected = %s |", exception_text, "MyException"); + if (0 == strcmp(exception_text, "MyException")) + printf("SUCCESS\n"); + else + printf("FAILURE\n"); + + axiom_soap_envelope_free(soap_envelope, env); + axiom_output_free(om_output, env); + return 0; +} + +int +test_soap_fault_node( + const axutil_env_t * env) +{ + axiom_soap_envelope_t *soap_envelope = NULL; + axiom_soap_body_t *soap_body = NULL; + axiom_soap_fault_t *soap_fault = NULL; + axis2_char_t *node_text = NULL; + axiom_soap_fault_node_t *fault_node = NULL; + axis2_status_t status = 0; + + printf("Testing soap fault node \n"); + soap_envelope = + axiom_soap_envelope_create_default_soap_fault_envelope(env, + "env:Receiver", + "Something went wrong!", + AXIOM_SOAP12, + NULL, NULL); + soap_body = axiom_soap_envelope_get_body(soap_envelope, env); + soap_fault = axiom_soap_body_get_fault(soap_body, env); + + fault_node = axiom_soap_fault_node_create_with_parent(env, soap_fault); + status = axiom_soap_fault_node_set_value(fault_node, env, "MyFaultNode"); + node_text = axiom_soap_fault_node_get_value(fault_node, env); + + printf("Actual = %s Expected = %s |", node_text, "MyFaultNode"); + if (0 == strcmp(node_text, "MyFaultNode")) + printf("SUCCESS\n"); + else + printf("FAILURE\n"); + axiom_soap_envelope_free(soap_envelope, env); + return 0; +} + +int +test_soap_fault_value( + const axutil_env_t * env) +{ + axiom_soap_envelope_t *soap_envelope = NULL; + axiom_soap_body_t *soap_body = NULL; + axiom_soap_fault_t *soap_fault = NULL; + axiom_soap_fault_code_t *soap_code = NULL; + axiom_soap_fault_value_t *value = NULL; + axis2_char_t *value_text = NULL; + + printf("TEST SOAP FAULT VALUE\n"); + soap_envelope = + axiom_soap_envelope_create_default_soap_fault_envelope(env, + "env:Receiver", + "Something went wrong!", + AXIOM_SOAP12, + NULL, NULL); + soap_body = axiom_soap_envelope_get_body(soap_envelope, env); + soap_fault = axiom_soap_body_get_fault(soap_body, env); + soap_code = axiom_soap_fault_get_code(soap_fault, env); + value = axiom_soap_fault_code_get_value(soap_code, env); + value_text = axiom_soap_fault_value_get_text(value, env); + + printf("Actual = %s Expected = %s |", value_text, "env:Receiver"); + if (0 == strcmp(value_text, "env:Receiver")) + printf("SUCCESS\n"); + else + printf("FAILURE\n"); + + axiom_soap_envelope_free(soap_envelope, env); + return 0; +} + +int +main( + int argc, + char *argv[]) +{ + axutil_env_t *env = NULL; + axutil_allocator_t *allocator = NULL; + axutil_error_t *error = NULL; + axutil_log_t *log = NULL; + const axis2_char_t *uri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI; + const char *filename = "../resources/xml/soap/test.xml"; + if (argc > 1) + filename = argv[1]; + if (argc > 2) + { + if (axutil_strcmp(argv[2], "0") == 0) + uri = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI; + else if (axutil_strcmp(argv[2], "1") == 0) + uri = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI; + } + allocator = axutil_allocator_init(NULL); + log = axutil_log_create(allocator, NULL, "test_soap.log"); + log->level = AXIS2_LOG_LEVEL_DEBUG; + error = axutil_error_create(allocator); + env = axutil_env_create_with_error_log(allocator, error, log); + + axutil_error_init(); + /*build_soap_programatically(env); */ + build_soap(env, filename, uri); + create_soap_fault(env); + create_soap_fault_with_exception(env); + test_soap_fault_node(env); + test_soap_fault_value(env); + axutil_env_free(env); + return 0; +} diff --git a/axiom/test/util/Makefile.am b/axiom/test/util/Makefile.am new file mode 100644 index 0000000..df0fd11 --- /dev/null +++ b/axiom/test/util/Makefile.am @@ -0,0 +1,8 @@ +noinst_PROGRAMS = axiom +axiom_SOURCES = axiom_util_test.c +axiom_LDADD = \ + $(top_builddir)/src/om/libaxis2_axiom.la + +INCLUDES = -I$(top_builddir)/include \ + -I ../../../util/include \ + -I ../../../include diff --git a/axiom/test/util/axiom_util_test.c b/axiom/test/util/axiom_util_test.c new file mode 100644 index 0000000..38f44f4 --- /dev/null +++ b/axiom/test/util/axiom_util_test.c @@ -0,0 +1,168 @@ +#include <axutil_uri.h> +#include <axiom_util.h> +#include <axiom.h> +#include <axis2_util.h> +#include <axiom_node.h> +#include "../../../util/test/util/create_env.h" + FILE *f = NULL; + axiom_node_t *node = NULL; + axiom_node_t *child = NULL; + axiom_types_t node_type; + axiom_node_t *first_node = NULL; + axiom_element_t *my_ele = NULL; + axiom_element_t *first_element = NULL; + axis2_char_t *uri = "http://www.develop.com/student"; + const axutil_uri_t * uri1 = NULL; + axiom_node_t *last_child = NULL; + axiom_element_t *localname_last_child = NULL; + axiom_element_t *localname_next_sibling = NULL; + axiom_element_t *uri_localname_first_child = NULL; + axiom_element_t *uri_localname_last_child = NULL; + axiom_element_t *uri_localname_next_sibling = NULL; + axiom_element_t *localname_first_child = NULL; + axis2_char_t *localname = NULL; + axiom_element_t *data_element = NULL; + axiom_element_t *next_sibling = NULL; + axiom_namespace_t *ns = NULL; + axiom_element_t *last_element = NULL; + axutil_qname_t *qname = NULL; + axis2_char_t *attr_name = NULL; + axiom_attribute_t *attr = NULL; + axis2_char_t *attr_value = NULL; + axiom_element_t *localname_attr_first_child = NULL; + axiom_element_t *localname_attr_last_child = NULL; + axiom_element_t *localname_attr_next_sibling = NULL; + axiom_child_element_iterator_t * child_element = NULL; + axis2_char_t * localpart = "type"; + axis2_char_t *child_node_text = NULL; + axis2_char_t *node_namespace_uri = NULL; + axiom_document_t * new_document = NULL; + axutil_array_list_t * names; + axiom_node_t *parent = NULL; + axis2_char_t * target = NULL; + axis2_char_t * value = NULL; + axiom_node_t *temp_node = NULL; + axiom_xml_reader_t *xml_reader = NULL; +int read_input_callback(char *buffer, int size, void* ctx) +{ + return fread(buffer, sizeof(char), size, f); +} +int close_input_callback(void *ctx) +{ + return fclose(f); +} +axis2_status_t build_and_serialize_om(axutil_env_t *env) +{ + axiom_node_t *root_node = NULL; + + axiom_element_t *root_ele = NULL; + axiom_document_t *document = NULL; + axiom_stax_builder_t *om_builder = NULL; + + f = fopen("test.xml","r"); + xml_reader = axiom_xml_reader_create_for_io(env, read_input_callback, close_input_callback, NULL, NULL); + if(!xml_reader) + return -1; + + om_builder = axiom_stax_builder_create(env, xml_reader); + if(!om_builder) + { + axiom_xml_reader_free(xml_reader, env); + return AXIS2_FAILURE; + } + + document = axiom_stax_builder_get_document(om_builder, env); + if(!document) + { + axiom_stax_builder_free(om_builder, env); + return AXIS2_FAILURE; + } + + root_node = axiom_document_get_root_element(document, env); + + if(!root_node) + { + axiom_stax_builder_free(om_builder, env); + return AXIS2_FAILURE; + } + if(root_node) + { + if(axiom_node_get_node_type(root_node, env) == AXIOM_ELEMENT) + { + root_ele = (axiom_element_t*)axiom_node_get_data_element(root_node, env); + if(root_ele) + { + printf(" %s is the root element \n" ,axiom_element_get_localname(root_ele, env)); + } + } + } + + axiom_document_build_all(document, env); + child = axiom_node_get_first_child(root_node, env); + printf ("%s\n", axiom_node_to_string (child, env)); + node = axiom_node_get_next_sibling(child, env); + temp_node = axiom_node_get_next_sibling (node, env); + child = axiom_node_get_first_child(node, env); + printf (" %s\n", axiom_node_to_string (temp_node, env)); + node_type = axiom_node_get_node_type(child,env); + data_element =(axiom_element_t*)axiom_node_get_data_element(child,env); + last_child = axiom_node_get_last_child(temp_node,env); + ns = axiom_element_get_namespace((axiom_element_t*)axiom_node_get_data_element(root_node,env), env, root_node); + printf("\nThe namespace = %s\n", axiom_namespace_to_string(ns,env)); + uri = axiom_namespace_get_uri(ns,env); + axiom_util_get_next_siblng_element_with_localnames(my_ele,env,node,names,&child); + axiom_util_get_last_child_element_with_localnames(my_ele,env,node,names,&child); + my_ele = axiom_util_get_first_child_element_with_uri(root_node,env,uri,&child); + axiom_util_get_first_child_element_with_localnames(my_ele,env,node,names,&child); + child = axiom_node_get_last_child(node, env); + axiom_util_new_document(env,uri1); + printf("\nmy_ele = "); + printf("%s\n ",axiom_element_to_string(my_ele,env,child)); + first_element = axiom_util_get_first_child_element(my_ele,env,child,&child); + printf("The first element = %s\n",axiom_element_to_string(first_element,env,node)); + last_element = axiom_util_get_last_child_element(my_ele,env,root_node,&child); + localname = axiom_element_get_localname(my_ele,env); + localname_last_child = axiom_util_get_last_child_element_with_localname(my_ele,env,root_node,localname,&child); + localname_next_sibling = axiom_util_get_next_siblng_element_with_localname(my_ele,env,root_node,localname,&child); + uri_localname_first_child = axiom_util_get_first_child_element_with_uri_localname(my_ele,env,root_node,localname,uri,&child); + uri_localname_last_child = axiom_util_get_last_child_element_with_uri_localname(my_ele,env,root_node,localname,uri,&child); + uri_localname_next_sibling = axiom_util_get_next_sibling_element_with_uri_localname(my_ele,env,root_node,localname,uri,&child); + qname = axutil_qname_create(env,localpart, NULL, NULL); + printf("The qname is "); + printf("%s",axutil_qname_to_string(qname,env)); + printf("\nThe localname is "); + printf("%s\n", axiom_element_get_localname(my_ele, env)); + attr = axiom_element_get_attribute(my_ele,env,qname); + attr_name = axiom_attribute_get_localname(attr,env); + attr_value = axiom_element_get_attribute_value(my_ele,env,qname); + localname_attr_first_child = axiom_util_get_first_child_element_with_localname_attr(my_ele,env,root_node,localname,attr_name,attr_value,&child); + localname_attr_last_child = axiom_util_get_last_child_element_with_localname_attr(my_ele,env,root_node,localname,attr_name,attr_value,&child); + localname_attr_next_sibling = axiom_util_get_next_siblng_element_with_localname_attr(my_ele,env,root_node,localname,attr_name,attr_value,&child); + axiom_util_get_child_node_text(node,env); + node_namespace_uri = axiom_util_get_node_namespace_uri(node,env); + child_element = axiom_util_get_child_elements(my_ele,env,node); + printf("%s\n",axiom_element_to_string(localname_attr_next_sibling,env,node)); + printf("%s\n","test is SUCCESS"); + return AXIS2_SUCCESS; +} + +int main() +{ + int status = AXIS2_SUCCESS; + axutil_env_t *env = NULL; + status = build_and_serialize_om(env); + + if(status == AXIS2_FAILURE) + { + printf(" build AXIOM failed"); + } + + axutil_env_free(env); + return 0; +} + + + + + + diff --git a/axiom/test/util/build.sh b/axiom/test/util/build.sh new file mode 100644 index 0000000..f3b3dd2 --- /dev/null +++ b/axiom/test/util/build.sh @@ -0,0 +1,2 @@ +#!/bin/bash +gcc axiom_util_test.c ../../../util/test/util/create_env.c -g -I$AXIS2C_HOME/include/axis2-1.2 -L$AXIS2C_HOME/lib -laxutil -laxis2_axiom -laxis2_parser -o axiom diff --git a/axiom/test/util/test.xml b/axiom/test/util/test.xml new file mode 100644 index 0000000..0b87a31 --- /dev/null +++ b/axiom/test/util/test.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<d:student type="student" xmlns:d='http://www.develop.com/student'> + <d:id type="student">3235329</d:id> + <d:name type="student">Jeff Smith</d:name> + <d:language type="student">C#</d:language> + <d:rating type="student">9.5</d:rating> +</d:student> diff --git a/axiom/test/xpath/Makefile.am b/axiom/test/xpath/Makefile.am new file mode 100644 index 0000000..ed70ed6 --- /dev/null +++ b/axiom/test/xpath/Makefile.am @@ -0,0 +1,20 @@ +TESTS = +noinst_PROGRAMS = test_xpath test_xpath_streaming +check_PROGRAMS = test_xpath test_xpath_streaming +SUBDIRS = +test_xpath_SOURCES = test_xpath.c + +test_xpath_streaming_SOURCES = test_xpath_streaming.c + +test_xpath_LDADD = ../../../util/src/libaxutil.la \ + $(top_builddir)/src/om/libaxis2_axiom.la \ + $(top_builddir)/src/xpath/libaxis2_xpath.la + +test_xpath_streaming_LDADD = ../../../util/src/libaxutil.la \ + $(top_builddir)/src/om/libaxis2_axiom.la \ + $(top_builddir)/src/xpath/libaxis2_xpath.la + +INCLUDES = -I$(top_builddir)/include \ + -I$(top_builddir)/src/parser \ + -I ../../../include \ + -I ../../../util/include diff --git a/axiom/test/xpath/results.txt b/axiom/test/xpath/results.txt new file mode 100644 index 0000000..10c7385 --- /dev/null +++ b/axiom/test/xpath/results.txt @@ -0,0 +1,616 @@ + +"<child>20<grandchild>20</grandchild></child>" +"<child>19<grandchild>19</grandchild></child>" +"<child>18<grandchild>18</grandchild></child>" +"<child>17<grandchild>17</grandchild></child>" +"<child>16<grandchild>16</grandchild></child>" +"<child>15<grandchild>15</grandchild></child>" +"<child>14<grandchild>14</grandchild></child>" +"<child>13<grandchild>13</grandchild></child>" +"<child>12<grandchild>12</grandchild></child>" +"<child>11<grandchild>11</grandchild></child>" +"<child>10<grandchild>10</grandchild></child>" +"<child>9<grandchild>9</grandchild></child>" +"<child>8<grandchild>8</grandchild></child>" +"<child>7<grandchild>7</grandchild></child>" +"<child>6<grandchild>6</grandchild></child>" +"<child>5<grandchild>5</grandchild></child>" +"<child>4<grandchild>4</grandchild></child>" +"<child>3<grandchild>3</grandchild></child>" +"<child>2<grandchild>2</grandchild></child>" +"<child>1<grandchild>1</grandchild></child>" +"<child>20<grandchild>20</grandchild></child>" +"<child>19<grandchild>19</grandchild></child>" +"<child>18<grandchild>18</grandchild></child>" +"<child>17<grandchild>17</grandchild></child>" +"<child>16<grandchild>16</grandchild></child>" +"<child>15<grandchild>15</grandchild></child>" +"<child>14<grandchild>14</grandchild></child>" +"<child>13<grandchild>13</grandchild></child>" +"<child>12<grandchild>12</grandchild></child>" +"<child>11<grandchild>11</grandchild></child>" +"<child>10<grandchild>10</grandchild></child>" +"<child>9<grandchild>9</grandchild></child>" +"<child>8<grandchild>8</grandchild></child>" +"<child>7<grandchild>7</grandchild></child>" +"<child>6<grandchild>6</grandchild></child>" +"<child>5<grandchild>5</grandchild></child>" +"<child>4<grandchild>4</grandchild></child>" +"<child xmlns:ns44="http://xpath/testsasd">3<grandchild>3</grandchild></child>" +"<child>2<grandchild>2</grandchild></child>" +"<child>1<grandchild>1</grandchild></child>" +# +"40.000000" +# +"<child>5<grandchild>5</grandchild></child>" +# +"<child>20<grandchild>20</grandchild></child>" +"<child>19<grandchild>19</grandchild></child>" +"<child>18<grandchild>18</grandchild></child>" +"<child>17<grandchild>17</grandchild></child>" +"<child>16<grandchild>16</grandchild></child>" +"<child>15<grandchild>15</grandchild></child>" +"<child>14<grandchild>14</grandchild></child>" +"<child>13<grandchild>13</grandchild></child>" +"<child>12<grandchild>12</grandchild></child>" +"<child>11<grandchild>11</grandchild></child>" +"<child>10<grandchild>10</grandchild></child>" +"<child>9<grandchild>9</grandchild></child>" +"<child>8<grandchild>8</grandchild></child>" +"<child>7<grandchild>7</grandchild></child>" +"<child>6<grandchild>6</grandchild></child>" +"<child>5<grandchild>5</grandchild></child>" +"<child>4<grandchild>4</grandchild></child>" +"<child>3<grandchild>3</grandchild></child>" +"<child>2<grandchild>2</grandchild></child>" +"<child>1<grandchild>1</grandchild></child>" +"<child>20<grandchild>20</grandchild></child>" +"<child>19<grandchild>19</grandchild></child>" +"<child>18<grandchild>18</grandchild></child>" +"<child>17<grandchild>17</grandchild></child>" +"<child>16<grandchild>16</grandchild></child>" +"<child>15<grandchild>15</grandchild></child>" +"<child>14<grandchild>14</grandchild></child>" +"<child>13<grandchild>13</grandchild></child>" +"<child>12<grandchild>12</grandchild></child>" +"<child>11<grandchild>11</grandchild></child>" +"<child>10<grandchild>10</grandchild></child>" +"<child>9<grandchild>9</grandchild></child>" +"<child>8<grandchild>8</grandchild></child>" +"<child>7<grandchild>7</grandchild></child>" +"<child>6<grandchild>6</grandchild></child>" +"<child>5<grandchild>5</grandchild></child>" +"<child>4<grandchild>4</grandchild></child>" +"<child xmlns:ns44="http://xpath/testsasd">3<grandchild>3</grandchild></child>" +"<child>2<grandchild>2</grandchild></child>" +"<child>1<grandchild>1</grandchild></child>" +# +"<test xmlns:ns1="http://xpath/test"> + + <ns1:node1 attr1="attribute_value_1" xmlns:nsx="http://xpath/test">10</ns1:node1> + + <ns1:node2> + <child>1<grandchild>1</grandchild></child> + <child>2<grandchild>2</grandchild></child> + <child xmlns:ns44="http://xpath/testsasd">3<grandchild>3</grandchild></child> + <child>4<grandchild>4</grandchild></child> + <child>5<grandchild>5</grandchild></child> + <child>6<grandchild>6</grandchild></child> + <child>7<grandchild>7</grandchild></child> + <child>8<grandchild>8</grandchild></child> + <child>9<grandchild>9</grandchild></child> + <child>10<grandchild>10</grandchild></child> + <child>11<grandchild>11</grandchild></child> + <child>12<grandchild>12</grandchild></child> + <child>13<grandchild>13</grandchild></child> + <child>14<grandchild>14</grandchild></child> + <child>15<grandchild>15</grandchild></child> + <child>16<grandchild>16</grandchild></child> + <child>17<grandchild>17</grandchild></child> + <child>18<grandchild>18</grandchild></child> + <child>19<grandchild>19</grandchild></child> + <child>20<grandchild>20</grandchild></child> + </ns1:node2> + + <node1 attr1="attribute_value_2" xmlns:nsp="http://xpath/test">5</node1> + + <node2> + <child>1<grandchild>1</grandchild></child> + <child>2<grandchild>2</grandchild></child> + <child>3<grandchild>3</grandchild></child> + <child>4<grandchild>4</grandchild></child> + <child>5<grandchild>5</grandchild></child> + <child>6<grandchild>6</grandchild></child> + <child>7<grandchild>7</grandchild></child> + <child>8<grandchild>8</grandchild></child> + <child>9<grandchild>9</grandchild></child> + <child>10<grandchild>10</grandchild></child> + <child>11<grandchild>11</grandchild></child> + <child>12<grandchild>12</grandchild></child> + <child>13<grandchild>13</grandchild></child> + <child>14<grandchild>14</grandchild></child> + <child>15<grandchild>15</grandchild></child> + <child>16<grandchild>16</grandchild></child> + <child>17<grandchild>17</grandchild></child> + <child>18<grandchild>18</grandchild></child> + <child>19<grandchild>19</grandchild></child> + <child>20<grandchild>20</grandchild></child> + </node2> + +</test>" +# +"<test xmlns:ns1="http://xpath/test"> + + <ns1:node1 attr1="attribute_value_1" xmlns:nsx="http://xpath/test">10</ns1:node1> + + <ns1:node2> + <child>1<grandchild>1</grandchild></child> + <child>2<grandchild>2</grandchild></child> + <child xmlns:ns44="http://xpath/testsasd">3<grandchild>3</grandchild></child> + <child>4<grandchild>4</grandchild></child> + <child>5<grandchild>5</grandchild></child> + <child>6<grandchild>6</grandchild></child> + <child>7<grandchild>7</grandchild></child> + <child>8<grandchild>8</grandchild></child> + <child>9<grandchild>9</grandchild></child> + <child>10<grandchild>10</grandchild></child> + <child>11<grandchild>11</grandchild></child> + <child>12<grandchild>12</grandchild></child> + <child>13<grandchild>13</grandchild></child> + <child>14<grandchild>14</grandchild></child> + <child>15<grandchild>15</grandchild></child> + <child>16<grandchild>16</grandchild></child> + <child>17<grandchild>17</grandchild></child> + <child>18<grandchild>18</grandchild></child> + <child>19<grandchild>19</grandchild></child> + <child>20<grandchild>20</grandchild></child> + </ns1:node2> + + <node1 attr1="attribute_value_2" xmlns:nsp="http://xpath/test">5</node1> + + <node2> + <child>1<grandchild>1</grandchild></child> + <child>2<grandchild>2</grandchild></child> + <child>3<grandchild>3</grandchild></child> + <child>4<grandchild>4</grandchild></child> + <child>5<grandchild>5</grandchild></child> + <child>6<grandchild>6</grandchild></child> + <child>7<grandchild>7</grandchild></child> + <child>8<grandchild>8</grandchild></child> + <child>9<grandchild>9</grandchild></child> + <child>10<grandchild>10</grandchild></child> + <child>11<grandchild>11</grandchild></child> + <child>12<grandchild>12</grandchild></child> + <child>13<grandchild>13</grandchild></child> + <child>14<grandchild>14</grandchild></child> + <child>15<grandchild>15</grandchild></child> + <child>16<grandchild>16</grandchild></child> + <child>17<grandchild>17</grandchild></child> + <child>18<grandchild>18</grandchild></child> + <child>19<grandchild>19</grandchild></child> + <child>20<grandchild>20</grandchild></child> + </node2> + +</test>" +"<node2> + <child>1<grandchild>1</grandchild></child> + <child>2<grandchild>2</grandchild></child> + <child>3<grandchild>3</grandchild></child> + <child>4<grandchild>4</grandchild></child> + <child>5<grandchild>5</grandchild></child> + <child>6<grandchild>6</grandchild></child> + <child>7<grandchild>7</grandchild></child> + <child>8<grandchild>8</grandchild></child> + <child>9<grandchild>9</grandchild></child> + <child>10<grandchild>10</grandchild></child> + <child>11<grandchild>11</grandchild></child> + <child>12<grandchild>12</grandchild></child> + <child>13<grandchild>13</grandchild></child> + <child>14<grandchild>14</grandchild></child> + <child>15<grandchild>15</grandchild></child> + <child>16<grandchild>16</grandchild></child> + <child>17<grandchild>17</grandchild></child> + <child>18<grandchild>18</grandchild></child> + <child>19<grandchild>19</grandchild></child> + <child>20<grandchild>20</grandchild></child> + </node2>" +"<child>3<grandchild>3</grandchild></child>" +# +"<child>20<grandchild>20</grandchild></child>" +"<child>19<grandchild>19</grandchild></child>" +"<child>18<grandchild>18</grandchild></child>" +"<child>17<grandchild>17</grandchild></child>" +"<child>16<grandchild>16</grandchild></child>" +"<child>15<grandchild>15</grandchild></child>" +"<child>14<grandchild>14</grandchild></child>" +"<child>13<grandchild>13</grandchild></child>" +"<child>12<grandchild>12</grandchild></child>" +"<child>11<grandchild>11</grandchild></child>" +"<child>10<grandchild>10</grandchild></child>" +"<child>9<grandchild>9</grandchild></child>" +"<child>8<grandchild>8</grandchild></child>" +"<child>7<grandchild>7</grandchild></child>" +"<child>6<grandchild>6</grandchild></child>" +"<child>5<grandchild>5</grandchild></child>" +"<child>4<grandchild>4</grandchild></child>" +# +"<child>1<grandchild>1</grandchild></child>" +"<child>2<grandchild>2</grandchild></child>" +# +"<grandchild>20</grandchild>" +"<child>20<grandchild>20</grandchild></child>" +"<grandchild>19</grandchild>" +"<child>19<grandchild>19</grandchild></child>" +"<grandchild>18</grandchild>" +"<child>18<grandchild>18</grandchild></child>" +"<grandchild>17</grandchild>" +"<child>17<grandchild>17</grandchild></child>" +"<grandchild>16</grandchild>" +"<child>16<grandchild>16</grandchild></child>" +"<grandchild>15</grandchild>" +"<child>15<grandchild>15</grandchild></child>" +"<grandchild>14</grandchild>" +"<child>14<grandchild>14</grandchild></child>" +"<grandchild>13</grandchild>" +"<child>13<grandchild>13</grandchild></child>" +"<grandchild>12</grandchild>" +"<child>12<grandchild>12</grandchild></child>" +"<grandchild>11</grandchild>" +"<child>11<grandchild>11</grandchild></child>" +"<grandchild>10</grandchild>" +"<child>10<grandchild>10</grandchild></child>" +"<grandchild>9</grandchild>" +"<child>9<grandchild>9</grandchild></child>" +"<grandchild>8</grandchild>" +"<child>8<grandchild>8</grandchild></child>" +"<grandchild>7</grandchild>" +"<child>7<grandchild>7</grandchild></child>" +"<grandchild>6</grandchild>" +"<child>6<grandchild>6</grandchild></child>" +"<grandchild>5</grandchild>" +"<child>5<grandchild>5</grandchild></child>" +"<grandchild>4</grandchild>" +"<child>4<grandchild>4</grandchild></child>" +"<grandchild>20</grandchild>" +"<child>20<grandchild>20</grandchild></child>" +"<grandchild>19</grandchild>" +"<child>19<grandchild>19</grandchild></child>" +"<grandchild>18</grandchild>" +"<child>18<grandchild>18</grandchild></child>" +"<grandchild>17</grandchild>" +"<child>17<grandchild>17</grandchild></child>" +"<grandchild>16</grandchild>" +"<child>16<grandchild>16</grandchild></child>" +"<grandchild>15</grandchild>" +"<child>15<grandchild>15</grandchild></child>" +"<grandchild>14</grandchild>" +"<child>14<grandchild>14</grandchild></child>" +"<grandchild>13</grandchild>" +"<child>13<grandchild>13</grandchild></child>" +"<grandchild>12</grandchild>" +"<child>12<grandchild>12</grandchild></child>" +"<grandchild>11</grandchild>" +"<child>11<grandchild>11</grandchild></child>" +"<grandchild>10</grandchild>" +"<child>10<grandchild>10</grandchild></child>" +"<grandchild>9</grandchild>" +"<child>9<grandchild>9</grandchild></child>" +"<grandchild>8</grandchild>" +"<child>8<grandchild>8</grandchild></child>" +"<grandchild>7</grandchild>" +"<child>7<grandchild>7</grandchild></child>" +"<grandchild>6</grandchild>" +"<child>6<grandchild>6</grandchild></child>" +"<grandchild>5</grandchild>" +"<child>5<grandchild>5</grandchild></child>" +"<grandchild>4</grandchild>" +"<child>4<grandchild>4</grandchild></child>" +# +"<ns1:node1 xmlns:ns1="http://xpath/test" attr1="attribute_value_1" xmlns:nsx="http://xpath/test">10</ns1:node1>" +"<grandchild>1</grandchild>" +"<child>1<grandchild>1</grandchild></child>" +"<grandchild>2</grandchild>" +"<child>2<grandchild>2</grandchild></child>" +"<grandchild>3</grandchild>" +"<child xmlns:ns44="http://xpath/testsasd">3<grandchild>3</grandchild></child>" +"<grandchild>4</grandchild>" +"<child>4<grandchild>4</grandchild></child>" +"<grandchild>5</grandchild>" +"<child>5<grandchild>5</grandchild></child>" +"<grandchild>6</grandchild>" +"<child>6<grandchild>6</grandchild></child>" +"<grandchild>7</grandchild>" +"<child>7<grandchild>7</grandchild></child>" +"<grandchild>8</grandchild>" +"<child>8<grandchild>8</grandchild></child>" +"<grandchild>9</grandchild>" +"<child>9<grandchild>9</grandchild></child>" +"<grandchild>10</grandchild>" +"<child>10<grandchild>10</grandchild></child>" +"<grandchild>11</grandchild>" +"<child>11<grandchild>11</grandchild></child>" +"<grandchild>12</grandchild>" +"<child>12<grandchild>12</grandchild></child>" +"<grandchild>13</grandchild>" +"<child>13<grandchild>13</grandchild></child>" +"<grandchild>14</grandchild>" +"<child>14<grandchild>14</grandchild></child>" +"<grandchild>15</grandchild>" +"<child>15<grandchild>15</grandchild></child>" +"<grandchild>16</grandchild>" +"<child>16<grandchild>16</grandchild></child>" +"<grandchild>17</grandchild>" +"<child>17<grandchild>17</grandchild></child>" +"<grandchild>18</grandchild>" +"<child>18<grandchild>18</grandchild></child>" +"<grandchild>19</grandchild>" +"<child>19<grandchild>19</grandchild></child>" +"<grandchild>20</grandchild>" +"<child>20<grandchild>20</grandchild></child>" +"<ns1:node2 xmlns:ns1="http://xpath/test"> + <child>1<grandchild>1</grandchild></child> + <child>2<grandchild>2</grandchild></child> + <child xmlns:ns44="http://xpath/testsasd">3<grandchild>3</grandchild></child> + <child>4<grandchild>4</grandchild></child> + <child>5<grandchild>5</grandchild></child> + <child>6<grandchild>6</grandchild></child> + <child>7<grandchild>7</grandchild></child> + <child>8<grandchild>8</grandchild></child> + <child>9<grandchild>9</grandchild></child> + <child>10<grandchild>10</grandchild></child> + <child>11<grandchild>11</grandchild></child> + <child>12<grandchild>12</grandchild></child> + <child>13<grandchild>13</grandchild></child> + <child>14<grandchild>14</grandchild></child> + <child>15<grandchild>15</grandchild></child> + <child>16<grandchild>16</grandchild></child> + <child>17<grandchild>17</grandchild></child> + <child>18<grandchild>18</grandchild></child> + <child>19<grandchild>19</grandchild></child> + <child>20<grandchild>20</grandchild></child> + </ns1:node2>" +"<node1 attr1="attribute_value_2" xmlns:nsp="http://xpath/test">5</node1>" +"<grandchild>1</grandchild>" +"<child>1<grandchild>1</grandchild></child>" +"<grandchild>2</grandchild>" +"<child>2<grandchild>2</grandchild></child>" +# +attr1 = "attribute_value_2" +attr1 = "attribute_value_1" +# +nsp = "http://xpath/test" +nsx = "http://xpath/test" +# +"<node1 attr1="attribute_value_2" xmlns:nsp="http://xpath/test">5</node1>" +# +"<child>20<grandchild>20</grandchild></child>" +"<child>19<grandchild>19</grandchild></child>" +"<child>18<grandchild>18</grandchild></child>" +"<child>17<grandchild>17</grandchild></child>" +"<child>16<grandchild>16</grandchild></child>" +"<child>15<grandchild>15</grandchild></child>" +"<child>14<grandchild>14</grandchild></child>" +"<child>13<grandchild>13</grandchild></child>" +"<child>12<grandchild>12</grandchild></child>" +"<child>11<grandchild>11</grandchild></child>" +"<child>10<grandchild>10</grandchild></child>" +"<child>9<grandchild>9</grandchild></child>" +"<child>8<grandchild>8</grandchild></child>" +"<child>7<grandchild>7</grandchild></child>" +"<child>6<grandchild>6</grandchild></child>" +"<child>5<grandchild>5</grandchild></child>" +"<child>4<grandchild>4</grandchild></child>" +"<child>3<grandchild>3</grandchild></child>" +"<child>2<grandchild>2</grandchild></child>" +"<child>1<grandchild>1</grandchild></child>" +"<child>20<grandchild>20</grandchild></child>" +"<child>19<grandchild>19</grandchild></child>" +"<child>18<grandchild>18</grandchild></child>" +"<child>17<grandchild>17</grandchild></child>" +"<child>16<grandchild>16</grandchild></child>" +"<child>15<grandchild>15</grandchild></child>" +"<child>14<grandchild>14</grandchild></child>" +"<child>13<grandchild>13</grandchild></child>" +"<child>12<grandchild>12</grandchild></child>" +"<child>11<grandchild>11</grandchild></child>" +"<child>10<grandchild>10</grandchild></child>" +"<child>9<grandchild>9</grandchild></child>" +"<child>8<grandchild>8</grandchild></child>" +"<child>7<grandchild>7</grandchild></child>" +"<child>6<grandchild>6</grandchild></child>" +"<child>5<grandchild>5</grandchild></child>" +"<child>4<grandchild>4</grandchild></child>" +"<child xmlns:ns44="http://xpath/testsasd">3<grandchild>3</grandchild></child>" +"<child>2<grandchild>2</grandchild></child>" +"<child>1<grandchild>1</grandchild></child>" +# +"<child>4<grandchild>4</grandchild></child>" +# +"<grandchild>20</grandchild>" +"<grandchild>19</grandchild>" +"<grandchild>18</grandchild>" +"<grandchild>17</grandchild>" +"<grandchild>16</grandchild>" +"<grandchild>15</grandchild>" +"<grandchild>14</grandchild>" +"<grandchild>13</grandchild>" +"<grandchild>12</grandchild>" +"<grandchild>11</grandchild>" +"<grandchild>10</grandchild>" +"<grandchild>9</grandchild>" +"<grandchild>8</grandchild>" +"<grandchild>7</grandchild>" +"<grandchild>6</grandchild>" +"<grandchild>5</grandchild>" +"<grandchild>4</grandchild>" +"<grandchild>3</grandchild>" +"<grandchild>2</grandchild>" +"<grandchild>1</grandchild>" +# +"<child>20<grandchild>20</grandchild></child>" +"<child>19<grandchild>19</grandchild></child>" +"<child>18<grandchild>18</grandchild></child>" +"<child>17<grandchild>17</grandchild></child>" +"<child>16<grandchild>16</grandchild></child>" +"<child>15<grandchild>15</grandchild></child>" +"<child>14<grandchild>14</grandchild></child>" +"<child>13<grandchild>13</grandchild></child>" +"<child>12<grandchild>12</grandchild></child>" +"<child>11<grandchild>11</grandchild></child>" +"<child>10<grandchild>10</grandchild></child>" +"<child>9<grandchild>9</grandchild></child>" +"<child>8<grandchild>8</grandchild></child>" +"<child>7<grandchild>7</grandchild></child>" +"<child>6<grandchild>6</grandchild></child>" +"<child>5<grandchild>5</grandchild></child>" +"<child>4<grandchild>4</grandchild></child>" +"<child xmlns:ns44="http://xpath/testsasd">3<grandchild>3</grandchild></child>" +"<child>2<grandchild>2</grandchild></child>" +"<child>1<grandchild>1</grandchild></child>" +# +"<child>20<grandchild>20</grandchild></child>" +"<child>19<grandchild>19</grandchild></child>" +"<child>18<grandchild>18</grandchild></child>" +"<child>17<grandchild>17</grandchild></child>" +"<child>16<grandchild>16</grandchild></child>" +"<child>15<grandchild>15</grandchild></child>" +"<child>14<grandchild>14</grandchild></child>" +"<child>13<grandchild>13</grandchild></child>" +"<child>12<grandchild>12</grandchild></child>" +"<child>11<grandchild>11</grandchild></child>" +"<child>10<grandchild>10</grandchild></child>" +"<child>9<grandchild>9</grandchild></child>" +"<child>8<grandchild>8</grandchild></child>" +"<child>7<grandchild>7</grandchild></child>" +"<child>6<grandchild>6</grandchild></child>" +"<child>5<grandchild>5</grandchild></child>" +"<child>4<grandchild>4</grandchild></child>" +"<child xmlns:ns44="http://xpath/testsasd">3<grandchild>3</grandchild></child>" +"<child>2<grandchild>2</grandchild></child>" +"<child>1<grandchild>1</grandchild></child>" +# +attr1 = "attribute_value_2" +# +"<node1 attr1="attribute_value_2" xmlns:nsp="http://xpath/test">5</node1>" +"<ns1:node1 xmlns:ns1="http://xpath/test" attr1="attribute_value_1" xmlns:nsx="http://xpath/test">10</ns1:node1>" +# +"<ns1:node1 xmlns:ns1="http://xpath/test" attr1="attribute_value_1" xmlns:nsx="http://xpath/test">10</ns1:node1>" +# +"<child>5<grandchild>5</grandchild></child>" +# +"true" +# +"<grandchild>20</grandchild>" +"<grandchild>19</grandchild>" +"<grandchild>18</grandchild>" +"<grandchild>17</grandchild>" +"<grandchild>16</grandchild>" +"<grandchild>15</grandchild>" +"<grandchild>14</grandchild>" +"<grandchild>13</grandchild>" +"<grandchild>12</grandchild>" +"<grandchild>11</grandchild>" +"<grandchild>10</grandchild>" +"<grandchild>9</grandchild>" +"<grandchild>8</grandchild>" +"<grandchild>7</grandchild>" +"<grandchild>6</grandchild>" +"<grandchild>5</grandchild>" +"<grandchild>4</grandchild>" +"<grandchild>3</grandchild>" +"<grandchild>2</grandchild>" +"<grandchild>1</grandchild>" +# +"<child>20<grandchild>20</grandchild></child>" +"<child>19<grandchild>19</grandchild></child>" +"<child>18<grandchild>18</grandchild></child>" +"<child>17<grandchild>17</grandchild></child>" +"<child>16<grandchild>16</grandchild></child>" +"<child>15<grandchild>15</grandchild></child>" +"<child>14<grandchild>14</grandchild></child>" +"<child>13<grandchild>13</grandchild></child>" +"<child>12<grandchild>12</grandchild></child>" +"<child>11<grandchild>11</grandchild></child>" +"<child>10<grandchild>10</grandchild></child>" +"<child>9<grandchild>9</grandchild></child>" +"<child>8<grandchild>8</grandchild></child>" +"<child>7<grandchild>7</grandchild></child>" +"<child>6<grandchild>6</grandchild></child>" +"<child>5<grandchild>5</grandchild></child>" +"<child>4<grandchild>4</grandchild></child>" +"<child>3<grandchild>3</grandchild></child>" +"<child>2<grandchild>2</grandchild></child>" +"<child>1<grandchild>1</grandchild></child>" +# +"<child>20<grandchild>20</grandchild></child>" +"<child>19<grandchild>19</grandchild></child>" +"<child>18<grandchild>18</grandchild></child>" +"<child>17<grandchild>17</grandchild></child>" +"<child>16<grandchild>16</grandchild></child>" +"<child>15<grandchild>15</grandchild></child>" +"<child>14<grandchild>14</grandchild></child>" +"<child>13<grandchild>13</grandchild></child>" +"<child>12<grandchild>12</grandchild></child>" +"<child>11<grandchild>11</grandchild></child>" +"<child>10<grandchild>10</grandchild></child>" +"<child>9<grandchild>9</grandchild></child>" +"<child>8<grandchild>8</grandchild></child>" +"<child>7<grandchild>7</grandchild></child>" +"<child>6<grandchild>6</grandchild></child>" +"<child>5<grandchild>5</grandchild></child>" +"<child>4<grandchild>4</grandchild></child>" +"<child>3<grandchild>3</grandchild></child>" +"<child>2<grandchild>2</grandchild></child>" +"<child>1<grandchild>1</grandchild></child>" +# +"<node1 attr1="attribute_value_2" xmlns:nsp="http://xpath/test">5</node1>" +"<ns1:node1 xmlns:ns1="http://xpath/test" attr1="attribute_value_1" xmlns:nsx="http://xpath/test">10</ns1:node1>" +# +"<node2> + <child>1<grandchild>1</grandchild></child> + <child>2<grandchild>2</grandchild></child> + <child>3<grandchild>3</grandchild></child> + <child>4<grandchild>4</grandchild></child> + <child>5<grandchild>5</grandchild></child> + <child>6<grandchild>6</grandchild></child> + <child>7<grandchild>7</grandchild></child> + <child>8<grandchild>8</grandchild></child> + <child>9<grandchild>9</grandchild></child> + <child>10<grandchild>10</grandchild></child> + <child>11<grandchild>11</grandchild></child> + <child>12<grandchild>12</grandchild></child> + <child>13<grandchild>13</grandchild></child> + <child>14<grandchild>14</grandchild></child> + <child>15<grandchild>15</grandchild></child> + <child>16<grandchild>16</grandchild></child> + <child>17<grandchild>17</grandchild></child> + <child>18<grandchild>18</grandchild></child> + <child>19<grandchild>19</grandchild></child> + <child>20<grandchild>20</grandchild></child> + </node2>" +# +"<ns1:node2 xmlns:ns1="http://xpath/test"> + <child>1<grandchild>1</grandchild></child> + <child>2<grandchild>2</grandchild></child> + <child xmlns:ns44="http://xpath/testsasd">3<grandchild>3</grandchild></child> + <child>4<grandchild>4</grandchild></child> + <child>5<grandchild>5</grandchild></child> + <child>6<grandchild>6</grandchild></child> + <child>7<grandchild>7</grandchild></child> + <child>8<grandchild>8</grandchild></child> + <child>9<grandchild>9</grandchild></child> + <child>10<grandchild>10</grandchild></child> + <child>11<grandchild>11</grandchild></child> + <child>12<grandchild>12</grandchild></child> + <child>13<grandchild>13</grandchild></child> + <child>14<grandchild>14</grandchild></child> + <child>15<grandchild>15</grandchild></child> + <child>16<grandchild>16</grandchild></child> + <child>17<grandchild>17</grandchild></child> + <child>18<grandchild>18</grandchild></child> + <child>19<grandchild>19</grandchild></child> + <child>20<grandchild>20</grandchild></child> + </ns1:node2>" +# +attr1 = "attribute_value_1" +#
\ No newline at end of file diff --git a/axiom/test/xpath/test.ns b/axiom/test/xpath/test.ns new file mode 100644 index 0000000..45508e2 --- /dev/null +++ b/axiom/test/xpath/test.ns @@ -0,0 +1,2 @@ +test +http://xpath/test diff --git a/axiom/test/xpath/test.xml b/axiom/test/xpath/test.xml new file mode 100644 index 0000000..fa0adb6 --- /dev/null +++ b/axiom/test/xpath/test.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<test xmlns:ns1="http://xpath/test"> + + <ns1:node1 xmlns:nsx="http://xpath/test" attr1="attribute_value_1">10</ns1:node1> + + <ns1:node2> + <child>1<grandchild>1</grandchild></child> + <child>2<grandchild>2</grandchild></child> + <child xmlns:ns44="http://xpath/testsasd">3<grandchild>3</grandchild></child> + <child>4<grandchild>4</grandchild></child> + <child>5<grandchild>5</grandchild></child> + <child>6<grandchild>6</grandchild></child> + <child>7<grandchild>7</grandchild></child> + <child>8<grandchild>8</grandchild></child> + <child>9<grandchild>9</grandchild></child> + <child>10<grandchild>10</grandchild></child> + <child>11<grandchild>11</grandchild></child> + <child>12<grandchild>12</grandchild></child> + <child>13<grandchild>13</grandchild></child> + <child>14<grandchild>14</grandchild></child> + <child>15<grandchild>15</grandchild></child> + <child>16<grandchild>16</grandchild></child> + <child>17<grandchild>17</grandchild></child> + <child>18<grandchild>18</grandchild></child> + <child>19<grandchild>19</grandchild></child> + <child>20<grandchild>20</grandchild></child> + </ns1:node2> + + <node1 xmlns:nsp="http://xpath/test" attr1="attribute_value_2">5</node1> + + <node2> + <child>1<grandchild>1</grandchild></child> + <child>2<grandchild>2</grandchild></child> + <child>3<grandchild>3</grandchild></child> + <child>4<grandchild>4</grandchild></child> + <child>5<grandchild>5</grandchild></child> + <child>6<grandchild>6</grandchild></child> + <child>7<grandchild>7</grandchild></child> + <child>8<grandchild>8</grandchild></child> + <child>9<grandchild>9</grandchild></child> + <child>10<grandchild>10</grandchild></child> + <child>11<grandchild>11</grandchild></child> + <child>12<grandchild>12</grandchild></child> + <child>13<grandchild>13</grandchild></child> + <child>14<grandchild>14</grandchild></child> + <child>15<grandchild>15</grandchild></child> + <child>16<grandchild>16</grandchild></child> + <child>17<grandchild>17</grandchild></child> + <child>18<grandchild>18</grandchild></child> + <child>19<grandchild>19</grandchild></child> + <child>20<grandchild>20</grandchild></child> + </node2> + +</test> diff --git a/axiom/test/xpath/test.xpath b/axiom/test/xpath/test.xpath new file mode 100644 index 0000000..1ebe4a8 --- /dev/null +++ b/axiom/test/xpath/test.xpath @@ -0,0 +1,37 @@ +#Test: Functions +test/descendant::child +count(test/descendant::child) +#Test: Axes +test/node2/child::child[5] +test/descendant::child +test/node2/parent::* +test/node2/child[3]/grandchild/ancestor::* +test/node2/child[3]/following-sibling::* +test/node2/child[3]/preceding-sibling::* +test/node2/child[3]/following::* +test/node2/child[3]/preceding::* +test/*/attribute::* +test/*/namespace::* +test/node1/self::* +test/descendant-or-self::child +test/node2/child[4]/grandchild/ancestor-or-self::child +#Test: Namespaces +test/test:node2//grandchild +test/test:node2/child +test/test:node2/* +#Test: Attributes and Predicates +test/node1/@* +//*[@*] +//*[@attr1 = 'attribute_value_1'] +test/node2/child[grandchild = /test/node1] +#Test: Equality Expressions +test/node1 = test/node2/child +#Test: Abbreviated Axes +test/node2//grandchild +test/node2/child +test/node2/* +#Test: Random +test/*[@*] +test/node2 +test/test:node2 +test/test:node1/@* diff --git a/axiom/test/xpath/test_xpath.c b/axiom/test/xpath/test_xpath.c new file mode 100644 index 0000000..95e0d94 --- /dev/null +++ b/axiom/test/xpath/test_xpath.c @@ -0,0 +1,513 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +/* +Compiling For Windows: +cl.exe /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /I %AXIS2C_HOME%\include /c *.c +link.exe /LIBPATH:%AXIS2C_HOME%\lib axutil.lib axiom.lib axis2_parser.lib axis2_engine.lib /OUT:test.exe *.obj +*/ +#include <stdio.h> +#include <axiom.h> +#include <axis2_util.h> +#include <axiom_soap.h> +#include <axiom_xpath.h> + +/* Function headers */ +axiom_node_t *build_test_xml(const axutil_env_t *env); + +void output_results(const axutil_env_t *env, axiom_xpath_result_t *xpath_result); + +axiom_node_t *read_test_xml(const axutil_env_t *env, char *file_name); + +void output_results(const axutil_env_t *env, + axiom_xpath_result_t *xpath_result); + +void evaluate(const axutil_env_t *env, + axiom_xpath_context_t *context, + axis2_char_t *expr_str); + +void evaluate_expressions(const axutil_env_t *env, + axiom_xpath_context_t *context, + char *file_name); + +void add_namespaces(const axutil_env_t *env, + axiom_xpath_context_t *context, + char *file_name); + +int readline(FILE *fin, char *str); + +FILE *fcor; +/*FILE *ftemp;*/ + +int main(int argc, char *argv[]) +{ + axiom_node_t *test_tree = NULL; + axis2_char_t *test_tree_str; + char *xml_file = "test.xml"; + char *xpath_file = "test.xpath"; + char *ns_file = "test.ns"; + char *cor_file = "results.txt"; + axiom_xpath_context_t *context = NULL; + + /* Create environment */ + axutil_env_t *env = + axutil_env_create_all("xpath_test.log", AXIS2_LOG_LEVEL_TRACE); + + /* Set input file */ + if (argc > 1) + { + printf("Usage: test [xml_file xpath_file namespaces_file results_file]\n\n"); + printf("\tLook at the example test case:"); + printf(" test.xml, test.xpath test.ns\n\n"); + + if(argc > 4) + { + xml_file = argv[1]; + xpath_file = argv[2]; + ns_file = argv[3]; + cor_file = argv[4]; + } + } + + /*Create the request */ + /* test_tree = build_test_xml(env); */ + test_tree = read_test_xml(env, (axis2_char_t *)xml_file); + + fcor = fopen(cor_file, "r"); + /*ftemp = fopen("temp.txt", "w");*/ + + if (!fcor) + { + printf("Error opening file: %s\n", cor_file); + } + + if (test_tree) + { + test_tree_str = axiom_node_to_string(test_tree, env); + printf("\nTesting XML\n-----------\n\"%s\"\n\n\n", test_tree_str); + + /* Create XPath Context */ + context = axiom_xpath_context_create(env, test_tree); + + /* Namespaces */ + add_namespaces(env, context, ns_file); + + evaluate_expressions(env, context, xpath_file); + + test_tree_str = axiom_node_to_string(test_tree, env); + printf("\n\nFinal XML\n-----------\n\"%s\"\n\n\n", test_tree_str); + } + + /* Freeing memory */ + if (context) + { + axiom_xpath_free_context(env, context); + } + + if (test_tree) + { + axiom_node_free_tree(test_tree, env); + } + + if (env) + { + axutil_env_free((axutil_env_t *) env); + } + + if(fcor) + { + fclose(fcor); + } + + return 0; +} + +int readline(FILE *fin, char *str) +{ + int i; + + for (i = 0; 1; i++) + { + str[i] = (char)getc(fin); + + if (str[i] == '\n' || str[i] == '\r' || str[i] == EOF) + { + break; + } + } + + str[i] = '\0'; + + return i; +} + +void add_namespaces(const axutil_env_t *env, + axiom_xpath_context_t *context, + char *file_name) +{ + FILE *fin = NULL; + char prefix[1024]; + char uri[1024]; + axiom_namespace_t *ns; + + fin = fopen(file_name, "r"); + + if (!fin) + { + printf("Error opening file: %s\n", file_name); + return; + } + + /* Compiling XPath expression */ + while (1) + { + if (readline(fin, prefix) == 0) + { + break; + } + + if (readline(fin, uri) == 0) + { + break; + } + + ns = axiom_namespace_create( + env, (axis2_char_t *)uri, (axis2_char_t *)prefix); + + if (ns) + { + axiom_xpath_register_namespace(context, ns); + } + } + + fclose(fin); +} + +void evaluate_expressions( + const axutil_env_t *env, + axiom_xpath_context_t *context, + char *file_name) +{ + FILE *fin = NULL; + char str[1024]; + + fin = fopen(file_name, "r"); + + if (!fin) + { + printf("Error opening file: %s\n", file_name); + return; + } + + /* Compiling XPath expression */ + while (1) + { + if (readline(fin, str) == 0) + { + break; + } + + if (str[0] == '#') + { + printf("\n\n%s", str + 1); + continue; + } + + evaluate(env, context, (axis2_char_t *)str); + } + + fclose(fin); +} + +void evaluate( + const axutil_env_t *env, + axiom_xpath_context_t *context, + axis2_char_t *expr_str) +{ + axiom_xpath_expression_t *expr = NULL; + axiom_xpath_result_t *result = NULL; + + printf("\nCompiling XPath expression: \"%s\" ...\n", expr_str); + expr = axiom_xpath_compile_expression(env, expr_str); + + if (!expr) + { + printf("Compilation error."); + printf("Please check the systax of the XPath query.\n"); + + return; + } + + /* Evaluating XPath expression */ + printf("Evaluating...\n"); + result = axiom_xpath_evaluate(context, expr); + + if (!result) + { + printf("An error occured while evaluating the expression.\n"); + + axiom_xpath_free_expression(env, expr); + + return; + } + + if (result->flag == AXIOM_XPATH_ERROR_STREAMING_NOT_SUPPORTED) + { + printf("Streaming not supported.\n"); + + axiom_xpath_free_expression(env, expr); + + return; + } + + output_results(env, result); + + if (result) + { + axiom_xpath_free_result(env, result); + } + + if (expr) + { + axiom_xpath_free_expression(env, expr); + } +} + +int compare_result(axis2_char_t *rs) +{ + int i; + char c; + + /*fprintf(ftemp, "%s#", rs);*/ + + if(!fcor) + { + return 0; + } + + for(i = 0; 1; i++) + { + while(rs[i] == ' ' || rs[i] == '\n' || rs[i] == '\r' || rs[i] == '\t') + { + i++; + } + + do + { + c = (char)getc(fcor); + } + while(c == ' ' || c == '\n' || c == '\r' || c == '\t'); + + if(c == '#' || c == EOF) + { + break; + } + + if(c != rs[i]) + { + while(c != '#' && c != EOF) + { + c = getc(fcor); + } + + return 0; + } + } + + return rs[i] == '\0'; +} + +void output_results(const axutil_env_t *env, + axiom_xpath_result_t *xpath_result) +{ + axiom_xpath_result_node_t *xpath_result_node; + axiom_node_t *result_node; + axis2_char_t *result_str; + axis2_char_t result_set[100000]; + axis2_char_t temp_res[100000]; + + axiom_element_t *ele; + int i; + + result_set[0] = '\n'; + result_set[1] = '\0'; + + for (i = 0; i < axutil_array_list_size(xpath_result->nodes, env); i++) + { + xpath_result_node = axutil_array_list_get(xpath_result->nodes, env, i); + + if (xpath_result_node->type == AXIOM_XPATH_TYPE_NODE) + { + result_node = xpath_result_node->value; + ele = (axiom_element_t *)axiom_node_get_data_element( + result_node, env); + + if (ele) + { + /*result_str = axiom_element_get_text(ele, env, result_node);*/ + result_str = axiom_node_to_string(result_node, env); + + sprintf(temp_res, "\"%s\"\n", result_str); + strcat(result_set, temp_res); + } + } + else if (xpath_result_node->type == AXIOM_XPATH_TYPE_ATTRIBUTE) + { + result_str = + axiom_attribute_get_localname(xpath_result_node->value, env); + sprintf(temp_res, "%s = ", result_str); + strcat(result_set, temp_res); + result_str = + axiom_attribute_get_value(xpath_result_node->value, env); + sprintf(temp_res, "\"%s\"\n", result_str); + strcat(result_set, temp_res); + } + else if (xpath_result_node->type == AXIOM_XPATH_TYPE_NAMESPACE) + { + result_str = + axiom_namespace_get_prefix(xpath_result_node->value, env); + sprintf(temp_res, "%s = ", result_str); + strcat(result_set, temp_res); + result_str = + axiom_namespace_get_uri(xpath_result_node->value, env); + sprintf(temp_res, "\"%s\"\n", result_str); + strcat(result_set, temp_res); + } + else if (xpath_result_node->type == AXIOM_XPATH_TYPE_BOOLEAN) + { + sprintf(temp_res, "\"%s\"\n", + (*(axis2_bool_t *)xpath_result_node->value) ? "true" : "false"); + strcat(result_set, temp_res); + } + else if (xpath_result_node->type == AXIOM_XPATH_TYPE_TEXT) + { + sprintf(temp_res, "\"%s\"\n", + (axis2_char_t *)xpath_result_node->value); + strcat(result_set, temp_res); + } + else if (xpath_result_node->type == AXIOM_XPATH_TYPE_NUMBER) + { + sprintf(temp_res, "\"%lf\"\n", + *(double *)xpath_result_node->value); + strcat(result_set, temp_res); + } + } + + if(compare_result(result_set)) + { + printf("Test case passed\n"); + } + else + { + printf("Failed test case!\nOutput\n%s\n", result_set); + } +} + +axiom_node_t *read_test_xml(const axutil_env_t *env, axis2_char_t *file_name) +{ + axiom_xml_reader_t *reader = NULL; + axiom_stax_builder_t *builder = NULL; + axiom_document_t *document = NULL; + axiom_node_t *root = NULL; + + /* Create parser */ + reader = axiom_xml_reader_create_for_file(env, file_name, NULL); + + if (!reader) + { + printf("Error creating pullparser"); + return NULL; + } + + /* Create axiom_stax_builder */ + builder = axiom_stax_builder_create(env, reader); + + if (!builder) + { + printf("Error creating pull parser"); + return NULL; + } + + /* Create an om document */ + document = axiom_stax_builder_get_document(builder, env); + + if (!document) + { + printf("Error creating document"); + return NULL; + } + + /* Get root element */ + root = axiom_document_get_root_element(document, env); + if (!root) + { + printf("Root element null "); + axiom_stax_builder_free(builder, env); + return NULL; + } + + while (axiom_document_build_next(document, env)); + + return root; +} + +axiom_node_t * build_test_xml(const axutil_env_t *env) +{ + axiom_node_t *main_node; + axiom_node_t *order_node; + axiom_node_t *values_node; + axiom_node_t *value_node; + axiom_node_t *grandchild; + axis2_char_t value_str[255]; + axiom_element_t *order_ele; + axiom_element_t *values_ele; + axiom_element_t *value_ele; + axiom_element_t *grandchild_ele; + axiom_attribute_t *attribute; + int i, N = 20; + + axiom_namespace_t *ns1 = + axiom_namespace_create(env, "http://xpath/test", "ns1"); + + axiom_element_create(env, NULL, "test", ns1, &main_node); + + order_ele = + axiom_element_create(env, main_node, "node1", NULL, &order_node); + axiom_element_set_text(order_ele, env, "10", order_node); + attribute = + axiom_attribute_create(env, "attr1", "attribute_value_1", NULL); + axiom_element_add_attribute(order_ele, env, attribute, order_node); + + values_ele = + axiom_element_create(env, main_node, "node2", NULL, &values_node); + + for (i = 0 ; i < N; i++) + { + sprintf(value_str, "%d", i + 1); + + value_ele = + axiom_element_create(env, values_node, "child", NULL, &value_node); + axiom_element_set_text(value_ele, env, value_str, value_node); + + grandchild_ele = + axiom_element_create(env, value_node, "grandchild", NULL, &grandchild); + axiom_element_set_text(grandchild_ele, env, value_str /*"3 rd level"*/, grandchild); + } + + return main_node; +} diff --git a/axiom/test/xpath/test_xpath_streaming.c b/axiom/test/xpath/test_xpath_streaming.c new file mode 100644 index 0000000..6b64262 --- /dev/null +++ b/axiom/test/xpath/test_xpath_streaming.c @@ -0,0 +1,468 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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. + */ + +/* +Compiling For Windows: +cl.exe /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /I %AXIS2C_HOME%\include /c *.c +link.exe /LIBPATH:%AXIS2C_HOME%\lib axutil.lib axiom.lib axis2_parser.lib axis2_engine.lib /OUT:test.exe *.obj +*/ +#include <stdio.h> +#include <axiom.h> +#include <axis2_util.h> +#include <axiom_soap.h> +#include <axiom_xpath.h> + +/* Function headers */ +void output_results(const axutil_env_t *env, axiom_xpath_result_t *xpath_result); + +axiom_node_t *read_test_xml(const axutil_env_t *env, char *file_name); + +void output_results(const axutil_env_t *env, + axiom_xpath_result_t *xpath_result); + +void evaluate(const axutil_env_t *env, + axis2_char_t *expr_str); + +void evaluate_expressions(const axutil_env_t *env, + char *file_name); + +void add_namespaces(const axutil_env_t *env, + axiom_xpath_context_t *context, + char *file_name); + +int readline(FILE *fin, char *str); + +FILE *fcor; +char *xml_file = "test.xml"; +char *xpath_file = "test.xpath"; +char *cor_file = "results.txt"; +char *ns_file = "test.ns"; + +/*FILE *ftemp;*/ + +int main(int argc, char *argv[]) +{ + axiom_node_t *test_tree = NULL; + axis2_char_t *test_tree_str; + + /* Create environment */ + axutil_env_t *env = + axutil_env_create_all("xpath_test.log", AXIS2_LOG_LEVEL_TRACE); + + /* Set input file */ + if (argc > 1) + { + printf("Usage: test [xml_file xpath_file namespaces_file results_file]\n\n"); + printf("\tLook at the example test case:"); + printf(" test.xml, test.xpath test.ns\n\n"); + + if(argc > 4) + { + xml_file = argv[1]; + xpath_file = argv[2]; + ns_file = argv[3]; + cor_file = argv[4]; + } + } + + /*Create the request */ + test_tree = read_test_xml(env, (axis2_char_t *)xml_file); + + fcor = fopen(cor_file, "r"); + /*ftemp = fopen("temp.txt", "w");*/ + + if (!fcor) + { + printf("Error opening file: %s\n", cor_file); + } + + if (test_tree) + { + test_tree_str = axiom_node_to_string(test_tree, env); + printf("\nTesting XML\n-----------\n\"%s\"\n\n\n", test_tree_str); + + axiom_node_free_tree(test_tree, env); + + evaluate_expressions(env, xpath_file); + } + + /* Freeing memory */ + if (env) + { + axutil_env_free((axutil_env_t *) env); + } + + if(fcor) + { + fclose(fcor); + } + + return 0; +} + +int readline(FILE *fin, char *str) +{ + int i; + + for (i = 0; 1; i++) + { + str[i] = (char)getc(fin); + + if (str[i] == '\n' || str[i] == '\r' || str[i] == EOF) + { + break; + } + } + + str[i] = '\0'; + + return i; +} + +void add_namespaces(const axutil_env_t *env, + axiom_xpath_context_t *context, + char *file_name) +{ + FILE *fin = NULL; + char prefix[1024]; + char uri[1024]; + axiom_namespace_t *ns; + + fin = fopen(file_name, "r"); + + if (!fin) + { + printf("Error opening file: %s\n", file_name); + return; + } + + /* Compiling XPath expression */ + while (1) + { + if (readline(fin, prefix) == 0) + { + break; + } + + if (readline(fin, uri) == 0) + { + break; + } + + ns = axiom_namespace_create( + env, (axis2_char_t *)uri, (axis2_char_t *)prefix); + + if (ns) + { + axiom_xpath_register_namespace(context, ns); + } + } + + fclose(fin); +} + +void evaluate_expressions( + const axutil_env_t *env, + char *file_name) +{ + FILE *fin = NULL; + char str[1024]; + + fin = fopen(file_name, "r"); + + if (!fin) + { + printf("Error opening file: %s\n", file_name); + return; + } + + /* Compiling XPath expression */ + while (1) + { + if (readline(fin, str) == 0) + { + break; + } + + if (str[0] == '#') + { + printf("\n\n%s", str + 1); + continue; + } + + evaluate(env, (axis2_char_t *)str); + } + + fclose(fin); +} + +void evaluate( + const axutil_env_t *env, + axis2_char_t *expr_str) +{ + axiom_xpath_expression_t *expr = NULL; + axiom_xpath_result_t *result = NULL; + axiom_node_t *test_tree = NULL; + axiom_xpath_context_t *context = NULL; + + test_tree = read_test_xml(env, (axis2_char_t *)xml_file); + + if(!test_tree) + { + printf("Error reading file: %s\n", xml_file); + return; + } + + /* Create XPath Context */ + context = axiom_xpath_context_create(env, test_tree); + + if(!context) + { + printf("Could not initialise XPath context\n"); + return; + } + + /* Namespaces */ + add_namespaces(env, context, ns_file); + + + printf("\nCompiling XPath expression: \"%s\" ...\n", expr_str); + expr = axiom_xpath_compile_expression(env, expr_str); + + if (!expr) + { + printf("Compilation error."); + printf("Please check the systax of the XPath query.\n"); + + return; + } + + /* Evaluating XPath expression */ + printf("Evaluating...\n"); + result = axiom_xpath_evaluate_streaming(context, expr); + + if (!result) + { + compare_result(""); + printf("An error occured while evaluating the expression.\n"); + + axiom_xpath_free_expression(env, expr); + + return; + } + + if (result->flag == AXIOM_XPATH_ERROR_STREAMING_NOT_SUPPORTED) + { + compare_result(""); + printf("Streaming not supported.\n"); + + axiom_xpath_free_expression(env, expr); + + return; + } + + output_results(env, result); + + if (result) + { + axiom_xpath_free_result(env, result); + } + + if (expr) + { + axiom_xpath_free_expression(env, expr); + } +} + +int compare_result(axis2_char_t *rs) +{ + int i; + char c; + + /*fprintf(ftemp, "%s#", rs);*/ + + if(!fcor) + { + return 0; + } + + for(i = 0; 1; i++) + { + while(rs[i] == ' ' || rs[i] == '\n' || rs[i] == '\r' || rs[i] == '\t') + { + i++; + } + + do + { + c = (char)getc(fcor); + } + while(c == ' ' || c == '\n' || c == '\r' || c == '\t'); + + if(c == '#' || c == EOF) + { + break; + } + + if(c != rs[i]) + { + while(c != '#' && c != EOF) + { + c = getc(fcor); + } + + return 0; + } + } + + return rs[i] == '\0'; +} + +void output_results(const axutil_env_t *env, + axiom_xpath_result_t *xpath_result) +{ + axiom_xpath_result_node_t *xpath_result_node; + axiom_node_t *result_node; + axis2_char_t *result_str; + axis2_char_t result_set[100000]; + axis2_char_t temp_res[100000]; + + axiom_element_t *ele; + int i; + + result_set[0] = '\n'; + result_set[1] = '\0'; + + for (i = 0; i < axutil_array_list_size(xpath_result->nodes, env); i++) + { + xpath_result_node = axutil_array_list_get(xpath_result->nodes, env, i); + + if (xpath_result_node->type == AXIOM_XPATH_TYPE_NODE) + { + result_node = xpath_result_node->value; + ele = (axiom_element_t *)axiom_node_get_data_element( + result_node, env); + + if (ele) + { + /*result_str = axiom_element_get_text(ele, env, result_node);*/ + result_str = axiom_node_to_string(result_node, env); + + sprintf(temp_res, "\"%s\"\n", result_str); + strcat(result_set, temp_res); + } + } + else if (xpath_result_node->type == AXIOM_XPATH_TYPE_ATTRIBUTE) + { + result_str = + axiom_attribute_get_localname(xpath_result_node->value, env); + sprintf(temp_res, "%s = ", result_str); + strcat(result_set, temp_res); + result_str = + axiom_attribute_get_value(xpath_result_node->value, env); + sprintf(temp_res, "\"%s\"\n", result_str); + strcat(result_set, temp_res); + } + else if (xpath_result_node->type == AXIOM_XPATH_TYPE_NAMESPACE) + { + result_str = + axiom_namespace_get_prefix(xpath_result_node->value, env); + sprintf(temp_res, "%s = ", result_str); + strcat(result_set, temp_res); + result_str = + axiom_namespace_get_uri(xpath_result_node->value, env); + sprintf(temp_res, "\"%s\"\n", result_str); + strcat(result_set, temp_res); + } + else if (xpath_result_node->type == AXIOM_XPATH_TYPE_BOOLEAN) + { + sprintf(temp_res, "\"%s\"\n", + (*(axis2_bool_t *)xpath_result_node->value) ? "true" : "false"); + strcat(result_set, temp_res); + } + else if (xpath_result_node->type == AXIOM_XPATH_TYPE_TEXT) + { + sprintf(temp_res, "\"%s\"\n", + (axis2_char_t *)xpath_result_node->value); + strcat(result_set, temp_res); + } + else if (xpath_result_node->type == AXIOM_XPATH_TYPE_NUMBER) + { + sprintf(temp_res, "\"%lf\"\n", + *(double *)xpath_result_node->value); + strcat(result_set, temp_res); + } + } + + if(compare_result(result_set)) + { + printf("Test case passed\n"); + } + else + { + printf("Failed test case!\nOutput\n%s\n", result_set); + } +} + +axiom_node_t *read_test_xml(const axutil_env_t *env, axis2_char_t *file_name) +{ + axiom_xml_reader_t *reader = NULL; + axiom_stax_builder_t *builder = NULL; + axiom_document_t *document = NULL; + axiom_node_t *root = NULL; + + /* Create parser */ + reader = axiom_xml_reader_create_for_file(env, file_name, NULL); + + if (!reader) + { + printf("Error creating pullparser"); + return NULL; + } + + /* Create axiom_stax_builder */ + builder = axiom_stax_builder_create(env, reader); + + if (!builder) + { + printf("Error creating pull parser"); + return NULL; + } + + /* Create an om document */ + document = axiom_stax_builder_get_document(builder, env); + + if (!document) + { + printf("Error creating document"); + return NULL; + } + + /* Get root element */ + root = axiom_document_get_root_element(document, env); + if (!root) + { + printf("Root element null "); + axiom_stax_builder_free(builder, env); + return NULL; + } + + while (axiom_document_build_next(document, env)); + + return root; +} |