diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..1a568d3 --- /dev/null +++ b/COPYING @@ -0,0 +1,7 @@ +SOAP4R, WSDL4R and XSD4R +Copyright (C) 2000-2003 NAKAMURA, Hiroshi . + +This program is copyrighted free software by NAKAMURA, Hiroshi. You can +redistribute it and/or modify it under the same terms of Ruby's license; +either the dual license version in 2003 (see the file RUBYS), or any later +version. diff --git a/GPL b/GPL new file mode 100644 index 0000000..5b6e7c6 --- /dev/null +++ b/GPL @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/README b/README new file mode 100644 index 0000000..c366504 --- /dev/null +++ b/README @@ -0,0 +1,17 @@ +== soap4r == + + This is a modified version of the soap4r library for + the Ruby programming language. The official verion + can be found at: + + http://dev.ctor.org/soap4r + + This modified version simply allows soap4r to run on + Ruby 1.9. I have not done any extensive testing, merely + fixed things that I needed to work. If you find problems, + please drop me a line and I'll do an update to fix it. + + Thanks! + + spox + spox@modspox.com \ No newline at end of file diff --git a/RELEASE_en.html b/RELEASE_en.html new file mode 100644 index 0000000..b0970da --- /dev/null +++ b/RELEASE_en.html @@ -0,0 +1,1900 @@ + + + + + + + + +Release Notes - SOAP4R + + + +
+

+Release Notes - SOAP4R +

+ +

+Last modified: Sep 24, 2007
+Created: July 17, 2000 +

+
+ +
+ +
+

0. In this document...

+ +

+This is Release Notes of SOAP4R. +

+ +

+Target SOAP4R version: SOAP4R/1.5.8 +

+ +
    +
  1. Changes
  2. +
  3. Install
  4. +
  5. Uninstall
  6. +
  7. What is SOAP4R?
  8. +
  9. Dependencies
  10. +
  11. Samples
  12. +
  13. Resources
  14. +
  15. History
  16. +
  17. Author
  18. +
  19. Copyright
  20. +
+ +

1. Changes

+ +

+Version 1.5.8 has improved its XML Schema support, such as +class generation of XML Schema anonymous complexType, +full built-in datatypes support of XML Schema Datatypes, and more. +Here are changes in 1.5.8 from 1.5.7. +

+ +
  • XML Schema +
    • added classes for the last of built-in datatypes of XML Schema Datatypes (NMTOKEN, NMTOKENS, Name, NCName, ID, IDREF, IDREFS, ENTITY, and ENTITIES). lexical scope is not checked for these datatypes yet. (#340) +
    • added anonymous type support. wsdl2ruby.rb/xsd2ruby.rb maps anonymous type to inner class. (#355) +
    • added support of all XML Schema facets for restriction. No validation implemented yet. do you want to validate XML messages by soap4r? (#364) +
    • added <xsd:attributeGroup> support. (#389) + +
    • added <xsd:anyAttribute> support. just ignore anyAttribute because wsdll2ruby.rb now generates xmlattr method. use it for adding any attribute. (#390) +
    • added <xsd:group> support. (#391) +
    • [BUG] XSD::XSDDuration should allow durations lower than a day. Thanks to an anonymous user for taking the time to file the ticket. (#401) +
    • [BUG] choice handling bug fixed according to a patch from KR, Vesa Varimo. If there was choice element in complex type, soap4r didn't process all elements if the first element was an empty array. (#382) + +
    • [BUG] some WSDL caused cyclic schema inclusion. <xsd:import> supported cyclic include but <xsd:include> did not. extract common implementation as importHandler.rb. (#385) +
    • [BUG] added supports of <xsd:complexType> definition inheritance. earlier soap4r supported only element definition inheritance. (#394) +
    • [BUG] support <xsd:choice maxOccurs="unbounded"/>: treat it <xsd:all/> for now. (#400) + +
    • [BUG] allow <xsd:any> appear twice or more. with the current implementation, soap4r ignores <xsd:any> element definition such as namespace and processContent. just allow any element appear. (#402) +
    • [BUG] Type simpleType and simpleContent was unmarshalled as a String, not as an instance of the subclass which is generated by wsdl2ruby.rb. (#412) +
    • [BUG] ignore xsd:element definition when the same qname is also defined as a xsd:complexType. it's a workaround for this version. (#413) +
    • [BUG] wsdl2ruby.rb generated inconsistent class definition when the base class was :TYPE_ARRAY and the derived class was a :TYPE_STRUCT. let the derived class be a standalone (not a derived) class. (#424) + +
    • [BUG] wsdl2ruby.rb generates incomplete encoded Array mapping registry for base64Binary[]. (#428) +
    • [BUG] LiteralMappingRegistryCreator did not generate an entry for the element which type is mapped to an Array. (#432) +
  • SOAP +
    • add :default_ns_tag option to configure a pre-defined Namespace tag. :default_ns is for configuring namespace definitions at SOAPEnvelope. :default_ns_tag is for configuring pre-defined namespace tag. (#383) +
    • login.live.com returns SOAPFault as a direct child of SOAPEnvelope. support it even though it's not spec compliant. (#384) +
    • allow to remove mustUnderstand attribute from a SOAP Header. I heard that there's an implementation which cannot handle mustUnderstand existence. (#429) + +
    • add the Generator option for using default namespace in SOAP message. it's for interoperability with non XML Namespace comformant implementation. false by default (same behavior as before.) you can turn it on with Driver#use_default_namespace = true or Server#use_default_namespace = true. (#430) +
    • [BUG] send xsi:nil=true element when literal + maxOccurs != 0 + nillable="true", not empty element. (#395) +
    • [BUG] do not crash when parsing an incomplete multi-dimensional array. (#397) +
    • [BUG] do not dump xsi:type for non-polymorphic type of literal service. there's an implementation which only allows xsd:type for polymorphic type hint. (#405) +
    • [BUG] a content of the stub class which is generated as a subclass of String by wsdl2ruby.rb was not properly encoded. (#415) +
    • [BUG] a value of XML attribute was not properly encoded. users who did XML-encode a value in SOAPElement#extraattr should care about this change (not needed from now.) (#416) + +
    • [BUG] XML encoding does not work properly depending on CES. (#417) +
    • [BUG] soap4r's XML namespace handler did not handle xmlns="" correctly. it means 'no default namespace'. (#421) +
    • [BUG] multi-refed basetype value was not be able to decode with generated EncodedRegistry. (#423) +
    • [BUG] unqualified element 'Envelope', 'Header', 'Body' and 'Fault' caused an error while parsing. (#431) +
    • [BUG] illegal marshaling a request for rpc/literal + parameter is a built-in basetype of XML Schema + message is defined as "type" (not "element"). fixed. (#434) +
  • SOAP/Ruby mapping +
    • let MappingError be a NestedException and show original cause of MappingError. (#404) + +
    • check illegal constant name before const_defined? call to avoid warnings. (#386) +
    • added a header handler which utilize a mapping registry. (#425) +
    • [BUG] avoid NoMethodError when passing SOAPArray to LiteralRegistry. It's caused when a servant raised an exception in literal service. Thanks to Emil for contributing test case for it. (#393) +
    • [BUG] allow the Fixnum which have an instance variable to be marshalled. For Fixnum, ivars are not marshalled but allowed to be marshalled in Ruby's marshal. (#406) + +
    • [BUG] a Driver generated by a WSDLDriverFactory did not handle nested sequence/choice correctly. (#409) +
    • [BUG] a Driver generated by a WSDLDriverFactory ignored 'xmlattr_*' value in a Hash parameter. (#414) +
    • [BUG] let it be distinguishable <ele attr=""> from <ele> (no attribute in the element). now the former returns "" and the latter returns nil. (#418) +
  • misc +
    • added SOAP::WSDLDriverFactory#dump_method_signatures. it returns a formatted text which describes method signatures. (#141) + +
    • added servletStubCreator. wsdl2ruby.rb with --servlet_stub creates servlet stub for WEBrick. (#290) +
    • wsdl2ruby.rb generated too much 'XSD::QName.new(...)' parts. let wsdl2ruby.rb/xsd2ruby.rb extract common namespace definitions as constants. (#381) +
    • let wsdl2ruby.rb/xsd2ruby.rb generate member types as a comment for each class in classdef file. (#384) +
    • do not raise warning when there's a simpleType definition which have non-enumeration restriction. Generated mapping registry wrongly contained references to undefined classes. (#399) +
    • [BUG] as a workaround of class name crash problem between generated class and generated driver, add --drivername_postfix option to wsdl2ruby.rb. (#372) +
    • [BUG] soap4r without httpclient caused NameError. forgot to add required dependency in the previous release. (#403) +
+ +

+Thanks to all of soap4r-ml members and soap4r users for their support. +And special thanks to following contributors; +

+
+'Aaron Pfeifer' for contributing a patch for safemethodname.
+'Andi Wundsam' for contributing a patch for net/http + no_proxy.
+'anonymous contributor from Wall St.' for contributing a MSSOAP + Excel sample.
+'Emil Marceta' for contributing a patch for one-way service support and many test cases that points a bug of soap4r.
+'Ernie' for contributing a helloworld WSDL sample and WSDL service feature of HTTPServer.
+'Felipe Contreras' for contributing an union + memberType sample, patches for missing 'require', and a patch to allow to customize default ns definition of SOAP Envelope.
+'Greg Lappen' for contributing an eBaySvc sample.
+'Ger Apeldoorn' for contributing a sample of complex type + MIME attachment.
+'Jamie Herre' for contributing a SwA implementation.
+'John Anderson' for contributing a patch for handling gzipped HTTP content.
+'Junichi Uekawa' for contributing a HTTP redirection patch for net/http.
+'Kent Sibilev' for contributing a patch for correct extraattr handling of SOAPHeaderItem.
+'KR, Vesa Varimo' for contributing a patch for correct handling of XML Schema's choice element.
+'Leoš Bitto' for contributing a patch for XML pretty print.
+'Michael Neumann' for contributing an original implementation of standaloneServer.
+'Oliver M. Bolzer' for contributing a patch for net/http + SSL.
+'Owen Fraser-Green' for contributing a patch for MIME CRLF handling.
+'Patrick Chanezon' for contributing a patch for wsdl2ruby classdef name option.
+'Peter Gardfjäll' for contributing a patch for wsdl:fault handling.
+'Sandi Metz' for contributing a patch for SwA in document/literal service.
+'SHINAGAWA, Norihide' for contributing a patch for emx platform.
+'Tadayoshi Funaba' for contributing a patch for date/time XMLSchema datatypes.
+'UENO Katsuhiro' for xmlscan implementation.
+'Walter Korman' for contributing soap4r.gemspec and a workaround patch for gem's require problem.
+'wrex' for contributing a patch for soap4r to work with SalesForce service.
+
+ +

2. Install

+ +

+At first, see Dependencies section. +You may need to install some extra packages. +Next, get the archived file of SOAP4R and extract it, then simply try; +

+
+$ ruby install.rb
+
+ +

+Necessary files will be installed to suitable directory. +

+ +

+Files and directories in lib directory are SOAP4R library program itself. +

+ +
+
lib/
+
Libraries.
+ +
sample/
+
SOAP4R samples. +See Samples section.
+ +
test/
+
Tests. It also contains useful sample scripts for servers and clients. +
+test/interopR2/ directory includes Clients/Server for +`SOAPBuilders Interoperability Lab.' +Followings are advanced examples to use complex type transmit, +sending base64 encoded string, multi-dimensional array, and so on. +
    +
  • test/interopR2/server.rb is a RPC Server side implementation.
  • +
  • test/interopR2/client.rb is a RPC Client side implementation.
  • +
  • test/interopR2/base.rb includes common definitions for client/server.
  • +
+
+
+ +

3. Uninstall

+ +

+Simply delete installed files. +

+ +

4. What is SOAP4R?

+ +

+'SOAP4R' is an implementation of +SOAP 1.1 (W3C Note). +

+ +

+Comments, information such as interoperability between SOAP4R and another implementation are welcomed. +Feel free sending mail to +nahi@ruby-lang.org. +

+ +

5. Dependencies

+ +

+SOAP4R is written in Ruby and aims to use with Ruby application. +You have to install ruby itself. Tested against the following ruby versions. +

+ +
    +
  • ruby-1.8.5
  • +
  • ruby-1.8.5 patchlevel 52
  • +
  • ruby-1.8.6
  • +
  • ruby-1.8.6 patchlevel 36
  • +
+ +

+SOAP4R depends on following Ruby modules in +RAA. +You also have to install these modules to use SOAP4R. +

+ +
+
[RAA:httpclient] (2.1.0 or later) (required)
+
Yet another HTTP client implementation by NaHi. +httpclient is formerly known as http-access2.
+ +
[RAA:uconv] (0.4.10) (not required but needed if your Ruby doesn't have iconv module and you need UTF-8 encoded Japanese chars)
+
by Yoshida Masato. +It is requred when you want automatic CES conversion between +SJIS <-> UTF8 and EUC <-> UTF8. +Note: SJIS <-> EUC uses NKF module which is in standard distribution. +
+ +
+ +

6. Samples

+ +

+Samples are in sample/ directory of distribution. +Some samples try to connect to public servers. +Set environment variable HTTP_PROXY if you are in a firewall and you have +http proxy to the internet like; +

+
+$ export HTTP_PROXY=http://myproxyserver:8080
+  or
+$ setenv HTTP_PROXY http://myproxyserver:8080
+
+ +

basic/ ... basic samples

+ +
+
babelfish.rb
+
a SOAP client sample to connect to a babelfish server.
+
whois.rb
+
a SOAP client sample to connect to a whois server.
+
flickr.rb
+
a SOAP client sample to connect to the flickr SOAP server and extract data from XML response.
+
yahooNewsSearch.rb
+
a HTTP client sample to connect to the Yahoo news search REST service and extract data from XML response.
+ +
helloworld/
+
a SOAP server and client sample of 'Hello World'. + To run the server; +
+$ ./server.rb
+
+ And to connect to the server, run the client; +
+$ ./client.rb
+
+
+ +
calc/
+
Calc service contains 2 servers and 2 clients. + calc.rb is hosted by server.rb, calc2.rb is hosted by server2.rb. + client.rb is for server.rb, client2.rb is for server2.rb. +
+
calc.rb
+
Calc server definition using module and module methods. + This module responds 'add', 'sub', 'multi' and 'div'. +
+
server.rb
+
Standalone server. + It requires calc.rb and serve module methods of this module. + To run this server; +
+$ ./server.rb
+
+
+
server.cgi
+
CGI version. + To run this server, copy server.cgi and calc.rb to suitable + directory of your WWW server. +
+
client.rb
+
It connects to server.rb or server.cgi, + and hit methods served by calc.rb. + To run the client; +
+$ ./client.rb
+
+ Is it stacked? Did you run the server.rb?
+ Turn logger and wireDumpDev in its source on to see logs and wire + dumps of SOAP transport. +
+
calc2.rb
+
Calc server definition using class and instance methods. + An instance of this class holds its value. Methods 'set' and 'get' + is to set/get the value. + It also responds to '+', '-', '*', and '/'. +
+
server2.rb
+
It requires calc2.rb and creates an instance of CalcService2 + that responds all SOAP requests. + Since '+', '-' and so on of calc2.rb are not valid name as an + element in XML instance, this sample register the method '+' as + 'add', '-' as 'sub', and so on. +
+
server2.cgi
+
CGI version. + To run this server, copy server2.cgi and calc2.rb to suitable + directory of your WWW server. +
+
client2.rb
+
It connects to server2.rb or server2.cgi. + Set a value at first and call methods like 'puts objAtServer + 2'. +
+
+
+ +
exchange/
+
A sample to retrieve the currency rate from public SOAP service. +
+
iExchange.rb
+
It includes common definitions for client and server of + Exchange service. Including only a definition of namespace URI of + this service.
+
exchange.rb
+
Definition of servant class ExchangeService which returns the + currency rate after connecting to another site by SOAP to get the + real rate. + So that this class is the SOAP server for local client and + is also a SOAP client for public server. + An instance of this class is hosted by server.rb. + The instance responds to only 'getRate' which receives two country + code such as 'USA' and 'Japan'.
+
server.rb
+
It requires exchange.rb and creates an instance of + ExchangeService that responds all SOAP requests. + To run this server; +
+$ ./server.rb
+
+
+
server.cgi
+
CGI version. To run this server, copy server.cgi and exchange.rb + to suitable directory of your WWW server.
+
client.rb
+
It connects to server.rb. Turn logger and wireDumpDev in its + source on to see logs and wire dumps of SOAP transport. + To run the client; +
+$ ./client.rb
+
+
+
+
+ +
sampleStruct/
+
A sample to transmit complex structured object which has recursive + object reference. +
+
iSampleStruct.rb
+
It includes common definitions for client and server of + SampleStruct service. Definition of SampleStruct class and + namespace URI of this service.
+
sampleStruct.rb
+
Definition of servant class SampleStructService. + An instance of this class is hosted by server.rb. + The instance responds to only 'hi' which receives a SampleStruct + and wraps it in the new instance of SampleStruct to return .
+
server.rb
+
It requires sampleStruct.rb and creates an instance of + SampleStructService that responds all SOAP requests. + To run this server; +
+$ ./server.rb
+
+
+
server.cgi
+
CGI version. To run this server, copy server.cgi and + sampleStruct.rb to suitable directory of your WWW server.
+
client.rb
+
It connects to server.rb. Turn logger and wireDumpDev in its + source on to see logs and wire dumps of SOAP transport. + To run the client; +
+$ ./client.rb
+
+
+
+
+ +
wsdl_helloworld/
+
A sample 'Hello World' SOAP client and server which utilize WSDL. + See wsdl_helloworld/README for more detail
+
+ +

payload/ ... various payload configuration

+ +
+
basicauth/
+
BasicAuth server and client sample.
+ +
cookies/
+
HTTP-Cookies server and client sample.
+ +
ssl/
+
SSL SOAP server and client samples. +
+
sslserver.rb
+
SSL server sample which hosts "hello world" service. + This server uses SSL server certificate in files/ directory + (SSL client should check this certificate for SSL server + authentication).
+
sslserver_noauth.rb
+
This server generates SSL server certificate + at runtime. No security.
+
sslserver_require_clientauth.rb
+
This server users SSL server certificate in files/ directory + and requires SSL client authentication (clients must + have SSL client certificate and send it to the server).
+
sslclient.rb
+
SSL client sample which calls "hello world" service via HTTPS. + This client checks SSL server certificate sent from SSL server.
+
sslclient_require_noserverauth.rb
+
This client does not check SSL server certificate. + No security.
+
sslclient_with_clientauth.rb
+
This client sends SSL client certificate in files/ directory + and checks SSL server certificate.
+
+
+ +
gzipped/
+
gzipped content negotiation server and client sample.
+
+ +

soapheader/ ... SOAPHeader configuration

+ +
+
authheader/
+
It contains a sample to utilize SOAP Header handler. Send + userid/passwd and receive sessionid via SOAP Header
+ +
soapext_basicauth/
+
It contains a sample to do BasicAuth in SOAPHeader. (http://soap-authentication.org/basic/2001/10/)
+
+ +

attachment/ ... SOAP with Attachment (SwA)

+ +
+
swa/
+
SOAP server and client sample of SwA (SOAP with Attachments).
+ +
complexmime/
+
SOAP server and client sample of Complex Type + SwA
+
+ +

howto/ ... various other configuration

+ +
+
as_xml/
+
Sample client to send a request with XML, and receive a response as XML.
+ +
base64/
+
Sample client to send/receive base64 data.
+ +
documentliteral/
+
Sample client and server of document/literal service. See README.txt in this directory to run this sample.
+ +
filter/
+
Sample client and server of filtering request/response before sending/receiving.
+ +
scopesample/
+
SOAP server sample which shows a different behavior of SOAP server scope settings; Request scope vs Application scope. + sample/soap/scopesample/servant.rb is a servant which holds push-ed + object that can be pop-ed afterward. + See sample/soap/scopesample/server.rb how to define a servant as + a Request scope servant or an Application scope servant. + Application scope servant works as we expected because the servant + object is living from beginning to the time server terminated. + In contrast, request scope servant(s) does not work because a servant + object is created for each request. +
+ +
styleuse/
+
Sample client and server of SOAP style and use combination, especially rpc/literal and document/encoded.
+ +
wsdl_fault/
+
Sample client and server of handling SOAP fault specified in a WSDL. See wsdl_fault/README.txt for more detail.
+ +
wsdl_hash/
+
Sample client and server of sending/receiving Hash struct defined in a WSDL.
+
+ +

marshal/ ... object <-> XML marshalling

+ +
+
digraph.rb
+
A sample of SOAP marshalling/unmarshalling. + It creates a digraph that contains multi-ref-ed nodes at first + and marshals this object to get serialized XML instance. + Then reads and unmarshals this XML instance to recover a object + which has the same links among nodes in the digraph. +
+ +
customfactory.rb
+
Sample program for customizing mapping registry.
+ +
enum/
+
Sample program to demonstrate how xsd2ruby.rb works.
+
+ +

showcase/ ... showcase sample to demonstrate

+ +
+
raa2.4/
+
sample/soap/raa2.4/sample.rb is a sample client to retrieve project + information on RAA. It uses raaDriver.rb which is generated by + wsdl2ruby.rb from WSDL at + http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/. + You'll find wsdlDriver.rb in sample/wsdl/raa2.4/wsdlDriver.rb which + loads the WSDL at runtime to connect.
+ +
icd/
+
A client for + Insider's Computer Dictionary Web Service. + This service is implemented with ASP.NET so that it's also a sample of + a client which connects to ASP.NET. + CAUTION: this sample contains non-ascii chars in its source and dumped + results. +
+
IICD.rb
+
Class(type) definitions for this server.
+
icd.rb
+
Client implementation. To run the client; +
+$ ./icd.rb
+
+
+
+
+ +
googleSearch/
+
Sample client to search with Google Web API using WSDL. You need to get a developer's key to use it. See wsdlDriver.rb.
+ +
amazon/
+
Sample client to connect with AmazonWebServices using WSDL. See wsdlDriver.rb.
+ +
noaa/
+
Sample client of National Weather Service digital weather forecast data service at http://weather.gov/
+ +
raa2.4/
+
sample/wsdl/raa2.4/wsdlDriver.rb is a sample client to retrieve + project information on RAA. It loads WSDL file + http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/ + at runtime. + You'll find a sample client at sample/soap/raa2.4/sample.rb + which connects RAA using pre-generated service definitions + (not loads WSDL at runtime).
+ +
googleAdwords/
+
Sample client of Google AdWords service. + CAUTION: I don't have an account of AdWords so the sample code is NOT + tested. Please tell me (nahi@ruby-lang.org) if you will get good/bad + result in communicating with AdWords Server.
+ +
amazonEC/
+
Sample client of AWSECommerce service. + CAUTION: I don't have an account of AWSECommerce so the sample code is + NOT tested. Please tell me (nahi@ruby-lang.org) if you will get + good/bad result in communicating with AWSECommerce Server.
+
+ +

+There are more samples in this directory. +

+ +

7. Resources

+ +
+
soap4r project page
+
You can get the latest information and the latest development version of soap4r here.
+ +
[RAA:soap4r]
+
RAA meta information
+ +
soap4r-ml on Google Groups
+
Feel free to join the list to ask any question and comment about soap4r. + You can browse messages archive. Bear in mind that Google Groups is still + in [beta] stage.
+ +
Subversion repository
+
Soap4r's svn repository is here: http://dev.ctor.org/svn/soap4r/ . + To checkout the latest soap4r module, try +
+svn checkout http://dev.ctor.org/svn/soap4r/trunk soap4r
+
+ CVS repository of soap4r which was located at cvs.ruby-lang.org is pending since 2004-05-27.
+
+ +

8. History

+ +
+
1.5.7 - Jul 16, 2007
+
Version 1.5.7 mainly intends to fix regression problems introduced in 1.5.6. +Here are changes in 1.5.7 from 1.5.6. +
  • Environment +
    • soap4r gem depends on httpclient >= 2.1.0. (#379) +
    • let soap4r http clients (SOAP::RPC::Driver and WSDL/XSD importers) do not check soap_use_proxy environment variable and use only http_proxy/HTTP_PROXY and no_proxy/NO_PROXY envvars for proxy configuration. no need to set 'soap_use_proxy=on' envvar anymore. But to avoid proxy injection problem, when a library is used on CGI environment (with checking REQUEST_METHOD envvar existence), soap4r http clients use cgi_http_proxy/CGI_HTTP_PROXY envvar instead of http_proxy/HTTP_PROXY. (#378) +
  • SOAP/Ruby mapping +
    • try to call klass.soap_marshallable before mapping an XML element to the klass while unmarshalling. to avoid auto-mapping from element name, define klass.soap_marshallable method let it return false. (#223) +
    • let xsd2ruby.rb generate a mapping registry and a mapper from XML Schema definition. the mapper has obj2xml and xml2obj which uses the generated mapping registry. you can use this instead of XSD::Mapping.obj2xml and XSD::Mapping.xml2obj which does not know anything about mapping. (#362, #363) + +
    • [BUG] Array or Struct was not properly marshalled when literal service + generated stub combination. (#360) +
    • [BUG] derived class was marshalled without xsi:type for literal service. (#361) +
    • [BUG] passing nil as a basetype through generated mapping registry was broken in 1.5.6. (#369) +
    • [BUG] an rpc/encoded parameter could be wrongly typed when the parameter is typed as a derived type from a base type of XML Schema datatypes. (#371) +
    • [BUG] under the earlier versions, we could use [] instead of CountryTargets[]. from 1.5.6-GA it doesn't work. let LiteralRegistry decide how the class should be mapped to according to the defined class in the parent complexType. (#373) + +
  • SOAP +
    • allow xsi:nil="true" element as an RPC request though I don't think it's SOAP spec compliant. (#374) +
    • allow to customize default ns definition of SOAP Envelope. SOAPGenerator.new gets option hash as 'opt' and treats opt[:default_ns] as a XSD::NS which stores default ns definition of SOAP Envelope. See how it works in test/soap/test_custom_ns.rb. (#380) + +
  • Payload +
    • added an API for filtering streamhandler to capture/generate HTTP header. (#276) +
    • added 'protocol.http.auth' option to set authentication information for both BasicAuth and DigestAuth. with the latest httpclient (formerly known as http-access2), now soap4r client can connect to DigestAuth server. (#345) + +
  • WSDL +
    • importer should not import http://schemas.xmlsoap.org/soap/encoding/. (#366) +
    • [BUG] error when simpleType element usage as "part" definition directly. (#367) +
    • [BUG] wsdl2ruby.rb did not generate a classdef entry for empty element definition such as <element name="foo"/>. let wsdl2ruby.rb generate 'class Foo < String'. (#370) +
+ +
1.5.6 - Jun 14, 2007
+
Here are changes in 1.5.6 from 1.5.5. +
  • SOAP/Ruby mapping +
    • specify sending XML document over SOAP by REXML::Element or to_xmlproc -able object. (#21) +
    • encode or decode of single basetype parameter according to type definition in rpc/encoded service. (#14, #98) +
    • determining rpc method paramaters and outputs at runtime with MethodDefCreator" rel="nofollow">MethodDefCreator#{collect_rpcparameter|collect_documentparameter} (#142) +
    • support an array element name other than 'item' in document/literal service. (#150) +
    • let document/literal service proxy generated by +WSDLDriverFactory accept key-value pair array of array ([['k1', 'v1'], +...]) as same as a hash ({'k1' => 'v1', ...}). (#156) +
    • allow an XSD::QName as a value of extraattr such as <elename xmlns:n1="urn:valuenamespace">n1:value</elename>. (#157) +
    • SwA and doc/lit service. (#165) +
    • allow to define an empty SOAP Body service. Thanks, emil. (#174) +
    • method overloading support. allow to define methods which have +same name and different signatures, and let Router invoke a method +according to SOAPAction. you need to define methods with different +SOAPAction. (#233) +
    • let Driver#generate_explicit_type work for ltieral service, too. (#234) +
    • get the raw XML from the response. you get a result as an XML string when you set Driver#return_response_as_xml = true. (#250) +
    • do not validate CES of String by default to avoid consuming +memory. let XML processor check it instead. (you can turn it on by +XSD::XSDString.strict_ces_check = true) (#265) +
    • allow SOAP::Mapping::Object to dump/load with marshal_dump/marshal_load. (#266) +
    • handle CDATA correctly with xmlscan and rexml (only xmlparser worked). (#332) +
    • defined omit element / xsi:nil="true" elemet control. nil +means xsi:nil="true" for encoded service and nil means element omission +for literal service. pass SOAPNil.new to pass xsi:nil="true" for +literal service. (#343) +
    • one-way service support. (#200, #346, #347) +
    • offer clearly defined message interceptor API. see test/soap/filter for more detail. (#350) +
    • SOAPElement.from_obj(obj): allow to set XML attribute. this +method is called when you pass a Hash or [['key1', 'value1'], ...] to +literal service so you can easily add XML attribute to a request. see #331 for more detail. (#331) +
  • Payload +
    • merged a patch from Ernie that enables httpserver to serve WSDL. (#161) +
    • allow user to set own streamhandler of a SOAP::RPC::Driver. (#180) +
    • let Driver#test_loopback_response work under soap4r + net/http. (#181) +
    • allow to define basic_auth parameters with property file. (#198) +
    • follow HTTP redirection even with net/http. (#280) +
    • [ruby-Bugs-7532] make SOAP::HTTPStreamHandler handle gzipped content. Thanks, John Anderson. (#310) +
  • SOAP format +
    • SOAP actor name can be set through HeaderHandler. (#19) +
    • support xsd:token and xsd:language. Thanks, Jirka Pech. (#252) +
    • let XSD::QName immutable. (#274) +
    • allow Header::Handler to access SOAPHeader from inside of on_outbound. (#354) +
  • WSDL +
    • support <xsd:list> of <xsd:simpleType>. (#3, #248) +
    • support <xsd:union> of memberTypes. (#6) +
    • support <xsd:extension> for <xsd:complexContent>. (#72) +
    • support <any>. (#148, #155) +
    • support <xsd:restriction> for <xsd:complexContent>. (#167) +
    • support <choice>. (#168, #205) +
    • support simpleContent + attribute extension. (#176) +
    • generate Array classdef for maxOccurs="unbounded" element. (#182) +
    • support minLength and maxLength attributes. (#185) +
    • support abstract attribute of complexTypes. (#195) +
    • moved @@schema_* things in classdef definition generated by +wsdl2ruby.rb to mapping registry. Mapping registries for each classdef +are defined in independent file and required from driver and server. +NOTE: old classdef files should still work but it should be +re-generated by new wsdl2ruby.rb. (#175, #267, #270) +
    • support wsdl:fault definitions. Thanks, Peter Gardfjall. (#319) +
  • Samples +
    • add a demo how to call from Excel a simple soap service running +in apache (sample/soap/mssoap/) Thanks, an 'anonymous contributor from +Wall St.' (#143, #154) +
    • a sample to send an integer as Long type. (#160) +
    • an eBaySvc sample by Greg. Thanks! (#183) +
    • basicauth client + server sample. (#249) +
    • cookie client + server sample. (#321) +
  • misc +
    • add a --prefix option in install.rb. (#255) +
    • warn misusage of lib/wsdl/soap/wsdl2ruby.rb. (#339) +
    • wsdl2ruby --classdef could have an optional classname argument. Thanks, P@. (#173) +
    • putting the classes that support a web service into a service-specific module. check --module_path (#279) +
+
+ +
1.5.5 - Sep 15, 2005
+
Here are changes in 1.5.5 from 1.5.4. +
  • SOAP +
    • allow to configure an envelope namespace of SOAP request. (#124) +
      TemporaryNamespace = 'http://www.w3.org/2003/05/soap-envelope'
      +@client.options["soap.envelope.requestnamespace"] = TemporaryNamespace
      +@client.options["soap.envelope.responsenamespace"] = TemporaryNamespace
      +@client.do_proc(...)
      +
      +
    • let SOAP request XML indent space configuable. see "soap.envelope.no_indent" option. (#130) + +
    • let external CES configuable. ex. client["soap.mapping.external_ces"] = 'SJIS'. $KCODE is used by default. (#133) +
      external CES ::= CES used in Ruby object of client and server
      +internal CES ::= CES used in SOAP/OM
      +
      +
    • add iso-8859-1 external CES support. (#106) +
    • fixed illegal 'qualified' handling of elements. it caused ASP.NET inteoperability problem. (#144) +
    • added 'soap.envelope.use_numeric_character_reference' (boolean) option to let query XML use numeric character reference in XML, not plain UTF-8 character. GoogleSearch server seems to not allow plain UTF-8 character since 2005-08-15 update. (#147) +
    • SOAP::Header::SimpleHeader (de)serialization throws an exception on SimpleHeader.on_(in|out)bound when header is a String. so we could not use a simple single element headerItem. fixed. thanks to emil. (#129) + +
    • out parameter of rpc operation did not work. (#132) +
    • follow HTTP redirect only if using http-access2. (#125) (#145) +
    • add a workaround for importing an WSDL whose path begins with drive letter. (#115) +
  • WSDL +
    • SOAP Data which is defined as a simpletype was not mapped correctly to Ruby obj when using wsdl2ruby.rb generated classdef file. (#123) +
    • rpc/literal support. (#118) + +
    • re-implemented local element qualify/unqualify control. handles elementFormDefault and form in WSDL. (#119) +
    • Array of an element which has simpleType causes a crash. (#128) +
    • prarmeterOrder may not contain return part so it can be shorter than parts size. Thanks to Hugh. (#139) +
  • Samples +
    • added BasicAuth client sample. (#117) +
    • added Base64 client/server sample. +
    • added Flickr SOAP interface client sample. (#122) + +
    • added SalesForce client sample. (#135) +
    • updated Thawte CA certificate for GoogleAdWords sample. +
    • updated a client script with the newer version made by Johan. thanks! +
    • shortened long file names. (#120) +
    • fixed typo in authheader sample. (#129) +
    • updated deprecated method usage. (#138) +
+
+ +
1.5.4 - May 13, 2005
+
This is version 1.5.4. +Version 1.5.3 is the module which is included in ruby-1.8.2, +and not released independently. +Following changes consist from 2 parts; Changes from 1.5.3 to 1.5.4, +and from 1.5.2 to 1.5.3. +

+Changes in 1.5.4 from 1.5.3 +

+
    +
  • SOAP client and server +
      +
    • for both client side and server side +
        +
      • improved document/literal service support. style(rpc, document)/use(encoding, literal) combination are all supported. for the detail about combination, see test/soap/test_style.rb.
      • +
      • let WSDLEncodedRegistry#soap2obj map SOAP/OM to Ruby according to WSDL as well as obj2soap.
      • +
      • let SOAP::Mapping::Object handle XML attribute for doc/lit service. you can set/get XML attribute via accessor methods which as a name 'xmlattr_' prefixed (<foo name="bar"/> -> Foo#xmlattr_name).
      • +
      +
    • +
    • client side +
        +
      • WSDLDriver capitalized name operation bug fixed. from 1.5.3-ruby1.8.2, operation which has capitalized name (such as KeywordSearchRequest in AWS) is defined as a method having uncapitalized name. (converted with GenSupport.safemethodname to handle operation name 'foo-bar'). it introduced serious incompatibility; in the past, it was defined as a capitalized. define capitalized method as well under that circumstance.
      • + +
      • added new factory interface 'WSDLDriverFactory#create_rpc_driver' to create RPC::Driver, not WSDLDriver (RPC::Driver and WSDLDriver are merged). 'WSDLDriverFactory#create_driver' still creates WSDLDriver for compatibility but it warns that the method is deprecated. please use create_rpc_driver instead of create_driver.
      • +
      • allow to use an URI object as an endpoint_url even with net/http, not http-access2.
      • +
      +
    • +
    • server side +
        +
      • added mod_ruby support to SOAP::CGIStub. rename a CGI script server.cgi to server.rb and let mod_ruby's RubyHandler handles the script. CGIStub detects if it's running under mod_ruby environment or not.
      • +
      • added fcgi support to SOAP::CGIStub. see the sample at sample/soap/calc/server.fcgi. (almost same as server.cgi but has fcgi handler at the bottom.)
      • +
      • allow to return a SOAPFault object to respond customized SOAP fault.
      • +
      • added the interface 'generate_explicit_type' for server side (CGIStub, HTTPServer). call 'self.generate_explicit_type = true' if you want to return simplified XML even if it's rpc/encoded service.
      • +
      +
    • +
    +
  • + +
  • WSDL +
      +
    • WSDL definition +
        +
      • improved XML Schema support such as extension, restriction, simpleType, complexType + simpleContent, ref, length, import, include.
      • +
      • reduced "unknown element/attribute" warnings (warn only 1 time for each QName).
      • +
      • importing XSD file at schemaLocation with xsd:import.
      • +
      +
    • +
    • code generation from WSDL +
        +
      • generator crashed when there's '-' in defined element/attribute name.
      • +
      • added ApacheMap WSDL definition.
      • +
      +
    • +
    +
  • + +
  • Samples +
      +
    • added XML <-> Ruby mapping utility. XSD::Mapping#xml2obj maps an XML to a tree of SOAP::Mapping::Object. XSD::Mapping#obj2xml is for reverse direction conversion. see a sample in sample/wsdl/noaa/client.rb
    • +
    • added a sample for weather.gov's NDFD services.
    • +
    • add a sample of googleAdWords. CAUTION: I don't have an account of AdWords so the sample code is NOT tested. Please tell me (nahi@ruby-lang.org) if you will get good/bad result in communicating with AdWords Server.
    • +
    • add a sample of AWSECommerce. CAUTION: I don't have an account of AWSECommerce so the sample code is NOT tested. Please tell me (nahi@ruby-lang.org) if you will get good/bad result in communicating with AWSECommerce Server.
    • +
    +
  • + +
  • Redists +
      +
    • include xmlscan as a redistributed module. xmlscan now is a first class XML processor. still soap4r should run with REXML and XMLParser.
    • +
    +
  • +
+
+Changes in 1.5.3 from 1.5.2 +

+
    +
  • SOAP client and server +
      +
    • for both client side and server side +
        +
      • added a header handler class for simple SOAPHeader handling. see samples in sample/soap/authheader/*.
      • +
      • SSL support (both client side and server side). check sample/soap/ssl/*
      • +
      • gzipped content encoding support. see sample/soap/helloworld/hw_{c,s}_gzip.rb.
      • +
      +
    • +
    • client side +
        +
      • HTTP-Cookies support under soap4r + http-access2. not supported under soap4r + net/http.
      • +
      • added a method (SOAP::RPC::Driver#test_loopback_response) for loopback test with the specified response.
      • +
      • added SOAP::RPC::Driver#loadproperty interface to load property file.
      • +
      • let SOAP::RPC::Driver#add_method returns Method object. you can invoke a service like; drv.add_method("hello").call("world")
      • +
      • added http options to get/set timeout seconds. +
          +
        • for http-access2: +
            +
          • driver.options["protocol.http.connect_timeout"]
          • +
          • driver.options["protocol.http.send_timeout"]
          • +
          • driver.options["protocol.http.receive_timeout"]
          • +
          +
        • +
        • for net/http: +
            +
          • driver.options["protocol.http.connect_timeout"]
          • +
          • driver.options["protocol.http.receive_timeout"]
          • +
          +
        • +
        +
      • +
      • raise NotImplementedError when net/http + basic_auth.
      • +
      +
    • +
    • server side +
        +
      • introduced the new server class SOAP::RPC::HTTPServer which takes WEBrick's HTTPServer compatible config parameter.
      • +
      • added a debug log of SOAP request/response.
      • +
      +
    • +
    +
  • + +
  • SOAP core part +
      +
    • added XMLSchema derived type support; byte, nonPositiveInteger, negativeInteger, nonNegativeInteger, positiveInteger, unsignedLong, unsignedInt, unsignedShort, unsignedByte.
    • +
    • 'eval' cleanup. I hope it allows soap4r to work under mod_ruby environment.
    • +
    • SOAPProperty raise RuntimeError under ruby-1.9 when accessing locked property. still raises TypeError under ruby-1.8 or earlier. the change is from ruby's behaviour change about an exception when accessing a frozen object.
    • +
    • make SOAPHeader a child of SOAPStruct, not SOAPArray.
    • +
    • SOAPProperty does not eval whole string. \\, \t, \r, \n, \f escaping chars are supported like Java's Properties.
    • +
    • URI object was not mapped correctly so that URI object was not interoperable under some situation. fixed.
    • +
    • SOAP::Mapping::Object: handle multiple value as an array. +
      +<foo>
      +  <bar>1</bar>
      +  <bar>2</bar>
      +  <bar>3</bar>
      +  <baz>4</baz>
      +</foo>
      +  ->
      +foo.bar => [1, 2, 3]
      +foo.baz => 4
      +
      +
    • +
    • raise an exception while dumping singleton class. [ruby-dev:22588] +
      +e.g. c = class << Object.new
      +       class C; self; end
      +     end
      +     SOAPMarshal.dump(c)
      +
      +
    • +
    +
  • + +
  • WSDL +
      +
    • WSDL definition +
        +
      • added <xsd:simpleContent> support.
      • +
      • initial (means "far from complete") simpleType support.
      • +
      • support parts attribute of soap:body element.
      • +
      • xmlSchema's 'any' element support; for parsing, just treat the element as an element which has a name 'any'.
      • +
      • add mustUnderstand attribute support.
      • +
      • a special well-known type: ApacheMap support.
      • +
      +
    • + +
    • code generation from WSDL +
        +
      • added simple code generation utils (lib/xsd/codegen)
      • +
      • dump attribute definition in XMLSchema as 'attr_*' attribute. [experimental]
      • +
      • wsdl2ruby.rb: add document/literal service support. see sample/wsdl/documentliteral/*
      • +
      • untyped element should be treated as xsd:anyType.
      • +
      • added a tool xsd2ruby.rb for generating classdef from xsd file.
      • +
      +
    • +
    +
  • + +
  • Samples +
      +
    • added RAA/2.4 sample client
    • +
    • added sample for Application/Request scope use. Session scope (with Cookies) feature is not yet exists.
    • +
    +
  • +
+
+ +
1.5.2 - December 25, 2003
+
+
    +
  • License; +
      +
    • Changed license from GPL2 to Ruby's.
    • +
  • + +
  • Features; +
      +
    • Add SOAP Messages with Attachments (SwA) support. + Patched by Jamie Herre. + "SOAP Messages with Attachments" is the W3C Note which defines a + binding for a SOAP 1.1 message to be carried within a MIME + multipart/related message. http://www.w3.org/TR/SOAP-attachments + This feature is still experimental. Interop testing is going on.
    • + +
    • HTTPS support even when you use net/http (not http-access2). + Patched by Oliver M. Bolzer.
    • + +
    • Property file support. SOAP and WSDL client reads "soap/property" + file located at somewhere in $: (ruby libray locations). For + example, save these lines to + "$rubylibdir/site_ruby/1.8/soap/property". +
      +client.protocol.http.proxy = http://myproxy:8080
      +client.protocol.http.no_proxy = 192.168.71.71,192.168.71.72
      +
      + Then all HTTP connections should use these proxy and no_proxy + definition.
    • + +
    • Do not trust "HTTP_PROXY" environment variable by default to + avoid security problem. cf. + + To use HTTP_PROXY and NO_PROXY environment variable, you must set + SOAP_USE_PROXY environment variable 'on', too. +
      +bash$ soap_use_proxy=on http_proxy=http://myproxy:8080 ruby ...
      +csh$  env soap_use_proxy=on http_proxy=http://myproxy:8080 ruby ...
      +
    • + +
    • Add SOAP::RPC::Driver#mandatorycharset= and + SOAP::WSDLDriver#mandatorycharset= interface to force using + charset when parsing response from buggy server such as AWS.
    • + +
    • Support a halfway-typed multi-ref array that Axis dumps.
    • + +
    • Added a interface XSD::Charset.encoding= to control internal + encoding scheme. Internal encoding scheme was fixed to 'utf-8' + when iconv or uconv was installed. You can set 'euc-jp', etc. + to avoid encoding scheme conversion if you know what encoding + scheme the server uses.
    • +
  • + +
  • Bug fixes; +
      +
    • SOAP::Marshal.unmarshal: raise an exception if parse fails. + (returned nil)
    • + +
    • SOAP::WSDLDriver: decode unknown element according to self-defined + type even if WSDL was given.
    • + +
    • SOAP::Mapping::Factory#create_empty_object: fix Class#allocate + emulation code for ruby/1.6. no effective change under ruby/1.8.
    • + +
    • SOAP::RPC::SOAPMethodResponse: element name of response message + could have the name other than 'return'.
    • + +
    • SOAP::RPC::StandaloneServer: add methods 'shutdown' and 'status' + as delegates to WEBrick.
    • + +
    • WSDL::SOAP::ClassDefCreator: WSDL/1.1 allows plural fault + definition in a operation.
    • + +
    • XSD::Charset.init: use cp932 under emx. + Patched by Siena. / SHINAGAWA, Norihide.
    • +
  • +
+ +
1.5.1 - November 2, 2003
+
+
    +
  • Features; +
      +
    • Sample updates; Update Amazon Web Service WSDL (v2 -> v3), and update RAA WSDL(0.0.1 -> 0.0.2). +
    • Supports ivars of basetype and extending modules marshalling with XML attribute. +Using XML attribute to support ruby object dependent information, marshalled object keeps compatibility with SOAP spec. +It shows the power of XML, extensibility.
      +Now I think SOAP marshaller supports all kind of object graph which is supported by Ruby's original marshaller.
    • +
    • Better XML pretty printing. +
      +puts SOAPMarshal.dump(Person.new("NaHi", 33))
      +
      +=>
      +
      +<?xml version="1.0" encoding="utf-8" ?>
      +<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      +    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
      +    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      +  <env:Body>
      +    <Person xmlns:n1="http://www.ruby-lang.org/xmlns/ruby/type/custom"
      +        xsi:type="n1:Person"
      +        env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      +      <age xsi:type="xsd:int">33</age>
      +      <name xsi:type="xsd:string">NaHi</name>
      +    </Person>
      +  </env:Body>
      +</env:Envelope>
      +    
    • +
  • + +
  • Installation; +
      +
    • The previous version soap4r/1.5.0 required http-access2 to be installed to build CGI server, but no longer needed fot this purpose now. +You can use almost all features of soap4r without http-access2, +but for actual usage, consider installing http-access2 for speed and +thread-safe SOAP client.
    • +
    • Under ruby/1.8, installer installs lib files to rubylibdir(e.g. /usr/local/lib/ruby/1.8) instead of sitelibdir(e.g. /usr/local/lib/ruby/site_ruby/1.8)
    • +
  • + +
  • Bug fixes; +
      +
    • Do not introduce XSD constants to toplevel.
    • +
    • 'NO_PROXY'/'no_proxy' env var was not supported under net/http. Fixed.
    • +
    • Remove some ruby/1.8 dependent codes. Should work fine under 1.6, too.
    • +
    • XSD::XSDString did not check its value space under $KCODE = 'NONE' env for example where iconv module is not installed.
    • +
    • XSD::XSDFloat, XSD::XSDDouble: add +/- sign explicitly when stringified and embedded into XML instance. Ruby's sprintf may format -0.0 as "0.0" (no minus sign) depending on underlying C sprintf implementation.
    • +
  • +
+ +
1.5.0 - September 13, 2003
+
Thousands of lines are changed in this release +(*.rb in current SOAP4R distribution has 30kloc or over). +But the biggest change is coding convention, camelCase to non_camel_case. +Though I tried to keep compatibility between 1.5.0 and 1.4.8, but there's no +way to keep it at a few point. If you'll find your code which was developed +for 1.4.8 does not run under 1.5.0, feel free to ask +me to solve the problem. +
    +
  • Dependency libraries; +
      +
    • Add net/http support. Users can try sample SOAP clients without installing http-access2. For actual usage, consider installing http-access2 for speed and thread-safe SOAP client. CAUTION: Building SOAP CGI server needs http-access2 to be installed.
    • +
    • Soap4r standalone server requires webrick module to be installed instead of GServer.rb and httpserver.rb.
    • +
    • Supports iconv. To use utf-8, you need to install iconv(included in ruby/1.8) or uconv.
    • +
    • Suspend NQXML XML parser support.
    • +
    • Remove REXML processor version check. No longer needed.
    • +
    • Rewrite tests with test/unit.
    • +
  • + +
  • Features; +
      +
    • Efforts to support messaging with document/literal and ASP.NET interoperability.
    • +
    • Add document/literal messaging interface to wsdlDriver.rb. See a very brief example in sample/soapbox/wsdlDriver.rb though I still didn't try to login to Jabber server.. Jabber folks?
    • +
    • XML pretty printing.
    • +
    • Better Ruby object mapping. Rewrote RubytypeFactory to support more Ruby objects. Tests in AMarshal(http://cvs.m17n.org/~akr/amarshal/) much helped it. Thanks very much to Tanaka Akira-san.
    • +
    • SOAPMarshal accepts IO as an output device like Marshal#dump.
    • +
    • SOAPElement: constructor signature change. Added extraattrs attribute.
    • +
    • XSDDateTimeImpl: to_time did not set usec.
    • +
    • StreamHandler: add reset method to shutdown a connection to a site.
    • +
  • + +
  • Others; +
      +
    • Simplify installer and remove uninstaller. Saving inventory file in src dir could be the problem.
    • +
    • Class/Module architecture relocation.
    • +
    • Changing coding convention to fit with Ruby's. Added lib/soap/compat.rb which defines compatibility definitions for 1.4.8. lib/soap/compat.rb warns when the library is loaded.
    • +
    • Many warnings raised under 1.8, caused by illegal references like XSD::XSDInt in typeMap.rb. Soap4r defined toplevel::XSDInt. Define XSD* classes in XSD module and introduce it to toplevel.
    • +
  • +
+
+ +
1.4.8 - January 17, 2003
+
+This version has these enhancements and bug fixes; +
    +
  • Avoid warnings; +
      +
    • Use Object#class instead of Object#type.
    • +
    • Avoid implicit use a String as a regexp source.
    • +
  • +
  • Add wsdlDriver which reads WSDL file and allow client to call procedures. Here is an example to search Google. +
    +    require 'soap/wsdlDriver'
    +    searchWord = ARGV.shift
    +    # You must get key from http://www.google.com/apis/ to use Google Web APIs.
    +    key = File.open(File.expand_path("~/.google_key")).read.chomp
    +    GOOGLE_WSDL = 'http://api.google.com/GoogleSearch.wsdl'
    +    # Load WSDL and create driver.
    +    google = SOAP::WSDLDriverFactory.new(GOOGLE_WSDL).createDriver
    +    # Just invoke!
    +    result = google.doGoogleSearch(key, searchWord, 0, 10, false, "", false, "", 'utf-8', 'utf-8')
    +    result.resultElements.each do |ele|
    +      puts "== #{ele.title}: #{ele.URL}"
    +      puts ele.snippet
    +      puts
    +    end
    +  
  • +
  • WSDLDriver client examples of AmazonWebServices, RAA and RNN (Japanese Ruby blog site) are also included in sample/ dir.
  • +
  • Support xmlscan XML processor.
  • +
  • Changed XML processor detection scheme. Search xmlscan, REXML, XMLParser and NQXML in this order.
  • +
  • Rewrite charset handling of XML processor. +
      +
    • If you only use us-ascii and utf-8, all XML processors should work without uconv module.
    • +
    • With xmlscan/0.2 or later, you can handle euc-jp or shift_jis encoded XML instance WITHOUT uconv module.
    • +
    • With other XML processors includes xmlscan/0.1, you need to install uconv module to handle euc-jp or shift_jis encoded XML instance.
    • +
  • +
  • cgistub.rb: Overridable response mediatype. There exists a http client which does not accept the mediatype text/xml which is specified in SOAP spec. For example, an i-Mode (smart phone) client does not accept it... You can set response mediatype to 'text/plain' for such client though it violates SOAP spec...
  • +
  • wsdl2ruby: Add --force option to override existing file.
  • +
  • Fixed many bugs.
  • +
+ +
1.4.7 - September 20, 2002
+
+This version has these enhancements and bug fixes; +
    +
  • Includes WSDL4R initial release. +
      +
    • Bear in mind this is an alpha level code. +I wrote it halfway at half and a year ago, +and wrote the rest part in half and a day. +No comprehensive test, no strict syntax check, unfriendly error message, etc. +Try it if you want, and find bugs in it.
    • +
    • WSDL4R can run under XMLParser for now. +You might be able to let it run under NQXML/REXML if you know SAX +programming well. How XML processor is used under WSDL4R +is as same as under SOAP4R.
    • +
  • +
  • Added xsd:short support.
  • +
  • ::Float(double precision float in Ruby) is mapped to xsd:double now. +It was mapped to xsd:float.
  • +
  • Fixed a bug of year < 0 handling. B.C. 1 => -0001 in XMLSchema.
  • +
  • Fixed a bug of exception serialization. Custam mappingRegistry was not used.
  • +
  • Fixed a bug of regex for MediaType parsing.
  • +
+
+ +
1.4.5 - May 25, 2002
+
+This version has these enhancements; +
    +
  • Supports all primitive datatypes of XML Schema Part2 Datatypes except NOTATION. +Added types are Duration, gYearMonth, anyURI, QName and so on.
  • +
  • Runs much faster than earlier versions. +Some performance check and tuning has been done.
  • +
  • Supports all Ruby objects marshalling/unmarshalling +except some special objects. See below for more detail.
  • +
+ +CAUTION: This version requires +[RAA:date2] version 3.2 or later and +[RAA:http-access2] version F. +Please make sure the versions you use. +

+ +Here is detail of change. +
+
Datatypes (XMLSchemaDatatypes.rb and baseData.rb)
+
+
    +
  • Added duration, gYearMonth, gYear, gMonthDay, gDay, gMonth, anyURI and QName datetypes. +All primitive datatypes in XML Schema Part 2 section 3.2 except NOTAION are supported now.
  • +
  • Modified XSDDataTime, XSDDate and XSDTime implementation. These use a DataTime as a data holder.
  • +
  • Follow date/3.2: date2.rb -> date.rb.
  • +
  • Changed to_s representations of single float and double float. Thanks to gotoken.
  • +
  • XSDFloat: Add '0' if given str ends with 'E'. Float( "-1.4E" ) might fail on some system.
  • +
  • Added SOAPRawString class. Given string is embedded into XML instance directly. +You can use this class to embed (numeric) character references manually.
  • +
  • Fixed UTF8 regexp bug. XSDString uses this regexp to check a given string.
  • +
  • Added UT for XMLSchemaDatatypes.rb. See test/xsd_ut.rb and test/baseData_ut.rb.
  • +
+ +
SOAP <-> Ruby object mapping (mappingRegistry.rb and rpcUtils.rb)
+
+
    +
  • Exception raised from server side could not be mapped to specific exception. Fixed.
  • +
  • Refactoring to avoid *_eval. Reduced warnings.
  • +
  • Added Range marshalling support.
  • +
  • Regexp#options support under ruby/1.6.
  • +
  • Supports cyclic Range such as; +
    +  class Foo
    +    attr_accessor :foo
    +    def succ; end
    +    def <=>( rhs ); end
    +  end
    +
    +  o1 = Foo.new
    +  o2 = Foo.new
    +  r = o1..o2
    +  o1.foo = r
    +
    +  p SOAPMarshal.load( SOAPMarshal.dump( r ))
    +
  • +
  • Supports some instance variable of ruby standard class. +But instance variable of Array, Hash, String, Float and Bignum are not supported because of restriction of SOAP encoding format...
  • +
  • Alias ::SOAPMarshal to ::SOAP::Marshal.
  • +
  • Added Marshal.load and Marshal.dump as aliases to Marshal.unmarshal and + Marshal.unmarshal.
  • +
+ +
misc
+
+
    +
  • Dumps what parser is used when $DEBUG. Try 'ruby -d -rsoap/processor -e 0'
  • +
  • Added CGI samples in sample/.
  • +
  • Some performance check and tuning has been done on both client and server side. +One bottle neck is Kernel.methods which SOAP4R use(d) while mapping SOAP Data Model <-> Ruby object. +I replaced it with Object.respond_to? . +Another bottle neck of client side is delegate.rb which is used by http-access2. +Get [RAA:http-access2] version F. +
+
+
+
+ +
1.4.4 - May 6, 2002
+
+This is a bug fix release. +Following users should update. +
    +
  • Users who use DateTime datatype.
  • +
  • Developers of SOAP client/server which works under multi-thread condition.
  • +
  • REXML users.
  • +
+Fixed bugs. +
    +
  • XSDDataTime: Changed variable name usec to sec_frac. It's not a micro sec so name usec is misleading.
  • +
  • XSDTime: Fixed bugs in usec part.
  • +
  • date.rb in standard library and date2 version 3 conflicts because date2.rb is a successor of date.rb and not designed for dual use. +(ex. using a module which requires date.rb like DBI and another module which requires date2.rb). +Added a workaround for this.
  • +
  • SOAP::Processor was not MT-safe. Fixed. +Projected feature regards to MT are follows. +At least I hope so. Tell me if you find these wrong. +
      +
    • Driver: safe
    • +
    • Proxy: safe
    • +
    • Server: safe
    • +
    • CGIStub: safe
    • +
    • StandaloneServer: safe
    • +
    • RPCRouter: safe
    • +
    • StreamHandler: safe
    • +
    • Processor: safe
    • +
    • SOAPParser: unsafe
    • +
    • SOAPGenerator: unsafe
    • +
    • EncodingStyleHandler: unsafe
    • +
    +
  • +
  • SOAP4R/1.4.3 supports REXML/2.1.3 but it did not detect REXML processor automatically.
  • +
+
+ +
1.4.3 - April 11, 2002
+ +
+
+
Attention to 1.4.2 or earlier users;
+
+
    +
  • Stopped redistributing packages in RAA from this release. +Please get required packages from +RAA +and install it.
  • +
  • It still does NOT support WSDL!
  • +
+
+ +
New features
+
+
    +
  • Added REXML parser support.
  • +
  • Added uninstaller.
  • +
  • Re: samples +
      +
    • Added 3 new samples, Calc, Exchange, and SampleStruct.
    • +
    • Use environment variable HTTP_PROXY or http_proxy for http proxy.
    • +
    • Removed unreachable services.
    • +
    • RAA: Separate iRAA.rb into RAA.rb and iRAA.rb.
    • +
    • Added description about samples to RELEASE_en.html.
    • +
    +
  • Changed String encoding handling among +Ruby object <-> SOAP Data Model <-> XML instance. +
      +
    • Ruby object: $KCODE.
    • +
    • SOAP Data Model: utf-8 if uconv module is installed, $KCODE if not.
    • +
    • XML instance: Client side use utf-8 if uconv module is installed, +$KCODE if not. Server side try to adjust the request encoding.
    • +
    • Use regexp instead of NKF.guess to check if the given String is EUC/SJIS or not.
    • +
    +
  • +
  • Added 'addServant' interface to server side. See sample/Calc/server.rb.
  • +
  • Added 'addMethodAs' interface to both server side and client side. +See sample/Calc/server2.rb.
  • +
+
+ +
Changes
+
+
    +
  • Removed Japanese document. +I was tired of maintaining 2 separated documents. +Though my English is poor as you see, numbers of readers of my English document +should be more than one of my Japanese document. +Would you please tell me bug of my English composition and of course in the code?
  • +
  • Use +[RAA:devel-logger] +instead of +[RAA:application]. +
  • +
  • Avoided using exception in soap2obj and reduced warnings in runtime.
  • +
  • XSDDateTime: Use date2 version 3 instead of date3.rb. +Date2 version 3 will be included in standard distribution of Ruby/1.8.
  • +
  • XSDDateTime: Added XSDDateTimeToTime module to extract a Time object from XSDDateTime, XSDDate and XSDTime.
  • +
+
+ +
Bug fixes
+
+
    +
  • Set 'charset=' to content-type when sending back a SOAPFault. +It was not set.
  • +
  • XSDDateTime: Parsedate was not used. Removed.
  • +
  • Added constant Log as a canonical name of Devel::Logger for backward +compatibility of devel-logger.
  • +
  • Foo = Struct.new(:foo) and Foo = Struct.new("Foo", :foo) could not be + unmarshalled collectly. All members were unmarshalled as nil. Fixed.
  • +
  • Rescue ArgumentError(Unrecognized signal) in standaloneServer.rb for mswin32 ruby.
  • +
+
+
+
+ +
1.4.2 - December 28, 2001
+
+Many changes around Ruby language mapping for SOAP. +I replaced DRb's marshalling format with SOAP marshalling and it passed +about all unit test packed in DRb package. +Only test failed was regards to packet size. +You might be able to use SOAP::Marshal.(un|)marshal for serializing objects +instead of Marshal.(load|dump). + +
    +
  • Illegal decoding of a position-less element after position-ed element. Fixed.
  • +
  • Add Rubytype encoding/decoding support: Regexp, Class, Module and Symbol.
  • +
  • Added an option of MappingRegistry to raise an exception when unknown Struct. +The option is set 'false' by default so that same behaviour as before.
  • +
+ +
1.4.1 - December 7, 2001
+
SOAP4R/1.4 contained many bugs (as usual...) +1.4.1 is a maintenance release. Some bugs are fixed. +Thanks to Michael Neumann. + +
    +
  • instance_eval in SOAPStruct#add for adding accessor illegaly overrode important methods for SOAP4R such as name, name= and so on. Removed this instance_eval and rewrote other codes which did depend the code. Thanks to MNeumann for reporting it and giving a suggestion to fix it.
  • +
  • Fixed charset handling. Illegal charset was set when automatic XML processor detecting.
  • +
  • Removed unused code(self.decode) in element.rb.
  • +
  • Illegal constant access when SOAP format error. Fixed.
  • +
  • LiteralEncodingNamespace moved to SOAP module.
  • +
+ + +
1.4 - December 5, 2001
+
    +
  • Datatypes: +
      +
    • XSDFloat: Bug in rounding double float to single float. Fixed.
    • +
    • SOAPElement: Added for literal encoding.
    • +
    • Removed SOAP encoding functions from baseData. EncondingStyleHandler should decide how to encode SOAP data model. (ie. ASP.NET seems to have its own encoding style.)
    • +
    • SOAPHeaderItem: Changed interface for easy use.
    • +
  • + +
  • SOAP Encoding: +
      +
    • Encoding by itself, not using NQXML's tree object model.
    • +
    • At last, supported multi-ref encoding!
    • +
    • marshal.rb: Marshalling with Envelope and Body. To marshal multi-ref'd object, Body is needed. CAUTION: Not compatible between former implementation.
    • +
    • Add EncodingStyleHandlerLiteral and set it to default.
    • +
    • Renamed encoding.rb to encodingStyleHandler.rb.
    • +
    • Added ASP.NET encoding handler. ASP.NET seems to use literal encoding (by default) but it is easier with this encodingStyleHandler to access the service which is built with ASP.NET.
    • +
    • Changed element name escape. +
        +
      • :: <=> \.\.
      • +
      • [^a-zA-Z0-9_-] <=> \.[0-F][0-F] +
      +Limitation: Using SOAP4R's RPC function, you cannot use the name which contains '.' for method name, class/struct name, and accessor name. In Ruby world, it should not be a problem I believe.
    • +
  • + +
  • RPC related functions: +
      +
    • Driver: Added 'invoke' method for messaging.
    • +
    • Driver: Content of SOAPFault detail element is set in the exception which is thrown from SOAP Node to client application.
    • +
    • Processor: Changed Processor.(un|)marshal interface. An instance of NS for parsing/generating XML instance is prepared in parser/generator.
    • +
    • mappingRegistry.rb is devided from rpcUtils.rb.
    • +
  • +
+ + +
1.3.8 - October 4, 2001
+
Feedback from +SOAPBuilders Interoperability Lab "Round 2" +and Michael Neumann. Thanks! + +
    +
  • Datatypes: +
      +
    • XSDFloat: Creating float data from junk string such as "123.0junk" was + converted to 0.0. It should be avoided. Fixed.
    • +
    • XSDFloat: Fixed double -> single rounding code.
    • +
  • + +
  • RPC related functions: +
      +
    • Changed typename <=> NCName strategy. '::' <=> '.'
    • +
    • Added mappingRegistry argument to interfaces for SOAP object creation.
    • +
  • + +
  • Others: +
      +
    • Set faultstring '(No faultstring)' to SOAP Fault when empty faultstring element.
    • +
    • server.rb: Added mappingRegistry interface.
    • +
    • marshal.rb: Create NCName from typename.
    • +
  • +
+ + +
1.3.7 - August 24, 2001
+
Feedback from +SOAPBuilders Interoperability Lab "Round 2" +and Michael Neumann. Thanks! + +
    +
  • Datatypes: +
      +
    • All datatypes try to keep nil correctly.
    • +
    • XSDInt/Integer/Long: to_i -> Integer() to detect format error.
    • +
    • XSDDateTime, XSDDate, XSDTime: Add trailing 'Z' to indicate UTC.
    • +
    • SOAPStruct: Accept untyped struct.
    • +
    • Map(Hash): Let <item> untyped.
    • +
    • Apache allows only 'item' in Map type.
    • +
  • + +
  • Stream handler: +
      +
    • Removed MPOST support.
    • +
    • ECONNRESET was not caught. Fixed.
    • +
    • Added timeout support.
    • +
  • + +
  • Others: +
      +
    • Changed using URI library: URb -> URI; following its name change.
    • +
    • Added NQXML/1.1.0 support. A XMLDecl now recognized as a XMLDecl, not a PI.
    • +
  • +
+ +
1.3.6 - July 27, 2001
+
Many feedbacks from Michael Neumann. Thanks! + +
    +
  • hexBinary type: Added.
  • +
  • nil type: Should not be xsd:nil but xsi:nil.
  • +
  • Added StandaloneServer implementation. Thanks to Michael Neumann!
  • +
  • Illegal parsing of XMLDecl. Fixed.
  • +
  • RPC's 'inout' param was not supported. Fixed. Thanks to Michael Neumann!
  • +
  • URb::Generic#path returns '' when abs_path is empty (such as http://foo). +Added checking code.
  • +
  • Use http-access2 instead of original HTTP implementation. http-access2 supports HTTP/1.1's persistent connection.
  • +
+ +
1.3.5 - July 14, 2001
+
Many feedbacks from Michael Neumann. +I much appreciate valuable comments to him. +Thanks! + +
    +
  • Changed using URI library: uri -> URb.
  • +
  • Types changed: +
      +
    • All: Triming data except XSDString before parsing it.
    • +
    • String: Regexp for XML Char check did not work under $KCODE = 'UTF8' condition. Fixed.
    • +
    • Nil: 2001xsd:nil must not accept a value '1'. 1999xsd:null must not accept a value 'true' because these are not a boolean but only a flag for nil. Fixed.
    • +
    +
  • + +
  • Supported XML parser: +
      +
    • Added automatic CES conversion support for NQXMLParser. + (Depends on uconv module). + Set $KCODE for regexps used in NQXML parser.
    • +
    • Moved SOAPNQXML*Parser to nqxmlparser.rb.
    • +
    +
  • + +
  • RPC related functions changed:
  • +
      +
    • Added marshalling/unmarshalling Ruby's object using SOAP Encoding.
    • +
    • Parallelize of signatures of 'addMethod': proxy.rb <-> rpcRouter.rb, driver.rb <-> cgistub.rb.
    • +
    • Void return if 'retval' is not defined.
    • +
    • Added SOAP's Long type to default mapping table.
    • +
    + +
+ +
1.3.4.2 - July 11, 2001
+
SOAP4R/1.3.4 was once packed in July 10, 2001. +But, thanks to MNeumann and knu, +I found I had forgotten to pack 'redist' directory with it. +I added some fix from developing version and repack it as 1.3.4.2. +Sorry for frequently release... +

+ +Feedback from +`SOAPBuilders Interoperability Lab.' +and Michael Neumann. Thanks! + +
    +
  • Added in 1.3.4.2: +
      +
    • Type Decimal: Silly bug fixed. 0.0001 was converted to 0.1
    • +
    • CGIStub returns HTTP status 500 when returning SOAP Fault. + Returned 200 because I don't like this spec., but SOAP/1.2 W3C WD + 9 July 2001 have adopted it. Hmm...
    • +
    • RPC client(driver.rb): Exception#set_backtrace was omitted when transmitting exception by SOAP Fault.
    • +
    +
  • +
  • Types changed: +
      +
    • Array: Incomplete sparse array support. Fixed.
    • +
    • Date: Added.
    • +
    • Time: Added.
    • +
    • DateTime: Added precision of time support.
    • +
    • String: Default data should not be nil but ''.
    • +
    • Nil: Attribute value of xsi:nil might be '1' instead of 'true'. Fixed.
    • +
    +
  • + +
  • Supported XML parser: +
      +
    • Added SOAPXMLParser and SOAPSAXDriver for XMLParser which uses expat. + You can get the module from RAA: XMLParser module.
      + To use XMLParser -> add "require 'soap/xmlparser'".
      + To use SAX driver of XMLParser -> add "require 'soap/saxdriver'".
      + To use NQXMLParser -> nothing to do.
      + FYI: +
        +
      • XMLParser version is faster than others
      • +
      • SAXDriver version is extremely slow
      • +
      • NQXMLParser version is somewhat slower than XMLParser version
      • +
      • XMLParser is a Ruby extension module; To use it, you must compile and install it.
      • +
      • So far, automatic code conversion support is for XMLParser and SAXDriver. See below.
      • +
      +
    • +
    • Added automatic CES conversion support: UTF-8 <-> EUC, SJIS. + Requires Uconv module. Works with XMLParser module only now.
    • +
    • Added XMLDecl for CES.
    • +
    +
+ +
1.3.3 - July 4, 2001
+
Feedback from +`SOAPBuilders Interoperability Lab.' +and Michael Neumann. Thanks! +
    +
  • Added SOAP4R Installer by Michael Neumann. Thanks!
  • +
  • Types changed: +
      +
    • Boolean: Accepts 1 and 0 in addition to true and falue.
    • +
    • Float: handles single-precision 32-bit floating point. + Ruby's float is doule-precision.
    • +
    • Double: Added. Mapped to Ruby's Float.
    • +
    • DateTime: Added TZ support.
    • +
    • Long: Added.
    • +
    • Int: Changed class hierarchy; derived from Long now.
    • +
    • Array: Added 'position' and 'offset' support.
    • +
    • Array: Added M-D Array support.
    • +
    • Decimal: Added but it's incomplete now.
    • +
    +
  • +
  • Illegal error message when a type not found in SOAP-ENC.
  • +
  • Tries to transmit \r safely. To be checked...
  • +
  • Parse Fault items like 'faultcode' as same as Body ie. href/id.
  • +
  • rpcUtils.rb was completely re-written. +
      +
    • Added mappingRegistry interface.
    • +
    • Changed soap2obj and obj2soap's interface.
    • +
    • Bignum might be int or integer. It's dependent on platform. + Changed to check range -2147483648~+2147483647 itself.
    • +
    • ary2md: Added. Converting Array ((of Array)...) to M-D Array.
    • +
    • struct2obj: Illegal dependency on ordering of Struct#members. Fixed.
    • +
    • Ruby's Array should be converted to SOAP's Array of anyType. Fixed.
    • +
    +
  • +
  • Dump HTTP header even when an error was raised.
  • +
+ +
1.3.2 - June 21, 2001
+
Feedback from +`SOAPBuilders Interoperability Lab.' + +
    +
  • "nil='1'" should be "nil='true'" in 2001 schema +whereas "null='1'" in 1999 schema. Fixed.
  • +
  • SOAP Array was not typed with xsi:type.
  • +
  • Fixed serialization root handling algorithm.
  • +
  • Supported kind of SOAP-ENC:String style typed element.
  • +
  • Default namespace was not derived to child element. Fixed.
  • +
  • Support default encodingStyle.
  • +
  • Added support for void type (SOAP::RPCUtils::SOAPVoid).
  • +
+ +
1.3.1 - May 30, 2001
+
Feedback from +`SOAPBuilders Interoperability Lab.' + +
    +
  • Heading and trailing whtespaces in Base64 string could not be processed. Fixed.
  • +
  • Illegal typeNamespace of SOAP's base64 type. Fixed.
  • +
  • Added NaN, INF, -INF support of Float type.
  • +
  • Extracted xsd:1999 type support to XMLSchemaDatatypes1999.rb. Use it with 'require "soap/XMLSchemaDatatypes1999"'.
  • +
  • Added 'root' attribute support.
  • +
  • Return status 500 when Fault.
  • +
+ +
1.3.0 - May 20, 2001
+
    +
  • Adopted +NQXML module +instead of XMLParser module extensively. +(You can implement your SOAP parser with XMLParser module. +See the last part of lib/soap/parser.rb) +
      +
    • Use NQXML's streamingParser or tokenizer instead of XMLParser's DOMParser for unmarshalling.
    • +
    • Use NQXML's document instead of XMLParser's DOM for marshalling.
    • +
  • +
  • Passed major(?) part of inteoperability test in +`SOAPBuilders Interoperability Lab.' +See test/interop/README.txt.
  • +
  • Changed module namespace. SOAPFoo -> SOAP::Foo.
  • +
  • Added float datatype support.
  • +
  • Changed dateTime marshalling format. No timezone was added to marshalled string because SOAP4R does not support timezone now.
  • +
+ +
1.2.0 - March 30, 2001
+
Checked interoperability with +Apache-SOAP, +pocketSOAP/0.91, +SOAP::Lite for Perl, +and SOAP/Perl/0.28. +It seems to work good except SOAP/Perl/0.28. + +
    +
  • Added href/id unmarshalling support. +(href/id marshalling has not been supported yet)
  • +
  • Added SOAP's base64 type support.
  • +
  • SOAPTimeInstant -> SOAPDateTime. Following XML Schema PR.
  • +
  • SOAPStruct can have multiple accessor which have same name. +Should I separate it from original SOAPStruct?
  • +
  • Unknown attribute in Header Item raised an exception. Omitted.
  • +
  • Router can handle methods which belong to different namespace.
  • +
  • Added an option to allow unqualified SOAP element.
  • +
  • Added Apache's Map type support. Ruby's Hash are mapped to it now. +(Ruby's Hash marshalled by 1.1 processor in the old way can be unmarshalled, +but 1.2 processor marshals it in the new way and 1.1 processor does not +unmarshals it into Hash. Incompatibility between SOAP4R/1.2 and 1.1)
  • +
  • Unknown type 'unknown:SOAPStruct' was incorrectly unmarshalled into SOAPStruct. Fixed.
  • +
  • Added utility methods map! and members to SOAPArray and SOAPStruct.
  • +
  • Added methods request, response, and fault to SOAPBody.
  • +
+ +
1.1.0 - March 23, 2001
+
Made many changes. +Since it is tested only for my limited use, please be careful to use. +Any comments especially "cannot connect to XXX implementation" are welcomed. +Feel free sending mail to +nahi@ruby-lang.org. + +
    +
  • Added RPC server support.
  • +
  • Divided RPC client/server implementation from core.
  • +
  • Added Date, Hash type support. (Unknown type is converted to Struct as usual)
  • +
  • Adopted Date in date3.rb by Funaba-san instead of Time as TimeInstant.
  • +
  • Many encoding/decoding bugs around SOAPArray and SOAPStruct were fixed.
  • +
+ +
1.0.2 - November 11, 2000
+
Since the previous package dated, refreshes some points. +
    +
  • Ruby: ruby 1.6.x
  • +
  • uri.rb: 4.22
  • +
  • sample: xml-soap/2.0
  • +
+ +
1.0.1 - July 27, 2000
+
Handles SOAP/1.1 arrays. +1.0.0 cannot handles SOAP/1.1 arrays... +Bear in mind there still be many +restrictions +around SOAP arrays.
+ +
1.0.0 - July 17, 2000
+
It is the initial released version of SOAP4R. :-)
+
+ +

9. Author

+ +
+
Name
+
NAKAMURA, Hiroshi (aka NaHi or nakahiro)
+ +
E-mail
+
nahi@ruby-lang.org
+
+ + + +

+SOAP4R
+Copyright © 2000-2007 NAKAMURA, Hiroshi <nahi@ruby-lang.org>. +

+ +

+This program is copyrighted free software by NAKAMURA, Hiroshi. You can +redistribute it and/or modify it under the same terms of Ruby's license; +either the dual license version in 2003 (see the file RUBYS), or any later +version. +

+ +
+ +
+ + + + diff --git a/RUBYS b/RUBYS new file mode 100644 index 0000000..870a5f2 --- /dev/null +++ b/RUBYS @@ -0,0 +1,56 @@ +Ruby is copyrighted free software by Yukihiro Matsumoto . +You can redistribute it and/or modify it under either the terms of the GPL +(see the file GPL), or the conditions below: + + 1. You may make and give away verbatim copies of the source form of the + software without restriction, provided that you duplicate all of the + original copyright notices and associated disclaimers. + + 2. You may modify your copy of the software in any way, provided that + you do at least ONE of the following: + + a) place your modifications in the Public Domain or otherwise + make them Freely Available, such as by posting said + modifications to Usenet or an equivalent medium, or by allowing + the author to include your modifications in the software. + + b) use the modified software only within your corporation or + organization. + + c) give non-standard binaries non-standard names, with + instructions on where to get the original software distribution. + + d) make other distribution arrangements with the author. + + 3. You may distribute the software in object code or binary form, + provided that you do at least ONE of the following: + + a) distribute the binaries and library files of the software, + together with instructions (in the manual page or equivalent) + on where to get the original distribution. + + b) accompany the distribution with the machine-readable source of + the software. + + c) give non-standard binaries non-standard names, with + instructions on where to get the original software distribution. + + d) make other distribution arrangements with the author. + + 4. You may modify and include the part of the software into any other + software (possibly commercial). But some files in the distribution + are not written by the author, so that they are not under these terms. + + For the list of those files and their copying conditions, see the + file LEGAL. + + 5. The scripts and library files supplied as input to or produced as + output from the software do not automatically fall under the + copyright of the software, but belong to whomever generated them, + and may be sold commercially, and may be aggregated with this + software. + + 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..74f6a89 --- /dev/null +++ b/Rakefile @@ -0,0 +1,9 @@ +require 'rake/gempackagetask' +load 'soap4r.gemspec' + +task :default => :gem + +Rake::GemPackageTask.new(SPEC) do |pkg| + pkg.need_zip = true + pkg.need_tar = true +end diff --git a/bin/wsdl2ruby.rb b/bin/wsdl2ruby.rb new file mode 100755 index 0000000..0c200a2 --- /dev/null +++ b/bin/wsdl2ruby.rb @@ -0,0 +1,137 @@ +#!/usr/bin/env ruby + +require 'getoptlong' +require 'logger' +require 'wsdl/soap/wsdl2ruby' + + +class WSDL2RubyApp < Logger::Application +private + + OptSet = [ + ['--wsdl','-w', GetoptLong::REQUIRED_ARGUMENT], + ['--module_path','-m', GetoptLong::REQUIRED_ARGUMENT], + ['--type','-t', GetoptLong::REQUIRED_ARGUMENT], + ['--classdef','-e', GetoptLong::OPTIONAL_ARGUMENT], + ['--mapping_registry','-r', GetoptLong::NO_ARGUMENT], + ['--client_skelton','-c', GetoptLong::OPTIONAL_ARGUMENT], + ['--servant_skelton','-s', GetoptLong::OPTIONAL_ARGUMENT], + ['--cgi_stub','-g', GetoptLong::OPTIONAL_ARGUMENT], + ['--servlet_stub','-l', GetoptLong::OPTIONAL_ARGUMENT], + ['--standalone_server_stub','-a', GetoptLong::OPTIONAL_ARGUMENT], + ['--driver','-d', GetoptLong::OPTIONAL_ARGUMENT], + ['--drivername_postfix','-n', GetoptLong::REQUIRED_ARGUMENT], + ['--force','-f', GetoptLong::NO_ARGUMENT], + ['--quiet','-q', GetoptLong::NO_ARGUMENT], + ] + + def initialize + super('app') + STDERR.sync = true + self.level = Logger::FATAL + end + + def run + @worker = WSDL::SOAP::WSDL2Ruby.new + @worker.logger = @log + location, opt = parse_opt(GetoptLong.new(*OptSet)) + usage_exit unless location + @worker.location = location + if opt['quiet'] + self.level = Logger::FATAL + else + self.level = Logger::INFO + end + @worker.opt.update(opt) + @worker.run + 0 + end + + def usage_exit + puts <<__EOU__ +Usage: #{ $0 } --wsdl wsdl_location [options] + wsdl_location: filename or URL + +Example: + For server side: + #{ $0 } --wsdl myapp.wsdl --type server + For client side: + #{ $0 } --wsdl myapp.wsdl --type client + +Options: + --wsdl wsdl_location + --type server|client + --type server implies; + --classdef --mapping_registry --servant_skelton --standalone_server_stub + --type client implies; + --classdef --mapping_registry --client_skelton --driver + --classdef [filenameprefix] + --mapping_registry + --client_skelton [servicename] + --servant_skelton [porttypename] + --cgi_stub [servicename] + --servlet_stub [servicename] + --standalone_server_stub [servicename] + --driver [porttypename] + --drivername_postfix driver_classname_postfix + --module_path Module::Path::Name + --force + --quiet + +Terminology: + Client <-> Driver <-(SOAP)-> Stub <-> Servant + + Driver and Stub: Automatically generated + Client and Servant: Skelton generated (you should change) +__EOU__ + exit 1 + end + + def parse_opt(getoptlong) + opt = {} + wsdl = nil + begin + getoptlong.each do |name, arg| + case name + when "--wsdl" + wsdl = arg + when "--module_path" + opt['module_path'] = arg + when "--type" + case arg + when "server" + opt['classdef'] ||= nil + opt['mapping_registry'] ||= nil + opt['servant_skelton'] ||= nil + opt['standalone_server_stub'] ||= nil + when "client" + opt['classdef'] ||= nil + opt['mapping_registry'] ||= nil + opt['driver'] ||= nil + opt['client_skelton'] ||= nil + else + raise ArgumentError.new("Unknown type #{ arg }") + end + when "--classdef", "--mapping_registry", + "--client_skelton", "--servant_skelton", + "--cgi_stub", "--servlet_stub", "--standalone_server_stub", + "--driver" + opt[name.sub(/^--/, '')] = arg.empty? ? nil : arg + when "--drivername_postfix" + opt['drivername_postfix'] = arg + when "--force" + opt['force'] = true + when "--quiet" + opt['quiet'] = true + else + raise ArgumentError.new("Unknown type #{ arg }") + end + end + rescue + usage_exit + end + return wsdl, opt + end +end + +WSDL2RubyApp.new.start diff --git a/bin/xsd2ruby.rb b/bin/xsd2ruby.rb new file mode 100644 index 0000000..b5de712 --- /dev/null +++ b/bin/xsd2ruby.rb @@ -0,0 +1,90 @@ +#!/usr/bin/env ruby + +require 'getoptlong' +require 'logger' +require 'wsdl/xmlSchema/xsd2ruby' + + +class XSD2RubyApp < Logger::Application +private + + OptSet = [ + ['--xsd','-x', GetoptLong::REQUIRED_ARGUMENT], + ['--module_path','-m', GetoptLong::REQUIRED_ARGUMENT], + ['--classdef','-e', GetoptLong::OPTIONAL_ARGUMENT], + ['--mapping_registry','-r', GetoptLong::NO_ARGUMENT], + ['--mapper','-p', GetoptLong::NO_ARGUMENT], + ['--force','-f', GetoptLong::NO_ARGUMENT], + ['--quiet','-q', GetoptLong::NO_ARGUMENT], + ] + + def initialize + super('app') + STDERR.sync = true + self.level = Logger::FATAL + end + + def run + @worker = WSDL::XMLSchema::XSD2Ruby.new + @worker.logger = @log + location, opt = parse_opt(GetoptLong.new(*OptSet)) + usage_exit unless location + @worker.location = location + if opt['quiet'] + self.level = Logger::FATAL + else + self.level = Logger::INFO + end + @worker.opt.update(opt) + @worker.run + 0 + end + + def usage_exit + puts <<__EOU__ +Usage: #{ $0 } --xsd xsd_location [options] + xsd_location: filename or URL + +Example: + #{ $0 } --xsd myapp.xsd --classdef foo + +Options: + --xsd xsd_location + --classdef [filenameprefix] + --mapping_registry + --mapper + --module_path [Module::Path::Name] + --force + --quiet +__EOU__ + exit 1 + end + + def parse_opt(getoptlong) + opt = {} + xsd = nil + begin + getoptlong.each do |name, arg| + case name + when "--xsd" + xsd = arg + when "--module_path" + opt['module_path'] = arg + when "--classdef", "--mapping_registry", "--mapper" + opt[name.sub(/^--/, '')] = arg.empty? ? nil : arg + when "--force" + opt['force'] = true + when "--quiet" + opt['quiet'] = true + else + raise ArgumentError.new("Unknown type #{ arg }") + end + end + rescue + usage_exit + end + return xsd, opt + end +end + +XSD2RubyApp.new.start diff --git a/install.rb b/install.rb new file mode 100755 index 0000000..c894741 --- /dev/null +++ b/install.rb @@ -0,0 +1,90 @@ +#!/usr/bin/env ruby + +require 'getoptlong' +require 'rbconfig' +require 'ftools' + +OptSet = [ + ['--prefix','-p', GetoptLong::REQUIRED_ARGUMENT], +] +prefix = nil +GetoptLong.new(*OptSet).each do |name, arg| + case name + when "--prefix" + prefix = arg + else + raise ArgumentError.new("Unknown type #{ arg }") + end +end + +include Config +RV = CONFIG["MAJOR"] + "." + CONFIG["MINOR"] +ORG_PREFIX = CONFIG["prefix"] +SRCPATH = File.join(File.dirname($0), 'lib') + +RUBYLIBDIR = CONFIG["rubylibdir"] +SITELIBDIR = CONFIG["sitedir"] + "/" + RV + +if prefix + RUBYLIBDIR.sub!(/^#{Regexp.quote(ORG_PREFIX)}/, prefix) + SITELIBDIR.sub!(/^#{Regexp.quote(ORG_PREFIX)}/, prefix) +end + +def install(from, to) + to_path = File.catname(from, to) + unless FileTest.exist?(to_path) and File.compare(from, to_path) + File.install(from, to_path, 0644, true) + end +end + +def install_dir(srcbase, *path) + from_path = File.join(srcbase, *path) + unless FileTest.directory?(from_path) + raise RuntimeError.new("'#{ from_path }' not found.") + end + to_path_rubylib = File.join(RUBYLIBDIR, *path) + to_path_sitelib = File.join(SITELIBDIR, *path) + Dir[File.join(from_path, '*.rb')].each do |from_file| + basename = File.basename(from_file) + to_file_rubylib = File.join(to_path_rubylib, basename) + to_file_sitelib = File.join(to_path_sitelib, basename) + if File.exist?(to_file_rubylib) + if File.exist?(to_file_sitelib) + raise RuntimeError.new( + "trying to install '#{ to_file_rubylib }' but '#{ to_file_sitelib }' exists. please remove '#{ to_file_sitelib }' first to avoid versioning problem and run installer again.") + end + install(from_file, to_path_rubylib) + else + File.mkpath(to_path_sitelib, true) + install(from_file, to_path_sitelib) + end + end +end + +begin + install_dir(SRCPATH, 'soap') + install_dir(SRCPATH, 'soap', 'rpc') + install_dir(SRCPATH, 'soap', 'mapping') + install_dir(SRCPATH, 'soap', 'encodingstyle') + install_dir(SRCPATH, 'soap', 'header') + install_dir(SRCPATH, 'soap', 'filter') + install_dir(SRCPATH, 'wsdl') + install_dir(SRCPATH, 'wsdl', 'xmlSchema') + install_dir(SRCPATH, 'wsdl', 'soap') + install_dir(SRCPATH, 'xsd') + install_dir(SRCPATH, 'xsd', 'codegen') + install_dir(SRCPATH, 'xsd', 'xmlparser') + + # xmlscan + xmlscansrcdir = File.join('redist', 'xmlscan', 'xmlscan-20050522', 'lib') + if File.exist?(xmlscansrcdir) + install_dir(xmlscansrcdir, 'xmlscan') + end + + puts "install succeed!" + +rescue + puts "install failed!" + puts $! + +end diff --git a/lib/soap/attachment.rb b/lib/soap/attachment.rb new file mode 100644 index 0000000..85b9078 --- /dev/null +++ b/lib/soap/attachment.rb @@ -0,0 +1,108 @@ +# soap/attachment.rb: SOAP4R - SwA implementation. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/baseData' +require 'soap/mapping' + + +module SOAP + + +class SOAPAttachment < SOAPExternalReference + attr_reader :data + + def initialize(value) + super() + @data = value + end + +private + + def external_contentid + @data.contentid + end +end + + +class Attachment + attr_reader :io + attr_accessor :contenttype + + def initialize(string_or_readable = nil) + @string_or_readable = string_or_readable + @contenttype = "application/octet-stream" + @contentid = nil + @content = nil + end + + def contentid + @contentid ||= Attachment.contentid(self) + end + + def contentid=(contentid) + @contentid = contentid + end + + def mime_contentid + '<' + contentid + '>' + end + + def content + if @content == nil and @string_or_readable != nil + @content = @string_or_readable.respond_to?(:read) ? + @string_or_readable.read : @string_or_readable + end + @content + end + + def to_s + content + end + + def write(out) + out.write(content) + end + + def save(filename) + File.open(filename, "wb") do |f| + write(f) + end + end + + def self.contentid(obj) + # this needs to be fixed + [obj.__id__.to_s, Process.pid.to_s].join('.') + end + + def self.mime_contentid(obj) + '<' + contentid(obj) + '>' + end +end + + +module Mapping + class AttachmentFactory < SOAP::Mapping::Factory + def obj2soap(soap_class, obj, info, map) + soap_obj = soap_class.new(obj) + mark_marshalled_obj(obj, soap_obj) + soap_obj + end + + def soap2obj(obj_class, node, info, map) + obj = node.data + mark_unmarshalled_obj(node, obj) + return true, obj + end + end + + DefaultRegistry.add(::SOAP::Attachment, ::SOAP::SOAPAttachment, + AttachmentFactory.new, nil) +end + + +end diff --git a/lib/soap/attrproxy.rb b/lib/soap/attrproxy.rb new file mode 100644 index 0000000..0c25bf5 --- /dev/null +++ b/lib/soap/attrproxy.rb @@ -0,0 +1,34 @@ +# SOAP4R - attribute proxy interface. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module SOAP + + +module AttrProxy + def self.included(klass) + klass.extend(AttrProxyClassSupport) + end + + module AttrProxyClassSupport + def attr_proxy(symbol, assignable = false) + name = symbol.to_s + define_method(name) { + attrproxy.__send__(name) + } + if assignable + aname = name + '=' + define_method(aname) { |rhs| + attrproxy.__send__(aname, rhs) + } + end + end + end +end + + +end diff --git a/lib/soap/baseData.rb b/lib/soap/baseData.rb new file mode 100644 index 0000000..426f2e8 --- /dev/null +++ b/lib/soap/baseData.rb @@ -0,0 +1,1094 @@ +# soap/baseData.rb: SOAP4R - Base type library +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/datatypes' +require 'soap/soap' +require 'xsd/codegen/gensupport' +require 'soap/mapping/mapping' + + +module SOAP + + +### +## Mix-in module for SOAP base type classes. +# +module SOAPModuleUtils + include SOAP + +public + + def decode(elename) + d = self.new + d.elename = elename + d + end + + def to_data(str) + new(str).data + end +end + + +### +## for SOAP type(base and compound) +# +module SOAPType + attr_accessor :encodingstyle + attr_accessor :elename + attr_accessor :id + attr_reader :precedents + attr_accessor :root + attr_accessor :parent + attr_accessor :position + attr_reader :extraattr + attr_accessor :definedtype + attr_accessor :force_typed + + def initialize(*arg) + super + @encodingstyle = nil + @elename = XSD::QName::EMPTY + @id = nil + @precedents = [] + @root = false + @parent = nil + @position = nil + @definedtype = nil + @extraattr = {} + @force_typed = false + end + + def inspect + if self.is_a?(XSD::NSDBase) + sprintf("#<%s:0x%x %s %s>", self.class.name, __id__, self.elename, self.type) + else + sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.elename) + end + end + + def rootnode + node = self + while node = node.parent + break if SOAPEnvelope === node + end + node + end +end + + +### +## for SOAP base type +# +module SOAPBasetype + include SOAPType + include SOAP + + attr_accessor :qualified + + def initialize(*arg) + super + @qualified = nil + end +end + + +### +## for SOAP compound type +# +module SOAPCompoundtype + include SOAPType + include SOAP + + attr_accessor :qualified + + def initialize(*arg) + super + @qualified = nil + end +end + +# marker for compound types which have named accessor +module SOAPNameAccessible +end + + +### +## Convenience datatypes. +# +class SOAPReference < XSD::NSDBase + include SOAPBasetype + extend SOAPModuleUtils + +public + + attr_accessor :refid + + # Override the definition in SOAPBasetype. + def initialize(obj = nil) + super() + @type = XSD::QName::EMPTY + @refid = nil + @obj = nil + __setobj__(obj) if obj + end + + def __getobj__ + @obj + end + + def __setobj__(obj) + @obj = obj + @refid = @obj.id || SOAPReference.create_refid(@obj) + @obj.id = @refid unless @obj.id + @obj.precedents << self + # Copies NSDBase information + @obj.type = @type unless @obj.type + end + + # Why don't I use delegate.rb? + # -> delegate requires target object type at initialize time. + # Why don't I use forwardable.rb? + # -> forwardable requires a list of forwarding methods. + # + # ToDo: Maybe I should use forwardable.rb and give it a methods list like + # delegate.rb... + # + def method_missing(msg_id, *params) + if @obj + @obj.send(msg_id, *params) + else + nil + end + end + + # for referenced base type such as a long value from Axis. + # base2obj requires a node to respond to :data + def data + if @obj.respond_to?(:data) + @obj.data + end + end + + def refidstr + '#' + @refid + end + + def self.create_refid(obj) + 'id' + obj.__id__.to_s + end + + def self.decode(elename, refidstr) + if /\A#(.*)\z/ =~ refidstr + refid = $1 + elsif /\Acid:(.*)\z/ =~ refidstr + refid = $1 + else + raise ArgumentError.new("illegal refid #{refidstr}") + end + d = super(elename) + d.refid = refid + d + end +end + + +class SOAPExternalReference < XSD::NSDBase + include SOAPBasetype + extend SOAPModuleUtils + + def initialize + super() + @type = XSD::QName::EMPTY + end + + def referred + rootnode.external_content[external_contentid] = self + end + + def refidstr + 'cid:' + external_contentid + end + +private + + def external_contentid + raise NotImplementedError.new + end +end + + +class SOAPNil < XSD::XSDNil + include SOAPBasetype + extend SOAPModuleUtils + +public + + def initialize(value = nil) + super(value) + @extraattr[XSD::AttrNilName] = 'true' + end +end + +# SOAPRawString is for sending raw string. In contrast to SOAPString, +# SOAP4R does not do XML encoding and does not convert its CES. The string it +# holds is embedded to XML instance directly as a 'xsd:string'. +class SOAPRawString < XSD::XSDString + include SOAPBasetype + extend SOAPModuleUtils +end + + +### +## Basic datatypes. +# +class SOAPAnySimpleType < XSD::XSDAnySimpleType + include SOAPBasetype + extend SOAPModuleUtils +end + +class SOAPString < XSD::XSDString + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, StringLiteral) +end + +class SOAPNormalizedString < XSD::XSDNormalizedString + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, NormalizedStringLiteral) +end + +class SOAPToken < XSD::XSDToken + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, TokenLiteral) +end + +class SOAPLanguage < XSD::XSDLanguage + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, LanguageLiteral) +end + +class SOAPNMTOKEN < XSD::XSDNMTOKEN + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, NMTOKENLiteral) +end + +class SOAPNMTOKENS < XSD::XSDNMTOKENS + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, NMTOKENSLiteral) +end + +class SOAPName < XSD::XSDName + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, NameLiteral) +end + +class SOAPNCName < XSD::XSDNCName + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, NCNameLiteral) +end + +class SOAPID < XSD::XSDID + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, IDLiteral) +end + +class SOAPIDREF < XSD::XSDIDREF + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, IDREFLiteral) +end + +class SOAPIDREFS < XSD::XSDIDREFS + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, IDREFSLiteral) +end + +class SOAPENTITY < XSD::XSDENTITY + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, ENTITYLiteral) +end + +class SOAPENTITIES < XSD::XSDENTITIES + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, ENTITIESLiteral) +end + +class SOAPBoolean < XSD::XSDBoolean + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, BooleanLiteral) +end + +class SOAPDecimal < XSD::XSDDecimal + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, DecimalLiteral) +end + +class SOAPFloat < XSD::XSDFloat + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, FloatLiteral) +end + +class SOAPDouble < XSD::XSDDouble + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, DoubleLiteral) +end + +class SOAPDuration < XSD::XSDDuration + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, DurationLiteral) +end + +class SOAPDateTime < XSD::XSDDateTime + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, DateTimeLiteral) +end + +class SOAPTime < XSD::XSDTime + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, TimeLiteral) +end + +class SOAPDate < XSD::XSDDate + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, DateLiteral) +end + +class SOAPGYearMonth < XSD::XSDGYearMonth + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, GYearMonthLiteral) +end + +class SOAPGYear < XSD::XSDGYear + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, GYearLiteral) +end + +class SOAPGMonthDay < XSD::XSDGMonthDay + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, GMonthDayLiteral) +end + +class SOAPGDay < XSD::XSDGDay + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, GDayLiteral) +end + +class SOAPGMonth < XSD::XSDGMonth + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, GMonthLiteral) +end + +class SOAPHexBinary < XSD::XSDHexBinary + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, HexBinaryLiteral) +end + +class SOAPBase64 < XSD::XSDBase64Binary + include SOAPBasetype + extend SOAPModuleUtils + Type = SOAPENCType = QName.new(EncodingNamespace, Base64Literal) + +public + + def initialize(value = nil) + super(value) + @type = Type + end + + def as_xsd + @type = XSD::XSDBase64Binary::Type + end +end + +class SOAPAnyURI < XSD::XSDAnyURI + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, AnyURILiteral) +end + +class SOAPQName < XSD::XSDQName + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, QNameLiteral) +end + + +class SOAPInteger < XSD::XSDInteger + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, IntegerLiteral) +end + +class SOAPNonPositiveInteger < XSD::XSDNonPositiveInteger + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, NonPositiveIntegerLiteral) +end + +class SOAPNegativeInteger < XSD::XSDNegativeInteger + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, NegativeIntegerLiteral) +end + +class SOAPLong < XSD::XSDLong + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, LongLiteral) +end + +class SOAPInt < XSD::XSDInt + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, IntLiteral) +end + +class SOAPShort < XSD::XSDShort + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, ShortLiteral) +end + +class SOAPByte < XSD::XSDByte + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, ByteLiteral) +end + +class SOAPNonNegativeInteger < XSD::XSDNonNegativeInteger + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, NonNegativeIntegerLiteral) +end + +class SOAPUnsignedLong < XSD::XSDUnsignedLong + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, UnsignedLongLiteral) +end + +class SOAPUnsignedInt < XSD::XSDUnsignedInt + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, UnsignedIntLiteral) +end + +class SOAPUnsignedShort < XSD::XSDUnsignedShort + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, UnsignedShortLiteral) +end + +class SOAPUnsignedByte < XSD::XSDUnsignedByte + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, UnsignedByteLiteral) +end + +class SOAPPositiveInteger < XSD::XSDPositiveInteger + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, PositiveIntegerLiteral) +end + + +### +## Compound datatypes. +# +class SOAPStruct < XSD::NSDBase + include Enumerable + include SOAPCompoundtype + include SOAPNameAccessible + +public + + def initialize(type = nil) + super() + @type = type || XSD::QName::EMPTY + @array = [] + @data = [] + end + + def to_s + str = '' + self.each do |key, data| + str << "#{key}: #{data}\n" + end + str + end + + def add(name, value) + value = SOAPNil.new if value.nil? + @array.push(name) + value.elename = value.elename.dup_name(name) + @data.push(value) + value.parent = self if value.respond_to?(:parent=) + value + end + + def [](idx) + if idx.is_a?(Range) + @data[idx] + elsif idx.is_a?(Integer) + if (idx > @array.size) + raise ArrayIndexOutOfBoundsError.new('In ' << @type.name) + end + @data[idx] + else + if @array.include?(idx) + @data[@array.index(idx)] + else + nil + end + end + end + + def []=(idx, data) + if @array.include?(idx) + data.parent = self if data.respond_to?(:parent=) + @data[@array.index(idx)] = data + else + add(idx, data) + end + end + + def key?(name) + @array.include?(name) + end + + def members + @array + end + + def have_member + !@array.empty? + end + + def to_obj + hash = {} + proptype = {} + each do |k, v| + value = v.respond_to?(:to_obj) ? v.to_obj : v.to_s + case proptype[k] + when :single + hash[k] = [hash[k], value] + proptype[k] = :multi + when :multi + hash[k] << value + else + hash[k] = value + proptype[k] = :single + end + end + hash + end + + def each + idx = 0 + while idx < @array.length + yield(@array[idx], @data[idx]) + idx += 1 + end + end + + def replace + members.each do |member| + self[member] = yield(self[member]) + end + end + + def self.decode(elename, type) + s = SOAPStruct.new(type) + s.elename = elename + s + end +end + + +# SOAPElement is not typed so it is not derived from NSDBase. +class SOAPElement + include Enumerable + include SOAPCompoundtype + include SOAPNameAccessible + + attr_accessor :type + # Text interface. + attr_accessor :text + alias data text + + def initialize(elename, text = nil) + super() + if elename.nil? + elename = XSD::QName::EMPTY + else + elename = Mapping.to_qname(elename) + end + @encodingstyle = LiteralNamespace + @elename = elename + @type = nil + + @array = [] + @data = [] + @text = text + end + + def inspect + sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.elename) + + (@text ? " #{@text.inspect}" : '') + + @data.collect { |ele| "\n#{ele.inspect}" }.join.gsub(/^/, ' ') + end + + def set(value) + @text = value + end + + # Element interfaces. + def add(value) + name = value.elename.name + @array.push(name) + @data.push(value) + value.parent = self if value.respond_to?(:parent=) + value + end + + def [](idx) + if @array.include?(idx) + @data[@array.index(idx)] + else + nil + end + end + + def []=(idx, data) + if @array.include?(idx) + data.parent = self if data.respond_to?(:parent=) + @data[@array.index(idx)] = data + else + add(data) + end + end + + def key?(name) + @array.include?(name) + end + + def members + @array + end + + def have_member + !@array.empty? + end + + def to_obj + if !have_member + @text + else + hash = {} + proptype = {} + each do |k, v| + value = v.respond_to?(:to_obj) ? v.to_obj : v.to_s + case proptype[k] + when :single + hash[k] = [hash[k], value] + proptype[k] = :multi + when :multi + hash[k] << value + else + hash[k] = value + proptype[k] = :single + end + end + hash + end + end + + def each + idx = 0 + while idx < @array.length + yield(@array[idx], @data[idx]) + idx += 1 + end + end + + def self.decode(elename) + o = SOAPElement.new(elename) + o + end + + def self.from_objs(objs) + objs.collect { |value| + if value.is_a?(SOAPElement) + value + else + k, v = value + ele = from_obj(v) + ele.elename = XSD::QName.new(nil, k) + ele + end + } + end + + # when obj is a Hash or an Array: + # when key starts with "xmlattr_": + # value is added as an XML attribute with the key name however the + # "xmlattr_" is dropped from the name. + # when key starts with "xmlele_": + # value is added as an XML element with the key name however the + # "xmlele_" is dropped from the name. + # if else: + # value is added as an XML element with the key name. + def self.from_obj(obj, namespace = nil) + return obj if obj.is_a?(SOAPElement) + o = SOAPElement.new(nil) + case obj + when nil + o.text = nil + when Hash, Array + obj.each do |name, value| + addname, is_attr = parse_name(name, namespace) + if value.is_a?(Array) + value.each do |subvalue| + if is_attr + o.extraattr[addname] = subvalue + else + child = from_obj(subvalue, namespace) + child.elename = addname + o.add(child) + end + end + else + if is_attr + o.extraattr[addname] = value + else + child = from_obj(value, namespace) + child.elename = addname + o.add(child) + end + end + end + else + o.text = obj.to_s + end + o + end + + def self.parse_name(obj, namespace = nil) + qname = to_qname(obj, namespace) + if /\Axmlele_/ =~ qname.name + qname = XSD::QName.new(qname.namespace, qname.name.sub(/\Axmlele_/, '')) + return qname, false + elsif /\Axmlattr_/ =~ qname.name + qname = XSD::QName.new(qname.namespace, qname.name.sub(/\Axmlattr_/, '')) + return qname, true + else + return qname, false + end + end + + def self.to_qname(obj, namespace = nil) + if obj.is_a?(XSD::QName) + obj + elsif /\A(.+):([^:]+)\z/ =~ obj.to_s + XSD::QName.new($1, $2) + else + XSD::QName.new(namespace, obj.to_s) + end + end +end + + +class SOAPRawData < SOAPElement + def initialize(obj) + super(XSD::QName::EMPTY) + @obj = obj + end + + def to_xmlpart + @obj.to_xmlpart + end +end + + +class SOAPREXMLElementWrap + def initialize(ele) + @ele = ele + end + + def to_xmlpart + @ele.to_s + end +end + + +class SOAPArray < XSD::NSDBase + include SOAPCompoundtype + include Enumerable + +public + + attr_accessor :sparse + + attr_reader :offset, :rank + attr_accessor :size, :size_fixed + attr_reader :arytype + + def initialize(type = nil, rank = 1, arytype = nil) + super() + @type = type || ValueArrayName + @rank = rank + @data = Array.new + @sparse = false + @offset = Array.new(rank, 0) + @size = Array.new(rank, 0) + @size_fixed = false + @position = nil + @arytype = arytype + end + + def offset=(var) + @offset = var + @sparse = true + end + + def add(value) + self[*(@offset)] = value + end + + def have_member + !@data.empty? + end + + def [](*idxary) + if idxary.size != @rank + raise ArgumentError.new("given #{idxary.size} params does not match rank: #{@rank}") + end + retrieve(idxary) + end + + def []=(*idxary) + value = idxary.slice!(-1) + if idxary.size != @rank + raise ArgumentError.new("given #{idxary.size} params(#{idxary}) does not match rank: #{@rank}") + end + idx = 0 + while idx < idxary.size + if idxary[idx] + 1 > @size[idx] + @size[idx] = idxary[idx] + 1 + end + idx += 1 + end + data = retrieve(idxary[0, idxary.size - 1]) + data[idxary.last] = value + if value.is_a?(SOAPType) + value.elename = ITEM_NAME + # Sync type + unless @type.name + @type = XSD::QName.new(value.type.namespace, + SOAPArray.create_arytype(value.type.name, @rank)) + end + value.type ||= @type + end + @offset = idxary + value.parent = self if value.respond_to?(:parent=) + offsetnext + end + + def each + @data.each do |data| + yield(data) + end + end + + def to_a + @data.dup + end + + def replace + @data = deep_map(@data) do |ele| + yield(ele) + end + end + + def deep_map(ary, &block) + ary.collect do |ele| + if ele.is_a?(Array) + deep_map(ele, &block) + else + new_obj = block.call(ele) + new_obj.elename = ITEM_NAME + new_obj + end + end + end + + def include?(var) + traverse_data(@data) do |v, *rank| + if v.is_a?(SOAPBasetype) && v.data == var + return true + end + end + false + end + + def traverse + traverse_data(@data) do |v, *rank| + unless @sparse + yield(v) + else + yield(v, *rank) if v && !v.is_a?(SOAPNil) + end + end + end + + def soap2array(ary) + traverse_data(@data) do |v, *position| + iteary = ary + rank = 1 + while rank < position.size + idx = position[rank - 1] + if iteary[idx].nil? + iteary = iteary[idx] = Array.new + else + iteary = iteary[idx] + end + rank += 1 + end + if block_given? + iteary[position.last] = yield(v) + else + iteary[position.last] = v + end + end + end + + def position + @position + end + +private + + ITEM_NAME = XSD::QName.new(nil, 'item') + + def retrieve(idxary) + data = @data + rank = 1 + while rank <= idxary.size + idx = idxary[rank - 1] + if data[idx].nil? + data = data[idx] = Array.new + else + data = data[idx] + end + rank += 1 + end + data + end + + def traverse_data(data, rank = 1) + idx = 0 + while idx < ranksize(rank) + if rank < @rank and data[idx] + traverse_data(data[idx], rank + 1) do |*v| + v[1, 0] = idx + yield(*v) + end + else + yield(data[idx], idx) + end + idx += 1 + end + end + + def ranksize(rank) + @size[rank - 1] + end + + def offsetnext + move = false + idx = @offset.size - 1 + while !move && idx >= 0 + @offset[idx] += 1 + if @size_fixed + if @offset[idx] < @size[idx] + move = true + else + @offset[idx] = 0 + idx -= 1 + end + else + move = true + end + end + end + + def self.decode(elename, type, arytype) + typestr, nofary = parse_type(arytype.name) + rank = nofary.count(',') + 1 + plain_arytype = XSD::QName.new(arytype.namespace, typestr) + o = SOAPArray.new(type, rank, plain_arytype) + size = [] + nofary.split(',').each do |s| + if s.empty? + size.clear + break + else + size << s.to_i + end + end + unless size.empty? + o.size = size + o.size_fixed = true + end + o.elename = elename + o + end + + def self.create_arytype(typename, rank) + "#{typename}[" << ',' * (rank - 1) << ']' + end + + TypeParseRegexp = Regexp.new("^(.+)\[([\d,]*)\]$") + + def self.parse_type(string) + TypeParseRegexp =~ string + return $1, $2 + end +end + + +require 'soap/mapping/typeMap' + + +end diff --git a/lib/soap/element.rb b/lib/soap/element.rb new file mode 100644 index 0000000..edc3fb7 --- /dev/null +++ b/lib/soap/element.rb @@ -0,0 +1,277 @@ +# SOAP4R - SOAP elements library +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/qname' +require 'soap/baseData' + + +module SOAP + + +### +## SOAP elements +# +module SOAPEnvelopeElement; end + +class SOAPFault < SOAPStruct + include SOAPEnvelopeElement + include SOAPCompoundtype + +public + + def faultcode + self['faultcode'] + end + + def faultstring + self['faultstring'] + end + + def faultactor + self['faultactor'] + end + + def detail + self['detail'] + end + + def faultcode=(rhs) + self['faultcode'] = rhs + end + + def faultstring=(rhs) + self['faultstring'] = rhs + end + + def faultactor=(rhs) + self['faultactor'] = rhs + end + + def detail=(rhs) + self['detail'] = rhs + end + + def initialize(faultcode = nil, faultstring = nil, faultactor = nil, detail = nil) + super(EleFaultName) + @elename = EleFaultName + @encodingstyle = EncodingNamespace + if faultcode + self.faultcode = faultcode + self.faultstring = faultstring + self.faultactor = faultactor + self.detail = detail + self.faultcode.elename = EleFaultCodeName if self.faultcode + self.faultstring.elename = EleFaultStringName if self.faultstring + self.faultactor.elename = EleFaultActorName if self.faultactor + self.detail.elename = EleFaultDetailName if self.detail + end + faultcode.parent = self if faultcode + faultstring.parent = self if faultstring + faultactor.parent = self if faultactor + detail.parent = self if detail + end + + def encode(generator, ns, attrs = {}) + Generator.assign_ns(attrs, ns, EnvelopeNamespace) + Generator.assign_ns(attrs, ns, EncodingNamespace) + attrs[ns.name(AttrEncodingStyleName)] = EncodingNamespace + name = ns.name(@elename) + generator.encode_tag(name, attrs) + yield(self.faultcode) + yield(self.faultstring) + yield(self.faultactor) + yield(self.detail) if self.detail + generator.encode_tag_end(name, true) + end +end + + +class SOAPBody < SOAPStruct + include SOAPEnvelopeElement + + attr_reader :is_fault + + def initialize(data = nil, is_fault = false) + super(nil) + @elename = EleBodyName + @encodingstyle = nil + if data + if data.respond_to?(:to_xmlpart) + data = SOAP::SOAPRawData.new(data) + elsif defined?(::REXML) and data.is_a?(::REXML::Element) + data = SOAP::SOAPRawData.new(SOAP::SOAPREXMLElementWrap.new(data)) + end + if data.respond_to?(:elename) + add(data.elename.name, data) + else + data.to_a.each do |datum| + add(datum.elename.name, datum) + end + end + end + @is_fault = is_fault + end + + def encode(generator, ns, attrs = {}) + name = ns.name(@elename) + generator.encode_tag(name, attrs) + @data.each do |data| + yield(data) + end + generator.encode_tag_end(name, @data.size > 0) + end + + def root_node + @data.each do |node| + if node.root == 1 + return node + end + end + # No specified root... + @data.each do |node| + if node.root != 0 + return node + end + end + raise Parser::FormatDecodeError.new('no root element') + end +end + + +class SOAPHeaderItem < XSD::NSDBase + include SOAPEnvelopeElement + include SOAPCompoundtype + +public + + attr_accessor :element + attr_accessor :mustunderstand + attr_accessor :encodingstyle + attr_accessor :actor + + def initialize(element, mustunderstand = true, encodingstyle = nil, actor = nil) + super() + @type = nil + @element = element + @mustunderstand = mustunderstand + @encodingstyle = encodingstyle + @actor = actor + element.parent = self if element + element.qualified = true + end + + def encode(generator, ns, attrs = {}) + attrs.each do |key, value| + @element.extraattr[key] = value + end + # to remove mustUnderstand attribute, set it to nil + unless @mustunderstand.nil? + @element.extraattr[AttrMustUnderstandName] = (@mustunderstand ? '1' : '0') + end + if @encodingstyle + @element.extraattr[AttrEncodingStyleName] = @encodingstyle + end + unless @element.encodingstyle + @element.encodingstyle = @encodingstyle + end + if @actor + @element.extraattr[AttrActorName] = @actor + end + yield(@element) + end +end + + +class SOAPHeader < SOAPStruct + include SOAPEnvelopeElement + + attr_writer :force_encode + + def initialize + super(nil) + @elename = EleHeaderName + @encodingstyle = nil + @force_encode = false + end + + def encode(generator, ns, attrs = {}) + name = ns.name(@elename) + generator.encode_tag(name, attrs) + @data.each do |data| + yield(data) + end + generator.encode_tag_end(name, @data.size > 0) + end + + def add(name, value) + actor = value.extraattr[AttrActorName] + mu = value.extraattr[AttrMustUnderstandName] + encstyle = value.extraattr[AttrEncodingStyleName] + mu_value = mu.nil? ? nil : (mu == '1') + # to remove mustUnderstand attribute, set it to nil + item = SOAPHeaderItem.new(value, mu_value, encstyle, actor) + super(name, item) + end + + def length + @data.length + end + alias size length + + def encode? + @force_encode or length > 0 + end +end + + +class SOAPEnvelope < XSD::NSDBase + include SOAPEnvelopeElement + include SOAPCompoundtype + + attr_reader :header + attr_reader :body + attr_reader :external_content + + def initialize(header = nil, body = nil) + super() + @type = nil + @elename = EleEnvelopeName + @encodingstyle = nil + @header = header + @body = body + @external_content = {} + header.parent = self if header + body.parent = self if body + end + + def header=(header) + header.parent = self + @header = header + end + + def body=(body) + body.parent = self + @body = body + end + + def encode(generator, ns, attrs = {}) + Generator.assign_ns(attrs, ns, elename.namespace) + name = ns.name(@elename) + generator.encode_tag(name, attrs) + yield(@header) if @header and @header.encode? + yield(@body) + generator.encode_tag_end(name, true) + end + + def to_ary + [header, body] + end +end + + +end diff --git a/lib/soap/encodingstyle/aspDotNetHandler.rb b/lib/soap/encodingstyle/aspDotNetHandler.rb new file mode 100644 index 0000000..ce6c450 --- /dev/null +++ b/lib/soap/encodingstyle/aspDotNetHandler.rb @@ -0,0 +1,207 @@ +# SOAP4R - ASP.NET EncodingStyle handler library +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/encodingstyle/handler' + + +module SOAP +module EncodingStyle + + +class ASPDotNetHandler < Handler + Namespace = 'http://tempuri.org/ASP.NET' + add_handler + + def initialize(charset = nil) + super(charset) + @textbuf = '' + @decode_typemap = nil + end + + + ### + ## encode interface. + # + def encode_data(generator, ns, data, parent) + attrs = {} + # ASPDotNetHandler is intended to be used for accessing an ASP.NET doc/lit + # service as an rpc/encoded service. in the situation, local elements + # should be qualified. propagate parent's namespace to children. + if data.elename.namespace.nil? + data.elename = + XSD::QName.new(parent.elename.namespace, data.elename.name) + end + name = generator.encode_name(ns, data, attrs) + case data + when SOAPRawString + generator.encode_tag(name, attrs) + generator.encode_rawstring(data.to_s) + when XSD::XSDString + generator.encode_tag(name, attrs) + generator.encode_string(@charset ? + XSD::Charset.encoding_to_xml(data.to_s, @charset) : data.to_s) + when XSD::XSDAnySimpleType + generator.encode_tag(name, attrs) + generator.encode_string(data.to_s) + when SOAPStruct + generator.encode_tag(name, attrs) + data.each do |key, value| + generator.encode_child(ns, value, data) + end + when SOAPArray + generator.encode_tag(name, attrs) + data.traverse do |child, *rank| + data.position = nil + generator.encode_child(ns, child, data) + end + else + raise EncodingStyleError.new( + "unknown object:#{data} in this encodingStyle") + end + end + + def encode_data_end(generator, ns, data, parent) + name = generator.encode_name_end(ns, data) + cr = (data.is_a?(SOAPCompoundtype) and data.have_member) + generator.encode_tag_end(name, cr) + end + + + ### + ## decode interface. + # + class SOAPTemporalObject + attr_accessor :parent + + def initialize + @parent = nil + end + end + + class SOAPUnknown < SOAPTemporalObject + def initialize(handler, elename) + super() + @handler = handler + @elename = elename + end + + def as_struct + o = SOAPStruct.decode(@elename, XSD::AnyTypeName) + o.parent = @parent + o.type.name = @name + @handler.decode_parent(@parent, o) + o + end + + def as_string + o = SOAPString.decode(@elename) + o.parent = @parent + @handler.decode_parent(@parent, o) + o + end + end + + def decode_tag(ns, elename, attrs, parent) + @textbuf = '' + o = SOAPUnknown.new(self, elename) + o.parent = parent + o + end + + def decode_tag_end(ns, node) + o = node.node + if o.is_a?(SOAPUnknown) + newnode = o.as_string +# if /\A\s*\z/ =~ @textbuf +# o.as_struct +# else +# o.as_string +# end + node.replace_node(newnode) + o = node.node + end + + decode_textbuf(o) + @textbuf = '' + end + + def decode_text(ns, text) + # @textbuf is set at decode_tag_end. + @textbuf << text + end + + def decode_prologue + end + + def decode_epilogue + end + + def decode_parent(parent, node) + case parent.node + when SOAPUnknown + newparent = parent.node.as_struct + node.parent = newparent + parent.replace_node(newparent) + decode_parent(parent, node) + + when SOAPStruct + data = parent.node[node.elename.name] + case data + when nil + parent.node.add(node.elename.name, node) + when SOAPArray + name, type_ns = node.elename.name, node.type.namespace + data.add(node) + node.elename, node.type.namespace = name, type_ns + else + parent.node[node.elename.name] = SOAPArray.new + name, type_ns = data.elename.name, data.type.namespace + parent.node[node.elename.name].add(data) + data.elename.name, data.type.namespace = name, type_ns + name, type_ns = node.elename.name, node.type.namespace + parent.node[node.elename.name].add(node) + node.elename.name, node.type.namespace = name, type_ns + end + + when SOAPArray + if node.position + parent.node[*(decode_arypos(node.position))] = node + parent.node.sparse = true + else + parent.node.add(node) + end + + when SOAPBasetype + raise EncodingStyleError.new("SOAP base type must not have a child") + + else + # SOAPUnknown does not have parent. + # raise EncodingStyleError.new("illegal parent: #{parent}") + end + end + +private + + def decode_textbuf(node) + if node.is_a?(XSD::XSDString) + if @charset + node.set(XSD::Charset.encoding_from_xml(@textbuf, @charset)) + else + node.set(@textbuf) + end + else + # Nothing to do... + end + end +end + +ASPDotNetHandler.new + + +end +end diff --git a/lib/soap/encodingstyle/handler.rb b/lib/soap/encodingstyle/handler.rb new file mode 100644 index 0000000..90389aa --- /dev/null +++ b/lib/soap/encodingstyle/handler.rb @@ -0,0 +1,120 @@ +# SOAP4R - EncodingStyle handler library +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/soap' +require 'soap/baseData' +require 'soap/element' + + +module SOAP +module EncodingStyle + + +class Handler + @@handlers = {} + + class EncodingStyleError < Error; end + + class << self + def uri + self::Namespace + end + + def handler(uri) + @@handlers[uri] + end + + def each + @@handlers.each do |key, value| + yield(value) + end + end + + private + + def add_handler + @@handlers[self.uri] = self + end + end + + attr_reader :charset + attr_accessor :generate_explicit_type + def decode_typemap=(definedtypes) + @decode_typemap = definedtypes + end + + def initialize(charset) + @charset = charset + @generate_explicit_type = true + @decode_typemap = nil + end + + ### + ## encode interface. + # + # Returns a XML instance as a string. + def encode_data(generator, ns, data, parent) + raise NotImplementError + end + + def encode_data_end(generator, ns, data, parent) + raise NotImplementError + end + + def encode_prologue + end + + def encode_epilogue + end + + ### + ## decode interface. + # + # Returns SOAP/OM data. + def decode_tag(ns, name, attrs, parent) + raise NotImplementError + end + + def decode_tag_end(ns, name) + raise NotImplementError + end + + def decode_text(ns, text) + raise NotImplementError + end + + def decode_prologue + end + + def decode_epilogue + end + + def encode_attr_key(attrs, ns, qname) + if qname.namespace.nil? + qname.name + else + unless ns.assigned_as_tagged?(qname.namespace) + Generator.assign_ns!(attrs, ns, qname.namespace) + end + ns.name_attr(qname) + end + end + + def encode_qname(attrs, ns, qname) + if qname.namespace.nil? + qname.name + else + Generator.assign_ns(attrs, ns, qname.namespace) + ns.name(qname) + end + end +end + + +end +end diff --git a/lib/soap/encodingstyle/literalHandler.rb b/lib/soap/encodingstyle/literalHandler.rb new file mode 100644 index 0000000..6327edb --- /dev/null +++ b/lib/soap/encodingstyle/literalHandler.rb @@ -0,0 +1,195 @@ +# SOAP4R - XML Literal EncodingStyle handler library +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/encodingstyle/handler' + + +module SOAP +module EncodingStyle + + +class LiteralHandler < Handler + Namespace = SOAP::LiteralNamespace + add_handler + + def initialize(charset = nil) + super(charset) + @textbuf = [] + end + + + ### + ## encode interface. + # + def encode_data(generator, ns, data, parent) + attrs = {} + name = generator.encode_name(ns, data, attrs) + if data.type and data.type.name and + (@generate_explicit_type or data.force_typed) + data.extraattr[XSD::AttrTypeName] = data.type + end + data.extraattr.each do |key, value| + keytag = key + if key.is_a?(XSD::QName) + keytag = encode_attr_key(attrs, ns, key) + end + if value.is_a?(XSD::QName) + value = encode_qname(attrs, ns, value) + end + attrs[keytag] = value + end + case data + when SOAPExternalReference + # do not encode SOAPExternalReference in + # literalHandler (which is used for literal service) + data.referred + when SOAPRawString + generator.encode_tag(name, attrs) + generator.encode_rawstring(data.to_s) + when XSD::XSDString + generator.encode_tag(name, attrs) + str = decode_str(data.to_s) + generator.encode_string(str) + when XSD::XSDAnySimpleType + generator.encode_tag(name, attrs) + generator.encode_string(data.to_s) + when SOAPStruct + generator.encode_tag(name, attrs) + data.each do |key, value| + generator.encode_child(ns, value, data) + end + when SOAPArray + generator.encode_tag(name, attrs) + data.traverse do |child, *rank| + data.position = nil + generator.encode_child(ns, child, data) + end + when SOAPElement + unless generator.use_default_namespace + # passes 2 times for simplifying namespace definition + data.each do |key, value| + if value.elename.namespace + Generator.assign_ns(attrs, ns, value.elename.namespace) + end + end + end + if data.text and data.text.is_a?(XSD::QName) + Generator.assign_ns(attrs, ns, data.text.namespace) + end + generator.encode_tag(name, attrs) + if data.text + if data.text.is_a?(XSD::QName) + text = ns.name(data.text) + else + text = data.text + end + generator.encode_string(text) + end + data.each do |key, value| + generator.encode_child(ns, value, data) + end + else + raise EncodingStyleError.new( + "unknown object:#{data} in this encodingStyle") + end + end + + def encode_data_end(generator, ns, data, parent) + # do not encode SOAPExternalReference in + # literalHandler (which is used for literal service) + return nil if data.is_a?(SOAPExternalReference) + name = generator.encode_name_end(ns, data) + cr = (data.is_a?(SOAPCompoundtype) and data.have_member) + generator.encode_tag_end(name, cr) + end + + + ### + ## decode interface. + # + def decode_tag(ns, elename, attrs, parent) + @textbuf.clear + if attrs[XSD::AttrNilName] == 'true' + o = SOAPNil.decode(elename) + else + o = SOAPElement.decode(elename) + end + if definedtype = attrs[XSD::AttrTypeName] + o.type = ns.parse(definedtype) + end + o.parent = parent + o.extraattr.update(attrs) + decode_parent(parent, o) + o + end + + def decode_tag_end(ns, node) + textbufstr = @textbuf.join + @textbuf.clear + o = node.node + decode_textbuf(o, textbufstr) + end + + def decode_text(ns, text) + # @textbuf is set at decode_tag_end. + @textbuf << text + end + + def decode_prologue + end + + def decode_epilogue + end + + def decode_parent(parent, node) + return unless parent.node + case parent.node + when SOAPElement + parent.node.add(node) + node.parent = parent.node + when SOAPStruct + parent.node.add(node.elename.name, node) + node.parent = parent.node + when SOAPArray + if node.position + parent.node[*(decode_arypos(node.position))] = node + parent.node.sparse = true + else + parent.node.add(node) + end + node.parent = parent.node + else + raise EncodingStyleError.new("illegal parent: #{parent.node}") + end + end + +private + + def decode_textbuf(node, textbufstr) + case node + when XSD::XSDString, SOAPElement + if @charset + node.set(decode_str(textbufstr)) + else + node.set(textbufstr) + end + else + # Nothing to do... + end + end + + def decode_str(str) + @charset ? XSD::Charset.encoding_from_xml(str, @charset) : str + end +end + +LiteralHandler.new + + +end +end diff --git a/lib/soap/encodingstyle/soapHandler.rb b/lib/soap/encodingstyle/soapHandler.rb new file mode 100644 index 0000000..a14f533 --- /dev/null +++ b/lib/soap/encodingstyle/soapHandler.rb @@ -0,0 +1,559 @@ +# SOAP4R - SOAP EncodingStyle handler library +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/encodingstyle/handler' +require 'soap/mapping/registry' + + +module SOAP +module EncodingStyle + + +class SOAPHandler < Handler + Namespace = SOAP::EncodingNamespace + add_handler + + def initialize(charset = nil) + super(charset) + @refpool = [] + @idpool = [] + @textbuf = [] + @is_first_top_ele = true + end + + + ### + ## encode interface. + # + def encode_data(generator, ns, data, parent) + attrs = encode_attrs(generator, ns, data, parent) + if parent && parent.is_a?(SOAPArray) && parent.position + attrs[ns.name(AttrPositionName)] = "[#{parent.position.join(',')}]" + end + name = generator.encode_name(ns, data, attrs) + case data + when SOAPReference + attrs['href'] = data.refidstr + generator.encode_tag(name, attrs) + when SOAPExternalReference + data.referred + attrs['href'] = data.refidstr + generator.encode_tag(name, attrs) + when SOAPRawString + generator.encode_tag(name, attrs) + generator.encode_rawstring(data.to_s) + when XSD::XSDString + generator.encode_tag(name, attrs) + generator.encode_string(@charset ? + XSD::Charset.encoding_to_xml(data.to_s, @charset) : data.to_s) + when XSD::XSDAnySimpleType + generator.encode_tag(name, attrs) + generator.encode_string(data.to_s) + when SOAPStruct + generator.encode_tag(name, attrs) + data.each do |key, value| + generator.encode_child(ns, value, data) + end + when SOAPArray + generator.encode_tag(name, attrs) + data.traverse do |child, *rank| + data.position = data.sparse ? rank : nil + generator.encode_child(ns, child, data) + end + else + raise EncodingStyleError.new( + "unknown object:#{data} in this encodingStyle") + end + end + + def encode_data_end(generator, ns, data, parent) + name = generator.encode_name_end(ns, data) + cr = (data.is_a?(SOAPCompoundtype) and data.have_member) + generator.encode_tag_end(name, cr) + end + + + ### + ## decode interface. + # + class SOAPTemporalObject + attr_accessor :parent + attr_accessor :position + attr_accessor :id + attr_accessor :root + + def initialize + @parent = nil + @position = nil + @id = nil + @root = nil + end + end + + class SOAPUnknown < SOAPTemporalObject + attr_reader :type + attr_accessor :definedtype + attr_reader :extraattr + + def initialize(handler, elename, type, extraattr) + super() + @handler = handler + @elename = elename + @type = type + @extraattr = extraattr + @definedtype = nil + end + + def as_struct + if @extraattr[XSD::AttrNilName] == 'true' + return as_nil + end + o = SOAPStruct.decode(@elename, @type) + o.id = @id + o.root = @root + o.parent = @parent + o.position = @position + o.extraattr.update(@extraattr) + @handler.decode_parent(@parent, o) + o + end + + def as_string + if @extraattr[XSD::AttrNilName] == 'true' + return as_nil + end + o = SOAPString.decode(@elename) + o.id = @id + o.root = @root + o.parent = @parent + o.position = @position + o.extraattr.update(@extraattr) + @handler.decode_parent(@parent, o) + o + end + + def as_nil + o = SOAPNil.decode(@elename) + o.id = @id + o.root = @root + o.parent = @parent + o.position = @position + o.extraattr.update(@extraattr) + @handler.decode_parent(@parent, o) + o + end + end + + def decode_tag(ns, elename, attrs, parent) + @textbuf.clear + is_nil, type, arytype, root, offset, position, href, id = + extract_attrs(ns, attrs) + o = nil + if is_nil + o = SOAPNil.decode(elename) + elsif href + o = SOAPReference.decode(elename, href) + @refpool << o + elsif @decode_typemap + o = decode_tag_by_wsdl(ns, elename, type, parent.node, arytype, attrs) + else + o = decode_tag_by_type(ns, elename, type, parent.node, arytype, attrs) + end + + if o.is_a?(SOAPArray) + if offset + o.offset = decode_arypos(offset) + o.sparse = true + else + o.sparse = false + end + end + + o.parent = parent + o.id = id + o.root = root + o.position = position + + unless o.is_a?(SOAPTemporalObject) + @idpool << o if o.id + decode_parent(parent, o) + end + o + end + + def decode_tag_end(ns, node) + textbufstr = @textbuf.join + @textbuf.clear + o = node.node + if o.is_a?(SOAPUnknown) + newnode = if /\A\s*\z/ =~ textbufstr + o.as_struct + else + o.as_string + end + if newnode.id + @idpool << newnode + end + node.replace_node(newnode) + o = node.node + end + decode_textbuf(o, textbufstr) + # unlink definedtype + o.definedtype = nil + end + + def decode_text(ns, text) + @textbuf << text + end + + def decode_prologue + @refpool.clear + @idpool.clear + @is_first_top_ele = true + end + + def decode_epilogue + decode_resolve_id + end + + def decode_parent(parent, node) + return unless parent.node + case parent.node + when SOAPUnknown + newparent = parent.node.as_struct + node.parent = newparent + if newparent.id + @idpool << newparent + end + parent.replace_node(newparent) + decode_parent(parent, node) + when SOAPStruct + parent.node.add(node.elename.name, node) + node.parent = parent.node + when SOAPArray + if node.position + parent.node[*(decode_arypos(node.position))] = node + parent.node.sparse = true + else + parent.node.add(node) + end + node.parent = parent.node + else + raise EncodingStyleError.new("illegal parent: #{parent.node}") + end + end + +private + + def content_ranksize(typename) + typename.scan(/\[[\d,]*\]$/)[0] + end + + def content_typename(typename) + typename.sub(/\[,*\]$/, '') + end + + def create_arytype(ns, data) + XSD::QName.new(data.arytype.namespace, + content_typename(data.arytype.name) + "[#{data.size.join(',')}]") + end + + def encode_attrs(generator, ns, data, parent) + attrs = {} + return attrs if data.is_a?(SOAPReference) + + if !parent || parent.encodingstyle != EncodingNamespace + if @generate_explicit_type + Generator.assign_ns(attrs, ns, EnvelopeNamespace) + attrs[ns.name(AttrEncodingStyleName)] = EncodingNamespace + end + data.encodingstyle = EncodingNamespace + end + + if data.is_a?(SOAPNil) + attrs[ns.name(XSD::AttrNilName)] = XSD::NilValue + elsif @generate_explicit_type + if data.type.namespace + Generator.assign_ns(attrs, ns, data.type.namespace) + end + if data.is_a?(SOAPArray) + if data.arytype.namespace + Generator.assign_ns(attrs, ns, data.arytype.namespace) + end + Generator.assign_ns(attrs, ns, EncodingNamespace) + attrs[ns.name(AttrArrayTypeName)] = ns.name(create_arytype(ns, data)) + if data.type.name + attrs[ns.name(XSD::AttrTypeName)] = ns.name(data.type) + end + elsif parent && parent.is_a?(SOAPArray) && (parent.arytype == data.type) + # No need to add. + elsif !data.type.namespace + # No need to add. + else + attrs[ns.name(XSD::AttrTypeName)] = ns.name(data.type) + end + end + data.extraattr.each do |key, value| + keytag = key + if key.is_a?(XSD::QName) + keytag = encode_attr_key(attrs, ns, key) + end + if value.is_a?(XSD::QName) + value = encode_qname(attrs, ns, value) + else + value = encode_attr_value(generator, ns, key, value) + end + attrs[keytag] = value + end + if data.id + attrs['id'] = data.id + end + attrs + end + + def encode_attr_value(generator, ns, qname, value) + case value + when SOAPType + ref = SOAPReference.new(value) + generator.add_reftarget(qname.name, value) + ref.refidstr + else + value.to_s + end + end + + def decode_tag_by_wsdl(ns, elename, typestr, parent, arytypestr, attrs) + o = nil + if parent.class == SOAPBody + # root element: should branch by root attribute? + if @is_first_top_ele + # Unqualified name is allowed here. + @is_first_top_ele = false + type = @decode_typemap[elename] || + @decode_typemap.find_name(elename.name) + if type + o = SOAPStruct.new(elename) + o.elename = elename + o.definedtype = type + return o + end + end + # multi-ref element. + if typestr + typename = ns.parse(typestr) + typedef = @decode_typemap[typename] + if typedef + return decode_definedtype(elename, typename, typedef, arytypestr) + end + end + return decode_tag_by_type(ns, elename, typestr, parent, arytypestr, attrs) + end + + if parent.type == XSD::AnyTypeName + return decode_tag_by_type(ns, elename, typestr, parent, arytypestr, attrs) + end + + # parent.definedtype == nil means the parent is SOAPUnknown. SOAPUnknown + # is generated by decode_tag_by_type when its type is anyType. + parenttype = parent.definedtype || @decode_typemap[parent.type] + unless parenttype + return decode_tag_by_type(ns, elename, typestr, parent, arytypestr, attrs) + end + + definedtype_name = parenttype.child_type(elename) + if definedtype_name and (klass = TypeMap[definedtype_name]) + return decode_basetype(klass, elename) + elsif definedtype_name == XSD::AnyTypeName + return decode_tag_by_type(ns, elename, typestr, parent, arytypestr, attrs) + end + + if definedtype_name + typedef = @decode_typemap[definedtype_name] + else + typedef = parenttype.child_defined_complextype(elename) + end + decode_definedtype(elename, definedtype_name, typedef, arytypestr) + end + + def decode_definedtype(elename, typename, typedef, arytypestr) + unless typedef + raise EncodingStyleError.new("unknown type '#{typename}'") + end + if typedef.is_a?(::WSDL::XMLSchema::SimpleType) + decode_defined_simpletype(elename, typename, typedef, arytypestr) + else + decode_defined_complextype(elename, typename, typedef, arytypestr) + end + end + + def decode_basetype(klass, elename) + klass.decode(elename) + end + + def decode_defined_simpletype(elename, typename, typedef, arytypestr) + if typedef.base + o = decode_basetype(TypeMap[typedef.base], elename) + o.definedtype = typedef + o + else + raise RuntimeError.new("unsupported simpleType: #{typedef}") + end + end + + def decode_defined_complextype(elename, typename, typedef, arytypestr) + case typedef.compoundtype + when :TYPE_STRUCT, :TYPE_MAP + o = SOAPStruct.decode(elename, typename) + o.definedtype = typedef + return o + when :TYPE_ARRAY + expected_arytype = typedef.find_arytype + if arytypestr + actual_arytype = XSD::QName.new(expected_arytype.namespace, + content_typename(expected_arytype.name) << + content_ranksize(arytypestr)) + o = SOAPArray.decode(elename, typename, actual_arytype) + else + o = SOAPArray.new(typename, 1, expected_arytype) + o.elename = elename + end + o.definedtype = typedef + return o + when :TYPE_EMPTY + o = SOAPNil.decode(elename) + o.definedtype = typedef + return o + else + raise RuntimeError.new( + "Unknown kind of complexType: #{typedef.compoundtype}") + end + nil + end + + def decode_tag_by_type(ns, elename, typestr, parent, arytypestr, attrs) + if arytypestr + type = typestr ? ns.parse(typestr) : ValueArrayName + node = SOAPArray.decode(elename, type, ns.parse(arytypestr)) + node.extraattr.update(attrs) + return node + end + + type = nil + if typestr + type = ns.parse(typestr) + elsif parent.is_a?(SOAPArray) + type = parent.arytype + else + # Since it's in dynamic(without any type) encoding process, + # assumes entity as its type itself. + # => type Array in SOAP-ENC. + # => type Country in foo. + type = elename + end + + if klass = TypeMap[type] + node = decode_basetype(klass, elename) + node.extraattr.update(attrs) + return node + end + + # Unknown type... Struct or String + SOAPUnknown.new(self, elename, type, attrs) + end + + def decode_textbuf(node, textbufstr) + case node + when XSD::XSDHexBinary, XSD::XSDBase64Binary + node.set_encoded(textbufstr) + when XSD::XSDString + if @charset + textbufstr = XSD::Charset.encoding_from_xml(textbufstr, @charset) + end + if node.definedtype + node.definedtype.check_lexical_format(textbufstr) + end + node.set(textbufstr) + when SOAPNil + # Nothing to do. + when SOAPBasetype + node.set(textbufstr) + else + # Nothing to do... + end + end + + NilLiteralMap = { + 'true' => true, + '1' => true, + 'false' => false, + '0' => false + } + RootLiteralMap = { + '1' => 1, + '0' => 0 + } + def extract_attrs(ns, attrs) + is_nil = NilLiteralMap[attrs[XSD::AttrNilName]] + type = attrs[XSD::AttrTypeName] + arytype = attrs[AttrArrayTypeName] + root = attrs[AttrRootName] + offset = attrs[AttrOffsetName] + position = attrs[AttrPositionName] + href = attrs[AttrHrefName] + id = attrs[AttrIdName] + if attrs.key?(Mapping::RubyIVarName) + attrs[Mapping::RubyIVarName] = + decode_ref_value(ns, attrs[Mapping::RubyIVarName]) + end + return is_nil, type, arytype, root, offset, position, href, id + end + + def decode_ref_value(ns, value) + if /\A#/ =~ value + o = SOAPReference.decode(nil, value) + @refpool << o + o + else + value + end + end + + def decode_arypos(position) + /^\[(.+)\]$/ =~ position + $1.split(',').collect { |s| s.to_i } + end + + def decode_resolve_id + count = @refpool.length # To avoid infinite loop + while !@refpool.empty? && count > 0 + @refpool = @refpool.find_all { |ref| + o = @idpool.find { |item| + item.id == ref.refid + } + if o.is_a?(SOAPReference) + true # link of link. + elsif o + ref.__setobj__(o) + false + elsif o = ref.rootnode.external_content[ref.refid] + ref.__setobj__(o) + false + else + raise EncodingStyleError.new("unresolved reference: #{ref.refid}") + end + } + count -= 1 + end + end +end + +SOAPHandler.new + + +end +end diff --git a/lib/soap/filter.rb b/lib/soap/filter.rb new file mode 100644 index 0000000..83cc7bf --- /dev/null +++ b/lib/soap/filter.rb @@ -0,0 +1,13 @@ +# SOAP4R - SOAP filter. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/filter/filterchain' +# envelope filter +require 'soap/filter/handler' +# steram filter +require 'soap/filter/streamhandler' diff --git a/lib/soap/filter/filterchain.rb b/lib/soap/filter/filterchain.rb new file mode 100644 index 0000000..54d821a --- /dev/null +++ b/lib/soap/filter/filterchain.rb @@ -0,0 +1,51 @@ +# SOAP4R - SOAP filter chain. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/filter/handler' + + +module SOAP +module Filter + + +class FilterChain + + def each + @array.each do |filter| + yield filter + end + end + + def reverse_each + @array.reverse_each do |filter| + yield filter + end + end + + def initialize + @array = [] + end + + def add(filter) + @array << filter + end + alias << add + + def delete(filter) + @array.delete(filter) + end + + def include?(filter) + @array.include?(filter) + end + +end + + +end +end diff --git a/lib/soap/filter/handler.rb b/lib/soap/filter/handler.rb new file mode 100644 index 0000000..1fde5cd --- /dev/null +++ b/lib/soap/filter/handler.rb @@ -0,0 +1,31 @@ +# SOAP4R - SOAP envelope filter base class. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module SOAP +module Filter + + +class Handler + + # should return envelope. opt can be updated for other filters. + def on_outbound(envelope, opt) + # do something. + envelope + end + + # should return xml. opt can be updated for other filters. + def on_inbound(xml, opt) + # do something. + xml + end + +end + + +end +end diff --git a/lib/soap/filter/streamhandler.rb b/lib/soap/filter/streamhandler.rb new file mode 100644 index 0000000..868f786 --- /dev/null +++ b/lib/soap/filter/streamhandler.rb @@ -0,0 +1,29 @@ +# SOAP4R - SOAP stream filter base class. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module SOAP +module Filter + + +class StreamHandler + + # no returning value expected. + def on_http_outbound(req) + # do something. + end + + # no returning value expected. + def on_http_inbound(req, res) + # do something. + end + +end + + +end +end diff --git a/lib/soap/generator.rb b/lib/soap/generator.rb new file mode 100644 index 0000000..3968410 --- /dev/null +++ b/lib/soap/generator.rb @@ -0,0 +1,299 @@ +# SOAP4R - SOAP XML Instance Generator library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/soap' +require 'soap/ns' +require 'soap/baseData' +require 'soap/encodingstyle/handler' +require 'xsd/codegen/gensupport' + + +module SOAP + + +### +## CAUTION: MT-unsafe +# +class Generator + include SOAP + include XSD::CodeGen::GenSupport + + class FormatEncodeError < Error; end + +public + + attr_accessor :charset + attr_accessor :default_encodingstyle + attr_accessor :generate_explicit_type + attr_accessor :use_numeric_character_reference + attr_accessor :use_default_namespace + + def initialize(opt = {}) + @reftarget = nil + @handlers = {} + @charset = opt[:charset] || XSD::Charset.xml_encoding_label + @default_encodingstyle = opt[:default_encodingstyle] || EncodingNamespace + @generate_explicit_type = + opt.key?(:generate_explicit_type) ? opt[:generate_explicit_type] : true + @use_default_namespace = opt[:use_default_namespace] + @attributeformdefault = opt[:attributeformdefault] + @use_numeric_character_reference = opt[:use_numeric_character_reference] + @indentstr = opt[:no_indent] ? '' : ' ' + @buf = @indent = @curr = nil + @default_ns = opt[:default_ns] + @default_ns_tag = opt[:default_ns_tag] + end + + def generate(obj, io = nil) + @buf = io || '' + @indent = '' + @encode_char_regexp = get_encode_char_regexp() + + prologue + @handlers.each do |uri, handler| + handler.encode_prologue + end + + ns = SOAP::NS.new + if @default_ns + @default_ns.each_ns do |default_ns, default_tag| + Generator.assign_ns(obj.extraattr, ns, default_ns, default_tag) + end + end + if @default_ns_tag + @default_ns_tag.each_ns do |default_ns, default_tag| + ns.known_tag[default_ns] = default_tag + end + end + @buf << xmldecl + encode_data(ns, obj, nil) + + @handlers.each do |uri, handler| + handler.encode_epilogue + end + epilogue + + @buf + end + + def encode_data(ns, obj, parent) + if obj.respond_to?(:to_xmlpart) + formatted = trim_eol(obj.to_xmlpart) + formatted = trim_indent(formatted) + formatted = formatted.gsub(/^/, @indent).sub(/\n+\z/, '') + @buf << "\n#{formatted}" + return + elsif obj.is_a?(SOAPEnvelopeElement) + encode_element(ns, obj, parent) + return + end + if @reftarget && !obj.precedents.empty? + add_reftarget(obj.elename.name, obj) + ref = SOAPReference.new(obj) + ref.elename = ref.elename.dup_name(obj.elename.name) + obj.precedents.clear # Avoid cyclic delay. + obj.encodingstyle = parent.encodingstyle + # SOAPReference is encoded here. + obj = ref + end + encodingstyle = obj.encodingstyle + # Children's encodingstyle is derived from its parent. + encodingstyle ||= parent.encodingstyle if parent + obj.encodingstyle = encodingstyle + handler = find_handler(encodingstyle || @default_encodingstyle) + unless handler + raise FormatEncodeError.new("Unknown encodingStyle: #{ encodingstyle }.") + end + if !obj.elename.name + raise FormatEncodeError.new("Element name not defined: #{ obj }.") + end + handler.encode_data(self, ns, obj, parent) + handler.encode_data_end(self, ns, obj, parent) + end + + def add_reftarget(name, node) + unless @reftarget + raise FormatEncodeError.new("Reftarget is not defined.") + end + @reftarget.add(name, node) + end + + def encode_child(ns, child, parent) + indent_backup, @indent = @indent, @indent + @indentstr + encode_data(ns.clone_ns, child, parent) + @indent = indent_backup + end + + def encode_element(ns, obj, parent) + attrs = obj.extraattr + if obj.is_a?(SOAPBody) + @reftarget = obj + obj.encode(self, ns, attrs) do |child| + indent_backup, @indent = @indent, @indent + @indentstr + encode_data(ns.clone_ns, child, obj) + @indent = indent_backup + end + @reftarget = nil + else + if obj.is_a?(SOAPEnvelope) + Generator.assign_ns(attrs, ns, XSD::InstanceNamespace) + Generator.assign_ns(attrs, ns, XSD::Namespace) + end + obj.encode(self, ns, attrs) do |child| + indent_backup, @indent = @indent, @indent + @indentstr + encode_data(ns.clone_ns, child, obj) + @indent = indent_backup + end + end + end + + def encode_name(ns, data, attrs) + if element_local?(data) + data.elename.name + else + if @use_default_namespace + Generator.assign_ns(attrs, ns, data.elename.namespace, '') + else + Generator.assign_ns(attrs, ns, data.elename.namespace) + end + ns.name(data.elename) + end + end + + def encode_name_end(ns, data) + if element_local?(data) + data.elename.name + else + ns.name(data.elename) + end + end + + def encode_tag(elename, attrs = nil) + if attrs.nil? or attrs.empty? + @buf << "\n#{ @indent }<#{ elename }>" + return + end + ary = [] + attrs.each do |key, value| + ary << %Q[#{ key }="#{ get_encoded(value.to_s) }"] + end + case ary.size + when 0 + @buf << "\n#{ @indent }<#{ elename }>" + when 1 + @buf << %Q[\n#{ @indent }<#{ elename } #{ ary[0] }>] + else + @buf << "\n#{ @indent }<#{ elename } " << + ary.join("\n#{ @indent }#{ @indentstr * 2 }") << + '>' + end + end + + def encode_tag_end(elename, cr = nil) + if cr + @buf << "\n#{ @indent }" + else + @buf << "" + end + end + + def encode_rawstring(str) + @buf << str + end + + def encode_string(str) + @buf << get_encoded(str) + end + + def element_local?(element) + element.elename.namespace.nil? + end + + def self.assign_ns(attrs, ns, namespace, tag = nil) + if namespace.nil? + raise FormatEncodeError.new("empty namespace") + end + override_default_ns = (tag == '' and namespace != ns.default_namespace) + if override_default_ns or !ns.assigned?(namespace) + assign_ns!(attrs, ns, namespace, tag) + end + end + + def self.assign_ns!(attrs, ns, namespace, tag = nil) + tag = ns.assign(namespace, tag) + if tag == '' + attr = 'xmlns' + else + attr = "xmlns:#{tag}" + end + attrs[attr] = namespace + end + +private + + def prologue + end + + def epilogue + end + + ENCODE_CHAR_REGEXP = {} + + EncodeMap = { + '&' => '&', + '<' => '<', + '>' => '>', + '"' => '"', + '\'' => ''', + "\r" => ' ' + } + + def get_encoded(str) + if @use_numeric_character_reference and !XSD::Charset.is_us_ascii(str) + str.gsub!(@encode_char_regexp) { |c| EncodeMap[c] } + str.unpack("U*").collect { |c| + if c == 0x9 or c == 0xa or c == 0xd or (c >= 0x20 and c <= 0x7f) + c.chr + else + sprintf("&#x%x;", c) + end + }.join + else + str.gsub(@encode_char_regexp) { |c| EncodeMap[c] } + end + end + + def get_encode_char_regexp + ENCODE_CHAR_REGEXP[XSD::Charset.encoding] ||= + Regexp.new("[#{EncodeMap.keys.join}]") + end + + def find_handler(encodingstyle) + unless @handlers.key?(encodingstyle) + factory = SOAP::EncodingStyle::Handler.handler(encodingstyle) + if factory + handler = factory.new(@charset) + handler.generate_explicit_type = @generate_explicit_type + handler.encode_prologue + @handlers[encodingstyle] = handler + end + end + @handlers[encodingstyle] + end + + def xmldecl + if @charset + %Q[] + else + %Q[] + end + end +end + + +end diff --git a/lib/soap/header/handler.rb b/lib/soap/header/handler.rb new file mode 100644 index 0000000..439f00b --- /dev/null +++ b/lib/soap/header/handler.rb @@ -0,0 +1,61 @@ +# SOAP4R - SOAP Header handler item +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/element' + + +module SOAP +module Header + + +class Handler + attr_reader :elename + attr_accessor :mustunderstand + attr_reader :encodingstyle + attr_reader :target_actor + + def initialize(elename) + @elename = elename + @mustunderstand = false + @encodingstyle = nil + @target_actor = nil + end + + # Should return a SOAP/OM, a SOAPHeaderItem or nil. + def on_outbound + nil + end + + # Given header is a SOAPHeaderItem or nil. + def on_inbound(header, mustunderstand = false) + # do something. + end + + def on_outbound_headeritem(header) + arity = self.method(:on_outbound).arity + item = (arity == 0) ? on_outbound : on_outbound(header) + if item.nil? + nil + elsif item.is_a?(::SOAP::SOAPHeaderItem) + item.elename = @elename + item + else + item.elename = @elename + ::SOAP::SOAPHeaderItem.new(item, @mustunderstand, @encodingstyle, + @target_actor) + end + end + + def on_inbound_headeritem(header, item) + on_inbound(item.element, item.mustunderstand) + end +end + + +end +end diff --git a/lib/soap/header/handlerset.rb b/lib/soap/header/handlerset.rb new file mode 100644 index 0000000..c86aab6 --- /dev/null +++ b/lib/soap/header/handlerset.rb @@ -0,0 +1,70 @@ +# SOAP4R - SOAP Header handler set +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/namedelements' + + +module SOAP +module Header + + +class HandlerSet + def initialize + @store = XSD::NamedElements.new + end + + def dup + obj = HandlerSet.new + obj.store = @store.dup + obj + end + + def add(handler) + @store << handler + end + alias << add + + def delete(handler) + @store.delete(handler) + end + + def include?(handler) + @store.include?(handler) + end + + # returns: Array of SOAPHeaderItem + def on_outbound(header) + @store.collect { |handler| + handler.on_outbound_headeritem(header) + }.compact + end + + # header: SOAPHeaderItem enumerable object + def on_inbound(header) + header.each do |name, item| + handler = @store.find { |handler| + handler.elename == item.element.elename + } + if handler + handler.on_inbound_headeritem(header, item) + elsif item.mustunderstand + raise UnhandledMustUnderstandHeaderError.new(item.element.elename.to_s) + end + end + end + +protected + + def store=(store) + @store = store + end +end + + +end +end diff --git a/lib/soap/header/mappinghandler.rb b/lib/soap/header/mappinghandler.rb new file mode 100644 index 0000000..32529a5 --- /dev/null +++ b/lib/soap/header/mappinghandler.rb @@ -0,0 +1,47 @@ +# SOAP4R - SOAP Mapping header item handler +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/header/handler' +require 'soap/mapping/mapping' + + +module SOAP +module Header + + +class MappingHandler < SOAP::Header::Handler + attr_accessor :registry + + def initialize(elename, registry = nil) + super(elename) + @registry = registry + end + + # Should return an Object for mapping + def on_mapping_outbound + nil + end + + # Given header is a mapped Object + def on_mapping_inbound(obj, mustunderstand) + end + + def on_outbound + obj = on_mapping_outbound + obj ? SOAP::Mapping.obj2soap(obj, @registry, @elename) : nil + end + + def on_inbound(header, mustunderstand) + obj = SOAP::Mapping.soap2obj(header, @registry) + on_mapping_inbound(obj, mustunderstand) + end +end + + +end +end diff --git a/lib/soap/header/simplehandler.rb b/lib/soap/header/simplehandler.rb new file mode 100644 index 0000000..39ce8fa --- /dev/null +++ b/lib/soap/header/simplehandler.rb @@ -0,0 +1,44 @@ +# SOAP4R - SOAP Simple header item handler +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/header/handler' +require 'soap/baseData' + + +module SOAP +module Header + + +class SimpleHandler < SOAP::Header::Handler + def initialize(elename) + super(elename) + end + + # Should return a Hash, String or nil. + def on_simple_outbound + nil + end + + # Given header is a Hash, String or nil. + def on_simple_inbound(header, mustunderstand) + end + + def on_outbound + h = on_simple_outbound + h ? SOAPElement.from_obj(h, elename.namespace) : nil + end + + def on_inbound(header, mustunderstand) + h = header.respond_to?(:to_obj) ? header.to_obj : header.data + on_simple_inbound(h, mustunderstand) + end +end + + +end +end diff --git a/lib/soap/httpconfigloader.rb b/lib/soap/httpconfigloader.rb new file mode 100644 index 0000000..ed31b0a --- /dev/null +++ b/lib/soap/httpconfigloader.rb @@ -0,0 +1,139 @@ +# SOAP4R - HTTP config loader. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/property' + + +module SOAP + + +module HTTPConfigLoader +module_function + + def set_options(client, options) + client.proxy = options["proxy"] + options.add_hook("proxy") do |key, value| + client.proxy = value + end + client.no_proxy = options["no_proxy"] + options.add_hook("no_proxy") do |key, value| + client.no_proxy = value + end + if client.respond_to?(:protocol_version=) + client.protocol_version = options["protocol_version"] + options.add_hook("protocol_version") do |key, value| + client.protocol_version = value + end + end + ssl_config = options["ssl_config"] ||= ::SOAP::Property.new + set_ssl_config(client, ssl_config) + ssl_config.add_hook(true) do |key, value| + set_ssl_config(client, ssl_config) + end + basic_auth = options["basic_auth"] ||= ::SOAP::Property.new + set_basic_auth(client, basic_auth) + basic_auth.add_hook do |key, value| + set_basic_auth(client, basic_auth) + end + auth = options["auth"] ||= ::SOAP::Property.new + set_auth(client, auth) + auth.add_hook do |key, value| + set_auth(client, auth) + end + options.add_hook("connect_timeout") do |key, value| + client.connect_timeout = value + end + options.add_hook("send_timeout") do |key, value| + client.send_timeout = value + end + options.add_hook("receive_timeout") do |key, value| + client.receive_timeout = value + end + end + + def set_basic_auth(client, basic_auth) + basic_auth.values.each do |ele| + client.set_basic_auth(*authele_to_triplets(ele)) + end + end + + def set_auth(client, auth) + auth.values.each do |ele| + client.set_auth(*authele_to_triplets(ele)) + end + end + + def authele_to_triplets(ele) + if ele.is_a?(::Array) + url, userid, passwd = ele + else + url, userid, passwd = ele[:url], ele[:userid], ele[:password] + end + return url, userid, passwd + end + + def set_ssl_config(client, ssl_config) + ssl_config.each do |key, value| + cfg = client.ssl_config + if cfg.nil? + raise NotImplementedError.new("SSL not supported") + end + case key + when 'client_cert' + cfg.client_cert = cert_from_file(value) + when 'client_key' + cfg.client_key = key_from_file(value) + when 'client_ca' + cfg.client_ca = value + when 'ca_path' + cfg.set_trust_ca(value) + when 'ca_file' + cfg.set_trust_ca(value) + when 'crl' + cfg.set_crl(value) + when 'verify_mode' + cfg.verify_mode = ssl_config_int(value) + when 'verify_depth' + cfg.verify_depth = ssl_config_int(value) + when 'options' + cfg.options = value + when 'ciphers' + cfg.ciphers = value + when 'verify_callback' + cfg.verify_callback = value + when 'cert_store' + cfg.cert_store = value + else + raise ArgumentError.new("unknown ssl_config property #{key}") + end + end + end + + def ssl_config_int(value) + if value.nil? or value.to_s.empty? + nil + else + begin + Integer(value) + rescue ArgumentError + ::SOAP::Property::Util.const_from_name(value.to_s) + end + end + end + + def cert_from_file(filename) + OpenSSL::X509::Certificate.new(File.open(filename) { |f| f.read }) + end + + def key_from_file(filename) + OpenSSL::PKey::RSA.new(File.open(filename) { |f| f.read }) + end +end + + +end diff --git a/lib/soap/mapping.rb b/lib/soap/mapping.rb new file mode 100644 index 0000000..a121290 --- /dev/null +++ b/lib/soap/mapping.rb @@ -0,0 +1,12 @@ +# SOAP4R - Ruby type mapping utility. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/mapping/mapping' +require 'soap/mapping/registry' +require 'soap/mapping/encodedregistry' +require 'soap/mapping/literalregistry' diff --git a/lib/soap/mapping/encodedregistry.rb b/lib/soap/mapping/encodedregistry.rb new file mode 100644 index 0000000..4acd69f --- /dev/null +++ b/lib/soap/mapping/encodedregistry.rb @@ -0,0 +1,537 @@ +# SOAP4R - encoded mapping registry. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/baseData' +require 'soap/mapping/mapping' +require 'soap/mapping/typeMap' +require 'soap/mapping/factory' +require 'soap/mapping/rubytypeFactory' + + +module SOAP +module Mapping + + +# Inner class to pass an exception. +class SOAPException + attr_reader :excn_type_name, :cause + + def initialize(e) + @excn_type_name = Mapping.name2elename(e.class.to_s) + @cause = e + end + + def to_e + if @cause.is_a?(::Exception) + @cause.extend(::SOAP::Mapping::MappedException) + return @cause + elsif @cause.respond_to?(:message) and @cause.respond_to?(:backtrace) + e = RuntimeError.new(@cause.message) + e.set_backtrace(@cause.backtrace) + return e + end + klass = Mapping.class_from_name(Mapping.elename2name(@excn_type_name.to_s)) + if klass.nil? or not klass <= ::Exception + return RuntimeError.new(@cause.inspect) + end + obj = klass.new(@cause.message) + obj.extend(::SOAP::Mapping::MappedException) + obj + end +end + + +class EncodedRegistry + include TraverseSupport + include RegistrySupport + + class Map + def initialize(registry) + @obj2soap = {} + @soap2obj = {} + @registry = registry + end + + def obj2soap(obj) + klass = obj.class + if map = @obj2soap[klass] + map.each do |soap_class, factory, info| + ret = factory.obj2soap(soap_class, obj, info, @registry) + return ret if ret + end + end + klass.ancestors.each do |baseclass| + next if baseclass == klass + if map = @obj2soap[baseclass] + map.each do |soap_class, factory, info| + if info[:derived_class] + ret = factory.obj2soap(soap_class, obj, info, @registry) + return ret if ret + end + end + end + end + nil + end + + def soap2obj(node, klass = nil) + if map = @soap2obj[node.class] + map.each do |obj_class, factory, info| + next if klass and obj_class != klass + conv, obj = factory.soap2obj(obj_class, node, info, @registry) + return true, obj if conv + end + end + return false, nil + end + + # Give priority to former entry. + def init(init_map = []) + clear + init_map.reverse_each do |obj_class, soap_class, factory, info| + add(obj_class, soap_class, factory, info) + end + end + + # Give priority to latter entry. + def add(obj_class, soap_class, factory, info) + info ||= {} + (@obj2soap[obj_class] ||= []).unshift([soap_class, factory, info]) + (@soap2obj[soap_class] ||= []).unshift([obj_class, factory, info]) + end + + def clear + @obj2soap.clear + @soap2obj.clear + end + + def find_mapped_soap_class(target_obj_class) + map = @obj2soap[target_obj_class] + map.empty? ? nil : map[0][1] + end + + def find_mapped_obj_class(target_soap_class) + map = @soap2obj[target_soap_class] + map.empty? ? nil : map[0][0] + end + end + + StringFactory = StringFactory_.new + BasetypeFactory = BasetypeFactory_.new + FixnumFactory = FixnumFactory_.new + DateTimeFactory = DateTimeFactory_.new + ArrayFactory = ArrayFactory_.new + Base64Factory = Base64Factory_.new + URIFactory = URIFactory_.new + TypedArrayFactory = TypedArrayFactory_.new + TypedStructFactory = TypedStructFactory_.new + + HashFactory = HashFactory_.new + + SOAPBaseMap = [ + [::NilClass, ::SOAP::SOAPNil, BasetypeFactory], + [::TrueClass, ::SOAP::SOAPBoolean, BasetypeFactory], + [::FalseClass, ::SOAP::SOAPBoolean, BasetypeFactory], + [::String, ::SOAP::SOAPString, StringFactory, + {:derived_class => true}], + [::DateTime, ::SOAP::SOAPDateTime, DateTimeFactory], + [::Date, ::SOAP::SOAPDate, DateTimeFactory], + [::Time, ::SOAP::SOAPDateTime, DateTimeFactory], + [::Time, ::SOAP::SOAPTime, DateTimeFactory], + [::Float, ::SOAP::SOAPDouble, BasetypeFactory, + {:derived_class => true}], + [::Float, ::SOAP::SOAPFloat, BasetypeFactory, + {:derived_class => true}], + [::Fixnum, ::SOAP::SOAPInt, FixnumFactory], + [::Integer, ::SOAP::SOAPInt, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPLong, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPInteger, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPShort, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPByte, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPNonPositiveInteger, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPNegativeInteger, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPNonNegativeInteger, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPPositiveInteger, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPUnsignedLong, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPUnsignedInt, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPUnsignedShort, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPUnsignedByte, BasetypeFactory, + {:derived_class => true}], + [::URI::Generic, ::SOAP::SOAPAnyURI, URIFactory, + {:derived_class => true}], + [::String, ::SOAP::SOAPBase64, Base64Factory], + [::String, ::SOAP::SOAPHexBinary, Base64Factory], + [::String, ::SOAP::SOAPDecimal, BasetypeFactory], + [::String, ::SOAP::SOAPDuration, BasetypeFactory], + [::String, ::SOAP::SOAPGYearMonth, BasetypeFactory], + [::String, ::SOAP::SOAPGYear, BasetypeFactory], + [::String, ::SOAP::SOAPGMonthDay, BasetypeFactory], + [::String, ::SOAP::SOAPGDay, BasetypeFactory], + [::String, ::SOAP::SOAPGMonth, BasetypeFactory], + [::String, ::SOAP::SOAPQName, BasetypeFactory], + + [::Hash, ::SOAP::SOAPArray, HashFactory, + {:derived_class => true}], + [::Hash, ::SOAP::SOAPStruct, HashFactory, + {:derived_class => true}], + + [::Array, ::SOAP::SOAPArray, ArrayFactory, + {:derived_class => true}], + + [::SOAP::Mapping::SOAPException, + ::SOAP::SOAPStruct, TypedStructFactory, + {:type => XSD::QName.new(RubyCustomTypeNamespace, "SOAPException")}], + ] + + RubyOriginalMap = [ + [::NilClass, ::SOAP::SOAPNil, BasetypeFactory], + [::TrueClass, ::SOAP::SOAPBoolean, BasetypeFactory], + [::FalseClass, ::SOAP::SOAPBoolean, BasetypeFactory], + [::String, ::SOAP::SOAPString, StringFactory], + [::DateTime, ::SOAP::SOAPDateTime, DateTimeFactory], + [::Date, ::SOAP::SOAPDate, DateTimeFactory], + [::Time, ::SOAP::SOAPDateTime, DateTimeFactory], + [::Time, ::SOAP::SOAPTime, DateTimeFactory], + [::Float, ::SOAP::SOAPDouble, BasetypeFactory, + {:derived_class => true}], + [::Float, ::SOAP::SOAPFloat, BasetypeFactory, + {:derived_class => true}], + [::Fixnum, ::SOAP::SOAPInt, FixnumFactory], + [::Integer, ::SOAP::SOAPInt, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPLong, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPInteger, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPShort, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPByte, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPNonPositiveInteger, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPNegativeInteger, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPNonNegativeInteger, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPPositiveInteger, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPUnsignedLong, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPUnsignedInt, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPUnsignedShort, BasetypeFactory, + {:derived_class => true}], + [::Integer, ::SOAP::SOAPUnsignedByte, BasetypeFactory, + {:derived_class => true}], + [::URI::Generic, ::SOAP::SOAPAnyURI, URIFactory, + {:derived_class => true}], + [::String, ::SOAP::SOAPBase64, Base64Factory], + [::String, ::SOAP::SOAPHexBinary, Base64Factory], + [::String, ::SOAP::SOAPDecimal, BasetypeFactory], + [::String, ::SOAP::SOAPDuration, BasetypeFactory], + [::String, ::SOAP::SOAPGYearMonth, BasetypeFactory], + [::String, ::SOAP::SOAPGYear, BasetypeFactory], + [::String, ::SOAP::SOAPGMonthDay, BasetypeFactory], + [::String, ::SOAP::SOAPGDay, BasetypeFactory], + [::String, ::SOAP::SOAPGMonth, BasetypeFactory], + [::String, ::SOAP::SOAPQName, BasetypeFactory], + + [::Hash, ::SOAP::SOAPArray, HashFactory], + [::Hash, ::SOAP::SOAPStruct, HashFactory], + + # Does not allow Array's subclass here. + [::Array, ::SOAP::SOAPArray, ArrayFactory], + + [::SOAP::Mapping::SOAPException, + ::SOAP::SOAPStruct, TypedStructFactory, + {:type => XSD::QName.new(RubyCustomTypeNamespace, "SOAPException")}], + ] + + attr_accessor :default_factory + attr_accessor :excn_handler_obj2soap + attr_accessor :excn_handler_soap2obj + + def initialize(config = {}) + super() + @config = config + @map = Map.new(self) + if @config[:allow_original_mapping] + @allow_original_mapping = true + @map.init(RubyOriginalMap) + else + @allow_original_mapping = false + @map.init(SOAPBaseMap) + end + @allow_untyped_struct = @config.key?(:allow_untyped_struct) ? + @config[:allow_untyped_struct] : true + @rubytype_factory = RubytypeFactory.new( + :allow_untyped_struct => @allow_untyped_struct, + :allow_original_mapping => @allow_original_mapping + ) + @default_factory = @rubytype_factory + @excn_handler_obj2soap = nil + @excn_handler_soap2obj = nil + end + + # initial mapping interface + # new interface Registry#register is defined in RegisterSupport + def add(obj_class, soap_class, factory, info = nil) + @map.add(obj_class, soap_class, factory, info) + end + alias set add + + def obj2soap(obj, type_qname = nil) + soap = _obj2soap(obj, type_qname) + if @allow_original_mapping + addextend2soap(soap, obj) + end + soap + end + + def soap2obj(node, klass = nil) + obj = _soap2obj(node, klass) + if @allow_original_mapping + addextend2obj(obj, node.extraattr[RubyExtendName]) + addiv2obj(obj, node.extraattr[RubyIVarName]) + end + obj + end + + def find_mapped_soap_class(obj_class) + @map.find_mapped_soap_class(obj_class) + end + + def find_mapped_obj_class(soap_class) + @map.find_mapped_obj_class(soap_class) + end + +private + + def _obj2soap(obj, type_qname = nil) + ret = nil + if obj.is_a?(SOAPCompoundtype) + obj.replace do |ele| + Mapping._obj2soap(ele, self) + end + return obj + elsif obj.is_a?(SOAPBasetype) + return obj + elsif type_qname && type = TypeMap[type_qname] + return base2soap(obj, type) + end + cause = nil + begin + if definition = schema_definition_from_class(obj.class) + return stubobj2soap(obj, definition) + end + ret = @map.obj2soap(obj) || + @default_factory.obj2soap(nil, obj, nil, self) + return ret if ret + rescue MappingError + cause = $! + end + if @excn_handler_obj2soap + ret = @excn_handler_obj2soap.call(obj) { |yield_obj| + Mapping._obj2soap(yield_obj, self) + } + return ret if ret + end + raise MappingError.new("Cannot map #{ obj.class.name } to SOAP/OM.", cause) + end + + # Might return nil as a mapping result. + def _soap2obj(node, klass = nil) + definition = find_node_definition(node) + if klass + klass_definition = schema_definition_from_class(klass) + if definition and (definition.class_for < klass) + klass = definition.class_for + else + definition = klass_definition + end + else + klass = definition.class_for if definition + end + if definition and node.is_a?(::SOAP::SOAPNameAccessible) + return elesoap2stubobj(node, klass, definition) + end + if node.extraattr.key?(RubyTypeName) + conv, obj = @rubytype_factory.soap2obj(nil, node, nil, self) + return obj if conv + end + conv, obj = @map.soap2obj(node) + return obj if conv + conv, obj = @default_factory.soap2obj(nil, node, nil, self) + return obj if conv + cause = nil + if @excn_handler_soap2obj + begin + return @excn_handler_soap2obj.call(node) { |yield_node| + Mapping._soap2obj(yield_node, self) + } + rescue Exception + cause = $! + end + end + raise MappingError.new("Cannot map #{ node.type } to Ruby object.", cause) + end + + def addiv2obj(obj, attr) + return unless attr + vars = {} + attr.__getobj__.each do |name, value| + vars[name] = Mapping._soap2obj(value, self) + end + Mapping.set_attributes(obj, vars) + end + + def addextend2obj(obj, attr) + return unless attr + attr.split(/ /).reverse_each do |mstr| + obj.extend(Mapping.module_from_name(mstr)) + end + end + + def addextend2soap(node, obj) + return if obj.is_a?(Symbol) or obj.is_a?(Fixnum) + list = (class << obj; self; end).ancestors - obj.class.ancestors + unless list.empty? + node.extraattr[RubyExtendName] = list.collect { |c| + name = c.name + if name.nil? or name.empty? + raise TypeError.new("singleton can't be dumped #{ obj }") + end + name + }.join(" ") + end + end + + def stubobj2soap(obj, definition) + case obj + when ::Array + array2soap(obj, definition) + else + unknownstubobj2soap(obj, definition) + end + end + + def array2soap(obj, definition) + return SOAPNil.new if obj.nil? # ToDo: check nillable. + eledef = definition.elements[0] + soap_obj = SOAPArray.new(ValueArrayName, 1, eledef.elename) + mark_marshalled_obj(obj, soap_obj) + obj.each do |item| + soap_obj.add(typedobj2soap(item, eledef.mapped_class)) + end + soap_obj + end + + def unknownstubobj2soap(obj, definition) + return SOAPNil.new if obj.nil? + if definition.elements.size == 0 + ele = Mapping.obj2soap(obj) + ele.elename = definition.elename if definition.elename + ele.extraattr[XSD::AttrTypeName] = definition.type if definition.type + return ele + else + ele = SOAPStruct.new(definition.type) + mark_marshalled_obj(obj, ele) + end + definition.elements.each do |eledef| + name = eledef.elename.name + if obj.respond_to?(:each) and eledef.as_array? + obj.each do |item| + ele.add(name, typedobj2soap(item, eledef.mapped_class)) + end + else + child = Mapping.get_attribute(obj, eledef.varname) + if child.respond_to?(:each) and eledef.as_array? + child.each do |item| + ele.add(name, typedobj2soap(item, eledef.mapped_class)) + end + else + ele.add(name, typedobj2soap(child, eledef.mapped_class)) + end + end + end + ele + end + + def typedobj2soap(value, klass) + if klass and klass.include?(::SOAP::SOAPBasetype) + base2soap(value, klass) + else + Mapping._obj2soap(value, self) + end + end + + def elesoap2stubobj(node, obj_class, definition) + obj = Mapping.create_empty_object(obj_class) + add_elesoap2stubobj(node, obj, definition) + obj + end + + # XXX consider to merge with the method in LiteralRegistry + def add_elesoap2stubobj(node, obj, definition) + vars = {} + node.each do |name, value| + item = definition.elements.find_element(value.elename) + if item + child = soap2typedobj(value, item.mapped_class) + else + # unknown element is treated as anyType. + child = Mapping._soap2obj(value, self) + end + if item and item.as_array? + (vars[name] ||= []) << child + elsif vars.key?(name) + vars[name] = [vars[name], child].flatten + else + vars[name] = child + end + end + if obj.is_a?(::Array) and is_stubobj_elements_for_array(vars) + Array.instance_method(:replace).bind(obj).call(vars.values[0]) + else + Mapping.set_attributes(obj, vars) + end + end + + def soap2typedobj(value, klass) + unless klass + raise MappingError.new("unknown class: #{klass}") + end + if klass.include?(::SOAP::SOAPBasetype) + obj = base2obj(value, klass) + else + obj = Mapping._soap2obj(value, self, klass) + end + obj + end +end + + +Registry = EncodedRegistry +DefaultRegistry = EncodedRegistry.new +RubyOriginalRegistry = EncodedRegistry.new(:allow_original_mapping => true) + + +end +end diff --git a/lib/soap/mapping/factory.rb b/lib/soap/mapping/factory.rb new file mode 100644 index 0000000..c4967a8 --- /dev/null +++ b/lib/soap/mapping/factory.rb @@ -0,0 +1,388 @@ +# SOAP4R - Mapping factory. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module SOAP +module Mapping + + +class Factory + include TraverseSupport + + def initialize + # nothing to do + end + + def obj2soap(soap_class, obj, info, map) + raise NotImplementError.new + # return soap_obj + end + + def soap2obj(obj_class, node, info, map) + raise NotImplementError.new + # return convert_succeeded_or_not, obj + end + + def setiv2obj(obj, node, map) + return if node.nil? + if obj.is_a?(Array) + setiv2ary(obj, node, map) + else + setiv2struct(obj, node, map) + end + end + + def setiv2soap(node, obj, map) + if obj.class.class_variables.include?('@@schema_element') + setdefinediv2soap(node, obj, map) + else + # should we sort instance_variables? how? + obj.instance_variables.each do |var| + name = var.to_s.sub(/^@/, '').to_sym + elename = Mapping.name2elename(name) + node.add(elename, + Mapping._obj2soap(obj.instance_variable_get(var), map)) + end + end + end + +private + + def setdefinediv2soap(ele, obj, map) + definition = Mapping.schema_definition_classdef(obj.class) + definition.elements.each do |eledef| + child = Mapping.get_attribute(obj, eledef.varname) + # extract method + if child.nil? + value = SOAPNil.new + elsif child.is_a?(XSD::NSDBase) + value = child + else + klass = Mapping.class_from_name(eledef.type) + if klass && klass.include?(::SOAP::SOAPBasetype) + value = klass.new(child) + else + # should check klass matches an actual object? + value = Mapping._obj2soap(child, map) + end + end + ele.add(eledef.elename.name, value) + end + end + + def setiv2ary(obj, node, map) + node.each do |name, value| + Array.instance_method(:<<).bind(obj).call(Mapping._soap2obj(value, map)) + end + end + + def setiv2struct(obj, node, map) + vars = {} + node.each do |name, value| + vars[Mapping.elename2name(name)] = Mapping._soap2obj(value, map) + end + Mapping.set_attributes(obj, vars) + end + + def anonymous_class?(obj) + name = obj.class.name + name.nil? or name.empty? # 1.8 returns "" + end +end + +class StringFactory_ < Factory + def initialize(allow_original_mapping = false) + super() + @allow_original_mapping = allow_original_mapping + end + + def obj2soap(soap_class, obj, info, map) + if !@allow_original_mapping and !obj.instance_variables.empty? + return nil + end + begin + encoded = XSD::Charset.encoding_conv(obj, Mapping.external_ces, + XSD::Charset.encoding) + soap_obj = soap_class.new(encoded) + rescue XSD::ValueSpaceError + return nil + end + mark_marshalled_obj(obj, soap_obj) + soap_obj + end + + def soap2obj(obj_class, node, info, map) + obj = Mapping.create_empty_object(obj_class) + decoded = XSD::Charset.encoding_conv(node.data, XSD::Charset.encoding, + Mapping.external_ces) + obj.replace(decoded) + mark_unmarshalled_obj(node, obj) + return true, obj + end +end + +class FixnumFactory_ < Factory + def obj2soap(soap_class, obj, info, map) + soap_obj = nil + begin + soap_obj = soap_class.new(obj) + rescue XSD::ValueSpaceError + return nil + end + soap_obj + end + + def soap2obj(obj_class, node, info, map) + obj = node.data + return true, obj + end +end + +class BasetypeFactory_ < Factory + def initialize(allow_original_mapping = false) + super() + @allow_original_mapping = allow_original_mapping + end + + def obj2soap(soap_class, obj, info, map) + if !@allow_original_mapping and !obj.instance_variables.empty? + return nil + end + soap_obj = nil + begin + soap_obj = soap_class.new(obj) + rescue XSD::ValueSpaceError + return nil + end + if @allow_original_mapping + # Basetype except String should not be multiref-ed in SOAP/1.1. + mark_marshalled_obj(obj, soap_obj) + end + soap_obj + end + + def soap2obj(obj_class, node, info, map) + obj = node.data + mark_unmarshalled_obj(node, obj) + return true, obj + end +end + +class DateTimeFactory_ < Factory + def initialize(allow_original_mapping = false) + super() + @allow_original_mapping = allow_original_mapping + end + + def obj2soap(soap_class, obj, info, map) + if !@allow_original_mapping and + Time === obj and !obj.instance_variables.empty? + return nil + end + soap_obj = nil + begin + soap_obj = soap_class.new(obj) + rescue XSD::ValueSpaceError + return nil + end + mark_marshalled_obj(obj, soap_obj) + soap_obj + end + + def soap2obj(obj_class, node, info, map) + if node.respond_to?(:to_obj) + obj = node.to_obj(obj_class) + return false if obj.nil? + mark_unmarshalled_obj(node, obj) + return true, obj + else + return false + end + end +end + +class Base64Factory_ < Factory + def obj2soap(soap_class, obj, info, map) + return nil unless obj.instance_variables.empty? + soap_obj = soap_class.new(obj) + mark_marshalled_obj(obj, soap_obj) if soap_obj + soap_obj + end + + def soap2obj(obj_class, node, info, map) + obj = node.string + mark_unmarshalled_obj(node, obj) + return true, obj + end +end + +class URIFactory_ < Factory + def obj2soap(soap_class, obj, info, map) + soap_obj = soap_class.new(obj) + mark_marshalled_obj(obj, soap_obj) if soap_obj + soap_obj + end + + def soap2obj(obj_class, node, info, map) + obj = node.data + mark_unmarshalled_obj(node, obj) + return true, obj + end +end + +class ArrayFactory_ < Factory + def initialize(allow_original_mapping = false) + super() + @allow_original_mapping = allow_original_mapping + end + + # [[1], [2]] is converted to Array of Array, not 2-D Array. + # To create M-D Array, you must call Mapping.ary2md. + def obj2soap(soap_class, obj, info, map) + if !@allow_original_mapping and !obj.instance_variables.empty? + return nil + end + arytype = Mapping.obj2element(obj) + if arytype.name + arytype.namespace ||= RubyTypeNamespace + else + arytype = XSD::AnyTypeName + end + soap_obj = SOAPArray.new(ValueArrayName, 1, arytype) + mark_marshalled_obj(obj, soap_obj) + obj.each do |item| + soap_obj.add(Mapping._obj2soap(item, map)) + end + soap_obj + end + + def soap2obj(obj_class, node, info, map) + obj = Mapping.create_empty_object(obj_class) + mark_unmarshalled_obj(node, obj) + node.soap2array(obj) do |elem| + elem ? Mapping._soap2obj(elem, map) : nil + end + return true, obj + end +end + +class TypedArrayFactory_ < Factory + def initialize(allow_original_mapping = false) + super() + @allow_original_mapping = allow_original_mapping + end + + def obj2soap(soap_class, obj, info, map) + if !@allow_original_mapping and !obj.instance_variables.empty? + return nil + end + arytype = info[:type] || info[0] + soap_obj = SOAPArray.new(ValueArrayName, 1, arytype) + mark_marshalled_obj(obj, soap_obj) + obj.each do |var| + soap_obj.add(Mapping._obj2soap(var, map)) + end + soap_obj + end + + def soap2obj(obj_class, node, info, map) + if node.rank > 1 + return false + end + arytype = info[:type] || info[0] + unless node.arytype == arytype + return false + end + obj = Mapping.create_empty_object(obj_class) + mark_unmarshalled_obj(node, obj) + node.soap2array(obj) do |elem| + elem ? Mapping._soap2obj(elem, map) : nil + end + return true, obj + end +end + +class TypedStructFactory_ < Factory + def obj2soap(soap_class, obj, info, map) + type = info[:type] || info[0] + soap_obj = soap_class.new(type) + mark_marshalled_obj(obj, soap_obj) + if obj.class <= SOAP::Marshallable + setiv2soap(soap_obj, obj, map) + else + # allow to serialize an instance of unmarked class + setiv2soap(soap_obj, obj, map) + end + soap_obj + end + + def soap2obj(obj_class, node, info, map) + type = info[:type] || info[0] + unless node.type == type + return false + end + obj = Mapping.create_empty_object(obj_class) + mark_unmarshalled_obj(node, obj) + setiv2obj(obj, node, map) + return true, obj + end +end + +MapQName = XSD::QName.new(ApacheSOAPTypeNamespace, 'Map') +class HashFactory_ < Factory + def initialize(allow_original_mapping = false) + super() + @allow_original_mapping = allow_original_mapping + end + + def obj2soap(soap_class, obj, info, map) + if !@allow_original_mapping and !obj.instance_variables.empty? + return nil + end + if !obj.default.nil? or + (obj.respond_to?(:default_proc) and obj.default_proc) + return nil + end + soap_obj = SOAPStruct.new(MapQName) + mark_marshalled_obj(obj, soap_obj) + obj.each do |key, value| + elem = SOAPStruct.new + elem.add("key", Mapping._obj2soap(key, map)) + elem.add("value", Mapping._obj2soap(value, map)) + # ApacheAxis allows only 'item' here. + soap_obj.add("item", elem) + end + soap_obj + end + + def soap2obj(obj_class, node, info, map) + unless node.type == MapQName + return false + end + if node.class == SOAPStruct and node.key?('default') + return false + end + obj = Mapping.create_empty_object(obj_class) + mark_unmarshalled_obj(node, obj) + if node.class == SOAPStruct + node.each do |key, value| + obj[Mapping._soap2obj(value['key'], map)] = + Mapping._soap2obj(value['value'], map) + end + else + node.each do |value| + obj[Mapping._soap2obj(value['key'], map)] = + Mapping._soap2obj(value['value'], map) + end + end + return true, obj + end +end + + +end +end diff --git a/lib/soap/mapping/literalregistry.rb b/lib/soap/mapping/literalregistry.rb new file mode 100644 index 0000000..06d16c6 --- /dev/null +++ b/lib/soap/mapping/literalregistry.rb @@ -0,0 +1,391 @@ +# SOAP4R - literal mapping registry. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/baseData' +require 'soap/mapping/mapping' +require 'soap/mapping/typeMap' +require 'xsd/codegen/gensupport' +require 'xsd/namedelements' + + +module SOAP +module Mapping + + +class LiteralRegistry + include RegistrySupport + + attr_accessor :excn_handler_obj2soap + attr_accessor :excn_handler_soap2obj + + def initialize + super() + @excn_handler_obj2soap = nil + @excn_handler_soap2obj = nil + end + + def obj2soap(obj, qname, obj_class = nil) + soap_obj = nil + if obj.is_a?(SOAPElement) + soap_obj = obj + else + soap_obj = any2soap(obj, qname, obj_class) + end + return soap_obj if soap_obj + if @excn_handler_obj2soap + soap_obj = @excn_handler_obj2soap.call(obj) { |yield_obj| + Mapping.obj2soap(yield_obj, nil, nil, MAPPING_OPT) + } + return soap_obj if soap_obj + end + raise MappingError.new("cannot map #{obj.class.name} as #{qname}") + end + + # node should be a SOAPElement + def soap2obj(node, obj_class = nil) + cause = nil + begin + return any2obj(node, obj_class) + rescue MappingError + cause = $! + end + if @excn_handler_soap2obj + begin + return @excn_handler_soap2obj.call(node) { |yield_node| + Mapping.soap2obj(yield_node, nil, nil, MAPPING_OPT) + } + rescue Exception + end + end + raise MappingError.new("cannot map #{node.elename.name}/#{node.type.name} to Ruby object", cause) + end + +private + + MAPPING_OPT = { :no_reference => true } + + def definedobj2soap(obj, definition) + obj2soap(obj, definition.elename, definition.mapped_class) + end + + def any2soap(obj, qname, obj_class) + ele = nil + if obj.is_a?(SOAP::Mapping::Object) + return mappingobj2soap(obj, qname) + end + class_definition = schema_definition_from_class(obj.class) + if class_definition.nil? and obj_class + class_definition = schema_definition_from_class(obj_class) + end + elename_definition = schema_definition_from_elename(qname) + if !class_definition and !elename_definition + # no definition found + return anyobj2soap(obj, qname) + end + if !class_definition or !elename_definition + # use found one + return stubobj2soap(obj, qname, class_definition || elename_definition) + end + # found both: + if class_definition.class_for == elename_definition.class_for + # if two definitions are for the same class, give qname a priority. + return stubobj2soap(obj, qname, elename_definition) + end + # it should be a derived class + return stubobj2soap(obj, qname, class_definition) + end + + def anyobj2soap(obj, qname) + ele = nil + case obj + when Hash + ele = SOAPElement.from_obj(obj, nil) + ele.elename = qname + when Array + # treat as a list of simpletype + ele = SOAPElement.new(qname, obj.join(" ")) + when XSD::QName + ele = SOAPElement.new(qname) + ele.text = obj + else + # expected to be a basetype or an anyType. + # SOAPStruct, etc. is used instead of SOAPElement. + begin + ele = Mapping.obj2soap(obj, nil, nil, MAPPING_OPT) + ele.elename = qname + rescue MappingError + ele = SOAPElement.new(qname, obj.to_s) + end + end + add_attributes2soap(obj, ele) + ele + end + + def stubobj2soap(obj, qname, definition) + if obj.nil? + ele = SOAPNil.new + ele.elename = qname + elsif obj.is_a?(::String) + ele = SOAPElement.new(qname, obj) + else + ele = SOAPElement.new(qname) + end + ele.qualified = definition.qualified + if definition.type + ele.type = definition.type + if definition.basetype or Mapping.root_type_hint + Mapping.reset_root_type_hint + ele.force_typed = true + end + end + if qname.nil? and definition.elename + ele.elename = definition.elename + end + return ele if obj.nil? + stubobj2soap_elements(obj, ele, definition.elements) + add_definedattributes2soap(obj, ele, definition) + ele + end + + def stubobj2soap_elements(obj, ele, definition, is_choice = false) + added = false + case definition + when SchemaSequenceDefinition, SchemaEmptyDefinition + definition.each do |eledef| + ele_added = stubobj2soap_elements(obj, ele, eledef, is_choice) + added = true if ele_added + end + when SchemaChoiceDefinition + definition.each do |eledef| + added = stubobj2soap_elements(obj, ele, eledef, true) + break if added + end + else + added = true + if definition.as_any? + any = Mapping.get_attributes_for_any(obj) + SOAPElement.from_objs(any).each do |child| + ele.add(child) + end + elsif obj.respond_to?(:each) and definition.as_array? + obj.each do |item| + ele.add(definedobj2soap(item, definition)) + end + else + child = Mapping.get_attribute(obj, definition.varname) + if child.nil? and (is_choice or definition.minoccurs == 0) + added = false + else + if child.respond_to?(:each) and definition.as_array? + if child.empty? + added = false + else + child.each do |item| + ele.add(definedobj2soap(item, definition)) + end + end + else + ele.add(definedobj2soap(child, definition)) + end + end + end + end + added + end + + def mappingobj2soap(obj, qname) + ele = SOAPElement.new(qname) + obj.__xmlele.each do |key, value| + if value.is_a?(::Array) + value.each do |item| + ele.add(obj2soap(item, key)) + end + else + ele.add(obj2soap(value, key)) + end + end + obj.__xmlattr.each do |key, value| + ele.extraattr[key] = value + end + ele + end + + def any2obj(node, obj_class = nil) + is_compound = node.is_a?(::SOAP::SOAPCompoundtype) + # trust xsi:type first + if is_compound and node.type + definition = schema_definition_from_type(node.type) + end + # element name next + definition ||= schema_definition_from_elename(node.elename) + # class defined in parent type last + if obj_class + definition ||= schema_definition_from_class(obj_class) + end + if definition + obj_class = definition.class_for + end + if is_compound + if definition + return elesoap2stubobj(node, obj_class, definition) + elsif node.is_a?(::SOAP::SOAPNameAccessible) + return elesoap2plainobj(node) + end + end + obj = Mapping.soap2obj(node, nil, obj_class, MAPPING_OPT) + add_attributes2obj(node, obj) + obj + end + + def elesoap2stubobj(node, obj_class, definition) + obj = nil + if obj_class == ::String + obj = node.text + elsif obj_class < ::String and node.respond_to?(:text) + obj = obj_class.new(node.text) + else + obj = Mapping.create_empty_object(obj_class) + add_elesoap2stubobj(node, obj, definition) + end + add_attributes2stubobj(node, obj, definition) + obj + end + + def elesoap2plainobj(node) + obj = nil + if !node.have_member + obj = base2obj(node, ::SOAP::SOAPString) + else + obj = anytype2obj(node) + add_elesoap2plainobj(node, obj) + end + add_attributes2obj(node, obj) + obj + end + + def anytype2obj(node) + if node.is_a?(::SOAP::SOAPBasetype) + return node.data + end + ::SOAP::Mapping::Object.new + end + + def add_elesoap2stubobj(node, obj, definition) + vars = {} + node.each do |name, value| + item = definition.elements.find_element(value.elename) + if item + child = elesoapchild2obj(value, item) + else + # unknown element is treated as anyType. + child = any2obj(value) + end + if item and item.as_array? + (vars[name] ||= []) << child + elsif vars.key?(name) + vars[name] = [vars[name], child].flatten + else + vars[name] = child + end + end + if obj.is_a?(::Array) and is_stubobj_elements_for_array(vars) + Array.instance_method(:replace).bind(obj).call(vars.values[0]) + else + Mapping.set_attributes(obj, vars) + end + end + + def elesoapchild2obj(value, eledef) + if eledef.mapped_class + if eledef.mapped_class.include?(::SOAP::SOAPBasetype) + base2obj(value, eledef.mapped_class) + else + any2obj(value, eledef.mapped_class) + end + else + child_definition = schema_definition_from_elename(eledef.elename) + if child_definition + any2obj(value, child_definition.class_for) + else + # untyped element is treated as anyType. + any2obj(value) + end + end + end + + def add_attributes2stubobj(node, obj, definition) + return if obj.nil? or node.extraattr.empty? + if attributes = definition.attributes + define_xmlattr(obj) + attributes.each do |qname, class_name| + child = node.extraattr[qname] + next if child.nil? + if class_name + klass = Mapping.class_from_name(class_name) + if klass.include?(::SOAP::SOAPBasetype) + child = klass.to_data(child) + end + end + obj.__xmlattr[qname] = child + define_xmlattr_accessor(obj, qname) + end + end + end + + def add_elesoap2plainobj(node, obj) + node.each do |name, value| + obj.__add_xmlele_value(value.elename, any2obj(value)) + end + end + + def add_attributes2obj(node, obj) + return if obj.nil? or node.extraattr.empty? + define_xmlattr(obj) + node.extraattr.each do |qname, value| + obj.__xmlattr[qname] = value + define_xmlattr_accessor(obj, qname) + end + end + + # Mapping.define_attr_accessor calls define_method with proc and it exhausts + # much memory for each singleton Object. just instance_eval instead of it. + def define_xmlattr_accessor(obj, qname) + # untaint depends GenSupport.safemethodname + name = Mapping.safemethodname('xmlattr_' + qname.name).untaint + unless obj.respond_to?(name) + # untaint depends QName#dump + qnamedump = qname.dump.untaint + obj.instance_eval <<-EOS + def #{name} + @__xmlattr[#{qnamedump}] + end + + def #{name}=(value) + @__xmlattr[#{qnamedump}] = value + end + EOS + end + end + + # Mapping.define_attr_accessor calls define_method with proc and it exhausts + # much memory for each singleton Object. just instance_eval instead of it. + def define_xmlattr(obj) + obj.instance_variable_set('@__xmlattr', {}) + unless obj.respond_to?(:__xmlattr) + obj.instance_eval <<-EOS + def __xmlattr + @__xmlattr + end + EOS + end + end +end + + +end +end diff --git a/lib/soap/mapping/mapping.rb b/lib/soap/mapping/mapping.rb new file mode 100644 index 0000000..bd20534 --- /dev/null +++ b/lib/soap/mapping/mapping.rb @@ -0,0 +1,577 @@ +# SOAP4R - Ruby type mapping utility. +# Copyright (C) 2000-2007 NAKAMURA Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/codegen/gensupport' +require 'soap/mapping/schemadefinition' + + +module SOAP + + +module Mapping + RubyTypeNamespace = 'http://www.ruby-lang.org/xmlns/ruby/type/1.6' + RubyTypeInstanceNamespace = + 'http://www.ruby-lang.org/xmlns/ruby/type-instance' + RubyCustomTypeNamespace = 'http://www.ruby-lang.org/xmlns/ruby/type/custom' + ApacheSOAPTypeNamespace = 'http://xml.apache.org/xml-soap' + + + module TraverseSupport + def mark_marshalled_obj(obj, soap_obj) + raise if obj.nil? + Thread.current[:SOAPMapping][:MarshalKey][obj.__id__] = soap_obj + end + + def mark_unmarshalled_obj(node, obj) + return if obj.nil? + # node.id is not Object#id but SOAPReference#id + Thread.current[:SOAPMapping][:MarshalKey][node.id] = obj + end + end + + + EMPTY_OPT = {}.freeze + def self.obj2soap(obj, registry = nil, type = nil, opt = EMPTY_OPT) + registry ||= Mapping::DefaultRegistry + soap_obj = nil + protect_mapping(opt) do + soap_obj = _obj2soap(obj, registry, type) + end + soap_obj + end + + def self.objs2soap(objs, registry = nil, types = nil, opt = EMPTY_OPT) + registry ||= Mapping::DefaultRegistry + ary = [] + protect_mapping(opt) do + 0.upto(objs.length - 1) do |idx| + type = types ? types[idx] : nil + soap = _obj2soap(objs[idx], registry, type) + ary << soap + end + end + ary + end + + def self.soap2obj(node, registry = nil, klass = nil, opt = EMPTY_OPT) + registry ||= Mapping::DefaultRegistry + obj = nil + protect_mapping(opt) do + obj = _soap2obj(node, registry, klass) + end + obj + end + + def self.ary2soap(ary, type_ns = XSD::Namespace, typename = XSD::AnyTypeLiteral, registry = nil, opt = EMPTY_OPT) + registry ||= Mapping::DefaultRegistry + type = XSD::QName.new(type_ns, typename) + soap_ary = SOAPArray.new(ValueArrayName, 1, type) + protect_mapping(opt) do + ary.each do |ele| + soap_ary.add(_obj2soap(ele, registry, type)) + end + end + soap_ary + end + + def self.ary2md(ary, rank, type_ns = XSD::Namespace, typename = XSD::AnyTypeLiteral, registry = nil, opt = EMPTY_OPT) + registry ||= Mapping::DefaultRegistry + type = XSD::QName.new(type_ns, typename) + md_ary = SOAPArray.new(ValueArrayName, rank, type) + protect_mapping(opt) do + add_md_ary(md_ary, ary, [], registry) + end + md_ary + end + + def self.fault2exception(fault, registry = nil) + registry ||= Mapping::DefaultRegistry + detail = "" + if fault.detail + begin + fault.detail.type ||= XSD::QName::EMPTY + detail = soap2obj(fault.detail, registry) || "" + rescue MappingError + detail = fault.detail + end + end + if detail.is_a?(Mapping::SOAPException) + begin + e = detail.to_e + remote_backtrace = e.backtrace + e.set_backtrace(nil) + raise e # ruby sets current caller as local backtrace of e => e2. + rescue Exception => e + e.set_backtrace(remote_backtrace + e.backtrace[1..-1]) + raise + end + else + fault.detail = detail + fault.set_backtrace( + if detail.is_a?(Array) + detail + else + [detail.to_s] + end + ) + raise + end + end + + def self._obj2soap(obj, registry, type = nil) + if obj.respond_to?(:to_xmlpart) + SOAPRawData.new(obj) + elsif defined?(::REXML) and obj.is_a?(::REXML::Element) + SOAPRawData.new(SOAPREXMLElementWrap.new(obj)) + elsif referent = Thread.current[:SOAPMapping][:MarshalKey][obj.__id__] and + !Thread.current[:SOAPMapping][:NoReference] + SOAPReference.new(referent) + elsif registry + registry.obj2soap(obj, type) + else + raise MappingError.new("no mapping registry given") + end + end + + def self._soap2obj(node, registry, klass = nil) + if node.nil? + return nil + elsif node.is_a?(SOAPReference) + target = node.__getobj__ + # target.id is not Object#id but SOAPReference#id + if referent = Thread.current[:SOAPMapping][:MarshalKey][target.id] and + !Thread.current[:SOAPMapping][:NoReference] + return referent + else + return _soap2obj(target, registry, klass) + end + end + return registry.soap2obj(node, klass) + end + + def self.create_empty_object(klass) + klass.allocate + end + + # Allow only (Letter | '_') (Letter | Digit | '-' | '_')* here. + # Caution: '.' is not allowed here. + # To follow XML spec., it should be NCName. + # (denied chars) => .[0-F][0-F] + # ex. a.b => a.2eb + # + def self.name2elename(name) + name = name.to_s + name.gsub(/([^a-zA-Z0-9:_\-]+)/n) { + '.' << $1.unpack('H2' * $1.size).join('.') + }.gsub(/::/n, '..').to_sym + end + + def self.elename2name(name) + name.gsub(/\.\./n, '::').gsub(/((?:\.[0-9a-fA-F]{2})+)/n) { + [$1.delete('.')].pack('H*') + } + end + + def self.const_from_name(name, lenient = false) + const = ::Object + name.sub(/\A::/, '').split('::').each do |const_str| + if /\A[A-Z]/ =~ const_str + begin + if const.const_defined?(const_str) + const = const.const_get(const_str) + next + end + rescue NameError + end + end + if lenient + const_str = Mapping.safeconstname(const_str) + if const.const_defined?(const_str) + const = const.const_get(const_str) + next + end + end + return nil + end + const + end + + def self.class_from_name(name, lenient = false) + unless lenient + const = const_from_name_nonlenient(name) + else + const = const_from_name(name, true) + end + if const.is_a?(::Class) + const + else + nil + end + end + + def self.module_from_name(name, lenient = false) + unless lenient + const = const_from_name_nonlenient(name) + else + const = const_from_name(name, true) + end + if const.is_a?(::Module) + const + else + nil + end + end + + def self.const_from_name_nonlenient(name) + if Thread.current[:SOAPMapping] + Thread.current[:SOAPMapping][:ConstFromName][name] ||= + const_from_name(name) + else + const_from_name(name) + end + end + + def self.class2qname(klass) + name = schema_type_definition(klass) + namespace = schema_ns_definition(klass) + XSD::QName.new(namespace, name) + end + + def self.class2element(klass) + name = schema_type_definition(klass) || + Mapping.name2elename(klass.name) + namespace = schema_ns_definition(klass) || RubyCustomTypeNamespace + XSD::QName.new(namespace, name) + end + + def self.obj2element(obj) + name = namespace = nil + ivars = obj.instance_variables + if ivars.include?('@schema_type') + name = obj.instance_variable_get('@schema_type') + end + if ivars.include?('@schema_ns') + namespace = obj.instance_variable_get('@schema_ns') + end + if !name or !namespace + class2qname(obj.class) + else + XSD::QName.new(namespace, name) + end + end + + def self.to_qname(obj, ns = nil) + if obj.is_a?(XSD::QName) + obj + else + XSD::QName.new(ns, obj) + end + end + + def self.define_singleton_method(obj, name, &block) + sclass = (class << obj; self; end) + sclass.class_eval { + define_method(name, &block) + } + end + + def self.get_attributes(obj) + if obj.is_a?(::Hash) + obj + else + rs = {} + obj.instance_variables.each do |ele| + rs[ele.sub(/^@/, '')] = obj.instance_variable_get(ele) + end + rs + end + end + + EMPTY_ATTRIBUTES = {}.freeze + def self.get_attributes_for_any(obj) + if obj.respond_to?(:__xmlele_any) + obj.__xmlele_any || EMPTY_ATTRIBUTES + else + get_attributes(obj) + end + end + + def self.get_attribute(obj, attr_name) + case obj + when ::SOAP::Mapping::Object + return obj[attr_name] + when ::Hash + return obj[attr_name] || obj[attr_name.intern] + else + if obj.respond_to?(attr_name) + return obj.__send__(attr_name) + end + iv = obj.instance_variables + name = Mapping.safevarname(attr_name) + if iv.include?("@#{name}") + return obj.instance_variable_get("@#{name}") + elsif iv.include?("@#{attr_name}") + return obj.instance_variable_get("@#{attr_name}") + end + if obj.respond_to?(name) + return obj.__send__(name) + end + nil + end + end + + def self.set_attributes(obj, values) + case obj + when ::SOAP::Mapping::Object + values.each do |attr_name, value| + obj.__add_xmlele_value(attr_name, value) + end + else + values.each do |attr_name, value| + # untaint depends GenSupport.safevarname + name = Mapping.safevarname(attr_name).untaint + setter = name + "=" + if obj.respond_to?(setter) + obj.__send__(setter, value) + else + obj.instance_variable_set('@' + name, value) + begin + unless obj.respond_to?(name) + obj.instance_eval <<-EOS + def #{name} + @#{name} + end + EOS + end + unless self.respond_to?(name + "=") + obj.instance_eval <<-EOS + def #{name}=(value) + @#{name} = value + end + EOS + end + rescue TypeError + # singleton class may not exist (e.g. Float) + end + end + end + end + end + + def self.safeconstname(name) + Thread.current[:SOAPMapping][:SafeConstName][name] ||= + XSD::CodeGen::GenSupport.safeconstname(name) + end + + def self.safemethodname(name) + Thread.current[:SOAPMapping][:SafeMethodName][name] ||= + XSD::CodeGen::GenSupport.safemethodname(name) + end + + def self.safevarname(name) + Thread.current[:SOAPMapping][:SafeVarName][name] ||= + XSD::CodeGen::GenSupport.safevarname(name) + end + + def self.root_type_hint + Thread.current[:SOAPMapping][:RootTypeHint] + end + + def self.reset_root_type_hint + Thread.current[:SOAPMapping][:RootTypeHint] = false + end + + def self.external_ces + Thread.current[:SOAPMapping][:ExternalCES] + end + + def self.schema_ns_definition(klass) + class_schema_variable(:schema_ns, klass) + end + + def self.schema_name_definition(klass) + class_schema_variable(:schema_name, klass) + end + + def self.schema_type_definition(klass) + class_schema_variable(:schema_type, klass) + end + + def self.schema_qualified_definition(klass) + class_schema_variable(:schema_qualified, klass) + end + + def self.schema_element_definition(klass) + class_schema_variable(:schema_element, klass) + end + + def self.schema_attribute_definition(klass) + class_schema_variable(:schema_attribute, klass) + end + + def self.schema_definition_classdef(klass) + if Thread.current[:SOAPMapping][:SchemaDefinition].key?(klass) + return Thread.current[:SOAPMapping][:SchemaDefinition][klass] + end + schema_ns = schema_ns_definition(klass) + schema_name = schema_name_definition(klass) + schema_type = schema_type_definition(klass) + qualified = schema_qualified_definition(klass) + elements = schema_element_definition(klass) + attributes = schema_attribute_definition(klass) + return nil if schema_name.nil? and schema_type.nil? + schema_name = Mapping.to_qname(schema_name, schema_ns) if schema_name + schema_type = Mapping.to_qname(schema_type, schema_ns) if schema_type + definition = create_schema_definition(klass, + :schema_name => schema_name, + :schema_type => schema_type, + :is_anonymous => false, + :schema_qualified => qualified, + :schema_element => elements, + :schema_attribute => attributes + ) + Thread.current[:SOAPMapping][:SchemaDefinition][klass] = definition + definition + end + + def self.create_schema_definition(klass, definition) + schema_ns = definition[:schema_ns] + schema_name = definition[:schema_name] + schema_type = definition[:schema_type] + is_anonymous = definition[:is_anonymous] + schema_basetype = definition[:schema_basetype] + schema_qualified = definition[:schema_qualified] + schema_element = definition[:schema_element] + schema_attributes = definition[:schema_attribute] + definition = SchemaDefinition.new(klass, schema_name, schema_type, is_anonymous, schema_qualified) + definition.basetype = schema_basetype + definition.attributes = schema_attributes + if schema_element + if schema_element.respond_to?(:is_concrete_definition) and + schema_element.is_concrete_definition + definition.elements = schema_element + else + default_ns = schema_name.namespace if schema_name + default_ns ||= schema_type.namespace if schema_type + definition.elements = parse_schema_definition(schema_element, default_ns) + if klass < ::Array + definition.elements.set_array + end + end + end + definition + end + + # returns SchemaComplexTypeDefinition + def self.parse_schema_definition(schema_element, default_ns) + definition = nil + if schema_element[0] == :choice + schema_element.shift + definition = SchemaChoiceDefinition.new + else + definition = SchemaSequenceDefinition.new + end + schema_element.each do |ele| + element_definition = parse_schema_element_definition(ele, default_ns) + definition << element_definition + end + definition + end + + # returns SchemaElementDefinition + def self.parse_schema_element_definition(schema_element, default_ns) + if schema_element[0] == :choice + parse_schema_definition(schema_element, default_ns) + elsif schema_element[0].is_a?(Array) + parse_schema_definition(schema_element, default_ns) + else + varname, info, occurrence = schema_element + mapped_class_str, elename = info + if occurrence + minoccurs, maxoccurs = occurrence + else + minoccurs, maxoccurs = 1, 1 + end + as_any = as_array = false + if /\[\]$/ =~ mapped_class_str + mapped_class_str = mapped_class_str.sub(/\[\]$/, '') + if mapped_class_str.empty? + mapped_class_str = nil + end + as_array = true + end + if mapped_class_str + mapped_class = Mapping.class_from_name(mapped_class_str) + if mapped_class.nil? + warn("cannot find mapped class: #{mapped_class_str}") + end + end + if elename == XSD::AnyTypeName + as_any = true + elsif elename.nil? + elename = XSD::QName.new(default_ns, varname) + end + SchemaElementDefinition.new( + varname, mapped_class, elename, minoccurs, maxoccurs, as_any, as_array) + end + end + + class << Mapping + public + + def protect_threadvars(*symbols) + backup = {} + begin + symbols.each do |sym| + backup[sym] = Thread.current[sym] + end + yield + ensure + symbols.each do |sym| + Thread.current[sym] = backup[sym] + end + end + end + + private + + def class_schema_variable(sym, klass) + var = "@@#{sym}" + klass.class_variables.include?(var) ? klass.class_eval(var) : nil + end + + def protect_mapping(opt) + protect_threadvars(:SOAPMapping) do + data = Thread.current[:SOAPMapping] = {} + data[:MarshalKey] = {} + data[:ExternalCES] = opt[:external_ces] || XSD::Charset.encoding + data[:NoReference] = opt[:no_reference] + data[:RootTypeHint] = opt[:root_type_hint] + data[:SchemaDefinition] = {} + data[:SafeConstName] = {} + data[:SafeMethodName] = {} + data[:SafeVarName] = {} + data[:ConstFromName] = {} + yield + end + end + + def add_md_ary(md_ary, ary, indices, registry) + for idx in 0..(ary.size - 1) + if ary[idx].is_a?(Array) + add_md_ary(md_ary, ary[idx], indices + [idx], registry) + else + md_ary[*(indices + [idx])] = _obj2soap(ary[idx], registry) + end + end + end + end +end + + +end diff --git a/lib/soap/mapping/registry.rb b/lib/soap/mapping/registry.rb new file mode 100644 index 0000000..09ad8a7 --- /dev/null +++ b/lib/soap/mapping/registry.rb @@ -0,0 +1,295 @@ +# SOAP4R - Mapping registry. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/baseData' +require 'soap/mapping/mapping' + + +module SOAP + + +module Marshallable + # @@type_ns = Mapping::RubyCustomTypeNamespace +end + + +module Mapping + + +module MappedException; end + + +RubyTypeName = XSD::QName.new(RubyTypeInstanceNamespace, 'rubyType') +RubyExtendName = XSD::QName.new(RubyTypeInstanceNamespace, 'extends') +RubyIVarName = XSD::QName.new(RubyTypeInstanceNamespace, 'ivars') + + +# For anyType object: SOAP::Mapping::Object not ::Object +class Object + def initialize + @__xmlele_type = {} + @__xmlele = [] + @__xmlattr = {} + end + + def inspect + sprintf("#<%s:0x%x%s>", self.class.name, __id__, + @__xmlele.collect { |name, value| " #{name}=#{value.inspect}" }.join) + end + + def __xmlattr + @__xmlattr + end + + def __xmlele + @__xmlele + end + + def [](qname) + qname = Mapping.to_qname(qname) + @__xmlele.each do |k, v| + return v if k == qname + end + # fallback + @__xmlele.each do |k, v| + return v if k.name == qname.name + end + nil + end + + def []=(qname, value) + qname = Mapping.to_qname(qname) + found = false + @__xmlele.each do |pair| + if pair[0] == qname + found = true + pair[1] = value + end + end + unless found + __define_attr_accessor(qname) + @__xmlele << [qname, value] + end + @__xmlele_type[qname] = :single + end + + def __add_xmlele_value(qname, value) + found = false + @__xmlele.map! do |k, v| + if k == qname + found = true + [k, __set_xmlele_value(k, v, value)] + else + [k, v] + end + end + unless found + __define_attr_accessor(qname) + @__xmlele << [qname, value] + @__xmlele_type[qname] = :single + end + value + end + + def marshal_load(dumpobj) + __import(dumpobj) + end + +private + + # Mapping.define_attr_accessor calls define_method with proc and it exhausts + # much memory for each singleton Object. just instance_eval instead of it. + def __define_attr_accessor(qname) + # untaint depends GenSupport.safemethodname + name = Mapping.safemethodname(qname.name).untaint + # untaint depends on QName#dump + qnamedump = qname.dump.untaint + singleton = false + unless self.respond_to?(name) + singleton = true + instance_eval <<-EOS + def #{name} + self[#{qnamedump}] + end + EOS + end + unless self.respond_to?(name + "=") + singleton = true + instance_eval <<-EOS + def #{name}=(value) + self[#{qnamedump}] = value + end + EOS + end + if singleton && !self.respond_to?(:marshal_dump) + instance_eval <<-EOS + def marshal_dump + __export + end + EOS + end + end + + def __set_xmlele_value(key, org, value) + case @__xmlele_type[key] + when :multi + org << value + org + when :single + @__xmlele_type[key] = :multi + [org, value] + else + raise RuntimeError.new("unknown type") + end + end + + def __export + dumpobj = ::SOAP::Mapping::Object.new + dumpobj.__xmlele.replace(@__xmlele) + dumpobj.__xmlattr.replace(@__xmlattr) + dumpobj + end + + def __import(dumpobj) + @__xmlele_type = {} + @__xmlele = [] + @__xmlattr = {} + dumpobj.__xmlele.each do |qname, value| + __add_xmlele_value(qname, value) + end + @__xmlattr.replace(dumpobj.__xmlattr) + end +end + + +class MappingError < Error; end + + +module RegistrySupport + def initialize + super() + @class_schema_definition = {} + @class_elename_schema_definition = {} + @elename_schema_definition = {} + @type_schema_definition = {} + end + + def register(definition) + obj_class = definition[:class] + definition = Mapping.create_schema_definition(obj_class, definition) + # give complexType definition a priority explicitly + if !@class_schema_definition[obj_class] or definition.type + @class_schema_definition[obj_class] = definition + end + if definition.elename and !definition.is_anonymous? + @class_elename_schema_definition[obj_class] = definition + @elename_schema_definition[definition.elename] = definition + end + if definition.type + @type_schema_definition[definition.type] = definition + end + end + + def schema_definition_from_class(klass) + @class_schema_definition[klass] || Mapping.schema_definition_classdef(klass) + end + + def elename_schema_definition_from_class(klass) + @class_elename_schema_definition[klass] + end + + def schema_definition_from_elename(qname) + @elename_schema_definition[qname] + end + + def schema_definition_from_type(type) + @type_schema_definition[type] + end + + def find_node_definition(node) + schema_definition_from_type(node.type) || + schema_definition_from_elename(node.elename) || + find_schema_definition(node.elename.name) || + find_schema_definition(node.type.name) + end + + def find_schema_definition(name) + return nil unless name + typestr = Mapping.safeconstname(name) + obj_class = Mapping.class_from_name(typestr) + if obj_class + schema_definition_from_class(obj_class) + end + end + + def add_attributes2soap(obj, ele) + if definition = Mapping.schema_definition_classdef(obj.class) + add_definedattributes2soap(obj, ele, definition) + elsif obj.respond_to?(:__xmlattr) + obj.__xmlattr.each do |key, value| + ele.extraattr[key] = value + end + end + end + + def add_definedattributes2soap(obj, ele, typedef) + if typedef.attributes + typedef.attributes.each do |qname, param| + value = get_xmlattr_value(obj, qname) + ele.extraattr[qname] = value unless value.nil? + end + end + end + + def get_xmlattr_value(obj, qname) + attrname = 'xmlattr_' + qname.name + value = Mapping.get_attribute(obj, attrname) + if value.nil? + attrname = Mapping.safemethodname('xmlattr_' + qname.name) + value = Mapping.get_attribute(obj, attrname) + end + value + end + + def base2soap(obj, type, qualified = nil) + return SOAPNil.new if obj.nil? + soap_obj = nil + if type <= XSD::XSDString + str = XSD::Charset.encoding_conv(obj.to_s, Mapping.external_ces, + XSD::Charset.encoding) + soap_obj = type.new(str) + else + soap_obj = type.new(obj) + end + soap_obj.qualified = qualified + soap_obj + end + + def base2obj(value, klass) + v = if value.respond_to?(:data) + value.data + elsif value.respond_to?(:text) + value.text + else + nil + end + if value.is_a?(klass) + v + else + klass.to_data(v) + end + end + + def is_stubobj_elements_for_array(vars) + vars.keys.size == 1 and vars.values[0].is_a?(::Array) + end +end + + +end +end diff --git a/lib/soap/mapping/rubytypeFactory.rb b/lib/soap/mapping/rubytypeFactory.rb new file mode 100644 index 0000000..e01359c --- /dev/null +++ b/lib/soap/mapping/rubytypeFactory.rb @@ -0,0 +1,446 @@ +# SOAP4R - Ruby type mapping factory. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + +require 'continuation' + +module SOAP +module Mapping + + +class RubytypeFactory < Factory + TYPE_STRING = XSD::QName.new(RubyTypeNamespace, 'String') + TYPE_TIME = XSD::QName.new(RubyTypeNamespace, 'Time') + TYPE_ARRAY = XSD::QName.new(RubyTypeNamespace, 'Array') + TYPE_REGEXP = XSD::QName.new(RubyTypeNamespace, 'Regexp') + TYPE_RANGE = XSD::QName.new(RubyTypeNamespace, 'Range') + TYPE_CLASS = XSD::QName.new(RubyTypeNamespace, 'Class') + TYPE_MODULE = XSD::QName.new(RubyTypeNamespace, 'Module') + TYPE_SYMBOL = XSD::QName.new(RubyTypeNamespace, 'Symbol') + TYPE_STRUCT = XSD::QName.new(RubyTypeNamespace, 'Struct') + TYPE_HASH = XSD::QName.new(RubyTypeNamespace, 'Map') + + def initialize(config = {}) + @config = config + @allow_untyped_struct = @config.key?(:allow_untyped_struct) ? + @config[:allow_untyped_struct] : true + @allow_original_mapping = @config.key?(:allow_original_mapping) ? + @config[:allow_original_mapping] : false + @string_factory = StringFactory_.new(true) + @basetype_factory = BasetypeFactory_.new(true) + @datetime_factory = DateTimeFactory_.new(true) + @array_factory = ArrayFactory_.new(true) + @hash_factory = HashFactory_.new(true) + end + + def obj2soap(soap_class, obj, info, map) + param = nil + case obj + when ::String + unless @allow_original_mapping + return nil + end + param = @string_factory.obj2soap(SOAPString, obj, info, map) + if obj.class != String + param.extraattr[RubyTypeName] = obj.class.name + end + addiv2soapattr(param, obj, map) + when ::Time + unless @allow_original_mapping + return nil + end + param = @datetime_factory.obj2soap(SOAPDateTime, obj, info, map) + if obj.class != Time + param.extraattr[RubyTypeName] = obj.class.name + end + addiv2soapattr(param, obj, map) + when ::Array + unless @allow_original_mapping + return nil + end + param = @array_factory.obj2soap(nil, obj, info, map) + if obj.class != Array + param.extraattr[RubyTypeName] = obj.class.name + end + addiv2soapattr(param, obj, map) + when ::NilClass + unless @allow_original_mapping + return nil + end + param = @basetype_factory.obj2soap(SOAPNil, obj, info, map) + addiv2soapattr(param, obj, map) + when ::FalseClass, ::TrueClass + unless @allow_original_mapping + return nil + end + param = @basetype_factory.obj2soap(SOAPBoolean, obj, info, map) + addiv2soapattr(param, obj, map) + when ::Integer + unless @allow_original_mapping + return nil + end + param = @basetype_factory.obj2soap(SOAPInt, obj, info, map) + param ||= @basetype_factory.obj2soap(SOAPInteger, obj, info, map) + param ||= @basetype_factory.obj2soap(SOAPDecimal, obj, info, map) + addiv2soapattr(param, obj, map) + when ::Float + unless @allow_original_mapping + return nil + end + param = @basetype_factory.obj2soap(SOAPDouble, obj, info, map) + if obj.class != Float + param.extraattr[RubyTypeName] = obj.class.name + end + addiv2soapattr(param, obj, map) + when ::Hash + unless @allow_original_mapping + return nil + end + if obj.respond_to?(:default_proc) && obj.default_proc + raise TypeError.new("cannot dump hash with default proc") + end + param = SOAPStruct.new(TYPE_HASH) + mark_marshalled_obj(obj, param) + if obj.class != Hash + param.extraattr[RubyTypeName] = obj.class.name + end + obj.each do |key, value| + elem = SOAPStruct.new # Undefined type. + elem.add("key", Mapping._obj2soap(key, map)) + elem.add("value", Mapping._obj2soap(value, map)) + param.add("item", elem) + end + param.add('default', Mapping._obj2soap(obj.default, map)) + addiv2soapattr(param, obj, map) + when ::Regexp + unless @allow_original_mapping + return nil + end + param = SOAPStruct.new(TYPE_REGEXP) + mark_marshalled_obj(obj, param) + if obj.class != Regexp + param.extraattr[RubyTypeName] = obj.class.name + end + param.add('source', SOAPBase64.new(obj.source)) + options = obj.options + param.add('options', SOAPInt.new(options)) + addiv2soapattr(param, obj, map) + when ::Range + unless @allow_original_mapping + return nil + end + param = SOAPStruct.new(TYPE_RANGE) + mark_marshalled_obj(obj, param) + if obj.class != Range + param.extraattr[RubyTypeName] = obj.class.name + end + param.add('begin', Mapping._obj2soap(obj.begin, map)) + param.add('end', Mapping._obj2soap(obj.end, map)) + param.add('exclude_end', SOAP::SOAPBoolean.new(obj.exclude_end?)) + addiv2soapattr(param, obj, map) + when ::Class + unless @allow_original_mapping + return nil + end + if obj.to_s[0] == ?# + raise TypeError.new("can't dump anonymous class #{obj}") + end + param = SOAPStruct.new(TYPE_CLASS) + mark_marshalled_obj(obj, param) + param.add('name', SOAPString.new(obj.name)) + addiv2soapattr(param, obj, map) + when ::Module + unless @allow_original_mapping + return nil + end + if obj.to_s[0] == ?# + raise TypeError.new("can't dump anonymous module #{obj}") + end + param = SOAPStruct.new(TYPE_MODULE) + mark_marshalled_obj(obj, param) + param.add('name', SOAPString.new(obj.name)) + addiv2soapattr(param, obj, map) + when ::Symbol + unless @allow_original_mapping + return nil + end + param = SOAPStruct.new(TYPE_SYMBOL) + mark_marshalled_obj(obj, param) + param.add('id', SOAPString.new(obj.id2name)) + addiv2soapattr(param, obj, map) + when ::Struct + unless @allow_original_mapping + # treat it as an user defined class. [ruby-talk:104980] + #param = unknownobj2soap(soap_class, obj, info, map) + param = SOAPStruct.new(XSD::AnyTypeName) + mark_marshalled_obj(obj, param) + obj.members.each do |member| + param.add(Mapping.name2elename(member), + Mapping._obj2soap(obj[member], map)) + end + else + param = SOAPStruct.new(TYPE_STRUCT) + mark_marshalled_obj(obj, param) + param.add('type', ele_type = SOAPString.new(obj.class.to_s)) + ele_member = SOAPStruct.new + obj.members.each do |member| + ele_member.add(Mapping.name2elename(member), + Mapping._obj2soap(obj[member], map)) + end + param.add('member', ele_member) + addiv2soapattr(param, obj, map) + end + when ::IO, ::Binding, ::Continuation, ::Data, ::Dir, ::File::Stat, + ::MatchData, Method, ::Proc, ::Process::Status, ::Thread, + ::ThreadGroup, ::UnboundMethod + return nil + when ::SOAP::Mapping::Object + param = SOAPStruct.new(XSD::AnyTypeName) + mark_marshalled_obj(obj, param) + obj.__xmlele.each do |key, value| + param.add(key.name, Mapping._obj2soap(value, map)) + end + obj.__xmlattr.each do |key, value| + param.extraattr[key] = value + end + when ::Exception + typestr = Mapping.name2elename(obj.class.to_s) + param = SOAPStruct.new(XSD::QName.new(RubyTypeNamespace, typestr)) + mark_marshalled_obj(obj, param) + param.add('message', Mapping._obj2soap(obj.message, map)) + param.add('backtrace', Mapping._obj2soap(obj.backtrace, map)) + addiv2soapattr(param, obj, map) + else + param = unknownobj2soap(soap_class, obj, info, map) + end + param + end + + def soap2obj(obj_class, node, info, map) + rubytype = node.extraattr[RubyTypeName] + if rubytype or node.type.namespace == RubyTypeNamespace + rubytype2obj(node, info, map, rubytype) + elsif node.type == XSD::AnyTypeName or node.type == XSD::AnySimpleTypeName + anytype2obj(node, info, map) + else + unknowntype2obj(node, info, map) + end + end + +private + + def addiv2soapattr(node, obj, map) + return if obj.instance_variables.empty? + ivars = SOAPStruct.new # Undefined type. + setiv2soap(ivars, obj, map) + node.extraattr[RubyIVarName] = ivars + end + + def unknownobj2soap(soap_class, obj, info, map) + if anonymous_class?(obj) + raise TypeError.new("can't dump anonymous class #{obj}") + end + singleton_class = class << obj; self; end + if !obj.singleton_methods(true).empty? or + !singleton_class.instance_variables.empty? + raise TypeError.new("singleton can't be dumped #{obj}") + end + if !(singleton_class.ancestors - obj.class.ancestors).empty? + typestr = Mapping.name2elename(obj.class.to_s) + type = XSD::QName.new(RubyTypeNamespace, typestr) + else + type = Mapping.class2element(obj.class) + end + param = SOAPStruct.new(type) + mark_marshalled_obj(obj, param) + setiv2soap(param, obj, map) + param + end + + def rubytype2obj(node, info, map, rubytype) + klass = rubytype ? Mapping.class_from_name(rubytype) : nil + obj = nil + case node + when SOAPString + return @string_factory.soap2obj(klass || String, node, info, map) + when SOAPDateTime + #return @datetime_factory.soap2obj(klass || Time, node, info, map) + klass ||= Time + t = node.to_time + arg = [t.year, t.month, t.mday, t.hour, t.min, t.sec, t.usec] + obj = t.gmt? ? klass.gm(*arg) : klass.local(*arg) + mark_unmarshalled_obj(node, obj) + return true, obj + when SOAPArray + return @array_factory.soap2obj(klass || Array, node, info, map) + when SOAPNil, SOAPBoolean, SOAPInt, SOAPInteger, SOAPDecimal, SOAPDouble + return @basetype_factory.soap2obj(nil, node, info, map) + when SOAPStruct + return rubytypestruct2obj(node, info, map, rubytype) + else + raise + end + end + + def rubytypestruct2obj(node, info, map, rubytype) + klass = rubytype ? Mapping.class_from_name(rubytype) : nil + obj = nil + case node.type + when TYPE_HASH + klass = rubytype ? Mapping.class_from_name(rubytype) : Hash + obj = Mapping.create_empty_object(klass) + mark_unmarshalled_obj(node, obj) + node.each do |key, value| + next unless key == 'item' + obj[Mapping._soap2obj(value['key'], map)] = + Mapping._soap2obj(value['value'], map) + end + if node.key?('default') + obj.default = Mapping._soap2obj(node['default'], map) + end + when TYPE_REGEXP + klass = rubytype ? Mapping.class_from_name(rubytype) : Regexp + obj = Mapping.create_empty_object(klass) + mark_unmarshalled_obj(node, obj) + source = node['source'].string + options = node['options'].data || 0 + Regexp.instance_method(:initialize).bind(obj).call(source, options) + when TYPE_RANGE + klass = rubytype ? Mapping.class_from_name(rubytype) : Range + obj = Mapping.create_empty_object(klass) + mark_unmarshalled_obj(node, obj) + first = Mapping._soap2obj(node['begin'], map) + last = Mapping._soap2obj(node['end'], map) + exclude_end = node['exclude_end'].data + Range.instance_method(:initialize).bind(obj).call(first, last, exclude_end) + when TYPE_CLASS + obj = Mapping.class_from_name(node['name'].data) + when TYPE_MODULE + obj = Mapping.class_from_name(node['name'].data) + when TYPE_SYMBOL + obj = node['id'].data.intern + when TYPE_STRUCT + typestr = Mapping.elename2name(node['type'].data) + klass = Mapping.class_from_name(typestr) + if klass.nil? + return false + end + unless klass <= ::Struct + return false + end + obj = Mapping.create_empty_object(klass) + mark_unmarshalled_obj(node, obj) + node['member'].each do |name, value| + obj[Mapping.elename2name(name)] = Mapping._soap2obj(value, map) + end + else + return unknowntype2obj(node, info, map) + end + return true, obj + end + + def anytype2obj(node, info, map) + case node + when SOAPBasetype + return true, node.data + when SOAPStruct + klass = ::SOAP::Mapping::Object + obj = klass.new + mark_unmarshalled_obj(node, obj) + node.each do |name, value| + obj.__add_xmlele_value(XSD::QName.new(nil, name), + Mapping._soap2obj(value, map)) + end + unless node.extraattr.empty? + obj.instance_variable_set('@__xmlattr', node.extraattr) + end + return true, obj + else + return false + end + end + + def unknowntype2obj(node, info, map) + case node + when SOAPBasetype + return true, node.data + when SOAPArray + return @array_factory.soap2obj(Array, node, info, map) + when SOAPStruct + obj = unknownstruct2obj(node, info, map) + return true, obj if obj + if !@allow_untyped_struct + return false + end + return anytype2obj(node, info, map) + else + # Basetype which is not defined... + return false + end + end + + def unknownstruct2obj(node, info, map) + unless node.type.name + return nil + end + typestr = Mapping.elename2name(node.type.name) + klass = Mapping.class_from_name(typestr) + if klass.respond_to?(:soap_marshallable) and !klass.soap_marshallable + return nil + end + if klass.nil? and @allow_untyped_struct + klass = Mapping.class_from_name(typestr, true) # lenient + end + if klass.nil? + return nil + end + if klass <= ::Exception + return exception2obj(klass, node, map) + end + klass_type = Mapping.class2qname(klass) + return nil unless node.type.match(klass_type) + obj = nil + begin + obj = Mapping.create_empty_object(klass) + rescue + # type name "data" tries Data.new which raises TypeError + nil + end + mark_unmarshalled_obj(node, obj) + setiv2obj(obj, node, map) + obj + end + + def exception2obj(klass, node, map) + message = Mapping._soap2obj(node['message'], map) + backtrace = Mapping._soap2obj(node['backtrace'], map) + obj = Mapping.create_empty_object(klass) + obj = obj.exception(message) + mark_unmarshalled_obj(node, obj) + obj.set_backtrace(backtrace) + obj + end + + # Only creates empty array. Do String#replace it with real string. + def array2obj(node, map, rubytype) + klass = rubytype ? Mapping.class_from_name(rubytype) : Array + obj = Mapping.create_empty_object(klass) + mark_unmarshalled_obj(node, obj) + obj + end + + # Only creates empty string. Do String#replace it with real string. + def string2obj(node, map, rubytype) + klass = rubytype ? Mapping.class_from_name(rubytype) : String + obj = Mapping.create_empty_object(klass) + mark_unmarshalled_obj(node, obj) + obj + end +end + + +end +end diff --git a/lib/soap/mapping/schemadefinition.rb b/lib/soap/mapping/schemadefinition.rb new file mode 100644 index 0000000..d024794 --- /dev/null +++ b/lib/soap/mapping/schemadefinition.rb @@ -0,0 +1,170 @@ +# SOAP4R - Ruby type mapping schema definition utility. +# Copyright (C) 2000-2007 NAKAMURA Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/codegen/gensupport' + + +module SOAP +module Mapping + + +class SchemaElementDefinition + attr_reader :varname, :mapped_class, :elename, :minoccurs, :maxoccurs + + def initialize(varname, mapped_class, elename, minoccurs, maxoccurs, + as_any, as_array) + @varname = varname + @mapped_class = mapped_class + @elename = elename + @minoccurs = minoccurs + @maxoccurs = maxoccurs + @as_any = as_any + @as_array = as_array + end + + def as_any? + @as_any + end + + def as_array? + @as_array + end +end + +module SchemaComplexTypeDefinition + include Enumerable + + def initialize + @content = [] + @element_cache = {} + end + + def is_concrete_definition + true + end + + def <<(ele) + @content << ele + end + + def each + @content.each do |ele| + yield ele + end + end + + def size + @content.size + end + + def as_any? + false + end + + def as_array? + false + end + + def find_element(qname) + @element_cache[qname] ||= search_element(qname) + end + +private + + def search_element(qname) + each do |ele| + if ele.respond_to?(:find_element) + found = ele.find_element(qname) + return found if found + else + # relaxed match + if ele.elename == qname or + (qname.namespace.nil? and ele.elename.name == qname.name) + return ele + end + end + end + nil + end +end + +class SchemaEmptyDefinition + include SchemaComplexTypeDefinition + + def initialize + super() + @content.freeze + end +end + +class SchemaSequenceDefinition + include SchemaComplexTypeDefinition + + def initialize + super() + end + + def choice? + false + end + + # override + def as_array? + @as_array ||= false + end + + def set_array + @as_array = true + end +end + +class SchemaChoiceDefinition + include SchemaComplexTypeDefinition + + def initialize + super() + end + + def choice? + true + end +end + +class SchemaDefinition + EMPTY = SchemaEmptyDefinition.new + + attr_reader :class_for + attr_reader :elename, :type + attr_reader :qualified + attr_accessor :basetype + attr_accessor :attributes + attr_accessor :elements + + def initialize(class_for, elename, type, anonymous, qualified) + @class_for = class_for + @elename = elename + @type = type + @anonymous = anonymous + @qualified = qualified + @basetype = nil + @elements = EMPTY + @attributes = nil + end + + def is_anonymous? + @anonymous + end + + def choice? + @elements.choice? + end +end + + +end +end diff --git a/lib/soap/mapping/typeMap.rb b/lib/soap/mapping/typeMap.rb new file mode 100644 index 0000000..f06e544 --- /dev/null +++ b/lib/soap/mapping/typeMap.rb @@ -0,0 +1,106 @@ +# SOAP4R - Base type mapping definition +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module SOAP + + +TypeMap = { + XSD::XSDAnySimpleType::Type => SOAPAnySimpleType, + + XSD::XSDString::Type => SOAPString, + XSD::XSDNormalizedString::Type => SOAPNormalizedString, + XSD::XSDToken::Type => SOAPToken, + XSD::XSDLanguage::Type => SOAPLanguage, + XSD::XSDNMTOKEN::Type => SOAPNMTOKEN, + XSD::XSDNMTOKENS::Type => SOAPNMTOKENS, + XSD::XSDName::Type => SOAPName, + XSD::XSDNCName::Type => SOAPNCName, + XSD::XSDID::Type => SOAPID, + XSD::XSDIDREF::Type => SOAPIDREF, + XSD::XSDIDREFS::Type => SOAPIDREFS, + XSD::XSDENTITY::Type => SOAPENTITY, + XSD::XSDENTITIES::Type => SOAPENTITIES, + XSD::XSDBoolean::Type => SOAPBoolean, + XSD::XSDDecimal::Type => SOAPDecimal, + XSD::XSDFloat::Type => SOAPFloat, + XSD::XSDDouble::Type => SOAPDouble, + XSD::XSDDuration::Type => SOAPDuration, + XSD::XSDDateTime::Type => SOAPDateTime, + XSD::XSDTime::Type => SOAPTime, + XSD::XSDDate::Type => SOAPDate, + XSD::XSDGYearMonth::Type => SOAPGYearMonth, + XSD::XSDGYear::Type => SOAPGYear, + XSD::XSDGMonthDay::Type => SOAPGMonthDay, + XSD::XSDGDay::Type => SOAPGDay, + XSD::XSDGMonth::Type => SOAPGMonth, + XSD::XSDHexBinary::Type => SOAPHexBinary, + XSD::XSDBase64Binary::Type => SOAPBase64, + XSD::XSDAnyURI::Type => SOAPAnyURI, + XSD::XSDQName::Type => SOAPQName, + XSD::XSDInteger::Type => SOAPInteger, + XSD::XSDNonPositiveInteger::Type => SOAPNonPositiveInteger, + XSD::XSDNegativeInteger::Type => SOAPNegativeInteger, + XSD::XSDLong::Type => SOAPLong, + XSD::XSDInt::Type => SOAPInt, + XSD::XSDShort::Type => SOAPShort, + XSD::XSDByte::Type => SOAPByte, + XSD::XSDNonNegativeInteger::Type => SOAPNonNegativeInteger, + XSD::XSDUnsignedLong::Type => SOAPUnsignedLong, + XSD::XSDUnsignedInt::Type => SOAPUnsignedInt, + XSD::XSDUnsignedShort::Type => SOAPUnsignedShort, + XSD::XSDUnsignedByte::Type => SOAPUnsignedByte, + XSD::XSDPositiveInteger::Type => SOAPPositiveInteger, + + # soap4r does not use soapenc types actively but it should be accepted. + SOAP::SOAPString::SOAPENCType => SOAPString, + SOAP::SOAPNormalizedString::Type => SOAPNormalizedString, + SOAP::SOAPToken::Type => SOAPToken, + SOAP::SOAPLanguage::Type => SOAPLanguage, + SOAP::SOAPNMTOKEN::Type => SOAPNMTOKEN, + SOAP::SOAPNMTOKENS::Type => SOAPNMTOKENS, + SOAP::SOAPName::Type => SOAPName, + SOAP::SOAPNCName::Type => SOAPNCName, + SOAP::SOAPID::Type => SOAPID, + SOAP::SOAPIDREF::Type => SOAPIDREF, + SOAP::SOAPIDREFS::Type => SOAPIDREFS, + SOAP::SOAPENTITY::Type => SOAPENTITY, + SOAP::SOAPENTITIES::Type => SOAPENTITIES, + SOAP::SOAPBoolean::SOAPENCType => SOAPBoolean, + SOAP::SOAPDecimal::SOAPENCType => SOAPDecimal, + SOAP::SOAPFloat::SOAPENCType => SOAPFloat, + SOAP::SOAPDouble::SOAPENCType => SOAPDouble, + SOAP::SOAPDuration::SOAPENCType => SOAPDuration, + SOAP::SOAPDateTime::SOAPENCType => SOAPDateTime, + SOAP::SOAPTime::SOAPENCType => SOAPTime, + SOAP::SOAPDate::SOAPENCType => SOAPDate, + SOAP::SOAPGYearMonth::SOAPENCType => SOAPGYearMonth, + SOAP::SOAPGYear::SOAPENCType => SOAPGYear, + SOAP::SOAPGMonthDay::SOAPENCType => SOAPGMonthDay, + SOAP::SOAPGDay::SOAPENCType => SOAPGDay, + SOAP::SOAPGMonth::SOAPENCType => SOAPGMonth, + SOAP::SOAPHexBinary::SOAPENCType => SOAPHexBinary, + SOAP::SOAPBase64::SOAPENCType => SOAPBase64, + SOAP::SOAPAnyURI::SOAPENCType => SOAPAnyURI, + SOAP::SOAPQName::SOAPENCType => SOAPQName, + SOAP::SOAPInteger::SOAPENCType => SOAPInteger, + SOAP::SOAPNonPositiveInteger::SOAPENCType => SOAPNonPositiveInteger, + SOAP::SOAPNegativeInteger::SOAPENCType => SOAPNegativeInteger, + SOAP::SOAPLong::SOAPENCType => SOAPLong, + SOAP::SOAPInt::SOAPENCType => SOAPInt, + SOAP::SOAPShort::SOAPENCType => SOAPShort, + SOAP::SOAPByte::SOAPENCType => SOAPByte, + SOAP::SOAPNonNegativeInteger::SOAPENCType => SOAPNonNegativeInteger, + SOAP::SOAPUnsignedLong::SOAPENCType => SOAPUnsignedLong, + SOAP::SOAPUnsignedInt::SOAPENCType => SOAPUnsignedInt, + SOAP::SOAPUnsignedShort::SOAPENCType => SOAPUnsignedShort, + SOAP::SOAPUnsignedByte::SOAPENCType => SOAPUnsignedByte, + SOAP::SOAPPositiveInteger::SOAPENCType => SOAPPositiveInteger, +} + + +end diff --git a/lib/soap/mapping/wsdlencodedregistry.rb b/lib/soap/mapping/wsdlencodedregistry.rb new file mode 100644 index 0000000..19fce1c --- /dev/null +++ b/lib/soap/mapping/wsdlencodedregistry.rb @@ -0,0 +1,211 @@ +# SOAP4R - WSDL encoded mapping registry. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/qname' +require 'xsd/namedelements' +require 'soap/baseData' +require 'soap/mapping/mapping' +require 'soap/mapping/typeMap' + + +module SOAP +module Mapping + + +class WSDLEncodedRegistry < EncodedRegistry + attr_reader :definedelements + attr_reader :definedtypes + + def initialize(definedtypes = XSD::NamedElements::Empty) + super() + @definedtypes = definedtypes + # @definedelements = definedelements needed? + # For mapping AnyType element. + @rubytype_factory = RubytypeFactory.new( + :allow_untyped_struct => true, + :allow_original_mapping => true + ) + end + + def obj2soap(obj, qname = nil) + soap_obj = nil + if type = @definedtypes[qname] + soap_obj = obj2typesoap(obj, type) + else + soap_obj = any2soap(obj, qname) + end + return soap_obj if soap_obj + if @excn_handler_obj2soap + soap_obj = @excn_handler_obj2soap.call(obj) { |yield_obj| + Mapping._obj2soap(yield_obj, self) + } + return soap_obj if soap_obj + end + if qname + raise MappingError.new("cannot map #{obj.class.name} as #{qname}") + else + raise MappingError.new("cannot map #{obj.class.name} to SOAP/OM") + end + end + + # map anything for now: must refer WSDL while mapping. [ToDo] + def soap2obj(node, obj_class = nil) + cause = nil + begin + unless obj_class + typestr = Mapping.safeconstname(node.elename.name) + obj_class = Mapping.class_from_name(typestr) + end + return Mapping._soap2obj(node, Mapping::DefaultRegistry, obj_class) + rescue MappingError + cause = $! + end + if @excn_handler_soap2obj + begin + return @excn_handler_soap2obj.call(node) { |yield_node| + Mapping._soap2obj(yield_node, self) + } + rescue Exception + end + end + raise MappingError.new("cannot map #{node.type.name} to Ruby object", cause) + end + +private + + def any2soap(obj, qname) + ele = nil + if obj.nil? + ele = SOAPNil.new + elsif qname.nil? or qname == XSD::AnyTypeName + ele = @rubytype_factory.obj2soap(nil, obj, nil, self) + elsif obj.is_a?(XSD::NSDBase) + ele = soap2soap(obj, qname) + elsif type = TypeMap[qname] + ele = base2soap(obj, type) + end + add_attributes2soap(obj, ele) unless ele.nil? + ele + end + + def soap2soap(obj, type_qname) + if obj.is_a?(SOAPBasetype) + obj + elsif obj.is_a?(SOAPStruct) && (type = @definedtypes[type_qname]) + soap_obj = obj + mark_marshalled_obj(obj, soap_obj) + elements2soap(obj, soap_obj, type.elements) + soap_obj + elsif obj.is_a?(SOAPArray) && (type = @definedtypes[type_qname]) + soap_obj = obj + contenttype = type.child_type + mark_marshalled_obj(obj, soap_obj) + obj.replace do |ele| + Mapping._obj2soap(ele, self, contenttype) + end + soap_obj + else + nil + end + end + + def obj2typesoap(obj, type) + if type.is_a?(::WSDL::XMLSchema::SimpleType) + simpleobj2soap(obj, type) + else + complexobj2soap(obj, type) + end + end + + def simpleobj2soap(obj, type) + type.check_lexical_format(obj) + return SOAPNil.new if obj.nil? # TODO: check nillable. + if type.base + ele = base2soap(obj, TypeMap[type.base]) + ele.type = type.name + elsif type.list + value = obj.is_a?(Array) ? obj.join(" ") : obj.to_s + ele = base2soap(value, SOAP::SOAPString) + else + raise MappingError.new("unsupported simpleType: #{type}") + end + ele + end + + def complexobj2soap(obj, type) + case type.compoundtype + when :TYPE_STRUCT + struct2soap(obj, type.name, type) + when :TYPE_ARRAY + array2soap(obj, type.name, type) + when :TYPE_MAP + map2soap(obj, type.name, type) + when :TYPE_SIMPLE + simpleobj2soap(obj, type.simplecontent) + when :TYPE_EMPTY + raise MappingError.new("should be empty") unless obj.nil? + SOAPNil.new + else + raise MappingError.new("unknown compound type: #{type.compoundtype}") + end + end + + def struct2soap(obj, type_qname, type) + return SOAPNil.new if obj.nil? # ToDo: check nillable. + soap_obj = SOAPStruct.new(type_qname) + mark_marshalled_obj(obj, soap_obj) + elements2soap(obj, soap_obj, type.elements) + soap_obj + end + + def array2soap(obj, type_qname, type) + return SOAPNil.new if obj.nil? # ToDo: check nillable. + arytype = type.child_type + soap_obj = SOAPArray.new(ValueArrayName, 1, arytype) + unless obj.nil? + mark_marshalled_obj(obj, soap_obj) + obj.each do |item| + soap_obj.add(Mapping._obj2soap(item, self, arytype)) + end + end + soap_obj + end + + MapKeyName = XSD::QName.new(nil, "key") + MapValueName = XSD::QName.new(nil, "value") + def map2soap(obj, type_qname, type) + return SOAPNil.new if obj.nil? # ToDo: check nillable. + keytype = type.child_type(MapKeyName) || XSD::AnyTypeName + valuetype = type.child_type(MapValueName) || XSD::AnyTypeName + soap_obj = SOAPStruct.new(MapQName) + unless obj.nil? + mark_marshalled_obj(obj, soap_obj) + obj.each do |key, value| + elem = SOAPStruct.new + elem.add("key", Mapping._obj2soap(key, self, keytype)) + elem.add("value", Mapping._obj2soap(value, self, valuetype)) + # ApacheAxis allows only 'item' here. + soap_obj.add("item", elem) + end + end + soap_obj + end + + def elements2soap(obj, soap_obj, elements) + elements.each do |element| + name = element.name.name + child_obj = Mapping.get_attribute(obj, name) + soap_obj.add(name, + Mapping._obj2soap(child_obj, self, element.type || element.name)) + end + end +end + + +end +end diff --git a/lib/soap/mapping/wsdlliteralregistry.rb b/lib/soap/mapping/wsdlliteralregistry.rb new file mode 100644 index 0000000..1c4b4f2 --- /dev/null +++ b/lib/soap/mapping/wsdlliteralregistry.rb @@ -0,0 +1,248 @@ +# SOAP4R - WSDL literal mapping registry. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/baseData' +require 'soap/mapping/mapping' +require 'soap/mapping/literalregistry' +require 'soap/mapping/typeMap' +require 'xsd/codegen/gensupport' +require 'xsd/namedelements' + + +module SOAP +module Mapping + + +class WSDLLiteralRegistry < LiteralRegistry + attr_reader :definedelements + attr_reader :definedtypes + + def initialize(definedtypes = XSD::NamedElements::Empty, + definedelements = XSD::NamedElements::Empty) + super() + @definedtypes = definedtypes + @definedelements = definedelements + end + + def obj2soap(obj, qname, obj_class = nil) + soap_obj = nil + if obj.is_a?(SOAPElement) + soap_obj = obj + elsif eledef = @definedelements[qname] + soap_obj = obj2elesoap(obj, eledef) + elsif type = @definedtypes[qname] + soap_obj = obj2typesoap(obj, type) + else + soap_obj = any2soap(obj, qname, obj_class) + end + return soap_obj if soap_obj + if @excn_handler_obj2soap + soap_obj = @excn_handler_obj2soap.call(obj) { |yield_obj| + Mapping.obj2soap(yield_obj, nil, nil, MAPPING_OPT) + } + return soap_obj if soap_obj + end + raise MappingError.new("cannot map #{obj.class.name} as #{qname}") + end + + # node should be a SOAPElement + def soap2obj(node, obj_class = nil) + cause = nil + begin + return any2obj(node, obj_class) + rescue MappingError + cause = $! + end + if @excn_handler_soap2obj + begin + return @excn_handler_soap2obj.call(node) { |yield_node| + Mapping.soap2obj(yield_node, nil, nil, MAPPING_OPT) + } + rescue Exception + end + end + if node.respond_to?(:type) + raise MappingError.new("cannot map #{node.type.name} to Ruby object", cause) + else + raise MappingError.new("cannot map #{node.elename.name} to Ruby object", cause) + end + end + +private + + def obj2elesoap(obj, eledef) + ele = nil + qualified = (eledef.elementform == 'qualified') + if obj.is_a?(SOAPNil) + ele = obj + elsif eledef.type + if type = @definedtypes[eledef.type] + ele = obj2typesoap(obj, type) + elsif type = TypeMap[eledef.type] + ele = base2soap(obj, type) + else + raise MappingError.new("cannot find type #{eledef.type}") + end + elsif eledef.local_complextype + ele = obj2typesoap(obj, eledef.local_complextype) + elsif eledef.local_simpletype + ele = obj2typesoap(obj, eledef.local_simpletype) + else + raise MappingError.new('illegal schema?') + end + ele.elename = eledef.name + ele.qualified = qualified + ele + end + + def obj2typesoap(obj, type) + ele = nil + if type.is_a?(::WSDL::XMLSchema::SimpleType) + ele = simpleobj2soap(obj, type) + else # complexType + if type.simplecontent + ele = simpleobj2soap(obj, type.simplecontent) + else + ele = complexobj2soap(obj, type) + end + ele.type = type.name + if type.base or Mapping.root_type_hint + Mapping.reset_root_type_hint + ele.force_typed = true + end + add_definedattributes2soap(obj, ele, type) + end + ele + end + + def simpleobj2soap(obj, type) + type.check_lexical_format(obj) + return SOAPNil.new if obj.nil? + if type.base + ele = base2soap(obj, TypeMap[type.base]) + elsif type.list + value = obj.is_a?(Array) ? obj.join(" ") : obj.to_s + ele = base2soap(value, SOAP::SOAPString) + else + raise MappingError.new("unsupported simpleType: #{type}") + end + ele + end + + def complexobj2soap(obj, type) + ele = SOAPElement.new(type.name) + complexobj2sequencesoap(obj, ele, type, type.choice?, type.choice?) + ele + end + + def complexobj2sequencesoap(obj, soap, type, nillable, is_choice) + added = false + type.elements.each do |child_ele| + case child_ele + when WSDL::XMLSchema::Any + any = Mapping.get_attributes_for_any(obj) + SOAPElement.from_objs(any).each do |child| + soap.add(child) + end + ele_added = true + when WSDL::XMLSchema::Element + ele_added = complexobj2soapchildren(obj, soap, child_ele, nillable) + when WSDL::XMLSchema::Sequence + ele_added = complexobj2sequencesoap(obj, soap, child_ele, nillable, false) + when WSDL::XMLSchema::Choice + ele_added = complexobj2sequencesoap(obj, soap, child_ele, true, true) + else + raise MappingError.new("unknown type: #{child_ele}") + end + added = true if ele_added + break if is_choice and ele_added + end + added + end + + def complexobj2soapchildren(obj, soap, child_ele, nillable = false) + if child_ele.map_as_array? + complexobj2soapchildren_array(obj, soap, child_ele, nillable) + else + complexobj2soapchildren_single(obj, soap, child_ele, nillable) + end + end + + def complexobj2soapchildren_array(obj, soap, child_ele, nillable) + child = Mapping.get_attribute(obj, child_ele.name.name) + if child.nil? and obj.is_a?(::Array) + child = obj + end + if child.nil? + return false if nillable + if child_soap = nil2soap(child_ele) + soap.add(child_soap) + return true + else + return false + end + end + unless child.respond_to?(:each) + return false + end + child.each do |item| + if item.is_a?(SOAPElement) + soap.add(item) + else + child_soap = obj2elesoap(item, child_ele) + soap.add(child_soap) + end + end + true + end + + def complexobj2soapchildren_single(obj, soap, child_ele, nillable) + child = Mapping.get_attribute(obj, child_ele.name.name) + case child + when NilClass + return false if nillable + if child_soap = nil2soap(child_ele) + soap.add(child_soap) + true + else + false + end + when SOAPElement + soap.add(child) + true + else + child_soap = obj2elesoap(child, child_ele) + soap.add(child_soap) + true + end + end + + def nil2soap(ele) + if ele.nillable + obj2elesoap(nil, ele) # add an empty element + elsif ele.minoccurs == 0 + nil # intends no element + else + warn("nil not allowed: #{ele.name.name}") + nil + end + end + + def add_definedattributes2soap(obj, ele, typedef) + if typedef.attributes + typedef.attributes.each do |at| + value = get_xmlattr_value(obj, at.name) + ele.extraattr[at.name] = value unless value.nil? + end + end + end +end + + +end +end diff --git a/lib/soap/marshal.rb b/lib/soap/marshal.rb new file mode 100644 index 0000000..a74f98d --- /dev/null +++ b/lib/soap/marshal.rb @@ -0,0 +1,59 @@ +# SOAP4R - Marshalling/Unmarshalling Ruby's object using SOAP Encoding. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require "soap/mapping" +require "soap/processor" + + +module SOAP + + +module Marshal + # Trying xsd:dateTime data to be recovered as aTime. + MarshalMappingRegistry = Mapping::EncodedRegistry.new( + :allow_original_mapping => true) + MarshalMappingRegistry.add( + Time, + ::SOAP::SOAPDateTime, + ::SOAP::Mapping::EncodedRegistry::DateTimeFactory + ) + + class << self + public + def dump(obj, io = nil) + marshal(obj, MarshalMappingRegistry, io) + end + + def load(stream) + unmarshal(stream, MarshalMappingRegistry) + end + + def marshal(obj, mapping_registry = MarshalMappingRegistry, io = nil) + elename = Mapping.name2elename(obj.class.to_s) + soap_obj = Mapping.obj2soap(obj, mapping_registry) + body = SOAPBody.new + body.add(elename, soap_obj) + env = SOAPEnvelope.new(nil, body) + SOAP::Processor.marshal(env, {}, io) + end + + def unmarshal(stream, mapping_registry = MarshalMappingRegistry) + env = SOAP::Processor.unmarshal(stream) + if env.nil? + raise ArgumentError.new("Illegal SOAP marshal format.") + end + Mapping.soap2obj(env.body.root_node, mapping_registry) + end + end +end + + +end + + +SOAPMarshal = SOAP::Marshal diff --git a/lib/soap/mimemessage.rb b/lib/soap/mimemessage.rb new file mode 100644 index 0000000..f3f26c9 --- /dev/null +++ b/lib/soap/mimemessage.rb @@ -0,0 +1,241 @@ +# SOAP4R - MIME Message implementation. +# Copyright (C) 2002 Jamie Herre. + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/attachment' + + +module SOAP + + +# Classes for MIME message handling. Should be put somewhere else! +# Tried using the 'tmail' module but found that I needed something +# lighter in weight. + + +class MIMEMessage + class MIMEMessageError < StandardError; end + + MultipartContentType = 'multipart/\w+' + + class Header + attr_accessor :str, :key, :root + + def initialize + @attrs = {} + end + + def [](key) + @attrs[key] + end + + def []=(key, value) + @attrs[key] = value + end + + def to_s + @key + ": " + @str + end + end + + class Headers < Hash + def self.parse(str) + new.parse(str) + end + + def parse(str) + header_cache = nil + str.each do |line| + case line + when /^\A[^\: \t]+:\s*.+$/ + parse_line(header_cache) if header_cache + header_cache = line.sub(/\r?\n\z/, '') + when /^\A\s+(.*)$/ + # a continuous line at the beginning line crashes here. + header_cache << line + else + raise RuntimeError.new("unexpected header: #{line.inspect}") + end + end + parse_line(header_cache) if header_cache + self + end + + def parse_line(line) + if /^\A([^\: \t]+):\s*(.+)\z/ =~ line + header = parse_rhs($2.strip) + header.key = $1.strip + self[header.key.downcase] = header + else + raise RuntimeError.new("unexpected header line: #{line.inspect}") + end + end + + def parse_rhs(str) + a = str.split(/;+\s+/) + header = Header.new + header.str = str + header.root = a.shift + a.each do |pair| + if pair =~ /(\w+)\s*=\s*"?([^"]+)"?/ + header[$1.downcase] = $2 + else + raise RuntimeError.new("unexpected header component: #{pair.inspect}") + end + end + header + end + + def add(key, value) + if key != nil and value != nil + header = parse_rhs(value) + header.key = key + self[key.downcase] = header + end + end + + def to_s + self.values.collect { |hdr| + hdr.to_s + }.join("\r\n") + end + end + + class Part + attr_accessor :headers, :body + + def initialize + @headers = Headers.new + @headers.add("Content-Transfer-Encoding", "8bit") + @body = nil + @contentid = nil + end + + def self.parse(str) + new.parse(str) + end + + def parse(str) + headers, body = str.split(/\r\n\r\n/, 2) + if headers != nil and body != nil + @headers = Headers.parse(headers) + @body = body.sub(/\r\n\z/, '') + else + raise RuntimeError.new("unexpected part: #{str.inspect}") + end + self + end + + def contentid + if @contentid == nil and @headers.key?('content-id') + @contentid = @headers['content-id'].str + @contentid = $1 if @contentid =~ /^<(.+)>$/ + end + @contentid + end + + alias content body + + def to_s + @headers.to_s + "\r\n\r\n" + @body + end + end + + def initialize + @parts = [] + @headers = Headers.new + @root = nil + @boundary = nil + end + + def self.parse(head, str) + new.parse(head, str) + end + + attr_reader :parts, :headers + + def close + @headers.add( + "Content-Type", + "multipart/related; type=\"text/xml\"; boundary=\"#{boundary}\"; start=\"#{@parts[0].contentid}\"" + ) + end + + def parse(head, str) + @headers = Headers.parse(head + "\r\n" + "From: jfh\r\n") + boundary = @headers['content-type']['boundary'] + if boundary != nil + parts = str.split(/--#{Regexp.quote(boundary)}\s*(?:\r\n|--\r\n)/) + part = parts.shift # preamble must be ignored. + @parts = parts.collect { |part| Part.parse(part) } + else + @parts = [Part.parse(str)] + end + if @parts.length < 1 + raise MIMEMessageError.new("This message contains no valid parts!") + end + self + end + + def root + if @root == nil + start = @headers['content-type']['start'] + @root = (start && @parts.find { |prt| prt.contentid == start }) || + @parts[0] + end + @root + end + + def boundary + if @boundary == nil + @boundary = "----=Part_" + __id__.to_s + rand.to_s + end + @boundary + end + + def add_part(content) + part = Part.new + part.headers.add("Content-Type", + "text/xml; charset=" + XSD::Charset.xml_encoding_label) + part.headers.add("Content-ID", Attachment.contentid(part)) + part.body = content + @parts.unshift(part) + end + + def add_attachment(attach) + part = Part.new + part.headers.add("Content-Type", attach.contenttype) + part.headers.add("Content-ID", attach.mime_contentid) + part.body = attach.content + @parts.unshift(part) + end + + def has_parts? + (@parts.length > 0) + end + + def headers_str + @headers.to_s + end + + def content_str + str = '' + @parts.each do |prt| + str << "--" + boundary + "\r\n" + str << prt.to_s + "\r\n" + end + str << '--' + boundary + "--\r\n" + str + end + + def to_s + str = headers_str + "\r\n\r\n" + conent_str + end +end + + +end diff --git a/lib/soap/nestedexception.rb b/lib/soap/nestedexception.rb new file mode 100644 index 0000000..a36c3dd --- /dev/null +++ b/lib/soap/nestedexception.rb @@ -0,0 +1,42 @@ +# SOAP4R - Nested exception implementation +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module SOAP + + +module NestedException + attr_reader :cause + attr_reader :original_backtraace + + def initialize(msg = nil, cause = nil) + super(msg) + @cause = cause + @original_backtrace = nil + end + + def set_backtrace(backtrace) + if @cause and @cause.respond_to?(:backtrace) + @original_backtrace = backtrace +=begin + # for agressive backtrace abstraction: 'here' only should not be good + here = @original_backtrace[0] + backtrace = Array[*@cause.backtrace] + backtrace[0] = "#{backtrace[0]}: #{@cause} (#{@cause.class})" + backtrace.unshift(here) +=end + # just join the nested backtrace at the tail of backtrace + caused = Array[*@cause.backtrace] + caused[0] = "#{caused[0]}: #{@cause} (#{@cause.class}) [NESTED]" + backtrace += caused + end + super(backtrace) + end +end + + +end diff --git a/lib/soap/netHttpClient.rb b/lib/soap/netHttpClient.rb new file mode 100644 index 0000000..d47d832 --- /dev/null +++ b/lib/soap/netHttpClient.rb @@ -0,0 +1,241 @@ +# SOAP4R - net/http wrapper +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'net/http' +require 'soap/filter/filterchain' + + +module SOAP + + +class NetHttpClient + + SSLEnabled = begin + require 'net/https' + true + rescue LoadError + false + end + + attr_reader :proxy + attr_accessor :no_proxy + attr_accessor :debug_dev + attr_accessor :ssl_config # ignored for now. + attr_accessor :protocol_version # ignored for now. + attr_accessor :connect_timeout + attr_accessor :send_timeout # ignored for now. + attr_accessor :receive_timeout + attr_reader :test_loopback_response + attr_reader :request_filter # ignored for now. + + def initialize(proxy = nil, agent = nil) + @proxy = proxy ? URI.parse(proxy) : nil + @agent = agent + @debug_dev = nil + @test_loopback_response = [] + @request_filter = Filter::FilterChain.new + @session_manager = SessionManager.new + @no_proxy = @ssl_config = @protocol_version = nil + @connect_timeout = @send_timeout = @receive_timeout = nil + end + + def proxy=(proxy) + if proxy.nil? + @proxy = nil + else + if proxy.is_a?(URI) + @proxy = proxy + else + @proxy = URI.parse(proxy) + end + if @proxy.scheme == nil or @proxy.scheme.downcase != 'http' or + @proxy.host == nil or @proxy.port == nil + raise ArgumentError.new("unsupported proxy `#{proxy}'") + end + end + reset_all + @proxy + end + + def set_auth(uri, user_id, passwd) + raise NotImplementedError.new("auth is not supported under soap4r + net/http.") + end + + def set_basic_auth(uri, user_id, passwd) + # net/http does not handle url. + @basic_auth = [user_id, passwd] + raise NotImplementedError.new("basic_auth is not supported under soap4r + net/http.") + end + + def set_cookie_store(filename) + raise NotImplementedError.new + end + + def save_cookie_store(filename) + raise NotImplementedError.new + end + + def reset(url) + # no persistent connection. ignored. + end + + def reset_all + # no persistent connection. ignored. + end + + def post(url, req_body, header = {}) + post_redirect(url, req_body, header, 10) + end + + def get_content(url, header = {}) + if str = @test_loopback_response.shift + return str + end + unless url.is_a?(URI) + url = URI.parse(url) + end + extra = header.dup + extra['User-Agent'] = @agent if @agent + res = start(url) { |http| + http.get(url.request_uri, extra) + } + res.body + end + +private + + def post_redirect(url, req_body, header, redirect_count) + if str = @test_loopback_response.shift + if @debug_dev + @debug_dev << "= Request\n\n" + @debug_dev << req_body + @debug_dev << "\n\n= Response\n\n" + @debug_dev << str + end + status = 200 + reason = nil + contenttype = 'text/xml' + content = str + return Response.new(status, reason, contenttype, content) + return str + end + unless url.is_a?(URI) + url = URI.parse(url) + end + extra = header.dup + extra['User-Agent'] = @agent if @agent + res = start(url) { |http| + if @debug_dev + @debug_dev << "= Request\n\n" + @debug_dev << req_body << "\n" + end + http.post(url.request_uri, req_body, extra) + } + case res + when Net::HTTPRedirection + if redirect_count > 0 + post_redirect(res['location'], req_body, header, + redirect_count - 1) + else + raise ArgumentError.new("Too many redirects") + end + else + Response.from_httpresponse(res) + end + end + + def start(url) + http = create_connection(url) + response = nil + http.start { |worker| + response = yield(worker) + worker.finish + } + if @debug_dev + @debug_dev << "\n\n= Response\n\n" + @debug_dev << response.body << "\n" + end + response + end + + def create_connection(url) + proxy_host = proxy_port = nil + unless no_proxy?(url) + proxy_host = @proxy.host + proxy_port = @proxy.port + end + http = Net::HTTP::Proxy(proxy_host, proxy_port).new(url.host, url.port) + if http.respond_to?(:set_debug_output) + http.set_debug_output(@debug_dev) + end + http.open_timeout = @connect_timeout if @connect_timeout + http.read_timeout = @receive_timeout if @receive_timeout + case url + when URI::HTTPS + if SSLEnabled + http.use_ssl = true + else + raise RuntimeError.new("Cannot connect to #{url} (OpenSSL is not installed.)") + end + when URI::HTTP + # OK + else + raise RuntimeError.new("Cannot connect to #{url} (Not HTTP.)") + end + http + end + + NO_PROXY_HOSTS = ['localhost'] + + def no_proxy?(uri) + if !@proxy or NO_PROXY_HOSTS.include?(uri.host) + return true + end + unless @no_proxy + return false + end + @no_proxy.scan(/([^:,]+)(?::(\d+))?/) do |host, port| + if /(\A|\.)#{Regexp.quote(host)}\z/i =~ uri.host && + (!port || uri.port == port.to_i) + return true + end + end + false + end + + class SessionManager + attr_accessor :connect_timeout + attr_accessor :send_timeout + attr_accessor :receive_timeout + end + + class Response + attr_reader :status + attr_reader :reason + attr_reader :contenttype + attr_reader :content + + def initialize(status, reason, contenttype, content) + @status = status + @reason = reason + @contenttype = contenttype + @content = content + end + + def self.from_httpresponse(res) + status = res.code.to_i + reason = res.message + contenttype = res['content-type'] + content = res.body + new(status, reason, contenttype, content) + end + end +end + + +end diff --git a/lib/soap/ns.rb b/lib/soap/ns.rb new file mode 100644 index 0000000..74321a8 --- /dev/null +++ b/lib/soap/ns.rb @@ -0,0 +1,34 @@ +# SOAP4R - SOAP Namespace library +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/datatypes' +require 'xsd/ns' +require 'soap/soap' + + +module SOAP + + +class NS < XSD::NS + KNOWN_TAG = XSD::NS::KNOWN_TAG.dup.update( + SOAP::EnvelopeNamespace => 'env' + ) + + def initialize(tag2ns = nil) + super(tag2ns) + end + +private + + def default_known_tag + KNOWN_TAG + end +end + + +end diff --git a/lib/soap/parser.rb b/lib/soap/parser.rb new file mode 100644 index 0000000..bdd28fd --- /dev/null +++ b/lib/soap/parser.rb @@ -0,0 +1,252 @@ +# SOAP4R - SOAP XML Instance Parser library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/xmlparser' +require 'soap/soap' +require 'soap/ns' +require 'soap/baseData' +require 'soap/encodingstyle/handler' + + +module SOAP + + +class Parser + include SOAP + + class ParseError < Error; end + class FormatDecodeError < ParseError; end + class UnexpectedElementError < ParseError; end + +private + + class ParseFrame + attr_reader :node + attr_reader :name + attr_reader :ns + attr_reader :encodingstyle + attr_reader :handler + + class NodeContainer + def initialize(node) + @node = node + end + + def node + @node + end + + def replace_node(node) + @node = node + end + end + + public + + def initialize(ns, name, node, encodingstyle, handler) + @ns = ns + @name = name + @node = NodeContainer.new(node) + @encodingstyle = encodingstyle + @handler = handler + end + + # to avoid memory consumption + def update(ns, name, node, encodingstyle, handler) + @ns = ns + @name = name + @node.replace_node(node) + @encodingstyle = encodingstyle + @handler = handler + self + end + end + +public + + attr_accessor :envelopenamespace + attr_accessor :default_encodingstyle + attr_accessor :decode_typemap + attr_accessor :allow_unqualified_element + + def initialize(opt = {}) + @opt = opt + @parser = XSD::XMLParser.create_parser(self, opt) + @parsestack = nil + @recycleframe = nil + @lastnode = nil + @handlers = {} + @envelopenamespace = opt[:envelopenamespace] || EnvelopeNamespace + @default_encodingstyle = opt[:default_encodingstyle] || EncodingNamespace + @decode_typemap = opt[:decode_typemap] || nil + @allow_unqualified_element = opt[:allow_unqualified_element] || false + end + + def charset + @parser.charset + end + + def parse(string_or_readable) + @parsestack = [] + @lastnode = nil + + @handlers.each do |uri, handler| + handler.decode_prologue + end + + @parser.do_parse(string_or_readable) + + unless @parsestack.empty? + raise FormatDecodeError.new("Unbalanced tag in XML.") + end + + @handlers.each do |uri, handler| + handler.decode_epilogue + end + + @lastnode + end + + def start_element(name, raw_attrs) + lastframe = @parsestack.last + ns = parent = parent_encodingstyle = nil + if lastframe + ns = lastframe.ns + parent = lastframe.node + parent_encodingstyle = lastframe.encodingstyle + else + ns = SOAP::NS.new + parent = ParseFrame::NodeContainer.new(nil) + parent_encodingstyle = nil + end + # ns might be the same + ns, raw_attrs = XSD::XMLParser.filter_ns(ns, raw_attrs) + attrs = decode_attrs(ns, raw_attrs) + encodingstyle = attrs[AttrEncodingStyleName] + # Children's encodingstyle is derived from its parent. + if encodingstyle.nil? + if parent.node.is_a?(SOAPHeader) + encodingstyle = LiteralNamespace + else + encodingstyle = parent_encodingstyle || @default_encodingstyle + end + end + handler = find_handler(encodingstyle) + unless handler + raise FormatDecodeError.new("Unknown encodingStyle: #{ encodingstyle }.") + end + node = decode_tag(ns, name, attrs, parent, handler) + if @recycleframe + @parsestack << @recycleframe.update(ns, name, node, encodingstyle, handler) + @recycleframe = nil + else + @parsestack << ParseFrame.new(ns, name, node, encodingstyle, handler) + end + end + + def characters(text) + # Ignore Text outside of SOAP Envelope. + if lastframe = @parsestack.last + # Need not to be cloned because character does not have attr. + decode_text(lastframe.ns, text, lastframe.handler) + end + end + + def end_element(name) + lastframe = @parsestack.pop + unless name == lastframe.name + raise UnexpectedElementError.new("Closing element name '#{ name }' does not match with opening element '#{ lastframe.name }'.") + end + decode_tag_end(lastframe.ns, lastframe.node, lastframe.handler) + @lastnode = lastframe.node.node + @recycleframe = lastframe + end + +private + + def decode_tag(ns, name, attrs, parent, handler) + ele = ns.parse(name) + # Envelope based parsing. + if ((ele.namespace == @envelopenamespace) || + (@allow_unqualified_element && ele.namespace.nil?)) + o = decode_soap_envelope(ns, ele, attrs, parent) + return o if o + end + # Encoding based parsing. + return handler.decode_tag(ns, ele, attrs, parent) + end + + def decode_tag_end(ns, node, handler) + return handler.decode_tag_end(ns, node) + end + + def decode_attrs(ns, attrs) + extraattr = {} + attrs.each do |key, value| + qname = ns.parse_local(key) + extraattr[qname] = value + end + extraattr + end + + def decode_text(ns, text, handler) + handler.decode_text(ns, text) + end + + def decode_soap_envelope(ns, ele, attrs, parent) + o = nil + if ele.name == EleEnvelope + o = SOAPEnvelope.new + if ext = @opt[:external_content] + ext.each do |k, v| + o.external_content[k] = v + end + end + elsif ele.name == EleHeader + return nil unless parent.node.is_a?(SOAPEnvelope) + o = SOAPHeader.new + parent.node.header = o + elsif ele.name == EleBody + return nil unless parent.node.is_a?(SOAPEnvelope) + o = SOAPBody.new + parent.node.body = o + elsif ele.name == EleFault + if parent.node.is_a?(SOAPBody) + o = SOAPFault.new + parent.node.fault = o + elsif parent.node.is_a?(SOAPEnvelope) + # live.com server returns SOAPFault as a direct child of SOAPEnvelope. + # support it even if it's not spec compliant. + warn("Fault must be a child of Body.") + body = SOAPBody.new + parent.node.body = body + o = SOAPFault.new + body.fault = o + else + return nil + end + end + o.extraattr.update(attrs) if o + o + end + + def find_handler(encodingstyle) + unless @handlers.key?(encodingstyle) + handler_factory = SOAP::EncodingStyle::Handler.handler(encodingstyle) || + SOAP::EncodingStyle::Handler.handler(EncodingNamespace) + handler = handler_factory.new(@parser.charset) + handler.decode_typemap = @decode_typemap + handler.decode_prologue + @handlers[encodingstyle] = handler + end + @handlers[encodingstyle] + end +end + + +end diff --git a/lib/soap/processor.rb b/lib/soap/processor.rb new file mode 100644 index 0000000..c78fc5d --- /dev/null +++ b/lib/soap/processor.rb @@ -0,0 +1,66 @@ +# SOAP4R - marshal/unmarshal interface. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/datatypes' +require 'soap/soap' +require 'soap/element' +require 'soap/parser' +require 'soap/generator' +require 'soap/encodingstyle/soapHandler' +require 'soap/encodingstyle/literalHandler' +require 'soap/encodingstyle/aspDotNetHandler' + + +module SOAP + + +module Processor + @@default_parser_option = {} + + class << self + public + + def marshal(env, opt = {}, io = nil) + generator = create_generator(opt) + marshalled_str = generator.generate(env, io) + unless env.external_content.empty? + opt[:external_content] = env.external_content + end + marshalled_str + end + + def unmarshal(stream, opt = {}) + parser = create_parser(opt) + parser.parse(stream) + end + + def default_parser_option=(rhs) + @@default_parser_option = rhs + end + + def default_parser_option + @@default_parser_option + end + + private + + def create_generator(opt) + Generator.new(opt) + end + + def create_parser(opt) + if opt.empty? + opt = @@default_parser_option + end + ::SOAP::Parser.new(opt) + end + end +end + + +end diff --git a/lib/soap/property.rb b/lib/soap/property.rb new file mode 100644 index 0000000..4ee94f2 --- /dev/null +++ b/lib/soap/property.rb @@ -0,0 +1,333 @@ +# soap/property.rb: SOAP4R - Property implementation. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module SOAP + + +# Property stream format: +# +# line separator is \r?\n. 1 line per a property. +# line which begins with '#' is a comment line. empty line is ignored, too. +# key/value separator is ':' or '='. +# '\' as escape character. but line separator cannot be escaped. +# \s at the head/tail of key/value are trimmed. +# +# '[' + key + ']' indicates property section. for example, +# +# [aaa.bbb] +# ccc = ddd +# eee.fff = ggg +# [] +# aaa.hhh = iii +# +# is the same as; +# +# aaa.bbb.ccc = ddd +# aaa.bbb.eee.fff = ggg +# aaa.hhh = iii +# +class Property + FrozenError = (RUBY_VERSION >= "1.9.0") ? RuntimeError : TypeError + + include Enumerable + + module Util + def const_from_name(fqname) + fqname.split("::").inject(Kernel) { |klass, name| klass.const_get(name) } + end + module_function :const_from_name + + def require_from_name(fqname) + require File.join(fqname.split("::").collect { |ele| ele.downcase }) + end + module_function :require_from_name + end + + def self.load(stream) + new.load(stream) + end + + def self.loadproperty(propname) + new.loadproperty(propname) + end + + def initialize + @store = Hash.new + @hook = Hash.new + @self_hook = Array.new + @locked = false + end + + KEY_REGSRC = '([^=:\\\\]*(?:\\\\.[^=:\\\\]*)*)' + DEF_REGSRC = '\\s*' + KEY_REGSRC + '\\s*[=:]\\s*(.*)' + COMMENT_REGEXP = Regexp.new("^(?:#.*|)$") + CATDEF_REGEXP = Regexp.new("^\\[\\s*#{KEY_REGSRC}\\s*\\]$") + LINE_REGEXP = Regexp.new("^#{DEF_REGSRC}$") + def load(stream) + key_prefix = "" + stream.each_line.each_with_index do |line, lineno| + line.sub!(/\r?\n\z/u, '') + case line + when COMMENT_REGEXP + next + when CATDEF_REGEXP + key_prefix = $1.strip + when LINE_REGEXP + key, value = $1.strip, $2.strip + key = "#{key_prefix}.#{key}" unless key_prefix.empty? + key, value = loadstr(key), loadstr(value) + self[key] = value + else + raise TypeError.new( + "property format error at line #{lineno + 1}: `#{line}'") + end + end + self + end + + # find property from $:. + def loadproperty(propname) + return loadpropertyfile(propname) if File.file?(propname) + $:.each do |path| + if File.file?(file = File.join(path, propname)) + return loadpropertyfile(file) + end + end + nil + end + + # name: a Symbol, String or an Array + def [](name) + referent(name_to_a(name)) + end + + # name: a Symbol, String or an Array + # value: an Object + def []=(name, value) + name_pair = name_to_a(name).freeze + hooks = assign(name_pair, value) + hooks.each do |hook| + hook.call(name_pair, value) + end + value + end + + # value: an Object + # key is generated by property + def <<(value) + self[generate_new_key] = value + end + + # name: a Symbol, String or an Array; nil means hook to the root + # cascade: true/false; for cascading hook of sub key + # hook: block which will be called with 2 args, name and value + def add_hook(name = nil, cascade = false, &hook) + if name == nil or name == true or name == false + cascade = name + assign_self_hook(cascade, &hook) + else + assign_hook(name_to_a(name), cascade, &hook) + end + end + + def each + @store.each do |key, value| + yield(key, value) + end + end + + def empty? + @store.empty? + end + + def keys + @store.keys + end + + def values + @store.values + end + + def lock(cascade = false) + if cascade + each_key do |key| + key.lock(cascade) + end + end + @locked = true + self + end + + def unlock(cascade = false) + @locked = false + if cascade + each_key do |key| + key.unlock(cascade) + end + end + self + end + + def locked? + @locked + end + +protected + + def deref_key(key) + check_lock(key) + ref = @store[key] ||= self.class.new + unless propkey?(ref) + raise ArgumentError.new("key `#{key}' already defined as a value") + end + ref + end + + def local_referent(key) + check_lock(key) + if propkey?(@store[key]) and @store[key].locked? + raise FrozenError.new("cannot split any key from locked property") + end + @store[key] + end + + def local_assign(key, value) + check_lock(key) + if @locked + if propkey?(value) + raise FrozenError.new("cannot add any key to locked property") + elsif propkey?(@store[key]) + raise FrozenError.new("cannot override any key in locked property") + end + end + @store[key] = value + end + + def local_hook(key, direct) + hooks = [] + (@self_hook + (@hook[key] || NO_HOOK)).each do |hook, cascade| + hooks << hook if direct or cascade + end + hooks + end + + def local_assign_hook(key, cascade, &hook) + check_lock(key) + @store[key] ||= nil + (@hook[key] ||= []) << [hook, cascade] + end + +private + + NO_HOOK = [].freeze + + def referent(ary) + ary[0..-2].inject(self) { |ref, name| + ref.deref_key(to_key(name)) + }.local_referent(to_key(ary.last)) + end + + def assign(ary, value) + ref = self + hook = NO_HOOK + ary[0..-2].each do |name| + key = to_key(name) + hook += ref.local_hook(key, false) + ref = ref.deref_key(key) + end + last_key = to_key(ary.last) + ref.local_assign(last_key, value) + hook + ref.local_hook(last_key, true) + end + + def assign_hook(ary, cascade, &hook) + ary[0..-2].inject(self) { |ref, name| + ref.deref_key(to_key(name)) + }.local_assign_hook(to_key(ary.last), cascade, &hook) + end + + def assign_self_hook(cascade, &hook) + check_lock(nil) + @self_hook << [hook, cascade] + end + + def each_key + self.each do |key, value| + if propkey?(value) + yield(value) + end + end + end + + def check_lock(key) + if @locked and (key.nil? or !@store.key?(key)) + raise FrozenError.new("cannot add any key to locked property") + end + end + + def propkey?(value) + value.is_a?(::SOAP::Property) + end + + def name_to_a(name) + case name + when Symbol + [name] + when String + name.scan(/[^.\\]+(?:\\.[^.\\])*/u) # split with unescaped '.' + when Array + name + else + raise ArgumentError.new("Unknown name #{name}(#{name.class})") + end + end + + def to_key(name) + name.to_s.downcase + end + + def generate_new_key + if @store.empty? + "0" + else + (key_max + 1).to_s + end + end + + def key_max + (@store.keys.max { |l, r| l.to_s.to_i <=> r.to_s.to_i }).to_s.to_i + end + + def loadpropertyfile(file) + puts "find property at #{file}" if $DEBUG + File.open(file) do |f| + load(f) + end + end + + def loadstr(str) + str.gsub(/\\./u) { |c| eval("\"#{c}\"") } + end +end + + +end + + +# for ruby/1.6. +unless Enumerable.instance_methods.include?('inject') + module Enumerable + def inject(init) + result = init + each do |item| + result = yield(result, item) + end + result + end + end +end diff --git a/lib/soap/proxy.rb b/lib/soap/proxy.rb new file mode 100644 index 0000000..35ac400 --- /dev/null +++ b/lib/soap/proxy.rb @@ -0,0 +1,14 @@ +# SOAP4R - Proxy library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/rpc/proxy' + + +module SOAP + SOAPProxy = RPC::Proxy +end diff --git a/lib/soap/rpc/cgistub.rb b/lib/soap/rpc/cgistub.rb new file mode 100644 index 0000000..233f59f --- /dev/null +++ b/lib/soap/rpc/cgistub.rb @@ -0,0 +1,247 @@ +# SOAP4R - CGI/mod_ruby stub library +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/streamHandler' +require 'webrick/httpresponse' +require 'webrick/httpstatus' +require 'logger' +require 'soap/rpc/soaplet' + + +module SOAP +module RPC + + +### +# SYNOPSIS +# CGIStub.new +# +# DESCRIPTION +# To be written... +# +class CGIStub < Logger::Application + include SOAP + include WEBrick + + class SOAPRequest + attr_reader :body + + def [](var); end + + def meta_vars; end + + EMPTY_COOKIES = [].freeze + def cookies; EMPTY_COOKIES; end + + def user; end + end + + class SOAPStdinRequest < SOAPRequest + attr_reader :body + + def initialize(stream) + size = ENV['CONTENT_LENGTH'].to_i || 0 + @body = stream.read(size) + end + + def [](var) + ENV[var.gsub(/-/, '_').upcase] + end + + def meta_vars + { + 'HTTP_SOAPACTION' => ENV['HTTP_SOAPAction'] + } + end + + def cookies + if cookie = ENV['HTTP_Cookie'] || ENV['Cookie'] + [WEBrick::Cookie.parse(cookie)] + else + EMPTY_COOKIES + end + end + + def user + ENV['REMOTE_USER'] + end + end + + class SOAPFCGIRequest < SOAPRequest + attr_reader :body + + def initialize(request) + @request = request + @body = @request.in.read + end + + def [](var) + @request.env[var.gsub(/-/, '_').upcase] + end + + def meta_vars + { + 'HTTP_SOAPACTION' => @request.env['HTTP_SOAPAction'] + } + end + + def cookies + if cookie = @request.env['HTTP_Cookie'] || @request.env['Cookie'] + [WEBrick::Cookie.parse(cookie)] + else + EMPTY_COOKIES + end + end + + def user + @request.env['REMOTE_USER'] + end + end + + def initialize(appname, default_namespace) + super(appname) + set_log(STDERR) + self.level = ERROR + @default_namespace = default_namespace + @remote_host = ENV['REMOTE_HOST'] || ENV['REMOTE_ADDR'] || 'unknown' + @router = ::SOAP::RPC::Router.new(self.class.name) + @soaplet = ::SOAP::RPC::SOAPlet.new(@router) + on_init + end + + def on_init + # do extra initialization in a derived class if needed. + end + + def mapping_registry + @router.mapping_registry + end + + def mapping_registry=(mapping_registry) + @router.mapping_registry = mapping_registry + end + + def literal_mapping_registry + @router.literal_mapping_registry + end + + def literal_mapping_registry=(literal_mapping_registry) + @router.literal_mapping_registry = literal_mapping_registry + end + + def generate_explicit_type + @router.generate_explicit_type + end + + def generate_explicit_type=(generate_explicit_type) + @router.generate_explicit_type = generate_explicit_type + end + + # servant entry interface + + def add_rpc_servant(obj, namespace = @default_namespace) + @router.add_rpc_servant(obj, namespace) + end + alias add_servant add_rpc_servant + + def add_headerhandler(obj) + @router.add_headerhandler(obj) + end + alias add_rpc_headerhandler add_headerhandler + + def filterchain + @router.filterchain + end + + # method entry interface + + def add_rpc_method(obj, name, *param) + add_rpc_method_with_namespace_as(@default_namespace, obj, name, name, *param) + end + alias add_method add_rpc_method + + def add_rpc_method_as(obj, name, name_as, *param) + add_rpc_method_with_namespace_as(@default_namespace, obj, name, name_as, *param) + end + alias add_method_as add_rpc_method_as + + def add_rpc_method_with_namespace(namespace, obj, name, *param) + add_rpc_method_with_namespace_as(namespace, obj, name, name, *param) + end + alias add_method_with_namespace add_rpc_method_with_namespace + + def add_rpc_method_with_namespace_as(namespace, obj, name, name_as, *param) + qname = XSD::QName.new(namespace, name_as) + soapaction = nil + param_def = SOAPMethod.derive_rpc_param_def(obj, name, *param) + @router.add_rpc_operation(obj, qname, soapaction, name, param_def) + end + alias add_method_with_namespace_as add_rpc_method_with_namespace_as + + def add_rpc_operation(receiver, qname, soapaction, name, param_def, opt = {}) + @router.add_rpc_operation(receiver, qname, soapaction, name, param_def, opt) + end + + def add_document_operation(receiver, soapaction, name, param_def, opt = {}) + @router.add_document_operation(receiver, soapaction, name, param_def, opt) + end + + def set_fcgi_request(request) + @fcgi = request + end + +private + + HTTPVersion = WEBrick::HTTPVersion.new('1.0') # dummy; ignored + + def run + res = WEBrick::HTTPResponse.new({:HTTPVersion => HTTPVersion}) + begin + @log.info { "received a request from '#{ @remote_host }'" } + if @fcgi + req = SOAPFCGIRequest.new(@fcgi) + else + req = SOAPStdinRequest.new($stdin) + end + @soaplet.do_POST(req, res) + rescue HTTPStatus::EOFError, HTTPStatus::RequestTimeout => ex + res.set_error(ex) + rescue HTTPStatus::Error => ex + res.set_error(ex) + rescue HTTPStatus::Status => ex + res.status = ex.code + rescue StandardError, NameError => ex # for Ruby 1.6 + res.set_error(ex, true) + ensure + if defined?(MOD_RUBY) + r = Apache.request + r.status = res.status + r.content_type = res.content_type + r.send_http_header + buf = res.body + else + buf = '' + res.send_response(buf) + buf.sub!(/^[^\r]+\r\n/, '') # Trim status line. + end + @log.debug { "SOAP CGI Response:\n#{ buf }" } + if @fcgi + @fcgi.out.print buf + @fcgi.finish + @fcgi = nil + else + print buf + end + end + 0 + end +end + + +end +end diff --git a/lib/soap/rpc/driver.rb b/lib/soap/rpc/driver.rb new file mode 100644 index 0000000..30c595c --- /dev/null +++ b/lib/soap/rpc/driver.rb @@ -0,0 +1,221 @@ +# SOAP4R - SOAP RPC driver +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/soap' +require 'soap/attrproxy' +require 'soap/mapping' +require 'soap/rpc/rpc' +require 'soap/rpc/proxy' +require 'soap/rpc/element' +require 'soap/streamHandler' +require 'soap/property' +require 'soap/header/handlerset' + + +module SOAP +module RPC + + +class Driver + include AttrProxy + + attr_proxy :endpoint_url, true + attr_proxy :mapping_registry, true + attr_proxy :literal_mapping_registry, true + attr_proxy :allow_unqualified_element, true + attr_proxy :default_encodingstyle, true + attr_proxy :generate_explicit_type, true + attr_proxy :use_default_namespace, true + attr_proxy :return_response_as_xml, true + attr_proxy :headerhandler + attr_proxy :filterchain + attr_proxy :streamhandler + attr_proxy :test_loopback_response + attr_proxy :reset_stream + + attr_reader :proxy + attr_reader :options + attr_accessor :soapaction + + def inspect + "#<#{self.class}:#{@proxy.inspect}>" + end + + def httpproxy + options["protocol.http.proxy"] + end + + def httpproxy=(httpproxy) + options["protocol.http.proxy"] = httpproxy + end + + def wiredump_dev + options["protocol.http.wiredump_dev"] + end + + def wiredump_dev=(wiredump_dev) + options["protocol.http.wiredump_dev"] = wiredump_dev + end + + def mandatorycharset + options["protocol.mandatorycharset"] + end + + def mandatorycharset=(mandatorycharset) + options["protocol.mandatorycharset"] = mandatorycharset + end + + def wiredump_file_base + options["protocol.wiredump_file_base"] + end + + def wiredump_file_base=(wiredump_file_base) + options["protocol.wiredump_file_base"] = wiredump_file_base + end + + def initialize(endpoint_url, namespace = nil, soapaction = nil) + @namespace = namespace + @soapaction = soapaction + @options = setup_options + @wiredump_file_base = nil + @proxy = Proxy.new(endpoint_url, @soapaction, @options) + end + + def loadproperty(propertyname) + unless options.loadproperty(propertyname) + raise LoadError.new("No such property to load -- #{propertyname}") + end + end + + def add_rpc_method(name, *params) + add_rpc_method_with_soapaction_as(name, name, @soapaction, *params) + end + + def add_rpc_method_as(name, name_as, *params) + add_rpc_method_with_soapaction_as(name, name_as, @soapaction, *params) + end + + def add_rpc_method_with_soapaction(name, soapaction, *params) + add_rpc_method_with_soapaction_as(name, name, soapaction, *params) + end + + def add_rpc_method_with_soapaction_as(name, name_as, soapaction, *params) + param_def = SOAPMethod.create_rpc_param_def(params) + qname = XSD::QName.new(@namespace, name_as) + @proxy.add_rpc_method(qname, soapaction, name, param_def) + add_rpc_method_interface(name, param_def) + end + + # add_method is for shortcut of typical rpc/encoded method definition. + alias add_method add_rpc_method + alias add_method_as add_rpc_method_as + alias add_method_with_soapaction add_rpc_method_with_soapaction + alias add_method_with_soapaction_as add_rpc_method_with_soapaction_as + + def add_document_method(name, soapaction, req_qname, res_qname) + param_def = SOAPMethod.create_doc_param_def(req_qname, res_qname) + @proxy.add_document_method(soapaction, name, param_def) + add_document_method_interface(name, param_def) + end + + def add_rpc_operation(qname, soapaction, name, param_def, opt = {}) + @proxy.add_rpc_operation(qname, soapaction, name, param_def, opt) + add_rpc_method_interface(name, param_def) + end + + def add_document_operation(soapaction, name, param_def, opt = {}) + @proxy.add_document_operation(soapaction, name, param_def, opt) + add_document_method_interface(name, param_def) + end + + def invoke(headers, body) + if headers and !headers.is_a?(SOAPHeader) + headers = create_header(headers) + end + set_wiredump_file_base(body.elename.name) + env = @proxy.invoke(headers, body) + if env.nil? + return nil, nil + else + return env.header, env.body + end + end + + def call(name, *params) + set_wiredump_file_base(name) + @proxy.call(name, *params) + end + +private + + def attrproxy + @proxy + end + + def set_wiredump_file_base(name) + if @wiredump_file_base + @proxy.set_wiredump_file_base("#{@wiredump_file_base}_#{name}") + end + end + + def create_header(headers) + header = SOAPHeader.new() + headers.each do |content, mustunderstand, encodingstyle| + header.add(SOAPHeaderItem.new(content, mustunderstand, encodingstyle)) + end + header + end + + def setup_options + if opt = Property.loadproperty(::SOAP::PropertyName) + opt = opt["client"] + end + opt ||= Property.new + opt.add_hook("protocol.mandatorycharset") do |key, value| + @proxy.mandatorycharset = value + end + opt.add_hook("protocol.wiredump_file_base") do |key, value| + @wiredump_file_base = value + end + opt["protocol.http.charset"] ||= XSD::Charset.xml_encoding_label + opt["protocol.http.proxy"] ||= Env::HTTP_PROXY + opt["protocol.http.no_proxy"] ||= Env::NO_PROXY + opt + end + + def add_rpc_method_interface(name, param_def) + param_count = RPC::SOAPMethod.param_count(param_def, + RPC::SOAPMethod::IN, RPC::SOAPMethod::INOUT) + add_method_interface(name, param_count) + end + + def add_document_method_interface(name, param_def) + param_count = RPC::SOAPMethod.param_count(param_def, RPC::SOAPMethod::IN) + add_method_interface(name, param_count) + end + + # Mapping.define_singleton_method calls define_method with proc and it + # exhausts much memory for each singleton Object. just instance_eval instead + # of it. + def add_method_interface(name, param_count) + instance_eval <<-EOS + def #{name}(*arg) + unless arg.size == #{param_count} + raise ArgumentError.new( + "wrong number of arguments (\#{arg.size} for #{param_count})") + end + call(#{name.dump}, *arg) + end + EOS + self.method(name) + end +end + + +end +end diff --git a/lib/soap/rpc/element.rb b/lib/soap/rpc/element.rb new file mode 100644 index 0000000..9c4c5a5 --- /dev/null +++ b/lib/soap/rpc/element.rb @@ -0,0 +1,374 @@ +# SOAP4R - RPC element definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/baseData' +require 'soap/rpc/methodDef' + + +module SOAP + +# Add method definitions for RPC to common definition in element.rb +class SOAPBody < SOAPStruct + public + + def request + root_node + end + + def response + root = root_node + if !@is_fault + if root.nil? + nil + elsif root.is_a?(SOAPBasetype) + root + else + # Initial element is [retval]. + root[0] + end + else + root + end + end + + def outparams + root = root_node + if !@is_fault and !root.nil? and !root.is_a?(SOAPBasetype) + op = root[1..-1] + op = nil if op && op.empty? + op + else + nil + end + end + + def fault + if @is_fault + self['fault'] + else + nil + end + end + + def fault=(fault) + @is_fault = true + add('fault', fault) + end +end + + +module RPC + + +class RPCError < Error; end +class MethodDefinitionError < RPCError; end +class ParameterError < RPCError; end + +class SOAPMethod < SOAPStruct + RETVAL = :retval + IN = :in + OUT = :out + INOUT = :inout + + attr_reader :param_def + attr_reader :inparam + attr_reader :outparam + attr_reader :retval_name + attr_reader :retval_class_name + + def initialize(qname, param_def = nil) + super(nil) + @elename = qname + @encodingstyle = nil + + @param_def = param_def + + @signature = [] + @inparam_names = [] + @inoutparam_names = [] + @outparam_names = [] + + @inparam = {} + @outparam = {} + @retval_name = nil + @retval_class_name = nil + + init_params(@param_def) if @param_def + end + + def have_member + true + end + + def have_outparam? + @outparam_names.size > 0 + end + + def input_params + collect_params(IN, INOUT) + end + + def output_params + collect_params(OUT, INOUT) + end + + def input_param_types + collect_param_types(IN, INOUT) + end + + def output_param_types + collect_param_types(OUT, INOUT) + end + + def set_param(params) + params.each do |param, data| + @inparam[param] = data + data.elename = XSD::QName.new(data.elename.namespace, param) + data.parent = self + end + end + + def set_outparam(params) + params.each do |param, data| + @outparam[param] = data + data.elename = XSD::QName.new(data.elename.namespace, param) + end + end + + def get_paramtypes(names) + types = [] + @signature.each do |io_type, name, type_qname| + if type_qname && idx = names.index(name) + types[idx] = type_qname + end + end + types + end + + def SOAPMethod.param_count(param_def, *type) + count = 0 + param_def.each do |param| + param = MethodDef.to_param(param) + if type.include?(param.io_type.to_sym) + count += 1 + end + end + count + end + + def SOAPMethod.derive_rpc_param_def(obj, name, *param) + if param.size == 1 and param[0].is_a?(Array) + return param[0] + end + if param.empty? + method = obj.method(name) + param_names = (1..method.arity.abs).collect { |i| "p#{i}" } + else + param_names = param + end + create_rpc_param_def(param_names) + end + + def SOAPMethod.create_rpc_param_def(param_names) + param_def = [] + param_names.each do |param_name| + param_def.push([IN, param_name, nil]) + end + param_def.push([RETVAL, 'return', nil]) + param_def + end + + def SOAPMethod.create_doc_param_def(req_qnames, res_qnames) + req_qnames = [req_qnames] if req_qnames.is_a?(XSD::QName) + res_qnames = [res_qnames] if res_qnames.is_a?(XSD::QName) + param_def = [] + # req_qnames and res_qnames can be nil + if req_qnames + req_qnames.each do |qname| + param_def << [IN, qname.name, [nil, qname.namespace, qname.name]] + end + end + if res_qnames + res_qnames.each do |qname| + param_def << [OUT, qname.name, [nil, qname.namespace, qname.name]] + end + end + param_def + end + +private + + def collect_param_types(*type) + names = [] + @signature.each do |io_type, name, type_qname| + names << type_qname if type.include?(io_type) + end + names + end + + def collect_params(*type) + names = [] + @signature.each do |io_type, name, type_qname| + names << name if type.include?(io_type) + end + names + end + + def init_params(param_def) + param_def.each do |param| + param = MethodDef.to_param(param) + init_param(param) + end + end + + def init_param(param) + mapped_class = SOAPMethod.parse_mapped_class(param.mapped_class) + qname = param.qname + if qname.nil? and mapped_class + qname = TypeMap.key(mapped_class) + end + case param.io_type + when IN + @signature.push([IN, param.name, qname]) + @inparam_names.push(param.name) + when OUT + @signature.push([OUT, param.name, qname]) + @outparam_names.push(param.name) + when INOUT + @signature.push([INOUT, param.name, qname]) + @inoutparam_names.push(param.name) + when RETVAL + if @retval_name + raise MethodDefinitionError.new('duplicated retval') + end + @retval_name = param.name + @retval_class_name = mapped_class + else + raise MethodDefinitionError.new("unknown type: #{param.io_type}") + end + end + + def self.parse_mapped_class(mapped_class) + # the first element of typedef in param_def can be a String like + # "::SOAP::SOAPStruct" or "CustomClass[]". turn this String to a class if + # we can. + if mapped_class.is_a?(String) + if /\[\]\Z/ =~ mapped_class + # when '[]' is added, ignore this. + mapped_class = nil + else + mapped_class = Mapping.class_from_name(mapped_class) + end + end + mapped_class + end +end + + +class SOAPMethodRequest < SOAPMethod + attr_accessor :soapaction + + def SOAPMethodRequest.create_request(qname, *params) + param_def = [] + param_value = [] + i = 0 + params.each do |param| + param_name = "p#{i}" + i += 1 + param_def << [IN, param_name, nil] + param_value << [param_name, param] + end + param_def << [RETVAL, 'return', nil] + o = new(qname, param_def) + o.set_param(param_value) + o + end + + def initialize(qname, param_def = nil, soapaction = nil) + super(qname, param_def) + @soapaction = soapaction + end + + def each + input_params.each do |name| + unless @inparam[name] + raise ParameterError.new("parameter: #{name} was not given") + end + yield(name, @inparam[name]) + end + end + + def dup + req = self.class.new(@elename.dup, @param_def, @soapaction) + req.encodingstyle = @encodingstyle + req + end + + def create_method_response(response_name = nil) + response_name ||= + XSD::QName.new(@elename.namespace, @elename.name + 'Response') + SOAPMethodResponse.new(response_name, @param_def) + end +end + + +class SOAPMethodResponse < SOAPMethod + + def initialize(qname, param_def = nil) + super(qname, param_def) + @retval = nil + end + + def retval + @retval + end + + def retval=(retval) + @retval = retval + @retval.elename = @retval.elename.dup_name(@retval_name || 'return') + retval.parent = self + retval + end + + def each + if @retval_name and !@retval.is_a?(SOAPVoid) + yield(@retval_name, @retval) + end + + output_params.each do |name| + unless @outparam[name] + raise ParameterError.new("parameter: #{name} was not given") + end + yield(name, @outparam[name]) + end + end +end + + +# To return(?) void explicitly. +# def foo(input_var) +# ... +# return SOAP::RPC::SOAPVoid.new +# end +class SOAPVoid < XSD::XSDAnySimpleType + include SOAPBasetype + extend SOAPModuleUtils + Name = XSD::QName.new(Mapping::RubyCustomTypeNamespace, nil) + +public + def initialize() + @elename = Name + @id = nil + @precedents = [] + @parent = nil + end +end + + +end +end diff --git a/lib/soap/rpc/element.rb.orig b/lib/soap/rpc/element.rb.orig new file mode 100644 index 0000000..93b019a --- /dev/null +++ b/lib/soap/rpc/element.rb.orig @@ -0,0 +1,374 @@ +# SOAP4R - RPC element definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/baseData' +require 'soap/rpc/methodDef' + + +module SOAP + +# Add method definitions for RPC to common definition in element.rb +class SOAPBody < SOAPStruct + public + + def request + root_node + end + + def response + root = root_node + if !@is_fault + if root.nil? + nil + elsif root.is_a?(SOAPBasetype) + root + else + # Initial element is [retval]. + root[0] + end + else + root + end + end + + def outparams + root = root_node + if !@is_fault and !root.nil? and !root.is_a?(SOAPBasetype) + op = root[1..-1] + op = nil if op && op.empty? + op + else + nil + end + end + + def fault + if @is_fault + self['fault'] + else + nil + end + end + + def fault=(fault) + @is_fault = true + add('fault', fault) + end +end + + +module RPC + + +class RPCError < Error; end +class MethodDefinitionError < RPCError; end +class ParameterError < RPCError; end + +class SOAPMethod < SOAPStruct + RETVAL = :retval + IN = :in + OUT = :out + INOUT = :inout + + attr_reader :param_def + attr_reader :inparam + attr_reader :outparam + attr_reader :retval_name + attr_reader :retval_class_name + + def initialize(qname, param_def = nil) + super(nil) + @elename = qname + @encodingstyle = nil + + @param_def = param_def + + @signature = [] + @inparam_names = [] + @inoutparam_names = [] + @outparam_names = [] + + @inparam = {} + @outparam = {} + @retval_name = nil + @retval_class_name = nil + + init_params(@param_def) if @param_def + end + + def have_member + true + end + + def have_outparam? + @outparam_names.size > 0 + end + + def input_params + collect_params(IN, INOUT) + end + + def output_params + collect_params(OUT, INOUT) + end + + def input_param_types + collect_param_types(IN, INOUT) + end + + def output_param_types + collect_param_types(OUT, INOUT) + end + + def set_param(params) + params.each do |param, data| + @inparam[param] = data + data.elename = XSD::QName.new(data.elename.namespace, param) + data.parent = self + end + end + + def set_outparam(params) + params.each do |param, data| + @outparam[param] = data + data.elename = XSD::QName.new(data.elename.namespace, param) + end + end + + def get_paramtypes(names) + types = [] + @signature.each do |io_type, name, type_qname| + if type_qname && idx = names.index(name) + types[idx] = type_qname + end + end + types + end + + def SOAPMethod.param_count(param_def, *type) + count = 0 + param_def.each do |param| + param = MethodDef.to_param(param) + if type.include?(param.io_type.to_sym) + count += 1 + end + end + count + end + + def SOAPMethod.derive_rpc_param_def(obj, name, *param) + if param.size == 1 and param[0].is_a?(Array) + return param[0] + end + if param.empty? + method = obj.method(name) + param_names = (1..method.arity.abs).collect { |i| "p#{i}" } + else + param_names = param + end + create_rpc_param_def(param_names) + end + + def SOAPMethod.create_rpc_param_def(param_names) + param_def = [] + param_names.each do |param_name| + param_def.push([IN, param_name, nil]) + end + param_def.push([RETVAL, 'return', nil]) + param_def + end + + def SOAPMethod.create_doc_param_def(req_qnames, res_qnames) + req_qnames = [req_qnames] if req_qnames.is_a?(XSD::QName) + res_qnames = [res_qnames] if res_qnames.is_a?(XSD::QName) + param_def = [] + # req_qnames and res_qnames can be nil + if req_qnames + req_qnames.each do |qname| + param_def << [IN, qname.name, [nil, qname.namespace, qname.name]] + end + end + if res_qnames + res_qnames.each do |qname| + param_def << [OUT, qname.name, [nil, qname.namespace, qname.name]] + end + end + param_def + end + +private + + def collect_param_types(*type) + names = [] + @signature.each do |io_type, name, type_qname| + names << type_qname if type.include?(io_type) + end + names + end + + def collect_params(*type) + names = [] + @signature.each do |io_type, name, type_qname| + names << name if type.include?(io_type) + end + names + end + + def init_params(param_def) + param_def.each do |param| + param = MethodDef.to_param(param) + init_param(param) + end + end + + def init_param(param) + mapped_class = SOAPMethod.parse_mapped_class(param.mapped_class) + qname = param.qname + if qname.nil? and mapped_class + qname = TypeMap.index(mapped_class) + end + case param.io_type + when IN + @signature.push([IN, param.name, qname]) + @inparam_names.push(param.name) + when OUT + @signature.push([OUT, param.name, qname]) + @outparam_names.push(param.name) + when INOUT + @signature.push([INOUT, param.name, qname]) + @inoutparam_names.push(param.name) + when RETVAL + if @retval_name + raise MethodDefinitionError.new('duplicated retval') + end + @retval_name = param.name + @retval_class_name = mapped_class + else + raise MethodDefinitionError.new("unknown type: #{param.io_type}") + end + end + + def self.parse_mapped_class(mapped_class) + # the first element of typedef in param_def can be a String like + # "::SOAP::SOAPStruct" or "CustomClass[]". turn this String to a class if + # we can. + if mapped_class.is_a?(String) + if /\[\]\Z/ =~ mapped_class + # when '[]' is added, ignore this. + mapped_class = nil + else + mapped_class = Mapping.class_from_name(mapped_class) + end + end + mapped_class + end +end + + +class SOAPMethodRequest < SOAPMethod + attr_accessor :soapaction + + def SOAPMethodRequest.create_request(qname, *params) + param_def = [] + param_value = [] + i = 0 + params.each do |param| + param_name = "p#{i}" + i += 1 + param_def << [IN, param_name, nil] + param_value << [param_name, param] + end + param_def << [RETVAL, 'return', nil] + o = new(qname, param_def) + o.set_param(param_value) + o + end + + def initialize(qname, param_def = nil, soapaction = nil) + super(qname, param_def) + @soapaction = soapaction + end + + def each + input_params.each do |name| + unless @inparam[name] + raise ParameterError.new("parameter: #{name} was not given") + end + yield(name, @inparam[name]) + end + end + + def dup + req = self.class.new(@elename.dup, @param_def, @soapaction) + req.encodingstyle = @encodingstyle + req + end + + def create_method_response(response_name = nil) + response_name ||= + XSD::QName.new(@elename.namespace, @elename.name + 'Response') + SOAPMethodResponse.new(response_name, @param_def) + end +end + + +class SOAPMethodResponse < SOAPMethod + + def initialize(qname, param_def = nil) + super(qname, param_def) + @retval = nil + end + + def retval + @retval + end + + def retval=(retval) + @retval = retval + @retval.elename = @retval.elename.dup_name(@retval_name || 'return') + retval.parent = self + retval + end + + def each + if @retval_name and !@retval.is_a?(SOAPVoid) + yield(@retval_name, @retval) + end + + output_params.each do |name| + unless @outparam[name] + raise ParameterError.new("parameter: #{name} was not given") + end + yield(name, @outparam[name]) + end + end +end + + +# To return(?) void explicitly. +# def foo(input_var) +# ... +# return SOAP::RPC::SOAPVoid.new +# end +class SOAPVoid < XSD::XSDAnySimpleType + include SOAPBasetype + extend SOAPModuleUtils + Name = XSD::QName.new(Mapping::RubyCustomTypeNamespace, nil) + +public + def initialize() + @elename = Name + @id = nil + @precedents = [] + @parent = nil + end +end + + +end +end diff --git a/lib/soap/rpc/httpserver.rb b/lib/soap/rpc/httpserver.rb new file mode 100644 index 0000000..41e8f39 --- /dev/null +++ b/lib/soap/rpc/httpserver.rb @@ -0,0 +1,142 @@ +# SOAP4R - WEBrick HTTP Server +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'logger' +require 'soap/attrproxy' +require 'soap/rpc/soaplet' +require 'soap/streamHandler' +require 'webrick' + + +module SOAP +module RPC + + +class HTTPServer < Logger::Application + include AttrProxy + + attr_reader :server + attr_accessor :default_namespace + + attr_proxy :mapping_registry, true + attr_proxy :literal_mapping_registry, true + attr_proxy :generate_explicit_type, true + attr_proxy :use_default_namespace, true + + def initialize(config) + actor = config[:SOAPHTTPServerApplicationName] || self.class.name + super(actor) + @default_namespace = config[:SOAPDefaultNamespace] + @webrick_config = config.dup + self.level = Logger::Severity::ERROR # keep silent by default + @webrick_config[:Logger] ||= @log + @log = @webrick_config[:Logger] # sync logger of App and HTTPServer + @router = ::SOAP::RPC::Router.new(actor) + @soaplet = ::SOAP::RPC::SOAPlet.new(@router) + on_init + @server = WEBrick::HTTPServer.new(@webrick_config) + @server.mount('/soaprouter', @soaplet) + if wsdldir = config[:WSDLDocumentDirectory] + @server.mount('/wsdl', WEBrick::HTTPServlet::FileHandler, wsdldir) + end + @server.mount('/', @soaplet) + end + + def on_init + # do extra initialization in a derived class if needed. + end + + def status + @server.status if @server + end + + def shutdown + @server.shutdown if @server + end + + def authenticator + @soaplet.authenticator + end + + def authenticator=(authenticator) + @soaplet.authenticator = authenticator + end + + # servant entry interface + + def add_rpc_request_servant(factory, namespace = @default_namespace) + @router.add_rpc_request_servant(factory, namespace) + end + + def add_rpc_servant(obj, namespace = @default_namespace) + @router.add_rpc_servant(obj, namespace) + end + + def add_request_headerhandler(factory) + @router.add_request_headerhandler(factory) + end + + def add_headerhandler(obj) + @router.add_headerhandler(obj) + end + alias add_rpc_headerhandler add_headerhandler + + def filterchain + @router.filterchain + end + + # method entry interface + + def add_rpc_method(obj, name, *param) + add_rpc_method_as(obj, name, name, *param) + end + alias add_method add_rpc_method + + def add_rpc_method_as(obj, name, name_as, *param) + qname = XSD::QName.new(@default_namespace, name_as) + soapaction = nil + param_def = SOAPMethod.derive_rpc_param_def(obj, name, *param) + @router.add_rpc_operation(obj, qname, soapaction, name, param_def) + end + alias add_method_as add_rpc_method_as + + def add_document_method(obj, soapaction, name, req_qnames, res_qnames) + param_def = SOAPMethod.create_doc_param_def(req_qnames, res_qnames) + @router.add_document_operation(obj, soapaction, name, param_def) + end + + def add_rpc_operation(receiver, qname, soapaction, name, param_def, opt = {}) + @router.add_rpc_operation(receiver, qname, soapaction, name, param_def, opt) + end + + def add_rpc_request_operation(factory, qname, soapaction, name, param_def, opt = {}) + @router.add_rpc_request_operation(factory, qname, soapaction, name, param_def, opt) + end + + def add_document_operation(receiver, soapaction, name, param_def, opt = {}) + @router.add_document_operation(receiver, soapaction, name, param_def, opt) + end + + def add_document_request_operation(factory, soapaction, name, param_def, opt = {}) + @router.add_document_request_operation(factory, soapaction, name, param_def, opt) + end + +private + + def attrproxy + @router + end + + def run + @server.start + end +end + + +end +end diff --git a/lib/soap/rpc/methodDef.rb b/lib/soap/rpc/methodDef.rb new file mode 100644 index 0000000..3878a81 --- /dev/null +++ b/lib/soap/rpc/methodDef.rb @@ -0,0 +1,68 @@ +# SOAP4R - A method definition +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module SOAP +module RPC + + +class MethodDef + attr_reader :name + attr_reader :soapaction + attr_reader :qname + attr_accessor :style + attr_accessor :inputuse + attr_accessor :outputuse + attr_reader :parameters + attr_reader :faults + + def initialize(name, soapaction, qname) + @name = name + @soapaction = soapaction + @qname = qname + @style = @inputuse = @outputuse = nil + @parameters = [] + @faults = {} + end + + def add_parameter(io_type, name, qname, mapped_class) + @parameters << Parameter.new(io_type, name, qname, mapped_class) + end + + def self.to_param(param) + if param.respond_to?(:io_type) + param + else + io_type, name, param_type = param + mapped_class_str, nsdef, namedef = param_type + if nsdef && namedef + qname = XSD::QName.new(nsdef, namedef) + else + qname = nil + end + MethodDef::Parameter.new(io_type.to_sym, name, qname, mapped_class_str) + end + end + + class Parameter + attr_reader :io_type + attr_reader :name + attr_reader :qname + attr_reader :mapped_class + + def initialize(io_type, name, qname, mapped_class) + @io_type = io_type + @name = name + @qname = qname + @mapped_class = mapped_class + end + end +end + + +end +end diff --git a/lib/soap/rpc/proxy.rb b/lib/soap/rpc/proxy.rb new file mode 100644 index 0000000..f731ebf --- /dev/null +++ b/lib/soap/rpc/proxy.rb @@ -0,0 +1,572 @@ +# SOAP4R - RPC Proxy library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/soap' +require 'soap/processor' +require 'soap/mapping' +require 'soap/mapping/literalregistry' +require 'soap/rpc/rpc' +require 'soap/rpc/element' +require 'soap/header/handlerset' +require 'soap/filter' +require 'soap/streamHandler' +require 'soap/mimemessage' + + +module SOAP +module RPC + + +class Proxy + include SOAP + +public + + attr_accessor :soapaction + attr_accessor :mandatorycharset + attr_accessor :allow_unqualified_element + attr_accessor :default_encodingstyle + attr_accessor :generate_explicit_type + attr_accessor :use_default_namespace + attr_accessor :return_response_as_xml + attr_reader :headerhandler + attr_reader :filterchain + attr_reader :streamhandler + + attr_accessor :mapping_registry + attr_accessor :literal_mapping_registry + + attr_reader :operation + + def initialize(endpoint_url, soapaction, options) + @endpoint_url = endpoint_url + @soapaction = soapaction + @options = options + @protocol_option = options["protocol"] ||= ::SOAP::Property.new + initialize_streamhandler(@protocol_option) + @operation = {} + @operation_by_qname = {} + @operation_by_soapaction = {} + @mandatorycharset = nil + # TODO: set to false by default or drop thie option in 1.6.0 + @allow_unqualified_element = true + @default_encodingstyle = nil + @generate_explicit_type = nil + @use_default_namespace = false + @return_response_as_xml = false + @headerhandler = Header::HandlerSet.new + @filterchain = Filter::FilterChain.new + @mapping_registry = nil + @literal_mapping_registry = ::SOAP::Mapping::LiteralRegistry.new + end + + def inspect + "#<#{self.class}:#{@endpoint_url}>" + end + + def endpoint_url + @endpoint_url + end + + def endpoint_url=(endpoint_url) + @endpoint_url = endpoint_url + reset_stream + end + + def reset_stream + @streamhandler.reset(@endpoint_url) + end + + def set_wiredump_file_base(wiredump_file_base) + @streamhandler.wiredump_file_base = wiredump_file_base + end + + def test_loopback_response + @streamhandler.test_loopback_response + end + + def add_rpc_operation(qname, soapaction, name, param_def, opt = {}) + ensure_styleuse_option(opt, :rpc, :encoded) + opt[:request_qname] = qname + op = Operation.new(soapaction, param_def, opt) + assign_operation(name, qname, soapaction, op) + end + + def add_document_operation(soapaction, name, param_def, opt = {}) + ensure_styleuse_option(opt, :document, :literal) + op = Operation.new(soapaction, param_def, opt) + assign_operation(name, nil, soapaction, op) + end + + # add_method is for shortcut of typical rpc/encoded method definition. + alias add_method add_rpc_operation + alias add_rpc_method add_rpc_operation + alias add_document_method add_document_operation + + def invoke(req_header, req_body, opt = nil) + opt ||= create_encoding_opt + env = route(req_header, req_body, opt, opt) + if @return_response_as_xml + opt[:response_as_xml] + else + env + end + end + + def call(name, *params) + # name must be used only for lookup + op_info = lookup_operation(name) + mapping_opt = create_mapping_opt + req_header = create_request_header + req_body = SOAPBody.new( + op_info.request_body(params, @mapping_registry, + @literal_mapping_registry, mapping_opt) + ) + reqopt = create_encoding_opt( + :soapaction => op_info.soapaction || @soapaction, + :envelopenamespace => @options["soap.envelope.requestnamespace"], + :default_encodingstyle => + @default_encodingstyle || op_info.request_default_encodingstyle, + :use_default_namespace => + op_info.use_default_namespace || @use_default_namespace + ) + resopt = create_encoding_opt( + :envelopenamespace => @options["soap.envelope.responsenamespace"], + :default_encodingstyle => + @default_encodingstyle || op_info.response_default_encodingstyle + ) + if reqopt[:generate_explicit_type].nil? + reqopt[:generate_explicit_type] = (op_info.request_use == :encoded) + end + if resopt[:generate_explicit_type].nil? + resopt[:generate_explicit_type] = (op_info.response_use == :encoded) + end + env = route(req_header, req_body, reqopt, resopt) + if op_info.response_use.nil? + return nil + end + raise EmptyResponseError unless env + receive_headers(env.header) + begin + check_fault(env.body) + rescue ::SOAP::FaultError => e + op_info.raise_fault(e, @mapping_registry, @literal_mapping_registry) + end + if @return_response_as_xml + resopt[:response_as_xml] + else + op_info.response_obj(env.body, @mapping_registry, + @literal_mapping_registry, mapping_opt) + end + end + + def route(req_header, req_body, reqopt, resopt) + req_env = ::SOAP::SOAPEnvelope.new(req_header, req_body) + unless reqopt[:envelopenamespace].nil? + set_envelopenamespace(req_env, reqopt[:envelopenamespace]) + end + reqopt[:external_content] = nil + conn_data = marshal(req_env, reqopt) + if ext = reqopt[:external_content] + mime = MIMEMessage.new + ext.each do |k, v| + mime.add_attachment(v.data) + end + mime.add_part(conn_data.send_string + "\r\n") + mime.close + conn_data.send_string = mime.content_str + conn_data.send_contenttype = mime.headers['content-type'].str + end + conn_data.soapaction = reqopt[:soapaction] + conn_data = @streamhandler.send(@endpoint_url, conn_data) + if conn_data.receive_string.empty? + return nil + end + unmarshal(conn_data, resopt) + end + + def check_fault(body) + if body.fault + raise SOAP::FaultError.new(body.fault) + end + end + +private + + def ensure_styleuse_option(opt, style, use) + if opt[:request_style] || opt[:response_style] || opt[:request_use] || opt[:response_use] + # do not edit + else + opt[:request_style] ||= style + opt[:response_style] ||= style + opt[:request_use] ||= use + opt[:response_use] ||= use + end + end + + def initialize_streamhandler(options) + value = options["streamhandler"] + if value and !value.empty? + factory = Property::Util.const_from_name(value) + else + factory = HTTPStreamHandler + end + @streamhandler = factory.create(options) + options.add_hook("streamhandler") do |key, value| + @streamhandler.reset + if value.respond_to?(:create) + factory = value + elsif value and !value.to_str.empty? + factory = Property::Util.const_from_name(value.to_str) + else + factory = HTTPStreamHandler + end + options.unlock(true) + @streamhandler = factory.create(options) + end + end + + def set_envelopenamespace(env, namespace) + env.elename = XSD::QName.new(namespace, env.elename.name) + if env.header + env.header.elename = XSD::QName.new(namespace, env.header.elename.name) + end + if env.body + env.body.elename = XSD::QName.new(namespace, env.body.elename.name) + end + end + + def create_request_header + header = ::SOAP::SOAPHeader.new + items = @headerhandler.on_outbound(header) + items.each do |item| + header.add(item.elename.name, item) + end + header + end + + def receive_headers(header) + @headerhandler.on_inbound(header) if header + end + + def marshal(env, opt) + @filterchain.each do |filter| + env = filter.on_outbound(env, opt) + break unless env + end + send_string = Processor.marshal(env, opt) + StreamHandler::ConnectionData.new(send_string) + end + + def unmarshal(conn_data, opt) + contenttype = conn_data.receive_contenttype + xml = nil + if /#{MIMEMessage::MultipartContentType}/i =~ contenttype + opt[:external_content] = {} + mime = MIMEMessage.parse("Content-Type: " + contenttype, + conn_data.receive_string) + mime.parts.each do |part| + value = Attachment.new(part.content) + value.contentid = part.contentid + obj = SOAPAttachment.new(value) + opt[:external_content][value.contentid] = obj if value.contentid + end + opt[:charset] = @mandatorycharset || + StreamHandler.parse_media_type(mime.root.headers['content-type'].str) + xml = mime.root.content + else + opt[:charset] = @mandatorycharset || + ::SOAP::StreamHandler.parse_media_type(contenttype) + xml = conn_data.receive_string + end + @filterchain.reverse_each do |filter| + xml = filter.on_inbound(xml, opt) + break unless xml + end + env = Processor.unmarshal(xml, opt) + if @return_response_as_xml + opt[:response_as_xml] = xml + end + unless env.is_a?(::SOAP::SOAPEnvelope) + raise ResponseFormatError.new("response is not a SOAP envelope: #{env}") + end + env + end + + def create_encoding_opt(hash = nil) + opt = {} + opt[:default_encodingstyle] = @default_encodingstyle + opt[:allow_unqualified_element] = @allow_unqualified_element + opt[:generate_explicit_type] = @generate_explicit_type + opt[:no_indent] = @options["soap.envelope.no_indent"] + opt[:use_numeric_character_reference] = + @options["soap.envelope.use_numeric_character_reference"] + opt.update(hash) if hash + opt + end + + def create_mapping_opt(hash = nil) + opt = { + :external_ces => @options["soap.mapping.external_ces"] + } + opt.update(hash) if hash + opt + end + + def assign_operation(name, qname, soapaction, op) + assigned = false + if name and !name.empty? + @operation[name] = op + assigned = true + end + if qname + @operation_by_qname[qname] = op + assigned = true + end + if soapaction and !soapaction.empty? + @operation_by_soapaction[soapaction] = op + assigned = true + end + unless assigned + raise MethodDefinitionError.new("cannot assign operation") + end + end + + def lookup_operation(name_or_qname_or_soapaction) + if op = @operation[name_or_qname_or_soapaction] + return op + end + if op = @operation_by_qname[name_or_qname_or_soapaction] + return op + end + if op = @operation_by_soapaction[name_or_qname_or_soapaction] + return op + end + raise MethodDefinitionError.new( + "operation: #{name_or_qname_or_soapaction} not supported") + end + + class Operation + attr_reader :soapaction + attr_reader :request_style + attr_reader :response_style + attr_reader :request_use + attr_reader :response_use + attr_reader :use_default_namespace + + def initialize(soapaction, param_def, opt) + @soapaction = soapaction + @request_style = opt[:request_style] + @response_style = opt[:response_style] + @request_use = opt[:request_use] + @response_use = opt[:response_use] + @use_default_namespace = + opt[:use_default_namespace] || opt[:elementformdefault] + if opt.key?(:elementformdefault) + warn("option :elementformdefault is deprecated. use :use_default_namespace instead") + end + check_style(@request_style) + check_style(@response_style) + check_use(@request_use) + check_use(@response_use) + if @request_style == :rpc + @rpc_request_qname = opt[:request_qname] + if @rpc_request_qname.nil? + raise MethodDefinitionError.new("rpc_request_qname must be given") + end + @rpc_method_factory = + RPC::SOAPMethodRequest.new(@rpc_request_qname, param_def, @soapaction) + else + @doc_request_qnames = [] + @doc_response_qnames = [] + param_def.each do |param| + param = MethodDef.to_param(param) + case param.io_type + when SOAPMethod::IN + @doc_request_qnames << param.qname + when SOAPMethod::OUT + @doc_response_qnames << param.qname + else + raise MethodDefinitionError.new( + "illegal inout definition for document style: #{param.io_type}") + end + end + end + end + + def request_default_encodingstyle + (@request_use == :encoded) ? EncodingNamespace : LiteralNamespace + end + + def response_default_encodingstyle + (@response_use == :encoded) ? EncodingNamespace : LiteralNamespace + end + + def request_body(values, mapping_registry, literal_mapping_registry, opt) + if @request_style == :rpc + request_rpc(values, mapping_registry, literal_mapping_registry, opt) + else + request_doc(values, mapping_registry, literal_mapping_registry, opt) + end + end + + def response_obj(body, mapping_registry, literal_mapping_registry, opt) + if @response_style == :rpc + response_rpc(body, mapping_registry, literal_mapping_registry, opt) + else + unique_result_for_one_element_array( + response_doc(body, mapping_registry, literal_mapping_registry, opt)) + end + end + + def raise_fault(e, mapping_registry, literal_mapping_registry) + if @response_style == :rpc + Mapping.fault2exception(e, mapping_registry) + else + Mapping.fault2exception(e, literal_mapping_registry) + end + end + + private + + # nil for [] / 1 for [1] / [1, 2] for [1, 2] + def unique_result_for_one_element_array(ary) + ary.size <= 1 ? ary[0] : ary + end + + def check_style(style) + unless [:rpc, :document].include?(style) + raise MethodDefinitionError.new("unknown style: #{style}") + end + end + + # nil means oneway + def check_use(use) + unless [:encoded, :literal, nil].include?(use) + raise MethodDefinitionError.new("unknown use: #{use}") + end + end + + def request_rpc(values, mapping_registry, literal_mapping_registry, opt) + if @request_use == :encoded + request_rpc_enc(values, mapping_registry, opt) + else + request_rpc_lit(values, literal_mapping_registry, opt) + end + end + + def request_doc(values, mapping_registry, literal_mapping_registry, opt) + if @request_use == :encoded + request_doc_enc(values, mapping_registry, opt) + else + request_doc_lit(values, literal_mapping_registry, opt) + end + end + + def request_rpc_enc(values, mapping_registry, opt) + method = @rpc_method_factory.dup + names = method.input_params + types = method.input_param_types + ary = Mapping.objs2soap(values, mapping_registry, types, opt) + soap = {} + 0.upto(ary.length - 1) do |idx| + soap[names[idx]] = ary[idx] + end + method.set_param(soap) + method + end + + def request_rpc_lit(values, mapping_registry, opt) + method = @rpc_method_factory.dup + names = method.input_params + types = method.get_paramtypes(names) + params = {} + idx = 0 + names.each do |name| + params[name] = Mapping.obj2soap(values[idx], mapping_registry, + types[idx], opt) + params[name].elename = XSD::QName.new(nil, name) + idx += 1 + end + method.set_param(params) + method + end + + def request_doc_enc(values, mapping_registry, opt) + (0...values.size).collect { |idx| + ele = Mapping.obj2soap(values[idx], mapping_registry, nil, opt) + ele.elename = @doc_request_qnames[idx] + ele + } + end + + def request_doc_lit(values, mapping_registry, opt) + (0...values.size).collect { |idx| + ele = Mapping.obj2soap(values[idx], mapping_registry, + @doc_request_qnames[idx], opt) + ele.encodingstyle = LiteralNamespace + ele + } + end + + def response_rpc(body, mapping_registry, literal_mapping_registry, opt) + if @response_use == :encoded + response_rpc_enc(body, mapping_registry, opt) + else + response_rpc_lit(body, literal_mapping_registry, opt) + end + end + + def response_doc(body, mapping_registry, literal_mapping_registry, opt) + if @response_use == :encoded + response_doc_enc(body, mapping_registry, opt) + else + response_doc_lit(body, literal_mapping_registry, opt) + end + end + + def response_rpc_enc(body, mapping_registry, opt) + ret = nil + if body.response + ret = Mapping.soap2obj(body.response, mapping_registry, + @rpc_method_factory.retval_class_name, opt) + end + if body.outparams + outparams = body.outparams.collect { |outparam| + Mapping.soap2obj(outparam, mapping_registry, nil, opt) + } + [ret].concat(outparams) + else + ret + end + end + + def response_rpc_lit(body, mapping_registry, opt) + body.root_node.collect { |key, value| + Mapping.soap2obj(value, mapping_registry, + @rpc_method_factory.retval_class_name, opt) + } + end + + def response_doc_enc(body, mapping_registry, opt) + body.collect { |key, value| + Mapping.soap2obj(value, mapping_registry, nil, opt) + } + end + + def response_doc_lit(body, mapping_registry, opt) + body.collect { |key, value| + Mapping.soap2obj(value, mapping_registry) + } + end + end +end + + +end +end diff --git a/lib/soap/rpc/router.rb b/lib/soap/rpc/router.rb new file mode 100644 index 0000000..60971b9 --- /dev/null +++ b/lib/soap/rpc/router.rb @@ -0,0 +1,662 @@ +# SOAP4R - RPC Routing library +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/soap' +require 'soap/processor' +require 'soap/mapping' +require 'soap/mapping/literalregistry' +require 'soap/rpc/rpc' +require 'soap/rpc/element' +require 'soap/header/handlerset' +require 'soap/filter' +require 'soap/streamHandler' +require 'soap/mimemessage' +require 'soap/header/handlerset' + + +module SOAP +module RPC + + +class Router + include SOAP + + attr_reader :actor + attr_accessor :mapping_registry + attr_accessor :literal_mapping_registry + attr_accessor :generate_explicit_type + attr_accessor :use_default_namespace + attr_accessor :external_ces + attr_reader :filterchain + + def initialize(actor) + @actor = actor + @mapping_registry = nil + @headerhandler = Header::HandlerSet.new + @literal_mapping_registry = ::SOAP::Mapping::LiteralRegistry.new + @generate_explicit_type = true + @use_default_namespace = false + @external_ces = nil + @operation_by_soapaction = {} + @operation_by_qname = {} + @headerhandlerfactory = [] + @filterchain = Filter::FilterChain.new + end + + ### + ## header handler interface + # + def add_request_headerhandler(factory) + unless factory.respond_to?(:create) + raise TypeError.new("factory must respond to 'create'") + end + @headerhandlerfactory << factory + end + + def add_headerhandler(handler) + @headerhandler.add(handler) + end + + ### + ## servant definition interface + # + def add_rpc_request_servant(factory, namespace) + unless factory.respond_to?(:create) + raise TypeError.new("factory must respond to 'create'") + end + obj = factory.create # a dummy instance for introspection + ::SOAP::RPC.defined_methods(obj).each do |name| + begin + qname = XSD::QName.new(namespace, name) + param_def = ::SOAP::RPC::SOAPMethod.derive_rpc_param_def(obj, name) + opt = create_styleuse_option(:rpc, :encoded) + add_rpc_request_operation(factory, qname, nil, name, param_def, opt) + rescue SOAP::RPC::MethodDefinitionError => e + p e if $DEBUG + end + end + end + + def add_rpc_servant(obj, namespace) + ::SOAP::RPC.defined_methods(obj).each do |name| + begin + qname = XSD::QName.new(namespace, name) + param_def = ::SOAP::RPC::SOAPMethod.derive_rpc_param_def(obj, name) + opt = create_styleuse_option(:rpc, :encoded) + add_rpc_operation(obj, qname, nil, name, param_def, opt) + rescue SOAP::RPC::MethodDefinitionError => e + p e if $DEBUG + end + end + end + alias add_servant add_rpc_servant + + ### + ## operation definition interface + # + def add_rpc_operation(receiver, qname, soapaction, name, param_def, opt = {}) + ensure_styleuse_option(opt, :rpc, :encoded) + opt[:request_qname] = qname + op = ApplicationScopeOperation.new(soapaction, receiver, name, param_def, + opt) + if opt[:request_style] != :rpc + raise RPCRoutingError.new("illegal request_style given") + end + assign_operation(soapaction, qname, op) + end + alias add_method add_rpc_operation + alias add_rpc_method add_rpc_operation + + def add_rpc_request_operation(factory, qname, soapaction, name, param_def, opt = {}) + ensure_styleuse_option(opt, :rpc, :encoded) + opt[:request_qname] = qname + op = RequestScopeOperation.new(soapaction, factory, name, param_def, opt) + if opt[:request_style] != :rpc + raise RPCRoutingError.new("illegal request_style given") + end + assign_operation(soapaction, qname, op) + end + + def add_document_operation(receiver, soapaction, name, param_def, opt = {}) + # + # adopt workaround for doc/lit wrapper method + # (you should consider to simply use rpc/lit service) + # + #unless soapaction + # raise RPCRoutingError.new("soapaction is a must for document method") + #end + ensure_styleuse_option(opt, :document, :literal) + op = ApplicationScopeOperation.new(soapaction, receiver, name, param_def, + opt) + if opt[:request_style] != :document + raise RPCRoutingError.new("illegal request_style given") + end + assign_operation(soapaction, first_input_part_qname(param_def), op) + end + alias add_document_method add_document_operation + + def add_document_request_operation(factory, soapaction, name, param_def, opt = {}) + # + # adopt workaround for doc/lit wrapper method + # (you should consider to simply use rpc/lit service) + # + #unless soapaction + # raise RPCRoutingError.new("soapaction is a must for document method") + #end + ensure_styleuse_option(opt, :document, :literal) + op = RequestScopeOperation.new(soapaction, receiver, name, param_def, opt) + if opt[:request_style] != :document + raise RPCRoutingError.new("illegal request_style given") + end + assign_operation(soapaction, first_input_part_qname(param_def), op) + end + + def route(conn_data) + # we cannot set request_default_encodingsyle before parsing the content. + env = unmarshal(conn_data) + if env.nil? + raise ArgumentError.new("illegal SOAP marshal format") + end + op = lookup_operation(conn_data.soapaction, env.body) + headerhandler = @headerhandler.dup + @headerhandlerfactory.each do |f| + headerhandler.add(f.create) + end + soap_response = default_encodingstyle = nil + begin + receive_headers(headerhandler, env.header) + soap_response = + op.call(env.body, @mapping_registry, @literal_mapping_registry, + create_mapping_opt) + conn_data.is_fault = true if soap_response.is_a?(SOAPFault) + default_encodingstyle = op.response_default_encodingstyle + rescue Exception => e + # If a wsdl fault was raised by service, the fault declaration details + # is kept in wsdl_fault. Otherwise (exception is a program fault) + # wsdl_fault is nil + wsdl_fault_details = op.faults && op.faults[e.class.name] + soap_response = fault(e, wsdl_fault_details) + conn_data.is_fault = true + default_encodingstyle = nil + end + header = call_headers(headerhandler) + if op.response_use.nil? + conn_data.send_string = '' + conn_data.is_nocontent = true + conn_data + else + body = SOAPBody.new(soap_response, conn_data.is_fault) + env = SOAPEnvelope.new(header, body) + marshal(conn_data, env, default_encodingstyle) + end + end + + # Create fault response string. + def create_fault_response(e) + env = SOAPEnvelope.new(SOAPHeader.new, SOAPBody.new(fault(e, nil), true)) + opt = {} + opt[:external_content] = nil + @filterchain.reverse_each do |filter| + env = filter.on_outbound(env, opt) + break unless env + end + response_string = Processor.marshal(env, opt) + conn_data = StreamHandler::ConnectionData.new(response_string) + conn_data.is_fault = true + if ext = opt[:external_content] + mimeize(conn_data, ext) + end + conn_data + end + +private + + def first_input_part_qname(param_def) + param_def.each do |param| + param = MethodDef.to_param(param) + if param.io_type == SOAPMethod::IN + return param.qname + end + end + nil + end + + def create_styleuse_option(style, use) + opt = {} + opt[:request_style] = opt[:response_style] = style + opt[:request_use] = opt[:response_use] = use + opt + end + + def ensure_styleuse_option(opt, style, use) + if opt[:request_style] || opt[:response_style] || opt[:request_use] || opt[:response_use] + # do not edit + else + opt[:request_style] ||= style + opt[:response_style] ||= style + opt[:request_use] ||= use + opt[:response_use] ||= use + end + end + + def assign_operation(soapaction, qname, op) + assigned = false + if soapaction and !soapaction.empty? + @operation_by_soapaction[soapaction] = op + assigned = true + end + if qname + @operation_by_qname[qname] = op + assigned = true + end + unless assigned + raise RPCRoutingError.new("cannot assign operation") + end + end + + def lookup_operation(soapaction, body) + if op = @operation_by_soapaction[soapaction] + return op + end + qname = body.root_node.elename + if op = @operation_by_qname[qname] + return op + end + if soapaction + raise RPCRoutingError.new( + "operation: #{soapaction} #{qname} not supported") + else + raise RPCRoutingError.new("operation: #{qname} not supported") + end + end + + def call_headers(headerhandler) + header = ::SOAP::SOAPHeader.new + items = headerhandler.on_outbound(header) + items.each do |item| + header.add(item.elename.name, item) + end + header + end + + def receive_headers(headerhandler, header) + headerhandler.on_inbound(header) if header + end + + def unmarshal(conn_data) + xml = nil + opt = {} + contenttype = conn_data.receive_contenttype + if /#{MIMEMessage::MultipartContentType}/i =~ contenttype + opt[:external_content] = {} + mime = MIMEMessage.parse("Content-Type: " + contenttype, + conn_data.receive_string) + mime.parts.each do |part| + value = Attachment.new(part.content) + value.contentid = part.contentid + obj = SOAPAttachment.new(value) + opt[:external_content][value.contentid] = obj if value.contentid + end + opt[:charset] = + StreamHandler.parse_media_type(mime.root.headers['content-type'].str) + xml = mime.root.content + else + opt[:charset] = ::SOAP::StreamHandler.parse_media_type(contenttype) + xml = conn_data.receive_string + end + @filterchain.each do |filter| + xml = filter.on_inbound(xml, opt) + break unless xml + end + env = Processor.unmarshal(xml, opt) + charset = opt[:charset] + conn_data.send_contenttype = "text/xml; charset=\"#{charset}\"" + env + end + + def marshal(conn_data, env, default_encodingstyle = nil) + opt = {} + opt[:external_content] = nil + opt[:default_encodingstyle] = default_encodingstyle + opt[:generate_explicit_type] = @generate_explicit_type + opt[:use_default_namespace] = @use_default_namespace + @filterchain.reverse_each do |filter| + env = filter.on_outbound(env, opt) + break unless env + end + response_string = Processor.marshal(env, opt) + conn_data.send_string = response_string + if ext = opt[:external_content] + mimeize(conn_data, ext) + end + conn_data + end + + def mimeize(conn_data, ext) + mime = MIMEMessage.new + ext.each do |k, v| + mime.add_attachment(v.data) + end + mime.add_part(conn_data.send_string + "\r\n") + mime.close + conn_data.send_string = mime.content_str + conn_data.send_contenttype = mime.headers['content-type'].str + conn_data + end + + # Create fault response. + def fault(e, wsdl_fault_details) + if e.is_a?(UnhandledMustUnderstandHeaderError) + faultcode = FaultCode::MustUnderstand + else + faultcode = FaultCode::Server + end + + # If the exception represents a WSDL fault, the fault element should + # be added as the SOAP fault element. If the exception is a + # normal program exception, it is wrapped inside a custom SOAP4R + # SOAP exception element. + detail = nil + begin + if (wsdl_fault_details) + registry = wsdl_fault_details[:use] == "literal" ? + @literal_mapping_registry : @mapping_registry + faultQName = XSD::QName.new( + wsdl_fault_details[:ns], wsdl_fault_details[:name] + ) + detail = Mapping.obj2soap(e, registry, faultQName) + # wrap fault element (SOAPFault swallows top-level element) + wrapper = SOAP::SOAPElement.new(faultQName) + wrapper.add(detail) + detail = wrapper + else + # Exception is a normal program exception. Wrap it. + detail = Mapping.obj2soap(Mapping::SOAPException.new(e), + @mapping_registry) + detail.elename ||= XSD::QName::EMPTY # for literal mappingregstry + end + rescue + detail = SOAPString.new("failed to serialize detail object: #{$!}") + end + + SOAPFault.new( + SOAPElement.new(nil, faultcode), + SOAPString.new(e.to_s), + SOAPString.new(@actor), + detail) + end + + def create_mapping_opt + { :external_ces => @external_ces } + end + + class Operation + attr_reader :name + attr_reader :soapaction + attr_reader :request_style + attr_reader :response_style + attr_reader :request_use + attr_reader :response_use + attr_reader :faults + + def initialize(soapaction, name, param_def, opt) + @soapaction = soapaction + @name = name + @request_style = opt[:request_style] + @response_style = opt[:response_style] + @request_use = opt[:request_use] + @response_use = opt[:response_use] + @faults = opt[:faults] + check_style(@request_style) + check_style(@response_style) + check_use(@request_use) + check_use(@response_use) + if @response_style == :rpc + request_qname = opt[:request_qname] or raise + @rpc_method_factory = + RPC::SOAPMethodRequest.new(request_qname, param_def, @soapaction) + @rpc_response_qname = opt[:response_qname] + else + @doc_request_qnames = [] + @doc_response_qnames = [] + param_def.each do |param| + param = MethodDef.to_param(param) + case param.io_type + when SOAPMethod::IN + @doc_request_qnames << param.qname + when SOAPMethod::OUT + @doc_response_qnames << param.qname + else + raise ArgumentError.new( + "illegal inout definition for document style: #{param.io_type}") + end + end + end + end + + def request_default_encodingstyle + (@request_use == :encoded) ? EncodingNamespace : LiteralNamespace + end + + def response_default_encodingstyle + (@response_use == :encoded) ? EncodingNamespace : LiteralNamespace + end + + def call(body, mapping_registry, literal_mapping_registry, opt) + if @request_style == :rpc + values = request_rpc(body, mapping_registry, literal_mapping_registry, + opt) + else + values = request_document(body, mapping_registry, + literal_mapping_registry, opt) + end + result = receiver.method(@name.intern).call(*values) + return result if result.is_a?(SOAPFault) + if @response_style == :rpc + response_rpc(result, mapping_registry, literal_mapping_registry, opt) + elsif @doc_response_qnames.empty? + # nothing to do + else + response_doc(result, mapping_registry, literal_mapping_registry, opt) + end + end + + private + + def receiver + raise NotImplementedError.new('must be defined in derived class') + end + + def request_rpc(body, mapping_registry, literal_mapping_registry, opt) + request = body.request + unless request.is_a?(SOAPNameAccessible) + if request.is_a?(SOAPNil) + # SOAP::Lite/0.69 seems to send xsi:nil="true" element as a request. + request = SOAPStruct.new(request.elename) + else + raise RPCRoutingError.new("not an RPC style") + end + end + if @request_use == :encoded + request_rpc_enc(request, mapping_registry, opt) + else + request_rpc_lit(request, literal_mapping_registry, opt) + end + end + + def request_document(body, mapping_registry, literal_mapping_registry, opt) + # ToDo: compare names with @doc_request_qnames + if @request_use == :encoded + request_doc_enc(body, mapping_registry, opt) + else + request_doc_lit(body, literal_mapping_registry, opt) + end + end + + def request_rpc_enc(request, mapping_registry, opt) + param = Mapping.soap2obj(request, mapping_registry, nil, opt) + request.collect { |key, value| + param[key] + } + end + + def request_rpc_lit(request, mapping_registry, opt) + request.collect { |key, value| + Mapping.soap2obj(value, mapping_registry, nil, opt) + } + end + + def request_doc_enc(body, mapping_registry, opt) + body.collect { |key, value| + Mapping.soap2obj(value, mapping_registry, nil, opt) + } + end + + def request_doc_lit(body, mapping_registry, opt) + body.collect { |key, value| + Mapping.soap2obj(value, mapping_registry, nil, opt) + } + end + + def response_rpc(result, mapping_registry, literal_mapping_registry, opt) + if @response_use == :encoded + response_rpc_enc(result, mapping_registry, opt) + else + response_rpc_lit(result, literal_mapping_registry, opt) + end + end + + def response_doc(result, mapping_registry, literal_mapping_registry, opt) + if @doc_response_qnames.size == 0 + result = [] + elsif @doc_response_qnames.size == 1 + result = [result] + end + if result.size != @doc_response_qnames.size + raise "required #{@doc_response_qnames.size} responses " + + "but #{result.size} given" + end + if @response_use == :encoded + response_doc_enc(result, mapping_registry, opt) + else + response_doc_lit(result, literal_mapping_registry, opt) + end + end + + def response_rpc_enc(result, mapping_registry, opt) + soap_response = + @rpc_method_factory.create_method_response(@rpc_response_qname) + if soap_response.have_outparam? + unless result.is_a?(Array) + raise RPCRoutingError.new("out parameter was not returned") + end + outparams = {} + i = 1 + soap_response.output_params.each do |outparam| + outparams[outparam] = Mapping.obj2soap(result[i], mapping_registry, + nil, opt) + i += 1 + end + soap_response.set_outparam(outparams) + soap_response.retval = Mapping.obj2soap(result[0], mapping_registry, + nil, opt) + else + soap_response.retval = Mapping.obj2soap(result, mapping_registry, nil, + opt) + end + soap_response + end + + def response_rpc_lit(result, mapping_registry, opt) + soap_response = + @rpc_method_factory.create_method_response(@rpc_response_qname) + if soap_response.have_outparam? + unless result.is_a?(Array) + raise RPCRoutingError.new("out parameter was not returned") + end + outparams = {} + i = 1 + soap_response.output_params.each do |outparam| + outparams[outparam] = Mapping.obj2soap(result[i], mapping_registry, + XSD::QName.new(nil, outparam), opt) + i += 1 + end + soap_response.set_outparam(outparams) + soap_response.retval = Mapping.obj2soap(result[0], mapping_registry, + soap_response.elename, opt) + else + soap_response.retval = Mapping.obj2soap(result, mapping_registry, + soap_response.elename, opt) + end + soap_response + end + + def response_doc_enc(result, mapping_registry, opt) + (0...result.size).collect { |idx| + ele = Mapping.obj2soap(result[idx], mapping_registry, nil, opt) + ele.elename = @doc_response_qnames[idx] + ele + } + end + + def response_doc_lit(result, mapping_registry, opt) + (0...result.size).collect { |idx| + ele = Mapping.obj2soap(result[idx], mapping_registry, + @doc_response_qnames[idx]) + ele.encodingstyle = LiteralNamespace + ele + } + end + + def check_style(style) + unless [:rpc, :document].include?(style) + raise ArgumentError.new("unknown style: #{style}") + end + end + + # nil means oneway + def check_use(use) + unless [:encoded, :literal, nil].include?(use) + raise ArgumentError.new("unknown use: #{use}") + end + end + end + + class ApplicationScopeOperation < Operation + def initialize(soapaction, receiver, name, param_def, opt) + super(soapaction, name, param_def, opt) + @receiver = receiver + end + + private + + def receiver + @receiver + end + end + + class RequestScopeOperation < Operation + def initialize(soapaction, receiver_factory, name, param_def, opt) + super(soapaction, name, param_def, opt) + unless receiver_factory.respond_to?(:create) + raise TypeError.new("factory must respond to 'create'") + end + @receiver_factory = receiver_factory + end + + private + + def receiver + @receiver_factory.create + end + end +end + + +end +end diff --git a/lib/soap/rpc/rpc.rb b/lib/soap/rpc/rpc.rb new file mode 100644 index 0000000..521d001 --- /dev/null +++ b/lib/soap/rpc/rpc.rb @@ -0,0 +1,25 @@ +# SOAP4R - RPC utility. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module SOAP + + +module RPC + ServerException = Mapping::MappedException + + def self.defined_methods(obj) + if obj.is_a?(Module) + obj.methods - Module.methods + else + obj.methods - Object.instance_methods(true) + end + end +end + + +end diff --git a/lib/soap/rpc/soaplet.rb b/lib/soap/rpc/soaplet.rb new file mode 100644 index 0000000..d952927 --- /dev/null +++ b/lib/soap/rpc/soaplet.rb @@ -0,0 +1,200 @@ +# SOAP4R - SOAP handler servlet for WEBrick +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'webrick/httpservlet/abstract' +require 'webrick/httpstatus' +require 'soap/rpc/router' +require 'soap/streamHandler' +begin + require 'stringio' + require 'zlib' +rescue LoadError + warn("Loading stringio or zlib failed. No gzipped response supported.") if $DEBUG +end + + +warn("Overriding WEBrick::Log#debug") if $DEBUG +require 'webrick/log' +module WEBrick + class Log < BasicLog + alias __debug debug + def debug(msg = nil) + if block_given? and msg.nil? + __debug(yield) + else + __debug(msg) + end + end + end +end + + +module SOAP +module RPC + + +class SOAPlet < WEBrick::HTTPServlet::AbstractServlet +public + attr_reader :options + attr_accessor :authenticator + + def initialize(router = nil) + @router = router || ::SOAP::RPC::Router.new(self.class.name) + @options = {} + @authenticator = nil + @config = {} + end + + def allow_content_encoding_gzip=(allow) + @options[:allow_content_encoding_gzip] = allow + end + + ### + ## Servlet interfaces for WEBrick. + # + def get_instance(config, *options) + @config = config + self + end + + def require_path_info? + false + end + + def do_GET(req, res) + res.header['Allow'] = 'POST' + raise WEBrick::HTTPStatus::MethodNotAllowed, "GET request not allowed" + end + + def do_POST(req, res) + logger.debug { "SOAP request: " + req.body } if logger + if @authenticator + @authenticator.authenticate(req, res) + # you can check authenticated user with SOAP::RPC::SOAPlet.user + end + begin + conn_data = ::SOAP::StreamHandler::ConnectionData.new + setup_req(conn_data, req) + @router.external_ces = @options[:external_ces] + Mapping.protect_threadvars(:SOAPlet) do + SOAPlet.user = req.user + SOAPlet.cookies = req.cookies + conn_data = @router.route(conn_data) + setup_res(conn_data, req, res) + end + rescue Exception => e + conn_data = @router.create_fault_response(e) + res.status = WEBrick::HTTPStatus::RC_INTERNAL_SERVER_ERROR + res.body = conn_data.send_string + res['content-type'] = conn_data.send_contenttype || "text/xml" + end + if res.body.is_a?(IO) + res.chunked = true + logger.debug { "SOAP response: (chunked response not logged)" } if logger + else + logger.debug { "SOAP response: " + res.body } if logger + end + end + + def self.cookies + get_variable(:Cookies) + end + + def self.cookies=(cookies) + set_variable(:Cookies, cookies) + end + + def self.user + get_variable(:User) + end + + def self.user=(user) + set_variable(:User, user) + end + +private + + def self.get_variable(name) + if var = Thread.current[:SOAPlet] + var[name] + else + nil + end + end + + def self.set_variable(name, value) + var = Thread.current[:SOAPlet] ||= {} + var[name] = value + end + + def logger + @config[:Logger] + end + + def setup_req(conn_data, req) + conn_data.receive_string = req.body + conn_data.receive_contenttype = req['content-type'] + conn_data.soapaction = parse_soapaction(req.meta_vars['HTTP_SOAPACTION']) + end + + def setup_res(conn_data, req, res) + res['content-type'] = conn_data.send_contenttype + cookies = SOAPlet.cookies + unless cookies.empty? + res['set-cookie'] = cookies.collect { |cookie| cookie.to_s } + end + if conn_data.is_nocontent + res.status = WEBrick::HTTPStatus::RC_ACCEPTED + res.body = '' + return + end + if conn_data.is_fault + res.status = WEBrick::HTTPStatus::RC_INTERNAL_SERVER_ERROR + end + if outstring = encode_gzip(req, conn_data.send_string) + res['content-encoding'] = 'gzip' + res['content-length'] = outstring.size + res.body = outstring + else + res.body = conn_data.send_string + end + end + + def parse_soapaction(soapaction) + if !soapaction.nil? and !soapaction.empty? + if /^"(.+)"$/ =~ soapaction + return $1 + end + end + nil + end + + def encode_gzip(req, outstring) + unless encode_gzip?(req) + return nil + end + begin + ostream = StringIO.new + gz = Zlib::GzipWriter.new(ostream) + gz.write(outstring) + ostream.string + ensure + gz.close + end + end + + def encode_gzip?(req) + @options[:allow_content_encoding_gzip] and defined?(::Zlib) and + req['accept-encoding'] and + req['accept-encoding'].split(/,\s*/).include?('gzip') + end +end + + +end +end diff --git a/lib/soap/rpc/standaloneServer.rb b/lib/soap/rpc/standaloneServer.rb new file mode 100644 index 0000000..1652fa4 --- /dev/null +++ b/lib/soap/rpc/standaloneServer.rb @@ -0,0 +1,43 @@ +# SOAP4R - WEBrick Server +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/rpc/httpserver' + + +module SOAP +module RPC + + +class StandaloneServer < HTTPServer + def initialize(appname, default_namespace, host = "0.0.0.0", port = 8089) + @appname = appname + @default_namespace = default_namespace + @host = host + @port = port + super(create_config) + end + + alias add_servant add_rpc_servant + alias add_headerhandler add_rpc_headerhandler + +private + + def create_config + { + :BindAddress => @host, + :Port => @port, + :AccessLog => [], + :SOAPDefaultNamespace => @default_namespace, + :SOAPHTTPServerApplicationName => @appname, + } + end +end + + +end +end diff --git a/lib/soap/soap.rb b/lib/soap/soap.rb new file mode 100644 index 0000000..bdcf782 --- /dev/null +++ b/lib/soap/soap.rb @@ -0,0 +1,151 @@ +# soap/soap.rb: SOAP4R - Base definitions. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/qname' +require 'xsd/charset' +require 'soap/nestedexception' + + +module SOAP + + +VERSION = Version = '1.6.1-SNAPSHOT' +PropertyName = 'soap/property' + +EnvelopeNamespace = 'http://schemas.xmlsoap.org/soap/envelope/' +EncodingNamespace = 'http://schemas.xmlsoap.org/soap/encoding/' +LiteralNamespace = 'http://xml.apache.org/xml-soap/literalxml' + +NextActor = 'http://schemas.xmlsoap.org/soap/actor/next' + +EleEnvelope = 'Envelope' +EleHeader = 'Header' +EleBody = 'Body' +EleFault = 'Fault' +EleFaultString = 'faultstring' +EleFaultActor = 'faultactor' +EleFaultCode = 'faultcode' +EleFaultDetail = 'detail' + +AttrMustUnderstand = 'mustUnderstand' +AttrEncodingStyle = 'encodingStyle' +AttrActor = 'actor' +AttrRoot = 'root' +AttrArrayType = 'arrayType' +AttrOffset = 'offset' +AttrPosition = 'position' +AttrHref = 'href' +AttrId = 'id' +ValueArray = 'Array' + +EleEnvelopeName = XSD::QName.new(EnvelopeNamespace, EleEnvelope).freeze +EleHeaderName = XSD::QName.new(EnvelopeNamespace, EleHeader).freeze +EleBodyName = XSD::QName.new(EnvelopeNamespace, EleBody).freeze +EleFaultName = XSD::QName.new(EnvelopeNamespace, EleFault).freeze +EleFaultStringName = XSD::QName.new(nil, EleFaultString).freeze +EleFaultActorName = XSD::QName.new(nil, EleFaultActor).freeze +EleFaultCodeName = XSD::QName.new(nil, EleFaultCode).freeze +EleFaultDetailName = XSD::QName.new(nil, EleFaultDetail).freeze +AttrActorName = XSD::QName.new(EnvelopeNamespace, AttrActor).freeze +AttrMustUnderstandName = XSD::QName.new(EnvelopeNamespace, AttrMustUnderstand).freeze +AttrEncodingStyleName = XSD::QName.new(EnvelopeNamespace, AttrEncodingStyle).freeze +AttrRootName = XSD::QName.new(EncodingNamespace, AttrRoot).freeze +AttrArrayTypeName = XSD::QName.new(EncodingNamespace, AttrArrayType).freeze +AttrOffsetName = XSD::QName.new(EncodingNamespace, AttrOffset).freeze +AttrPositionName = XSD::QName.new(EncodingNamespace, AttrPosition).freeze +AttrHrefName = XSD::QName.new(nil, AttrHref).freeze +AttrIdName = XSD::QName.new(nil, AttrId).freeze +ValueArrayName = XSD::QName.new(EncodingNamespace, ValueArray).freeze + +Base64Literal = 'base64' + +MediaType = 'text/xml' + +class Error < StandardError; include NestedException; end + +class StreamError < Error; end +class HTTPStreamError < StreamError; end +class PostUnavailableError < HTTPStreamError; end +class MPostUnavailableError < HTTPStreamError; end + +class ArrayIndexOutOfBoundsError < Error; end +class ArrayStoreError < Error; end + +class RPCRoutingError < Error; end +class EmptyResponseError < Error; end +class ResponseFormatError < Error; end + +class UnhandledMustUnderstandHeaderError < Error; end + + +module FaultCode + VersionMismatch = XSD::QName.new(EnvelopeNamespace, 'VersionMismatch').freeze + MustUnderstand = XSD::QName.new(EnvelopeNamespace, 'MustUnderstand').freeze + Client = XSD::QName.new(EnvelopeNamespace, 'Client').freeze + Server = XSD::QName.new(EnvelopeNamespace, 'Server').freeze +end + + +class FaultError < Error + attr_reader :faultcode + attr_reader :faultstring + attr_reader :faultactor + attr_accessor :detail + + def initialize(fault) + @faultcode = fault.faultcode + @faultstring = fault.faultstring + @faultactor = fault.faultactor + @detail = fault.detail + super(self.to_s) + end + + def to_s + str = nil + if @faultstring and @faultstring.respond_to?('data') + str = @faultstring.data + end + str || '(No faultstring)' + end +end + + +module Env + def self.getenv(name) + ENV[name.downcase] || ENV[name.upcase] + end + + is_cgi = !getenv('request_method').nil? + HTTP_PROXY = is_cgi ? getenv('cgi_http_proxy') : getenv('http_proxy') + NO_PROXY = getenv('no_proxy') +end + + +end + + +unless Object.respond_to?(:instance_variable_get) + class Object + def instance_variable_get(ivarname) + instance_eval(ivarname) + end + + def instance_variable_set(ivarname, value) + instance_eval("#{ivarname} = value") + end + end +end + + +unless Kernel.respond_to?(:warn) + module Kernel + def warn(msg) + STDERR.puts(msg + "\n") unless $VERBOSE.nil? + end + end +end diff --git a/lib/soap/streamHandler.rb b/lib/soap/streamHandler.rb new file mode 100644 index 0000000..6b7e265 --- /dev/null +++ b/lib/soap/streamHandler.rb @@ -0,0 +1,301 @@ +# SOAP4R - Stream handler. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/soap' +require 'soap/httpconfigloader' +require 'soap/filter/filterchain' +begin + require 'stringio' + require 'zlib' +rescue LoadError + warn("Loading stringio or zlib failed. No gzipped response support.") if $DEBUG +end + + +module SOAP + + +class StreamHandler + RUBY_VERSION_STRING = "ruby #{ RUBY_VERSION } (#{ RUBY_RELEASE_DATE }) [#{ RUBY_PLATFORM }]" + + attr_reader :filterchain + + class ConnectionData + attr_accessor :send_string + attr_accessor :send_contenttype + attr_accessor :receive_string + attr_accessor :receive_contenttype + attr_accessor :is_fault + attr_accessor :is_nocontent + attr_accessor :soapaction + + def initialize(send_string = nil) + @send_string = send_string + @send_contenttype = nil + @receive_string = nil + @receive_contenttype = nil + @is_fault = false + @is_nocontent = false + @soapaction = nil + end + end + + def initialize + @filterchain = Filter::FilterChain.new + end + + def self.parse_media_type(str) + if /^#{ MediaType }(?:\s*;\s*charset=([^"]+|"[^"]+"))?$/i !~ str + return nil + end + charset = $1 + charset.gsub!(/"/, '') if charset + charset || 'us-ascii' + end + + def self.create_media_type(charset) + "#{ MediaType }; charset=#{ charset }" + end + + def send(url, conn_data, soapaction = nil, charset = nil) + # send a ConnectionData to specified url. + # return value is a ConnectionData with receive_* property filled. + # You can fill values of given conn_data and return it. + end + + def reset(url = nil) + # for initializing connection status if needed. + # return value is not expected. + end + + def set_wiredump_file_base(wiredump_file_base) + # for logging. return value is not expected. + # Override it when you want. + raise NotImplementedError + end + + def test_loopback_response + # for loopback testing. see HTTPStreamHandler for more detail. + # return value is an Array of loopback responses. + # Override it when you want. + raise NotImplementedError + end +end + + +class HTTPStreamHandler < StreamHandler + include SOAP + + begin + require 'httpclient' + Client = HTTPClient + RETRYABLE = true + rescue LoadError + begin + require 'http-access2' + if HTTPAccess2::VERSION < "2.0" + raise LoadError.new("http-access/2.0 or later is required.") + end + Client = HTTPAccess2::Client + RETRYABLE = true + rescue LoadError + warn("Loading http-access2 failed. Net/http is used.") if $DEBUG + require 'soap/netHttpClient' + Client = SOAP::NetHttpClient + RETRYABLE = false + end + end + + class HttpPostRequestFilter + def initialize(filterchain) + @filterchain = filterchain + end + + def filter_request(req) + @filterchain.each do |filter| + filter.on_http_outbound(req) + end + end + + def filter_response(req, res) + @filterchain.each do |filter| + filter.on_http_inbound(req, res) + end + end + end + +public + + attr_reader :client + attr_accessor :wiredump_file_base + + MAX_RETRY_COUNT = 10 # [times] + + def self.create(options) + new(options) + end + + def initialize(options) + super() + @client = Client.new(nil, "SOAP4R/#{ Version }") + if @client.respond_to?(:request_filter) + @client.request_filter << HttpPostRequestFilter.new(@filterchain) + end + @wiredump_file_base = nil + @charset = @wiredump_dev = nil + @options = options + set_options + @client.debug_dev = @wiredump_dev + @cookie_store = nil + @accept_encoding_gzip = false + end + + def test_loopback_response + @client.test_loopback_response + end + + def accept_encoding_gzip=(allow) + @accept_encoding_gzip = allow + end + + def inspect + "#<#{self.class}>" + end + + def send(url, conn_data, charset = @charset) + conn_data = send_post(url, conn_data, charset) + @client.save_cookie_store if @cookie_store + conn_data + end + + def reset(url = nil) + if url.nil? + @client.reset_all + else + @client.reset(url) + end + @client.save_cookie_store if @cookie_store + end + +private + + def set_options + @options["http"] ||= ::SOAP::Property.new + HTTPConfigLoader.set_options(@client, @options["http"]) + @charset = @options["http.charset"] || XSD::Charset.xml_encoding_label + @options.add_hook("http.charset") do |key, value| + @charset = value + end + @wiredump_dev = @options["http.wiredump_dev"] + @options.add_hook("http.wiredump_dev") do |key, value| + @wiredump_dev = value + @client.debug_dev = @wiredump_dev + end + set_cookie_store_file(@options["http.cookie_store_file"]) + @options.add_hook("http.cookie_store_file") do |key, value| + set_cookie_store_file(value) + end + ssl_config = @options["http.ssl_config"] + basic_auth = @options["http.basic_auth"] + auth = @options["http.auth"] + @options["http"].lock(true) + ssl_config.unlock + basic_auth.unlock + auth.unlock + end + + def set_cookie_store_file(value) + value = nil if value and value.empty? + @cookie_store = value + @client.set_cookie_store(@cookie_store) if @cookie_store + end + + def send_post(url, conn_data, charset) + conn_data.send_contenttype ||= StreamHandler.create_media_type(charset) + + if @wiredump_file_base + filename = @wiredump_file_base + '_request.xml' + f = File.open(filename, "w") + f << conn_data.send_string + f.close + end + + extheader = {} + extheader['Content-Type'] = conn_data.send_contenttype + extheader['SOAPAction'] = "\"#{ conn_data.soapaction }\"" + extheader['Accept-Encoding'] = 'gzip' if send_accept_encoding_gzip? + send_string = conn_data.send_string + @wiredump_dev << "Wire dump:\n\n" if @wiredump_dev + begin + retry_count = 0 + while true + res = @client.post(url, send_string, extheader) + if RETRYABLE and HTTP::Status.redirect?(res.status) + retry_count += 1 + if retry_count >= MAX_RETRY_COUNT + raise HTTPStreamError.new("redirect count exceeded") + end + url = res.header["location"][0] + puts "redirected to #{url}" if $DEBUG + else + break + end + end + rescue + @client.reset(url) + raise + end + @wiredump_dev << "\n\n" if @wiredump_dev + receive_string = res.content + if @wiredump_file_base + filename = @wiredump_file_base + '_response.xml' + f = File.open(filename, "w") + f << receive_string + f.close + end + case res.status + when 405 + raise PostUnavailableError.new("#{ res.status }: #{ res.reason }") + when 200, 202, 500 + # Nothing to do. 202 is for oneway service. + else + raise HTTPStreamError.new("#{ res.status }: #{ res.reason }") + end + + # decode gzipped content, if we know it's there from the headers + if res.respond_to?(:header) and !res.header['content-encoding'].empty? and + res.header['content-encoding'][0].downcase == 'gzip' + receive_string = decode_gzip(receive_string) + # otherwise check for the gzip header + elsif @accept_encoding_gzip && receive_string[0..1] == "\x1f\x8b" + receive_string = decode_gzip(receive_string) + end + conn_data.receive_string = receive_string + conn_data.receive_contenttype = res.contenttype + conn_data + end + + def send_accept_encoding_gzip? + @accept_encoding_gzip and defined?(::Zlib) + end + + def decode_gzip(instring) + unless send_accept_encoding_gzip? + raise HTTPStreamError.new("Gzipped response content.") + end + begin + gz = Zlib::GzipReader.new(StringIO.new(instring)) + gz.read + ensure + gz.close + end + end +end + + +end diff --git a/lib/soap/wsdlDriver.rb b/lib/soap/wsdlDriver.rb new file mode 100644 index 0000000..00b15d9 --- /dev/null +++ b/lib/soap/wsdlDriver.rb @@ -0,0 +1,164 @@ +# SOAP4R - SOAP WSDL driver +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/parser' +require 'wsdl/importer' +require 'xsd/qname' +require 'xsd/codegen/gensupport' +require 'soap/attrproxy' +require 'soap/mapping/wsdlencodedregistry' +require 'soap/mapping/wsdlliteralregistry' +require 'soap/rpc/driver' +require 'wsdl/soap/methodDefCreator' +require 'wsdl/soap/classDefCreatorSupport' +require 'wsdl/soap/classNameCreator' + + +module SOAP + + +class WSDLDriverFactory + include WSDL::SOAP::ClassDefCreatorSupport + + class FactoryError < StandardError; end + + attr_reader :wsdl + + def initialize(wsdl) + @wsdl = import(wsdl) + end + + def inspect + sprintf("#<%s:%s:0x%x\n\n%s>", self.class.name, @wsdl.name, __id__, dump_method_signatures) + end + + def create_rpc_driver(servicename = nil, portname = nil) + port = find_port(servicename, portname) + drv = SOAP::RPC::Driver.new(port.soap_address.location) + if binding = port.find_binding + init_driver(drv, binding) + add_operation(drv, binding) + end + drv + end + + def dump_method_signatures(servicename = nil, portname = nil) + targetservice = XSD::QName.new(@wsdl.targetnamespace, servicename) if servicename + targetport = XSD::QName.new(@wsdl.targetnamespace, portname) if portname + sig = [] + element_definitions = @wsdl.collect_elements + @wsdl.services.each do |service| + next if targetservice and service.name != targetservice + service.ports.each do |port| + next if targetport and port.name != targetport + if porttype = port.porttype + assigned_method = collect_assigned_method(porttype.name) + if binding = port.porttype.find_binding + sig << binding.operations.collect { |op_bind| + operation = op_bind.find_operation + name = assigned_method[op_bind.boundid] || op_bind.name + str = "= #{safemethodname(name)}\n\n" + str << dump_method_signature(name, operation, element_definitions) + str.gsub(/^#/, " ") + }.join("\n") + end + end + end + end + sig.join("\n") + end + +private + + def collect_assigned_method(porttypename) + name_creator = WSDL::SOAP::ClassNameCreator.new + methoddefcreator = + WSDL::SOAP::MethodDefCreator.new(@wsdl, name_creator, nil, {}) + methoddefcreator.dump(porttypename) + methoddefcreator.assigned_method + end + + def find_port(servicename = nil, portname = nil) + service = port = nil + if servicename + service = @wsdl.service( + XSD::QName.new(@wsdl.targetnamespace, servicename)) + else + service = @wsdl.services[0] + end + if service.nil? + raise FactoryError.new("service #{servicename} not found in WSDL") + end + if portname + port = service.ports[XSD::QName.new(@wsdl.targetnamespace, portname)] + if port.nil? + raise FactoryError.new("port #{portname} not found in WSDL") + end + else + port = service.ports.find { |port| !port.soap_address.nil? } + if port.nil? + raise FactoryError.new("no ports have soap:address") + end + end + if port.soap_address.nil? + raise FactoryError.new("soap:address element not found in WSDL") + end + port + end + + def init_driver(drv, binding) + wsdl_elements = @wsdl.collect_elements + wsdl_types = @wsdl.collect_complextypes + @wsdl.collect_simpletypes + rpc_decode_typemap = wsdl_types + + @wsdl.soap_rpc_complextypes(binding) + drv.proxy.mapping_registry = + Mapping::WSDLEncodedRegistry.new(rpc_decode_typemap) + drv.proxy.literal_mapping_registry = + Mapping::WSDLLiteralRegistry.new(wsdl_types, wsdl_elements) + end + + def add_operation(drv, binding) + name_creator = WSDL::SOAP::ClassNameCreator.new + modulepath = 'WSDLDriverFactory' + methoddefcreator = + WSDL::SOAP::MethodDefCreator.new(@wsdl, name_creator, modulepath, {}) + mdefs = methoddefcreator.create(binding.name) + if mdefs.nil? + raise FactoryError.new("no method definition found in WSDL") + end + mdefs.each do |mdef| + opt = { + :request_style => mdef.style, + :response_style => mdef.style, + :request_use => mdef.inputuse, + :response_use => mdef.outputuse + } + qname = mdef.qname + soapaction = mdef.soapaction + name = mdef.name + if mdef.style == :rpc + drv.add_rpc_operation(qname, soapaction, name, mdef.parameters, opt) + else + drv.add_document_operation(soapaction, name, mdef.parameters, opt) + end + orgname = mdef.qname.name + if orgname != name and orgname.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(drv, orgname) do |*arg| + __send__(name, *arg) + end + end + end + end + + def import(location) + WSDL::Importer.import(location) + end +end + + +end diff --git a/lib/wsdl/binding.rb b/lib/wsdl/binding.rb new file mode 100644 index 0000000..48477be --- /dev/null +++ b/lib/wsdl/binding.rb @@ -0,0 +1,65 @@ +# WSDL4R - WSDL binding definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' + + +module WSDL + + +class Binding < Info + attr_reader :name # required + attr_reader :type # required + attr_reader :operations + attr_reader :soapbinding + + def initialize + super + @name = nil + @type = nil + @operations = XSD::NamedElements.new + @soapbinding = nil + end + + def targetnamespace + parent.targetnamespace + end + + def parse_element(element) + case element + when OperationName + o = OperationBinding.new + @operations << o + o + when SOAPBindingName + o = WSDL::SOAP::Binding.new + @soapbinding = o + o + when DocumentationName + o = Documentation.new + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when NameAttrName + @name = XSD::QName.new(targetnamespace, value.source) + when TypeAttrName + @type = value + else + nil + end + end +end + + +end diff --git a/lib/wsdl/data.rb b/lib/wsdl/data.rb new file mode 100644 index 0000000..f645acb --- /dev/null +++ b/lib/wsdl/data.rb @@ -0,0 +1,64 @@ +# WSDL4R - WSDL data definitions. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/qname' +require 'wsdl/documentation' +require 'wsdl/definitions' +require 'wsdl/types' +require 'wsdl/message' +require 'wsdl/part' +require 'wsdl/portType' +require 'wsdl/operation' +require 'wsdl/param' +require 'wsdl/binding' +require 'wsdl/operationBinding' +require 'wsdl/service' +require 'wsdl/port' +require 'wsdl/import' + + +module WSDL + + +ArrayTypeAttrName = XSD::QName.new(Namespace, 'arrayType') +BindingName = XSD::QName.new(Namespace, 'binding') +DefinitionsName = XSD::QName.new(Namespace, 'definitions') +DocumentationName = XSD::QName.new(Namespace, 'documentation') +FaultName = XSD::QName.new(Namespace, 'fault') +ImportName = XSD::QName.new(Namespace, 'import') +InputName = XSD::QName.new(Namespace, 'input') +MessageName = XSD::QName.new(Namespace, 'message') +OperationName = XSD::QName.new(Namespace, 'operation') +OutputName = XSD::QName.new(Namespace, 'output') +PartName = XSD::QName.new(Namespace, 'part') +PortName = XSD::QName.new(Namespace, 'port') +PortTypeName = XSD::QName.new(Namespace, 'portType') +ServiceName = XSD::QName.new(Namespace, 'service') +TypesName = XSD::QName.new(Namespace, 'types') + +SchemaName = XSD::QName.new(XSD::Namespace, 'schema') + +SOAPAddressName = XSD::QName.new(SOAPBindingNamespace, 'address') +SOAPBindingName = XSD::QName.new(SOAPBindingNamespace, 'binding') +SOAPHeaderName = XSD::QName.new(SOAPBindingNamespace, 'header') +SOAPBodyName = XSD::QName.new(SOAPBindingNamespace, 'body') +SOAPFaultName = XSD::QName.new(SOAPBindingNamespace, 'fault') +SOAPOperationName = XSD::QName.new(SOAPBindingNamespace, 'operation') + +BindingAttrName = XSD::QName.new(nil, 'binding') +ElementAttrName = XSD::QName.new(nil, 'element') +LocationAttrName = XSD::QName.new(nil, 'location') +MessageAttrName = XSD::QName.new(nil, 'message') +NameAttrName = XSD::QName.new(nil, 'name') +NamespaceAttrName = XSD::QName.new(nil, 'namespace') +ParameterOrderAttrName = XSD::QName.new(nil, 'parameterOrder') +TargetNamespaceAttrName = XSD::QName.new(nil, 'targetNamespace') +TypeAttrName = XSD::QName.new(nil, 'type') + + +end diff --git a/lib/wsdl/definitions.rb b/lib/wsdl/definitions.rb new file mode 100644 index 0000000..2e76e0d --- /dev/null +++ b/lib/wsdl/definitions.rb @@ -0,0 +1,236 @@ +# WSDL4R - WSDL definitions. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' + + +module WSDL + + +class Definitions < Info + attr_reader :name + attr_reader :targetnamespace + attr_reader :imports + + attr_accessor :location + attr_reader :importedschema + + def initialize + super + @name = nil + @targetnamespace = nil + @location = nil + @importedschema = {} + + @types = nil + @imports = [] + @messages = XSD::NamedElements.new + @porttypes = XSD::NamedElements.new + @bindings = XSD::NamedElements.new + @services = XSD::NamedElements.new + + @anontypes = XSD::NamedElements.new + @root = self + end + + def inspect + sprintf("#<%s:0x%x %s>", self.class.name, __id__, @name || '(unnamed)') + end + + def targetnamespace=(targetnamespace) + @targetnamespace = targetnamespace + if @name + @name = XSD::QName.new(@targetnamespace, @name.name) + end + end + + def collect_attributes + collect_imports(:collect_attributes) + end + + def collect_modelgroups + collect_imports(:collect_modelgroups) + end + + def collect_attributegroups + collect_imports(:collect_attributegroups) + end + + def collect_elements + collect_imports(:collect_elements) + end + + def collect_complextypes + result = collect_imports(:collect_complextypes) + @anontypes.dup.concat(result) + end + + def collect_simpletypes + collect_imports(:collect_simpletypes) + end + + # ToDo: simpletype must be accepted... + def add_type(complextype) + @anontypes << complextype + end + + def messages + result = @messages.dup + @imports.each do |import| + result.concat(import.content.messages) if self.class === import.content + end + result + end + + def porttypes + result = @porttypes.dup + @imports.each do |import| + result.concat(import.content.porttypes) if self.class === import.content + end + result + end + + def bindings + result = @bindings.dup + @imports.each do |import| + result.concat(import.content.bindings) if self.class === import.content + end + result + end + + def services + result = @services.dup + @imports.each do |import| + result.concat(import.content.services) if self.class === import.content + end + result + end + + def message(name) + message = @messages[name] + return message if message + @imports.each do |import| + message = import.content.message(name) if self.class === import.content + return message if message + end + nil + end + + def porttype(name) + porttype = @porttypes[name] + return porttype if porttype + @imports.each do |import| + porttype = import.content.porttype(name) if self.class === import.content + return porttype if porttype + end + nil + end + + def binding(name) + binding = @bindings[name] + return binding if binding + @imports.each do |import| + binding = import.content.binding(name) if self.class === import.content + return binding if binding + end + nil + end + + def service(name) + service = @services[name] + return service if service + @imports.each do |import| + service = import.content.service(name) if self.class === import.content + return service if service + end + nil + end + + def porttype_binding(name) + binding = @bindings.find { |item| item.type == name } + return binding if binding + @imports.each do |import| + binding = import.content.porttype_binding(name) if self.class === import.content + return binding if binding + end + nil + end + + def parse_element(element) + case element + when ImportName + o = Import.new + @imports << o + o + when TypesName + o = Types.new + @types = o + o + when MessageName + o = Message.new + @messages << o + o + when PortTypeName + o = PortType.new + @porttypes << o + o + when BindingName + o = Binding.new + @bindings << o + o + when ServiceName + o = Service.new + @services << o + o + when DocumentationName + o = Documentation.new + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when NameAttrName + @name = XSD::QName.new(targetnamespace, value.source) + when TargetNamespaceAttrName + self.targetnamespace = value.source + else + nil + end + end + + def self.parse_element(element) + if element == DefinitionsName + Definitions.new + else + nil + end + end + +private + + def collect_imports(method) + result = XSD::NamedElements.new + if @types + @types.schemas.each do |schema| + result.concat(schema.send(method)) + end + end + @imports.each do |import| + result.concat(import.content.send(method)) + end + result + end + +end + + +end diff --git a/lib/wsdl/documentation.rb b/lib/wsdl/documentation.rb new file mode 100644 index 0000000..0cbf8f8 --- /dev/null +++ b/lib/wsdl/documentation.rb @@ -0,0 +1,32 @@ +# WSDL4R - WSDL SOAP documentation element. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL + + +class Documentation < Info + def initialize + super + end + + def parse_element(element) + # Accepts any element. + self + end + + def parse_attr(attr, value) + # Accepts any attribute. + true + end +end + + +end diff --git a/lib/wsdl/import.rb b/lib/wsdl/import.rb new file mode 100644 index 0000000..c1f262c --- /dev/null +++ b/lib/wsdl/import.rb @@ -0,0 +1,80 @@ +# WSDL4R - WSDL import definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/importer' + + +module WSDL + + +class Import < Info + attr_reader :namespace + attr_reader :location + attr_reader :content + + def initialize + super + @namespace = nil + @location = nil + @content = nil + @web_client = nil + end + + def parse_element(element) + case element + when DocumentationName + o = Documentation.new + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when NamespaceAttrName + @namespace = value.source + if @content + @content.targetnamespace = @namespace + end + @namespace + when LocationAttrName + @location = URI.parse(value.source) + if @location.relative? and !parent.location.nil? and + !parent.location.relative? + @location = parent.location + @location + end + if root.importedschema.key?(@location) + @content = root.importedschema[@location] + else + root.importedschema[@location] = nil # placeholder + @content = import(@location) + if @content.is_a?(Definitions) + @content.root = root + if @namespace + @content.targetnamespace = @namespace + end + end + root.importedschema[@location] = @content + end + @location + else + nil + end + end + +private + + def import(location) + Importer.import(location, root) + end +end + + +end diff --git a/lib/wsdl/importer.rb b/lib/wsdl/importer.rb new file mode 100644 index 0000000..0fe7298 --- /dev/null +++ b/lib/wsdl/importer.rb @@ -0,0 +1,38 @@ +# WSDL4R - WSDL importer library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/xmlSchema/importer' +require 'wsdl/parser' + + +module WSDL + + +class Importer < WSDL::XMLSchema::Importer + def self.import(location, originalroot = nil) + new.import(location, originalroot) + end + +private + + def parse(content, location, originalroot) + opt = { + :location => location, + :originalroot => originalroot + } + begin + WSDL::Parser.new(opt).parse(content) + rescue WSDL::Parser::ParseError + super(content, location, originalroot) + end + end + +end + + +end diff --git a/lib/wsdl/info.rb b/lib/wsdl/info.rb new file mode 100644 index 0000000..9c708af --- /dev/null +++ b/lib/wsdl/info.rb @@ -0,0 +1,50 @@ +# WSDL4R - WSDL information base. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module WSDL + + +class Info + attr_accessor :root + attr_accessor :parent + attr_accessor :id + + def initialize + @root = nil + @parent = nil + @id = nil + end + + def inspect + if self.respond_to?(:name) + sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.name) + else + sprintf("#<%s:0x%x>", self.class.name, __id__) + end + end + + def parse_element(element); end # abstract + + def parse_attr(attr, value); end # abstract + + def parse_epilogue; end # abstract + +private + + def to_int(value) + Integer(value.source) + end + + def to_boolean(value) + s = value.source + s == "true" or s == "1" + end +end + + +end diff --git a/lib/wsdl/message.rb b/lib/wsdl/message.rb new file mode 100644 index 0000000..d5aa1a5 --- /dev/null +++ b/lib/wsdl/message.rb @@ -0,0 +1,54 @@ +# WSDL4R - WSDL message definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL + + +class Message < Info + attr_reader :name # required + attr_reader :parts + + def initialize + super + @name = nil + @parts = [] + end + + def targetnamespace + parent.targetnamespace + end + + def parse_element(element) + case element + when PartName + o = Part.new + @parts << o + o + when DocumentationName + o = Documentation.new + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when NameAttrName + @name = XSD::QName.new(parent.targetnamespace, value.source) + else + nil + end + end +end + + +end diff --git a/lib/wsdl/operation.rb b/lib/wsdl/operation.rb new file mode 100644 index 0000000..9e0d8ca --- /dev/null +++ b/lib/wsdl/operation.rb @@ -0,0 +1,151 @@ +# WSDL4R - WSDL operation definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL + + +class Operation < Info + attr_reader :name # required + attr_reader :parameter_order # optional + attr_reader :input + attr_reader :output + attr_reader :fault + attr_reader :type # required + + def initialize + super + @name = nil + @type = nil + @parameter_order = nil + @input = nil + @output = nil + @fault = [] + end + + def targetnamespace + parent.targetnamespace + end + + def operationname + as_operationname(@name) + end + + EMPTY = [].freeze + # TODO: remove once after OperationInfo created + def inputparts + if message = input_message + sort_parts(message.parts) + else + EMPTY + end + end + + def inputname + if input + as_operationname(input.name ? input.name.name : @name) + else + nil + end + end + + # TODO: remove once after OperationInfo created + def outputparts + if message = output_message + sort_parts(message.parts) + else + EMPTY + end + end + + def outputname + if output + as_operationname(output.name ? output.name.name : @name + 'Response') + else + nil + end + end + + def parse_element(element) + case element + when InputName + o = Param.new + @input = o + o + when OutputName + o = Param.new + @output = o + o + when FaultName + o = Param.new + @fault << o + o + when DocumentationName + o = Documentation.new + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when NameAttrName + @name = value.source + when TypeAttrName + @type = value + when ParameterOrderAttrName + @parameter_order = value.source.split(/\s+/) + else + nil + end + end + +private + + def input_message + if input and message = input.find_message + message + else + nil + end + end + + def output_message + if output and message = output.find_message + message + else + nil + end + end + + def sort_parts(parts) + return parts.dup unless parameter_order + result = [] + parameter_order.each do |orderitem| + if (ele = parts.find { |part| part.name == orderitem }) + result << ele + end + end + if result.length == 0 + return parts.dup + end + # result length can be shorter than parts's. + # return part must not be a part of the parameterOrder. + result + end + + def as_operationname(name) + XSD::QName.new(targetnamespace, name) + end +end + + +end diff --git a/lib/wsdl/operationBinding.rb b/lib/wsdl/operationBinding.rb new file mode 100644 index 0000000..c1ecf42 --- /dev/null +++ b/lib/wsdl/operationBinding.rb @@ -0,0 +1,240 @@ +# WSDL4R - WSDL bound operation definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL + + +class OperationBinding < Info + attr_reader :name # required + attr_reader :input + attr_reader :output + attr_reader :fault + attr_reader :soapoperation + + class OperationInfo + attr_reader :boundid + attr_reader :qname + attr_reader :style + attr_accessor :inputuse + attr_accessor :outputuse + attr_reader :parts + attr_reader :faults + + def initialize(boundid, qname, style, inputuse, outputuse) + @boundid = boundid + @qname = qname + @style = style + @inputuse = inputuse + @outputuse = outputuse + @parts = [] + @faults = {} + end + end + + class Part + attr_reader :io_type + attr_reader :name + attr_reader :type + attr_reader :element + + def initialize(io_type, name, type, element) + @io_type = io_type + @name = name + @type = type + @element = element + end + end + + class BoundId + attr_reader :name + attr_reader :soapaction + + def initialize(name, soapaction) + @name = name + @soapaction = soapaction + end + + def ==(rhs) + !rhs.nil? and @name == rhs.name and @soapaction == rhs.soapaction + end + + def eql?(rhs) + (self == rhs) + end + + def hash + @name.hash ^ @soapaction.hash + end + end + + def initialize + super + @name = nil + @input = nil + @output = nil + @fault = [] + @soapoperation = nil + end + + def operation_info + qname = soapoperation_name() + style = soapoperation_style() + use_input = soapbody_use(@input) + use_output = soapbody_use(@output) + info = OperationInfo.new(boundid, qname, style, use_input, use_output) + op = find_operation() + if style == :rpc + info.parts.concat(collect_rpcparameter(op)) + else + info.parts.concat(collect_documentparameter(op)) + end + @fault.each do |fault| + op_fault = {} + soapfault = fault.soapfault + next if soapfault.nil? + op_fault[:ns] = fault.name.namespace + op_fault[:name] = fault.name.name + op_fault[:namespace] = soapfault.namespace + op_fault[:use] = soapfault.use || "literal" + op_fault[:encodingstyle] = soapfault.encodingstyle || "document" + info.faults[fault.name] = op_fault + end + info + end + + def targetnamespace + parent.targetnamespace + end + + def porttype + root.porttype(parent.type) + end + + def boundid + BoundId.new(name, soapaction) + end + + def find_operation + porttype.operations.each do |op| + next if op.name != @name + next if op.input and @input and op.input.name and @input.name and + op.input.name != @input.name + next if op.output and @output and op.output.name and @output.name and + op.output.name != @output.name + return op + end + raise RuntimeError.new("#{@name} not found") + end + + def soapoperation_name + op_name = find_operation.operationname + if @input and @input.soapbody and @input.soapbody.namespace + op_name = XSD::QName.new(@input.soapbody.namespace, op_name.name) + end + op_name + end + + def soapoperation_style + style = nil + if @soapoperation + style = @soapoperation.operation_style + elsif parent.soapbinding + style = parent.soapbinding.style + else + raise TypeError.new("operation style definition not found") + end + style || :document + end + + def soapaction + if @soapoperation + @soapoperation.soapaction + else + nil + end + end + + def parse_element(element) + case element + when InputName + o = Param.new + @input = o + o + when OutputName + o = Param.new + @output = o + o + when FaultName + o = Param.new + @fault << o + o + when SOAPOperationName + o = WSDL::SOAP::Operation.new + @soapoperation = o + o + when DocumentationName + o = Documentation.new + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when NameAttrName + @name = value.source + else + nil + end + end + +private + + def soapbody_use(param) + param ? param.soapbody_use : nil + end + + def collect_rpcparameter(operation) + result = operation.inputparts.collect { |part| + Part.new(:in, part.name, part.type, part.element) + } + outparts = operation.outputparts + if outparts.size > 0 + retval = outparts[0] + result << Part.new(:retval, retval.name, retval.type, retval.element) + cdr(outparts).each { |part| + result << Part.new(:out, part.name, part.type, part.element) + } + end + result + end + + def collect_documentparameter(operation) + param = [] + operation.inputparts.each do |input| + param << Part.new(:in, input.name, input.type, input.element) + end + operation.outputparts.each do |output| + param << Part.new(:out, output.name, output.type, output.element) + end + param + end + + def cdr(ary) + result = ary.dup + result.shift + result + end +end + + +end diff --git a/lib/wsdl/param.rb b/lib/wsdl/param.rb new file mode 100644 index 0000000..f36e1d1 --- /dev/null +++ b/lib/wsdl/param.rb @@ -0,0 +1,93 @@ +# WSDL4R - WSDL param definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL + + +class Param < Info + attr_reader :message # required + attr_reader :name # optional but required for fault. + attr_reader :soapbody + attr_reader :soapheader + attr_reader :soapfault + + def initialize + super + @message = nil + @name = nil + @soapbody = nil + @soapheader = [] + @soapfault = nil + end + + def targetnamespace + parent.targetnamespace + end + + def find_message + root.message(@message) or raise RuntimeError.new("#{@message} not found") + end + + def soapbody_use + if @soapbody + @soapbody.use || :literal + else + nil + end + end + + def soapbody_encodingstyle + if @soapbody + @soapbody.encodingstyle + else + nil + end + end + + def parse_element(element) + case element + when SOAPBodyName + o = WSDL::SOAP::Body.new + @soapbody = o + o + when SOAPHeaderName + o = WSDL::SOAP::Header.new + @soapheader << o + o + when SOAPFaultName + o = WSDL::SOAP::Fault.new + @soapfault = o + o + when DocumentationName + o = Documentation.new + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when MessageAttrName + if value.namespace.nil? + value = XSD::QName.new(targetnamespace, value.source) + end + @message = value + when NameAttrName + @name = XSD::QName.new(targetnamespace, value.source) + else + nil + end + end +end + + +end diff --git a/lib/wsdl/parser.rb b/lib/wsdl/parser.rb new file mode 100644 index 0000000..e84245f --- /dev/null +++ b/lib/wsdl/parser.rb @@ -0,0 +1,164 @@ +# WSDL4R - WSDL XML Instance parser library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/qname' +require 'xsd/charset' +require 'xsd/datatypes' +require 'xsd/xmlparser' +require 'soap/ns' +require 'wsdl/wsdl' +require 'wsdl/data' +require 'wsdl/xmlSchema/data' +require 'wsdl/soap/data' + + +module WSDL + + +class Parser + include WSDL + + class ParseError < Error; end + class FormatDecodeError < ParseError; end + class UnknownElementError < FormatDecodeError; end + class UnknownAttributeError < FormatDecodeError; end + class UnexpectedElementError < FormatDecodeError; end + class ElementConstraintError < FormatDecodeError; end + class AttributeConstraintError < FormatDecodeError; end + +private + + class ParseFrame + attr_reader :ns + attr_reader :name + attr_accessor :node + + private + + def initialize(ns, name, node) + @ns = ns + @name = name + @node = node + end + end + +public + + def initialize(opt = {}) + @parser = XSD::XMLParser.create_parser(self, opt) + @parsestack = nil + @lastnode = nil + @ignored = {} + @location = opt[:location] + @originalroot = opt[:originalroot] + end + + def parse(string_or_readable) + @parsestack = [] + @lastnode = nil + @textbuf = '' + @parser.do_parse(string_or_readable) + @lastnode + end + + def charset + @parser.charset + end + + def start_element(name, attrs) + lastframe = @parsestack.last + ns = parent = nil + if lastframe + ns = lastframe.ns + parent = lastframe.node + else + ns = ::SOAP::NS.new + parent = nil + end + # ns might be the same + ns, attrs = XSD::XMLParser.filter_ns(ns, attrs) + node = decode_tag(ns, name, attrs, parent) + @parsestack << ParseFrame.new(ns, name, node) + end + + def characters(text) + lastframe = @parsestack.last + if lastframe + # Need not to be cloned because character does not have attr. + ns = lastframe.ns + decode_text(ns, text) + else + p text if $DEBUG + end + end + + def end_element(name) + lastframe = @parsestack.pop + unless name == lastframe.name + raise UnexpectedElementError.new("closing element name '#{name}' does not match with opening element '#{lastframe.name}'") + end + decode_tag_end(lastframe.ns, lastframe.node) + @lastnode = lastframe.node + end + +private + + def decode_tag(ns, name, attrs, parent) + o = nil + elename = ns.parse(name) + if !parent + if elename == DefinitionsName + o = Definitions.parse_element(elename) + o.location = @location + else + raise UnknownElementError.new("unknown element: #{elename}") + end + o.root = @originalroot if @originalroot # o.root = o otherwise + else + if elename == XMLSchema::AnnotationName + # only the first annotation element is allowed for each xsd element. + o = XMLSchema::Annotation.new + else + o = parent.parse_element(elename) + end + if o.nil? + unless @ignored.key?(elename) + warn("ignored element: #{elename}") + @ignored[elename] = elename + end + o = Documentation.new # which accepts any element. + end + # node could be a pseudo element. pseudo element has its own parent. + o.root = parent.root + o.parent = parent if o.parent.nil? + end + attrs.each do |key, value| + attr_ele = ns.parse(key, true) + value_ele = ns.parse(value, false) + value_ele.source = value # for recovery; value may not be a QName + if o.parse_attr(attr_ele, value_ele).nil? + unless @ignored.key?(attr_ele) + warn("ignored attr: #{attr_ele}") + @ignored[attr_ele] = attr_ele + end + end + end + o + end + + def decode_tag_end(ns, node) + node.parse_epilogue + end + + def decode_text(ns, text) + @textbuf << text + end +end + + +end diff --git a/lib/wsdl/part.rb b/lib/wsdl/part.rb new file mode 100644 index 0000000..a52e6c3 --- /dev/null +++ b/lib/wsdl/part.rb @@ -0,0 +1,52 @@ +# WSDL4R - WSDL part definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL + + +class Part < Info + attr_reader :name # required + attr_reader :element # optional + attr_reader :type # optional + + def initialize + super + @name = nil + @element = nil + @type = nil + end + + def parse_element(element) + case element + when DocumentationName + o = Documentation.new + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when NameAttrName + @name = value.source + when ElementAttrName + @element = value + when TypeAttrName + @type = value + else + nil + end + end +end + + +end diff --git a/lib/wsdl/port.rb b/lib/wsdl/port.rb new file mode 100644 index 0000000..8fb7f1f --- /dev/null +++ b/lib/wsdl/port.rb @@ -0,0 +1,66 @@ +# WSDL4R - WSDL port definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL + + +class Port < Info + attr_reader :name # required + attr_reader :binding # required + attr_reader :soap_address + + def initialize + super + @name = nil + @binding = nil + @soap_address = nil + end + + def targetnamespace + parent.targetnamespace + end + + def porttype + root.porttype(find_binding.type) + end + + def find_binding + root.binding(@binding) or raise RuntimeError.new("#{@binding} not found") + end + + def parse_element(element) + case element + when SOAPAddressName + o = WSDL::SOAP::Address.new + @soap_address = o + o + when DocumentationName + o = Documentation.new + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when NameAttrName + @name = XSD::QName.new(targetnamespace, value.source) + when BindingAttrName + @binding = value + else + nil + end + end +end + + +end diff --git a/lib/wsdl/portType.rb b/lib/wsdl/portType.rb new file mode 100644 index 0000000..26269f2 --- /dev/null +++ b/lib/wsdl/portType.rb @@ -0,0 +1,75 @@ +# WSDL4R - WSDL portType definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' + + +module WSDL + + +class PortType < Info + attr_reader :name # required + attr_reader :operations + + def targetnamespace + parent.targetnamespace + end + + def initialize + super + @name = nil + @operations = XSD::NamedElements.new + end + + # may be nil if not defined + def find_binding + root.bindings.find { |item| item.type == @name } + end + + def locations + binding = find_binding + return [] if binding.nil? + bind_name = binding.name + result = [] + root.services.each do |service| + service.ports.each do |port| + if port.binding == bind_name + result << port.soap_address.location if port.soap_address + end + end + end + result + end + + def parse_element(element) + case element + when OperationName + o = Operation.new + @operations << o + o + when DocumentationName + o = Documentation.new + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when NameAttrName + @name = XSD::QName.new(targetnamespace, value.source) + else + nil + end + end +end + + +end diff --git a/lib/wsdl/service.rb b/lib/wsdl/service.rb new file mode 100644 index 0000000..1efbd59 --- /dev/null +++ b/lib/wsdl/service.rb @@ -0,0 +1,61 @@ +# WSDL4R - WSDL service definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' + + +module WSDL + + +class Service < Info + attr_reader :name # required + attr_reader :ports + attr_reader :soap_address + + def initialize + super + @name = nil + @ports = XSD::NamedElements.new + @soap_address = nil + end + + def targetnamespace + parent.targetnamespace + end + + def parse_element(element) + case element + when PortName + o = Port.new + @ports << o + o + when SOAPAddressName + o = WSDL::SOAP::Address.new + @soap_address = o + o + when DocumentationName + o = Documentation.new + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when NameAttrName + @name = XSD::QName.new(targetnamespace, value.source) + else + nil + end + end +end + + +end diff --git a/lib/wsdl/soap/address.rb b/lib/wsdl/soap/address.rb new file mode 100644 index 0000000..fc03aa2 --- /dev/null +++ b/lib/wsdl/soap/address.rb @@ -0,0 +1,40 @@ +# WSDL4R - WSDL SOAP address definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module SOAP + + +class Address < Info + attr_reader :location + + def initialize + super + @location = nil + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when LocationAttrName + @location = value.source + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/soap/binding.rb b/lib/wsdl/soap/binding.rb new file mode 100644 index 0000000..3b840c4 --- /dev/null +++ b/lib/wsdl/soap/binding.rb @@ -0,0 +1,49 @@ +# WSDL4R - WSDL SOAP binding definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module SOAP + + +class Binding < Info + attr_reader :style + attr_reader :transport + + def initialize + super + @style = nil + @transport = nil + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when StyleAttrName + if ["document", "rpc"].include?(value.source) + @style = value.source.intern + else + raise Parser::AttributeConstraintError.new( + "Unexpected value #{ value }.") + end + when TransportAttrName + @transport = value.source + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/soap/body.rb b/lib/wsdl/soap/body.rb new file mode 100644 index 0000000..b2392d7 --- /dev/null +++ b/lib/wsdl/soap/body.rb @@ -0,0 +1,58 @@ +# WSDL4R - WSDL SOAP body definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module SOAP + + +class Body < Info + attr_reader :parts + attr_reader :use # required + attr_reader :encodingstyle + attr_reader :namespace + + def initialize + super + @parts = nil + @use = nil + @encodingstyle = nil + @namespace = nil + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when PartsAttrName + @parts = value.source + when UseAttrName + if ['literal', 'encoded'].include?(value.source) + @use = value.source.intern + else + raise RuntimeError.new("unknown use of soap:body: #{value.source}") + end + when EncodingStyleAttrName + @encodingstyle = value.source + @encodingstyle = nil if @encodingstyle.to_s.empty? + value.source + when NamespaceAttrName + @namespace = value.source + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/soap/cgiStubCreator.rb b/lib/wsdl/soap/cgiStubCreator.rb new file mode 100644 index 0000000..9b73278 --- /dev/null +++ b/lib/wsdl/soap/cgiStubCreator.rb @@ -0,0 +1,92 @@ +# WSDL4R - Creating CGI stub code from WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/soap/mappingRegistryCreator' +require 'wsdl/soap/methodDefCreator' +require 'wsdl/soap/classDefCreatorSupport' + + +module WSDL +module SOAP + + +class CGIStubCreator + include ClassDefCreatorSupport + + attr_reader :definitions + + def initialize(definitions, name_creator, modulepath = nil) + @definitions = definitions + @name_creator = name_creator + @modulepath = modulepath + end + + def dump(service_name) + warn("CGI stub can have only 1 port. Creating stub for the first port... Rests are ignored.") + services = @definitions.service(service_name) + unless services + raise RuntimeError.new("service not defined: #{service_name}") + end + ports = services.ports + if ports.empty? + raise RuntimeError.new("ports not found for #{service_name}") + end + port = ports[0] + if port.porttype.nil? + raise RuntimeError.new("porttype not found for #{port}") + end + dump_porttype(port.porttype) + end + +private + + def dump_porttype(porttype) + class_name = mapped_class_name(porttype.name, @modulepath) + defined_const = {} + methoddef = MethodDefCreator.new(@definitions, @name_creator, @modulepath, defined_const).dump(porttype.name) + wsdl_name = @definitions.name ? @definitions.name.name : 'default' + mrname = safeconstname(wsdl_name + 'MappingRegistry') + c1 = XSD::CodeGen::ClassDef.new(class_name) + c1.def_require("soap/rpc/cgistub") + c1.def_code <<-EOD +Methods = [ +#{methoddef.gsub(/^/, " ")} +] + EOD + defined_const.each do |ns, tag| + c1.def_const(tag, dq(ns)) + end + c2 = XSD::CodeGen::ClassDef.new(class_name + "App", + "::SOAP::RPC::CGIStub") + c2.def_method("initialize", "*arg") do + <<-EOD + super(*arg) + servant = #{class_name}.new + #{class_name}::Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + @router.add_document_operation(servant, *definitions) + else + @router.add_rpc_operation(servant, *definitions) + end + end + self.mapping_registry = #{mrname}::EncodedRegistry + self.literal_mapping_registry = #{mrname}::LiteralRegistry + self.level = Logger::Severity::ERROR + EOD + end + c1.dump + "\n" + c2.dump + format(<<-EOD) + #{class_name}App.new('app', nil).start + EOD + end +end + + +end +end diff --git a/lib/wsdl/soap/classDefCreator.rb b/lib/wsdl/soap/classDefCreator.rb new file mode 100644 index 0000000..224b9d8 --- /dev/null +++ b/lib/wsdl/soap/classDefCreator.rb @@ -0,0 +1,433 @@ +# WSDL4R - Creating class definition from WSDL +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/data' +require 'wsdl/soap/classDefCreatorSupport' +require 'xsd/codegen' +require 'set' + + +module WSDL +module SOAP + + +class ClassDefCreator + include ClassDefCreatorSupport + include XSD::CodeGen + + def initialize(definitions, name_creator, modulepath = nil) + @definitions = definitions + @name_creator = name_creator + @modulepath = modulepath + @elements = definitions.collect_elements + @elements.uniq! + @attributes = definitions.collect_attributes + @attributes.uniq! + @simpletypes = definitions.collect_simpletypes + @simpletypes.uniq! + @complextypes = definitions.collect_complextypes + @complextypes.uniq! + @modelgroups = definitions.collect_modelgroups + @modelgroups.uniq! + @faulttypes = nil + if definitions.respond_to?(:collect_faulttypes) + @faulttypes = definitions.collect_faulttypes + end + @defined_const = {} + end + + def dump(type = nil) + result = "require 'xsd/qname'\n" + # cannot use @modulepath because of multiple classes + if @modulepath + result << "\n" + result << modulepath_split(@modulepath).collect { |ele| "module #{ele}" }.join("; ") + result << "\n\n" + end + str = dump_group(type) + unless str.empty? + result << "\n" unless result.empty? + result << str + end + str = dump_complextype(type) + unless str.empty? + result << "\n" unless result.empty? + result << str + end + str = dump_simpletype(type) + unless str.empty? + result << "\n" unless result.empty? + result << str + end + str = dump_element(type) + unless str.empty? + result << "\n" unless result.empty? + result << str + end + str = dump_attribute(type) + unless str.empty? + result << "\n" unless result.empty? + result << str + end + if @modulepath + result << "\n\n" + result << modulepath_split(@modulepath).collect { |ele| "end" }.join("; ") + result << "\n" + end + result + end + +private + + def dump_element(target = nil) + @elements.collect { |ele| + next if @complextypes[ele.name] + next if target and target != ele.name + c = create_elementdef(@modulepath, ele) + c ? c.dump : nil + }.compact.join("\n") + end + + def dump_attribute(target = nil) + @attributes.collect { |attribute| + next if target and target != attribute.name + if attribute.local_simpletype + c = create_simpletypedef(@modulepath, attribute.name, attribute.local_simpletype) + end + c ? c.dump : nil + }.compact.join("\n") + end + + def dump_simpletype(target = nil) + @simpletypes.collect { |type| + next if target and target != type.name + c = create_simpletypedef(@modulepath, type.name, type) + c ? c.dump : nil + }.compact.join("\n") + end + + def dump_complextype(target = nil) + definitions = sort_dependency(@complextypes).collect { |type| + next if target and target != type.name + c = create_complextypedef(@modulepath, type.name, type) + c ? c.dump : nil + }.compact.join("\n") + end + + def dump_group(target = nil) + definitions = @modelgroups.collect { |group| + # TODO: not dumped for now but may be useful in the future + }.compact.join("\n") + end + + def create_elementdef(mpath, ele) + qualified = (ele.elementform == 'qualified') + if ele.local_complextype + create_complextypedef(mpath, ele.name, ele.local_complextype, qualified) + elsif ele.local_simpletype + create_simpletypedef(mpath, ele.name, ele.local_simpletype, qualified) + elsif ele.empty? + create_simpleclassdef(mpath, ele.name, nil) + else + # ignores type only element + nil + end + end + + def create_simpletypedef(mpath, qname, simpletype, qualified = false) + if simpletype.restriction + create_simpletypedef_restriction(mpath, qname, simpletype, qualified) + elsif simpletype.list + create_simpletypedef_list(mpath, qname, simpletype, qualified) + elsif simpletype.union + create_simpletypedef_union(mpath, qname, simpletype, qualified) + else + raise RuntimeError.new("unknown kind of simpletype: #{simpletype}") + end + end + + def create_simpletypedef_restriction(mpath, qname, typedef, qualified) + restriction = typedef.restriction + unless restriction.enumeration? + # not supported. minlength? + return nil + end + classname = mapped_class_basename(qname, mpath) + c = ClassDef.new(classname, '::String') + c.comment = "#{qname}" + define_classenum_restriction(c, classname, restriction.enumeration) + c + end + + def create_simpletypedef_list(mpath, qname, typedef, qualified) + list = typedef.list + classname = mapped_class_basename(qname, mpath) + c = ClassDef.new(classname, '::Array') + c.comment = "#{qname}" + if simpletype = list.local_simpletype + if simpletype.restriction.nil? + raise RuntimeError.new( + "unknown kind of simpletype: #{simpletype}") + end + define_stringenum_restriction(c, simpletype.restriction.enumeration) + c.comment << "\n contains list of #{classname}::*" + elsif list.itemtype + c.comment << "\n contains list of #{mapped_class_basename(list.itemtype, mpath)}::*" + else + raise RuntimeError.new("unknown kind of list: #{list}") + end + c + end + + def create_simpletypedef_union(mpath, qname, typedef, qualified) + union = typedef.union + classname = mapped_class_basename(qname, mpath) + c = ClassDef.new(classname, '::String') + c.comment = "#{qname}" + if union.member_types + # fixme + c.comment << "\n any of #{union.member_types}" + end + c + end + + def define_stringenum_restriction(c, enumeration) + const = {} + enumeration.each do |value| + constname = safeconstname(value) + const[constname] ||= 0 + if (const[constname] += 1) > 1 + constname += "_#{const[constname]}" + end + c.def_const(constname, ndq(value)) + end + end + + def define_classenum_restriction(c, classname, enumeration) + const = {} + enumeration.each do |value| + constname = safeconstname(value) + const[constname] ||= 0 + if (const[constname] += 1) > 1 + constname += "_#{const[constname]}" + end + c.def_const(constname, "new(#{ndq(value)})") + end + end + + def create_simpleclassdef(mpath, qname, type_or_element) + classname = mapped_class_basename(qname, mpath) + c = ClassDef.new(classname, '::String') + c.comment = "#{qname}" + init_lines = [] + if type_or_element and !type_or_element.attributes.empty? + define_attribute(c, type_or_element.attributes) + init_lines << "@__xmlattr = {}" + end + c.def_method('initialize', '*arg') do + "super\n" + init_lines.join("\n") + end + c + end + + def create_complextypedef(mpath, qname, type, qualified = false) + case type.compoundtype + when :TYPE_STRUCT, :TYPE_EMPTY + create_structdef(mpath, qname, type, qualified) + when :TYPE_ARRAY + create_arraydef(mpath, qname, type) + when :TYPE_SIMPLE + create_simpleclassdef(mpath, qname, type) + when :TYPE_MAP + # mapped as a general Hash + nil + else + raise RuntimeError.new( + "unknown kind of complexContent: #{type.compoundtype}") + end + end + + def create_structdef(mpath, qname, typedef, qualified = false) + classname = mapped_class_basename(qname, mpath) + baseclassname = nil + if typedef.complexcontent + if base = typedef.complexcontent.base + # :TYPE_ARRAY must not be derived (#424) + basedef = @complextypes[base] + if basedef and basedef.compoundtype != :TYPE_ARRAY + # baseclass should be a toplevel complexType + baseclassname = mapped_class_basename(base, @modulepath) + end + end + end + if @faulttypes and @faulttypes.index(qname) + c = ClassDef.new(classname, '::StandardError') + else + c = ClassDef.new(classname, baseclassname) + end + c.comment = "#{qname}" + c.comment << "\nabstract" if typedef.abstract + parentmodule = mapped_class_name(qname, mpath) + init_lines, init_params = + parse_elements(c, typedef.elements, qname.namespace, parentmodule) + unless typedef.attributes.empty? + define_attribute(c, typedef.attributes) + init_lines << "@__xmlattr = {}" + end + c.def_method('initialize', *init_params) do + init_lines.join("\n") + end + c + end + + def parse_elements(c, elements, base_namespace, mpath, as_array = false) + init_lines = [] + init_params = [] + any = false + elements.each do |element| + case element + when XMLSchema::Any + # only 1 is allowed for now. + raise RuntimeError.new("duplicated 'any'") if any + any = true + attrname = '__xmlele_any' + c.def_attr(attrname, false, attrname) + c.def_method('set_any', 'elements') do + '@__xmlele_any = elements' + end + init_lines << "@__xmlele_any = nil" + when XMLSchema::Element + next if element.ref == SchemaName + name = name_element(element).name + typebase = @modulepath + if element.anonymous_type? + inner = create_elementdef(mpath, element) + unless as_array + inner.comment = "inner class for member: #{name}\n" + inner.comment + end + c.innermodule << inner + typebase = mpath + end + unless as_array + attrname = safemethodname(name) + varname = safevarname(name) + c.def_attr(attrname, true, varname) + init_lines << "@#{varname} = #{varname}" + if element.map_as_array? + init_params << "#{varname} = []" + else + init_params << "#{varname} = nil" + end + c.comment << "\n #{attrname} - #{create_type_name(typebase, element) || '(any)'}" + end + when WSDL::XMLSchema::Sequence + child_init_lines, child_init_params = + parse_elements(c, element.elements, base_namespace, mpath, as_array) + init_lines.concat(child_init_lines) + init_params.concat(child_init_params) + when WSDL::XMLSchema::Choice + child_init_lines, child_init_params = + parse_elements(c, element.elements, base_namespace, mpath, as_array) + init_lines.concat(child_init_lines) + init_params.concat(child_init_params) + when WSDL::XMLSchema::Group + if element.content.nil? + warn("no group definition found: #{element}") + next + end + child_init_lines, child_init_params = + parse_elements(c, element.content.elements, base_namespace, mpath, as_array) + init_lines.concat(child_init_lines) + init_params.concat(child_init_params) + else + raise RuntimeError.new("unknown type: #{element}") + end + end + [init_lines, init_params] + end + + def define_attribute(c, attributes) + const = {} + unless attributes.empty? + c.def_method("__xmlattr") do <<-__EOD__ + @__xmlattr ||= {} + __EOD__ + end + end + attributes.each do |attribute| + name = name_attribute(attribute) + methodname = safemethodname('xmlattr_' + name.name) + constname = 'Attr' + safeconstname(name.name) + const[constname] ||= 0 + if (const[constname] += 1) > 1 + constname += "_#{const[constname]}" + end + c.def_const(constname, dqname(name)) + c.def_method(methodname) do <<-__EOD__ + __xmlattr[#{constname}] + __EOD__ + end + c.def_method(methodname + '=', 'value') do <<-__EOD__ + __xmlattr[#{constname}] = value + __EOD__ + end + c.comment << "\n #{methodname} - #{attribute_basetype(attribute) || '(any)'}" + end + end + + def create_arraydef(mpath, qname, typedef) + classname = mapped_class_basename(qname, mpath) + c = ClassDef.new(classname, '::Array') + c.comment = "#{qname}" + parentmodule = mapped_class_name(qname, mpath) + parse_elements(c, typedef.elements, qname.namespace, parentmodule, true) + c + end + + def sort_dependency(types) + dep = {} + root = [] + types.each do |type| + if type.complexcontent and (base = type.complexcontent.base) + dep[base] ||= [] + dep[base] << type + else + root << type + end + end + sorted = [] + root.each do |type| + sorted.concat(collect_dependency(type, dep)) + end + sorted.concat(dep.values.flatten) + sorted + end + + # removes collected key from dep + def collect_dependency(type, dep) + result = [type] + return result unless dep.key?(type.name) + dep[type.name].each do |deptype| + result.concat(collect_dependency(deptype, dep)) + end + dep.delete(type.name) + result + end + + def modulepath_split(modulepath) + if modulepath.is_a?(::Array) + modulepath + else + modulepath.to_s.split('::') + end + end +end + + +end +end diff --git a/lib/wsdl/soap/classDefCreatorSupport.rb b/lib/wsdl/soap/classDefCreatorSupport.rb new file mode 100644 index 0000000..5d7d8ea --- /dev/null +++ b/lib/wsdl/soap/classDefCreatorSupport.rb @@ -0,0 +1,240 @@ +# WSDL4R - Creating class code support from WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'soap/mapping' +require 'soap/mapping/typeMap' +require 'xsd/codegen/gensupport' + + +module WSDL +module SOAP + + +# requires @defined_const, @simpletypes, @name_creator +module ClassDefCreatorSupport + include XSD::CodeGen::GenSupport + + def mapped_class_name(qname, modulepath) + @name_creator.assign_name(qname, modulepath) + end + + def mapped_class_basename(qname, modulepath) + classname = @name_creator.assign_name(qname, modulepath) + classname.sub(/\A.*:/, '') + end + + def basetype_mapped_class(name) + ::SOAP::TypeMap[name] + end + + def dump_method_signature(name, operation, element_definitions) + methodname = safemethodname(name) + input = operation.input + output = operation.output + fault = operation.fault + signature = "#{methodname}#{dump_inputparam(input)}" + str = <<__EOD__ +# SYNOPSIS +# #{methodname}#{dump_inputparam(input)} +# +# ARGS +#{dump_inout_type(input, element_definitions).chomp} +# +# RETURNS +#{dump_inout_type(output, element_definitions).chomp} +# +__EOD__ + unless fault.empty? + str <<<<__EOD__ +# RAISES +#{dump_fault_type(fault, element_definitions)} +# +__EOD__ + end + str + end + + def dq(ele) + ele.dump + end + + def ndq(ele) + ele.nil? ? 'nil' : dq(ele) + end + + def sym(ele) + ':' + ele.id2name + end + + def nsym(ele) + ele.nil? ? 'nil' : sym(ele) + end + + def dqname(qname) + if @defined_const.key?(qname.namespace) + qname.dump(@defined_const[qname.namespace]) + else + qname.dump + end + end + + def assign_const(value, prefix = '') + return if value.nil? or @defined_const.key?(value) + name = value.scan(/[^:\/]+\/?\z/)[0] || 'C' + tag = prefix + safeconstname(name) + if @defined_const.value?(tag) + idx = 0 + while true + tag = prefix + safeconstname(name + "_#{idx}") + break unless @defined_const.value?(tag) + idx += 1 + raise RuntimeError.new("too much similar names") if idx > 100 + end + end + @defined_const[value] = tag + end + + def create_type_name(modulepath, element) + if element.type == XSD::AnyTypeName + # nil means anyType. + nil + elsif simpletype = @simpletypes[element.type] + if simpletype.restriction and simpletype.restriction.enumeration? + mapped_class_name(element.type, modulepath) + else + nil + end + elsif klass = element_basetype(element) + klass.name + elsif element.type + mapped_class_name(element.type, modulepath) + elsif element.ref + mapped_class_name(element.ref, modulepath) + elsif element.anonymous_type? + # inner class + mapped_class_name(element.name, modulepath) + else + nil + end + end + +private + + def dump_inout_type(param, element_definitions) + if param + message = param.find_message + params = "" + message.parts.each do |part| + name = safevarname(part.name) + if part.type + typename = safeconstname(part.type.name) + qname = part.type + params << add_at("# #{name}", "#{typename} - #{qname}\n", 20) + elsif part.element + ele = element_definitions[part.element] + if ele.type + typename = safeconstname(ele.type.name) + qname = ele.type + else + typename = safeconstname(ele.name.name) + qname = ele.name + end + params << add_at("# #{name}", "#{typename} - #{qname}\n", 20) + end + end + unless params.empty? + return params + end + end + "# N/A\n" + end + + def dump_inputparam(input) + message = input.find_message + params = "" + message.parts.each do |part| + params << ", " unless params.empty? + params << safevarname(part.name) + end + if params.empty? + "" + else + "(#{ params })" + end + end + + def add_at(base, str, pos) + if base.size >= pos + base + ' ' + str + else + base + ' ' * (pos - base.size) + str + end + end + + def dump_fault_type(fault, element_definitions) + fault.collect { |ele| + dump_inout_type(ele, element_definitions).chomp + }.join("\n") + end + + def element_basetype(ele) + if klass = basetype_class(ele.type) + klass + elsif ele.local_simpletype + basetype_class(ele.local_simpletype.base) + else + nil + end + end + + def attribute_basetype(attr) + if klass = basetype_class(attr.type) + klass + elsif attr.local_simpletype + basetype_class(attr.local_simpletype.base) + else + nil + end + end + + def basetype_class(type) + return nil if type.nil? + if simpletype = @simpletypes[type] + basetype_mapped_class(simpletype.base) + else + basetype_mapped_class(type) + end + end + + def name_element(element) + return element.name if element.name + return element.ref if element.ref + raise RuntimeError.new("cannot define name of #{element}") + end + + def name_attribute(attribute) + return attribute.name if attribute.name + return attribute.ref if attribute.ref + raise RuntimeError.new("cannot define name of #{attribute}") + end + + # TODO: run MethodDefCreator just once in 1.6.X. + # MethodDefCreator should return parsed struct, not a String. + def collect_assigned_method(wsdl, porttypename, modulepath = nil) + name_creator = WSDL::SOAP::ClassNameCreator.new + methoddefcreator = + WSDL::SOAP::MethodDefCreator.new(wsdl, name_creator, modulepath, {}) + methoddefcreator.dump(porttypename) + methoddefcreator.assigned_method + end +end + + +end +end diff --git a/lib/wsdl/soap/classNameCreator.rb b/lib/wsdl/soap/classNameCreator.rb new file mode 100644 index 0000000..10c7e38 --- /dev/null +++ b/lib/wsdl/soap/classNameCreator.rb @@ -0,0 +1,54 @@ +# WSDL4R - Class name creator. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/mapping/typeMap' +require 'xsd/codegen/gensupport' + + +module WSDL +module SOAP + + +class ClassNameCreator + include XSD::CodeGen::GenSupport + + def initialize + @classname = {} + end + + def assign_name(qname, modulepath = nil) + key = [modulepath, qname] + unless @classname.key?(key) + if klass = ::SOAP::TypeMap[qname] + name = + ::SOAP::Mapping::DefaultRegistry.find_mapped_obj_class(klass).name + else + name = safeconstname(qname.name) + if modulepath + name = [modulepath, name].join('::') + end + while @classname.value?(name) + name += '_' + end + check_classname(name) + end + @classname[key] = name.freeze + end + @classname[key] + end + + def check_classname(name) + if Object.constants.include?(name) + warn("created definition re-opens an existing toplevel class: #{name}. consider to use --module_path option of wsdl2ruby.rb") + end + end +end + + +end +end diff --git a/lib/wsdl/soap/clientSkeltonCreator.rb b/lib/wsdl/soap/clientSkeltonCreator.rb new file mode 100644 index 0000000..cd6d338 --- /dev/null +++ b/lib/wsdl/soap/clientSkeltonCreator.rb @@ -0,0 +1,104 @@ +# WSDL4R - Creating client skelton code from WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/soap/classDefCreatorSupport' + + +module WSDL +module SOAP + + +class ClientSkeltonCreator + include ClassDefCreatorSupport + + attr_reader :definitions + + def initialize(definitions, name_creator, modulepath = nil) + @definitions = definitions + @name_creator = name_creator + @modulepath = modulepath + end + + def dump(service_name) + services = @definitions.service(service_name) + unless services + raise RuntimeError.new("service not defined: #{service_name}") + end + result = "" + if @modulepath + result << "\n" + result << @modulepath.collect { |ele| "module #{ele}" }.join("; ") + result << "\n\n" + end + services.ports.each do |port| + result << dump_porttype(port.porttype) + result << "\n" + end + if @modulepath + result << "\n\n" + result << @modulepath.collect { |ele| "end" }.join("; ") + result << "\n" + end + result + end + +private + + def dump_porttype(porttype) + assigned_method = collect_assigned_method(@definitions, porttype.name, @modulepath) + drv_name = mapped_class_basename(porttype.name, @modulepath) + + result = "" + result << <<__EOD__ +endpoint_url = ARGV.shift +obj = #{ drv_name }.new(endpoint_url) + +# run ruby with -d to see SOAP wiredumps. +obj.wiredump_dev = STDERR if $DEBUG + +__EOD__ + element_definitions = @definitions.collect_elements + binding = porttype.find_binding + if binding + binding.operations.each do |op_bind| + operation = op_bind.find_operation + if operation.nil? + warn("operation not found for binding: #{op_bind}") + next + end + name = assigned_method[op_bind.boundid] || operation.name + result << dump_method_signature(name, operation, element_definitions) + result << dump_input_init(operation.input) << "\n" + result << dump_operation(name, operation) << "\n\n" + end + end + result + end + + def dump_operation(name, operation) + input = operation.input + "puts obj.#{ safemethodname(name) }#{ dump_inputparam(input) }" + end + + def dump_input_init(input) + result = input.find_message.parts.collect { |part| + safevarname(part.name) + }.join(" = ") + if result.empty? + "" + else + result << " = nil" + end + result + end +end + + +end +end diff --git a/lib/wsdl/soap/complexType.rb b/lib/wsdl/soap/complexType.rb new file mode 100644 index 0000000..bbf6b50 --- /dev/null +++ b/lib/wsdl/soap/complexType.rb @@ -0,0 +1,173 @@ +# WSDL4R - SOAP complexType definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/xmlSchema/complexType' +require 'soap/mapping' + + +module WSDL +module XMLSchema + + +class ComplexType < Info + def compoundtype + @compoundtype ||= check_type + end + + def check_type + if have_any? + :TYPE_STRUCT + elsif content + if attributes.empty? and map_as_array? + if name == ::SOAP::Mapping::MapQName + :TYPE_MAP + else + :TYPE_ARRAY + end + else + :TYPE_STRUCT + end + elsif complexcontent + complexcontent.check_type + elsif simplecontent + :TYPE_SIMPLE + elsif !attributes.empty? + :TYPE_STRUCT + else # empty complexType definition (seen in partner.wsdl of salesforce) + :TYPE_EMPTY + end + end + + def child_type(name = nil) + case compoundtype + when :TYPE_STRUCT + if ele = find_element(name) + ele.type + elsif ele = find_element_by_name(name.name) + ele.type + end + when :TYPE_ARRAY + @contenttype ||= content_arytype + when :TYPE_MAP + item_ele = find_element_by_name("item") or + raise RuntimeError.new("'item' element not found in Map definition.") + content = item_ele.local_complextype or + raise RuntimeError.new("No complexType definition for 'item'.") + if ele = content.find_element(name) + ele.type + elsif ele = content.find_element_by_name(name.name) + ele.type + end + else + raise NotImplementedError.new("Unknown kind of complexType.") + end + end + + def child_defined_complextype(name) + ele = nil + case compoundtype + when :TYPE_STRUCT, :TYPE_MAP + unless ele = find_element(name) + if name.namespace.nil? + ele = find_element_by_name(name.name) + end + end + when :TYPE_ARRAY + e = elements + if e.size == 1 + ele = e[0] + else + raise RuntimeError.new("Assert: must not reach.") + end + else + raise RuntimeError.new("Assert: Not implemented.") + end + unless ele + raise RuntimeError.new("Cannot find #{name} as a children of #{@name}.") + end + ele.local_complextype + end + + def find_soapenc_arytype + unless compoundtype == :TYPE_ARRAY + raise RuntimeError.new("Assert: not for array") + end + if complexcontent + if complexcontent.restriction + complexcontent.restriction.attributes.each do |attribute| + if attribute.ref == ::SOAP::AttrArrayTypeName + return attribute.arytype + end + end + end + end + nil + end + + def find_arytype + unless compoundtype == :TYPE_ARRAY + raise RuntimeError.new("Assert: not for array") + end + if arytype = find_soapenc_arytype + return arytype + end + if map_as_array? + return element_simpletype(elements[0]) + end + raise RuntimeError.new("Assert: Unknown array definition.") + end + + def find_aryelement + unless compoundtype == :TYPE_ARRAY + raise RuntimeError.new("Assert: not for array") + end + if map_as_array? + return nested_elements[0] + end + nil # use default item name + end + +private + + def element_simpletype(element) + case element + when XMLSchema::Element + if element.type + element.type + elsif element.local_simpletype + element.local_simpletype.base + else + # element definition + nil + end + when XMLSchema::Any + XSD::AnyTypeName + else + nil + end + end + + def map_as_array? + e = nested_elements + e.size == 1 and e[0].map_as_array? + end + + def content_arytype + if arytype = find_arytype + ns = arytype.namespace + name = arytype.name.sub(/\[(?:,)*\]$/, '') + XSD::QName.new(ns, name) + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/soap/data.rb b/lib/wsdl/soap/data.rb new file mode 100644 index 0000000..56bbadf --- /dev/null +++ b/lib/wsdl/soap/data.rb @@ -0,0 +1,42 @@ +# WSDL4R - WSDL SOAP binding data definitions. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/qname' +require 'wsdl/soap/definitions' +require 'wsdl/soap/binding' +require 'wsdl/soap/operation' +require 'wsdl/soap/body' +require 'wsdl/soap/element' +require 'wsdl/soap/header' +require 'wsdl/soap/headerfault' +require 'wsdl/soap/fault' +require 'wsdl/soap/address' +require 'wsdl/soap/complexType' + + +module WSDL +module SOAP + + +HeaderFaultName = XSD::QName.new(SOAPBindingNamespace, 'headerfault') + +LocationAttrName = XSD::QName.new(nil, 'location') +StyleAttrName = XSD::QName.new(nil, 'style') +TransportAttrName = XSD::QName.new(nil, 'transport') +UseAttrName = XSD::QName.new(nil, 'use') +PartsAttrName = XSD::QName.new(nil, 'parts') +PartAttrName = XSD::QName.new(nil, 'part') +NameAttrName = XSD::QName.new(nil, 'name') +MessageAttrName = XSD::QName.new(nil, 'message') +EncodingStyleAttrName = XSD::QName.new(nil, 'encodingStyle') +NamespaceAttrName = XSD::QName.new(nil, 'namespace') +SOAPActionAttrName = XSD::QName.new(nil, 'soapAction') + + +end +end diff --git a/lib/wsdl/soap/definitions.rb b/lib/wsdl/soap/definitions.rb new file mode 100644 index 0000000..7a42a4c --- /dev/null +++ b/lib/wsdl/soap/definitions.rb @@ -0,0 +1,200 @@ +# WSDL4R - WSDL additional definitions for SOAP. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' +require 'soap/mapping' + + +module WSDL + + +class Definitions < Info + def self.soap_rpc_complextypes + types = XSD::NamedElements.new + types << array_complextype + types << fault_complextype + types << exception_complextype + types + end + + def self.array_complextype + type = XMLSchema::ComplexType.new(::SOAP::ValueArrayName) + type.complexcontent = XMLSchema::ComplexContent.new + type.complexcontent.restriction = XMLSchema::ComplexRestriction.new + type.complexcontent.restriction.base = ::SOAP::ValueArrayName + attr = XMLSchema::Attribute.new + attr.ref = ::SOAP::AttrArrayTypeName + anyarray = XSD::QName.new( + XSD::AnyTypeName.namespace, + XSD::AnyTypeName.name + '[]') + attr.arytype = anyarray + type.complexcontent.restriction.attributes << attr + type + end + +=begin + + + + + + + + +=end + def self.fault_complextype + type = XMLSchema::ComplexType.new(::SOAP::EleFaultName) + faultcode = XMLSchema::Element.new(::SOAP::EleFaultCodeName, XSD::XSDQName::Type) + faultstring = XMLSchema::Element.new(::SOAP::EleFaultStringName, XSD::XSDString::Type) + faultactor = XMLSchema::Element.new(::SOAP::EleFaultActorName, XSD::XSDAnyURI::Type) + faultactor.minoccurs = 0 + detail = XMLSchema::Element.new(::SOAP::EleFaultDetailName, XSD::AnyTypeName) + detail.minoccurs = 0 + type.all_elements = [faultcode, faultstring, faultactor, detail] + type.final = 'extension' + type + end + + def self.exception_complextype + type = XMLSchema::ComplexType.new(XSD::QName.new( + ::SOAP::Mapping::RubyCustomTypeNamespace, 'SOAPException')) + excn_name = XMLSchema::Element.new(XSD::QName.new(nil, 'excn_type_name'), XSD::XSDString::Type) + cause = XMLSchema::Element.new(XSD::QName.new(nil, 'cause'), XSD::AnyTypeName) + backtrace = XMLSchema::Element.new(XSD::QName.new(nil, 'backtrace'), ::SOAP::ValueArrayName) + message = XMLSchema::Element.new(XSD::QName.new(nil, 'message'), XSD::XSDString::Type) + type.all_elements = [excn_name, cause, backtrace, message] + type + end + + def soap_rpc_complextypes(binding) + types = rpc_operation_complextypes(binding) + types + self.class.soap_rpc_complextypes + end + + def collect_faulttypes + result = [] + collect_fault_messages.each do |name| + faultparts = message(name).parts + if faultparts.size != 1 + raise RuntimeError.new("Expecting fault message \"#{name}\" to have ONE part") + end + fault_part = faultparts[0] + # WS-I Basic Profile Version 1.1 (R2205) requires fault message parts + # to refer to elements rather than types + faulttype = fault_part.element + if not faulttype + warn("Fault message \"#{name}\" part \"#{fault_part.name}\" must specify an \"element\" attribute") + faulttype = fault_part.type + end + if faulttype and result.index(faulttype).nil? + result << faulttype + end + end + result + end + +private + + def get_fault_binding(op_binding, fault_name) + op_binding.fault.each do |fault| + return fault if fault.name == fault_name + end + return nil + end + + def op_binding_declares_fault(op_binding, fault_name) + return get_fault_binding(op_binding, fault_name) != nil + end + + def collect_fault_messages + result = [] + porttypes.each do |porttype| + port_binding = porttype.find_binding() + next unless port_binding + porttype.operations.each do |operation| + op_binding = port_binding.operations.find { |ele| ele.name == operation.name } + next unless op_binding + operation.fault.each do |fault| + # Make sure the operation fault has a name + if not fault.name + warn("Operation \"#{operation.name}\": fault must specify a \"name\" attribute") + next + end + # Make sure that portType fault has a corresponding soap:fault + # definition in binding section. + if not op_binding_declares_fault(op_binding, fault.name) + warn("Operation \"#{operation.name}\", fault \"#{fault.name}\": no corresponding wsdl:fault binding found with a matching \"name\" attribute") + next + end + fault_binding = get_fault_binding(op_binding, fault.name) + if fault_binding.soapfault.nil? + warn("WARNING: no soap:fault found for wsdl:fault \"#{fault_binding.name}\" in operation \"#{operation.name}\" \n\n") + next + end + if fault_binding.soapfault.name != fault_binding.name + warn("WARNING: name of soap:fault \"#{fault_binding.soapfault.name}\" doesn't match the name of wsdl:fault \"#{fault_binding.name}\" in operation \"#{operation.name}\" \n\n") + next + end + # According to WS-I (R2723): if in a wsdl:binding the use attribute + # on a contained soapbind:fault element is present, its value MUST + # be "literal". + if fault_binding.soapfault.use and fault_binding.soapfault.use != "literal" + warn("Operation \"#{operation.name}\", fault \"#{fault.name}\": soap:fault \"use\" attribute must be \"literal\"") + end + if result.index(fault.message).nil? + result << fault.message + end + end + end + end + result + end + + def rpc_operation_complextypes(binding) + types = XSD::NamedElements.new + binding.operations.each do |op_bind| + if op_bind_rpc?(op_bind) + operation = op_bind.find_operation + if op_bind.input + type = XMLSchema::ComplexType.new(op_bind.soapoperation_name) + message = messages[operation.input.message] + type.sequence_elements = elements_from_message(message) + types << type + end + if op_bind.output + type = XMLSchema::ComplexType.new(operation.outputname) + message = messages[operation.output.message] + type.sequence_elements = elements_from_message(message) + types << type + end + end + end + types + end + + def op_bind_rpc?(op_bind) + op_bind.soapoperation_style == :rpc + end + + def elements_from_message(message) + message.parts.collect { |part| + if part.element + collect_elements[part.element] + elsif part.name.nil? or part.type.nil? + raise RuntimeError.new("part of a message must be an element or typed") + else + qname = XSD::QName.new(nil, part.name) + XMLSchema::Element.new(qname, part.type) + end + } + end +end + + +end diff --git a/lib/wsdl/soap/driverCreator.rb b/lib/wsdl/soap/driverCreator.rb new file mode 100644 index 0000000..68f203c --- /dev/null +++ b/lib/wsdl/soap/driverCreator.rb @@ -0,0 +1,118 @@ +# WSDL4R - Creating driver code from WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/soap/mappingRegistryCreator' +require 'wsdl/soap/methodDefCreator' +require 'wsdl/soap/classDefCreatorSupport' +require 'xsd/codegen' + + +module WSDL +module SOAP + + +class DriverCreator + include ClassDefCreatorSupport + + attr_reader :definitions + attr_accessor :drivername_postfix + + def initialize(definitions, name_creator, modulepath = nil) + @definitions = definitions + @name_creator = name_creator + @modulepath = modulepath + @drivername_postfix = '' + end + + def dump(porttype = nil) + result = "require 'soap/rpc/driver'\n\n" + if @modulepath + @modulepath.each do |name| + result << "module #{name}\n" + end + result << "\n" + end + if porttype.nil? + @definitions.porttypes.each do |type| + result << dump_porttype(type.name) + result << "\n" + end + else + result << dump_porttype(porttype) + end + if @modulepath + result << "\n" + @modulepath.each do |name| + result << "end\n" + end + end + result + end + +private + + def dump_porttype(porttype) + drivername = porttype.name + @drivername_postfix + qname = XSD::QName.new(porttype.namespace, drivername) + class_name = mapped_class_basename(qname, @modulepath) + defined_const = {} + mdcreator = MethodDefCreator.new(@definitions, @name_creator, @modulepath, defined_const) + methoddef = mdcreator.dump(porttype) + binding = @definitions.bindings.find { |item| item.type == porttype } + if binding.nil? or binding.soapbinding.nil? + # not bound or not a SOAP binding + return '' + end + address = @definitions.porttype(porttype).locations[0] + + c = XSD::CodeGen::ClassDef.new(class_name, "::SOAP::RPC::Driver") + c.def_const("DefaultEndpointUrl", ndq(address)) + c.def_code <<-EOD +Methods = [ +#{methoddef.gsub(/^/, " ")} +] + EOD + wsdl_name = @definitions.name ? @definitions.name.name : 'default' + mrname = safeconstname(wsdl_name + 'MappingRegistry') + c.def_method("initialize", "endpoint_url = nil") do + %Q[endpoint_url ||= DefaultEndpointUrl\n] + + %Q[super(endpoint_url, nil)\n] + + %Q[self.mapping_registry = #{mrname}::EncodedRegistry\n] + + %Q[self.literal_mapping_registry = #{mrname}::LiteralRegistry\n] + + %Q[init_methods] + end + c.def_privatemethod("init_methods") do + <<-EOD + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + EOD + end + defined_const.each do |ns, tag| + c.def_const(tag, dq(ns)) + end + c.dump + end +end + + +end +end diff --git a/lib/wsdl/soap/element.rb b/lib/wsdl/soap/element.rb new file mode 100644 index 0000000..bc996ab --- /dev/null +++ b/lib/wsdl/soap/element.rb @@ -0,0 +1,33 @@ +# WSDL4R - XMLSchema element definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/xmlSchema/element' + + +module WSDL +module XMLSchema + + +class Element < Info + def map_as_array? + # parent sequence / choice may be marked as maxOccurs="unbounded" + maxoccurs.nil? or maxoccurs != 1 or (parent and parent.map_as_array?) + end + + def anonymous_type? + !@ref and @name and @local_complextype + end + + def attributes + @local_complextype.attributes + end +end + + +end +end diff --git a/lib/wsdl/soap/encodedMappingRegistryCreator.rb b/lib/wsdl/soap/encodedMappingRegistryCreator.rb new file mode 100644 index 0000000..7fa5bae --- /dev/null +++ b/lib/wsdl/soap/encodedMappingRegistryCreator.rb @@ -0,0 +1,73 @@ +# WSDL4R - Creating EncodedMappingRegistry code from WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/soap/mappingRegistryCreatorSupport' + + +module WSDL +module SOAP + + +class EncodedMappingRegistryCreator + include MappingRegistryCreatorSupport + + attr_reader :definitions + + def initialize(definitions, name_creator, modulepath, defined_const) + @definitions = definitions + @name_creator = name_creator + @modulepath = modulepath + @simpletypes = definitions.collect_simpletypes + @simpletypes.uniq! + @complextypes = definitions.collect_complextypes + @complextypes.uniq! + @varname = nil + @defined_const = defined_const + end + + def dump(varname) + @varname = varname + result = '' + str = dump_complextype + unless str.empty? + result << "\n" unless result.empty? + result << str + end + str = dump_simpletype + unless str.empty? + result << "\n" unless result.empty? + result << str + end + result + end + +private + + def dump_complextype + @complextypes.collect { |type| + unless type.abstract + dump_with_inner { + dump_complextypedef(@modulepath, type.name, type, nil, :encoded => true) + } + end + }.compact.join("\n") + end + + def dump_simpletype + @simpletypes.collect { |type| + dump_with_inner { + dump_simpletypedef(@modulepath, type.name, type, nil, :encoded => true) + } + }.compact.join("\n") + end +end + + +end +end diff --git a/lib/wsdl/soap/fault.rb b/lib/wsdl/soap/fault.rb new file mode 100644 index 0000000..eba1d72 --- /dev/null +++ b/lib/wsdl/soap/fault.rb @@ -0,0 +1,56 @@ +# WSDL4R - WSDL SOAP body definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module SOAP + + +class Fault < Info + attr_reader :name # required + attr_reader :use # required + attr_reader :encodingstyle + attr_reader :namespace + + def initialize + super + @name = nil + @use = nil + @encodingstyle = nil + @namespace = nil + end + + def targetnamespace + parent.targetnamespace + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when NameAttrName + @name = XSD::QName.new(targetnamespace, value.source) + when UseAttrName + @use = value.source + when EncodingStyleAttrName + @encodingstyle = value.source + when NamespaceAttrName + @namespace = value.source + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/soap/header.rb b/lib/wsdl/soap/header.rb new file mode 100644 index 0000000..2f03ff8 --- /dev/null +++ b/lib/wsdl/soap/header.rb @@ -0,0 +1,86 @@ +# WSDL4R - WSDL SOAP body definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module SOAP + + +class Header < Info + attr_reader :headerfault + + attr_reader :message # required + attr_reader :part # required + attr_reader :use # required + attr_reader :encodingstyle + attr_reader :namespace + + def initialize + super + @message = nil + @part = nil + @use = nil + @encodingstyle = nil + @namespace = nil + @headerfault = nil + end + + def targetnamespace + parent.targetnamespace + end + + def find_message + root.message(@message) or raise RuntimeError.new("#{@message} not found") + end + + def find_part + find_message.parts.each do |part| + if part.name == @part + return part + end + end + raise RuntimeError.new("#{@part} not found") + end + + def parse_element(element) + case element + when HeaderFaultName + o = WSDL::SOAP::HeaderFault.new + @headerfault = o + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when MessageAttrName + if value.namespace.nil? + value = XSD::QName.new(targetnamespace, value.source) + end + @message = value + when PartAttrName + @part = value.source + when UseAttrName + @use = value.source + when EncodingStyleAttrName + @encodingstyle = value.source + when NamespaceAttrName + @namespace = value.source + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/soap/headerfault.rb b/lib/wsdl/soap/headerfault.rb new file mode 100644 index 0000000..7b11f24 --- /dev/null +++ b/lib/wsdl/soap/headerfault.rb @@ -0,0 +1,56 @@ +# WSDL4R - WSDL SOAP body definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module SOAP + + +class HeaderFault < Info + attr_reader :message # required + attr_reader :part # required + attr_reader :use # required + attr_reader :encodingstyle + attr_reader :namespace + + def initialize + super + @message = nil + @part = nil + @use = nil + @encodingstyle = nil + @namespace = nil + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when MessageAttrName + @message = value + when PartAttrName + @part = value.source + when UseAttrName + @use = value.source + when EncodingStyleAttrName + @encodingstyle = value.source + when NamespaceAttrName + @namespace = value.source + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/soap/literalMappingRegistryCreator.rb b/lib/wsdl/soap/literalMappingRegistryCreator.rb new file mode 100644 index 0000000..1853ac1 --- /dev/null +++ b/lib/wsdl/soap/literalMappingRegistryCreator.rb @@ -0,0 +1,115 @@ +# WSDL4R - Creating LiteralMappingRegistry code from WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/soap/mappingRegistryCreatorSupport' + + +module WSDL +module SOAP + + +class LiteralMappingRegistryCreator + include MappingRegistryCreatorSupport + + def initialize(definitions, name_creator, modulepath, defined_const) + @definitions = definitions + @name_creator = name_creator + @modulepath = modulepath + @elements = definitions.collect_elements + @elements.uniq! + @attributes = definitions.collect_attributes + @attributes.uniq! + @simpletypes = definitions.collect_simpletypes + @simpletypes.uniq! + @complextypes = definitions.collect_complextypes + @complextypes.uniq! + @varname = nil + @defined_const = defined_const + end + + def dump(varname) + @varname = varname + result = '' + str = dump_complextype + unless str.empty? + result << "\n" unless result.empty? + result << str + end + str = dump_simpletype + unless str.empty? + result << "\n" unless result.empty? + result << str + end + str = dump_element + unless str.empty? + result << "\n" unless result.empty? + result << str + end + str = dump_attribute + unless str.empty? + result << "\n" unless result.empty? + result << str + end + result + end + +private + + def dump_element + @elements.collect { |ele| + # has the definition different from the complexType of the same name + next if ele.type.nil? and @complextypes[ele.name] + dump_with_inner { + if typedef = ele.local_complextype + dump_complextypedef(@modulepath, ele.name, typedef) + elsif typedef = ele.local_simpletype + dump_simpletypedef(@modulepath, ele.name, typedef) + elsif ele.type + if typedef = @complextypes[ele.type] + dump_complextypedef(@modulepath, ele.type, typedef, ele.name) + elsif typedef = @simpletypes[ele.type] + dump_simpletypedef(@modulepath, ele.type, typedef, ele.name) + end + end + } + }.compact.join("\n") + end + + def dump_attribute + @attributes.collect { |attr| + if attr.local_simpletype + dump_with_inner { + dump_simpletypedef(@modulepath, attr.name, attr.local_simpletype) + } + end + }.compact.join("\n") + end + + def dump_simpletype + @simpletypes.collect { |type| + dump_with_inner { + dump_simpletypedef(@modulepath, type.name, type) + } + }.compact.join("\n") + end + + def dump_complextype + @complextypes.collect { |type| + unless type.abstract + dump_with_inner { + dump_complextypedef(@modulepath, type.name, type) + } + end + }.compact.join("\n") + end +end + + +end +end diff --git a/lib/wsdl/soap/mappingRegistryCreator.rb b/lib/wsdl/soap/mappingRegistryCreator.rb new file mode 100644 index 0000000..b619eda --- /dev/null +++ b/lib/wsdl/soap/mappingRegistryCreator.rb @@ -0,0 +1,58 @@ +# WSDL4R - Creating MappingRegistry code from WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/soap/classDefCreatorSupport' +require 'wsdl/soap/encodedMappingRegistryCreator' +require 'wsdl/soap/literalMappingRegistryCreator' +require 'xsd/codegen/moduledef.rb' + + +module WSDL +module SOAP + + +class MappingRegistryCreator + include ClassDefCreatorSupport + + attr_reader :definitions + + def initialize(definitions, name_creator, modulepath = nil) + @definitions = definitions + @name_creator = name_creator + @modulepath = modulepath + end + + def dump + defined_const = {} + encoded_creator = EncodedMappingRegistryCreator.new(@definitions, @name_creator, @modulepath, defined_const) + literal_creator = LiteralMappingRegistryCreator.new(@definitions, @name_creator, @modulepath, defined_const) + wsdl_name = @definitions.name ? @definitions.name.name : 'default' + module_name = safeconstname(wsdl_name + 'MappingRegistry') + if @modulepath + module_name = [@modulepath, module_name].join('::') + end + m = XSD::CodeGen::ModuleDef.new(module_name) + m.def_require("soap/mapping") + varname = 'EncodedRegistry' + m.def_const(varname, '::SOAP::Mapping::EncodedRegistry.new') + m.def_code(encoded_creator.dump(varname)) + varname = 'LiteralRegistry' + m.def_const(varname, '::SOAP::Mapping::LiteralRegistry.new') + m.def_code(literal_creator.dump(varname)) + # + defined_const.each do |ns, tag| + m.def_const(tag, dq(ns)) + end + m.dump + end +end + + +end +end diff --git a/lib/wsdl/soap/mappingRegistryCreatorSupport.rb b/lib/wsdl/soap/mappingRegistryCreatorSupport.rb new file mode 100644 index 0000000..b224eec --- /dev/null +++ b/lib/wsdl/soap/mappingRegistryCreatorSupport.rb @@ -0,0 +1,376 @@ +# WSDL4R - Creating MappingRegistry support. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/soap/classDefCreatorSupport' + + +module WSDL +module SOAP + + +# requires @defined_const = {}, @dump_with_inner, @modulepath +module MappingRegistryCreatorSupport + include ClassDefCreatorSupport + include XSD::CodeGen + + def dump_with_inner + @dump_with_inner = [] + @dump_with_inner.unshift(yield) + @dump_with_inner.join("\n") + end + + def dump_complextypedef(mpath, qname, typedef, as_element = nil, opt = {}) + case typedef.compoundtype + when :TYPE_STRUCT, :TYPE_EMPTY + dump_complex_typemap(mpath, qname, typedef, as_element, opt) + when :TYPE_ARRAY + dump_array_typemap(mpath, qname, typedef, as_element, opt) + when :TYPE_SIMPLE + dump_simple_typemap(mpath, qname, typedef, as_element, opt) + when :TYPE_MAP + # mapped as a general Hash + nil + else + raise RuntimeError.new( + "unknown kind of complexContent: #{typedef.compoundtype}") + end + end + + def dump_array_typemap(mpath, qname, typedef, as_element, opt) + if typedef.find_soapenc_arytype + if opt[:encoded] + dump_encoded_array_typemap(mpath, qname, typedef, as_element, opt) + end + else + dump_literal_array_typemap(mpath, qname, typedef, as_element, opt) + end + end + + def dump_complex_typemap(mpath, qname, typedef, as_element, opt) + var = {} + define_dump_class(var, mpath, qname, typedef, as_element, opt) + schema_ns = (var[:schema_name] || var[:schema_type]).namespace + if var[:schema_type] and typedef.base + var[:schema_basetype] = typedef.base + end + parentmodule = var[:class] + parsed_element = + parse_elements(typedef.elements, qname.namespace, parentmodule, opt) + if typedef.choice? + parsed_element.unshift(:choice) + end + var[:schema_element] = dump_schema_element_definition(parsed_element, 2) + unless typedef.attributes.empty? + var[:schema_attribute] = define_attribute(typedef.attributes) + end + assign_const(schema_ns, 'Ns') + dump_entry(@varname, var) + end + + def dump_simple_typemap(mpath, qname, typedef, as_element, opt) + var = {} + define_dump_class(var, mpath, qname, typedef, as_element, opt) + schema_ns = (var[:schema_name] || var[:schema_type]).namespace + unless typedef.attributes.empty? + var[:schema_attribute] = define_attribute(typedef.attributes) + end + assign_const(schema_ns, 'Ns') + dump_entry(@varname, var) + end + + def dump_schema_element_definition(definition, indent = 0) + return '[]' if definition.empty? + sp = ' ' * indent + if definition[0] == :choice + definition.shift + "[ :choice,\n" + + dump_schema_element(definition, indent + 2) + "\n" + sp + "]" + elsif definition[0].is_a?(::Array) + "[\n" + + dump_schema_element(definition, indent + 2) + "\n" + sp + "]" + else + varname, name, type, occurrence = definition + '[' + [ + varname.dump, + dump_type(name, type), + dump_occurrence(occurrence) + ].compact.join(', ') + ']' + end + end + + def dump_schema_element(schema_element, indent = 0) + sp = ' ' * indent + delimiter = ",\n" + sp + sp + schema_element.collect { |definition| + dump_schema_element_definition(definition, indent) + }.join(delimiter) + end + + def dump_type(name, type) + if name + assign_const(name.namespace, 'Ns') + '[' + ndq(type) + ', ' + dqname(name) + ']' + else + ndq(type) + end + end + + def dump_occurrence(occurrence) + if occurrence and occurrence != [1, 1] # default + minoccurs, maxoccurs = occurrence + maxoccurs ||= 'nil' + "[#{minoccurs}, #{maxoccurs}]" + end + end + + def parse_elements(elements, base_namespace, mpath, opt) + schema_element = [] + any = false + elements.each do |element| + case element + when XMLSchema::Any + # only 1 is allowed for now. + raise RuntimeError.new("duplicated 'any'") if any + any = true + varname = 'any' # not used + eleqname = XSD::AnyTypeName + type = nil + occurrence = nil + schema_element << [varname, eleqname, type, occurrence] + when XMLSchema::Element + next if element.ref == SchemaName + typebase = @modulepath + if element.anonymous_type? + child_opt = { + :qualified => (element.elementform == 'qualified'), + :is_anonymous => true + } + @dump_with_inner << dump_complextypedef(mpath, element.name, element.local_complextype, nil, child_opt) + typebase = mpath + end + type = create_type_name(typebase, element) + name = name_element(element).name + varname = safevarname(name) + if element.map_as_array? + if type + type += '[]' + else + type = '[]' + end + end + # nil means @@schema_ns + varname + eleqname = element.name || element.ref + if eleqname && varname == name && eleqname.namespace == base_namespace + eleqname = nil + end + occurrence = [element.minoccurs, element.maxoccurs] + schema_element << [varname, eleqname, type, occurrence] + when WSDL::XMLSchema::Sequence + child_schema_element = + parse_elements(element.elements, base_namespace, mpath, opt) + schema_element << child_schema_element + when WSDL::XMLSchema::Choice + child_schema_element = + parse_elements(element.elements, base_namespace, mpath, opt) + if !element.map_as_array? + # choice + maxOccurs="unbounded" is treated just as 'all' now. + child_schema_element.unshift(:choice) + end + schema_element << child_schema_element + when WSDL::XMLSchema::Group + if element.content.nil? + warn("no group definition found: #{element}") + next + end + child_schema_element = + parse_elements(element.content.elements, base_namespace, mpath, opt) + schema_element.concat(child_schema_element) + else + raise RuntimeError.new("unknown type: #{element}") + end + end + schema_element + end + + def define_attribute(attributes) + schema_attribute = [] + attributes.each do |attribute| + name = name_attribute(attribute) + if klass = attribute_basetype(attribute) + type = klass.name + else + warn("unresolved attribute type #{attribute.type} for #{name}") + type = nil + end + schema_attribute << [name, type] + end + "{\n " + + schema_attribute.collect { |name, type| + assign_const(name.namespace, 'Ns') + dqname(name) + ' => ' + ndq(type) + }.join(",\n ") + + "\n }" + end + + def dump_entry(regname, var) + "#{regname}.register(\n " + + [ + dump_entry_item(var, :class), + dump_entry_item(var, :soap_class), + dump_entry_item(var, :schema_name, :qname), + dump_entry_item(var, :schema_type, :qname), + dump_entry_item(var, :is_anonymous), + dump_entry_item(var, :schema_basetype, :qname), + dump_entry_item(var, :schema_qualified), + dump_entry_item(var, :schema_element), + dump_entry_item(var, :schema_attribute) + ].compact.join(",\n ") + + "\n)\n" + end + + def dump_entry_item(var, key, dump_type = :none) + if var.key?(key) + case dump_type + when :none + ":#{key} => #{var[key]}" + when :string + if @defined_const.key?(var[key]) + ":#{key} => #{@defined_const[var[key]]}" + else + ":#{key} => #{ndq(var[key])}" + end + when :qname + qname = var[key] + if @defined_const.key?(qname.namespace) + ns = @defined_const[qname.namespace] + else + ns = ndq(qname.namespace) + end + ":#{key} => XSD::QName.new(#{ns}, #{ndq(qname.name)})" + else + raise "Unknown dump type: #{dump_type}" + end + end + end + + def dump_simpletypedef(mpath, qname, simpletype, as_element = nil, opt = {}) + if simpletype.restriction + dump_simpletypedef_restriction(mpath, qname, simpletype, as_element, opt) + elsif simpletype.list + dump_simpletypedef_list(mpath, qname, simpletype, as_element, opt) + elsif simpletype.union + dump_simpletypedef_union(mpath, qname, simpletype, as_element, opt) + else + raise RuntimeError.new("unknown kind of simpletype: #{simpletype}") + end + end + + def dump_simpletypedef_restriction(mpath, qname, typedef, as_element, opt) + restriction = typedef.restriction + unless restriction.enumeration? + # not supported. minlength? + return nil + end + var = {} + define_dump_class(var, mpath, qname, typedef, as_element, opt) + schema_ns = (var[:schema_name] || var[:schema_type]).namespace + assign_const(schema_ns, 'Ns') + dump_entry(@varname, var) + end + + def dump_simpletypedef_list(mpath, qname, typedef, as_element, opt) + nil + end + + def dump_simpletypedef_union(mpath, qname, typedef, as_element, opt) + nil + end + + DEFAULT_ITEM_NAME = XSD::QName.new(nil, 'item') + + def dump_literal_array_typemap(mpath, qname, typedef, as_element, opt) + var = {} + define_dump_class(var, mpath, qname, typedef, as_element, opt) + schema_ns = (var[:schema_name] || var[:schema_type]).namespace + parsed_element = + parse_elements(typedef.elements, qname.namespace, var[:class], opt) + if parsed_element.empty? + parsed_element = [create_array_element_definition(typedef, mpath)] + end + var[:schema_element] = dump_schema_element_definition(parsed_element, 2) + assign_const(schema_ns, 'Ns') + dump_entry(@varname, var) + end + + def dump_encoded_array_typemap(mpath, qname, typedef, as_element, opt) + arytype = typedef.find_arytype || XSD::AnyTypeName + type = XSD::QName.new(arytype.namespace, arytype.name.sub(/\[(?:,)*\]$/, '')) + return <<__EOD__ +#{@varname}.set( + #{mapped_class_name(qname, mpath)}, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => #{dqname(type)} } +) +__EOD__ + end + + # used when "soapenc:arrayType" definition + def create_array_element_definition(typedef, mpath) + child_type = typedef.child_type + child_element = typedef.find_aryelement + if child_type == XSD::AnyTypeName + type = nil + elsif child_element + if klass = element_basetype(child_element) + type = klass.name + else + typename = child_element.type || child_element.name + type = mapped_class_name(typename, mpath) + end + elsif child_type + type = mapped_class_name(child_type, mpath) + else + type = nil + end + occurrence = [0, nil] + if child_element and child_element.name + if child_element.map_as_array? + type << '[]' if type + occurrence = [child_element.minoccurs, child_element.maxoccurs] + end + child_element_name = child_element.name + else + child_element_name = DEFAULT_ITEM_NAME + end + [child_element_name.name, child_element_name, type, occurrence] + end + + def define_dump_class(var, mpath, qname, typedef, as_element, opt) + var[:class] = mapped_class_name(qname, mpath) + if as_element + var[:schema_name] = as_element + schema_ns = as_element.namespace + elsif typedef.name.nil? + var[:schema_name] = qname + schema_ns = qname.namespace + else + var[:schema_type] = qname + schema_ns = qname.namespace + end + var[:is_anonymous] = opt[:is_anonymous] if opt.key?(:is_anonymous) + # true, false, or nil + if opt.key?(:qualified) + var[:schema_qualified] = opt[:qualified].to_s + end + end +end + + +end +end diff --git a/lib/wsdl/soap/methodDefCreator.rb b/lib/wsdl/soap/methodDefCreator.rb new file mode 100644 index 0000000..0bb1416 --- /dev/null +++ b/lib/wsdl/soap/methodDefCreator.rb @@ -0,0 +1,199 @@ +# WSDL4R - Creating method definition from WSDL +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/soap/classDefCreatorSupport' +require 'soap/rpc/element' +require 'soap/rpc/methodDef' + + +module WSDL +module SOAP + + +class MethodDefCreator + include ClassDefCreatorSupport + + attr_reader :definitions + # TODO: should not export this kind of stateful information. + # will be rewwritten in 1.6.1 + attr_reader :assigned_method + + def initialize(definitions, name_creator, modulepath, defined_const) + @definitions = definitions + @name_creator = name_creator + @modulepath = modulepath + @simpletypes = @definitions.collect_simpletypes + @complextypes = @definitions.collect_complextypes + @elements = @definitions.collect_elements + @defined_const = defined_const + @assigned_method = {} + end + + def dump(name) + methoddef = "" + porttype = @definitions.porttype(name) + binding = porttype.find_binding + if binding + create(binding.name).each do |mdef| + methoddef << ",\n" unless methoddef.empty? + methoddef << dump_method(mdef).chomp + end + end + methoddef + end + + def create(bindingname) + binding = @definitions.binding(bindingname) + if binding + return binding.operations.collect { |op_bind| + next unless op_bind.soapoperation # not a SOAP operation binding + create_methoddef(op_bind) + } + end + nil + end + +private + + def create_methoddef(op_bind) + op_info = op_bind.operation_info + name = assign_method_name(op_bind) + soapaction = op_info.boundid.soapaction + qname = op_bind.soapoperation_name + mdef = ::SOAP::RPC::MethodDef.new(name, soapaction, qname) + op_info.parts.each do |part| + if op_info.style == :rpc + mapped_class, qname = rpcdefinedtype(part) + else + mapped_class, qname = documentdefinedtype(part) + end + mdef.add_parameter(part.io_type, part.name, qname, mapped_class) + end + op_info.faults.each do |name, faultinfo| + faultclass = mapped_class_name(name, @modulepath) + mdef.faults[faultclass] = faultinfo + end + mdef.style = op_info.style + mdef.inputuse = op_info.inputuse + mdef.outputuse = op_info.outputuse + mdef + end + + def dump_method(mdef) + style = mdef.style + inputuse = mdef.inputuse + outputuse = mdef.outputuse + paramstr = param2str(mdef.parameters) + if paramstr.empty? + paramstr = '[]' + else + paramstr = "[ " << paramstr.split(/\r?\n/).join("\n ") << " ]" + end + definitions = <<__EOD__ +#{ndq(mdef.soapaction)}, + #{dq(mdef.name)}, + #{paramstr}, + { :request_style => #{nsym(style)}, :request_use => #{nsym(inputuse)}, + :response_style => #{nsym(style)}, :response_use => #{nsym(outputuse)}, + :faults => #{mdef.faults.inspect} } +__EOD__ + if style == :rpc + assign_const(mdef.qname.namespace, 'Ns') + return <<__EOD__ +[ #{dqname(mdef.qname)}, + #{definitions}] +__EOD__ + else + return <<__EOD__ +[ #{definitions}] +__EOD__ + end + end + + def assign_method_name(op_bind) + method_name = safemethodname(op_bind.name) + i = 1 # starts from _2 + while @assigned_method.value?(method_name) + i += 1 + method_name = safemethodname("#{op_bind.name}_#{i}") + end + @assigned_method[op_bind.boundid] = method_name + method_name + end + + def rpcdefinedtype(part) + if mapped = basetype_mapped_class(part.type) + return ['::' + mapped.name, nil] + elsif definedtype = @simpletypes[part.type] + return [nil, definedtype.name] + elsif definedtype = @elements[part.element] + return [nil, part.element] + elsif definedtype = @complextypes[part.type] + case definedtype.compoundtype + when :TYPE_STRUCT, :TYPE_EMPTY, :TYPE_ARRAY, :TYPE_SIMPLE + type = mapped_class_name(part.type, @modulepath) + return [type, part.type] + when :TYPE_MAP + return [Hash.name, part.type] + else + raise NotImplementedError.new("must not reach here: #{definedtype.compoundtype}") + end + elsif part.type == XSD::AnyTypeName + return [nil, nil] + else + raise RuntimeError.new("part: #{part.name} cannot be resolved") + end + end + + def documentdefinedtype(part) + if mapped = basetype_mapped_class(part.type) + return ['::' + mapped.name, XSD::QName.new(nil, part.name)] + elsif definedtype = @simpletypes[part.type] + if definedtype.base + return ['::' + basetype_mapped_class(definedtype.base).name, XSD::QName.new(nil, part.name)] + else + raise RuntimeError.new("unsupported simpleType: #{definedtype}") + end + elsif definedtype = @elements[part.element] + return ['::SOAP::SOAPElement', part.element] + elsif definedtype = @complextypes[part.type] + return ['::SOAP::SOAPElement', part.type] + else + raise RuntimeError.new("part: #{part.name} cannot be resolved") + end + end + + def param2str(params) + params.collect { |param| + mappingstr = mapping_info2str(param.mapped_class, param.qname) + "[:#{param.io_type.id2name}, #{dq(param.name)}, #{mappingstr}]" + }.join(",\n") + end + + def mapping_info2str(mapped_class, qname) + if qname.nil? + "[#{ndq(mapped_class)}]" + else + "[#{ndq(mapped_class)}, #{ndq(qname.namespace)}, #{dq(qname.name)}]" + end + end + + def ele2str(ele) + qualified = ele + if qualified + "true" + else + "false" + end + end +end + + +end +end diff --git a/lib/wsdl/soap/operation.rb b/lib/wsdl/soap/operation.rb new file mode 100644 index 0000000..455bd84 --- /dev/null +++ b/lib/wsdl/soap/operation.rb @@ -0,0 +1,112 @@ +# WSDL4R - WSDL SOAP operation definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module SOAP + + +class Operation < Info + class ParamInfo + attr_reader :style + attr_reader :op_name + attr_reader :optype_name + attr_reader :encodingstyle + attr_reader :headerparts + attr_reader :bodyparts + attr_reader :faultpart + attr_reader :soapaction + + def initialize(style, use, encodingstyle, op_name, optype_name, + headerparts, bodyparts, faultpart, soapaction) + @style = style + @use = use + @encodingstyle = encodingstyle + @op_name = op_name + @optype_name = optype_name + @headerparts = headerparts + @bodyparts = bodyparts + @faultpart = faultpart + @soapaction = soapaction + end + end + + attr_reader :soapaction + attr_reader :style + + def initialize + super + @soapaction = nil + @style = nil + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when StyleAttrName + if ["document", "rpc"].include?(value.source) + @style = value.source.intern + else + raise Parser::AttributeConstraintError.new( + "Unexpected value #{ value }.") + end + when SOAPActionAttrName + @soapaction = value.source + else + nil + end + end + + def operation_style + return @style if @style + if parent_binding.soapbinding + return parent_binding.soapbinding.style + end + nil + end + +private + + def parent_binding + parent.parent + end + + def create_param_info(name_info, param) + op_style = operation_style() + op_use = param.soapbody_use + op_encodingstyle = param.soapbody_encodingstyle + op_name = name_info.op_name + optype_name = name_info.optype_name + soapheader = param.soapheader + headerparts = soapheader.collect { |item| item.find_part } + soapbody = param.soapbody + if soapbody.namespace + op_name = XSD::QName.new(soapbody.namespace, op_name.name) + end + if soapbody.parts + target = soapbody.parts.split(/\s+/) + bodyparts = name_info.parts.find_all { |part| + target.include?(part.name) + } + else + bodyparts = name_info.parts + end + faultpart = nil + ParamInfo.new(op_style, op_use, op_encodingstyle, op_name, optype_name, + headerparts, bodyparts, faultpart, parent.soapaction) + end +end + + +end +end diff --git a/lib/wsdl/soap/servantSkeltonCreator.rb b/lib/wsdl/soap/servantSkeltonCreator.rb new file mode 100644 index 0000000..e2d79f0 --- /dev/null +++ b/lib/wsdl/soap/servantSkeltonCreator.rb @@ -0,0 +1,89 @@ +# WSDL4R - Creating servant skelton code from WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/soap/classDefCreatorSupport' +require 'xsd/codegen' + + +module WSDL +module SOAP + + +class ServantSkeltonCreator + include ClassDefCreatorSupport + include XSD::CodeGen::GenSupport + + attr_reader :definitions + + def initialize(definitions, name_creator, modulepath = nil) + @definitions = definitions + @name_creator = name_creator + @modulepath = modulepath + end + + def dump(porttype = nil) + result = "" + if @modulepath + result << "\n" + result << @modulepath.collect { |ele| "module #{ele}" }.join("; ") + result << "\n\n" + end + if porttype.nil? + @definitions.porttypes.each do |porttype| + result << dump_porttype(porttype) + result << "\n" + end + else + result << dump_porttype(porttype) + end + if @modulepath + result << "\n\n" + result << @modulepath.collect { |ele| "end" }.join("; ") + result << "\n" + end + result + end + +private + + def dump_porttype(porttype) + assigned_method = collect_assigned_method(@definitions, porttype.name, @modulepath) + class_name = mapped_class_basename(porttype.name, @modulepath) + c = XSD::CodeGen::ClassDef.new(class_name) + element_definitions = @definitions.collect_elements + binding = porttype.find_binding + if binding + binding.operations.each do |op_bind| + operation = op_bind.find_operation + if operation.nil? + warn("operation not found for binding: #{op_bind}") + next + end + name = assigned_method[op_bind.boundid] || operation.name + methodname = safemethodname(name) + input = operation.input + params = input.find_message.parts.collect { |part| + safevarname(part.name) + } + m = XSD::CodeGen::MethodDef.new(methodname, params) do <<-EOD + p [#{params.join(", ")}] + raise NotImplementedError.new + EOD + end + m.comment = dump_method_signature(methodname, operation, element_definitions) + c.add_method(m) + end + end + c.dump + end +end + + +end +end diff --git a/lib/wsdl/soap/servletStubCreator.rb b/lib/wsdl/soap/servletStubCreator.rb new file mode 100644 index 0000000..826b2e2 --- /dev/null +++ b/lib/wsdl/soap/servletStubCreator.rb @@ -0,0 +1,104 @@ +# WSDL4R - Creating servlet stub code from WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/soap/mappingRegistryCreator' +require 'wsdl/soap/methodDefCreator' +require 'wsdl/soap/classDefCreatorSupport' + + +module WSDL +module SOAP + + +class ServletStubCreator + include ClassDefCreatorSupport + + attr_reader :definitions + + def initialize(definitions, name_creator, modulepath = nil) + @definitions = definitions + @name_creator = name_creator + @modulepath = modulepath + end + + def dump(service_name) + warn("- Servlet stub can have only 1 port for now. So creating stub for the first port and rests are ignored.") + services = @definitions.service(service_name) + unless services + raise RuntimeError.new("service not defined: #{service_name}") + end + ports = services.ports + if ports.empty? + raise RuntimeError.new("ports not found for #{service_name}") + end + port = ports[0] + if port.porttype.nil? + raise RuntimeError.new("porttype not found for #{port}") + end + dump_porttype(port.porttype) + end + +private + + def dump_porttype(porttype) + class_name = mapped_class_name(porttype.name, @modulepath) + defined_const = {} + methoddef = MethodDefCreator.new(@definitions, @name_creator, @modulepath, defined_const).dump(porttype.name) + wsdl_name = @definitions.name ? @definitions.name.name : 'default' + mrname = safeconstname(wsdl_name + 'MappingRegistry') + c1 = XSD::CodeGen::ClassDef.new(class_name) + c1.def_require("soap/rpc/soaplet") + c1.def_code <<-EOD +Methods = [ +#{methoddef.gsub(/^/, " ")} +] + EOD + defined_const.each do |ns, tag| + c1.def_const(tag, dq(ns)) + end + c2 = XSD::CodeGen::ClassDef.new(class_name + "Servlet", + "::SOAP::RPC::SOAPlet") + c2.def_method("initialize", "router = nil") do + <<-EOD + super(router) + servant = #{class_name}.new + #{class_name}::Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + @router.add_document_operation(servant, *definitions) + else + @router.add_rpc_operation(servant, *definitions) + end + end + @router.mapping_registry = #{mrname}::EncodedRegistry + @router.literal_mapping_registry = #{mrname}::LiteralRegistry + EOD + end + c1.dump + "\n" + c2.dump + format(<<-EOD) + + if $0 == __FILE__ + require 'webrick' + server = WEBrick::HTTPServer.new( + :BindAddress => "0.0.0.0", + :Port => 10080, + :DocumentRoot => "." + ) + server.mount("/", #{c2.name}.new) + trap(:INT) do + server.shutdown + end + server.start + end + EOD + end +end + + +end +end diff --git a/lib/wsdl/soap/standaloneServerStubCreator.rb b/lib/wsdl/soap/standaloneServerStubCreator.rb new file mode 100644 index 0000000..169eb2a --- /dev/null +++ b/lib/wsdl/soap/standaloneServerStubCreator.rb @@ -0,0 +1,100 @@ +# WSDL4R - Creating standalone server stub code from WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/soap/mappingRegistryCreator' +require 'wsdl/soap/methodDefCreator' +require 'wsdl/soap/classDefCreatorSupport' + + +module WSDL +module SOAP + + +class StandaloneServerStubCreator + include ClassDefCreatorSupport + + attr_reader :definitions + + def initialize(definitions, name_creator, modulepath = nil) + @definitions = definitions + @name_creator = name_creator + @modulepath = modulepath + end + + def dump(service_name) + warn("- Standalone stub can have only 1 port for now. So creating stub for the first port and rests are ignored.") + warn("- Standalone server stub ignores port location defined in WSDL. Location is http://localhost:10080/ by default. Generated client from WSDL must be configured to point this endpoint manually.") + services = @definitions.service(service_name) + unless services + raise RuntimeError.new("service not defined: #{service_name}") + end + ports = services.ports + if ports.empty? + raise RuntimeError.new("ports not found for #{service_name}") + end + port = ports[0] + if port.porttype.nil? + raise RuntimeError.new("porttype not found for #{port}") + end + dump_porttype(port.porttype) + end + +private + + def dump_porttype(porttype) + class_name = mapped_class_name(porttype.name, @modulepath) + defined_const = {} + methoddef = MethodDefCreator.new(@definitions, @name_creator, @modulepath, defined_const).dump(porttype.name) + wsdl_name = @definitions.name ? @definitions.name.name : 'default' + mrname = safeconstname(wsdl_name + 'MappingRegistry') + c1 = XSD::CodeGen::ClassDef.new(class_name) + c1.def_require("soap/rpc/standaloneServer") + c1.def_code <<-EOD +Methods = [ +#{methoddef.gsub(/^/, " ")} +] + EOD + defined_const.each do |ns, tag| + c1.def_const(tag, dq(ns)) + end + c2 = XSD::CodeGen::ClassDef.new(class_name + "App", + "::SOAP::RPC::StandaloneServer") + c2.def_method("initialize", "*arg") do + <<-EOD + super(*arg) + servant = #{class_name}.new + #{class_name}::Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + @router.add_document_operation(servant, *definitions) + else + @router.add_rpc_operation(servant, *definitions) + end + end + self.mapping_registry = #{mrname}::EncodedRegistry + self.literal_mapping_registry = #{mrname}::LiteralRegistry + EOD + end + c1.dump + "\n" + c2.dump + format(<<-EOD) + + if $0 == __FILE__ + # Change listen port. + server = #{class_name}App.new('app', nil, '0.0.0.0', 10080) + trap(:INT) do + server.shutdown + end + server.start + end + EOD + end +end + + +end +end diff --git a/lib/wsdl/soap/wsdl2ruby.rb b/lib/wsdl/soap/wsdl2ruby.rb new file mode 100644 index 0000000..6b63322 --- /dev/null +++ b/lib/wsdl/soap/wsdl2ruby.rb @@ -0,0 +1,217 @@ +# WSDL4R - WSDL to ruby mapping library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'logger' +require 'xsd/qname' +require 'wsdl/importer' +require 'wsdl/soap/classDefCreator' +require 'wsdl/soap/servantSkeltonCreator' +require 'wsdl/soap/driverCreator' +require 'wsdl/soap/clientSkeltonCreator' +require 'wsdl/soap/standaloneServerStubCreator' +require 'wsdl/soap/servletStubCreator' +require 'wsdl/soap/cgiStubCreator' +require 'wsdl/soap/classNameCreator' + + +module WSDL +module SOAP + + +class WSDL2Ruby + attr_accessor :location + attr_reader :opt + attr_accessor :logger + attr_accessor :basedir + + def run + unless @location + raise RuntimeError, "WSDL location not given" + end + @wsdl = import(@location) + if @opt['classdef'] + @name = @opt['classdef'] + else + @name = @wsdl.name ? @wsdl.name.name : 'default' + end + create_file + end + +private + + def initialize + @modulepath = nil + @location = nil + @opt = {} + @logger = Logger.new(STDERR) + @basedir = nil + @wsdl = nil + @name = nil + @classdef_filename = nil + @mr_filename = nil + @name_creator = ClassNameCreator.new + end + + def create_file + @modulepath = @opt['module_path'] + create_classdef if @opt.key?('classdef') + create_mapping_registry if @opt.key?('mapping_registry') + create_servant_skelton(@opt['servant_skelton']) if @opt.key?('servant_skelton') + create_cgi_stub(@opt['cgi_stub']) if @opt.key?('cgi_stub') + create_standalone_server_stub(@opt['standalone_server_stub']) if @opt.key?('standalone_server_stub') + create_servlet_stub(@opt['servlet_stub']) if @opt.key?('servlet_stub') + create_driver(@opt['driver'], @opt['drivername_postfix'] || '') if @opt.key?('driver') + create_client_skelton(@opt['client_skelton']) if @opt.key?('client_skelton') + end + + def create_classdef + @logger.info { "Creating class definition." } + @classdef_filename = @name + '.rb' + check_file(@classdef_filename) or return + write_file(@classdef_filename) do |f| + f << WSDL::SOAP::ClassDefCreator.new(@wsdl, @name_creator, @modulepath).dump + end + end + + def create_mapping_registry + @logger.info { "Creating mapping registry definition." } + @mr_filename = @name + 'MappingRegistry.rb' + check_file(@mr_filename) or return + write_file(@mr_filename) do |f| + f << "require '#{@classdef_filename}'\n" if @classdef_filename + f << WSDL::SOAP::MappingRegistryCreator.new(@wsdl, @name_creator, @modulepath).dump + end + end + + def create_client_skelton(servicename) + return if @wsdl.services.empty? + @logger.info { "Creating client skelton." } + servicename ||= @wsdl.services[0].name.name + @client_skelton_filename = servicename + 'Client.rb' + check_file(@client_skelton_filename) or return + write_file(@client_skelton_filename) do |f| + f << shbang << "\n" + f << "require '#{@driver_filename}'\n\n" if @driver_filename + f << WSDL::SOAP::ClientSkeltonCreator.new(@wsdl, @name_creator, @modulepath).dump(create_name(servicename)) + end + end + + def create_servant_skelton(porttypename) + @logger.info { "Creating servant skelton." } + @servant_skelton_filename = (porttypename || @name + 'Servant') + '.rb' + check_file(@servant_skelton_filename) or return + write_file(@servant_skelton_filename) do |f| + f << "require '#{@classdef_filename}'\n\n" if @classdef_filename + f << WSDL::SOAP::ServantSkeltonCreator.new(@wsdl, @name_creator, @modulepath).dump(create_name(porttypename)) + end + end + + def create_cgi_stub(servicename) + @logger.info { "Creating CGI stub." } + servicename ||= @wsdl.services[0].name.name + @cgi_stubFilename = servicename + '.cgi' + check_file(@cgi_stubFilename) or return + write_file(@cgi_stubFilename) do |f| + f << shbang << "\n" + f << "require '#{@servant_skelton_filename}'\n" if @servant_skelton_filename + f << "require '#{@mr_filename}'\n" if @mr_filename + f << WSDL::SOAP::CGIStubCreator.new(@wsdl, @name_creator, @modulepath).dump(create_name(servicename)) + end + end + + def create_standalone_server_stub(servicename) + @logger.info { "Creating standalone stub." } + servicename ||= @wsdl.services[0].name.name + @standalone_server_stub_filename = servicename + '.rb' + check_file(@standalone_server_stub_filename) or return + write_file(@standalone_server_stub_filename) do |f| + f << shbang << "\n" + f << "require '#{@servant_skelton_filename}'\n" if @servant_skelton_filename + f << "require '#{@mr_filename}'\n" if @mr_filename + f << WSDL::SOAP::StandaloneServerStubCreator.new(@wsdl, @name_creator, @modulepath).dump(create_name(servicename)) + end + end + + def create_servlet_stub(servicename) + @logger.info { "Creating servlet stub." } + servicename ||= @wsdl.services[0].name.name + @servlet_stub_filename = servicename + 'Servlet.rb' + check_file(@servlet_stub_filename) or return + write_file(@servlet_stub_filename) do |f| + f << shbang << "\n" + f << "require '#{@servant_skelton_filename}'\n" if @servant_skelton_filename + f << "require '#{@mr_filename}'\n" if @mr_filename + f << WSDL::SOAP::ServletStubCreator.new(@wsdl, @name_creator, @modulepath).dump(create_name(servicename)) + end + end + + def create_driver(porttypename, drivername_postfix) + @logger.info { "Creating driver." } + @driver_filename = (porttypename || @name) + 'Driver.rb' + creator = WSDL::SOAP::DriverCreator.new(@wsdl, @name_creator, @modulepath) + creator.drivername_postfix = drivername_postfix + check_file(@driver_filename) or return + write_file(@driver_filename) do |f| + f << "require '#{@classdef_filename}'\n" if @classdef_filename + f << "require '#{@mr_filename}'\n" if @mr_filename + f << creator.dump(create_name(porttypename)) + end + end + + def write_file(filename) + if @basedir + filename = File.join(basedir, filename) + end + File.open(filename, "w") do |f| + yield f + end + end + + def check_file(filename) + if @basedir + filename = File.join(basedir, filename) + end + if FileTest.exist?(filename) + if @opt.key?('force') + @logger.warn { + "File '#{filename}' exists but overrides it." + } + true + else + @logger.warn { + "File '#{filename}' exists. #{$0} did not override it." + } + false + end + else + @logger.info { "Creates file '#{filename}'." } + true + end + end + + def shbang + "#!/usr/bin/env ruby" + end + + def create_name(name) + name ? XSD::QName.new(@wsdl.targetnamespace, name) : nil + end + + def import(location) + WSDL::Importer.import(location) + end +end + + +end +end + + +if __FILE__ == $0 + warn("WARNING: #{File.expand_path(__FILE__)} is a library file used by bin/wsdl2ruby.rb. Find bin/wsdl2ruby.rb from tarball version of soap4r or install soap4r via gem.") +end diff --git a/lib/wsdl/types.rb b/lib/wsdl/types.rb new file mode 100644 index 0000000..0b77997 --- /dev/null +++ b/lib/wsdl/types.rb @@ -0,0 +1,44 @@ +# WSDL4R - WSDL types definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL + + +class Types < Info + attr_reader :schemas + + def initialize + super + @schemas = [] + end + + def parse_element(element) + case element + when SchemaName + o = XMLSchema::Schema.new + o.location = parent.location + @schemas << o + o + when DocumentationName + o = Documentation.new + o + else + nil + end + end + + def parse_attr(attr, value) + nil + end +end + + +end diff --git a/lib/wsdl/wsdl.rb b/lib/wsdl/wsdl.rb new file mode 100644 index 0000000..f9356c8 --- /dev/null +++ b/lib/wsdl/wsdl.rb @@ -0,0 +1,24 @@ +# WSDL4R - Base definitions. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/qname' +require 'soap/nestedexception' + + +module WSDL + + +Version = '0.0.2' + +Namespace = 'http://schemas.xmlsoap.org/wsdl/' +SOAPBindingNamespace ='http://schemas.xmlsoap.org/wsdl/soap/' + +class Error < StandardError; include ::SOAP::NestedException; end + + +end diff --git a/lib/wsdl/xmlSchema/all.rb b/lib/wsdl/xmlSchema/all.rb new file mode 100644 index 0000000..5e98759 --- /dev/null +++ b/lib/wsdl/xmlSchema/all.rb @@ -0,0 +1,24 @@ +# WSDL4R - XMLSchema complexType definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/xmlSchema/content' + + +module WSDL +module XMLSchema + + +class All < Content + def initialize + super() + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/annotation.rb b/lib/wsdl/xmlSchema/annotation.rb new file mode 100644 index 0000000..4e2341a --- /dev/null +++ b/lib/wsdl/xmlSchema/annotation.rb @@ -0,0 +1,34 @@ +# WSDL4R - WSDL SOAP documentation element. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class Annotation < Info + def initialize + super + end + + def parse_element(element) + # Accepts any element. + self + end + + def parse_attr(attr, value) + # Accepts any attribute. + true + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/any.rb b/lib/wsdl/xmlSchema/any.rb new file mode 100644 index 0000000..59322d2 --- /dev/null +++ b/lib/wsdl/xmlSchema/any.rb @@ -0,0 +1,61 @@ +# WSDL4R - XMLSchema any definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class Any < Info + attr_accessor :maxoccurs + attr_accessor :minoccurs + attr_accessor :namespace + attr_accessor :process_contents + + def initialize + super() + @maxoccurs = 1 + @minoccurs = 1 + @namespace = '##any' + @process_contents = 'strict' + end + + def targetnamespace + parent.targetnamespace + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when MaxOccursAttrName + if value.source == 'unbounded' + @maxoccurs = nil + else + @maxoccurs = Integer(value.source) + end + value.source + when MinOccursAttrName + @minoccurs = Integer(value.source) + when NamespaceAttrName + @namespace = value.source + when ProcessContentsAttrName + @process_contents = value.source + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/anyAttribute.rb b/lib/wsdl/xmlSchema/anyAttribute.rb new file mode 100644 index 0000000..12da395 --- /dev/null +++ b/lib/wsdl/xmlSchema/anyAttribute.rb @@ -0,0 +1,48 @@ +# WSDL4R - XMLSchema anyAttribute definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class AnyAttribute < Info + attr_accessor :namespace + attr_accessor :processcontents + + def initialize + super() + @namespace = '##any' + @processcontents = 'strict' + end + + def targetnamespace + parent.targetnamespace + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when NamespaceAttrName + @namespace = value.source + when ProcessContentsAttrName + @processcontents = value.source + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/attribute.rb b/lib/wsdl/xmlSchema/attribute.rb new file mode 100644 index 0000000..8b7ddeb --- /dev/null +++ b/lib/wsdl/xmlSchema/attribute.rb @@ -0,0 +1,104 @@ +# WSDL4R - XMLSchema attribute definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/xmlSchema/ref' + + +module WSDL +module XMLSchema + + +class Attribute < Info + include Ref + + attr_writer :use + attr_writer :form + attr_writer :name + attr_writer :type + attr_writer :local_simpletype + attr_writer :default + attr_writer :fixed + + attr_reader_ref :use + attr_reader_ref :form + attr_reader_ref :name + attr_reader_ref :type + attr_reader_ref :local_simpletype + attr_reader_ref :default + attr_reader_ref :fixed + + attr_accessor :arytype + + def initialize + super + @use = nil + @form = nil + @name = nil + @type = nil + @local_simpletype = nil + @default = nil + @fixed = nil + @ref = nil + @refelement = nil + @arytype = nil + end + + def targetnamespace + parent.targetnamespace + end + + def parse_element(element) + case element + when SimpleTypeName + @local_simpletype = SimpleType.new + @local_simpletype + end + end + + def parse_attr(attr, value) + case attr + when RefAttrName + @ref = value + when UseAttrName + @use = value.source + when FormAttrName + @form = value.source + when NameAttrName + if directelement? + @name = XSD::QName.new(targetnamespace, value.source) + else + @name = XSD::QName.new(nil, value.source) + end + when TypeAttrName + @type = value + when DefaultAttrName + @default = value.source + when FixedAttrName + @fixed = value.source + when ArrayTypeAttrName + @arytype = value + else + nil + end + end + +private + + def directelement? + parent.is_a?(Schema) + end + + def refelement + @refelement ||= root.collect_attributes[@ref] + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/attributeGroup.rb b/lib/wsdl/xmlSchema/attributeGroup.rb new file mode 100644 index 0000000..dfb922c --- /dev/null +++ b/lib/wsdl/xmlSchema/attributeGroup.rb @@ -0,0 +1,68 @@ +# WSDL4R - XMLSchema attributeGroup definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/xmlSchema/ref' + + +module WSDL +module XMLSchema + + +class AttributeGroup < Info + include Ref + + attr_writer :name # required + attr_writer :attributes + + attr_reader_ref :name + attr_reader_ref :attributes + + def initialize + super + @name = nil + @attributes = nil + @ref = nil + @refelement = nil + end + + def targetnamespace + parent.targetnamespace + end + + def parse_element(element) + case element + when AttributeName + @attributes ||= XSD::NamedElements.new + o = Attribute.new + @attributes << o + o + end + end + + def parse_attr(attr, value) + case attr + when NameAttrName + @name = XSD::QName.new(targetnamespace, value.source) + when RefAttrName + @ref = value + else + nil + end + end + +private + + def refelement + @refelement ||= root.collect_attributegroups[@ref] + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/choice.rb b/lib/wsdl/xmlSchema/choice.rb new file mode 100644 index 0000000..062b6fa --- /dev/null +++ b/lib/wsdl/xmlSchema/choice.rb @@ -0,0 +1,58 @@ +# WSDL4R - XMLSchema complexType definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/xmlSchema/content' + + +module WSDL +module XMLSchema + + +class Choice < Content + attr_reader :any + + def initialize + super() + @any = nil + end + + def have_any? + !!@any + end + + def choice? + true + end + + def parse_element(element) + case element + when SequenceName + o = Sequence.new + @elements << o + o + when ChoiceName + o = Choice.new + @elements << o + o + when GroupName + o = Group.new + @elements << o + o + when AnyName + @any = Any.new + @elements << @any + @any + else + super(element) + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/complexContent.rb b/lib/wsdl/xmlSchema/complexContent.rb new file mode 100644 index 0000000..34a3a61 --- /dev/null +++ b/lib/wsdl/xmlSchema/complexContent.rb @@ -0,0 +1,97 @@ +# WSDL4R - XMLSchema complexContent definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' + + +module WSDL +module XMLSchema + + +class ComplexContent < Info + attr_accessor :restriction + attr_accessor :extension + attr_accessor :mixed + + def initialize + super + @restriction = nil + @extension = nil + @mixed = false + end + + def targetnamespace + parent.targetnamespace + end + + def elementformdefault + parent.elementformdefault + end + + def content + @extension || @restriction + end + + def base + content ? content.base : nil + end + + def have_any? + content ? content.have_any? : nil + end + + def choice? + content ? content.choice? : nil + end + + def elements + content ? content.elements : XSD::NamedElements::Empty + end + + def attributes + content ? content.attributes : XSD::NamedElements::Empty + end + + def nested_elements + # restrict and extension does not have particle. + content ? content.nested_elements : XSD::NamedElements::Empty + end + + def check_type + if content + content.check_type + else + raise ArgumentError.new("incomplete complexContent") + end + end + + def parse_element(element) + case element + when RestrictionName + raise ArgumentError.new("incomplete complexContent") if content + @restriction = ComplexRestriction.new + when ExtensionName + raise ArgumentError.new("incomplete complexContent") if content + @extension = ComplexExtension.new + end + end + + def parse_attr(attr, value) + case attr + when MixedAttrName + @mixed = to_boolean(value) + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/complexExtension.rb b/lib/wsdl/xmlSchema/complexExtension.rb new file mode 100644 index 0000000..23b68ab --- /dev/null +++ b/lib/wsdl/xmlSchema/complexExtension.rb @@ -0,0 +1,119 @@ +# WSDL4R - XMLSchema complexType extension definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' + + +module WSDL +module XMLSchema + + +class ComplexExtension < Info + attr_accessor :base + attr_reader :content + + def initialize + super + @base = nil + @basetype = nil + @content = nil + @attributes = XSD::NamedElements.new + end + + def targetnamespace + parent.targetnamespace + end + + def elementformdefault + parent.elementformdefault + end + + def have_any? + basetype.have_any? or (content && content.have_any?) + end + + def choice? + content and content.choice? + end + + def elements + result = XSD::NamedElements.new + result.concat(basetype.elements) + result.concat(content.elements) if content + result + end + + def nested_elements + result = XSD::NamedElements.new + result.concat(basetype.nested_elements) + result.concat(content.nested_elements) if content + result + end + + def attributes + basetype.attributes + @attributes + end + + def check_type + if @base == ::SOAP::ValueArrayName + :TYPE_ARRAY + elsif content or !@attributes.empty? + :TYPE_STRUCT + else + basetype.check_type + end + end + + def parse_element(element) + case element + when AllName + @content = All.new + @content + when SequenceName + @content = Sequence.new + @content + when ChoiceName + @content = Choice.new + @content + when AttributeName + o = Attribute.new + @attributes << o + o + when AttributeGroupName + o = AttributeGroup.new + @attributes << o + o + when AnyAttributeName + o = AnyAttribute.new + @attributes << o + o + end + end + + def parse_attr(attr, value) + case attr + when BaseAttrName + @base = value + end + end + +private + + def basetype + @basetype ||= root.collect_complextypes[@base] + unless @basetype + raise RuntimeError.new("base type definition not found: #{@base}") + end + @basetype + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/complexRestriction.rb b/lib/wsdl/xmlSchema/complexRestriction.rb new file mode 100644 index 0000000..c12cc0f --- /dev/null +++ b/lib/wsdl/xmlSchema/complexRestriction.rb @@ -0,0 +1,104 @@ +# WSDL4R - XMLSchema complexType restriction definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' + + +module WSDL +module XMLSchema + + +class ComplexRestriction < Info + attr_accessor :base + attr_reader :content + attr_reader :attributes + + def initialize + super + @base = nil + @basetype = nil + @content = nil + @attributes = XSD::NamedElements.new + end + + def targetnamespace + parent.targetnamespace + end + + def elementformdefault + parent.elementformdefault + end + + def have_any? + @content and @content.have_any? + end + + def choice? + @content and @content.choice? + end + + def elements + @content ? @content.elements : XSD::NamedElements::Empty + end + + def nested_elements + @content ? @content.nested_elements : XSD::NamedElements::Empty + end + + def check_type + if @base == ::SOAP::ValueArrayName + :TYPE_ARRAY + else + basetype.check_type if basetype + end + end + + def parse_element(element) + case element + when AllName + @content = All.new + @content + when SequenceName + @content = Sequence.new + @content + when ChoiceName + @content = Choice.new + @content + when AttributeName + o = Attribute.new + @attributes << o + o + when AttributeGroupName + o = AttributeGroup.new + @attributes << o + o + when AnyAttributeName + o = AnyAttribute.new + @attributes << o + o + end + end + + def parse_attr(attr, value) + case attr + when BaseAttrName + @base = value + end + end + +private + + def basetype + @basetype ||= root.collect_complextypes[@base] + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/complexType.rb b/lib/wsdl/xmlSchema/complexType.rb new file mode 100644 index 0000000..79374f7 --- /dev/null +++ b/lib/wsdl/xmlSchema/complexType.rb @@ -0,0 +1,193 @@ +# WSDL4R - XMLSchema complexType definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/xmlSchema/element' +require 'xsd/namedelements' + + +module WSDL +module XMLSchema + + +class ComplexType < Info + attr_accessor :name + attr_accessor :complexcontent + attr_accessor :simplecontent + attr_reader :content + attr_accessor :final + attr_accessor :mixed + attr_accessor :abstract + + def initialize(name = nil) + super() + @name = name + @complexcontent = nil + @simplecontent = nil + @content = nil + @final = nil + @mixed = false + @abstract = false + @attributes = XSD::NamedElements.new + end + + def targetnamespace + # inner elements can be qualified + # parent.is_a?(WSDL::XMLSchema::Element) ? nil : parent.targetnamespace + parent.targetnamespace + end + + def elementformdefault + parent.elementformdefault + end + + def have_any? + if c = @complexcontent || @content + c.have_any? + else + false + end + end + + def choice? + if c = @complexcontent || @content + c.choice? + else + false + end + end + + def base + if c = @complexcontent || @simplecontent + c.base + end + end + + def elements + if c = @complexcontent || @content + c.elements + else + XSD::NamedElements::Empty + end + end + + def attributes + attrs = nil + if @complexcontent + attrs = @complexcontent.attributes + @attributes + elsif @simplecontent + attrs = @simplecontent.attributes + @attributes + else + attrs = @attributes + end + found = XSD::NamedElements.new + attrs.each do |attr| + case attr + when Attribute + found << attr + when AttributeGroup + if attr.attributes + found.concat(attr.attributes) + end + when AnyAttribute + # ignored + else + warn("unknown attribute: #{attr}") + end + end + found + end + + def nested_elements + if c = @complexcontent || @content + c.nested_elements + else + XSD::NamedElements::Empty + end + end + + def find_element(name) + return nil if name.nil? + elements.each do |element| + return element if name == element.name + end + nil + end + + def find_element_by_name(name) + return nil if name.nil? + elements.each do |element| + return element if name == element.name.name + end + nil + end + + def sequence_elements=(elements) + @content = Sequence.new + elements.each do |element| + @content << element + end + end + + def all_elements=(elements) + @content = All.new + elements.each do |element| + @content << element + end + end + + def parse_element(element) + case element + when AllName + @content = All.new + when SequenceName + @content = Sequence.new + when ChoiceName + @content = Choice.new + when GroupName + @content = Group.new + when ComplexContentName + @complexcontent = ComplexContent.new + when SimpleContentName + @simplecontent = SimpleContent.new + when AttributeName + o = Attribute.new + @attributes << o + o + when AttributeGroupName + o = AttributeGroup.new + @attributes << o + o + when AnyAttributeName + o = AnyAttribute.new + @attributes << o + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when AbstractAttrName + @abstract = to_boolean(value) + when FinalAttrName + @final = value.source + when MixedAttrName + @mixed = to_boolean(value) + when NameAttrName + @name = XSD::QName.new(targetnamespace, value.source) + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/content.rb b/lib/wsdl/xmlSchema/content.rb new file mode 100644 index 0000000..2583ddb --- /dev/null +++ b/lib/wsdl/xmlSchema/content.rb @@ -0,0 +1,95 @@ +# WSDL4R - XMLSchema content base definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class Content < Info + attr_reader :minoccurs + attr_reader :maxoccurs + attr_reader :elements + + def initialize + super() + @minoccurs = 1 + @maxoccurs = 1 + @elements = XSD::NamedElements.new + end + + def targetnamespace + parent.targetnamespace + end + + def elementformdefault + parent.elementformdefault + end + + def have_any? + false + end + + def choice? + false + end + + def map_as_array? + maxoccurs.nil? or maxoccurs != 1 + end + + def nested_elements + elements = XSD::NamedElements.new + @elements.each do |ele| + if ele.respond_to?(:nested_elements) + elements.concat(ele.nested_elements) + else + elements << ele + end + end + elements + end + + def <<(element) + @elements << element + end + + def parse_element(element) + case element + when ElementName + o = Element.new + o.form = elementformdefault + @elements << o + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when MaxOccursAttrName + if value.source == 'unbounded' + @maxoccurs = nil + else + @maxoccurs = Integer(value.source) + end + value.source + when MinOccursAttrName + @minoccurs = Integer(value.source) + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/data.rb b/lib/wsdl/xmlSchema/data.rb new file mode 100644 index 0000000..bf2dd62 --- /dev/null +++ b/lib/wsdl/xmlSchema/data.rb @@ -0,0 +1,116 @@ +# WSDL4R - XMLSchema data definitions. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/datatypes' +require 'wsdl/xmlSchema/annotation' +require 'wsdl/xmlSchema/schema' +require 'wsdl/xmlSchema/import' +require 'wsdl/xmlSchema/include' +require 'wsdl/xmlSchema/simpleType' +require 'wsdl/xmlSchema/simpleRestriction' +require 'wsdl/xmlSchema/simpleExtension' +require 'wsdl/xmlSchema/complexType' +require 'wsdl/xmlSchema/complexContent' +require 'wsdl/xmlSchema/complexRestriction' +require 'wsdl/xmlSchema/complexExtension' +require 'wsdl/xmlSchema/simpleContent' +require 'wsdl/xmlSchema/any' +require 'wsdl/xmlSchema/anyAttribute' +require 'wsdl/xmlSchema/element' +require 'wsdl/xmlSchema/all' +require 'wsdl/xmlSchema/choice' +require 'wsdl/xmlSchema/sequence' +require 'wsdl/xmlSchema/list' +require 'wsdl/xmlSchema/attribute' +require 'wsdl/xmlSchema/union' +require 'wsdl/xmlSchema/unique' +require 'wsdl/xmlSchema/group' +require 'wsdl/xmlSchema/attributeGroup' + +require 'wsdl/xmlSchema/length' +require 'wsdl/xmlSchema/minlength' +require 'wsdl/xmlSchema/maxlength' +require 'wsdl/xmlSchema/pattern' +require 'wsdl/xmlSchema/enumeration' +require 'wsdl/xmlSchema/whitespace' +require 'wsdl/xmlSchema/maxinclusive' +require 'wsdl/xmlSchema/maxexclusive' +require 'wsdl/xmlSchema/minexclusive' +require 'wsdl/xmlSchema/mininclusive' +require 'wsdl/xmlSchema/totaldigits' +require 'wsdl/xmlSchema/fractiondigits' + +module WSDL +module XMLSchema + + +AllName = XSD::QName.new(XSD::Namespace, 'all') +AnnotationName = XSD::QName.new(XSD::Namespace, 'annotation') +AnyName = XSD::QName.new(XSD::Namespace, 'any') +AnyAttributeName = XSD::QName.new(XSD::Namespace, 'anyAttribute') +AttributeName = XSD::QName.new(XSD::Namespace, 'attribute') +AttributeGroupName = XSD::QName.new(XSD::Namespace, 'attributeGroup') +ChoiceName = XSD::QName.new(XSD::Namespace, 'choice') +ComplexContentName = XSD::QName.new(XSD::Namespace, 'complexContent') +ComplexTypeName = XSD::QName.new(XSD::Namespace, 'complexType') +ElementName = XSD::QName.new(XSD::Namespace, 'element') +ExtensionName = XSD::QName.new(XSD::Namespace, 'extension') +GroupName = XSD::QName.new(XSD::Namespace, 'group') +ImportName = XSD::QName.new(XSD::Namespace, 'import') +IncludeName = XSD::QName.new(XSD::Namespace, 'include') +ListName = XSD::QName.new(XSD::Namespace, 'list') +RestrictionName = XSD::QName.new(XSD::Namespace, 'restriction') +SequenceName = XSD::QName.new(XSD::Namespace, 'sequence') +SchemaName = XSD::QName.new(XSD::Namespace, 'schema') +SimpleContentName = XSD::QName.new(XSD::Namespace, 'simpleContent') +SimpleTypeName = XSD::QName.new(XSD::Namespace, 'simpleType') +UnionName = XSD::QName.new(XSD::Namespace, 'union') +UniqueName = XSD::QName.new(XSD::Namespace, 'unique') + +LengthName = XSD::QName.new(XSD::Namespace, 'length') +MinLengthName = XSD::QName.new(XSD::Namespace, 'minLength') +MaxLengthName = XSD::QName.new(XSD::Namespace, 'maxLength') +PatternName = XSD::QName.new(XSD::Namespace, 'pattern') +EnumerationName = XSD::QName.new(XSD::Namespace, 'enumeration') +WhiteSpaceName = XSD::QName.new(XSD::Namespace, 'whiteSpace') +MaxInclusiveName = XSD::QName.new(XSD::Namespace, 'maxInclusive') +MaxExclusiveName = XSD::QName.new(XSD::Namespace, 'maxExclusive') +MinExclusiveName = XSD::QName.new(XSD::Namespace, 'minExclusive') +MinInclusiveName = XSD::QName.new(XSD::Namespace, 'minInclusive') +TotalDigitsName = XSD::QName.new(XSD::Namespace, 'totalDigits') +FractionDigitsName = XSD::QName.new(XSD::Namespace, 'fractionDigits') + +AbstractAttrName = XSD::QName.new(nil, 'abstract') +AttributeFormDefaultAttrName = XSD::QName.new(nil, 'attributeFormDefault') +BaseAttrName = XSD::QName.new(nil, 'base') +DefaultAttrName = XSD::QName.new(nil, 'default') +ElementFormDefaultAttrName = XSD::QName.new(nil, 'elementFormDefault') +FinalAttrName = XSD::QName.new(nil, 'final') +FixedAttrName = XSD::QName.new(nil, 'fixed') +FormAttrName = XSD::QName.new(nil, 'form') +IdAttrName = XSD::QName.new(nil, 'id') +ItemTypeAttrName = XSD::QName.new(nil, 'itemType') +MaxOccursAttrName = XSD::QName.new(nil, 'maxOccurs') +MemberTypesAttrName = XSD::QName.new(nil, 'memberTypes') +MinOccursAttrName = XSD::QName.new(nil, 'minOccurs') +MixedAttrName = XSD::QName.new(nil, 'mixed') +NameAttrName = XSD::QName.new(nil, 'name') +NamespaceAttrName = XSD::QName.new(nil, 'namespace') +NillableAttrName = XSD::QName.new(nil, 'nillable') +ProcessContentsAttrName = XSD::QName.new(nil, 'processContents') +RefAttrName = XSD::QName.new(nil, 'ref') +SchemaLocationAttrName = XSD::QName.new(nil, 'schemaLocation') +TargetNamespaceAttrName = XSD::QName.new(nil, 'targetNamespace') +TypeAttrName = XSD::QName.new(nil, 'type') +UseAttrName = XSD::QName.new(nil, 'use') +ValueAttrName = XSD::QName.new(nil, 'value') +VersionAttrName = XSD::QName.new(nil, 'version') + + +end +end diff --git a/lib/wsdl/xmlSchema/element.rb b/lib/wsdl/xmlSchema/element.rb new file mode 100644 index 0000000..70919fe --- /dev/null +++ b/lib/wsdl/xmlSchema/element.rb @@ -0,0 +1,153 @@ +# WSDL4R - XMLSchema element definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/xmlSchema/ref' + + +module WSDL +module XMLSchema + + +class Element < Info + include Ref + + attr_writer :name # required + attr_writer :form + attr_writer :type + attr_writer :local_simpletype + attr_writer :local_complextype + attr_writer :constraint + attr_accessor :maxoccurs + attr_accessor :minoccurs + attr_writer :nillable + + attr_reader_ref :name + attr_reader_ref :form + attr_reader_ref :type + attr_reader_ref :local_simpletype + attr_reader_ref :local_complextype + attr_reader_ref :constraint + attr_reader_ref :nillable + attr_reader_ref :default + attr_reader_ref :abstract + + def initialize(name = nil, type = nil) + super() + @name = name + @form = nil + @type = type + @local_simpletype = @local_complextype = nil + @constraint = nil + @maxoccurs = 1 + @minoccurs = 1 + @nillable = nil + @default = nil + @abstract = false + @ref = nil + @refelement = nil + end + + def empty? + !(local_simpletype || local_complextype || constraint || type) + end + + def targetnamespace + parent.targetnamespace + end + + def elementformdefault + parent.elementformdefault + end + + def elementform + self.form.nil? ? parent.elementformdefault : self.form + end + + def parse_element(element) + case element + when SimpleTypeName + @local_simpletype = SimpleType.new + @local_simpletype + when ComplexTypeName + @type = nil + @local_complextype = ComplexType.new + @local_complextype + when UniqueName + @constraint = Unique.new + @constraint + else + nil + end + end + + def parse_attr(attr, value) + case attr + when NameAttrName + # namespace may be nil + if directelement? or elementform == 'qualified' + @name = XSD::QName.new(targetnamespace, value.source) + else + @name = XSD::QName.new(nil, value.source) + end + when FormAttrName + @form = value.source + if @form != 'qualified' and @name.namespace + @name = XSD::QName.new(nil, @name.name) + end + @form + when TypeAttrName + @type = value + when RefAttrName + @ref = value + when MaxOccursAttrName + if parent.is_a?(All) + if value.source != '1' + raise Parser::AttributeConstraintError.new( + "cannot parse #{value} for #{attr}") + end + end + if value.source == 'unbounded' + @maxoccurs = nil + else + @maxoccurs = Integer(value.source) + end + value.source + when MinOccursAttrName + if parent.is_a?(All) + unless ['0', '1'].include?(value.source) + raise Parser::AttributeConstraintError.new( + "cannot parse #{value} for #{attr}") + end + end + @minoccurs = Integer(value.source) + when NillableAttrName + @nillable = to_boolean(value) + when DefaultAttrName + @default = value.source + when AbstractAttrName + @abstract = to_boolean(value) + else + nil + end + end + +private + + def directelement? + parent.is_a?(Schema) + end + + def refelement + @refelement ||= (@ref ? root.collect_elements[@ref] : nil) + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/enumeration.rb b/lib/wsdl/xmlSchema/enumeration.rb new file mode 100644 index 0000000..592c2c2 --- /dev/null +++ b/lib/wsdl/xmlSchema/enumeration.rb @@ -0,0 +1,36 @@ +# WSDL4R - XMLSchema enumeration definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class Enumeration < Info + def initialize + super + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when ValueAttrName + parent.enumeration << value.source + value.source + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/fractiondigits.rb b/lib/wsdl/xmlSchema/fractiondigits.rb new file mode 100644 index 0000000..d0c5a2c --- /dev/null +++ b/lib/wsdl/xmlSchema/fractiondigits.rb @@ -0,0 +1,37 @@ +# WSDL4R - XMLSchema fractionDigits definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class FractionDigits < Info + def initialize + super + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when FixedAttrName + parent.fixed[:fractiondigits] = to_boolean(value) + when ValueAttrName + parent.fractiondigits = to_int(value) + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/group.rb b/lib/wsdl/xmlSchema/group.rb new file mode 100644 index 0000000..af12009 --- /dev/null +++ b/lib/wsdl/xmlSchema/group.rb @@ -0,0 +1,100 @@ +# WSDL4R - XMLSchema group definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/xmlSchema/ref' + + +module WSDL +module XMLSchema + + +class Group < Info + include Ref + + attr_writer :name # required + attr_accessor :maxoccurs + attr_accessor :minoccurs + attr_writer :content + + attr_reader_ref :name + attr_reader_ref :content + + def initialize(name = nil) + super() + @name = name + @maxoccurs = 1 + @minoccurs = 1 + @content = nil + @ref = nil + @refelement = nil + end + + def targetnamespace + parent.targetnamespace + end + + def elementformdefault + parent.elementformdefault + end + + def parse_element(element) + case element + when AllName + @content = All.new + when SequenceName + @content = Sequence.new + when ChoiceName + @content = Choice.new + else + nil + end + end + + def parse_attr(attr, value) + case attr + when NameAttrName + @name = XSD::QName.new(targetnamespace, value.source) + when RefAttrName + @ref = value + when MaxOccursAttrName + if parent.is_a?(All) + if value.source != '1' + raise Parser::AttributeConstraintError.new( + "cannot parse #{value} for #{attr}") + end + end + if value.source == 'unbounded' + @maxoccurs = nil + else + @maxoccurs = Integer(value.source) + end + value.source + when MinOccursAttrName + if parent.is_a?(All) + unless ['0', '1'].include?(value.source) + raise Parser::AttributeConstraintError.new( + "cannot parse #{value} for #{attr}") + end + end + @minoccurs = Integer(value.source) + else + nil + end + end + +private + + def refelement + @refelement ||= (@ref ? root.collect_modelgroups[@ref] : nil) + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/import.rb b/lib/wsdl/xmlSchema/import.rb new file mode 100644 index 0000000..b17d3a5 --- /dev/null +++ b/lib/wsdl/xmlSchema/import.rb @@ -0,0 +1,53 @@ +# WSDL4R - XMLSchema import definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/xmlSchema/importer' +require 'wsdl/xmlSchema/importHandler' + + +module WSDL +module XMLSchema + + +class Import < Info + attr_reader :namespace + + def initialize + super + @namespace = nil + @handler = ImportHandler.new + end + + def schemalocation + @handler.schemalocation + end + + def content + @handler.content + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when NamespaceAttrName + @namespace = value.source + when SchemaLocationAttrName + @handler.parse_schemalocation(value.source, root, parent) + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/importHandler.rb b/lib/wsdl/xmlSchema/importHandler.rb new file mode 100644 index 0000000..b6fb39d --- /dev/null +++ b/lib/wsdl/xmlSchema/importHandler.rb @@ -0,0 +1,45 @@ +# WSDL4R - XMLSchema import handler. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/xmlSchema/importer' + + +module WSDL +module XMLSchema + + +class ImportHandler + attr_reader :schemalocation + attr_reader :content + + def initialize + @schemalocation = nil + @content = nil + end + + def parse_schemalocation(location, root, parent) + @schemalocation = URI.parse(location) + if @schemalocation.relative? and !parent.location.nil? and + !parent.location.relative? + @schemalocation = parent.location + @schemalocation + end + if root.importedschema.key?(@schemalocation) + @content = root.importedschema[@schemalocation] + else + root.importedschema[@schemalocation] = nil # placeholder + @content = Importer.import(@schemalocation, root) + root.importedschema[@schemalocation] = @content + end + @schemalocation + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/importer.rb b/lib/wsdl/xmlSchema/importer.rb new file mode 100644 index 0000000..20e5eda --- /dev/null +++ b/lib/wsdl/xmlSchema/importer.rb @@ -0,0 +1,102 @@ +# WSDL4R - XSD importer library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'soap/soap' +require 'soap/httpconfigloader' +require 'wsdl/xmlSchema/parser' + + +module WSDL +module XMLSchema + + +class Importer + DO_NOT_IMPORT = [::SOAP::EncodingNamespace] + + def self.import(location, originalroot = nil) + new.import(location, originalroot) + end + + def initialize + @web_client = nil + end + + def import(location, originalroot = nil) + if DO_NOT_IMPORT.include?(location.to_s) + return nil + end + unless location.is_a?(URI) + location = URI.parse(location) + end + source, normalizedlocation = fetch(location) + content = parse(source, normalizedlocation, originalroot) + content.location = normalizedlocation + content + end + +private + + def parse(content, location, originalroot) + opt = { + :location => location, + :originalroot => originalroot + } + WSDL::XMLSchema::Parser.new(opt).parse(content) + end + + def fetch(location) + warn("importing: #{location}") if $DEBUG + content = nil + normalizedlocation = location + if location.scheme == 'file' or + (location.relative? and FileTest.exist?(location.path)) + content = File.open(location.path).read + normalizedlocation = URI.parse('file://' + File.expand_path(location.path)) + elsif location.scheme and location.scheme.size == 1 and + FileTest.exist?(location.to_s) + # ToDo: remove this ugly workaround for a path with drive letter + # (D://foo/bar) + content = File.open(location.to_s).read + else + client = web_client.new(nil, "WSDL4R") + client.proxy = ::SOAP::Env::HTTP_PROXY + client.no_proxy = ::SOAP::Env::NO_PROXY + if opt = ::SOAP::Property.loadproperty(::SOAP::PropertyName) + http_opt = opt["client.protocol.http"] + ::SOAP::HTTPConfigLoader.set_options(client, http_opt) if http_opt + end + content = client.get_content(location) + end + return content, normalizedlocation + end + + def web_client + return @web_client if @web_client + begin + require 'httpclient' + @web_client = HTTPClient + rescue LoadError + begin + require 'http-access2' + if HTTPAccess2::VERSION < "2.0" + raise LoadError.new("http-access/2.0 or later is required.") + end + @web_client = HTTPAccess2::Client + rescue LoadError + warn("Loading http-access2 failed. Net/http is used.") if $DEBUG + require 'soap/netHttpClient' + @web_client = ::SOAP::NetHttpClient + end + end + @web_client + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/include.rb b/lib/wsdl/xmlSchema/include.rb new file mode 100644 index 0000000..13dfa51 --- /dev/null +++ b/lib/wsdl/xmlSchema/include.rb @@ -0,0 +1,48 @@ +# WSDL4R - XMLSchema include definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'wsdl/xmlSchema/importer' +require 'wsdl/xmlSchema/importHandler' + + +module WSDL +module XMLSchema + + +class Include < Info + def initialize + super + @handler = ImportHandler.new + end + + def schemalocation + @handler.schemalocation + end + + def content + @handler.content + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when SchemaLocationAttrName + @handler.parse_schemalocation(value.source, root, parent) + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/length.rb b/lib/wsdl/xmlSchema/length.rb new file mode 100644 index 0000000..71fba88 --- /dev/null +++ b/lib/wsdl/xmlSchema/length.rb @@ -0,0 +1,37 @@ +# WSDL4R - XMLSchema length definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class Length < Info + def initialize + super + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when FixedAttrName + parent.fixed[:length] = to_boolean(value) + when ValueAttrName + parent.length = to_int(value) + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/list.rb b/lib/wsdl/xmlSchema/list.rb new file mode 100644 index 0000000..7d5ecec --- /dev/null +++ b/lib/wsdl/xmlSchema/list.rb @@ -0,0 +1,48 @@ +# WSDL4R - XMLSchema list definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class List < Info + attr_reader :itemtype + attr_reader :local_simpletype + + def initialize + super() + @itemtype = nil + @local_simpletype = nil + end + + def parse_element(element) + case element + when SimpleTypeName + @local_simpletype = SimpleType.new + @local_simpletype + else + nil + end + end + + def parse_attr(attr, value) + case attr + when ItemTypeAttrName + @itemtype = value + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/maxexclusive.rb b/lib/wsdl/xmlSchema/maxexclusive.rb new file mode 100644 index 0000000..41df496 --- /dev/null +++ b/lib/wsdl/xmlSchema/maxexclusive.rb @@ -0,0 +1,37 @@ +# WSDL4R - XMLSchema maxExclusive definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class MaxExclusive < Info + def initialize + super + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when FixedAttrName + parent.fixed[:maxexclusive] = to_boolean(value) + when ValueAttrName + parent.maxexclusive = value.source + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/maxinclusive.rb b/lib/wsdl/xmlSchema/maxinclusive.rb new file mode 100644 index 0000000..3be8e2c --- /dev/null +++ b/lib/wsdl/xmlSchema/maxinclusive.rb @@ -0,0 +1,37 @@ +# WSDL4R - XMLSchema maxInclusive definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class MaxInclusive < Info + def initialize + super + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when FixedAttrName + parent.fixed[:maxinclusive] = to_boolean(value) + when ValueAttrName + parent.maxinclusive = value.source + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/maxlength.rb b/lib/wsdl/xmlSchema/maxlength.rb new file mode 100644 index 0000000..d35e01b --- /dev/null +++ b/lib/wsdl/xmlSchema/maxlength.rb @@ -0,0 +1,37 @@ +# WSDL4R - XMLSchema maxLength definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class MaxLength < Info + def initialize + super + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when FixedAttrName + parent.fixed[:maxlength] = to_boolean(value) + when ValueAttrName + parent.maxlength = to_int(value) + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/minexclusive.rb b/lib/wsdl/xmlSchema/minexclusive.rb new file mode 100644 index 0000000..8621349 --- /dev/null +++ b/lib/wsdl/xmlSchema/minexclusive.rb @@ -0,0 +1,37 @@ +# WSDL4R - XMLSchema minExclusive definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class MinExclusive < Info + def initialize + super + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when FixedAttrName + parent.fixed[:minexclusive] = to_boolean(value) + when ValueAttrName + parent.minexclusive = value.source + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/mininclusive.rb b/lib/wsdl/xmlSchema/mininclusive.rb new file mode 100644 index 0000000..2a3f68d --- /dev/null +++ b/lib/wsdl/xmlSchema/mininclusive.rb @@ -0,0 +1,37 @@ +# WSDL4R - XMLSchema minInclusive definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class MinInclusive < Info + def initialize + super + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when FixedAttrName + parent.fixed[:mininclusive] = to_boolean(value) + when ValueAttrName + parent.mininclusive = value.source + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/minlength.rb b/lib/wsdl/xmlSchema/minlength.rb new file mode 100644 index 0000000..e10a1f1 --- /dev/null +++ b/lib/wsdl/xmlSchema/minlength.rb @@ -0,0 +1,37 @@ +# WSDL4R - XMLSchema minLength definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class MinLength < Info + def initialize + super + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when FixedAttrName + parent.fixed[:minlength] = to_boolean(value) + when ValueAttrName + parent.minlength = to_int(value) + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/parser.rb b/lib/wsdl/xmlSchema/parser.rb new file mode 100644 index 0000000..746b6bb --- /dev/null +++ b/lib/wsdl/xmlSchema/parser.rb @@ -0,0 +1,167 @@ +# WSDL4R - WSDL XML Instance parser library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/qname' +require 'xsd/ns' +require 'xsd/charset' +require 'xsd/datatypes' +require 'xsd/xmlparser' +require 'wsdl/xmlSchema/data' + + +module WSDL +module XMLSchema + + +class Parser + include XSD + + class ParseError < Error; end + class FormatDecodeError < ParseError; end + class UnknownElementError < FormatDecodeError; end + class UnknownAttributeError < FormatDecodeError; end + class UnexpectedElementError < FormatDecodeError; end + class ElementConstraintError < FormatDecodeError; end + class AttributeConstraintError < FormatDecodeError; end + +private + + class ParseFrame + attr_reader :ns + attr_reader :name + attr_accessor :node + + private + + def initialize(ns, name, node) + @ns = ns + @name = name + @node = node + end + end + +public + + def initialize(opt = {}) + @parser = XSD::XMLParser.create_parser(self, opt) + @parsestack = nil + @lastnode = nil + @ignored = {} + @location = opt[:location] + @originalroot = opt[:originalroot] + end + + def parse(string_or_readable) + @parsestack = [] + @lastnode = nil + @textbuf = '' + @parser.do_parse(string_or_readable) + @lastnode + end + + def charset + @parser.charset + end + + def start_element(name, attrs) + lastframe = @parsestack.last + ns = parent = nil + if lastframe + ns = lastframe.ns + parent = lastframe.node + else + ns = XSD::NS.new + parent = nil + end + # ns might be the same + ns, attrs = XSD::XMLParser.filter_ns(ns, attrs) + node = decode_tag(ns, name, attrs, parent) + @parsestack << ParseFrame.new(ns, name, node) + end + + def characters(text) + lastframe = @parsestack.last + if lastframe + # Need not to be cloned because character does not have attr. + ns = lastframe.ns + decode_text(ns, text) + else + p text if $DEBUG + end + end + + def end_element(name) + lastframe = @parsestack.pop + unless name == lastframe.name + raise UnexpectedElementError.new("closing element name '#{name}' does not match with opening element '#{lastframe.name}'") + end + decode_tag_end(lastframe.ns, lastframe.node) + @lastnode = lastframe.node + end + +private + + def decode_tag(ns, name, attrs, parent) + o = nil + elename = ns.parse(name) + if !parent + if elename == SchemaName + o = Schema.parse_element(elename) + o.location = @location + else + raise UnknownElementError.new("unknown element: #{elename}") + end + o.root = @originalroot if @originalroot # o.root = o otherwise + else + if elename == AnnotationName + # only the first annotation element is allowed for each element. + o = Annotation.new + else + o = parent.parse_element(elename) + end + if o.nil? + unless @ignored.key?(elename) + warn("ignored element: #{elename} of #{parent.class}") + @ignored[elename] = elename + end + o = Documentation.new # which accepts any element. + end + # node could be a pseudo element. pseudo element has its own parent. + o.root = parent.root + o.parent = parent if o.parent.nil? + end + attrs.each do |key, value| + attr_ele = ns.parse(key, true) + value_ele = ns.parse(value, false) + value_ele.source = value # for recovery; value may not be a QName + if attr_ele == IdAttrName + o.id = value_ele + else + if o.parse_attr(attr_ele, value_ele).nil? + unless @ignored.key?(attr_ele) + warn("ignored attr: #{attr_ele}") + @ignored[attr_ele] = attr_ele + end + end + end + end + o + end + + def decode_tag_end(ns, node) + node.parse_epilogue + end + + def decode_text(ns, text) + @textbuf << text + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/pattern.rb b/lib/wsdl/xmlSchema/pattern.rb new file mode 100644 index 0000000..160636c --- /dev/null +++ b/lib/wsdl/xmlSchema/pattern.rb @@ -0,0 +1,36 @@ +# WSDL4R - XMLSchema pattern definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class Pattern < Info + def initialize + super + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when ValueAttrName + parent.pattern = /\A#{value.source}\z/n + value.source + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/ref.rb b/lib/wsdl/xmlSchema/ref.rb new file mode 100644 index 0000000..f7b5670 --- /dev/null +++ b/lib/wsdl/xmlSchema/ref.rb @@ -0,0 +1,33 @@ +# WSDL4R - XMLSchema ref support. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module WSDL +module XMLSchema + + +module Ref + def self.included(klass) + klass.extend(RefClassSupport) + end + + module RefClassSupport + def attr_reader_ref(symbol) + name = symbol.to_s + define_method(name) { + instance_variable_get("@#{name}") || + (refelement ? refelement.__send__(name) : nil) + } + end + end + + attr_accessor :ref +end + + +end +end diff --git a/lib/wsdl/xmlSchema/schema.rb b/lib/wsdl/xmlSchema/schema.rb new file mode 100644 index 0000000..841f6a9 --- /dev/null +++ b/lib/wsdl/xmlSchema/schema.rb @@ -0,0 +1,178 @@ +# WSDL4R - XMLSchema schema definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' + + +module WSDL +module XMLSchema + + +class Schema < Info + attr_reader :targetnamespace # required + attr_reader :complextypes + attr_reader :simpletypes + attr_reader :elements + attr_reader :attributes + attr_reader :modelgroups + attr_reader :attributegroups + attr_reader :imports + attr_accessor :attributeformdefault + attr_accessor :elementformdefault + attr_accessor :version + + attr_reader :importedschema + + def initialize + super + @targetnamespace = nil + @complextypes = XSD::NamedElements.new + @simpletypes = XSD::NamedElements.new + @elements = XSD::NamedElements.new + @attributes = XSD::NamedElements.new + @modelgroups = XSD::NamedElements.new + @attributegroups = XSD::NamedElements.new + @imports = [] + @attributeformdefault = "unqualified" + @elementformdefault = "unqualified" + @importedschema = {} + @location = nil + @root = self + @version = nil + end + + def location + @location || (root.nil? ? nil : root.location) + end + + def location=(location) + @location = location + end + + def parse_element(element) + case element + when ImportName + o = Import.new + @imports << o + o + when IncludeName + o = Include.new + @imports << o + o + when ComplexTypeName + o = ComplexType.new + @complextypes << o + o + when SimpleTypeName + o = SimpleType.new + @simpletypes << o + o + when ElementName + o = Element.new + o.form = 'qualified' # root element is qualified + @elements << o + o + when AttributeName + o = Attribute.new + @attributes << o + o + when GroupName + o = Group.new + @modelgroups << o + o + when AttributeGroupName + o = AttributeGroup.new + @attributegroups << o + o + else + nil + end + end + + def parse_attr(attr, value) + case attr + when TargetNamespaceAttrName + @targetnamespace = value.source + when AttributeFormDefaultAttrName + @attributeformdefault = value.source + when ElementFormDefaultAttrName + @elementformdefault = value.source + when VersionAttrName + @version = value.source + else + nil + end + end + + def collect_attributes + result = XSD::NamedElements.new + result.concat(@attributes) + @imports.each do |import| + result.concat(import.content.collect_attributes) if import.content + end + result + end + + def collect_modelgroups + result = XSD::NamedElements.new + result.concat(@modelgroups) + @imports.each do |import| + result.concat(import.content.collect_modelgroups) if import.content + end + result + end + + def collect_attributegroups + result = XSD::NamedElements.new + result.concat(@attributegroups) + @imports.each do |import| + result.concat(import.content.collect_attributegroups) if import.content + end + result + end + + def collect_elements + result = XSD::NamedElements.new + result.concat(@elements) + @imports.each do |import| + result.concat(import.content.collect_elements) if import.content + end + result + end + + def collect_complextypes + result = XSD::NamedElements.new + result.concat(@complextypes) + @imports.each do |import| + result.concat(import.content.collect_complextypes) if import.content + end + result + end + + def collect_simpletypes + result = XSD::NamedElements.new + result.concat(@simpletypes) + @imports.each do |import| + result.concat(import.content.collect_simpletypes) if import.content + end + result + end + + def self.parse_element(element) + if element == SchemaName + Schema.new + else + nil + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/sequence.rb b/lib/wsdl/xmlSchema/sequence.rb new file mode 100644 index 0000000..a1835dd --- /dev/null +++ b/lib/wsdl/xmlSchema/sequence.rb @@ -0,0 +1,54 @@ +# WSDL4R - XMLSchema complexType definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/xmlSchema/content' + + +module WSDL +module XMLSchema + + +class Sequence < Content + attr_reader :any + + def initialize + super() + @any = nil + end + + def have_any? + !!@any + end + + def parse_element(element) + case element + when SequenceName + o = Sequence.new + @elements << o + o + when ChoiceName + o = Choice.new + @elements << o + o + when GroupName + o = Group.new + @elements << o + o + when AnyName + @any = Any.new + @elements << @any + @any + else + super(element) + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/simpleContent.rb b/lib/wsdl/xmlSchema/simpleContent.rb new file mode 100644 index 0000000..9740d3e --- /dev/null +++ b/lib/wsdl/xmlSchema/simpleContent.rb @@ -0,0 +1,69 @@ +# WSDL4R - XMLSchema simpleContent definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' + + +module WSDL +module XMLSchema + + +class SimpleContent < Info + attr_reader :restriction + attr_reader :extension + + def check_lexical_format(value) + check(value) + end + + def initialize + super + @restriction = nil + @extension = nil + end + + def base + content.base + end + + def attributes + content.attributes + end + + def targetnamespace + parent.targetnamespace + end + + def parse_element(element) + case element + when RestrictionName + @restriction = SimpleRestriction.new + @restriction + when ExtensionName + @extension = SimpleExtension.new + @extension + end + end + +private + + def content + @restriction || @extension + end + + def check(value) + unless content.valid?(value) + raise XSD::ValueSpaceError.new("#{@name}: cannot accept '#{value}'") + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/simpleExtension.rb b/lib/wsdl/xmlSchema/simpleExtension.rb new file mode 100644 index 0000000..10f8c37 --- /dev/null +++ b/lib/wsdl/xmlSchema/simpleExtension.rb @@ -0,0 +1,62 @@ +# WSDL4R - XMLSchema simpleType extension definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' + + +module WSDL +module XMLSchema + + +class SimpleExtension < Info + attr_reader :base + attr_reader :attributes + + def initialize + super + @base = nil + @attributes = XSD::NamedElements.new + end + + def targetnamespace + parent.targetnamespace + end + + def valid?(value) + true + end + + def parse_element(element) + case element + when AttributeName + o = Attribute.new + @attributes << o + o + when AttributeGroupName + o = AttributeGroup.new + @attributes << o + o + when AnyAttributeName + o = AnyAttribute.new + @attributes << o + o + end + end + + def parse_attr(attr, value) + case attr + when BaseAttrName + @base = value + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/simpleRestriction.rb b/lib/wsdl/xmlSchema/simpleRestriction.rb new file mode 100644 index 0000000..ea32442 --- /dev/null +++ b/lib/wsdl/xmlSchema/simpleRestriction.rb @@ -0,0 +1,132 @@ +# WSDL4R - XMLSchema simpleContent restriction definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' + + +module WSDL +module XMLSchema + + +class SimpleRestriction < Info + attr_reader :base + attr_accessor :length + attr_accessor :minlength + attr_accessor :maxlength + attr_accessor :pattern + attr_reader :enumeration + attr_accessor :whitespace + attr_accessor :maxinclusive + attr_accessor :maxexclusive + attr_accessor :minexclusive + attr_accessor :mininclusive + attr_accessor :totaldigits + attr_accessor :fractiondigits + attr_reader :fixed + attr_reader :attributes + + def initialize + super + @base = nil + @enumeration = [] # NamedElements? + @length = nil + @maxlength = nil + @minlength = nil + @pattern = nil + @fixed = {} + @attributes = XSD::NamedElements.new + end + + def valid?(value) + return false unless check_restriction(value) + return false unless check_length(value) + return false unless check_maxlength(value) + return false unless check_minlength(value) + return false unless check_pattern(value) + true + end + + def enumeration? + !@enumeration.empty? + end + + def parse_element(element) + case element + when LengthName + Length.new + when MinLengthName + MinLength.new + when MaxLengthName + MaxLength.new + when PatternName + Pattern.new + when EnumerationName + Enumeration.new + when WhiteSpaceName + WhiteSpace.new + when MaxInclusiveName + MaxInclusive.new + when MaxExclusiveName + MaxExclusive.new + when MinExclusiveName + MinExclusive.new + when MinInclusiveName + MinInclusive.new + when TotalDigitsName + TotalDigits.new + when FractionDigitsName + FractionDigits.new + when AttributeName + o = Attribute.new + @attributes << o + o + when AttributeGroupName + o = AttributeGroup.new + @attributes << o + o + when AnyAttributeName + o = AnyAttribute.new + @attributes << o + o + end + end + + def parse_attr(attr, value) + case attr + when BaseAttrName + @base = value + end + end + +private + + def check_restriction(value) + @enumeration.empty? or @enumeration.include?(value) + end + + def check_length(value) + @length.nil? or value.size == @length + end + + def check_maxlength(value) + @maxlength.nil? or value.size <= @maxlength + end + + def check_minlength(value) + @minlength.nil? or value.size >= @minlength + end + + def check_pattern(value) + @pattern.nil? or @pattern =~ value + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/simpleType.rb b/lib/wsdl/xmlSchema/simpleType.rb new file mode 100644 index 0000000..a10420d --- /dev/null +++ b/lib/wsdl/xmlSchema/simpleType.rb @@ -0,0 +1,87 @@ +# WSDL4R - XMLSchema simpleType definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' + + +module WSDL +module XMLSchema + + +class SimpleType < Info + attr_accessor :name + attr_reader :restriction + attr_reader :list + attr_reader :union + + def check_lexical_format(value) + if @restriction + check_restriction(value) + elsif @list + # TODO: check + elsif @union + # TODO: check + else + raise ArgumentError.new("incomplete simpleType") + end + end + + def base + if @restriction + @restriction.base + else + nil + end + end + + def initialize(name = nil) + super() + @name = name + @restriction = nil + @list = nil + @union = nil + end + + def targetnamespace + parent.targetnamespace + end + + def parse_element(element) + case element + when RestrictionName + @restriction = SimpleRestriction.new + @restriction + when ListName + @list = List.new + @list + when UnionName + @union = Union.new + @union + end + end + + def parse_attr(attr, value) + case attr + when NameAttrName + @name = XSD::QName.new(targetnamespace, value.source) + end + end + +private + + def check_restriction(value) + unless @restriction.valid?(value) + raise XSD::ValueSpaceError.new("#{@name}: cannot accept '#{value}'") + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/totaldigits.rb b/lib/wsdl/xmlSchema/totaldigits.rb new file mode 100644 index 0000000..4669473 --- /dev/null +++ b/lib/wsdl/xmlSchema/totaldigits.rb @@ -0,0 +1,37 @@ +# WSDL4R - XMLSchema totalDigits definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class TotalDigits < Info + def initialize + super + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when FixedAttrName + parent.fixed[:totaldigits] = to_boolean(value) + when ValueAttrName + parent.totaldigits = to_int(value) + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/union.rb b/lib/wsdl/xmlSchema/union.rb new file mode 100644 index 0000000..57fdd46 --- /dev/null +++ b/lib/wsdl/xmlSchema/union.rb @@ -0,0 +1,35 @@ +# WSDL4R - XMLSchema union definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' +require 'xsd/namedelements' + + +module WSDL +module XMLSchema + + +class Union < Info + attr_reader :member_types + + def initialize + super + @member_types = nil + end + + def parse_attr(attr, value) + case attr + when MemberTypesAttrName + @member_types = value.source + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/unique.rb b/lib/wsdl/xmlSchema/unique.rb new file mode 100644 index 0000000..d872a43 --- /dev/null +++ b/lib/wsdl/xmlSchema/unique.rb @@ -0,0 +1,34 @@ +# WSDL4R - XMLSchema unique element. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class Unique < Info + def initialize + super + end + + def parse_element(element) + # Accepts any element. + self + end + + def parse_attr(attr, value) + # Accepts any attribute. + true + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/whitespace.rb b/lib/wsdl/xmlSchema/whitespace.rb new file mode 100644 index 0000000..54f1470 --- /dev/null +++ b/lib/wsdl/xmlSchema/whitespace.rb @@ -0,0 +1,37 @@ +# WSDL4R - XMLSchema whiteSpace definition for WSDL. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'wsdl/info' + + +module WSDL +module XMLSchema + + +class WhiteSpace < Info + def initialize + super + end + + def parse_element(element) + nil + end + + def parse_attr(attr, value) + case attr + when FixedAttrName + parent.fixed[:whitespace] = to_boolean(value) + when ValueAttrName + parent.whitespace = value.source + end + end +end + + +end +end diff --git a/lib/wsdl/xmlSchema/xsd2ruby.rb b/lib/wsdl/xmlSchema/xsd2ruby.rb new file mode 100644 index 0000000..69db776 --- /dev/null +++ b/lib/wsdl/xmlSchema/xsd2ruby.rb @@ -0,0 +1,174 @@ +# XSD4R - XSD to ruby mapping library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/codegen/gensupport' +require 'wsdl/xmlSchema/importer' +require 'wsdl/soap/classDefCreator' +require 'wsdl/soap/classDefCreatorSupport' +require 'wsdl/soap/literalMappingRegistryCreator' +require 'wsdl/soap/classNameCreator' +require 'logger' + + +module WSDL +module XMLSchema + + +class XSD2Ruby + include WSDL::SOAP::ClassDefCreatorSupport + + attr_accessor :location + attr_reader :opt + attr_accessor :logger + attr_accessor :basedir + + def run + unless @location + raise RuntimeError, "XML Schema location not given" + end + @xsd = import(@location) + @name = @opt['classdef'] || create_classname(@xsd) + create_file + end + +private + + def initialize + @location = nil + @opt = {} + @logger = Logger.new(STDERR) + @basedir = nil + @xsd = nil + @name = nil + @name_creator = WSDL::SOAP::ClassNameCreator.new + end + + def create_file + @modulepath = @opt['module_path'] + create_classdef if @opt.key?('classdef') + create_mapping_registry if @opt.key?('mapping_registry') + create_mapper if @opt.key?('mapper') + end + + def create_classdef + @logger.info { "Creating class definition." } + @classdef_filename = @name + '.rb' + check_file(@classdef_filename) or return + write_file(@classdef_filename) do |f| + f << WSDL::SOAP::ClassDefCreator.new(@xsd, @name_creator, @modulepath).dump + end + end + + def create_mapping_registry + @logger.info { "Creating mapping registry definition." } + @mr_filename = @name + '_mapping_registry.rb' + check_file(@mr_filename) or return + write_file(@mr_filename) do |f| + f << dump_mapping_registry + end + end + + def create_mapper + @logger.info { "Creating mapper definition." } + @mapper_filename = @name + '_mapper.rb' + check_file(@mapper_filename) or return + write_file(@mapper_filename) do |f| + f << dump_mapper + end + end + + def dump_mapping_registry + defined_const = {} + creator = WSDL::SOAP::LiteralMappingRegistryCreator.new(@xsd, @name_creator, @modulepath, defined_const) + module_name = XSD::CodeGen::GenSupport.safeconstname(@name + 'MappingRegistry') + if @modulepath + module_name = [@modulepath, module_name].join('::') + end + m = XSD::CodeGen::ModuleDef.new(module_name) + m.def_require("xsd/mapping") + m.def_require("#{@classdef_filename}") + varname = 'Registry' + m.def_const(varname, '::SOAP::Mapping::LiteralRegistry.new') + m.def_code(creator.dump(varname)) + # + defined_const.each do |ns, tag| + m.def_const(tag, dq(ns)) + end + m.dump + end + + def dump_mapper + class_name = XSD::CodeGen::GenSupport.safeconstname(@name + 'Mapper') + if @modulepath + class_name = [@modulepath, class_name].join('::') + end + mr_name = XSD::CodeGen::GenSupport.safeconstname(@name + 'MappingRegistry') + c = XSD::CodeGen::ClassDef.new(class_name, 'XSD::Mapping::Mapper') + c.def_require("#{@mr_filename}") + c.def_method("initialize") do + "super(#{mr_name}::Registry)" + end + c.dump + end + + def write_file(filename) + if @basedir + filename = File.join(basedir, filename) + end + File.open(filename, "w") do |f| + yield f + end + end + + def check_file(filename) + if @basedir + filename = File.join(basedir, filename) + end + if FileTest.exist?(filename) + if @opt.key?('force') + @logger.warn { + "File '#{filename}' exists but overrides it." + } + true + else + @logger.warn { + "File '#{filename}' exists. #{$0} did not override it." + } + false + end + else + @logger.info { "Creates file '#{filename}'." } + true + end + end + + def create_classname(xsd) + name = nil + if xsd.targetnamespace + name = xsd.targetnamespace.scan(/[a-zA-Z0-9]+$/)[0] + end + if name.nil? + 'default' + else + XSD::CodeGen::GenSupport.safevarname(name) + end + end + + def import(location) + WSDL::XMLSchema::Importer.import(location) + end +end + + +end +end + + +if __FILE__ == $0 + warn("WARNING: #{File.expand_path(__FILE__)} is a library file used by bin/xsd2ruby.rb. Find bin/xsd2ruby.rb from tarball version of soap4r or install soap4r via gem.") +end diff --git a/lib/xsd/charset.rb b/lib/xsd/charset.rb new file mode 100644 index 0000000..c1ad43f --- /dev/null +++ b/lib/xsd/charset.rb @@ -0,0 +1,189 @@ +# XSD4R - Charset handling library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module XSD + + +module Charset + @internal_encoding = "UTF8" #$KCODE + + class XSDError < StandardError; end + class CharsetError < XSDError; end + class UnknownCharsetError < CharsetError; end + class CharsetConversionError < CharsetError; end + +public + + ### + ## Maps + # + EncodingConvertMap = {} + def Charset.init + EncodingConvertMap[['UTF8', 'X_ISO_8859_1']] = + Proc.new { |str| str.unpack('U*').pack('C*') } + EncodingConvertMap[['X_ISO_8859_1', 'UTF8']] = + Proc.new { |str| str.unpack('C*').pack('U*') } + begin + require 'xsd/iconvcharset' + @internal_encoding = 'UTF8' + sjtag = (/(mswin|bccwin|mingw|cygwin|emx)/ =~ RUBY_PLATFORM) ? 'cp932' : + 'shift_jis' + EncodingConvertMap[['UTF8', 'EUC' ]] = + Proc.new { |str| IconvCharset.safe_iconv("euc-jp", "utf-8", str) } + EncodingConvertMap[['EUC' , 'UTF8']] = + Proc.new { |str| IconvCharset.safe_iconv("utf-8", "euc-jp", str) } + EncodingConvertMap[['EUC' , 'SJIS']] = + Proc.new { |str| IconvCharset.safe_iconv(sjtag, "euc-jp", str) } + EncodingConvertMap[['UTF8', 'SJIS']] = + Proc.new { |str| IconvCharset.safe_iconv(sjtag, "utf-8", str) } + EncodingConvertMap[['SJIS', 'UTF8']] = + Proc.new { |str| IconvCharset.safe_iconv("utf-8", sjtag, str) } + EncodingConvertMap[['SJIS', 'EUC' ]] = + Proc.new { |str| IconvCharset.safe_iconv("euc-jp", sjtag, str) } + rescue LoadError + begin + require 'nkf' + EncodingConvertMap[['EUC' , 'SJIS']] = + Proc.new { |str| NKF.nkf('-sXm0', str) } + EncodingConvertMap[['SJIS', 'EUC' ]] = + Proc.new { |str| NKF.nkf('-eXm0', str) } + rescue LoadError + end + + begin + require 'uconv' + @internal_encoding = 'UTF8' + EncodingConvertMap[['UTF8', 'EUC' ]] = Uconv.method(:u8toeuc) + EncodingConvertMap[['UTF8', 'SJIS']] = Uconv.method(:u8tosjis) + EncodingConvertMap[['EUC' , 'UTF8']] = Uconv.method(:euctou8) + EncodingConvertMap[['SJIS', 'UTF8']] = Uconv.method(:sjistou8) + rescue LoadError + end + end + end + self.init + + CharsetMap = { + 'NONE' => 'us-ascii', + 'EUC' => 'euc-jp', + 'SJIS' => 'shift_jis', + 'UTF8' => 'utf-8', + 'X_ISO_8859_1' => 'iso-8859-1', + 'X_UNKNOWN' => nil, + } + + CharsetStrCache = {} + + + ### + ## handlers + # + def Charset.encoding + @internal_encoding + end + + def Charset.encoding=(encoding) + warn("xsd charset is set to #{encoding}") if $DEBUG + @internal_encoding = encoding + end + + def Charset.xml_encoding_label + charset_label(@internal_encoding) + end + + def Charset.encoding_to_xml(str, charset) + encoding_conv(str, @internal_encoding, charset_str(charset)) + end + + def Charset.encoding_from_xml(str, charset) + encoding_conv(str, charset_str(charset), @internal_encoding) + end + + def Charset.encoding_conv(str, enc_from, enc_to) + if enc_from == enc_to or enc_from == 'NONE' or enc_to == 'NONE' + str + elsif converter = EncodingConvertMap[[enc_from, enc_to]] + converter.call(str) + else + raise CharsetConversionError.new( + "Converter not found: #{enc_from} -> #{enc_to}") + end + end + + def Charset.charset_label(encoding) + CharsetMap[encoding.upcase] + end + + def Charset.charset_str(label) + if CharsetMap.respond_to?(:key) + CharsetStrCache[label] ||= CharsetMap.key(label.downcase) || 'X_UNKNOWN' + else + CharsetStrCache[label] ||= CharsetMap.index(label.downcase) || 'X_UNKNOWN' + end + end + + # us_ascii = '[\x00-\x7F]' + us_ascii = "[\x9\xa\xd\x20-\x7F]" # XML 1.0 restricted. + USASCIIRegexp = Regexp.new("\\A#{us_ascii}*\\z") + + twobytes_euc = "(?:[\x8E\xA1-\xFE][\xA1-\xFE])" + threebytes_euc = "(?:\x8F[\xA1-\xFE][\xA1-\xFE])" + character_euc = "(?:#{us_ascii}|#{twobytes_euc}|#{threebytes_euc})" + EUCRegexp = Regexp.new("\\A#{character_euc}*\\z") + + # onebyte_sjis = '[\x00-\x7F\xA1-\xDF]' + onebyte_sjis = "[\x9\xa\xd\x20-\x7F\xA1-\xDF]" # XML 1.0 restricted. + twobytes_sjis = "(?:[\x81-\x9F\xE0-\xFC][\x40-\x7E\x80-\xFC])" + character_sjis = "(?:#{onebyte_sjis}|#{twobytes_sjis})" + SJISRegexp = Regexp.new("\\A#{character_sjis}*\\z") + + # 0xxxxxxx + # 110yyyyy 10xxxxxx + twobytes_utf8 = "(?:[\xC0-\xDF][\x80-\xBF])" + # 1110zzzz 10yyyyyy 10xxxxxx + threebytes_utf8 = "(?:[\xE0-\xEF][\x80-\xBF][\x80-\xBF])" + # 11110uuu 10uuuzzz 10yyyyyy 10xxxxxx + fourbytes_utf8 = "(?:[\xF0-\xF7][\x80-\xBF][\x80-\xBF][\x80-\xBF])" + character_utf8 = + "(?:#{us_ascii}|#{twobytes_utf8}|#{threebytes_utf8}|#{fourbytes_utf8})" + UTF8Regexp = Regexp.new("\\A#{character_utf8}*\\z") + + def Charset.is_us_ascii(str) + USASCIIRegexp =~ str + end + + def Charset.is_utf8(str) + UTF8Regexp =~ str + end + + def Charset.is_euc(str) + EUCRegexp =~ str + end + + def Charset.is_sjis(str) + SJISRegexp =~ str + end + + def Charset.is_ces(str, code = @internal_encoding) + case code + when 'NONE' + is_us_ascii(str) + when 'UTF8' + is_utf8(str) + when 'EUC' + is_euc(str) + when 'SJIS' + is_sjis(str) + else + raise UnknownCharsetError.new("Unknown charset: #{code}") + end + end +end + + +end diff --git a/lib/xsd/codegen.rb b/lib/xsd/codegen.rb new file mode 100644 index 0000000..4f71f0e --- /dev/null +++ b/lib/xsd/codegen.rb @@ -0,0 +1,12 @@ +# XSD4R - Generating code library +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/codegen/gensupport' +require 'xsd/codegen/moduledef' +require 'xsd/codegen/classdef' +require 'xsd/codegen/methoddef' diff --git a/lib/xsd/codegen/classdef.rb b/lib/xsd/codegen/classdef.rb new file mode 100644 index 0000000..755ec54 --- /dev/null +++ b/lib/xsd/codegen/classdef.rb @@ -0,0 +1,208 @@ +# XSD4R - Generating class definition code +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/codegen/gensupport' +require 'xsd/codegen/moduledef' +require 'xsd/codegen/methoddef' + + +module XSD +module CodeGen + + +class ClassDef < ModuleDef + include GenSupport + + def initialize(name, baseclass = nil) + super(name) + @baseclass = baseclass + @classvar = [] + @attrdef = [] + end + + def def_classvar(var, value) + var = var.sub(/\A@@/, "") + unless safevarname?(var) + raise ArgumentError.new("#{var} seems to be unsafe") + end + @classvar << [var, value] + end + + def def_attr(attrname, writable = true, varname = nil) + unless safevarname?(varname || attrname) + raise ArgumentError.new("#{varname || attrname} seems to be unsafe") + end + @attrdef << [attrname, writable, varname] + end + + def dump + buf = "" + unless @requirepath.empty? + buf << dump_requirepath + end + buf << dump_emptyline unless buf.empty? + package = @name.split(/::/)[0..-2] + buf << dump_package_def(package) unless package.empty? + buf << dump_comment if @comment + buf << dump_class_def + spacer = false + unless @classvar.empty? + spacer = true + buf << dump_classvar + end + unless @const.empty? + buf << dump_emptyline if spacer + spacer = true + buf << dump_const + end + unless @innermodule.empty? + buf << dump_emptyline # always add 1 empty line + spacer = true + buf << dump_innermodule + end + unless @code.empty? + buf << dump_emptyline if spacer + spacer = true + buf << dump_code + end + unless @attrdef.empty? + buf << dump_emptyline if spacer + spacer = true + buf << dump_attributes + end + unless @methoddef.empty? + buf << dump_emptyline if spacer + spacer = true + buf << dump_methods + end + buf << dump_class_def_end + buf << dump_package_def_end(package) unless package.empty? + buf.gsub(/^\s+$/, '') + end + +private + + def dump_class_def + name = @name.to_s.split(/::/) + if @baseclass + format("class #{name.last} < #{@baseclass}") + else + format("class #{name.last}") + end + end + + def dump_class_def_end + str = format("end") + end + + def dump_classvar + dump_static( + @classvar.collect { |var, value| + %Q(@@#{var.sub(/^@@/, "")} = #{dump_value(value)}) + }.join("\n") + ) + end + + def dump_attributes + str = "" + @attrdef.each do |attrname, writable, varname| + varname ||= attrname + if attrname == varname + str << format(dump_accessor(attrname, writable), 2) + end + end + @attrdef.each do |attrname, writable, varname| + varname ||= attrname + if attrname != varname + str << "\n" unless str.empty? + str << format(dump_attribute(attrname, writable, varname), 2) + end + end + str + end + + def dump_accessor(attrname, writable) + if writable + "attr_accessor :#{attrname}" + else + "attr_reader :#{attrname}" + end + end + + def dump_attribute(attrname, writable, varname) + str = nil + mr = MethodDef.new(attrname) + mr.definition = "@#{varname}" + str = mr.dump + if writable + mw = MethodDef.new(attrname + "=", 'value') + mw.definition = "@#{varname} = value" + str << "\n" + mw.dump + end + str + end +end + + +end +end + + +if __FILE__ == $0 + require 'xsd/codegen/classdef' + include XSD::CodeGen + c = ClassDef.new("Foo::Bar::HobbitName", String) + c.def_require("foo/bar") + c.comment = <<-EOD + foo + bar + baz + EOD + c.def_const("FOO", 1) + c.def_classvar("@@foo", "var".dump) + c.def_classvar("baz", "1".dump) + c.def_attr("Foo", true, "foo") + c.def_attr("bar") + c.def_attr("baz", true) + c.def_attr("Foo2", true, "foo2") + c.def_attr("foo3", false, "foo3") + c.def_method("foo") do + <<-EOD + foo.bar = 1 +\tbaz.each do |ele| +\t ele + end + EOD + end + c.def_method("baz", "qux") do + <<-EOD + [1, 2, 3].each do |i| + p i + end + EOD + end + + m = MethodDef.new("qux", "quxx", "quxxx") do + <<-EOD + p quxx + quxxx + EOD + end + m.comment = "hello world\n123" + c.add_method(m) + c.def_code <<-EOD + Foo.new + Bar.z + EOD + c.def_code <<-EOD + Foo.new + Bar.z + EOD + c.def_privatemethod("foo", "baz", "*arg", "&block") + + puts c.dump +end diff --git a/lib/xsd/codegen/commentdef.rb b/lib/xsd/codegen/commentdef.rb new file mode 100644 index 0000000..13b074b --- /dev/null +++ b/lib/xsd/codegen/commentdef.rb @@ -0,0 +1,34 @@ +# XSD4R - Generating comment definition code +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/codegen/gensupport' + + +module XSD +module CodeGen + + +module CommentDef + include GenSupport + + attr_accessor :comment + +private + + def dump_comment + if /\A#/ =~ @comment + format(@comment) + else + format(@comment).gsub(/^/, '# ') + end + end +end + + +end +end diff --git a/lib/xsd/codegen/gensupport.rb b/lib/xsd/codegen/gensupport.rb new file mode 100644 index 0000000..332236a --- /dev/null +++ b/lib/xsd/codegen/gensupport.rb @@ -0,0 +1,271 @@ +# XSD4R - Code generation support +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module XSD +module CodeGen + +# from the file 'keywords' in 1.9. +KEYWORDS = {} +%w( +__LINE__ +__FILE__ +BEGIN +END +alias +and +begin +break +case +class +def +defined? +do +else +elsif +end +ensure +false +for +if +in +module +next +nil +not +or +redo +rescue +retry +return +self +super +then +true +undef +unless +until +when +while +yield +).each { |k| KEYWORDS[k] = nil } + +# from Module.constants from 1.8 & 1.9 +CONSTANTS = {} +%w( +ARGF +ARGV +ArgumentError +Array +BasicObject +Bignum +Binding +Class +Comparable +Continuation +Data +Dir +ENV +EOFError +Enumerable +Errno +Exception +FALSE +FalseClass +File +FileTest +Fixnum +Float +FloatDomainError +GC +Hash +IO +IOError +IndexError +Integer +Interrupt +Kernel +KeyError +LoadError +LocalJumpError +Marshal +MatchData +MatchingData +Math +Method +Module +Mutex +NIL +NameError +NilClass +NoMemoryError +NoMethodError +NotImplementedError +Numeric +Object +ObjectSpace +PLATFORM +Precision +Proc +Process +RELEASE_DATE +RUBY_PATCHLEVEL +RUBY_PLATFORM +RUBY_RELEASE_DATE +RUBY_VERSION +Range +RangeError +Regexp +RegexpError +RuntimeError +STDERR +STDIN +STDOUT +ScriptError +SecurityError +Signal +SignalException +StandardError +String +Struct +Symbol +SyntaxError +SystemCallError +SystemExit +SystemStackError +TOPLEVEL_BINDING +TRUE +Thread +ThreadError +ThreadGroup +Time +TrueClass +TypeError +UnboundMethod +VERSION +VM +ZeroDivisionError +).each { |c| CONSTANTS[c] = nil } + + +module GenSupport + def capitalize(target) + target.sub(/^([a-z])/) { $1.upcase } + end + module_function :capitalize + + def uncapitalize(target) + target.sub(/^([A-Z])/) { $1.downcase } + end + module_function :uncapitalize + + def safeconstname(name) + safename = name.scan(/[a-zA-Z0-9_]+/).collect { |ele| + GenSupport.capitalize(ele) + }.join + if /\A[A-Z]/ !~ safename or keyword?(safename) or constant?(safename) + "C_#{safename}" + else + safename + end + end + module_function :safeconstname + + def safeconstname?(name) + /\A[A-Z][a-zA-Z0-9_]*\z/ =~ name and !keyword?(name) + end + module_function :safeconstname? + + def safemethodname(name) + postfix = name[/[=?!]$/] + safename = name.scan(/[a-zA-Z0-9_]+/).join('_') + safename = uncapitalize(safename) + safename += postfix if postfix + if /\A[a-z]/ !~ safename or keyword?(safename) + "m_#{safename}" + else + safename + end + end + module_function :safemethodname + + def safemethodname?(name) + /\A[a-zA-Z_][a-zA-Z0-9_]*[=!?]?\z/ =~ name and !keyword?(name) + end + module_function :safemethodname? + + def safevarname(name) + safename = uncapitalize(name.scan(/[a-zA-Z0-9_]+/).join('_')) + if /\A[a-z]/ !~ safename or keyword?(safename) + "v_#{safename}" + else + safename + end + end + module_function :safevarname + + def safevarname?(name) + /\A[a-z_][a-zA-Z0-9_]*\z/ =~ name and !keyword?(name) + end + module_function :safevarname? + + def keyword?(word) + KEYWORDS.key?(word) + end + module_function :keyword? + + def constant?(word) + CONSTANTS.key?(word) + end + module_function :constant? + + def format(str, indent = nil) + str = trim_eol(str) + str = trim_indent(str) + if indent + str.gsub(/^/, " " * indent) + else + str + end + end + +private + + def trim_eol(str) + str.gsub(/\r?\n\z/, "\n") + end + + def trim_indent(str) + indent = nil + str = str.split.collect { |line| untab(line) }.join + str.each_line do |line| + head = line.index(/\S/) + if !head.nil? and (indent.nil? or head < indent) + indent = head + end + end + return str unless indent + str.split.collect { |line| + line.sub(/^ {0,#{indent}}/, "") + }.join + end + + def untab(line, ts = 8) + while pos = line.index(/\t/) + line = line.sub(/\t/, " " * (ts - (pos % ts))) + end + line + end + + def dump_emptyline + "\n" + end +end + + +end +end diff --git a/lib/xsd/codegen/methoddef.rb b/lib/xsd/codegen/methoddef.rb new file mode 100644 index 0000000..72d24a6 --- /dev/null +++ b/lib/xsd/codegen/methoddef.rb @@ -0,0 +1,70 @@ +# XSD4R - Generating method definition code +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/codegen/gensupport' +require 'xsd/codegen/commentdef' + + +module XSD +module CodeGen + + +class MethodDef + include GenSupport + include CommentDef + + attr_accessor :definition + + def initialize(name, *params) + klass, mname = name.split('.', 2) + if mname.nil? + mname, klass = klass, mname + end + unless safemethodname?(mname) + raise ArgumentError.new("name '#{name}' seems to be unsafe") + end + if klass and klass != 'self' and !safeconstname(klass) + raise ArgumentError.new("name '#{name}' seems to be unsafe") + end + @name = name + @params = params + @comment = nil + @definition = yield if block_given? + end + + def dump + buf = "" + buf << dump_comment if @comment + buf << dump_method_def + buf << dump_definition if @definition and !@definition.empty? + buf << dump_method_def_end + buf + end + +private + + def dump_method_def + if @params.empty? + format("def #{@name}") + else + format("def #{@name}(#{@params.join(", ")})") + end + end + + def dump_method_def_end + format("end") + end + + def dump_definition + format(@definition, 2) + end +end + + +end +end diff --git a/lib/xsd/codegen/moduledef.rb b/lib/xsd/codegen/moduledef.rb new file mode 100644 index 0000000..a135a2b --- /dev/null +++ b/lib/xsd/codegen/moduledef.rb @@ -0,0 +1,208 @@ +# XSD4R - Generating module definition code +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/codegen/gensupport' +require 'xsd/codegen/methoddef' +require 'xsd/codegen/commentdef' + + +module XSD +module CodeGen + + +class ModuleDef + include GenSupport + include CommentDef + + attr_reader :name + attr_reader :innermodule + + def initialize(name) + @name = name + @comment = nil + @const = [] + @code = [] + @requirepath = [] + @methoddef = [] + @innermodule = [] + end + + def def_require(path) + @requirepath << path + end + + def def_const(const, value) + unless safeconstname?(const) + raise ArgumentError.new("#{const} seems to be unsafe") + end + @const << [const, value] + end + + def def_code(code) + @code << code + end + + def def_method(name, *params) + add_method(MethodDef.new(name, *params) { yield if block_given? }, :public) + end + alias def_publicmethod def_method + + def def_protectedmethod(name, *params) + add_method(MethodDef.new(name, *params) { yield if block_given? }, + :protected) + end + + def def_privatemethod(name, *params) + add_method(MethodDef.new(name, *params) { yield if block_given? }, :private) + end + + def add_method(m, visibility = :public) + @methoddef << [visibility, m] + end + + def dump + buf = "" + unless @requirepath.empty? + buf << dump_requirepath + end + buf << dump_emptyline unless buf.empty? + package = @name.split(/::/)[0..-2] + buf << dump_package_def(package) unless package.empty? + buf << dump_comment if @comment + buf << dump_module_def + spacer = false + unless @const.empty? + buf << dump_emptyline if spacer + spacer = true + buf << dump_const + end + unless @innermodule.empty? + buf << dump_emptyline # always add 1 empty line + spacer = true + buf << dump_innermodule + end + unless @code.empty? + buf << dump_emptyline if spacer + spacer = true + buf << dump_code + end + unless @methoddef.empty? + buf << dump_emptyline if spacer + spacer = true + buf << dump_methods + end + buf << dump_module_def_end + buf << dump_package_def_end(package) unless package.empty? + buf.gsub(/^\s+$/, '') + end + +private + + def dump_requirepath + format( + @requirepath.collect { |path| + %Q(require '#{path}') + }.join("\n") + ) + end + + def dump_const + dump_static( + @const.sort.collect { |var, value| + %Q(#{var} = #{dump_value(value)}) + }.join("\n") + ) + end + + def dump_innermodule + dump_static( + @innermodule.collect { |moduledef| + moduledef.dump + }.join("\n") + ) + end + + def dump_code + dump_static(@code.join("\n")) + end + + def dump_static(str) + format(str, 2) + end + + def dump_methods + methods = {} + @methoddef.each do |visibility, method| + (methods[visibility] ||= []) << method + end + str = "" + [:public, :protected, :private].each do |visibility| + if methods[visibility] + str << "\n" unless str.empty? + str << visibility.to_s << "\n\n" unless visibility == :public + str << methods[visibility].collect { |m| format(m.dump, 2) }.join("\n") + end + end + str + end + + def dump_value(value) + if value.respond_to?(:to_src) + value.to_src + else + value + end + end + + def dump_package_def(package) + format(package.collect { |ele| "module #{ele}" }.join("; ")) + "\n\n" + end + + def dump_package_def_end(package) + "\n\n" + format(package.collect { |ele| "end" }.join("; ")) + end + + def dump_module_def + name = @name.to_s.split(/::/) + format("module #{name.last}") + end + + def dump_module_def_end + format("end") + end +end + + +end +end + + +if __FILE__ == $0 + require 'xsd/codegen/moduledef' + include XSD::CodeGen + m = ModuleDef.new("Foo::Bar::HobbitName") + m.def_require("foo/bar") + m.def_require("baz") + m.comment = <<-EOD + foo + bar + baz + EOD + m.def_method("foo") do + <<-EOD + foo.bar = 1 + baz.each do |ele| + ele + 1 + end + EOD + end + m.def_method("baz", "qux") + #m.def_protectedmethod("aaa") + m.def_privatemethod("bbb") + puts m.dump +end diff --git a/lib/xsd/datatypes.rb b/lib/xsd/datatypes.rb new file mode 100644 index 0000000..0e9669c --- /dev/null +++ b/lib/xsd/datatypes.rb @@ -0,0 +1,1466 @@ +# XSD4R - XML Schema Datatype implementation. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/qname' +require 'xsd/charset' +require 'soap/nestedexception' +require 'uri' +require 'date' + +### +## XMLSchamaDatatypes general definitions. +# +module XSD + + +Namespace = 'http://www.w3.org/2001/XMLSchema' +InstanceNamespace = 'http://www.w3.org/2001/XMLSchema-instance' + +AttrType = 'type' +NilValue = 'true' + +AnyTypeLiteral = 'anyType' +AnySimpleTypeLiteral = 'anySimpleType' +NilLiteral = 'nil' +StringLiteral = 'string' +BooleanLiteral = 'boolean' +DecimalLiteral = 'decimal' +FloatLiteral = 'float' +DoubleLiteral = 'double' +DurationLiteral = 'duration' +DateTimeLiteral = 'dateTime' +TimeLiteral = 'time' +DateLiteral = 'date' +GYearMonthLiteral = 'gYearMonth' +GYearLiteral = 'gYear' +GMonthDayLiteral = 'gMonthDay' +GDayLiteral = 'gDay' +GMonthLiteral = 'gMonth' +HexBinaryLiteral = 'hexBinary' +Base64BinaryLiteral = 'base64Binary' +AnyURILiteral = 'anyURI' +QNameLiteral = 'QName' + +NormalizedStringLiteral = 'normalizedString' +TokenLiteral = 'token' +LanguageLiteral = 'language' +NMTOKENLiteral = 'NMTOKEN' +NMTOKENSLiteral = 'NMTOKENS' +NameLiteral = 'Name' +NCNameLiteral = 'NCName' +IDLiteral = 'ID' +IDREFLiteral = 'IDREF' +IDREFSLiteral = 'IDREFS' +ENTITYLiteral = 'ENTITY' +ENTITIESLiteral = 'ENTITIES' +IntegerLiteral = 'integer' +NonPositiveIntegerLiteral = 'nonPositiveInteger' +NegativeIntegerLiteral = 'negativeInteger' +LongLiteral = 'long' +IntLiteral = 'int' +ShortLiteral = 'short' +ByteLiteral = 'byte' +NonNegativeIntegerLiteral = 'nonNegativeInteger' +UnsignedLongLiteral = 'unsignedLong' +UnsignedIntLiteral = 'unsignedInt' +UnsignedShortLiteral = 'unsignedShort' +UnsignedByteLiteral = 'unsignedByte' +PositiveIntegerLiteral = 'positiveInteger' + +AttrTypeName = QName.new(InstanceNamespace, AttrType) +AttrNilName = QName.new(InstanceNamespace, NilLiteral) + +AnyTypeName = QName.new(Namespace, AnyTypeLiteral) +AnySimpleTypeName = QName.new(Namespace, AnySimpleTypeLiteral) + +class Error < StandardError; include ::SOAP::NestedException; end +class ValueSpaceError < Error; end + + +### +## The base class of all datatypes with Namespace. +# +class NSDBase + @@types = [] + + attr_accessor :type + + def self.inherited(klass) + @@types << klass + end + + def self.types + @@types + end + + def initialize + end + + def init(type) + @type = type + end +end + + +### +## The base class of XSD datatypes. +# +class XSDAnySimpleType < NSDBase + include XSD + Type = QName.new(Namespace, AnySimpleTypeLiteral) + + # @data represents canonical space (ex. Integer: 123). + attr_reader :data + # @is_nil represents this data is nil or not. + attr_accessor :is_nil + + def initialize(value = nil) + init(Type, value) + end + + # true or raise + def check_lexical_format(value) + screen_data(value) + true + end + + # set accepts a string which follows lexical space (ex. String: "+123"), or + # an object which follows canonical space (ex. Integer: 123). + def set(value) + if value.nil? + @is_nil = true + @data = nil + _set(nil) + else + @is_nil = false + _set(screen_data(value)) + end + end + + # to_s creates a string which follows lexical space (ex. String: "123"). + def to_s() + if @is_nil + "" + else + _to_s + end + end + +private + + def init(type, value) + super(type) + set(value) + end + + # raises ValueSpaceError if check failed + def screen_data(value) + value + end + + def _set(value) + @data = value + end + + def _to_s + @data.to_s + end +end + +class XSDNil < XSDAnySimpleType + Type = QName.new(Namespace, NilLiteral) + Value = 'true' + + def initialize(value = nil) + init(Type, value) + end +end + + +### +## Primitive datatypes. +# +class XSDString < XSDAnySimpleType + Type = QName.new(Namespace, StringLiteral) + + def initialize(value = nil) + init(Type, value) + end + + @@strict_ces_validation = false + + def self.strict_ces_validation=(strict_ces_validation) + @@strict_ces_validation = strict_ces_validation + end + + def self.strict_ces_validation + @@strict_ces_validation + end + +private + + def screen_data(value) + if ::XSD::XSDString.strict_ces_validation + externalces = XSD::Charset.encoding + unless XSD::Charset.is_ces(value, externalces) + raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") + end + end + value + end +end + +class XSDBoolean < XSDAnySimpleType + Type = QName.new(Namespace, BooleanLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + if value.is_a?(String) + str = value.strip + if str == 'true' || str == '1' + true + elsif str == 'false' || str == '0' + false + else + raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.") + end + else + value ? true : false + end + end +end + +class XSDDecimal < XSDAnySimpleType + Type = QName.new(Namespace, DecimalLiteral) + + def initialize(value = nil) + init(Type, value) + end + + def nonzero? + (@number != '0') + end + +private + + def screen_data(d) + if d.is_a?(String) + # Integer("00012") => 10 in Ruby. + d.sub!(/^([+\-]?)0*(?=\d)/, "\\1") + end + screen_data_str(d) + end + + def screen_data_str(str) + /^([+\-]?)(\d*)(?:\.(\d*)?)?$/ =~ str.to_s.strip + unless Regexp.last_match + raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.") + end + sign = $1 || '+' + int_part = $2 + frac_part = $3 + int_part = '0' if int_part.empty? + frac_part = frac_part ? frac_part.sub(/0+$/, '') : '' + point = - frac_part.size + number = int_part + frac_part + # normalize + if sign == '+' + sign = '' + elsif sign == '-' + if number == '0' + sign = '' + end + end + [sign, point, number] + end + + def _set(data) + if data.nil? + @sign = @point = @number = @data = nil + return + end + @sign, @point, @number = data + @data = _to_s + @data.freeze + end + + # 0.0 -> 0; right? + def _to_s + str = @number.dup + if @point.nonzero? + str[@number.size + @point, 0] = '.' + end + @sign + str + end +end + +module FloatConstants + NaN = 0.0/0.0 + POSITIVE_INF = +1.0/0.0 + NEGATIVE_INF = -1.0/0.0 + POSITIVE_ZERO = +1.0/POSITIVE_INF + NEGATIVE_ZERO = -1.0/POSITIVE_INF + MIN_POSITIVE_SINGLE = 2.0 ** -149 +end + +class XSDFloat < XSDAnySimpleType + include FloatConstants + Type = QName.new(Namespace, FloatLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + # "NaN".to_f => 0 in some environment. libc? + if value.is_a?(Float) + return narrow32bit(value) + end + str = value.to_s.strip + if str == 'NaN' + NaN + elsif str == 'INF' + POSITIVE_INF + elsif str == '-INF' + NEGATIVE_INF + else + if /^[+\-\.\deE]+$/ !~ str + raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.") + end + # Float("-1.4E") might fail on some system. + str << '0' if /e$/i =~ str + begin + return narrow32bit(Float(str)) + rescue ArgumentError + raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.", $!) + end + end + end + + def _to_s + if @data.nan? + 'NaN' + elsif @data.infinite? == 1 + 'INF' + elsif @data.infinite? == -1 + '-INF' + else + sign = XSDFloat.positive?(@data) ? '+' : '-' + sign + sprintf("%.10g", @data.abs).sub(/[eE]([+-])?0+/) { 'e' + $1 } + end + end + + # Convert to single-precision 32-bit floating point value. + def narrow32bit(f) + if f.nan? || f.infinite? + f + elsif f.abs < MIN_POSITIVE_SINGLE + XSDFloat.positive?(f) ? POSITIVE_ZERO : NEGATIVE_ZERO + else + f + end + end + + def self.positive?(value) + (1 / value) > 0.0 + end +end + +# Ruby's Float is double-precision 64-bit floating point value. +class XSDDouble < XSDAnySimpleType + include FloatConstants + Type = QName.new(Namespace, DoubleLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + # "NaN".to_f => 0 in some environment. libc? + if value.is_a?(Float) + return value + end + str = value.to_s.strip + if str == 'NaN' + NaN + elsif str == 'INF' + POSITIVE_INF + elsif str == '-INF' + NEGATIVE_INF + else + begin + return Float(str) + rescue ArgumentError + # '1.4e' cannot be parsed on some architecture. + if /e\z/i =~ str + begin + return Float(str + '0') + rescue ArgumentError + raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.", $!) + end + else + raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.", $!) + end + end + end + end + + def _to_s + if @data.nan? + 'NaN' + elsif @data.infinite? == 1 + 'INF' + elsif @data.infinite? == -1 + '-INF' + else + sign = (1 / @data > 0.0) ? '+' : '-' + sign + sprintf("%.16g", @data.abs).sub(/[eE]([+-])?0+/) { 'e' + $1 } + end + end +end + +class XSDDuration < XSDAnySimpleType + Type = QName.new(Namespace, DurationLiteral) + + attr_accessor :sign + attr_accessor :year + attr_accessor :month + attr_accessor :day + attr_accessor :hour + attr_accessor :min + attr_accessor :sec + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + /^([+\-]?)P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/ =~ value.to_s.strip + unless Regexp.last_match + raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") + end + if $5 and !$6 and !$7 and !$8 + # allows durations lower than a day such as 'PT5S'. + raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") + end + sign = $1 + year = $2.to_i + month = $3.to_i + day = $4.to_i + hour = $6.to_i + min = $7.to_i + sec = $8 ? XSDDecimal.new($8) : 0 + [sign, year, month, day, hour, min, sec] + end + + def _set(data) + if data.nil? + @sign = @year = @month = @day = @hour = @min = @sec = @data = nil + return + end + @sign, @year, @month, @day, @hour, @min, @sec = data + @data = _to_s + @data.freeze + end + + def _to_s + str = '' + str << @sign if @sign + str << 'P' + l = '' + l << "#{ @year }Y" if @year.nonzero? + l << "#{ @month }M" if @month.nonzero? + l << "#{ @day }D" if @day.nonzero? + r = '' + r << "#{ @hour }H" if @hour.nonzero? + r << "#{ @min }M" if @min.nonzero? + r << "#{ @sec }S" if @sec.nonzero? + str << l + unless r.empty? + str << "T" << r + end + if l.empty? and r.empty? + str << "0D" + end + str + end +end + + +require 'rational' +require 'date' + +module XSDDateTimeImpl + DayInSec = 86400 # 24 * 60 * 60 + DayInMicro = 86400_000_000 + + def to_obj(klass) + if klass == Time + to_time + elsif klass == Date + to_date + elsif klass == DateTime + to_datetime + else + nil + end + end + + def to_time + begin + if @data.offset * DayInSec == Time.now.utc_offset + d = @data + usec = (d.sec_fraction * DayInMicro).round + Time.local(d.year, d.month, d.mday, d.hour, d.min, d.sec, usec) + else + d = @data.newof + usec = (d.sec_fraction * DayInMicro).round + Time.gm(d.year, d.month, d.mday, d.hour, d.min, d.sec, usec) + end + rescue ArgumentError + nil + end + end + + def to_date + Date.new0(@data.class.jd_to_ajd(@data.jd, 0, 0), 0, @data.start) + end + + def to_datetime + data + end + + def tz2of(str) + /^(?:Z|(?:([+\-])(\d\d):(\d\d))?)$/ =~ str + sign = $1 + hour = $2.to_i + min = $3.to_i + + of = case sign + when '+' + of = +(hour.to_r * 60 + min) / 1440 # 24 * 60 + when '-' + of = -(hour.to_r * 60 + min) / 1440 # 24 * 60 + else + 0 + end + of + end + + def of2tz(offset) + diffmin = offset * 24 * 60 + if diffmin.zero? + 'Z' + else + ((diffmin < 0) ? '-' : '+') << format('%02d:%02d', + (diffmin.abs / 60.0).to_i, (diffmin.abs % 60.0).to_i) + end + end + + def screen_data(t) + # convert t to a DateTime as an internal representation. + if t.respond_to?(:to_datetime) # 1.9 or later + t.to_datetime + elsif t.is_a?(DateTime) + t + elsif t.is_a?(Date) + t = screen_data_str(t) + t <<= 12 if t.year < 0 + t + elsif t.is_a?(Time) + jd = DateTime.civil_to_jd(t.year, t.mon, t.mday, DateTime::ITALY) + fr = DateTime.time_to_day_fraction(t.hour, t.min, [t.sec, 59].min) + + t.usec.to_r / DayInMicro + of = t.utc_offset.to_r / DayInSec + DateTime.new0(DateTime.jd_to_ajd(jd, fr, of), of, DateTime::ITALY) + else + screen_data_str(t) + end + end + + def add_tz(s) + s + of2tz(@data.offset) + end +end + +class XSDDateTime < XSDAnySimpleType + include XSDDateTimeImpl + Type = QName.new(Namespace, DateTimeLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data_str(t) + /^([+\-]?\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d(?:\.(\d*))?)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ t.to_s.strip + unless Regexp.last_match + raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") + end + if $1 == '0000' + raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") + end + year = $1.to_i + if year < 0 + year += 1 + end + mon = $2.to_i + mday = $3.to_i + hour = $4.to_i + min = $5.to_i + sec = $6.to_i + secfrac = $7 + zonestr = $8 + data = DateTime.civil(year, mon, mday, hour, min, sec, tz2of(zonestr)) + if secfrac + diffday = secfrac.to_i.to_r / (10 ** secfrac.size) / DayInSec + data += diffday + # FYI: new0 and jd_to_rjd are not necessary to use if you don't have + # exceptional reason. + end + [data, secfrac] + end + + def _set(data) + if data.nil? + @data = @secfrac = nil + return + end + @data, @secfrac = data + end + + def _to_s + year = (@data.year > 0) ? @data.year : @data.year - 1 + s = format('%.4d-%02d-%02dT%02d:%02d:%02d', + year, @data.mon, @data.mday, @data.hour, @data.min, @data.sec) + if @data.sec_fraction.nonzero? + if @secfrac + s << ".#{ @secfrac }" + else + s << sprintf("%.16f", + (@data.sec_fraction * DayInSec).to_f).sub(/^0/, '').sub(/0*$/, '') + end + end + add_tz(s) + end +end + +class XSDTime < XSDAnySimpleType + include XSDDateTimeImpl + Type = QName.new(Namespace, TimeLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data_str(t) + /^(\d\d):(\d\d):(\d\d(?:\.(\d*))?)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip + unless Regexp.last_match + raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") + end + hour = $1.to_i + min = $2.to_i + sec = $3.to_i + secfrac = $4 + zonestr = $5 + data = DateTime.civil(1, 1, 1, hour, min, sec, tz2of(zonestr)) + if secfrac + diffday = secfrac.to_i.to_r / (10 ** secfrac.size) / DayInSec + data += diffday + end + [data, secfrac] + end + + def _set(data) + if data.nil? + @data = @secfrac = nil + return + end + @data, @secfrac = data + end + + def _to_s + s = format('%02d:%02d:%02d', @data.hour, @data.min, @data.sec) + if @data.sec_fraction.nonzero? + if @secfrac + s << ".#{ @secfrac }" + else + s << sprintf("%.16f", + (@data.sec_fraction * DayInSec).to_f).sub(/^0/, '').sub(/0*$/, '') + end + end + add_tz(s) + end +end + +class XSDDate < XSDAnySimpleType + include XSDDateTimeImpl + Type = QName.new(Namespace, DateLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data_str(t) + /^([+\-]?\d{4,})-(\d\d)-(\d\d)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip + unless Regexp.last_match + raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") + end + year = $1.to_i + if year < 0 + year += 1 + end + mon = $2.to_i + mday = $3.to_i + zonestr = $4 + DateTime.civil(year, mon, mday, 0, 0, 0, tz2of(zonestr)) + end + + def _to_s + year = (@data.year > 0) ? @data.year : @data.year - 1 + s = format('%.4d-%02d-%02d', year, @data.mon, @data.mday) + add_tz(s) + end +end + +class XSDGYearMonth < XSDAnySimpleType + include XSDDateTimeImpl + Type = QName.new(Namespace, GYearMonthLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data_str(t) + /^([+\-]?\d{4,})-(\d\d)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip + unless Regexp.last_match + raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") + end + year = $1.to_i + if year < 0 + year += 1 + end + mon = $2.to_i + zonestr = $3 + DateTime.civil(year, mon, 1, 0, 0, 0, tz2of(zonestr)) + end + + def _to_s + year = (@data.year > 0) ? @data.year : @data.year - 1 + s = format('%.4d-%02d', year, @data.mon) + add_tz(s) + end +end + +class XSDGYear < XSDAnySimpleType + include XSDDateTimeImpl + Type = QName.new(Namespace, GYearLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data_str(t) + /^([+\-]?\d{4,})(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip + unless Regexp.last_match + raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") + end + year = $1.to_i + if year < 0 + year += 1 + end + zonestr = $2 + DateTime.civil(year, 1, 1, 0, 0, 0, tz2of(zonestr)) + end + + def _to_s + year = (@data.year > 0) ? @data.year : @data.year - 1 + s = format('%.4d', year) + add_tz(s) + end +end + +class XSDGMonthDay < XSDAnySimpleType + include XSDDateTimeImpl + Type = QName.new(Namespace, GMonthDayLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data_str(t) + /^--(\d\d)-(\d\d)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ t.to_s.strip + unless Regexp.last_match + raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") + end + mon = $1.to_i + mday = $2.to_i + zonestr = $3 + DateTime.civil(1, mon, mday, 0, 0, 0, tz2of(zonestr)) + end + + def _to_s + s = format('--%02d-%02d', @data.mon, @data.mday) + add_tz(s) + end +end + +class XSDGDay < XSDAnySimpleType + include XSDDateTimeImpl + Type = QName.new(Namespace, GDayLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data_str(t) + /^---(\d\d)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ t.to_s.strip + unless Regexp.last_match + raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") + end + mday = $1.to_i + zonestr = $2 + DateTime.civil(1, 1, mday, 0, 0, 0, tz2of(zonestr)) + end + + def _to_s + s = format('---%02d', @data.mday) + add_tz(s) + end +end + +class XSDGMonth < XSDAnySimpleType + include XSDDateTimeImpl + Type = QName.new(Namespace, GMonthLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data_str(t) + /^--(\d\d)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ t.to_s.strip + unless Regexp.last_match + raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") + end + mon = $1.to_i + zonestr = $2 + DateTime.civil(1, mon, 1, 0, 0, 0, tz2of(zonestr)) + end + + def _to_s + s = format('--%02d', @data.mon) + add_tz(s) + end +end + +class XSDHexBinary < XSDAnySimpleType + Type = QName.new(Namespace, HexBinaryLiteral) + + # String in Ruby could be a binary. + def initialize(value = nil) + init(Type, value) + end + + def set_encoded(value) + if /^[0-9a-fA-F]*$/ !~ value + raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") + end + @data = String.new(value).strip + @is_nil = false + end + + def string + [@data].pack("H*") + end + +private + + def screen_data(value) + value.unpack("H*")[0].tr('a-f', 'A-F') + end +end + +class XSDBase64Binary < XSDAnySimpleType + Type = QName.new(Namespace, Base64BinaryLiteral) + + # String in Ruby could be a binary. + def initialize(value = nil) + init(Type, value) + end + + def set_encoded(value) + if /^[A-Za-z0-9+\/=]*$/ !~ value + raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") + end + @data = String.new(value).strip + @is_nil = false + end + + def string + @data.unpack("m")[0] + end + +private + + def screen_data(value) + [value].pack("m").strip + end +end + +class XSDAnyURI < XSDAnySimpleType + Type = QName.new(Namespace, AnyURILiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + begin + URI.parse(value.to_s.strip) + rescue URI::InvalidURIError + raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.", $!) + end + end +end + +class XSDQName < XSDAnySimpleType + Type = QName.new(Namespace, QNameLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + /^(?:([^:]+):)?([^:]+)$/ =~ value.to_s.strip + unless Regexp.last_match + raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") + end + prefix = $1 + localpart = $2 + [prefix, localpart] + end + + def _set(data) + if data.nil? + @prefix = @localpart = @data = nil + return + end + @prefix, @localpart = data + @data = _to_s + @data.freeze + end + + def _to_s + if @prefix + "#{ @prefix }:#{ @localpart }" + else + "#{ @localpart }" + end + end +end + + +### +## Derived types +# +class XSDNormalizedString < XSDString + Type = QName.new(Namespace, NormalizedStringLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + super + if /[\t\r\n]/ =~ value + raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") + end + value + end +end + +class XSDToken < XSDNormalizedString + Type = QName.new(Namespace, TokenLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + super + if /\A / =~ value or / \Z/ =~ value or value.index(' ') + raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") + end + value + end +end + +class XSDLanguage < XSDToken + Type = QName.new(Namespace, LanguageLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + super + # RFC 3066 syntax check + if /\A[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})?\z/ !~ value + raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") + end + value + end +end + +class XSDNMTOKEN < XSDToken + Type = QName.new(Namespace, NMTOKENLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + super + # TODO: check lexical space and convert to a value + value + end +end + +class XSDNMTOKENS < XSDNMTOKEN + Type = QName.new(Namespace, NMTOKENSLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + # derived by list + # TODO: check lexical space and convert to a value + value + end +end + +class XSDName < XSDToken + Type = QName.new(Namespace, NameLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + super + # TODO: check lexical space and convert to a value + value + end +end + +class XSDNCName < XSDName + Type = QName.new(Namespace, NCNameLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + super + # TODO: check lexical space and convert to a value + value + end +end + +class XSDID < XSDNCName + Type = QName.new(Namespace, IDLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + super + # TODO: check lexical space and convert to a value + value + end +end + +class XSDIDREF < XSDNCName + Type = QName.new(Namespace, IDREFLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + super + # TODO: check lexical space and convert to a value + value + end +end + +class XSDIDREFS < XSDIDREF + Type = QName.new(Namespace, IDREFSLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + # derived by list + # TODO: check lexical space and convert to a value + value + end +end + +class XSDENTITY < XSDNCName + Type = QName.new(Namespace, ENTITYLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + super + # TODO: check lexical space and convert to a value + value + end +end + +class XSDENTITIES < XSDENTITY + Type = QName.new(Namespace, ENTITIESLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + # derived by list + # TODO: check lexical space and convert to a value + value + end +end + +class XSDInteger < XSDDecimal + Type = QName.new(Namespace, IntegerLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data_str(str) + begin + data = Integer(str) + rescue ArgumentError + raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.", $!) + end + unless validate(data) + raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.") + end + data + end + + def _set(value) + @data = value + end + + def _to_s() + @data.to_s + end + + def validate(v) + max = maxinclusive + min = mininclusive + (max.nil? or v <= max) and (min.nil? or v >= min) + end + + def maxinclusive + nil + end + + def mininclusive + nil + end + + PositiveMinInclusive = 1 + def positive(v) + PositiveMinInclusive <= v + end +end + +class XSDNonPositiveInteger < XSDInteger + Type = QName.new(Namespace, NonPositiveIntegerLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def maxinclusive + 0 + end + + def mininclusive + nil + end +end + +class XSDNegativeInteger < XSDNonPositiveInteger + Type = QName.new(Namespace, NegativeIntegerLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def maxinclusive + -1 + end + + def mininclusive + nil + end +end + +class XSDLong < XSDInteger + Type = QName.new(Namespace, LongLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def maxinclusive + +9223372036854775807 + end + + def mininclusive + -9223372036854775808 + end +end + +class XSDInt < XSDLong + Type = QName.new(Namespace, IntLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def maxinclusive + +2147483647 + end + + def mininclusive + -2147483648 + end +end + +class XSDShort < XSDInt + Type = QName.new(Namespace, ShortLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def maxinclusive + +32767 + end + + def mininclusive + -32768 + end +end + +class XSDByte < XSDShort + Type = QName.new(Namespace, ByteLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def maxinclusive + +127 + end + + def mininclusive + -128 + end +end + +class XSDNonNegativeInteger < XSDInteger + Type = QName.new(Namespace, NonNegativeIntegerLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def maxinclusive + nil + end + + def mininclusive + 0 + end +end + +class XSDUnsignedLong < XSDNonNegativeInteger + Type = QName.new(Namespace, UnsignedLongLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def maxinclusive + +18446744073709551615 + end + + def mininclusive + 0 + end +end + +class XSDUnsignedInt < XSDUnsignedLong + Type = QName.new(Namespace, UnsignedIntLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def maxinclusive + +4294967295 + end + + def mininclusive + 0 + end +end + +class XSDUnsignedShort < XSDUnsignedInt + Type = QName.new(Namespace, UnsignedShortLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def maxinclusive + +65535 + end + + def mininclusive + 0 + end +end + +class XSDUnsignedByte < XSDUnsignedShort + Type = QName.new(Namespace, UnsignedByteLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def maxinclusive + +255 + end + + def mininclusive + 0 + end +end + +class XSDPositiveInteger < XSDNonNegativeInteger + Type = QName.new(Namespace, PositiveIntegerLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def maxinclusive + nil + end + + def mininclusive + 1 + end +end + + +end diff --git a/lib/xsd/datatypes1999.rb b/lib/xsd/datatypes1999.rb new file mode 100644 index 0000000..5387ce0 --- /dev/null +++ b/lib/xsd/datatypes1999.rb @@ -0,0 +1,20 @@ +# XSD4R - XML Schema Datatype 1999 support +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/datatypes' + + +module XSD + Namespace.replace('http://www.w3.org/1999/XMLSchema') + InstanceNamespace.replace('http://www.w3.org/1999/XMLSchema-instance') + AnyTypeLiteral.replace('ur-type') + AnySimpleTypeLiteral.replace('ur-type') + NilLiteral.replace('null') + NilValue.replace('1') + DateTimeLiteral.replace('timeInstant') +end diff --git a/lib/xsd/iconvcharset.rb b/lib/xsd/iconvcharset.rb new file mode 100644 index 0000000..57733a8 --- /dev/null +++ b/lib/xsd/iconvcharset.rb @@ -0,0 +1,33 @@ +# XSD4R - Charset handling with iconv. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'iconv' + + +module XSD + + +class IconvCharset + def self.safe_iconv(to, from, str) + iconv = Iconv.new(to, from) + out = "" + begin + out << iconv.iconv(str) + rescue Iconv::IllegalSequence => e + out << e.success + ch, str = e.failed.split(//, 2) + out << '?' + warn("Failed to convert #{ch}") + retry + end + return out + end +end + + +end diff --git a/lib/xsd/mapping.rb b/lib/xsd/mapping.rb new file mode 100644 index 0000000..4602ee5 --- /dev/null +++ b/lib/xsd/mapping.rb @@ -0,0 +1,68 @@ +# XSD4R - XML Mapping for Ruby +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require "soap/parser" +require 'soap/encodingstyle/literalHandler' +require "soap/generator" +require "soap/mapping" +require "soap/mapping/wsdlliteralregistry" + + +module XSD + + +module Mapping + MappingRegistry = SOAP::Mapping::LiteralRegistry.new + + def self.obj2xml(obj, elename = nil, io = nil) + Mapper.new(MappingRegistry).obj2xml(obj, elename, io) + end + + def self.xml2obj(stream, klass = nil) + Mapper.new(MappingRegistry).xml2obj(stream, klass) + end + + class Mapper + MAPPING_OPT = { + :default_encodingstyle => SOAP::LiteralNamespace, + :generate_explicit_type => false, + :root_type_hint => true + }.freeze + + def initialize(registry) + @registry = registry + end + + def obj2xml(obj, elename = nil, io = nil) + opt = MAPPING_OPT.dup + unless elename + if definition = @registry.elename_schema_definition_from_class(obj.class) + elename = definition.elename + opt[:root_type_hint] = false + end + end + elename = SOAP::Mapping.to_qname(elename) if elename + soap = SOAP::Mapping.obj2soap(obj, @registry, elename, opt) + if soap.elename.nil? or soap.elename == XSD::QName::EMPTY + soap.elename = + XSD::QName.new(nil, SOAP::Mapping.name2elename(obj.class.to_s)) + end + generator = SOAP::Generator.new(opt) + generator.generate(soap, io) + end + + def xml2obj(stream, klass = nil) + parser = SOAP::Parser.new(MAPPING_OPT) + soap = parser.parse(stream) + SOAP::Mapping.soap2obj(soap, @registry, klass) + end + end +end + + +end diff --git a/lib/xsd/namedelements.rb b/lib/xsd/namedelements.rb new file mode 100644 index 0000000..ec60424 --- /dev/null +++ b/lib/xsd/namedelements.rb @@ -0,0 +1,132 @@ +# XSD4R - WSDL named element collection. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module XSD + + +class NamedElements + include Enumerable + + def initialize + @elements = [] + @cache = {} + end + + def dup + o = NamedElements.new + o.elements = @elements.dup + o + end + + def freeze + super + @elements.freeze + self + end + + def empty? + size == 0 + end + + def size + @elements.size + end + + def [](idx) + if idx.is_a?(Numeric) + @elements[idx] + else + @cache[idx] ||= @elements.find { |item| item.name == idx } + end + end + + def find_name(name) + @elements.find { |item| item.name.name == name } + end + + def keys + collect { |element| element.name } + end + + def each + @elements.each do |element| + yield(element) + end + end + + def <<(rhs) + @elements << rhs + self + end + + def delete(rhs) + rv = @elements.delete(rhs) + @cache.clear + rv + end + + def +(rhs) + o = NamedElements.new + o.elements = @elements + rhs.elements + @cache.clear + o + end + + def concat(rhs) + @elements.concat(rhs.elements) + @cache.clear + self + end + + def uniq + o = NamedElements.new + o.elements = uniq_elements + o + end + + def uniq! + @elements.replace(uniq_elements) + @cache.clear + end + + def find_all + o = NamedElements.new + each do |ele| + o << ele if yield(ele) + end + o + end + + Empty = NamedElements.new.freeze + +protected + + def elements=(rhs) + @elements = rhs + end + + def elements + @elements + end + +private + + def uniq_elements + dict = {} + elements = [] + @elements.each do |ele| + unless dict.key?(ele.name) + dict[ele.name] = ele + elements << ele + end + end + elements + end +end + +end diff --git a/lib/xsd/ns.rb b/lib/xsd/ns.rb new file mode 100644 index 0000000..9c934d6 --- /dev/null +++ b/lib/xsd/ns.rb @@ -0,0 +1,182 @@ +# XSD4R - XML Schema Namespace library +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/datatypes' + + +module XSD + + +class NS + Namespace = 'http://www.w3.org/XML/1998/namespace' + + KNOWN_TAG = { + XSD::Namespace => 'xsd', + XSD::InstanceNamespace => 'xsi', + } + + class Assigner + attr_reader :known_tag + + def initialize(known_tag) + @known_tag = known_tag.dup + @count = 0 + end + + def assign(ns) + if @known_tag.key?(ns) + return @known_tag[ns] + end + @count += 1 + "n#{@count}" + end + end + + attr_reader :default_namespace + + class FormatError < Error; end + +public + + def initialize(tag2ns = nil) + @tag2ns = tag2ns || ns_default + @ns2tag = @tag2ns.invert + @assigner = nil + @default_namespace = nil + end + + def known_tag + @assigner ||= Assigner.new(default_known_tag) + @assigner.known_tag + end + + def assign(ns, tag = nil) + if tag == '' + if ns.empty? + @default_namespace = nil + else + @default_namespace = ns + end + tag + else + @assigner ||= Assigner.new(default_known_tag) + tag ||= @assigner.assign(ns) + @ns2tag[ns] = tag + @tag2ns[tag] = ns + tag + end + end + + def assigned?(ns) + @default_namespace == ns or @ns2tag.key?(ns) + end + + def assigned_as_tagged?(ns) + @ns2tag.key?(ns) + end + + def assigned_tag?(tag) + @tag2ns.key?(tag) + end + + def clone_ns + cloned = self.class.new(@tag2ns.dup) + cloned.assigner = @assigner + cloned.assign(@default_namespace, '') if @default_namespace + cloned + end + + def name(qname) + if qname.namespace == @default_namespace + qname.name + elsif tag = @ns2tag[qname.namespace] + "#{tag}:#{qname.name}" + else + raise FormatError.new("namespace: #{qname.namespace} not defined yet") + end + end + + # no default namespace + def name_attr(qname) + if tag = @ns2tag[qname.namespace] + "#{tag}:#{qname.name}" + else + raise FormatError.new("namespace: #{qname.namespace} not defined yet") + end + end + + def compare(ns, name, rhs) + if (ns == @default_namespace) + return true if (name == rhs) + end + @tag2ns.each do |assigned_tag, assigned_ns| + if assigned_ns == ns && "#{assigned_tag}:#{name}" == rhs + return true + end + end + false + end + + # $1 and $2 are necessary. + ParseRegexp = Regexp.new("\A([^:]+)(?::(.+))?\z") + + def parse(str, local = false) + if ParseRegexp =~ str + if (name = $2) and (ns = @tag2ns[$1]) + return XSD::QName.new(ns, name) + end + end + XSD::QName.new(local ? nil : @default_namespace, str) + end + + # For local attribute key parsing + # + # => + # {}bar, {urn:a}baz + def parse_local(elem) + ParseRegexp =~ elem + if $2 + ns = @tag2ns[$1] + name = $2 + if !ns + raise FormatError.new("unknown namespace qualifier: #{$1}") + end + elsif $1 + ns = nil + name = $1 + else + raise FormatError.new("illegal element format: #{elem}") + end + XSD::QName.new(ns, name) + end + + def each_ns + @ns2tag.each do |ns, tag| + yield(ns, tag) + end + end + +protected + + def assigner=(assigner) + @assigner = assigner + end + +private + + def ns_default + {'xml' => Namespace} + end + + def default_known_tag + KNOWN_TAG + end +end + + +end diff --git a/lib/xsd/qname.rb b/lib/xsd/qname.rb new file mode 100644 index 0000000..10377e2 --- /dev/null +++ b/lib/xsd/qname.rb @@ -0,0 +1,79 @@ +# XSD4R - XML QName definition. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +module XSD + + +class QName + attr_reader :namespace + attr_reader :name + attr_accessor :source + + def initialize(namespace = nil, name = nil) + @namespace = namespace + @name = name + @source = nil + end + + def dup_name(name) + XSD::QName.new(@namespace, name) + end + + def dump(predefined_ns = nil) + ns = predefined_ns + ns ||= @namespace.nil? ? 'nil' : @namespace.dump + name = @name.nil? ? 'nil' : @name.dump + "XSD::QName.new(#{ns}, #{name})" + end + + def match(rhs) + if rhs.namespace and (rhs.namespace != @namespace) + return false + end + if rhs.name and (rhs.name != @name) + return false + end + true + end + + def ==(rhs) + !rhs.nil? and @namespace == rhs.namespace and @name == rhs.name + end + + def ===(rhs) + (self == rhs) + end + + def eql?(rhs) + (self == rhs) + end + + def hash + @namespace.hash ^ @name.hash + end + + def to_s + "{#{ namespace }}#{ name }" + end + + def inspect + sprintf("#<%s:0x%x %s>", self.class.name, __id__, + "{#{ namespace }}#{ name }") + end + + NormalizedNameRegexp = /^\{([^}]*)\}(.*)$/ + def parse(str) + NormalizedNameRegexp =~ str + self.new($1, $2) + end + + EMPTY = QName.new.freeze +end + + +end diff --git a/lib/xsd/xmlparser.rb b/lib/xsd/xmlparser.rb new file mode 100644 index 0000000..832f406 --- /dev/null +++ b/lib/xsd/xmlparser.rb @@ -0,0 +1,76 @@ +# XSD4R - XML Instance parser library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/xmlparser/parser' + + +module XSD + + +module XMLParser + def create_parser(host, opt) + XSD::XMLParser::Parser.create_parser(host, opt) + end + module_function :create_parser + + # $1 is necessary. + NSParseRegexp = Regexp.new("^xmlns:?(.*)$") + + def filter_ns(ns, attrs) + ns_updated = false + if attrs.nil? or attrs.empty? + return [ns, attrs] + end + newattrs = {} + attrs.each do |key, value| + if NSParseRegexp =~ key + unless ns_updated + ns = ns.clone_ns + ns_updated = true + end + # tag == '' means 'default namespace' + # value == '' means 'no default namespace' + tag = $1 || '' + ns.assign(value, tag) + else + newattrs[key] = value + end + end + return [ns, newattrs] + end + module_function :filter_ns +end + + +end + + +# Try to load XML processor. +loaded = false +[ + 'xsd/xmlparser/libxmlparser', + 'xsd/xmlparser/xmlparser', + 'xsd/xmlparser/xmlscanner', + 'xsd/xmlparser/rexmlparser', +].each do |lib| + begin + require lib + # XXX: for a workaround of rubygems' require inconsistency + # XXX: MUST BE REMOVED IN THE FUTURE + name = lib.sub(/^.*\//, '') + raise LoadError unless XSD::XMLParser.constants.find { |c| + c.to_s.downcase == name.downcase + } + loaded = true + break + rescue LoadError + end +end +unless loaded + raise RuntimeError.new("XML processor module not found.") +end diff --git a/lib/xsd/xmlparser.rb.orig b/lib/xsd/xmlparser.rb.orig new file mode 100644 index 0000000..2880c55 --- /dev/null +++ b/lib/xsd/xmlparser.rb.orig @@ -0,0 +1,76 @@ +# XSD4R - XML Instance parser library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/xmlparser/parser' + + +module XSD + + +module XMLParser + def create_parser(host, opt) + XSD::XMLParser::Parser.create_parser(host, opt) + end + module_function :create_parser + + # $1 is necessary. + NSParseRegexp = Regexp.new('^xmlns:?(.*)$', nil, 'NONE') + + def filter_ns(ns, attrs) + ns_updated = false + if attrs.nil? or attrs.empty? + return [ns, attrs] + end + newattrs = {} + attrs.each do |key, value| + if NSParseRegexp =~ key + unless ns_updated + ns = ns.clone_ns + ns_updated = true + end + # tag == '' means 'default namespace' + # value == '' means 'no default namespace' + tag = $1 || '' + ns.assign(value, tag) + else + newattrs[key] = value + end + end + return [ns, newattrs] + end + module_function :filter_ns +end + + +end + + +# Try to load XML processor. +loaded = false +[ + 'xsd/xmlparser/libxmlparser', + 'xsd/xmlparser/xmlparser', + 'xsd/xmlparser/xmlscanner', + 'xsd/xmlparser/rexmlparser', +].each do |lib| + begin + require lib + # XXX: for a workaround of rubygems' require inconsistency + # XXX: MUST BE REMOVED IN THE FUTURE + name = lib.sub(/^.*\//, '') + raise LoadError unless XSD::XMLParser.constants.find { |c| + c.downcase == name + } + loaded = true + break + rescue LoadError + end +end +unless loaded + raise RuntimeError.new("XML processor module not found.") +end diff --git a/lib/xsd/xmlparser/libxmlparser.rb b/lib/xsd/xmlparser/libxmlparser.rb new file mode 100644 index 0000000..ba8f3b8 --- /dev/null +++ b/lib/xsd/xmlparser/libxmlparser.rb @@ -0,0 +1,115 @@ +# XSD4R - XMLParser XML parser library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/xmlparser' +require 'xml/libxml' + + +module XSD +module XMLParser + + +class LibXMLParser < XSD::XMLParser::Parser + include XML::SaxParser::Callbacks + + def do_parse(string_or_readable) + if string_or_readable.respond_to?(:read) + string = string_or_readable.read + else + string = string_or_readable + end + # XMLParser passes a String in utf-8. + @charset = 'utf-8' + @parser = XML::SaxParser.new + @parser.callbacks = self + @parser.string = string + @parser.parse + end + + ENTITY_REF_MAP = { + 'lt' => '<', + 'gt' => '>', + 'amp' => '&', + 'quot' => '"', + 'apos' => '\'' + } + + #def on_internal_subset(name, external_id, system_id) + # nil + #end + + #def on_is_standalone() + # nil + #end + + #def on_has_internal_subset() + # nil + #end + + #def on_has_external_subset() + # nil + #end + + #def on_start_document() + # nil + #end + + #def on_end_document() + # nil + #end + + def on_start_element(name, attr_hash) + start_element(name, attr_hash) + end + + def on_end_element(name) + end_element(name) + end + + def on_reference(name) + characters(ENTITY_REF_MAP[name]) + end + + def on_characters(chars) + characters(chars) + end + + #def on_processing_instruction(target, data) + # nil + #end + + #def on_comment(msg) + # nil + #end + + def on_parser_warning(msg) + warn(msg) + end + + def on_parser_error(msg) + raise ParseError.new(msg) + end + + def on_parser_fatal_error(msg) + raise ParseError.new(msg) + end + + def on_cdata_block(cdata) + characters(cdata) + end + + def on_external_subset(name, external_id, system_id) + nil + end + + add_factory(self) +end + + +end +end diff --git a/lib/xsd/xmlparser/parser.rb b/lib/xsd/xmlparser/parser.rb new file mode 100644 index 0000000..4bdd895 --- /dev/null +++ b/lib/xsd/xmlparser/parser.rb @@ -0,0 +1,100 @@ +# XSD4R - XML Instance parser library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/qname' +require 'xsd/ns' +require 'xsd/charset' + + +module XSD +module XMLParser + + +class Parser + class ParseError < Error; end + class FormatDecodeError < ParseError; end + class UnknownElementError < FormatDecodeError; end + class UnknownAttributeError < FormatDecodeError; end + class UnexpectedElementError < FormatDecodeError; end + class ElementConstraintError < FormatDecodeError; end + class ParserError < ParseError; end + + @@parser_factory = nil + + def self.factory + @@parser_factory + end + + def self.create_parser(host, opt = {}) + unless @@parser_factory + raise ParserError.new("illegal XML parser configuration") + end + @@parser_factory.new(host, opt) + end + + def self.add_factory(factory) + if $DEBUG + puts "Set #{ factory } as XML processor." + end + @@parser_factory = factory + end + +public + + attr_accessor :charset + + def initialize(host, opt = {}) + @host = host + @charset = opt[:charset] || nil + end + + def parse(string_or_readable) + @textbuf = '' + prologue + do_parse(string_or_readable) + epilogue + end + +private + + def do_parse(string_or_readable) + raise ParserError.new( + 'Method do_parse must be defined in derived class.') + end + + def start_element(name, attrs) + @host.start_element(name, attrs) + end + + def characters(text) + @host.characters(text) + end + + def end_element(name) + @host.end_element(name) + end + + def prologue + end + + def epilogue + end + + def xmldecl_encoding=(charset) + if @charset.nil? + @charset = charset + else + # Definition in a stream (like HTTP) has a priority. + p "encoding definition: #{ charset } is ignored." if $DEBUG + end + end +end + + +end +end diff --git a/lib/xsd/xmlparser/rexmlparser.rb b/lib/xsd/xmlparser/rexmlparser.rb new file mode 100644 index 0000000..76ac75c --- /dev/null +++ b/lib/xsd/xmlparser/rexmlparser.rb @@ -0,0 +1,58 @@ +# XSD4R - REXMLParser XML parser library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/xmlparser' +require 'rexml/streamlistener' +require 'rexml/document' + + +module XSD +module XMLParser + + +class REXMLParser < XSD::XMLParser::Parser + include REXML::StreamListener + + def do_parse(string_or_readable) + source = nil + source = REXML::SourceFactory.create_from(string_or_readable) + source.encoding = charset if charset + # Listener passes a String in utf-8. + @charset = 'utf-8' + REXML::Document.parse_stream(source, self) + end + + def epilogue + end + + def tag_start(name, attrs) + start_element(name, attrs) + end + + def tag_end(name) + end_element(name) + end + + def text(text) + characters(text) + end + + def cdata(content) + characters(content) + end + + def xmldecl(version, encoding, standalone) + # Version should be checked. + end + + add_factory(self) +end + + +end +end diff --git a/lib/xsd/xmlparser/xmlparser.rb b/lib/xsd/xmlparser/xmlparser.rb new file mode 100644 index 0000000..c7a9f65 --- /dev/null +++ b/lib/xsd/xmlparser/xmlparser.rb @@ -0,0 +1,50 @@ +# XSD4R - XMLParser XML parser library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/xmlparser' +require 'xml/parser' + + +module XSD +module XMLParser + + +class XMLParser < XSD::XMLParser::Parser + class Listener < XML::Parser + begin + require 'xml/encoding-ja' + include XML::Encoding_ja + rescue LoadError + # uconv may not be installed. + end + end + + def do_parse(string_or_readable) + # XMLParser passes a String in utf-8. + @charset = 'utf-8' + @parser = Listener.new + @parser.parse(string_or_readable) do |type, name, data| + case type + when XML::Parser::START_ELEM + start_element(name, data) + when XML::Parser::END_ELEM + end_element(name) + when XML::Parser::CDATA + characters(data) + else + raise FormatDecodeError.new("Unexpected XML: #{ type }/#{ name }/#{ data }.") + end + end + end + + add_factory(self) +end + + +end +end diff --git a/lib/xsd/xmlparser/xmlscanner.rb b/lib/xsd/xmlparser/xmlscanner.rb new file mode 100644 index 0000000..c4d3d74 --- /dev/null +++ b/lib/xsd/xmlparser/xmlscanner.rb @@ -0,0 +1,149 @@ +# XSD4R - XMLScan XML parser library. +# Copyright (C) 2000-2007 NAKAMURA, Hiroshi . + +# This program is copyrighted free software by NAKAMURA, Hiroshi. You can +# redistribute it and/or modify it under the same terms of Ruby's license; +# either the dual license version in 2003, or any later version. + + +require 'xsd/xmlparser' +require 'xmlscan/scanner' + + +module XSD +module XMLParser + + +class XMLScanner < XSD::XMLParser::Parser + include XMLScan::Visitor + + def do_parse(string_or_readable) + @attrs = {} + @curattr = nil + @scanner = XMLScan::XMLScanner.new(self) + @scanner.kcode = XSD::Charset.charset_str(charset) if charset + @scanner.parse(string_or_readable) + end + + def scanner_kcode=(charset) + @scanner.kcode = XSD::Charset.charset_str(charset) if charset + self.xmldecl_encoding = charset + end + + ENTITY_REF_MAP = { + 'lt' => '<', + 'gt' => '>', + 'amp' => '&', + 'quot' => '"', + 'apos' => '\'' + } + + def parse_error(msg) + raise ParseError.new(msg) + end + + def wellformed_error(msg) + raise NotWellFormedError.new(msg) + end + + def valid_error(msg) + raise NotValidError.new(msg) + end + + def warning(msg) + warn(msg) + end + + # def on_xmldecl; end + + def on_xmldecl_version(str) + # 1.0 expected. + end + + def on_xmldecl_encoding(str) + self.scanner_kcode = str + end + + # def on_xmldecl_standalone(str); end + + # def on_xmldecl_other(name, value); end + + # def on_xmldecl_end; end + + # def on_doctype(root, pubid, sysid); end + + # def on_prolog_space(str); end + + # def on_comment(str); end + + # def on_pi(target, pi); end + + def on_chardata(str) + characters(str) + end + + def on_cdata(str) + characters(str) + end + + def on_etag(name) + end_element(name) + end + + def on_entityref(ref) + characters(ENTITY_REF_MAP[ref]) + end + + def on_charref(code) + characters([code].pack('U')) + end + + def on_charref_hex(code) + on_charref(code) + end + + # def on_start_document; end + + # def on_end_document; end + + def on_stag(name) + @attrs = {} + end + + def on_attribute(name) + @attrs[name] = @curattr = '' + end + + def on_attr_value(str) + @curattr << str + end + + def on_attr_entityref(ref) + @curattr << ENTITY_REF_MAP[ref] + end + + def on_attr_charref(code) + @curattr << [code].pack('U') + end + + def on_attr_charref_hex(code) + on_attr_charref(code) + end + + # def on_attribute_end(name); end + + def on_stag_end_empty(name) + on_stag_end(name) + on_etag(name) + end + + def on_stag_end(name) + start_element(name, @attrs) + end + + add_factory(self) +end + + +end +end diff --git a/rubyStyle.css b/rubyStyle.css new file mode 100644 index 0000000..160327c --- /dev/null +++ b/rubyStyle.css @@ -0,0 +1,104 @@ +body { + background: #fff; + color: black; + margin-left: 2%; + margin-right: 2%; + font-family: Verdana, Arial, Helvetica, Sans-Serif; +} + +a:link, a:visited { + text-decoration: none; + font-weight: bold; + color: #c00; + background: white; +} + +a:link:hover, a:visited:hover { + font-weight: bold; + color: #fff; + background: black; +} + +h1 { + color: #666; + background: white; + text-align: right; + margin-top: 1em; +} + +h2 { + color: #666; + background: #ddd; + margin-top: 3ex; +} + +h2 span.content { + border-style: solid solid dashed solid; + border-width: 0px 0px 1px 20px; + border-color: #666; + padding-left: 1ex; +} + +h3 { + color: #666; + background: #ddd; + margin-top: 2ex; +} + +h3 span.content { + border-style: solid; + border-width: 0px 0px 0px 10px; + border-color: #999; + padding-left: 1ex; +} + +dt { + font-weight: bold; + margin-top: 2ex; + margin-left: 1em; +} + +ul { + margin-bottom: 0.5em; +} + +li { + margin-bottom: 0.1em; +} + +table { + border-collapse: collapse; + empty-cells: show; + border-style: solid; + border-color: black; +} + +table td { + border-style: solid; +} + +address { + color: gray; + background: #fff; + text-align: right; + font-family: Times, serif; + font-style: normal; + font-variant: normal; + font-weight: normal; +} + +pre { + font-size: 90%; + border-style: inset; + border-width: 1px; + border-color: #666; + padding-right: 1ex; + padding-top: 0.5em; + padding-left: 1ex; + padding-bottom: 0.5em; + margin-left: 1em; + margin-right: 2em; + white-space: pre; + background: #e6e6e6; + color: black; +} diff --git a/sample/attachment/complexmime/EdmService.rb b/sample/attachment/complexmime/EdmService.rb new file mode 100644 index 0000000..0c2e47e --- /dev/null +++ b/sample/attachment/complexmime/EdmService.rb @@ -0,0 +1,124 @@ +require 'xsd/qname' + +# {urn:EDD:Edm}LocationInfo +class LocationInfo + @@schema_type = "LocationInfo" + @@schema_ns = "urn:EDD:Edm" + @@schema_element = [["bottomLeft", ["Coordinates", XSD::QName.new(nil, "bottomLeft")]], ["topRight", ["Coordinates", XSD::QName.new(nil, "topRight")]], ["startTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "startTime")]], ["endTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "endTime")]]] + + attr_accessor :bottomLeft + attr_accessor :topRight + attr_accessor :startTime + attr_accessor :endTime + + def initialize(bottomLeft = nil, topRight = nil, startTime = nil, endTime = nil) + @bottomLeft = bottomLeft + @topRight = topRight + @startTime = startTime + @endTime = endTime + end +end + +# {urn:EDD:Edm}MapInfo +class MapInfo + @@schema_type = "MapInfo" + @@schema_ns = "urn:EDD:Edm" + @@schema_element = [["mapArea", ["MapArea", XSD::QName.new(nil, "mapArea")]], ["mapTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "mapTime")]], ["mapOptions", ["MapOptions", XSD::QName.new(nil, "mapOptions")]]] + + attr_accessor :mapArea + attr_accessor :mapTime + attr_accessor :mapOptions + + def initialize(mapArea = nil, mapTime = nil, mapOptions = nil) + @mapArea = mapArea + @mapTime = mapTime + @mapOptions = mapOptions + end +end + +# {urn:EDD}ObjectIdentification +class ObjectIdentification + @@schema_type = "ObjectIdentification" + @@schema_ns = "urn:EDD" + @@schema_element = [["mmsiNumber", ["SOAP::SOAPString", XSD::QName.new(nil, "mmsiNumber")]], ["weight", ["SOAP::SOAPLong", XSD::QName.new(nil, "weight")]], ["length", ["SOAP::SOAPLong", XSD::QName.new(nil, "length")]], ["width", ["SOAP::SOAPLong", XSD::QName.new(nil, "width")]], ["draught", ["SOAP::SOAPLong", XSD::QName.new(nil, "draught")]]] + + attr_accessor :mmsiNumber + attr_accessor :weight + attr_accessor :length + attr_accessor :width + attr_accessor :draught + + def initialize(mmsiNumber = nil, weight = nil, length = nil, width = nil, draught = nil) + @mmsiNumber = mmsiNumber + @weight = weight + @length = length + @width = width + @draught = draught + end +end + +# {urn:EDD}Coordinates +class Coordinates + @@schema_type = "Coordinates" + @@schema_ns = "urn:EDD" + @@schema_element = [["wgs84Latitude", ["SOAP::SOAPDouble", XSD::QName.new(nil, "wgs84Latitude")]], ["wgs84Longitude", ["SOAP::SOAPDouble", XSD::QName.new(nil, "wgs84Longitude")]]] + + attr_accessor :wgs84Latitude + attr_accessor :wgs84Longitude + + def initialize(wgs84Latitude = nil, wgs84Longitude = nil) + @wgs84Latitude = wgs84Latitude + @wgs84Longitude = wgs84Longitude + end +end + +# {urn:EDD}LastKnownPosition +class LastKnownPosition + @@schema_type = "LastKnownPosition" + @@schema_ns = "urn:EDD" + @@schema_element = [["location", ["Coordinates", XSD::QName.new(nil, "location")]], ["timestamp", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "timestamp")]]] + + attr_accessor :location + attr_accessor :timestamp + + def initialize(location = nil, timestamp = nil) + @location = location + @timestamp = timestamp + end +end + +# {urn:EDD}MapArea +class MapArea + @@schema_type = "MapArea" + @@schema_ns = "urn:EDD" + @@schema_element = [["bottomLeft", ["Coordinates", XSD::QName.new(nil, "bottomLeft")]], ["topRight", ["Coordinates", XSD::QName.new(nil, "topRight")]], ["width", ["SOAP::SOAPLong", XSD::QName.new(nil, "width")]], ["height", ["SOAP::SOAPLong", XSD::QName.new(nil, "height")]]] + + attr_accessor :bottomLeft + attr_accessor :topRight + attr_accessor :width + attr_accessor :height + + def initialize(bottomLeft = nil, topRight = nil, width = nil, height = nil) + @bottomLeft = bottomLeft + @topRight = topRight + @width = width + @height = height + end +end + +# {urn:EDD}MapOptions +class MapOptions + @@schema_type = "MapOptions" + @@schema_ns = "urn:EDD" + @@schema_element = [["showCurrentData", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "showCurrentData")]], ["showWaveData", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "showWaveData")]], ["showWindData", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "showWindData")]]] + + attr_accessor :showCurrentData + attr_accessor :showWaveData + attr_accessor :showWindData + + def initialize(showCurrentData = nil, showWaveData = nil, showWindData = nil) + @showCurrentData = showCurrentData + @showWaveData = showWaveData + @showWindData = showWindData + end +end diff --git a/sample/attachment/complexmime/README.txt b/sample/attachment/complexmime/README.txt new file mode 100644 index 0000000..e6aa21e --- /dev/null +++ b/sample/attachment/complexmime/README.txt @@ -0,0 +1,3 @@ +This directory includes Complex Type + MIME attachment example +by Ger Apeldoorn +Thanks. diff --git a/sample/attachment/complexmime/client.rb b/sample/attachment/complexmime/client.rb new file mode 100644 index 0000000..085371a --- /dev/null +++ b/sample/attachment/complexmime/client.rb @@ -0,0 +1,57 @@ +require 'soap/rpc/driver' +require 'soap/attachment' +require 'EdmService' + +# test script for the EDD service in ruby, to see if we can send and +# receive attachments. + +# set up the server parameters +server = 'http://localhost:7000/' +driver = SOAP::RPC::Driver.new(server, 'urn:EDD:Edm') + +# debugging? +driver.wiredump_dev = STDERR + +# add methods +driver.add_method('MapInfo', 'mapArea', 'mapTime', 'mapOptions', 'driftPrediction') +driver.add_method('LocationInfo', 'bottomLeft', 'topRight', 'startTime', 'endTime') + +# LocationInfo +bottomLeft = Coordinates.new +bottomLeft.wgs84Latitude = 0.12 +bottomLeft.wgs84Longitude = 3.45 + +topRight = Coordinates.new +topRight.wgs84Latitude = 1.23 +topRight.wgs84Longitude = 4.56 + +startTime = '2006-07-13T14:39:25.459Z' +endTime = '2006-07-13T14:55:25.459Z' + +result = driver.LocationInfo(bottomLeft, topRight, startTime, endTime) +puts("LocationInfo result: #{result}") + +# MapInfo +mapArea = MapArea.new +mapArea.bottomLeft = Coordinates.new +mapArea.topRight = Coordinates.new +mapArea.bottomLeft.wgs84Latitude = 2.34 +mapArea.bottomLeft.wgs84Longitude = 5.67 +mapArea.topRight.wgs84Latitude = 3.45 +mapArea.topRight.wgs84Longitude = 6.78 +mapArea.width = 4.56 +mapArea.height = 7.89 + +mapTime = SOAP::SOAPDateTime.new('2006-07-13T14:39:25.459Z') + +mapOptions = MapOptions.new +mapOptions.showCurrentData = true +mapOptions.showWaveData = false +mapOptions.showWindData = true + +driftPrediction = SOAP::Attachment.new(File.open('drift.cdf')) +driftPrediction.contenttype = "application/x-netcdf" + +result = driver.MapInfo(mapArea, mapTime, mapOptions, driftPrediction) +puts("MapInfo result: #{result}") + diff --git a/sample/attachment/complexmime/drift.cdf b/sample/attachment/complexmime/drift.cdf new file mode 100644 index 0000000..108fde4 --- /dev/null +++ b/sample/attachment/complexmime/drift.cdf @@ -0,0 +1 @@ +file content of drift.cdf diff --git a/sample/attachment/complexmime/plaatje.png b/sample/attachment/complexmime/plaatje.png new file mode 100644 index 0000000..3929b46 --- /dev/null +++ b/sample/attachment/complexmime/plaatje.png @@ -0,0 +1 @@ +file content of plaatje.png diff --git a/sample/attachment/complexmime/server.rb b/sample/attachment/complexmime/server.rb new file mode 100644 index 0000000..8c42e0a --- /dev/null +++ b/sample/attachment/complexmime/server.rb @@ -0,0 +1,68 @@ +require 'soap/rpc/standaloneServer' +require 'soap/attachment' + +# Ruby test class for the EDD project to see if we can receive and +# send attachments on the server side. + +class SwAService + + def initialize + puts("EDD SOAP service (ruby) initialized.") + end + + def LocationInfo(bottomLeft, topRight, startTime, endTime) + puts("bottomLeft->wgs84Latitude : '#{bottomLeft.wgs84Latitude}'") + puts("bottomLeft->wgs84Longitude: '#{bottomLeft.wgs84Longitude}'") + puts("topRight->wgs84Latitude : '#{topRight.wgs84Latitude}'") + puts("topRight->wgs84Longitude : '#{topRight.wgs84Longitude}'") + puts("startTime : '#{startTime}'") + puts("endTime : '#{endTime}'") + + # COMPUTE NETCDF HERE! + cdffilename = 'drift.cdf' + + file = SOAP::Attachment.new(File.open(cdffilename)) + file.contenttype = "application/x-netcdf" + return file + end + + def MapInfo(mapArea, mapTime, mapOptions, driftPrediction) + + puts("mapArea.topRight.wgs84Longitude : #{mapArea.topRight.wgs84Longitude}") + puts("mapArea.topRight.wgs84Latitude : #{mapArea.topRight.wgs84Latitude}") + puts("mapArea.bottomLeft.wgs84Longitude : #{mapArea.bottomLeft.wgs84Longitude}") + puts("mapArea.bottomLeft.wgs84Latitude : #{mapArea.bottomLeft.wgs84Latitude}") + puts("mapArea.width : #{mapArea.width}") + puts("mapArea.height : #{mapArea.height}") + puts("mapTime : #{mapTime}") + puts("mapOptions.showCurrentData : #{mapOptions.showCurrentData}") + puts("mapOptions.showWaveData : #{mapOptions.showWaveData}") + puts("mapOptions.showWindData : #{mapOptions.showWindData}") + puts("Received file:") + puts(driftPrediction.to_s) + + # COMPUTE PNG IMAGE HERE! + imagefilename = 'plaatje.png' + + file = SOAP::Attachment.new(File.open(imagefilename)) + file.contenttype = "image/png" + file.contentid = "out" + file + end +end + +# setup server object +server = SOAP::RPC::StandaloneServer.new('SwAServer', + 'urn:EDD:Edm', + '0.0.0.0', 7000) + +# add attachment functionality +server.add_servant(SwAService.new) + +# run until interrupted +trap(:INT) do + server.shutdown +end + +# go +server.start diff --git a/sample/attachment/swa/client.rb b/sample/attachment/swa/client.rb new file mode 100644 index 0000000..01c59a3 --- /dev/null +++ b/sample/attachment/swa/client.rb @@ -0,0 +1,13 @@ +require 'soap/rpc/driver' +require 'soap/attachment' + +server = 'http://localhost:7000/' +driver = SOAP::RPC::Driver.new(server, 'http://www.acmetron.com/soap') +driver.wiredump_dev = STDERR +driver.add_method('get_file') +driver.add_method('put_file', 'name', 'file') + +p driver.get_file +file = File.open($0) +attach = SOAP::Attachment.new(file) +p driver.put_file($0, attach) diff --git a/sample/attachment/swa/server.rb b/sample/attachment/swa/server.rb new file mode 100644 index 0000000..0a82fe5 --- /dev/null +++ b/sample/attachment/swa/server.rb @@ -0,0 +1,23 @@ +require 'soap/rpc/standaloneServer' +require 'soap/attachment' + +class SwAService + def get_file + return { + 'name' => $0, + 'file' => SOAP::Attachment.new(File.open($0)) + } + end + + def put_file(name, file) + "File '#{name}' was received ok." + end +end + +server = SOAP::RPC::StandaloneServer.new('SwAServer', + 'http://www.acmetron.com/soap', '0.0.0.0', 7000) +server.add_servant(SwAService.new) +trap(:INT) do + server.shutdown +end +server.start diff --git a/sample/basic/apacheClient.rb b/sample/basic/apacheClient.rb new file mode 100644 index 0000000..d724d8c --- /dev/null +++ b/sample/basic/apacheClient.rb @@ -0,0 +1,92 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/driver' +require 'soap/XMLSchemaDatatypes1999' + + +class SampleClient < Application + + private + + AppName = 'SampleClient' + + NS1 = 'urn:i3solutions-delayed-quotes' + NS2 = 'urn:AddressFetcher' + + def initialize(server, proxy) + super(AppName) + @server = server + @proxy = proxy + @drv1 = nil + @drv2 = nil + end + + def run + # Driver initialize and method definition + + @drv1 = SOAP::RPC::Driver.new(@server, NS1) + @drv1.addMethod('getQuote', 'symbol') + + @drv2 = SOAP::RPC::Driver.new(@server, NS2) + @drv2.addMethod('getAddressFromName', 'nameToLookup') + @drv2.addMethod('addEntry', 'nameToRegister', 'address') + + # Method invocation + + puts @drv1.getQuote("IBM") + + address = @drv2.getAddressFromName("John B. Good") + dumpAddress(address) + + phoneNumber = PhoneNumber.new(987, '654', '3210') + address = Address.new(123, 'STREET', 'CITY', 'NY', 99999, phoneNumber) + result = @drv2.addEntry('NaHi', address) + puts 'NaHi has been added.' + + address = @drv2.getAddressFromName("NaHi") + dumpAddress(address) + + return 0 + end + + def dumpAddress(addr) + phone = addr.phoneNumber + puts < 3' +puts calc.add(1, 2) +puts 'sub: 1.1 - 2.2 # => -1.1' +puts calc.sub(1.1, 2.2) +puts 'multi: 1.1 * 2.2 # => 2.42' +puts calc.multi(1.1, 2.2) +puts 'div: 5 / 2 # => 2' +puts calc.div(5, 2) +puts 'div: 5.0 / 2 # => 2.5' +puts calc.div(5.0, 2) +puts 'div: 1.1 / 0 # => Infinity' +puts calc.div(1.1, 0) +puts 'div: 1 / 0 # => ZeroDivisionError' +puts calc.div(1, 0) diff --git a/sample/basic/calc/client2.rb b/sample/basic/calc/client2.rb new file mode 100644 index 0000000..2c53f09 --- /dev/null +++ b/sample/basic/calc/client2.rb @@ -0,0 +1,29 @@ +require 'soap/rpc/driver' + +server = ARGV.shift || 'http://localhost:7000/' +# server = 'http://localhost:8808/server2.cgi' + +var = SOAP::RPC::Driver.new( server, 'http://tempuri.org/calcService' ) +var.add_method( 'set', 'newValue' ) +var.add_method( 'get' ) +var.add_method_as( '+', 'add', 'rhs' ) +var.add_method_as( '-', 'sub', 'rhs' ) +var.add_method_as( '*', 'multi', 'rhs' ) +var.add_method_as( '/', 'div', 'rhs' ) + +puts 'var.set( 1 )' +puts '# Bare in mind that another client set another value to this service.' +puts '# This is only a sample for proof of concept.' +var.set( 1 ) +puts 'var + 2 # => 1 + 2 = 3' +puts var + 2 +puts 'var - 2.2 # => 1 - 2.2 = -1.2' +puts var - 2.2 +puts 'var * 2.2 # => 1 * 2.2 = 2.2' +puts var * 2.2 +puts 'var / 2 # => 1 / 2 = 0' +puts var / 2 +puts 'var / 2.0 # => 1 / 2.0 = 0.5' +puts var / 2.0 +puts 'var / 0 # => 1 / 0 => ZeroDivisionError' +puts var / 0 diff --git a/sample/basic/calc/httpd.rb b/sample/basic/calc/httpd.rb new file mode 100644 index 0000000..bebcff9 --- /dev/null +++ b/sample/basic/calc/httpd.rb @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby + +require 'webrick' +require 'soap/property' + +docroot = "." +port = 8808 +if opt = SOAP::Property.loadproperty("samplehttpd.conf") + docroot = opt["docroot"] + port = Integer(opt["port"]) +end + +s = WEBrick::HTTPServer.new( + :BindAddress => "0.0.0.0", + :Port => port, + :DocumentRoot => docroot, + :CGIPathEnv => ENV['PATH'] +) +trap(:INT){ s.shutdown } +s.start diff --git a/sample/basic/calc/samplehttpd.conf b/sample/basic/calc/samplehttpd.conf new file mode 100644 index 0000000..85e9995 --- /dev/null +++ b/sample/basic/calc/samplehttpd.conf @@ -0,0 +1,2 @@ +docroot = . +port = 8808 diff --git a/sample/basic/calc/server.cgi b/sample/basic/calc/server.cgi new file mode 100644 index 0000000..c4fa687 --- /dev/null +++ b/sample/basic/calc/server.cgi @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/cgistub' + +class CalcServer < SOAP::RPC::CGIStub + def initialize(*arg) + super + + require 'calc' + servant = CalcService + add_servant(servant, 'http://tempuri.org/calcService') + end +end + +status = CalcServer.new('CalcServer', nil).start diff --git a/sample/basic/calc/server.fcgi b/sample/basic/calc/server.fcgi new file mode 100755 index 0000000..82d7cb8 --- /dev/null +++ b/sample/basic/calc/server.fcgi @@ -0,0 +1,22 @@ +#!/usr/bin/env ruby + +require 'fcgi' + +require 'soap/rpc/cgistub' + +class CalcServer < SOAP::RPC::CGIStub + def initialize(*arg) + super + + require 'calc' + servant = CalcService + add_servant(servant, 'http://tempuri.org/calcService') + end +end + +app = CalcServer.new('CalcServer', nil) + +FCGI.each do |request| + app.set_fcgi_request(request) + app.start +end diff --git a/sample/basic/calc/server.rb b/sample/basic/calc/server.rb new file mode 100644 index 0000000..97661be --- /dev/null +++ b/sample/basic/calc/server.rb @@ -0,0 +1,21 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/standaloneServer' +require 'calc' + +class CalcServer < SOAP::RPC::StandaloneServer + def initialize(*arg) + super + + servant = CalcService + add_servant(servant, 'http://tempuri.org/calcService') + end +end + +if $0 == __FILE__ + server = CalcServer.new('CalcServer', nil, '0.0.0.0', 7000) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/sample/basic/calc/server2.rb b/sample/basic/calc/server2.rb new file mode 100644 index 0000000..bb0f643 --- /dev/null +++ b/sample/basic/calc/server2.rb @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/standaloneServer' +require 'calc2' + +class CalcServer2 < SOAP::RPC::StandaloneServer + def on_init + servant = CalcService2.new + add_method(servant, 'set', 'newValue') + add_method(servant, 'get') + add_method_as(servant, '+', 'add', 'lhs') + add_method_as(servant, '-', 'sub', 'lhs') + add_method_as(servant, '*', 'multi', 'lhs') + add_method_as(servant, '/', 'div', 'lhs') + end +end + +if $0 == __FILE__ + server = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', 7000) + trap(:INT) do + server.shutdown + end + status = server.start +end diff --git a/sample/basic/exchange/client.rb b/sample/basic/exchange/client.rb new file mode 100644 index 0000000..2aa277a --- /dev/null +++ b/sample/basic/exchange/client.rb @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +require "soap/rpc/driver" + +ExchangeServiceNamespace = 'http://tempuri.org/exchangeService' + +server = ARGV.shift || "http://localhost:7000/" +# server = "http://localhost:8808/server.cgi" + +logger = nil +wiredump_dev = nil +# logger = Logger.new(STDERR) +# wiredump_dev = STDERR + +drv = SOAP::RPC::Driver.new(server, ExchangeServiceNamespace) +drv.wiredump_dev = wiredump_dev +drv.add_method("rate", "country1", "country2") + +p drv.rate("USA", "Japan") diff --git a/sample/basic/exchange/exchange.rb b/sample/basic/exchange/exchange.rb new file mode 100644 index 0000000..00f930d --- /dev/null +++ b/sample/basic/exchange/exchange.rb @@ -0,0 +1,17 @@ +require 'soap/rpc/driver' + +ExchangeServiceNamespace = 'http://tempuri.org/exchangeService' + +class Exchange + ForeignServer = "http://services.xmethods.net/soap" + Namespace = "urn:xmethods-CurrencyExchange" + + def initialize + @drv = SOAP::RPC::Driver.new(ForeignServer, Namespace) + @drv.add_method("getRate", "country1", "country2") + end + + def rate(country1, country2) + return @drv.getRate(country1, country2) + end +end diff --git a/sample/basic/exchange/httpd.rb b/sample/basic/exchange/httpd.rb new file mode 100644 index 0000000..bebcff9 --- /dev/null +++ b/sample/basic/exchange/httpd.rb @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby + +require 'webrick' +require 'soap/property' + +docroot = "." +port = 8808 +if opt = SOAP::Property.loadproperty("samplehttpd.conf") + docroot = opt["docroot"] + port = Integer(opt["port"]) +end + +s = WEBrick::HTTPServer.new( + :BindAddress => "0.0.0.0", + :Port => port, + :DocumentRoot => docroot, + :CGIPathEnv => ENV['PATH'] +) +trap(:INT){ s.shutdown } +s.start diff --git a/sample/basic/exchange/samplehttpd.conf b/sample/basic/exchange/samplehttpd.conf new file mode 100644 index 0000000..85e9995 --- /dev/null +++ b/sample/basic/exchange/samplehttpd.conf @@ -0,0 +1,2 @@ +docroot = . +port = 8808 diff --git a/sample/basic/exchange/server.cgi b/sample/basic/exchange/server.cgi new file mode 100755 index 0000000..1ba453d --- /dev/null +++ b/sample/basic/exchange/server.cgi @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/cgistub' +require 'exchange' + +class ExchangeServer < SOAP::RPC::CGIStub + def initialize(*arg) + super + servant = Exchange.new + add_servant(servant) + end +end + +status = ExchangeServer.new('SampleStructServer', ExchangeServiceNamespace).start diff --git a/sample/basic/exchange/server.rb b/sample/basic/exchange/server.rb new file mode 100644 index 0000000..cfb9ed5 --- /dev/null +++ b/sample/basic/exchange/server.rb @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/standaloneServer' +require 'exchange' + +class ExchangeServer < SOAP::RPC::StandaloneServer + def initialize(*arg) + super + servant = Exchange.new + add_servant(servant) + end +end + +if $0 == __FILE__ + server = ExchangeServer.new('SampleStructServer', ExchangeServiceNamespace, '0.0.0.0', 7000) + trap(:INT) do + server.shutdown + end + status = server.start +end diff --git a/sample/basic/flickr.rb b/sample/basic/flickr.rb new file mode 100644 index 0000000..c961349 --- /dev/null +++ b/sample/basic/flickr.rb @@ -0,0 +1,26 @@ +require 'soap/rpc/driver' + +api_key = ARGV.shift or raise + +flickr = SOAP::RPC::Driver.new('http://www.flickr.com/services/soap/') +flickr.wiredump_dev = STDOUT if $DEBUG + +flickr.add_document_method('request', nil, + XSD::QName.new('urn:flickr', 'FlickrRequest'), + XSD::QName.new('urn:flickr', 'FlickrResponse')) + +soap12namespace = 'http://www.w3.org/2003/05/soap-envelope' +flickr.options['soap.envelope.requestnamespace'] = soap12namespace +flickr.options['soap.envelope.responsenamespace'] = soap12namespace + +response = flickr.request( + :api_key => api_key, + :method => 'flickr.test.echo', + :name => 'hello world') + +responsexml = "#{response}" + +require 'xsd/mapping' +obj = XSD::Mapping.xml2obj(responsexml) +p obj.method +p obj.name diff --git a/sample/basic/helloworld/client.rb b/sample/basic/helloworld/client.rb new file mode 100644 index 0000000..253d0a4 --- /dev/null +++ b/sample/basic/helloworld/client.rb @@ -0,0 +1,6 @@ +require 'soap/rpc/driver' + +s = SOAP::RPC::Driver.new('http://localhost:2000/', 'urn:hws') +s.add_method("hello_world", "from") + +p s.hello_world(self.to_s) diff --git a/sample/basic/helloworld/server.rb b/sample/basic/helloworld/server.rb new file mode 100644 index 0000000..f9f819a --- /dev/null +++ b/sample/basic/helloworld/server.rb @@ -0,0 +1,20 @@ +require 'soap/rpc/standaloneServer' + +class HelloWorldServer < SOAP::RPC::StandaloneServer + def on_init + @log.level = Logger::Severity::DEBUG + add_method(self, 'hello_world', 'from') + end + + def hello_world(from) + "Hello World, from #{ from }" + end +end + +if $0 == __FILE__ + server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', 2000) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/sample/basic/sampleStruct/client.rb b/sample/basic/sampleStruct/client.rb new file mode 100644 index 0000000..b55c7fd --- /dev/null +++ b/sample/basic/sampleStruct/client.rb @@ -0,0 +1,16 @@ +require 'soap/rpc/driver' + +require 'iSampleStruct' + +server = ARGV.shift || 'http://localhost:7000/' +# server = 'http://localhost:8808/server.cgi' + +drv = SOAP::RPC::Driver.new(server, SampleStructServiceNamespace) +drv.wiredump_dev = STDERR +drv.add_method('hi', 'sampleStruct') + +o1 = SampleStruct.new +puts "Sending struct: #{ o1.inspect }" +puts +o2 = drv.hi(o1) +puts "Received (wrapped): #{ o2.inspect }" diff --git a/sample/basic/sampleStruct/httpd.rb b/sample/basic/sampleStruct/httpd.rb new file mode 100644 index 0000000..bebcff9 --- /dev/null +++ b/sample/basic/sampleStruct/httpd.rb @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby + +require 'webrick' +require 'soap/property' + +docroot = "." +port = 8808 +if opt = SOAP::Property.loadproperty("samplehttpd.conf") + docroot = opt["docroot"] + port = Integer(opt["port"]) +end + +s = WEBrick::HTTPServer.new( + :BindAddress => "0.0.0.0", + :Port => port, + :DocumentRoot => docroot, + :CGIPathEnv => ENV['PATH'] +) +trap(:INT){ s.shutdown } +s.start diff --git a/sample/basic/sampleStruct/iSampleStruct.rb b/sample/basic/sampleStruct/iSampleStruct.rb new file mode 100644 index 0000000..399ea52 --- /dev/null +++ b/sample/basic/sampleStruct/iSampleStruct.rb @@ -0,0 +1,22 @@ +require 'soap/mapping' + +SampleStructServiceNamespace = 'http://tempuri.org/sampleStructService' + +class SampleStruct; include SOAP::Marshallable + attr_accessor :sampleArray + attr_accessor :date + + def initialize + @sampleArray = SampleArray[ "cyclic", self ] + @date = DateTime.now + end + + def wrap( rhs ) + @sampleArray = SampleArray[ "wrap", rhs.dup ] + @date = DateTime.now + self + end +end + +class SampleArray < Array; include SOAP::Marshallable +end diff --git a/sample/basic/sampleStruct/sampleStruct.rb b/sample/basic/sampleStruct/sampleStruct.rb new file mode 100644 index 0000000..394c1bf --- /dev/null +++ b/sample/basic/sampleStruct/sampleStruct.rb @@ -0,0 +1,13 @@ +require 'iSampleStruct' + +class SampleStructService + def hi(struct) + ack = SampleStruct.new + ack.wrap(struct) + ack + end +end + +if __FILE__ == $0 + p SampleStructService.new.hi(SampleStruct.new) +end diff --git a/sample/basic/sampleStruct/samplehttpd.conf b/sample/basic/sampleStruct/samplehttpd.conf new file mode 100644 index 0000000..85e9995 --- /dev/null +++ b/sample/basic/sampleStruct/samplehttpd.conf @@ -0,0 +1,2 @@ +docroot = . +port = 8808 diff --git a/sample/basic/sampleStruct/server.cgi b/sample/basic/sampleStruct/server.cgi new file mode 100755 index 0000000..494512d --- /dev/null +++ b/sample/basic/sampleStruct/server.cgi @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/cgistub' +require 'sampleStruct' + +class SampleStructServer < SOAP::RPC::CGIStub + def initialize(*arg) + super + servant = SampleStructService.new + add_servant(servant) + end +end + +status = SampleStructServer.new('SampleStructServer', SampleStructServiceNamespace).start diff --git a/sample/basic/sampleStruct/server.rb b/sample/basic/sampleStruct/server.rb new file mode 100644 index 0000000..ea1a2ef --- /dev/null +++ b/sample/basic/sampleStruct/server.rb @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/standaloneServer' +require 'sampleStruct' + +class SampleStructServer < SOAP::RPC::StandaloneServer + def initialize(*arg) + super + servant = SampleStructService.new + add_servant(servant) + end +end + +if $0 == __FILE__ + server = SampleStructServer.new('SampleStructServer', SampleStructServiceNamespace, '0.0.0.0', 7000) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/sample/basic/whois.rb b/sample/basic/whois.rb new file mode 100644 index 0000000..2737e80 --- /dev/null +++ b/sample/basic/whois.rb @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +key = ARGV.shift + +require 'soap/rpc/driver' + +server = 'http://www.SoapClient.com/xml/SQLDataSoap.WSDL' +interface = 'http://www.SoapClient.com/xml/SQLDataSoap.xsd' + +whois = SOAP::RPC::Driver.new(server, interface) +whois.wiredump_dev = STDERR +whois.add_method('ProcessSRL', 'SRLFile', 'RequestName', 'key') + +p whois.ProcessSRL('WHOIS.SRI', 'whois', key) diff --git a/sample/basic/wsdl_helloworld/README b/sample/basic/wsdl_helloworld/README new file mode 100644 index 0000000..5f07eac --- /dev/null +++ b/sample/basic/wsdl_helloworld/README @@ -0,0 +1,15 @@ +The files: +hwsClient.rb +default.rb +defaultDriver.rb + +were generated by applying wsdl2ruby.rb to hws.wsdl + +The hws.wsdl file was written to describe the server +hw_s.rb in the /helloworld/server directory. +Please note that the namespace declaration in hw_s.rb is +the same as the name space delaration in hws.wsdl. You +cannot make the client will generate an error if the namespace +used in the client differs from the namespace in the server. + + diff --git a/sample/basic/wsdl_helloworld/client/default.rb b/sample/basic/wsdl_helloworld/client/default.rb new file mode 100644 index 0000000..f4b03a0 --- /dev/null +++ b/sample/basic/wsdl_helloworld/client/default.rb @@ -0,0 +1 @@ +require 'xsd/qname' diff --git a/sample/basic/wsdl_helloworld/client/defaultDriver.rb b/sample/basic/wsdl_helloworld/client/defaultDriver.rb new file mode 100644 index 0000000..6bf555c --- /dev/null +++ b/sample/basic/wsdl_helloworld/client/defaultDriver.rb @@ -0,0 +1,47 @@ +require 'default.rb' + +require 'soap/rpc/driver' + +class HwsPort < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://localhost:2000/" + MappingRegistry = ::SOAP::Mapping::Registry.new + + Methods = [ + ["hello_world", "hello_world", + [ + [:in, "from", [::SOAP::SOAPString]], + [:retval, "from", [::SOAP::SOAPString]] + ], + "http://localhost:2000/wsdl/hws.wsdl#hello_world", "http://localhost:2000/wsdl/hws.wsdl", :rpc + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = MappingRegistry + init_methods + end + +private + + def init_methods + Methods.each do |name_as, name, params, soapaction, namespace, style| + qname = XSD::QName.new(namespace, name_as) + if style == :document + @proxy.add_document_method(soapaction, name, params) + add_document_method_interface(name, params) + else + @proxy.add_rpc_method(qname, soapaction, name, params) + add_rpc_method_interface(name, params) + end + if name_as != name and name_as.capitalize == name.capitalize + sclass = class << self; self; end + sclass.__send__(:define_method, name_as, proc { |*arg| + __send__(name, *arg) + }) + end + end + end +end + diff --git a/sample/basic/wsdl_helloworld/client/hws.wsdl b/sample/basic/wsdl_helloworld/client/hws.wsdl new file mode 100644 index 0000000..cdf92fb --- /dev/null +++ b/sample/basic/wsdl_helloworld/client/hws.wsdl @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The service simply says hello world from something supplied + + + + + + + \ No newline at end of file diff --git a/sample/basic/wsdl_helloworld/client/hwsClient.rb b/sample/basic/wsdl_helloworld/client/hwsClient.rb new file mode 100755 index 0000000..47c7b84 --- /dev/null +++ b/sample/basic/wsdl_helloworld/client/hwsClient.rb @@ -0,0 +1,22 @@ +#!/usr/bin/env ruby +require 'defaultDriver.rb' + +endpoint_url = ARGV.shift +obj = HwsPort.new(endpoint_url) + +# Uncomment the below line to see SOAP wiredumps. +# obj.wiredump_dev = STDERR + +# SYNOPSIS +# hello_world(from) +# +# ARGS +# from String - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# from String - {http://www.w3.org/2001/XMLSchema}string +# +from = "hwsClient" +puts obj.hello_world(from) + + diff --git a/sample/basic/wsdl_helloworld/server/hw_s.rb b/sample/basic/wsdl_helloworld/server/hw_s.rb new file mode 100755 index 0000000..0875184 --- /dev/null +++ b/sample/basic/wsdl_helloworld/server/hw_s.rb @@ -0,0 +1,25 @@ +require 'soap/rpc/httpserver' +class QueryServer < SOAP::RPC::HTTPServer + def on_init + #@log.level = Logger::Severity::DEBUG + add_method(self, 'hello_world', 'from') + end + + def hello_world(from) + sOut="Hellow world from #{from}" + sOut + end +end + +if $0 == __FILE__ + server = QueryServer.new( + :BindAddress => '0.0.0.0', + :Port => 2000, + :SOAPDefaultNamespace => 'http://localhost:2000/wsdl/hws.wsdl', + :WSDLDocumentDirectory => '.' + ) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/sample/basic/wsdl_helloworld/server/hws.wsdl b/sample/basic/wsdl_helloworld/server/hws.wsdl new file mode 100644 index 0000000..cdf92fb --- /dev/null +++ b/sample/basic/wsdl_helloworld/server/hws.wsdl @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The service simply says hello world from something supplied + + + + + + + \ No newline at end of file diff --git a/sample/basic/yahooNewsSearch.rb b/sample/basic/yahooNewsSearch.rb new file mode 100644 index 0000000..47197ba --- /dev/null +++ b/sample/basic/yahooNewsSearch.rb @@ -0,0 +1,36 @@ +query = ARGV.shift or raise ArgumentError + +require 'soap/marshal' +class MyXMLHandler < SOAP::EncodingStyle::SOAPHandler + Namespace = 'urn:myxmlhandler' + add_handler + def decode_parent(parent, node) + super if parent.node + end +end + +require 'httpclient' +appid = 'soap4r-dev' +url = 'http://api.search.yahoo.com/NewsSearchService/V1/newsSearch' +type = 'all' # any, phrase +results = 3 +language = 'en' +results_sort = 'rank' # date + +param = { + 'appid' => appid, + 'query' => query, + 'results' => results, + 'language' => language, + 'results_sort' => results_sort +} +proxy = ENV['http_proxy'] || ENV['HTTP_PROXY'] +result = HTTPClient.new(proxy).get_content(url, param) + +opt = {:default_encodingstyle => 'urn:myxmlhandler'} +soap = SOAP::Processor.unmarshal(result, opt) + +SOAP::Mapping.soap2obj(soap).result.each do |result| + puts "== " + result.title + " ==" + puts result.summary +end diff --git a/sample/howto/as_xml/client.rb b/sample/howto/as_xml/client.rb new file mode 100644 index 0000000..4a1f482 --- /dev/null +++ b/sample/howto/as_xml/client.rb @@ -0,0 +1,22 @@ +require 'soap/rpc/driver' + +Namespace = 'urn:echo' +drv = SOAP::RPC::Driver.new('http://localhost:7171/', Namespace) +drv.add_document_method('echo', 'echo_soapaction', + XSD::QName.new(Namespace, 'echoRequest'), + XSD::QName.new(Namespace, 'echoResponse')) + +drv.return_response_as_xml = true +drv.wiredump_dev = STDOUT + +require 'rexml/document' +request = REXML::Document.new(<<__XML__) + + + quxx + + +__XML__ + +response = drv.echo(request) +p REXML::XPath.match(REXML::Document.new(response), "//*[name()='n1:foo']") diff --git a/sample/howto/as_xml/server.rb b/sample/howto/as_xml/server.rb new file mode 100644 index 0000000..7324f44 --- /dev/null +++ b/sample/howto/as_xml/server.rb @@ -0,0 +1,22 @@ +require 'soap/rpc/standaloneServer' + +class EchoServer < SOAP::RPC::StandaloneServer + Namespace = 'urn:echo' + def on_init + add_document_method(self, 'echo_soapaction', 'echo', + XSD::QName.new(Namespace, 'echoRequest'), + XSD::QName.new(Namespace, 'echoResponse')) + end + + def echo(var) + var + end +end + +if $0 == __FILE__ + server = EchoServer.new('app', EchoServer::Namespace, '0.0.0.0', 7171) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/sample/howto/base64/client.rb b/sample/howto/base64/client.rb new file mode 100644 index 0000000..2f74ca1 --- /dev/null +++ b/sample/howto/base64/client.rb @@ -0,0 +1,17 @@ +require 'soap/rpc/driver' + +server = ARGV.shift || 'http://localhost:7000/' + +drv = SOAP::RPC::Driver.new(server, 'http://tempuri.org/base64Service') +drv.wiredump_dev = STDERR if $DEBUG + +drv.add_method('echo', 'arg') +drv.add_method('echo_base64', 'arg') + +binary = "\0\0\0" +text = "000" + +drv.echo(binary) # => binary is automatically converted to Base64 + +drv.echo(text) # => send as String +drv.echo_base64(SOAP::SOAPBase64.new(text)) # => send as Base64 explicitly diff --git a/sample/howto/base64/server.rb b/sample/howto/base64/server.rb new file mode 100644 index 0000000..cb7dc96 --- /dev/null +++ b/sample/howto/base64/server.rb @@ -0,0 +1,30 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/standaloneServer' + +class Server < SOAP::RPC::StandaloneServer + def initialize(*arg) + super + add_rpc_method(self, 'echo', 'arg') + add_rpc_method(self, 'echo_base64', 'arg') + end + + def echo(arg) + p arg + arg + end + + def echo_base64(arg) + p arg + SOAP::SOAPBase64.new(arg) + end +end + +if $0 == __FILE__ + server = Server.new('Server', 'http://tempuri.org/base64Service', + '0.0.0.0', 7000) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/sample/howto/custom_ns/client.rb b/sample/howto/custom_ns/client.rb new file mode 100644 index 0000000..5d6dfc8 --- /dev/null +++ b/sample/howto/custom_ns/client.rb @@ -0,0 +1,37 @@ +require 'soap/rpc/driver' +require 'soap/header/simplehandler' + + +class DefaultNSFilter < SOAP::Filter::Handler + def on_outbound(envelope, opt) + opt[:default_ns] = @default_ns + envelope + end + + def initialize + @default_ns = SOAP::NS.new + @default_ns.assign('urn:custom_ns', 'myns') + end +end + + +class MyHeaderHandler < SOAP::Header::SimpleHandler + MyHeaderName = XSD::QName.new('urn:custom_ns', 'myheader') + + def initialize + super(MyHeaderName) + end + + def on_simple_outbound + { "hello" => "world" } + end +end + + +client = SOAP::RPC::Driver.new("http://localhost:7171", "urn:custom_ns") +client.add_method('echo', 'amt') +client.filterchain << DefaultNSFilter.new +client.headerhandler << MyHeaderHandler.new +client.wiredump_dev = STDOUT + +p client.echo(1) diff --git a/sample/howto/custom_ns/server.rb b/sample/howto/custom_ns/server.rb new file mode 100644 index 0000000..7c8b862 --- /dev/null +++ b/sample/howto/custom_ns/server.rb @@ -0,0 +1,42 @@ +require 'soap/rpc/standaloneServer' +require 'soap/filter' + + +class CustomNSTestServer < SOAP::RPC::StandaloneServer + class Servant + def self.create + new + end + + def echo(amt) + amt + end + end + + class DefaultNSFilter < SOAP::Filter::Handler + def on_outbound(envelope, opt) + opt[:default_ns] = @default_ns + envelope + end + + def initialize + @default_ns = SOAP::NS.new + @default_ns.assign('urn:custom_ns', 'myns') + end + end + + def initialize(*arg) + super + add_rpc_servant(Servant.new, "urn:custom_ns") + self.filterchain << DefaultNSFilter.new + end +end + + +if __FILE__ == $0 + server = CustomNSTestServer.new(self.class.name, nil, '0.0.0.0', 7171) + trap("INT") do + server.shutdown + end + server.start +end diff --git a/sample/howto/documentliteral/README.txt b/sample/howto/documentliteral/README.txt new file mode 100644 index 0000000..cfc5200 --- /dev/null +++ b/sample/howto/documentliteral/README.txt @@ -0,0 +1,19 @@ +To use the sample service in this directory; + +1. run ../../../bin/wsdl2ruby.rb: + $ wsdl2ruby.rb --wsdl echo.wsdl --type server --type client --force + +2. replace the file defaultServant.rb with the file servant.rb in this + directory. the file defaultServant.rb is generated by wsdl2ruby.rb in the + previous step. + +3. replace the file echoServiceClient.rb with the file client.rb in this + directory. the file echoServiceClient.rb is generated by wsdl2ruby.rb, too. + +4. run echoService.rb: + $ ruby echoService.rb + + echoService.rb is the server program. hit Ctrl-C to stop the server. + +5. run echoServiceClient.rb in another terminal: + $ ruby echoServiceClient.rb http://localhost:10080 diff --git a/sample/howto/documentliteral/client.rb b/sample/howto/documentliteral/client.rb new file mode 100644 index 0000000..46ff58e --- /dev/null +++ b/sample/howto/documentliteral/client.rb @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby +require 'defaultDriver.rb' + +endpoint_url = ARGV.shift +obj = EchoPortType.new(endpoint_url) +obj.wiredump_dev = STDOUT if $DEBUG + +request = EchoRequest.new +request.xmlattr_sampleAttr = 5 +request.sampleElement = 3.14 +p obj.echo(request) diff --git a/sample/howto/documentliteral/echo.wsdl b/sample/howto/documentliteral/echo.wsdl new file mode 100644 index 0000000..e4da399 --- /dev/null +++ b/sample/howto/documentliteral/echo.wsdl @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/howto/documentliteral/servant.rb b/sample/howto/documentliteral/servant.rb new file mode 100644 index 0000000..bbc3fd3 --- /dev/null +++ b/sample/howto/documentliteral/servant.rb @@ -0,0 +1,11 @@ +require 'default.rb' + +class EchoPortType + def echo(parameters) + response = EchoResponse.new + response << parameters.xmlattr_sampleAttr + response << parameters.sampleElement + response + end +end + diff --git a/sample/howto/filter/client.rb b/sample/howto/filter/client.rb new file mode 100644 index 0000000..e41724d --- /dev/null +++ b/sample/howto/filter/client.rb @@ -0,0 +1,42 @@ +require 'soap/rpc/driver' + + +class ClientFilter1 < SOAP::Filter::Handler + # 1 -> 2 + def on_outbound(envelope, opt) + param = envelope.body.root_node.inparam + param["amt"] = SOAP::SOAPInt.new(param["amt"].data + 1) + param["amt"].elename = XSD::QName.new(nil, 'amt') + envelope + end + + # 31 -> 32 + def on_inbound(xml, opt) + xml = xml.sub(/31/, '32') + xml + end +end + +class ClientFilter2 < SOAP::Filter::Handler + # 2 -> 4 + def on_outbound(envelope, opt) + param = envelope.body.root_node.inparam + param["amt"] = SOAP::SOAPInt.new(param["amt"].data * 2) + param["amt"].elename = XSD::QName.new(nil, 'amt') + envelope + end + + # 30 -> 31 + def on_inbound(xml, opt) + xml = xml.sub(/30/, '31') + xml + end +end + + +client = SOAP::RPC::Driver.new("http://localhost:7171", "urn:filter") +client.add_method('echo', 'amt') +client.filterchain << ClientFilter1.new +client.filterchain << ClientFilter2.new + +p client.echo(1) diff --git a/sample/howto/filter/server.rb b/sample/howto/filter/server.rb new file mode 100644 index 0000000..804515a --- /dev/null +++ b/sample/howto/filter/server.rb @@ -0,0 +1,67 @@ +require 'soap/rpc/standaloneServer' +require 'soap/filter' + + +class FilterTestServer < SOAP::RPC::StandaloneServer + class Servant + def self.create + new + end + + def echo(amt) + amt + end + end + + class ServerFilter1 < SOAP::Filter::Handler + # 15 -> 30 + def on_outbound(envelope, opt) + unless envelope.body.is_fault + node = envelope.body.root_node + node.retval = SOAP::SOAPInt.new(node.retval.data * 2) + node.elename = XSD::QName.new(nil, 'return') + end + envelope + end + + # 4 -> 5 + def on_inbound(xml, opt) + xml = xml.sub(/4/, '5') + xml + end + end + + class ServerFilter2 < SOAP::Filter::Handler + # 5 -> 15 + def on_outbound(envelope, opt) + unless envelope.body.is_fault + node = envelope.body.root_node + node.retval = SOAP::SOAPInt.new(node.retval.data + 10) + node.elename = XSD::QName.new(nil, 'return') + end + envelope + end + + # 5 -> 6 + def on_inbound(xml, opt) + xml = xml.sub(/5/, '6') + xml + end + end + + def initialize(*arg) + super + add_rpc_servant(Servant.new, "urn:filter") + self.filterchain << ServerFilter1.new + self.filterchain << ServerFilter2.new + end +end + + +if __FILE__ == $0 + server = FilterTestServer.new(self.class.name, nil, '0.0.0.0', 7171) + trap("INT") do + server.shutdown + end + server.start +end diff --git a/sample/howto/scopesample/client.rb b/sample/howto/scopesample/client.rb new file mode 100644 index 0000000..009fdf1 --- /dev/null +++ b/sample/howto/scopesample/client.rb @@ -0,0 +1,34 @@ +require 'soap/rpc/driver' + +server = ARGV.shift || 'http://localhost:7000/' +# server = 'http://localhost:8808/server.cgi' + +# client which accesses application scope servant. +app = SOAP::RPC::Driver.new(server, + 'http://tempuri.org/applicationScopeService') +app.add_method('push', 'value') +app.add_method('pop') + +# client which accesses request scope servant must send SOAPAction to identify +# the service. +req = SOAP::RPC::Driver.new(server, + 'http://tempuri.org/requestScopeService') +req.add_method_with_soapaction('push', + 'http://tempuri.org/requestScopeService', 'value') +req.add_method_with_soapaction('pop', + 'http://tempuri.org/requestScopeService') + +# exec +app.push(1) +app.push(2) +app.push(3) +p app.pop +p app.pop +p app.pop + +req.push(1) +req.push(2) +req.push(3) +p req.pop +p req.pop +p req.pop diff --git a/sample/howto/scopesample/httpd.rb b/sample/howto/scopesample/httpd.rb new file mode 100644 index 0000000..5f58c7e --- /dev/null +++ b/sample/howto/scopesample/httpd.rb @@ -0,0 +1,22 @@ +#!/usr/bin/env ruby + +require 'webrick' +require 'soap/property' + +docroot = "." +port = 8808 +if opt = SOAP::Property.loadproperty("samplehttpd.conf") + docroot = opt["docroot"] + port = Integer(opt["port"]) +end + +s = WEBrick::HTTPServer.new( + :BindAddress => "0.0.0.0", + :Port => port, + :DocumentRoot => docroot, + :CGIPathEnv => ENV['PATH'] +) +trap(:INT) do + s.shutdown +end +s.start diff --git a/sample/howto/scopesample/samplehttpd.conf b/sample/howto/scopesample/samplehttpd.conf new file mode 100644 index 0000000..85e9995 --- /dev/null +++ b/sample/howto/scopesample/samplehttpd.conf @@ -0,0 +1,2 @@ +docroot = . +port = 8808 diff --git a/sample/howto/scopesample/servant.rb b/sample/howto/scopesample/servant.rb new file mode 100644 index 0000000..5076050 --- /dev/null +++ b/sample/howto/scopesample/servant.rb @@ -0,0 +1,18 @@ +class Servant + def self.create + new + end + + def initialize + STDERR.puts "Servant created." + @task = [] + end + + def push(value) + @task.push(value) + end + + def pop + @task.pop + end +end diff --git a/sample/howto/scopesample/server.cgi b/sample/howto/scopesample/server.cgi new file mode 100755 index 0000000..ebe13eb --- /dev/null +++ b/sample/howto/scopesample/server.cgi @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/cgistub' +require 'servant' + +class Server < SOAP::RPC::CGIStub + class DummyServant + def push(value) + "Not supported" + end + + def pop + "Not supported" + end + end + + def initialize(*arg) + super + add_rpc_servant(Servant.new, 'http://tempuri.org/requestScopeService') + + # Application scope servant is not supported in CGI environment. + # See server.rb to support application scope servant. + dummy = DummyServant.new + add_method_with_namespace('http://tempuri.org/applicationScopeService', dummy, 'push', 'value') + add_method_with_namespace('http://tempuri.org/applicationScopeService', dummy, 'pop') + end +end + +status = Server.new('Server', nil).start diff --git a/sample/howto/scopesample/server.rb b/sample/howto/scopesample/server.rb new file mode 100644 index 0000000..6b87b74 --- /dev/null +++ b/sample/howto/scopesample/server.rb @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/standaloneServer' +require 'servant' + +class Server < SOAP::RPC::StandaloneServer + def initialize(*arg) + super + add_rpc_servant(Servant.new, 'http://tempuri.org/applicationScopeService') + add_rpc_request_servant(Servant, 'http://tempuri.org/requestScopeService') + end +end + +if $0 == __FILE__ + server = Server.new('Server', nil, '0.0.0.0', 7000) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/sample/howto/styleuse/client.rb b/sample/howto/styleuse/client.rb new file mode 100644 index 0000000..efa329f --- /dev/null +++ b/sample/howto/styleuse/client.rb @@ -0,0 +1,21 @@ +require 'soap/rpc/driver' + +server = 'http://localhost:7000/' + +app = SOAP::RPC::Driver.new(server, 'urn:styleuse') +app.wiredump_dev = STDOUT +app.add_rpc_method('rpc_serv', 'obj1', 'obj2') +app.add_document_method('doc_serv', 'urn:doc_serv#doc_serv', + [XSD::QName.new('urn:styleuse', 'req')], + [XSD::QName.new('urn:styleuse', 'res')]) +app.add_document_method('doc_serv2', 'urn:doc_serv#doc_serv2', + [XSD::QName.new('urn:styleuse', 'req')], + [XSD::QName.new('urn:styleuse', 'res')]) + #app.wiredump_dev = STDOUT + +p app.rpc_serv(true, false) +p app.rpc_serv("foo", "bar") +p app.doc_serv({"a" => "2"}) +p app.doc_serv({"a" => {"b" => "2"}}) +p app.doc_serv2({"a" => "2"}) +p app.doc_serv2({"a" => {"b" => "2", :e => 5}, "c" => "d"}) diff --git a/sample/howto/styleuse/server.rb b/sample/howto/styleuse/server.rb new file mode 100644 index 0000000..6e61c41 --- /dev/null +++ b/sample/howto/styleuse/server.rb @@ -0,0 +1,86 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/standaloneServer' + +class Server < SOAP::RPC::StandaloneServer + class RpcServant + def rpc_serv(obj1, obj2) + [obj1, obj2] + end + end + + class DocumentServant + def doc_serv(hash) + hash + end + + def doc_serv2(hash) + { 'newroot' => hash } + end + end + + class GenericServant + + # method name style: requeststyle_requestuse_responsestyle_responseuse + + def rpc_enc_rpc_enc(obj1, obj2) + [obj1, obj2] + end + + alias rpc_enc_rpc_lit rpc_enc_rpc_enc + + def rpc_enc_doc_enc(obj1, obj2) + obj1 + end + + alias rpc_enc_doc_lit rpc_enc_doc_enc + + def doc_enc_rpc_enc(obj) + [obj, obj] + end + + alias doc_enc_rpc_lit doc_enc_rpc_enc + + def doc_enc_doc_enc(obj) + obj + end + + alias doc_enc_doc_lit doc_enc_doc_enc + end + + def initialize(*arg) + super + rpcservant = RpcServant.new + docservant = DocumentServant.new + add_rpc_servant(rpcservant) + add_document_method(docservant, 'urn:doc_serv#doc_serv', 'doc_serv', + [XSD::QName.new('urn:styleuse', 'req')], + [XSD::QName.new('urn:styleuse', 'res')]) + add_document_method(docservant, 'urn:doc_serv#doc_serv2', 'doc_serv2', + [XSD::QName.new('urn:styleuse', 'req')], + [XSD::QName.new('urn:styleuse', 'res')]) + + #servant = Servant.new + # ToDo: too plain: should add bare test case + #qname ||= XSD::QName.new(@default_namespace, name) + #add_operation(qname, nil, servant, "rpc_enc_rpc_enc", param_def, + # opt(:rpc, :rpc, :encoded, :encoded)) + end + + def opt(request_style, request_use, response_style, response_use) + { + :request_style => request_style, + :request_use => request_use, + :response_style => response_style, + :response_use => response_use + } + end +end + +if $0 == __FILE__ + server = Server.new('Server', 'urn:styleuse', '0.0.0.0', 7000) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/sample/howto/wsdl_fault/README.txt b/sample/howto/wsdl_fault/README.txt new file mode 100644 index 0000000..5592d1f --- /dev/null +++ b/sample/howto/wsdl_fault/README.txt @@ -0,0 +1,11 @@ +These samples are created by Peter Gardfjäl. Thanks! + +1) Generate the stubs + ruby wsdl2ruby.rb --wsdl fault.wsdl --type client --type server --force --quiet +2) Start the server: + ruby AddServer.rb 12345 +3) Run the (add) client: + ruby -d AddClient.rb http://localhost:12345 101 + +The "fault" directory contains a service that raises a fault whenever the added number is greater than 100. +The "multifault" sample behaves the same way, but in addition to the AddFault it also raises a NegativeValueFault if the received value is negative. diff --git a/sample/howto/wsdl_fault/fault/AddClient.rb b/sample/howto/wsdl_fault/fault/AddClient.rb new file mode 100755 index 0000000..3e1b0c0 --- /dev/null +++ b/sample/howto/wsdl_fault/fault/AddClient.rb @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby +require 'AddDriver.rb' + +endpoint_url = ARGV.shift +value = ARGV.shift +if ((endpoint_url == nil) or (value == nil)) then + puts "Usage: ${0} " + exit -1 +end + +obj = AddPortType.new(endpoint_url) +# run ruby with -d to see SOAP wiredumps. +obj.wiredump_dev = STDERR if $DEBUG + + +begin + request = Add.new(value) + response = obj.add(request) + puts "Result: #{response.sum}" +rescue SOAP::FaultError => e + puts "Fault caught! Reason: '#{e.detail.addFault.reason}' Severity: '#{e.detail.addFault.severity}'" +end + + diff --git a/sample/howto/wsdl_fault/fault/AddServer.rb b/sample/howto/wsdl_fault/fault/AddServer.rb new file mode 100755 index 0000000..2d27970 --- /dev/null +++ b/sample/howto/wsdl_fault/fault/AddServer.rb @@ -0,0 +1,15 @@ +require 'AddService.rb' +require 'AddServiceImpl.rb' + +port = ARGV.shift +if (port == nil) then + puts "Usage: ${0} " + exit -1 +end + +server = AddPortTypeApp.new('app', nil, '0.0.0.0', port.to_i) +trap(:INT) do + server.shutdown +end +puts "Starting fault service endpoint" +server.start diff --git a/sample/howto/wsdl_fault/fault/AddServiceImpl.rb b/sample/howto/wsdl_fault/fault/AddServiceImpl.rb new file mode 100644 index 0000000..0df306c --- /dev/null +++ b/sample/howto/wsdl_fault/fault/AddServiceImpl.rb @@ -0,0 +1,18 @@ +require 'AddMappingRegistry.rb' +require 'AddServant.rb' + +class AddPortType + def initialize() + @sum = 0 + end + + def add(request) + if (request.value > 100) + fault = AddFault.new("Value #{request.value} is too large", "Critical") + raise fault + end + @sum += request.value + return AddResponse.new(@sum) + end +end + diff --git a/sample/howto/wsdl_fault/fault/fault.wsdl b/sample/howto/wsdl_fault/fault/fault.wsdl new file mode 100644 index 0000000..b31d3bc --- /dev/null +++ b/sample/howto/wsdl_fault/fault/fault.wsdl @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/howto/wsdl_fault/multifault/AddClient.rb b/sample/howto/wsdl_fault/multifault/AddClient.rb new file mode 100755 index 0000000..5f27701 --- /dev/null +++ b/sample/howto/wsdl_fault/multifault/AddClient.rb @@ -0,0 +1,28 @@ +#!/usr/bin/env ruby +require 'AddDriver.rb' + +endpoint_url = ARGV.shift +value = ARGV.shift +if ((endpoint_url == nil) or (value == nil)) then + puts "Usage: #{$0} " + exit -1 +end + +obj = AddPortType.new(endpoint_url) +# run ruby with -d to see SOAP wiredumps. +obj.wiredump_dev = STDERR if $DEBUG + + +begin + request = Add.new(value) + response = obj.add(request) + puts "Result: #{response.sum}" +rescue SOAP::FaultError => e + if (e.faultstring.to_s == "AddFault") + puts "Fault caught! Reason: '#{e.detail.addFault.reason}' Severity: '#{e.detail.addFault.severity}'" + else + puts "Fault caught! Reason: '#{e.detail.negativeValueFault.reason}' Severity: '#{e.detail.negativeValueFault.severity}'" + end +end + + diff --git a/sample/howto/wsdl_fault/multifault/AddServer.rb b/sample/howto/wsdl_fault/multifault/AddServer.rb new file mode 100755 index 0000000..2d27970 --- /dev/null +++ b/sample/howto/wsdl_fault/multifault/AddServer.rb @@ -0,0 +1,15 @@ +require 'AddService.rb' +require 'AddServiceImpl.rb' + +port = ARGV.shift +if (port == nil) then + puts "Usage: ${0} " + exit -1 +end + +server = AddPortTypeApp.new('app', nil, '0.0.0.0', port.to_i) +trap(:INT) do + server.shutdown +end +puts "Starting fault service endpoint" +server.start diff --git a/sample/howto/wsdl_fault/multifault/AddServiceImpl.rb b/sample/howto/wsdl_fault/multifault/AddServiceImpl.rb new file mode 100644 index 0000000..39c0231 --- /dev/null +++ b/sample/howto/wsdl_fault/multifault/AddServiceImpl.rb @@ -0,0 +1,24 @@ +require 'AddMappingRegistry.rb' +require 'AddServant.rb' + +class AddPortType + def initialize() + @sum = 0 + end + + def add(request) + if (request.value > 100) + fault = AddFault.new("Value #{request.value} is too large", "Critical") + raise fault + end + + if (request.value < 0) + fault = NegativeValueFault.new("Value #{request.value} is negative", "Fatal") + raise fault + end + + @sum += request.value + return AddResponse.new(@sum) + end +end + diff --git a/sample/howto/wsdl_fault/multifault/fault.wsdl b/sample/howto/wsdl_fault/multifault/fault.wsdl new file mode 100644 index 0000000..1b77e20 --- /dev/null +++ b/sample/howto/wsdl_fault/multifault/fault.wsdl @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/howto/wsdl_hash/client.rb b/sample/howto/wsdl_hash/client.rb new file mode 100644 index 0000000..98d3ffa --- /dev/null +++ b/sample/howto/wsdl_hash/client.rb @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby + +require 'soap/wsdlDriver' +wsdl = 'hash.wsdl' +driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver +driver.generate_explicit_type = true + +backup = driver.wsdl_mapping_registry +driver.wsdl_mapping_registry = SOAP::Mapping::DefaultRegistry +p driver.hash({1=>2, 3=>4}) +driver.wsdl_mapping_registry = backup diff --git a/sample/howto/wsdl_hash/hash.wsdl b/sample/howto/wsdl_hash/hash.wsdl new file mode 100644 index 0000000..02044fc --- /dev/null +++ b/sample/howto/wsdl_hash/hash.wsdl @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/howto/wsdl_hash/server.rb b/sample/howto/wsdl_hash/server.rb new file mode 100644 index 0000000..135f912 --- /dev/null +++ b/sample/howto/wsdl_hash/server.rb @@ -0,0 +1,17 @@ +require 'soap/rpc/standaloneServer' + +class Server < SOAP::RPC::StandaloneServer + def on_init + add_method(self, 'hash') + end + + def hash(arg) + arg.update({5=>6, 7=>8}) + end +end + +if $0 == __FILE__ + server = Server.new('svr', 'urn:www.example.org:hashsample', '0.0.0.0', 7171) + trap(:INT) { server.shutdown } + server.start +end diff --git a/sample/marshal/customfactory.rb b/sample/marshal/customfactory.rb new file mode 100644 index 0000000..21a259c --- /dev/null +++ b/sample/marshal/customfactory.rb @@ -0,0 +1,97 @@ +require 'soap/marshal' +include SOAP + +class DummyStruct + include Enumerable + + QName = XSD::QName.new(nil, 'DummyStruct') + + def initialize(hash = nil) + @hash = {} + @hash.update(hash) if hash + end + + def [](key) + @hash[key] + end + + def []=(key, value) + @hash[key] = value + end + + def each + @hash.each do |key, value| + yield(key, value) + end + end +end + +class DummyStructFactory + def obj2soap(soap_class, obj, info, map) + unless obj.is_a?(DummyStruct) + return nil + end + soap_obj = soap_class.new(DummyStruct::QName) + obj.each do |key, value| + soap_obj[key] = SOAPString.new(value.to_s) + end + soap_obj + end + + def soap2obj(obj_class, node, info, map) + unless node.type == DummyStruct::QName + return false + end + obj = obj_class.new + node.each do |key, value| + obj[key] = value.data + end + return true, obj + end +end + +class ExplicitTypedArrayFactory < SOAP::Mapping::Factory + def obj2soap(soap_class, obj, info, map) + unless obj.respond_to?(:arytype) + return nil + end + soap_obj = soap_class.new(ValueArrayName, 1, obj.arytype) + mark_marshalled_obj(obj, soap_obj) + obj.each do |item| + soap_obj.add(Mapping._obj2soap(item, map)) + end + soap_obj + end + + # let default TypedArrayFactory handle that. + def soap2obj(obj_class, node, info, map) + return false + end +end + +map = Mapping::Registry.new +map.set(DummyStruct, SOAPStruct, DummyStructFactory.new) +map.set(Array, SOAPArray, ExplicitTypedArrayFactory.new) + +puts +puts "== DummyStruct ==" +puts + +obj = DummyStruct.new('family' => 'Na', 'given' => 'Hi') +puts marshalledstring = SOAPMarshal.marshal(obj, map) +p SOAPMarshal.unmarshal(marshalledstring, map) + +puts +puts "== Custom array ==" +puts + +obj1 = [1, 2, 3] +obj2 = [4, 5, 6] +def obj1.arytype + XSD::XSDInt::Type +end + +puts marshalledstring = SOAPMarshal.marshal(obj1, map) +p SOAPMarshal.unmarshal(marshalledstring, map) +puts marshalledstring = SOAPMarshal.marshal(obj2, map) +p SOAPMarshal.unmarshal(marshalledstring, map) diff --git a/sample/marshal/customregistry.rb b/sample/marshal/customregistry.rb new file mode 100644 index 0000000..64d43f2 --- /dev/null +++ b/sample/marshal/customregistry.rb @@ -0,0 +1,17 @@ +require 'soap/marshal' + +class IntArray < Array; end + +map = SOAP::Mapping::Registry.new +map.add( + IntArray, SOAP::SOAPArray, SOAP::Mapping::Registry::TypedArrayFactory, + { + :type => XSD::QName.new(XSD::Namespace, XSD::IntLiteral) + } +) + +puts "== dumps anyType array ==" +puts SOAP::Marshal.marshal(IntArray[1, 2, 3]) +puts +puts "== dumps int array with custom registry ==" +puts SOAP::Marshal.marshal(IntArray[1, 2, 3], map) diff --git a/sample/marshal/digraph.rb b/sample/marshal/digraph.rb new file mode 100644 index 0000000..54ff302 --- /dev/null +++ b/sample/marshal/digraph.rb @@ -0,0 +1,43 @@ +require 'soap/marshal' + +class Node; include SOAP::Marshallable + attr_reader :first, :second, :str + + def initialize(*init_next) + @first = init_next[0] + @second = init_next[1] + end +end + +n9 = Node.new +n81 = Node.new(n9) +n82 = Node.new(n9) +n7 = Node.new(n81, n82) +n61 = Node.new(n7) +n62 = Node.new(n7) +n5 = Node.new(n61, n62) +n41 = Node.new(n5) +n42 = Node.new(n5) +n3 = Node.new(n41, n42) +n21 = Node.new(n3) +n22 = Node.new(n3) +n1 = Node.new(n21, n22) + +File.open("digraph_marshalled_string.soap", "wb") do |f| + SOAP::Marshal.dump(n1, f) +end + +marshalledString = File.open("digraph_marshalled_string.soap") { |f| f.read } + +puts marshalledString + +newnode = SOAP::Marshal.unmarshal(marshalledString) + +puts newnode.inspect + +p newnode.first.first.__id__ +p newnode.second.first.__id__ +p newnode.first.first.first.first.__id__ +p newnode.second.first.second.first.__id__ + +File.unlink("digraph_marshalled_string.soap") diff --git a/sample/marshal/enum/README.txt b/sample/marshal/enum/README.txt new file mode 100644 index 0000000..bfc0f2d --- /dev/null +++ b/sample/marshal/enum/README.txt @@ -0,0 +1,6 @@ +enum.xsd ........ original definition +enumsample.rb ... generated class definition + +run xsd2ruby.rb to get enumsample.rb from enum.xsd + +% xsd2ruby.rb --xsd enum.xsd --classdef --mapping_registry --mapper --force diff --git a/sample/marshal/enum/enum.xsd b/sample/marshal/enum/enum.xsd new file mode 100644 index 0000000..fd607ac --- /dev/null +++ b/sample/marshal/enum/enum.xsd @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sample/marshal/enum/enumsample.rb b/sample/marshal/enum/enumsample.rb new file mode 100644 index 0000000..20bbbf2 --- /dev/null +++ b/sample/marshal/enum/enumsample.rb @@ -0,0 +1,20 @@ +require 'xsd/qname' + +# {urn:org.example.enumsample}hobbit.type +class HobbitType + attr_accessor :name + attr_accessor :age + + def initialize(name = nil, age = nil) + @name = name + @age = age + end +end + +# {urn:org.example.enumsample}hobbit.name.type +class HobbitNameType < ::String + Frodo = HobbitNameType.new("frodo") + Meriadoc = HobbitNameType.new("meriadoc") + Peregrin = HobbitNameType.new("peregrin") + Sam = HobbitNameType.new("sam") +end diff --git a/sample/marshal/enum/enumsample_mapper.rb b/sample/marshal/enum/enumsample_mapper.rb new file mode 100644 index 0000000..2e3629b --- /dev/null +++ b/sample/marshal/enum/enumsample_mapper.rb @@ -0,0 +1,7 @@ +require 'enumsample_mapping_registry.rb' + +class EnumsampleMapper < XSD::Mapping::Mapper + def initialize + super(EnumsampleMappingRegistry::Registry) + end +end diff --git a/sample/marshal/enum/enumsample_mapping_registry.rb b/sample/marshal/enum/enumsample_mapping_registry.rb new file mode 100644 index 0000000..c525cc2 --- /dev/null +++ b/sample/marshal/enum/enumsample_mapping_registry.rb @@ -0,0 +1,23 @@ +require 'xsd/mapping' +require 'enumsample.rb' + +module EnumsampleMappingRegistry + Registry = ::SOAP::Mapping::LiteralRegistry.new + + Registry.register( + :class => HobbitType, + :schema_ns => "urn:org.example.enumsample", + :schema_type => "hobbit.type", + :schema_qualified => false, + :schema_element => [ + ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]], + ["age", ["SOAP::SOAPInt", XSD::QName.new(nil, "age")]] + ] + ) + + Registry.register( + :class => HobbitNameType, + :schema_ns => "urn:org.example.enumsample", + :schema_type => "hobbit.name.type" + ) +end diff --git a/sample/marshal/enum/marshal.rb b/sample/marshal/enum/marshal.rb new file mode 100644 index 0000000..4605f18 --- /dev/null +++ b/sample/marshal/enum/marshal.rb @@ -0,0 +1,9 @@ +require 'enumsample_mapper' + +mapper = EnumsampleMapper.new + +t = HobbitType.new(HobbitNameType::Frodo, 51) + +xml = mapper.obj2xml(t) +puts xml +p mapper.xml2obj(xml) diff --git a/sample/payload/basicauth/client.rb b/sample/payload/basicauth/client.rb new file mode 100644 index 0000000..045e461 --- /dev/null +++ b/sample/payload/basicauth/client.rb @@ -0,0 +1,10 @@ +require 'soap/rpc/driver' + +# SOAP client with BasicAuth requires httpclient. +# http://raa.ruby-lang.org/project/httpclient/ +drv = SOAP::RPC::Driver.new('http://localhost:7000/', 'urn:test') +drv.wiredump_dev = STDERR if $DEBUG +drv.options["protocol.http.basic_auth"] << + ['http://localhost:7000/', "admin", "admin"] + +p drv.add_method('echo', 'msg').call('hello') diff --git a/sample/payload/basicauth/htpasswd b/sample/payload/basicauth/htpasswd new file mode 100644 index 0000000..70df50c --- /dev/null +++ b/sample/payload/basicauth/htpasswd @@ -0,0 +1,2 @@ +admin:Qg266hq/YYKe2 +guest:gbPc4vPCH.h12 diff --git a/sample/payload/basicauth/server.rb b/sample/payload/basicauth/server.rb new file mode 100644 index 0000000..e7c25cb --- /dev/null +++ b/sample/payload/basicauth/server.rb @@ -0,0 +1,43 @@ +#!/usr/bin/env ruby + +# SOAP server cannot use WEBrick's httpauth feature for now... +require 'soap/rpc/standaloneServer' + +class Server < SOAP::RPC::StandaloneServer + Namespace = 'urn:test' + + class Servant + @@counter = 0 + + def self.create + new(@@counter += 1) + end + + def initialize(counter) + @counter = counter + end + + def echo(msg) + "echo from servant ##{@counter} (#{SOAP::RPC::SOAPlet.user}): #{msg}" + end + end + + def initialize(*arg) + super + add_rpc_request_servant(Servant) + end + + def on_init + userdb_file = File.join(File.dirname(__FILE__), 'htpasswd') + userdb = WEBrick::HTTPAuth::Htpasswd.new(userdb_file) + self.authenticator = WEBrick::HTTPAuth::BasicAuth.new(:Realm => 'auth', :UserDB => userdb) + end +end + +if $0 == __FILE__ + server = Server.new('tst', Server::Namespace, '0.0.0.0', 7000) + trap(:INT) do + server.shutdown + end + status = server.start +end diff --git a/sample/payload/cookies/calc.rb b/sample/payload/cookies/calc.rb new file mode 100644 index 0000000..ca92cdc --- /dev/null +++ b/sample/payload/cookies/calc.rb @@ -0,0 +1,52 @@ +class CookieCalcService + def initialize + @client_id = 0 + @value = {} + end + + def set(value) + @value[get_client_id] = value + end + + def get + @value[get_client_id] + end + + def +(rhs) + get + rhs + end + + def -(rhs) + get - rhs + end + + def *(rhs) + get * rhs + end + + def /(rhs) + get / rhs + end + +private + + def get_client_id + if cookie = SOAP::RPC::SOAPlet.cookies.find { |cookie| cookie.name == 'client_id' } + cookie.expires = Time.now + 3600 + client_id = cookie.value + else + client_id = assign_new_client_id + cookie = WEBrick::Cookie.new('client_id', client_id) + cookie.expires = Time.now + 3600 + SOAP::RPC::SOAPlet.cookies << cookie + end + p "assined client id: #{client_id}" + client_id + end + + def assign_new_client_id + @client_id += 1 + @client_id.to_s + end + +end diff --git a/sample/payload/cookies/client.rb b/sample/payload/cookies/client.rb new file mode 100644 index 0000000..3c0ec00 --- /dev/null +++ b/sample/payload/cookies/client.rb @@ -0,0 +1,30 @@ +require 'soap/rpc/driver' + +server = ARGV.shift || 'http://localhost:7000/' + +var = SOAP::RPC::Driver.new( server, 'http://tempuri.org/calcService' ) +var.add_method( 'set', 'newValue' ) +var.add_method( 'get' ) +var.add_method_as( '+', 'add', 'rhs' ) +var.add_method_as( '-', 'sub', 'rhs' ) +var.add_method_as( '*', 'multi', 'rhs' ) +var.add_method_as( '/', 'div', 'rhs' ) +var.options['protocol.http.cookie_store_file'] = 'cookie.dat' +var.wiredump_dev = STDOUT if $DEBUG + +puts 'var.set( 1 )' +puts '# Bare in mind that another client set another value to this service.' +puts '# This is only a sample for proof of concept.' +var.set( 1 ) +puts 'var + 2 # => 1 + 2 = 3' +puts var + 2 +puts 'var - 2.2 # => 1 - 2.2 = -1.2' +puts var - 2.2 +puts 'var * 2.2 # => 1 * 2.2 = 2.2' +puts var * 2.2 +puts 'var / 2 # => 1 / 2 = 0' +puts var / 2 +puts 'var / 2.0 # => 1 / 2.0 = 0.5' +puts var / 2.0 +puts 'var / 0 # => 1 / 0 => ZeroDivisionError' +puts var / 0 diff --git a/sample/payload/cookies/filterclient.rb b/sample/payload/cookies/filterclient.rb new file mode 100644 index 0000000..d4da006 --- /dev/null +++ b/sample/payload/cookies/filterclient.rb @@ -0,0 +1,52 @@ +require 'soap/rpc/driver' +require 'soap/filter/streamhandler' + +server = ARGV.shift || 'http://localhost:7000/' + +class CookieFilter < SOAP::Filter::StreamHandler + attr_accessor :cookie_value + + def initialize + @cookie_value = nil + end + + def on_http_outbound(req) + req.header['Cookie'] = @cookie_value if @cookie_value + end + + def on_http_inbound(req, res) + # this sample filter only caputures the first cookie. + cookie = res.header['Set-Cookie'][0] + cookie.sub!(/;.*\z/, '') if cookie + @cookie_value = cookie + # do not save cookie value. + puts "new cookie value: #{@cookie_value}" + end +end + +var = SOAP::RPC::Driver.new( server, 'http://tempuri.org/calcService' ) +var.add_method( 'set', 'newValue' ) +var.add_method( 'get' ) +var.add_method_as( '+', 'add', 'rhs' ) +var.add_method_as( '-', 'sub', 'rhs' ) +var.add_method_as( '*', 'multi', 'rhs' ) +var.add_method_as( '/', 'div', 'rhs' ) +var.streamhandler.filterchain << CookieFilter.new +var.wiredump_dev = STDOUT if $DEBUG + +puts 'var.set( 1 )' +puts '# Bare in mind that another client set another value to this service.' +puts '# This is only a sample for proof of concept.' +var.set( 1 ) +puts 'var + 2 # => 1 + 2 = 3' +puts var + 2 +puts 'var - 2.2 # => 1 - 2.2 = -1.2' +puts var - 2.2 +puts 'var * 2.2 # => 1 * 2.2 = 2.2' +puts var * 2.2 +puts 'var / 2 # => 1 / 2 = 0' +puts var / 2 +puts 'var / 2.0 # => 1 / 2.0 = 0.5' +puts var / 2.0 +puts 'var / 0 # => 1 / 0 => ZeroDivisionError' +puts var / 0 diff --git a/sample/payload/cookies/server.rb b/sample/payload/cookies/server.rb new file mode 100644 index 0000000..be7c231 --- /dev/null +++ b/sample/payload/cookies/server.rb @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/standaloneServer' +require 'calc' + +class CookieCalcServer < SOAP::RPC::StandaloneServer + def on_init + servant = CookieCalcService.new + add_method(servant, 'set', 'newValue') + add_method(servant, 'get') + add_method_as(servant, '+', 'add', 'lhs') + add_method_as(servant, '-', 'sub', 'lhs') + add_method_as(servant, '*', 'multi', 'lhs') + add_method_as(servant, '/', 'div', 'lhs') + end +end + +if $0 == __FILE__ + server = CookieCalcServer.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', 7000) + trap(:INT) do + server.shutdown + end + status = server.start +end diff --git a/sample/payload/gzipped/client.rb b/sample/payload/gzipped/client.rb new file mode 100644 index 0000000..3335b5f --- /dev/null +++ b/sample/payload/gzipped/client.rb @@ -0,0 +1,8 @@ +require 'soap/rpc/driver' + +s = SOAP::RPC::Driver.new('http://localhost:2000/', 'urn:hws') +s.add_method("hello_world", "from") +#s.wiredump_dev = STDOUT # care about binary output. +s.streamhandler.accept_encoding_gzip = true + +p s.hello_world(self.to_s) diff --git a/sample/payload/gzipped/server.rb b/sample/payload/gzipped/server.rb new file mode 100644 index 0000000..d124df0 --- /dev/null +++ b/sample/payload/gzipped/server.rb @@ -0,0 +1,21 @@ +require 'soap/rpc/standaloneServer' + +class HelloWorldServer < SOAP::RPC::StandaloneServer + def on_init + @soaplet.allow_content_encoding_gzip = true + @log.level = Logger::Severity::DEBUG + add_method(self, 'hello_world', 'from') + end + + def hello_world(from) + "Hello World, from #{ from }" + end +end + +if $0 == __FILE__ + server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', 2000) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/sample/payload/ssl/files/README b/sample/payload/ssl/files/README new file mode 100644 index 0000000..927c738 --- /dev/null +++ b/sample/payload/ssl/files/README @@ -0,0 +1 @@ +* certificates and keys in this directory is copied from httpclient test. diff --git a/sample/payload/ssl/files/ca.cert b/sample/payload/ssl/files/ca.cert new file mode 100644 index 0000000..bcabbee --- /dev/null +++ b/sample/payload/ssl/files/ca.cert @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID0DCCArigAwIBAgIBADANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGDAJKUDES +MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxCzAJBgNVBAMMAkNBMB4X +DTA0MDEzMDAwNDIzMloXDTM2MDEyMjAwNDIzMlowPDELMAkGA1UEBgwCSlAxEjAQ +BgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMQswCQYDVQQDDAJDQTCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANbv0x42BTKFEQOE+KJ2XmiSdZpR +wjzQLAkPLRnLB98tlzs4xo+y4RyY/rd5TT9UzBJTIhP8CJi5GbS1oXEerQXB3P0d +L5oSSMwGGyuIzgZe5+vZ1kgzQxMEKMMKlzA73rbMd4Jx3u5+jdbP0EDrPYfXSvLY +bS04n2aX7zrN3x5KdDrNBfwBio2/qeaaj4+9OxnwRvYP3WOvqdW0h329eMfHw0pi +JI0drIVdsEqClUV4pebT/F+CPUPkEh/weySgo9wANockkYu5ujw2GbLFcO5LXxxm +dEfcVr3r6t6zOA4bJwL0W/e6LBcrwiG/qPDFErhwtgTLYf6Er67SzLyA66UCAwEA +AaOB3DCB2TAPBgNVHRMBAf8EBTADAQH/MDEGCWCGSAGG+EIBDQQkFiJSdWJ5L09w +ZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBRJ7Xd380KzBV7f +USKIQ+O/vKbhDzAOBgNVHQ8BAf8EBAMCAQYwZAYDVR0jBF0wW4AUSe13d/NCswVe +31EiiEPjv7ym4Q+hQKQ+MDwxCzAJBgNVBAYMAkpQMRIwEAYDVQQKDAlKSU4uR1Iu +SlAxDDAKBgNVBAsMA1JSUjELMAkGA1UEAwwCQ0GCAQAwDQYJKoZIhvcNAQEFBQAD +ggEBAIu/mfiez5XN5tn2jScgShPgHEFJBR0BTJBZF6xCk0jyqNx/g9HMj2ELCuK+ +r/Y7KFW5c5M3AQ+xWW0ZSc4kvzyTcV7yTVIwj2jZ9ddYMN3nupZFgBK1GB4Y05GY +MJJFRkSu6d/Ph5ypzBVw2YMT/nsOo5VwMUGLgS7YVjU+u/HNWz80J3oO17mNZllj +PvORJcnjwlroDnS58KoJ7GDgejv3ESWADvX1OHLE4cRkiQGeLoEU4pxdCxXRqX0U +PbwIkZN9mXVcrmPHq8MWi4eC/V7hnbZETMHuWhUoiNdOEfsAXr3iP4KjyyRdwc7a +d/xgcK06UVQRL/HbEYGiQL056mc= +-----END CERTIFICATE----- diff --git a/sample/payload/ssl/files/client.cert b/sample/payload/ssl/files/client.cert new file mode 100644 index 0000000..ad13c4b --- /dev/null +++ b/sample/payload/ssl/files/client.cert @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDKDCCAhCgAwIBAgIBAjANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGDAJKUDES +MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxCzAJBgNVBAMMAkNBMB4X +DTA0MDEzMTAzMTQ1OFoXDTM1MDEyMzAzMTQ1OFowZTELMAkGA1UEBgwCSlAxEjAQ +BgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMRAwDgYDVQQDDAdleGFtcGxl +MSIwIAYJKoZIhvcNAQkBDBNleGFtcGxlQGV4YW1wbGUub3JnMIGfMA0GCSqGSIb3 +DQEBAQUAA4GNADCBiQKBgQDRWssrK8Gyr+500hpLjCGR3+AHL8/hEJM5zKi/MgLW +jTkvsgOwbYwXOiNtAbR9y4/ucDq7EY+cMUMHES4uFaPTcOaAV0aZRmk8AgslN1tQ +gNS6ew7/Luq3DcVeWkX8PYgR9VG0mD1MPfJ6+IFA5d3vKpdBkBgN4l46jjO0/2Xf +ewIDAQABo4GPMIGMMAwGA1UdEwEB/wQCMAAwMQYJYIZIAYb4QgENBCQWIlJ1Ynkv +T3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFOFvay0H7lr2 +xUx6waYEV2bVDYQhMAsGA1UdDwQEAwIF4DAdBgNVHSUEFjAUBggrBgEFBQcDAgYI +KwYBBQUHAwQwDQYJKoZIhvcNAQEFBQADggEBABd2dYWqbDIWf5sWFvslezxJv8gI +w64KCJBuyJAiDuf+oazr3016kMzAlt97KecLZDusGNagPrq02UX7YMoQFsWJBans +cDtHrkM0al5r6/WGexNMgtYbNTYzt/IwodISGBgZ6dsOuhznwms+IBsTNDAvWeLP +lt2tOqD8kEmjwMgn0GDRuKjs4EoboA3kMULb1p9akDV9ZESU3eOtpS5/G5J5msLI +9WXbYBjcjvkLuJH9VsJhb+R58Vl0ViemvAHhPilSl1SPWVunGhv6FcIkdBEi1k9F +e8BNMmsEjFiANiIRvpdLRbiGBt0KrKTndVfsmoKCvY48oCOvnzxtahFxfs8= +-----END CERTIFICATE----- diff --git a/sample/payload/ssl/files/client.key b/sample/payload/ssl/files/client.key new file mode 100644 index 0000000..37bc62f --- /dev/null +++ b/sample/payload/ssl/files/client.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICWwIBAAKBgQDRWssrK8Gyr+500hpLjCGR3+AHL8/hEJM5zKi/MgLWjTkvsgOw +bYwXOiNtAbR9y4/ucDq7EY+cMUMHES4uFaPTcOaAV0aZRmk8AgslN1tQgNS6ew7/ +Luq3DcVeWkX8PYgR9VG0mD1MPfJ6+IFA5d3vKpdBkBgN4l46jjO0/2XfewIDAQAB +AoGAZcz8llWErtsV3QB9gNb3S/PNADGjqBFjReva8n3jG2k4sZSibpwWTwUaTNtT +ZQgjSRKRvH1hk9XwffNAvXAQZNNkuj/16gO2oO45nyLj4dO365ujLptWnVIWDHOE +uN0GeiZO+VzcCisT0WCq4tvtLeH8svrxzA8cbXIEyOK7NiECQQDwo2zPFyKAZ/Cu +lDJ6zKT+RjfWwW7DgWzirAlTrt4ViMaW+IaDH29TmQpb4V4NuR3Xi+2Xl4oicu6S +36TW9+/FAkEA3rgfOQJuLlWSnw1RTGwvnC816a/W7iYYY7B+0U4cDbfWl7IoXT4y +M8nV/HESooviZLqBwzAYSoj3fFKYBKpGPwJAUO8GN5iWWA2dW3ooiDiv/X1sZmRk +dojfMFWgRW747tEzya8Ivq0h6kH8w+5GjeMG8Gn1nRiwsulo6Ckj7dEx6QJACyui +7UIQ8qP6GZ4aYMHgVW4Mvy7Bkeo5OO7GPYs0Xv/EdJFL8vlGnVBXOjUVoS9w6Gpu +TbLg1QQvnX2rADjmEwJANxZO2GUkaWGsEif8aGW0x5g/IdaMGG27pTWk5zqix7P3 +1UDrdo/JOXhptovhRi06EppIxAxYmbh9vd9VN8Itlw== +-----END RSA PRIVATE KEY----- diff --git a/sample/payload/ssl/files/server.cert b/sample/payload/ssl/files/server.cert new file mode 100644 index 0000000..998ccc5 --- /dev/null +++ b/sample/payload/ssl/files/server.cert @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIC/zCCAeegAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQGDAJKUDES +MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxDjAMBgNVBAMMBVN1YkNB +MB4XDTA0MDEzMTAzMTMxNloXDTMzMDEyMzAzMTMxNlowQzELMAkGA1UEBgwCSlAx +EjAQBgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMRIwEAYDVQQDDAlsb2Nh +bGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANFJTxWqup3nV9dsJAku +p+WaXnPNIzcpAA3qMGZDJTJsfa8Du7ZxTP0XJK5mETttBrn711cJxAuP3KjqnW9S +vtZ9lY2sXJ6Zj62sN5LwG3VVe25dI28yR1EsbHjJ5Zjf9tmggMC6am52dxuHbt5/ +vHo4ngJuKE/U+eeGRivMn6gFAgMBAAGjgYUwgYIwDAYDVR0TAQH/BAIwADAxBglg +hkgBhvhCAQ0EJBYiUnVieS9PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAd +BgNVHQ4EFgQUpZIyygD9JxFYHHOTEuWOLbCKfckwCwYDVR0PBAQDAgWgMBMGA1Ud +JQQMMAoGCCsGAQUFBwMBMA0GCSqGSIb3DQEBBQUAA4IBAQBwAIj5SaBHaA5X31IP +CFCJiep96awfp7RANO0cuUj+ZpGoFn9d6FXY0g+Eg5wAkCNIzZU5NHN9xsdOpnUo +zIBbyTfQEPrge1CMWMvL6uGaoEXytq84VTitF/xBTky4KtTn6+es4/e7jrrzeUXQ +RC46gkHObmDT91RkOEGjHLyld2328jo3DIN/VTHIryDeVHDWjY5dENwpwdkhhm60 +DR9IrNBbXWEe9emtguNXeN0iu1ux0lG1Hc6pWGQxMlRKNvGh0yZB9u5EVe38tOV0 +jQaoNyL7qzcQoXD3Dmbi1p0iRmg/+HngISsz8K7k7MBNVsSclztwgCzTZOBiVtkM +rRlQ +-----END CERTIFICATE----- diff --git a/sample/payload/ssl/files/server.key b/sample/payload/ssl/files/server.key new file mode 100644 index 0000000..9ba2218 --- /dev/null +++ b/sample/payload/ssl/files/server.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDRSU8Vqrqd51fXbCQJLqflml5zzSM3KQAN6jBmQyUybH2vA7u2 +cUz9FySuZhE7bQa5+9dXCcQLj9yo6p1vUr7WfZWNrFyemY+trDeS8Bt1VXtuXSNv +MkdRLGx4yeWY3/bZoIDAumpudncbh27ef7x6OJ4CbihP1PnnhkYrzJ+oBQIDAQAB +AoGBAIf4CstW2ltQO7+XYGoex7Hh8s9lTSW/G2vu5Hbr1LTHy3fzAvdq8MvVR12O +rk9fa+lU9vhzPc0NMB0GIDZ9GcHuhW5hD1Wg9OSCbTOkZDoH3CAFqonjh4Qfwv5W +IPAFn9KHukdqGXkwEMdErsUaPTy9A1V/aROVEaAY+HJgq/eZAkEA/BP1QMV04WEZ +Oynzz7/lLizJGGxp2AOvEVtqMoycA/Qk+zdKP8ufE0wbmCE3Qd6GoynavsHb6aGK +gQobb8zDZwJBANSK6MrXlrZTtEaeZuyOB4mAmRzGzOUVkUyULUjEx2GDT93ujAma +qm/2d3E+wXAkNSeRpjUmlQXy/2oSqnGvYbMCQQDRM+cYyEcGPUVpWpnj0shrF/QU +9vSot/X1G775EMTyaw6+BtbyNxVgOIu2J+rqGbn3c+b85XqTXOPL0A2RLYkFAkAm +syhSDtE9X55aoWsCNZY/vi+i4rvaFoQ/WleogVQAeGVpdo7/DK9t9YWoFBIqth0L +mGSYFu9ZhvZkvQNV8eYrAkBJ+rOIaLDsmbrgkeDruH+B/9yrm4McDtQ/rgnOGYnH +LjLpLLOrgUxqpzLWe++EwSLwK2//dHO+SPsQJ4xsyQJy +-----END RSA PRIVATE KEY----- diff --git a/sample/payload/ssl/files/sslclient.properties b/sample/payload/ssl/files/sslclient.properties new file mode 100644 index 0000000..547ac7b --- /dev/null +++ b/sample/payload/ssl/files/sslclient.properties @@ -0,0 +1,5 @@ +# verify server's certificate +protocol.http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_PEER +# certificates for verification +protocol.http.ssl_config.ca_file = files/ca.cert +protocol.http.ssl_config.ca_file = files/subca.cert diff --git a/sample/payload/ssl/files/sslclient_require_noserverauth.properties b/sample/payload/ssl/files/sslclient_require_noserverauth.properties new file mode 100644 index 0000000..5ce5337 --- /dev/null +++ b/sample/payload/ssl/files/sslclient_require_noserverauth.properties @@ -0,0 +1,2 @@ +# no verify server's certificate +protocol.http.ssl_config.verify_mode = diff --git a/sample/payload/ssl/files/sslclient_with_clientauth.properties b/sample/payload/ssl/files/sslclient_with_clientauth.properties new file mode 100644 index 0000000..f1c81eb --- /dev/null +++ b/sample/payload/ssl/files/sslclient_with_clientauth.properties @@ -0,0 +1,9 @@ +# verify server's certificate +protocol.http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_PEER +# certificates for verification +protocol.http.ssl_config.ca_file = files/ca.cert +protocol.http.ssl_config.ca_file = files/subca.cert + +# key and certificate for client identity +protocol.http.ssl_config.client_cert = files/client.cert +protocol.http.ssl_config.client_key = files/client.key diff --git a/sample/payload/ssl/files/subca.cert b/sample/payload/ssl/files/subca.cert new file mode 100644 index 0000000..1e47185 --- /dev/null +++ b/sample/payload/ssl/files/subca.cert @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDaDCCAlCgAwIBAgIBATANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGDAJKUDES +MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxCzAJBgNVBAMMAkNBMB4X +DTA0MDEzMDAwNDMyN1oXDTM1MDEyMjAwNDMyN1owPzELMAkGA1UEBgwCSlAxEjAQ +BgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMQ4wDAYDVQQDDAVTdWJDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ0Ou7AyRcRXnB/kVHv/6kwe +ANzgg/DyJfsAUqW90m7Lu1nqyug8gK0RBd77yU0w5HOAMHTVSdpjZK0g2sgx4Mb1 +d/213eL9TTl5MRVEChTvQr8q5DVG/8fxPPE7fMI8eOAzd98/NOAChk+80r4Sx7fC +kGVEE1bKwY1MrUsUNjOY2d6t3M4HHV3HX1V8ShuKfsHxgCmLzdI8U+5CnQedFgkm +3e+8tr8IX5RR1wA1Ifw9VadF7OdI/bGMzog/Q8XCLf+WPFjnK7Gcx6JFtzF6Gi4x +4dp1Xl45JYiVvi9zQ132wu8A1pDHhiNgQviyzbP+UjcB/tsOpzBQF8abYzgEkWEC +AwEAAaNyMHAwDwYDVR0TAQH/BAUwAwEB/zAxBglghkgBhvhCAQ0EJBYiUnVieS9P +cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUlCjXWLsReYzH +LzsxwVnCXmKoB/owCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQCJ/OyN +rT8Cq2Y+G2yA/L1EMRvvxwFBqxavqaqHl/6rwsIBFlB3zbqGA/0oec6MAVnYynq4 +c4AcHTjx3bQ/S4r2sNTZq0DH4SYbQzIobx/YW8PjQUJt8KQdKMcwwi7arHP7A/Ha +LKu8eIC2nsUBnP4NhkYSGhbmpJK+PFD0FVtD0ZIRlY/wsnaZNjWWcnWF1/FNuQ4H +ySjIblqVQkPuzebv3Ror6ZnVDukn96Mg7kP4u6zgxOeqlJGRe1M949SS9Vudjl8X +SF4aZUUB9pQGhsqQJVqaz2OlhGOp9D0q54xko/rekjAIcuDjl1mdX4F2WRrzpUmZ +uY/bPeOBYiVsOYVe +-----END CERTIFICATE----- diff --git a/sample/payload/ssl/sslclient.rb b/sample/payload/ssl/sslclient.rb new file mode 100644 index 0000000..1786b30 --- /dev/null +++ b/sample/payload/ssl/sslclient.rb @@ -0,0 +1,12 @@ +require 'httpclient' +require 'soap/rpc/driver' + +# setup driver +url = "https://localhost:17443/" +client = SOAP::RPC::Driver.new(url, 'urn:sslhelloworld') +client.add_method("hello_world", "from") +# load SSL properties +client.loadproperty('files/sslclient.properties') + +# SOAP over SSL +p client.hello_world(__FILE__) diff --git a/sample/payload/ssl/sslclient_require_noserverauth.rb b/sample/payload/ssl/sslclient_require_noserverauth.rb new file mode 100644 index 0000000..2b24909 --- /dev/null +++ b/sample/payload/ssl/sslclient_require_noserverauth.rb @@ -0,0 +1,12 @@ +require 'httpclient' +require 'soap/rpc/driver' + +# setup driver +url = "https://localhost:17443/" +client = SOAP::RPC::Driver.new(url, 'urn:sslhelloworld') +client.add_method("hello_world", "from") +# load SSL properties +client.loadproperty('files/sslclient_require_noserverauth.properties') + +# SOAP over SSL +p client.hello_world(__FILE__) diff --git a/sample/payload/ssl/sslclient_with_clientauth.rb b/sample/payload/ssl/sslclient_with_clientauth.rb new file mode 100644 index 0000000..2115907 --- /dev/null +++ b/sample/payload/ssl/sslclient_with_clientauth.rb @@ -0,0 +1,12 @@ +require 'httpclient' +require 'soap/rpc/driver' + +# setup driver +url = ARGV.shift || "https://localhost:17443/" +client = SOAP::RPC::Driver.new(url, 'urn:sslhelloworld') +client.add_method("hello_world", "from") +# load SSL properties +client.loadproperty('files/sslclient_with_clientauth.properties') + +# SOAP over SSL +p client.hello_world(__FILE__) diff --git a/sample/payload/ssl/sslserver.rb b/sample/payload/ssl/sslserver.rb new file mode 100644 index 0000000..e65cbac --- /dev/null +++ b/sample/payload/ssl/sslserver.rb @@ -0,0 +1,49 @@ +require 'soap/rpc/httpserver' +require 'webrick/https' +require 'logger' + +class HelloWorldServer < SOAP::RPC::HTTPServer +private + + def on_init + @default_namespace = 'urn:sslhelloworld' + add_method(self, 'hello_world', 'from') + end + + def hello_world(from) + "Hello World, from #{ from }" + end +end + + +if $0 == __FILE__ + DIR = File.dirname(File.expand_path(__FILE__)) + + def cert(filename) + OpenSSL::X509::Certificate.new(File.open(File.join(DIR, filename)) { |f| + f.read + }) + end + + def key(filename) + OpenSSL::PKey::RSA.new(File.open(File.join(DIR, filename)) { |f| + f.read + }) + end + + $server = HelloWorldServer.new( + :BindAddress => "0.0.0.0", + :Port => 17443, + :AccessLog => [], + :SSLEnable => true, + :SSLCACertificateFile => File.join(DIR, 'files/ca.cert'), + :SSLCertificate => cert('files/server.cert'), + :SSLPrivateKey => key('files/server.key'), + :SSLVerifyClient => nil, + :SSLCertName => nil + ) + trap(:INT) do + $server.shutdown + end + $server.start +end diff --git a/sample/payload/ssl/sslserver_noauth.rb b/sample/payload/ssl/sslserver_noauth.rb new file mode 100644 index 0000000..48f5a68 --- /dev/null +++ b/sample/payload/ssl/sslserver_noauth.rb @@ -0,0 +1,45 @@ +require 'soap/rpc/httpserver' +require 'webrick/https' +require 'logger' + +class HelloWorldServer < SOAP::RPC::HTTPServer +private + + def on_init + @default_namespace = 'urn:sslhelloworld' + add_method(self, 'hello_world', 'from') + end + + def hello_world(from) + "Hello World, from #{ from }" + end +end + + +if $0 == __FILE__ + DIR = File.dirname(File.expand_path(__FILE__)) + + def cert(filename) + OpenSSL::X509::Certificate.new(File.open(File.join(DIR, filename)) { |f| + f.read + }) + end + + def key(filename) + OpenSSL::PKey::RSA.new(File.open(File.join(DIR, filename)) { |f| + f.read + }) + end + + $server = HelloWorldServer.new( + :BindAddress => "0.0.0.0", + :Port => 17443, + :AccessLog => [], + :SSLEnable => true, + :SSLCertName => [['OU', 'example'], ['CN', 'localhost']] # creates dummy certificate + ) + trap(:INT) do + $server.shutdown + end + $server.start +end diff --git a/sample/payload/ssl/sslserver_require_clientauth.rb b/sample/payload/ssl/sslserver_require_clientauth.rb new file mode 100644 index 0000000..63caf69 --- /dev/null +++ b/sample/payload/ssl/sslserver_require_clientauth.rb @@ -0,0 +1,50 @@ +require 'soap/rpc/httpserver' +require 'webrick/https' +require 'logger' + +class HelloWorldServer < SOAP::RPC::HTTPServer +private + + def on_init + @default_namespace = 'urn:sslhelloworld' + add_method(self, 'hello_world', 'from') + end + + def hello_world(from) + "Hello World, from #{ from }" + end +end + + +if $0 == __FILE__ + DIR = File.dirname(File.expand_path(__FILE__)) + + def cert(filename) + OpenSSL::X509::Certificate.new(File.open(File.join(DIR, filename)) { |f| + f.read + }) + end + + def key(filename) + OpenSSL::PKey::RSA.new(File.open(File.join(DIR, filename)) { |f| + f.read + }) + end + + $server = HelloWorldServer.new( + :BindAddress => "0.0.0.0", + :Port => 17443, + :AccessLog => [], + :SSLEnable => true, + :SSLCACertificateFile => File.join(DIR, 'files/ca.cert'), + :SSLCertificate => cert('files/server.cert'), + :SSLPrivateKey => key('files/server.key'), + :SSLVerifyClient => + OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT|OpenSSL::SSL::VERIFY_PEER, + :SSLClientCA => cert('files/ca.cert') + ) + trap(:INT) do + $server.shutdown + end + $server.start +end diff --git a/sample/showcase/soap/hippo5tq/hippo5tq.rb b/sample/showcase/soap/hippo5tq/hippo5tq.rb new file mode 100644 index 0000000..68fb29c --- /dev/null +++ b/sample/showcase/soap/hippo5tq/hippo5tq.rb @@ -0,0 +1,41 @@ +#!/usr/bin/env ruby + +require 'soap/driver' + +#Server = 'http://www.hippo2000.net/cgi-bin/soap5tq2.cgi' +Server = 'http://www.hippo2000.net/cgi-bin/soap5tq.cgi' +NS = 'urn:Soap5tq' + +proxy = ARGV.shift || nil + +def getWireDumpLogFile + logFilename = File.basename( $0 ) + '.log' + f = File.open( logFilename, 'w' ) + f << "File: #{ logFilename } - Wiredumps for SOAP4R client / #{ $serverName } server.\n" + f << "Date: #{ Time.now }\n\n" +end + + +drv = SOAP::Driver.new( nil, 'hippo5tq', NS, Server, proxy ) +drv.setWireDumpDev( getWireDumpLogFile ) + +drv.addMethod( 'Init', 'UsrName', 'Passwd' ) + # => [ sSession, sErr ] +drv.addMethod( 'End', 'sSsID' ) + # => void + +drv.addMethod( 'GetQuizAll', 'sSsId' ) + # => [ sQuiz0, sOpt00, sOpt01, sOpt02, sOpt03, sOpt04, + # ... + # sQuiz9, sOpt90, sOpt91, sOpt92, sOpt93, sOpt94 ] +drv.addMethod( 'RepQuizAll', 'sSsID', 'iRes' ) + # => [ iResult, iPoint ] + +drv.addMethod( 'GetQuiz', 'sSsID' ) + # => [ sQuiz, sOpt0, sOpt1, sOpt2, sOpt3, sOpt4 ] +drv.addMethod( 'ReqQuiz', 'sSsID', 'iRes' ) + # => [ iResult, iPoint ] + +sessionId, errInfo = drv.Init( 'SOAP4R', '' ) + +p drv.GetQuizAll( sessionId ) diff --git a/sample/showcase/soap/hippo5tq/hippo5tq2.rb b/sample/showcase/soap/hippo5tq/hippo5tq2.rb new file mode 100644 index 0000000..1fee11f --- /dev/null +++ b/sample/showcase/soap/hippo5tq/hippo5tq2.rb @@ -0,0 +1,99 @@ +#!/usr/bin/env ruby + +$KCODE = 'SJIS' + +proxy = ARGV.shift || nil + +require 'soap/driver' + +# XML Schema Datatypes1999łwi͂ȂȂĂj +require 'soap/XMLSchemaDatatypes1999' + +# Wiredump̏o͐ +def getWireDumpLogFile + logFilename = File.basename( $0 ) + '.log' + f = File.open( logFilename, 'w' ) + f << "File: #{ logFilename } - Wiredumps for SOAP4R client / #{ $serverName } server.\n" + f << "Date: #{ Time.now }\n\n" +end + +# T[rX̓o^i{ȂWSDLׂƂj +Server = 'http://www.hippo2000.net/cgi-bin/soap5tq2.cgi' +NS = 'urn:Soap5tq2' + +drv = SOAP::Driver.new( nil, 'hippo5tq', NS, Server, proxy ) +drv.setWireDumpDev( getWireDumpLogFile ) + +drv.addMethod( 'Init', 'UsrName', 'Passwd' ) + # => [ sSession, sErr ] +drv.addMethod( 'End', 'sSsID' ) + # => void +drv.addMethod( 'GetQuizAll', 'sSsId' ) + # => [ sQuiz0, sOpt00, sOpt01, sOpt02, sOpt03, sOpt04, + # ... + # sQuiz9, sOpt90, sOpt91, sOpt92, sOpt93, sOpt94 ] +drv.addMethod( 'RepQuizAll', 'sSsID', 'iRes' ) + # => [ iResult, iPoint ] +drv.addMethod( 'GetQuiz', 'sSsID' ) + # => [ sQuiz, sOpt0, sOpt1, sOpt2, sOpt3, sOpt4 ] +drv.addMethod( 'ReqQuiz', 'sSsID', 'iRes' ) + # => [ iResult, iPoint ] + + +# NCYT[rXւ̃OC +sessionId, errInfo = drv.Init( 'SOAP4R', '' ) + +totalPoint = 0 + +# fBBB +trap( "INT" ) do | sig | + puts "f܂" + drv.End( sessionId ) + exit( -1 ) +end + +# ŏɈꊇăNCY擾Ă܂ +quizAll = drv.GetQuizAll( sessionId ) + +# ׍H\bhd +def quizAll.next + quiz, opt1, opt2, opt3, opt4, opt5 = self.slice!( 0..5 ) + return quiz, opt1, opt2, opt3, opt4, opt5 +end + +def quizAll.eof? + ( self.length < 6 ) +end + +# NCYJn + +# NCY̎cĂԁBBB +while !quizAll.eof? + quiz, *opt = quizAll.next + + # o + puts '-' * 78 + puts quiz + 1.upto( opt.length ) do | i | + puts "#{ i }: #{ opt[ i-1 ] }" + end + + # + ans = gets.chomp.to_i + + # 񓚂ƍ + result, point = drv.RepQuizAll( sessionId, ans - 1 ) + + # 茋ʂ? + unless result.zero? + puts " _: #{ point }" + totalPoint += point + else + puts "nY" + end +end + +puts "Total: #{ totalPoint }" + +# OIt +drv.End( sessionId ) diff --git a/sample/showcase/soap/hippo5tq/hippoClient.rb b/sample/showcase/soap/hippo5tq/hippoClient.rb new file mode 100644 index 0000000..d69bebc --- /dev/null +++ b/sample/showcase/soap/hippo5tq/hippoClient.rb @@ -0,0 +1,106 @@ +#!/usr/bin/env ruby + +require 'soap/driver' + +server = ARGV.shift or raise ArgumentError.new( 'Target URL was not given.' ) +proxy = ARGV.shift || nil + +require 'soap/XMLSchemaDatatypes1999' + +def getWireDumpLogFile + logFilename = File.basename( $0 ) + '.log' + f = File.open( logFilename, 'w' ) + f << "File: #{ logFilename } - Wiredumps for SOAP4R client / #{ $serverName } server.\n" + f << "Date: #{ Time.now }\n\n" +end + + +=begin +# http://www.hippo2000.net/cgi-bin/soap.cgi + +NS = 'urn:Geometry2' + +drv = SOAP::Driver.new( Log.new( STDERR ), 'hippoApp', NS, server, proxy ) +drv.setWireDumpDev( getWireDumpLogFile ) +drv.addMethod( 'calcArea', 'x1', 'y1', 'x2', 'y2' ) + +puts drv.calcArea( 5, 1000, 10, 20 ) +=end + +=begin +# http://www.hippo2000.net/cgi-bin/soap.pl?class=Geometry + +NS = 'urn:ServerDemo' + +class Point + @@namespace = NS + def initialize( x, y ) + @x = x + @y = y + end +end + +origin = Point.new( 10, 10 ) +corner = Point.new( 110, 110 ) + +drv = SOAP::Driver.new( Log.new( STDERR ), 'hippoApp', NS, server, proxy ) +drv.setWireDumpDev( getWireDumpLogFile ) +drv.addMethod( 'calculateArea', 'origin', 'corner' ) + +puts drv.calculateArea( origin, corner ) +=end + +=begin +# http://www.hippo2000.net/cgi-bin/soapEx.cgi + +NS = 'urn:SoapEx' + +drv = SOAP::Driver.new( Log.new( STDERR ), 'hippoApp', NS, server, proxy ) +drv.setWireDumpDev( getWireDumpLogFile ) +drv.addMethod( 'calcArea', 'x1', 'y1', 'x2', 'y2' ) + +# calcArea sample +p drv.calcArea( 5, 10, 10, 15 ) +=end + + +=begin +# http://www.hippo2000.net/cgi-bin/soapEx.cgi + +NS = 'urn:SoapEx' + +drv = SOAP::Driver.new( Log.new( STDERR ), 'hippoApp', NS, server, proxy ) +drv.setWireDumpDev( getWireDumpLogFile ) +drv.addMethod( 'parseChasen', 'target' ) +drv.addMethod( 'parseChasenArry', 'target' ) + +require 'uconv' + +# ChaSen Sample 1 +def putLine( index, kanaName, pos ) + line = "#{ index }\t\t#{ kanaName }\t\t#{ pos }" + puts Uconv.u8toeuc( line ) +end + +targetString = Uconv.euctou8( 'SOAPȤȳڤǤ?' ) + +result = drv.parseChasen( targetString ) + +index = Uconv.euctou8( 'Ф' ) +kanaName = Uconv.euctou8( 'ɤ' ) +pos = Uconv.euctou8( 'ʻ' ) + +putLine( index, kanaName, pos ) + +result.each do | ele | + putLine( ele[ index ], ele[ kanaName ], ele[ pos ] ) +end + + +# ChaSen Sample 2 +targetString = Uconv.euctou8( 'ڤѤǤ?' ) + +drv.parseChasenArry( targetString ).each do | ele | + puts Uconv.u8toeuc( ele ) +end +=end diff --git a/sample/showcase/soap/icd/IICD.rb b/sample/showcase/soap/icd/IICD.rb new file mode 100644 index 0000000..3b1fa9b --- /dev/null +++ b/sample/showcase/soap/icd/IICD.rb @@ -0,0 +1,17 @@ +module IICD + # All methods in a single namespace?! + InterfaceNS = 'http://www.iwebmethod.net' + + Methods = [ + ['SearchWord', 'query', 'partial'], + ['GetItemById', 'id'], + ['EnumWords'], + ['FullTextSearch', 'query'], + ] + + def IICD.add_method(drv) + Methods.each do |method, *param| + drv.add_method_with_soapaction(method, InterfaceNS + "/#{ method }", *param ) + end + end +end diff --git a/sample/showcase/soap/icd/icd.rb b/sample/showcase/soap/icd/icd.rb new file mode 100644 index 0000000..6e1e51c --- /dev/null +++ b/sample/showcase/soap/icd/icd.rb @@ -0,0 +1,46 @@ +#!/usr/bin/env ruby + +$KCODE = 'SJIS' + +require 'soap/rpc/driver' +require 'IICD'; include IICD + +server = 'http://www.iwebmethod.net/icd1.0/icd.asmx' +wiredump_dev = nil # STDERR + +icd = SOAP::RPC::Driver.new(server, IICD::InterfaceNS) +icd.wiredump_dev = wiredump_dev +icd.default_encodingstyle = SOAP::EncodingStyle::ASPDotNetHandler::Namespace +IICD::add_method(icd) + +puts "L[[h: 'microsoft'Ōo" +result = icd.SearchWord('microsoft', true) + +id = nil +result.WORD.each do |word| + puts "Title: " << word.title + puts "Id: " << word.id + puts "English: " << word.english + puts "Japanese: " << word.japanese + puts "----" + id = word.id +end + +item = icd.GetItemById(id) +puts +puts +puts "Title: " << item.word.title +puts "Ӗ: " << item.meaning + +#p icd.EnumWords + +puts +puts +puts "L[[h: 'IBM'őS" +icd.FullTextSearch("IBM").WORD.each do |word| + puts "Title: " << word.title + puts "Id: " << word.id + puts "English: " << word.english + puts "Japanese: " << word.japanese + puts "----" +end diff --git a/sample/showcase/soap/mssoap/README.txt b/sample/showcase/soap/mssoap/README.txt new file mode 100644 index 0000000..04e2a07 --- /dev/null +++ b/sample/showcase/soap/mssoap/README.txt @@ -0,0 +1,62 @@ +these samples are from an 'anonymous contributor from Wall St'. Thanks! + += MANIFEST = + +stockQuoteService.wsdl ..... A getQuote sample service definition. + +stockQuoteService.rb ....... getQuote sample service which returns random value +stockQuoteService.cgi ...... CGI interface of stockQuoteService + +stockQuoteServicePortTypeDriver.rb ... soap4r client stub for the service +stockQuoteServiceClient.rb ........... soap4r client which uses the stub +client.vba ........................... A VBA sample to access the service +stockQuoteServiceClient.xls .......... An excel client contains the VBA sample + + += How to run = + +1. server setup + + 1. setup CGI enabled Web server such as apache httpd. + + 2. copy following 3 files to cgi-bin directory at the server. + + stockQuoteService.wsdl + stockQuoteService.rb + stockQuoteService.cgi + + 3. configure the URL at the bottom of stockQuoteService.wsdl to point the URL + of the CGI interface. + + ex. http://localhost/cgi-bin/stockQuoteService.cgi + -> http://localhost/~myname/testcgi/stockQuoteService.cgi + + 4. change "#!/usr/bin/env ruby" at the head of the CGI interface to point a + ruby interpreter you have. + + ex. #!/usr/bin/env ruby + -> #!/usr/local/bin/ruby + +2. client usage + + 1. soap4r sample + + run stockQuoteServiceClient.rb with WSDL location. + + ex. $ ruby stockQuoteServiceClient.rb http://localhost/~myname/testcgi/stockQuoteService.cgi + + 2. VBA sample + + open stockQuoteServiceClient.xls with Excel. You need to configure the + accessing URL in VBA macro. + + += FYI = + +These files are generated wsdl2ruby.rb then are modified. + stockQuoteService.rb + stockQuoteService.cgi + stockQuoteServicePortTypeDriver.rb + stockQuoteServiceClient.rb + +$ wsdl2ruby.rb --wsdl stockQuoteService.wsdl --type client --cgi_stub --servant_skelton diff --git a/sample/showcase/soap/mssoap/client.vba b/sample/showcase/soap/mssoap/client.vba new file mode 100644 index 0000000..38b527f --- /dev/null +++ b/sample/showcase/soap/mssoap/client.vba @@ -0,0 +1,19 @@ +Public Function testStockQuoteService(ticker As String) As Variant + On Error GoTo ErrorHandler + + Dim soapClient + Set soapClient = CreateObject("MSSoap.SoapClient") + + soapClient.mssoapinit("http://localhost/cgi-bin/stockQuoteService.cgi?wsdl") + + r = soapClient.getQuote(ticker) + testStockQuoteService = r + +Exit Function + +ErrorHandler: +MsgBox Err.Description + vbCrLf + soapClient.faultactor + vbCrLf + +soapClient.faultcode + vbCrLf + soapClient.faultstring + vbCrLf + +soapClient.detail + +End Function diff --git a/sample/showcase/soap/mssoap/stockQuoteService.cgi b/sample/showcase/soap/mssoap/stockQuoteService.cgi new file mode 100755 index 0000000..b7f5dbf --- /dev/null +++ b/sample/showcase/soap/mssoap/stockQuoteService.cgi @@ -0,0 +1,44 @@ +#!/usr/bin/env ruby +require 'soap/rpc/cgistub' +require 'soap/mapping/registry' +require 'stockQuoteService.rb' + +class StockQuoteServicePortType + MappingRegistry = ::SOAP::Mapping::Registry.new + + Methods = [ + [ XSD::QName.new("urn:xmltoday-delayed-quotes", "getQuote"), + "", + "getQuote", + [ [:in, "arg0", ["::SOAP::SOAPString"]], + [:retval, "getQuoteResult", ["::SOAP::SOAPFloat"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded } + ] + ] +end + +class StockQuoteServicePortTypeApp < ::SOAP::RPC::CGIStub + def initialize(*arg) + super(*arg) + servant = StockQuoteServicePortType.new + StockQuoteServicePortType::Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + @router.add_document_operation(servant, *definitions) + else + @router.add_rpc_operation(servant, *definitions) + end + end + self.mapping_registry = StockQuoteServicePortType::MappingRegistry + self.level = Logger::Severity::ERROR + end +end + + +if ENV['QUERY_STRING'] == 'wsdl' + puts "Content-Type: text/html\r\n\r\n" + puts IO.readlines('~/web/cgi-bin/stockQuoteService.wsdl') +else + StockQuoteServicePortTypeApp.new('app', nil).start +end diff --git a/sample/showcase/soap/mssoap/stockQuoteService.rb b/sample/showcase/soap/mssoap/stockQuoteService.rb new file mode 100644 index 0000000..221dd16 --- /dev/null +++ b/sample/showcase/soap/mssoap/stockQuoteService.rb @@ -0,0 +1,9 @@ +require 'xsd/qname' + +class StockQuoteServicePortType + + def getQuote(ticker) + return 100 + rand * 50.0 + end + +end diff --git a/sample/showcase/soap/mssoap/stockQuoteService.wsdl b/sample/showcase/soap/mssoap/stockQuoteService.wsdl new file mode 100644 index 0000000..80fd259 --- /dev/null +++ b/sample/showcase/soap/mssoap/stockQuoteService.wsdl @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/showcase/soap/mssoap/stockQuoteServiceClient.rb b/sample/showcase/soap/mssoap/stockQuoteServiceClient.rb new file mode 100755 index 0000000..2782f8e --- /dev/null +++ b/sample/showcase/soap/mssoap/stockQuoteServiceClient.rb @@ -0,0 +1,26 @@ +#!/usr/bin/env ruby +require 'stockQuoteServicePortTypeDriver.rb' +require 'net/http' +require 'uri' +require 'yaml' + +endpoint_url = ARGV.shift || 'http://localhost/cgi-bin/stockQuoteService.cgi' + +Net::HTTP.get_print URI.parse("#{endpoint_url}?wsdl") + +obj = StockQuoteServicePortType.new(endpoint_url) + +# run ruby with -d to see SOAP wiredumps. +obj.wiredump_dev = STDERR if $DEBUG + +# SYNOPSIS +# getQuote(arg0) +# +# ARGS +# arg0 String - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# getQuoteResult Float - {http://www.w3.org/2001/XMLSchema}float +# +arg0 = 'LEH' +puts obj.getQuote(arg0) diff --git a/sample/showcase/soap/mssoap/stockQuoteServiceClient.xls b/sample/showcase/soap/mssoap/stockQuoteServiceClient.xls new file mode 100644 index 0000000..7ed60da Binary files /dev/null and b/sample/showcase/soap/mssoap/stockQuoteServiceClient.xls differ diff --git a/sample/showcase/soap/mssoap/stockQuoteServicePortTypeDriver.rb b/sample/showcase/soap/mssoap/stockQuoteServicePortTypeDriver.rb new file mode 100644 index 0000000..1d36baa --- /dev/null +++ b/sample/showcase/soap/mssoap/stockQuoteServicePortTypeDriver.rb @@ -0,0 +1,46 @@ +require 'stockQuote.rb' + +require 'soap/rpc/driver' + +class StockQuoteServicePortType < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://localhost/cgi-bin/stockQuoteService.cgi" + MappingRegistry = ::SOAP::Mapping::Registry.new + + Methods = [ + [ XSD::QName.new("urn:xmltoday-delayed-quotes", "getQuote"), + "", + "getQuote", + [ [:in, "arg0", ["::SOAP::SOAPString"]], + [:retval, "getQuoteResult", ["::SOAP::SOAPFloat"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = MappingRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end diff --git a/sample/showcase/soap/netDicV06/INetDicV06.rb b/sample/showcase/soap/netDicV06/INetDicV06.rb new file mode 100644 index 0000000..27e3ca7 --- /dev/null +++ b/sample/showcase/soap/netDicV06/INetDicV06.rb @@ -0,0 +1,36 @@ +module INetDicV06 + InterfaceNS = 'http://btonic.est.co.jp/NetDic/NetDicV06' + + Methods = [ + ['GetDicList', + [:out, 'DicInfoList'], [:out, 'ErrorMessage'], + [:retval, 'GetDicListResult']], + ['SearchDicItem', + [:in, 'DicID'], [:in, 'QueryString'], [:in, 'ScopeOption'], + [:in, 'MatchOption'], [:in, 'FormatOption'], [:in, 'ResourceOption'], + [:in, 'CharsetOption'], [:in, 'ReqItemIndex'], + [:in, 'ReqItemTitleCount'], [:in, 'ReqItemContentCount']], + ['GetDicItem', + [:in, 'DicID'], [:in, 'ItemID'], [:in, 'FormatOption'], + [:in, 'ResourceOption'], [:in, 'CharsetOption']], + ] + + def INetDicV06.add_method( drv ) + Methods.each do |method, *param| + drv.add_method_with_soapaction(method, InterfaceNS + "/#{ method }", param) + end + end + + class DicInfo + attr_accessor :DicID + attr_accessor :FullName + attr_accessor :ShortName + attr_accessor :Publisher + attr_accessor :Abbrev + attr_accessor :LogoURL + attr_accessor :StartItemID + attr_accessor :SearchOptionList + attr_accessor :DefSearchOptionIndex + end +end + diff --git a/sample/showcase/soap/netDicV06/netDicV06.rb b/sample/showcase/soap/netDicV06/netDicV06.rb new file mode 100644 index 0000000..3fb5722 --- /dev/null +++ b/sample/showcase/soap/netDicV06/netDicV06.rb @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby + +$KCODE = 'SJIS' + +require 'soap/rpc/driver' +require 'INetDicV06'; include INetDicV06 + +server = 'http://btonic.est.co.jp/NetDic/NetDicv06.asmx' +wiredump_dev = STDERR # STDERR + +dic = SOAP::RPC::Driver.new(server, INetDicV06::InterfaceNS) +dic.wiredump_dev = wiredump_dev +dic.default_encodingstyle = ::SOAP::EncodingStyle::ASPDotNetHandler::Namespace +INetDicV06::add_method(dic) + +p dic.GetDicList() diff --git a/sample/showcase/soap/raa/SOAP__Lite.pl b/sample/showcase/soap/raa/SOAP__Lite.pl new file mode 100644 index 0000000..96eda9d --- /dev/null +++ b/sample/showcase/soap/raa/SOAP__Lite.pl @@ -0,0 +1,15 @@ +# RAA SOAP interface client sample; Perl version. +# 2001-03-28T21:00 Kawai,Takanori [GCD00051@nifty.ne.jp] +# +# You need to download and install SOAP::Lite for Perl: http://www.geocities.com/paulclinger/soap.html + +use strict; +use Data::Dumper; +use SOAP::Lite + uri => 'http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.1', + proxy => 'http://raa.ruby-lang.org/soap/1.0/', +; +my $oSom = SOAP::Lite->new->getAllListings(); +my $raRes = $oSom->result; +$raRes = $oSom->fault unless($raRes); +print Dumper($raRes); diff --git a/sample/showcase/soap/raa/pocketSOAP.js b/sample/showcase/soap/raa/pocketSOAP.js new file mode 100644 index 0000000..85833ce --- /dev/null +++ b/sample/showcase/soap/raa/pocketSOAP.js @@ -0,0 +1,33 @@ +/* +# RAA SOAP interface client sample JScript version for Win32 box +# Original by fumiakiy [fumiakiy@ant.co.jp] +# +# You need to download and install pocketSOAP/0.91 or later +# from http://www.pocketsoap.com/ +*/ + +var uri = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.1"; +var endPoint = "http://raa.ruby-lang.org/soap/1.0/"; +var proxySvr = "myProxyServer"; +var proxyPort = 8080; + +var e = WScript.CreateObject("PocketSOAP.Envelope"); + +var methodName = "getAllListings"; +e.methodName = methodName; +e.URI = uri + "#" + methodName; +var x = e.serialize(); + +var t = WScript.CreateObject("PocketSOAP.HTTPTransport"); +t.SetProxy(proxySvr, proxyPort); +t.Send(endPoint, x); +var r = t.Receive(); + +e.Parse(r); + +var ret = ""; +var arrRes = new VBArray(e.Parameters.ItemByName("return").Value); +for (var idx = arrRes.lbound(1); idx < arrRes.ubound(1); idx++) { + ret += idx + " = " + arrRes.getItem(idx) + String.fromCharCode(13, 10); +} +WScript.Echo(ret); diff --git a/sample/showcase/soap/raa2.4/raa.rb b/sample/showcase/soap/raa2.4/raa.rb new file mode 100644 index 0000000..9b4c4e4 --- /dev/null +++ b/sample/showcase/soap/raa2.4/raa.rb @@ -0,0 +1,332 @@ +# http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/ +class Gem + @@schema_type = "Gem" + @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/" + + def id + @id + end + + def id=(value) + @id = value + end + + def category + @category + end + + def category=(value) + @category = value + end + + def owner + @owner + end + + def owner=(value) + @owner = value + end + + def project + @project + end + + def project=(value) + @project = value + end + + def updated + @updated + end + + def updated=(value) + @updated = value + end + + def created + @created + end + + def created=(value) + @created = value + end + + def initialize(id = nil, + category = nil, + owner = nil, + project = nil, + updated = nil, + created = nil) + @id = id + @category = category + @owner = owner + @project = project + @updated = updated + @created = created + end +end + +# http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/ +class Category + @@schema_type = "Category" + @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/" + + def major + @major + end + + def major=(value) + @major = value + end + + def minor + @minor + end + + def minor=(value) + @minor = value + end + + def initialize(major = nil, + minor = nil) + @major = major + @minor = minor + end +end + +# http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/ +class Owner + @@schema_type = "Owner" + @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/" + + def id + @id + end + + def id=(value) + @id = value + end + + def email + @email + end + + def email=(value) + @email = value + end + + def name + @name + end + + def name=(value) + @name = value + end + + def initialize(id = nil, + email = nil, + name = nil) + @id = id + @email = email + @name = name + end +end + +# http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/ +class Project + @@schema_type = "Project" + @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/" + + def name + @name + end + + def name=(value) + @name = value + end + + def short_description + @short_description + end + + def short_description=(value) + @short_description = value + end + + def version + @version + end + + def version=(value) + @version = value + end + + def status + @status + end + + def status=(value) + @status = value + end + + def url + @url + end + + def url=(value) + @url = value + end + + def download + @download + end + + def download=(value) + @download = value + end + + def license + @license + end + + def license=(value) + @license = value + end + + def description + @description + end + + def description=(value) + @description = value + end + + def updated + @updated + end + + def updated=(value) + @updated = value + end + + def history + @history + end + + def history=(value) + @history = value + end + + def dependency + @dependency + end + + def dependency=(value) + @dependency = value + end + + def initialize(name = nil, + short_description = nil, + version = nil, + status = nil, + url = nil, + download = nil, + license = nil, + description = nil, + updated = nil, + history = nil, + dependency = nil) + @name = name + @short_description = short_description + @version = version + @status = status + @url = url + @download = download + @license = license + @description = description + @updated = updated + @history = history + @dependency = dependency + end +end + +# http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/ +class ProjectDependency + @@schema_type = "ProjectDependency" + @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/" + + def project + @project + end + + def project=(value) + @project = value + end + + def version + @version + end + + def version=(value) + @version = value + end + + def description + @description + end + + def description=(value) + @description = value + end + + def initialize(project = nil, + version = nil, + description = nil) + @project = project + @version = version + @description = description + end +end + +# http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/ +class GemArray < Array + # Contents type should be dumped here... + @@schema_type = "GemArray" + @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/" +end + +# http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/ +class OwnerArray < Array + # Contents type should be dumped here... + @@schema_type = "OwnerArray" + @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/" +end + +# http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/ +class ProjectArray < Array + # Contents type should be dumped here... + @@schema_type = "ProjectArray" + @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/" +end + +# http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/ +class ProjectDependencyArray < Array + # Contents type should be dumped here... + @@schema_type = "ProjectDependencyArray" + @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/" +end + +# http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/ +class StringArray < Array + # Contents type should be dumped here... + @@schema_type = "StringArray" + @@schema_ns = "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/" +end + +# http://xml.apache.org/xml-soap +class Map < Array + # Contents type should be dumped here... + @@schema_type = "Map" + @@schema_ns = "http://xml.apache.org/xml-soap" +end + diff --git a/sample/showcase/soap/raa2.4/raa.wsdl b/sample/showcase/soap/raa2.4/raa.wsdl new file mode 100644 index 0000000..71bb161 --- /dev/null +++ b/sample/showcase/soap/raa2.4/raa.wsdl @@ -0,0 +1,644 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/showcase/soap/raa2.4/raaDriver.rb b/sample/showcase/soap/raa2.4/raaDriver.rb new file mode 100644 index 0000000..3c9e84f --- /dev/null +++ b/sample/showcase/soap/raa2.4/raaDriver.rb @@ -0,0 +1,255 @@ +require 'raa.rb' + +require 'soap/rpc/driver' + +class RaaServicePortType < SOAP::RPC::Driver + TargetNamespace = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + MappingRegistry = ::SOAP::Mapping::Registry.new + + MappingRegistry.set( + Gem, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "Gem") } + ) + MappingRegistry.set( + Category, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "Category") } + ) + MappingRegistry.set( + Owner, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "Owner") } + ) + MappingRegistry.set( + Project, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "Project") } + ) + MappingRegistry.set( + ProjectArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "Project") } + ) + MappingRegistry.set( + ProjectDependencyArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "ProjectDependency") } + ) + MappingRegistry.set( + StringArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") } + ) + MappingRegistry.set( + Map, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "anyType") } + ) + MappingRegistry.set( + OwnerArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "Owner") } + ) + MappingRegistry.set( + ProjectDependency, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "ProjectDependency") } + ) + Methods = [ + ["gem", "gem", + [ + [:in, "name", [SOAP::SOAPString]], + [:retval, "return", [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "Gem"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["dependents", "dependents", + [ + [:in, "name", [SOAP::SOAPString]], + [:in, "version", [SOAP::SOAPString]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "ProjectDependency"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["names", "names", + [ + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["size", "size", + [ + [:retval, "return", [SOAP::SOAPInt]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["list_by_category", "list_by_category", + [ + [:in, "major", [SOAP::SOAPString]], + [:in, "minor", [SOAP::SOAPString]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["tree_by_category", "tree_by_category", + [ + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "anyType"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["list_recent_updated", "list_recent_updated", + [ + [:in, "idx", [SOAP::SOAPInt]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["list_recent_created", "list_recent_created", + [ + [:in, "idx", [SOAP::SOAPInt]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["list_updated_since", "list_updated_since", + [ + [:in, "date", [SOAP::SOAPDateTime]], + [:in, "idx", [SOAP::SOAPInt]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["list_created_since", "list_created_since", + [ + [:in, "date", [SOAP::SOAPDateTime]], + [:in, "idx", [SOAP::SOAPInt]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["list_by_owner", "list_by_owner", + [ + [:in, "owner_id", [SOAP::SOAPInt]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["search_name", "search_name", + [ + [:in, "substring", [SOAP::SOAPString]], + [:in, "idx", [SOAP::SOAPInt]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["search_short_description", "search_short_description", + [ + [:in, "substring", [SOAP::SOAPString]], + [:in, "idx", [SOAP::SOAPInt]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["search_owner", "search_owner", + [ + [:in, "substring", [SOAP::SOAPString]], + [:in, "idx", [SOAP::SOAPInt]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["search_version", "search_version", + [ + [:in, "substring", [SOAP::SOAPString]], + [:in, "idx", [SOAP::SOAPInt]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["search_status", "search_status", + [ + [:in, "substring", [SOAP::SOAPString]], + [:in, "idx", [SOAP::SOAPInt]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["search_description", "search_description", + [ + [:in, "substring", [SOAP::SOAPString]], + [:in, "idx", [SOAP::SOAPInt]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "string"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["search", "search", + [ + [:in, "substring", [SOAP::SOAPString]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.w3.org/2001/XMLSchema", "anyType"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["owner", "owner", + [ + [:in, "owner_id", [SOAP::SOAPInt]], + [:retval, "return", [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "Owner"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["list_owner", "list_owner", + [ + [:in, "idx", [SOAP::SOAPInt]], + [:retval, "return", [::SOAP::SOAPArray, "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "Owner"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["update", "update", + [ + [:in, "name", [SOAP::SOAPString]], + [:in, "pass", [SOAP::SOAPString]], + [:in, "gem", [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "Gem"]], + [:retval, "return", [::SOAP::SOAPStruct, "http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/", "Gem"]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ], + ["update_pass", "update_pass", + [ + [:in, "name", [SOAP::SOAPString]], + [:in, "oldpass", [SOAP::SOAPString]], + [:in, "newpass", [SOAP::SOAPString]] + ], + "", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/" + ] + ] + + DefaultEndpointUrl = "http://raa.ruby-lang.org/soapsrv" + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = MappingRegistry + init_methods + end + +private + + def init_methods + Methods.each do |name_as, name, params, soapaction, namespace| + qname = XSD::QName.new(namespace, name_as) + @proxy.add_method(qname, soapaction, name, params) + add_rpc_method_interface(name, params) + end + end +end + diff --git a/sample/showcase/soap/raa2.4/raaServiceClient.rb b/sample/showcase/soap/raa2.4/raaServiceClient.rb new file mode 100644 index 0000000..a59815b --- /dev/null +++ b/sample/showcase/soap/raa2.4/raaServiceClient.rb @@ -0,0 +1,354 @@ +#!/usr/bin/env ruby +require 'raaDriver.rb' + +endpoint_url = ARGV.shift +obj = RaaServicePortType.new(endpoint_url) + +# Uncomment the below line to see SOAP wiredumps. +# obj.wiredump_dev = STDERR + +# SYNOPSIS +# gem(name) +# +# ARGS +# name - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# return Gem - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}Gem +# +# RAISES +# (undefined) +# +name = nil +puts obj.gem(name) + +# SYNOPSIS +# dependents(name, version) +# +# ARGS +# name - {http://www.w3.org/2001/XMLSchema}string +# version - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# return ProjectDependencyArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}ProjectDependencyArray +# +# RAISES +# (undefined) +# +name = version = nil +puts obj.dependents(name, version) + +# SYNOPSIS +# names +# +# ARGS +# N/A +# +# RETURNS +# return StringArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +# +# RAISES +# (undefined) +# + +puts obj.names + +# SYNOPSIS +# size +# +# ARGS +# N/A +# +# RETURNS +# return - {http://www.w3.org/2001/XMLSchema}int +# +# RAISES +# (undefined) +# + +puts obj.size + +# SYNOPSIS +# list_by_category(major, minor) +# +# ARGS +# major - {http://www.w3.org/2001/XMLSchema}string +# minor - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# return StringArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +# +# RAISES +# (undefined) +# +major = minor = nil +puts obj.list_by_category(major, minor) + +# SYNOPSIS +# tree_by_category +# +# ARGS +# N/A +# +# RETURNS +# return Map - {http://xml.apache.org/xml-soap}Map +# +# RAISES +# (undefined) +# + +puts obj.tree_by_category + +# SYNOPSIS +# list_recent_updated(idx) +# +# ARGS +# idx - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# return StringArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +# +# RAISES +# (undefined) +# +idx = nil +puts obj.list_recent_updated(idx) + +# SYNOPSIS +# list_recent_created(idx) +# +# ARGS +# idx - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# return StringArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +# +# RAISES +# (undefined) +# +idx = nil +puts obj.list_recent_created(idx) + +# SYNOPSIS +# list_updated_since(date, idx) +# +# ARGS +# date - {http://www.w3.org/2001/XMLSchema}dateTime +# idx - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# return StringArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +# +# RAISES +# (undefined) +# +date = idx = nil +puts obj.list_updated_since(date, idx) + +# SYNOPSIS +# list_created_since(date, idx) +# +# ARGS +# date - {http://www.w3.org/2001/XMLSchema}dateTime +# idx - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# return StringArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +# +# RAISES +# (undefined) +# +date = idx = nil +puts obj.list_created_since(date, idx) + +# SYNOPSIS +# list_by_owner(owner_id) +# +# ARGS +# owner_id - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# return StringArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +# +# RAISES +# (undefined) +# +owner_id = nil +puts obj.list_by_owner(owner_id) + +# SYNOPSIS +# search_name(substring, idx) +# +# ARGS +# substring - {http://www.w3.org/2001/XMLSchema}string +# idx - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# return StringArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +# +# RAISES +# (undefined) +# +substring = idx = nil +puts obj.search_name(substring, idx) + +# SYNOPSIS +# search_short_description(substring, idx) +# +# ARGS +# substring - {http://www.w3.org/2001/XMLSchema}string +# idx - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# return StringArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +# +# RAISES +# (undefined) +# +substring = idx = nil +puts obj.search_short_description(substring, idx) + +# SYNOPSIS +# search_owner(substring, idx) +# +# ARGS +# substring - {http://www.w3.org/2001/XMLSchema}string +# idx - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# return StringArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +# +# RAISES +# (undefined) +# +substring = idx = nil +puts obj.search_owner(substring, idx) + +# SYNOPSIS +# search_version(substring, idx) +# +# ARGS +# substring - {http://www.w3.org/2001/XMLSchema}string +# idx - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# return StringArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +# +# RAISES +# (undefined) +# +substring = idx = nil +puts obj.search_version(substring, idx) + +# SYNOPSIS +# search_status(substring, idx) +# +# ARGS +# substring - {http://www.w3.org/2001/XMLSchema}string +# idx - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# return StringArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +# +# RAISES +# (undefined) +# +substring = idx = nil +puts obj.search_status(substring, idx) + +# SYNOPSIS +# search_description(substring, idx) +# +# ARGS +# substring - {http://www.w3.org/2001/XMLSchema}string +# idx - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# return StringArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +# +# RAISES +# (undefined) +# +substring = idx = nil +puts obj.search_description(substring, idx) + +# SYNOPSIS +# search(substring) +# +# ARGS +# substring - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# return Map - {http://xml.apache.org/xml-soap}Map +# +# RAISES +# (undefined) +# +substring = nil +puts obj.search(substring) + +# SYNOPSIS +# owner(owner_id) +# +# ARGS +# owner_id - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# return Owner - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}Owner +# +# RAISES +# (undefined) +# +owner_id = nil +puts obj.owner(owner_id) + +# SYNOPSIS +# list_owner(idx) +# +# ARGS +# idx - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# return OwnerArray - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}OwnerArray +# +# RAISES +# (undefined) +# +idx = nil +puts obj.list_owner(idx) + +# SYNOPSIS +# update(name, pass, gem) +# +# ARGS +# name - {http://www.w3.org/2001/XMLSchema}string +# pass - {http://www.w3.org/2001/XMLSchema}string +# gem Gem - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}Gem +# +# RETURNS +# return Gem - {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}Gem +# +# RAISES +# (undefined) +# +name = pass = gem = nil +puts obj.update(name, pass, gem) + +# SYNOPSIS +# update_pass(name, oldpass, newpass) +# +# ARGS +# name - {http://www.w3.org/2001/XMLSchema}string +# oldpass - {http://www.w3.org/2001/XMLSchema}string +# newpass - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# N/A +# +# RAISES +# (undefined) +# +name = oldpass = newpass = nil +puts obj.update_pass(name, oldpass, newpass) + + diff --git a/sample/showcase/soap/raa2.4/sample.rb b/sample/showcase/soap/raa2.4/sample.rb new file mode 100644 index 0000000..e157f83 --- /dev/null +++ b/sample/showcase/soap/raa2.4/sample.rb @@ -0,0 +1,115 @@ +#!/usr/bin/env ruby + +# This is a sample client based on raaServiceClient.rb. +# You can generate raaServiceClient.rb and related files with +# wsdl2ruby.rb --wsdl http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/ --type client + +require 'pp' +require 'raaDriver.rb' + +raa = RaaServicePortType.new +# raa.wiredump_dev = STDERR + +def sec(msg) + puts + puts "--------" + puts "-- " + msg + puts +end + +def subsec(msg) + puts "-- " + msg +end + +sec("retrieve a gem (RAA Information) which has specified name") +name = 'soap4r' +pp raa.gem(name) + +sec("retrieve dependents of the project") +name = 'http-access2'; version = nil +pp raa.dependents(name, version) + +sec("number of registered gems") +puts raa.size + +sec("retrieve all registered gem names") +p raa.names + +sec("retrieve gems of specified category") +major = 'Library'; minor = 'XML' +p raa.list_by_category(major, minor) + +sec("retrieve category tree") +pp raa.tree_by_category + +sec("retrieve gems which is updated recently") +idx = 0 +p raa.list_recent_updated(idx) +subsec("next 10 gems") +idx += 1 +p raa.list_recent_updated(idx) +subsec("next 10 gems") +idx += 1 +p raa.list_recent_updated(idx) + +sec("retrieve gems which is created recently") +p raa.list_recent_created(idx) + +sec("retrieve gems which is updated in 7 days") +date = Time.now - 7 * 24 * 60 * 60; idx = 0 +p raa.list_updated_since(date, idx) + +sec("retrieve gems which is created in 7 days") +p raa.list_created_since(date, idx) + +sec("retrieve gems of specified owner") +owner_id = 8 # NaHi +p raa.list_by_owner(owner_id) + +sec("search gems with keyword") +substring = 'soap' +pp raa.search(substring) + +# There are several search interface to search a field explicitly. +# puts raa.search_name(substring, idx) +# puts raa.search_short_description(substring, idx) +# puts raa.search_owner(substring, idx) +# puts raa.search_version(substring, idx) +# puts raa.search_status(substring, idx) +# puts raa.search_description(substring, idx) + +sec("retrieve owner info") +owner_id = 8 +pp raa.owner(owner_id) + +sec("retrieve owners") +idx = 0 +p raa.list_owner(idx) + +sec("update 'sampleproject'") +name = 'sampleproject' +pass = 'sampleproject' +gem = raa.gem(name) +p gem.project.version +gem.project.version.succ! +gem.updated = Time.now +raa.update(name, pass, gem) +p raa.gem(name).project.version + +sec("update pass phrase") +raa.update_pass(name, 'sampleproject', 'foo') +subsec("update check") +gem = raa.gem(name) +gem.project.description = 'Current pass phrase is "foo"' +gem.updated = Time.now +raa.update(name, 'foo', gem) +# +subsec("recover pass phrase") +raa.update_pass(name, 'foo', 'sampleproject') +subsec("update check") +gem = raa.gem(name) +gem.project.description = 'Current pass phrase is "sampleproject"' +gem.updated = Time.now +raa.update(name, 'sampleproject', gem) + +sec("done") diff --git a/sample/showcase/soap/rwiki/rwikiClient.rb b/sample/showcase/soap/rwiki/rwikiClient.rb new file mode 100644 index 0000000..fb999ed --- /dev/null +++ b/sample/showcase/soap/rwiki/rwikiClient.rb @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/driver' + +server = 'http://www.jin.gr.jp/~nahi/yarpc/soapServer.cgi' +NS = 'http://www.ruby-lang.org/xmlns/soap/interface/RWiki/0.0.1' + +drv = SOAP::RPC::Driver.new(server, NS) +# drv.wiredump_dev = STDERR +drv.add_method('find', 'keyword') +drv.add_method('src', 'name') +drv.add_method('view', 'name', 'env') +drv.add_method('setSrcAndView', 'name', 'src', 'env') + +from = "nahi" +to = "hina" + +env = { 'base' => 'mailto:nahi@keynauts.com' } + +drv.find(from).each do | name | + p name + src = drv.src(name) + src.gsub!(/#{ from }/i, to) +# drv.setSrcAndView(name, src, env) +end + +drv.find(from).each do | name | + puts drv.view(name, env) +end diff --git a/sample/showcase/soap/rwiki/rwikiServer.cgi b/sample/showcase/soap/rwiki/rwikiServer.cgi new file mode 100755 index 0000000..9313e46 --- /dev/null +++ b/sample/showcase/soap/rwiki/rwikiServer.cgi @@ -0,0 +1,44 @@ +#!/usr/bin/env ruby + +$KCODE = 'EUC' +$RWIKI_DIR = 'rwiki' +$RWIKI_URI = 'druby://localhost:8470' + +$:.unshift($RWIKI_DIR) +$:.unshift(File::join($RWIKI_DIR, 'lib')) + +require 'cgi' +require 'drb/drb' +require 'rw-lib' +require 'soap/rpc/cgistub' + +NS = 'http://www.ruby-lang.org/xmlns/soap/interface/RWiki/0.0.1' + +class RWikiSOAPApp < SOAP::RPC::CGIStub + def methodDef + add_method(self, 'find') + add_method(self, 'view') + add_method(self, 'src') + add_method(self, 'setSrcAndView') + end + + def find(keyword) + $rwiki.find(keyword) + end + + def src(name) + $rwiki.src(name) + end + + def view(name, env) + $rwiki.view(name, env) + end + + def setSrcAndView(name, src, env) + $rwiki.set_src_and_view(name, src, env) + end +end + +DRb.start_service() +$rwiki = DRbObject.new(nil, $RWIKI_URI) +RWikiSOAPApp.new("InteropApp", NS).start diff --git a/sample/showcase/soap/soapbox/ContactsDataSet.xml b/sample/showcase/soap/soapbox/ContactsDataSet.xml new file mode 100644 index 0000000..e671d00 --- /dev/null +++ b/sample/showcase/soap/soapbox/ContactsDataSet.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sample/showcase/soap/soapbox/ExceptionDataSet.xml b/sample/showcase/soap/soapbox/ExceptionDataSet.xml new file mode 100644 index 0000000..fb55183 --- /dev/null +++ b/sample/showcase/soap/soapbox/ExceptionDataSet.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sample/showcase/soap/soapbox/MessageDataSet.xml b/sample/showcase/soap/soapbox/MessageDataSet.xml new file mode 100644 index 0000000..f532e29 --- /dev/null +++ b/sample/showcase/soap/soapbox/MessageDataSet.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/sample/showcase/soap/soapbox/SoapBoxWebService.wsdl b/sample/showcase/soap/soapbox/SoapBoxWebService.wsdl new file mode 100644 index 0000000..a281cff --- /dev/null +++ b/sample/showcase/soap/soapbox/SoapBoxWebService.wsdl @@ -0,0 +1,1233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets the values that will be used for your presence when you go idle. The timeout defaults to ten minutes but you can set it using the SetSessionTimeouts method. Idle time is calculated based on the last time you accessed the web service. + + + + + Specifies the timeout in seconds, for AutoAway, AutoBlockMessages and AutoLogout. These default to 600, 10, and 3600 respectively. Each timeout action is performed based on the last time you accessed the web service. + + + + + Closes your session to the Jabber server. Also removes your session on the Web Service server. Your SessionID will no longer be valid. Consider using SessionLogout as it performs PresenceSendUnavailable and SessionClose. + + + + + Authenticates your session with the Jabber server using the provided credentials. Consider using SessionLogin as it performs SessionOpen, SessionAuthenticate, PresenceSendAvailable, and ContactsRequestFromServer with one method call. + + + + + Performs PresenceSendUnavailable and SessionClose. Closes your session to the Jabber server. Removes your session on the Web Service server. Your SessionID will no longer be valid. + + + + + Sends a message of type 'chat' to the specified user with the message text. + + + + + Sends a message of type 'chat' to the specified user with the message text and the payload. The payload must be an element with its own default namespace. + + + + + Sends a message of type 'chat' to the specified user with the message text and a subject. + + + + + Sends a message of type 'chat' to the specified user with the message text, payload, and a subject. The payload must be an element with its own default namespace. + + + + + Dequeues all unread messages from your incoming message queue and returns them to you in a MessageDataSet. Returns messages as a separate DataTable for each user. The name of the DataTable is the Bare JID (JID with no resource) of the user the messages are from. + + + + + Returns a cached copy of the ContactsDataSet populated with all your contacts and their availability. + + + + + Returns any changes to the cached copy of the ContactsDataSet since you last requested it. + + + + + Adds a user to your list of Contacts. Adds the user to your Jabber roster and also subscribes to their presence. + + + + + Removes a user from your list of Contacts. Removes the user from your Jabber roster and also unsubscribes from their presence. + + + + + Updates the specified jid with a new friendlyname and group. You should specify a value for both friendlyname and group. A blank username will be defaulted to the jid and a blank group will be defaulted to Unspecified. + + + + + Announces your presence as available with the specified showValue and longText. Valid values for showValue are: 'dnd', 'xa', 'chat', 'normal', and 'away'. These stand for 'Do Not Disturb', 'Extended Away', 'I Want to Chat', 'Available', and 'Away', respectively. You can specify more detailed messages with longText such as: 'I am in a quick meeting. Be back soon.' + + + + + Announces your presence as available with the specified showValue, longText, and priority. Valid values for showValue are: 'dnd', 'xa', 'chat', 'normal', and 'away'. These stand for 'Do Not Disturb', 'Extended Away', 'I Want to Chat', 'Available', and 'Away', respectively. You can specify more detailed messages with longText such as: 'I am in a quick meeting. Be back soon.' Priority is used by the Jabber server when making message routing decisoins for messages sent to 'username@host' without a resource (username@host/resource). The logged in resource with the highest priority will receive the message. Any resource with a negative priority will never receive any messages. + + + + + Sends your presence to the user of your choice. The presence to send is determined by the last presence broadcast you sent using PresenceSendAvailable or PresenceSendUnavailable. + + + + + Announces your presence as unavailable. This is done automatically when you call SessionLogout. + + + + + Announces your presence as unavailable to the specified user. This allows you to temporarily hide from users you do not wish to know you are online. + + + + + Registers the specified user with the specified Jabber server. This does not return you a SessionID. If the method succeeds and you wish to log in to the server, you must call SessionLogin with your new user's information. + + + + + Registers the specified user with the specified Jabber server on the specified port. It will use SSL to the Jabber server if you set UseSSL to true. This does not return you a SessionID. If the method succeeds and you wish to log in to the server, you must call SessionLogin with your new user's information. + + + + + Registers with a gateway on a Jabber server. This is useful for communicating with outside networks such as AIM, MSN, or Yahoo!. + + + + + Returns an ExceptionDataSet containing all of the exceptions that have occurred in background threads. If no exceptions have occurred, returns an empty ExceptionDataSet. + + + + + Opens your session to the Jabber server. Returns your unique SessionID on the SoapBoxHeader SessionID property. This SessionID must be passed on the header in all subsequent calls. Consider using SessionLogin as it performs SessionOpen, SessionAuthenticate, PresenceSendAvailable, and ContactsRequestFromServer with one method call. + + + + + Performs SessionOpen, SessionAuthenticate, PresenceSendAvailable, and ContactsRequestFromServer with one method call. Returns your unique SessionID on the SoapBoxHeader SessionID property. This SessionID must be passed on the header in all subsequent calls. + + + + + Performs SessionOpen, SessionAuthenticate, PresenceSendAvailable, and ContactsRequestFromServer with one method call. Uses the web service defaults for resource, port number, and SSL. Returns your unique SessionID on the SoapBoxHeader SessionID property. This SessionID must be passed on the header in all subsequent calls. + + + + + Waits for the specified amount of time (in milliseconds) for incoming messages. As soon as an incoming message is received, or the timeout period has elapsed, a MessageDataSet is returned. Returns an emtpy MessageDataSet if the timeout period elapsed. Returns messages as a separate DataTable for each user. The name of the DataTable is the Bare JID (JID with no resource) of the user the messages are from. + + + + + Sends a request to your Jabber server for a copy of your roster. Returns the updated copy of the ContactsDataSet after the server responds with your roster, or the timeout period (in milliseconds) elapses. + + + + + Waits for the specified amount of time (in milliseconds) for any change to the cached ContactsDataSet. As soon as any change is made to the ContactsDataSet -- whether it be a presence update or adding/updating/removing a contact -- or the timout period elapses, you will get a ContactsDataSet in return. This dataset contains only the changes that have occurred. If no changes were made by the time the timeout period is reached, an empty ContactsDataSet is returned. + + + + + Removes the currently logged in user from the Jabber server. + + + + + Removes the currently logged in user from a gateway you had previously registered with. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Enables users to perform standard XMPP/Jabber instant messaging over a web service. This service maintains state for the user based on the SessionID provided in the SOAP Header. + + + + + + diff --git a/sample/showcase/soap/soapbox/SoapBoxWebServiceWithRawXML.wsdl b/sample/showcase/soap/soapbox/SoapBoxWebServiceWithRawXML.wsdl new file mode 100644 index 0000000..a037839 --- /dev/null +++ b/sample/showcase/soap/soapbox/SoapBoxWebServiceWithRawXML.wsdl @@ -0,0 +1,1226 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets the values that will be used for your presence when you go idle. The timeout defaults to ten minutes but you can set it using the SetSessionTimeouts method. Idle time is calculated based on the last time you accessed the web service. + + + + + Specifies the timeout in seconds, for AutoAway, AutoBlockMessages and AutoLogout. These default to 600, 10, and 3600 respectively. Each timeout action is performed based on the last time you accessed the web service. + + + + + Closes your session to the Jabber server. Also removes your session on the Web Service server. Your SessionID will no longer be valid. Consider using SessionLogout as it performs PresenceSendUnavailable and SessionClose. + + + + + Authenticates your session with the Jabber server using the provided credentials. Consider using SessionLogin as it performs SessionOpen, SessionAuthenticate, PresenceSendAvailable, and ContactsRequestFromServer with one method call. + + + + + Performs PresenceSendUnavailable and SessionClose. Closes your session to the Jabber server. Removes your session on the Web Service server. Your SessionID will no longer be valid. + + + + + Sends a message of type 'chat' to the specified user with the message text. + + + + + Sends a message of type 'chat' to the specified user with the message text and the payload. The payload must be an element with its own default namespace. + + + + + Sends a message of type 'chat' to the specified user with the message text and a subject. + + + + + Sends a message of type 'chat' to the specified user with the message text, payload, and a subject. The payload must be an element with its own default namespace. + + + + + Dequeues all unread messages from your incoming message queue and returns them to you in a MessageDataSet. Returns messages as a separate DataTable for each user. The name of the DataTable is the Bare JID (JID with no resource) of the user the messages are from. + + + + + Returns a cached copy of the ContactsDataSet populated with all your contacts and their availability. + + + + + Returns any changes to the cached copy of the ContactsDataSet since you last requested it. + + + + + Adds a user to your list of Contacts. Adds the user to your Jabber roster and also subscribes to their presence. + + + + + Removes a user from your list of Contacts. Removes the user from your Jabber roster and also unsubscribes from their presence. + + + + + Updates the specified jid with a new friendlyname and group. You should specify a value for both friendlyname and group. A blank username will be defaulted to the jid and a blank group will be defaulted to Unspecified. + + + + + Announces your presence as available with the specified showValue and longText. Valid values for showValue are: 'dnd', 'xa', 'chat', 'normal', and 'away'. These stand for 'Do Not Disturb', 'Extended Away', 'I Want to Chat', 'Available', and 'Away', respectively. You can specify more detailed messages with longText such as: 'I am in a quick meeting. Be back soon.' + + + + + Announces your presence as available with the specified showValue, longText, and priority. Valid values for showValue are: 'dnd', 'xa', 'chat', 'normal', and 'away'. These stand for 'Do Not Disturb', 'Extended Away', 'I Want to Chat', 'Available', and 'Away', respectively. You can specify more detailed messages with longText such as: 'I am in a quick meeting. Be back soon.' Priority is used by the Jabber server when making message routing decisoins for messages sent to 'username@host' without a resource (username@host/resource). The logged in resource with the highest priority will receive the message. Any resource with a negative priority will never receive any messages. + + + + + Sends your presence to the user of your choice. The presence to send is determined by the last presence broadcast you sent using PresenceSendAvailable or PresenceSendUnavailable. + + + + + Announces your presence as unavailable. This is done automatically when you call SessionLogout. + + + + + Announces your presence as unavailable to the specified user. This allows you to temporarily hide from users you do not wish to know you are online. + + + + + Registers the specified user with the specified Jabber server. This does not return you a SessionID. If the method succeeds and you wish to log in to the server, you must call SessionLogin with your new user's information. + + + + + Registers the specified user with the specified Jabber server on the specified port. It will use SSL to the Jabber server if you set UseSSL to true. This does not return you a SessionID. If the method succeeds and you wish to log in to the server, you must call SessionLogin with your new user's information. + + + + + Registers with a gateway on a Jabber server. This is useful for communicating with outside networks such as AIM, MSN, or Yahoo!. + + + + + Returns an ExceptionDataSet containing all of the exceptions that have occurred in background threads. If no exceptions have occurred, returns an empty ExceptionDataSet. + + + + + Opens your session to the Jabber server. Returns your unique SessionID on the SoapBoxHeader SessionID property. This SessionID must be passed on the header in all subsequent calls. Consider using SessionLogin as it performs SessionOpen, SessionAuthenticate, PresenceSendAvailable, and ContactsRequestFromServer with one method call. + + + + + Performs SessionOpen, SessionAuthenticate, PresenceSendAvailable, and ContactsRequestFromServer with one method call. Returns your unique SessionID on the SoapBoxHeader SessionID property. This SessionID must be passed on the header in all subsequent calls. + + + + + Performs SessionOpen, SessionAuthenticate, PresenceSendAvailable, and ContactsRequestFromServer with one method call. Uses the web service defaults for resource, port number, and SSL. Returns your unique SessionID on the SoapBoxHeader SessionID property. This SessionID must be passed on the header in all subsequent calls. + + + + + Waits for the specified amount of time (in milliseconds) for incoming messages. As soon as an incoming message is received, or the timeout period has elapsed, a MessageDataSet is returned. Returns an emtpy MessageDataSet if the timeout period elapsed. Returns messages as a separate DataTable for each user. The name of the DataTable is the Bare JID (JID with no resource) of the user the messages are from. + + + + + Sends a request to your Jabber server for a copy of your roster. Returns the updated copy of the ContactsDataSet after the server responds with your roster, or the timeout period (in milliseconds) elapses. + + + + + Waits for the specified amount of time (in milliseconds) for any change to the cached ContactsDataSet. As soon as any change is made to the ContactsDataSet -- whether it be a presence update or adding/updating/removing a contact -- or the timout period elapses, you will get a ContactsDataSet in return. This dataset contains only the changes that have occurred. If no changes were made by the time the timeout period is reached, an empty ContactsDataSet is returned. + + + + + Removes the currently logged in user from the Jabber server. + + + + + Removes the currently logged in user from a gateway you had previously registered with. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Enables users to perform standard XMPP/Jabber instant messaging over a web service. This service maintains state for the user based on the SessionID provided in the SOAP Header. + + + + + \ No newline at end of file diff --git a/sample/showcase/soap/soapbox/wsdlDriver.rb b/sample/showcase/soap/soapbox/wsdlDriver.rb new file mode 100644 index 0000000..f69ab4d --- /dev/null +++ b/sample/showcase/soap/soapbox/wsdlDriver.rb @@ -0,0 +1,23 @@ +require 'soap/wsdlDriver' +include SOAP + +wsdl = ARGV.shift || 'SoapBoxWebServiceWithRawXML.wsdl' +driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver +driver.wiredump_dev = STDOUT + +=begin +userinfo = SOAPElement.new(XSD::QName.new('http://www.winfessor.com/SoapBoxWebService/SoapBoxWebService', 'RegisterUser')) +userinfo.add(SOAPElement.new('username', 'NaHi')) +userinfo.add(SOAPElement.new('passowrd', 'passwd')) +userinfo.add(SOAPElement.new('hostname', 'www.example.com')) + +s = Struct.new(:username, :password, :hostname) +userinfo = s.new('NaHi', 'nahi', 'jabber.example.com') + +s = Struct.new(:username, :password) +userinfo = {:username => 'NaHi', :password => 'nahi'} +driver.RegisterUser(nil, userinfo) +=end + +header = { :SessionID => '12345' } +driver.RegisterRemoveUser(header, nil) diff --git a/sample/showcase/wsdl/PayPalSvc/client.rb b/sample/showcase/wsdl/PayPalSvc/client.rb new file mode 100644 index 0000000..91eb6c2 --- /dev/null +++ b/sample/showcase/wsdl/PayPalSvc/client.rb @@ -0,0 +1,36 @@ +#!/usr/bin/env ruby +require 'defaultDriver.rb' +require 'soap/header/simplehandler' + +class RequesterCredentialsHandler < SOAP::Header::SimpleHandler + HeaderName = XSD::QName.new('urn:ebay:api:PayPalAPI', 'RequesterCredentials') + CredentialsName = + XSD::QName.new('urn:ebay:apis:eBLBaseComponents', 'Credentials') + UsernameName = XSD::QName.new(nil, 'Username') + PasswordName = XSD::QName.new(nil, 'Password') + SubjectName = XSD::QName.new(nil, 'Subject') + + def initialize(username, password, subject) + super(HeaderName) + @username, @password, @subject = username, password, subject + end + + def on_simple_outbound + {CredentialsName => {UsernameName => @username, PasswordName => @password, + SubjectName => @subject}} + end +end + +endpoint_url = ARGV.shift +obj = PayPalAPIAAInterface.new(endpoint_url) +obj.headerhandler << RequesterCredentialsHandler.new('NaHi', 'pass', 'authorizing_account_emailaddress') +obj.wiredump_dev = STDOUT if $DEBUG + +obj.test_loopback_response << File.read("response.xml") +payerInfo = obj.getExpressCheckoutDetails(nil).getExpressCheckoutDetailsResponseDetails.payerInfo +p payerInfo.payerName.firstName +p payerInfo.payerBusiness +exit + +getTransactionDetailsRequest = nil +puts obj.getTransactionDetails(getTransactionDetailsRequest) diff --git a/sample/showcase/wsdl/amazon/AmazonSearch.rb b/sample/showcase/wsdl/amazon/AmazonSearch.rb new file mode 100644 index 0000000..e37d5ff --- /dev/null +++ b/sample/showcase/wsdl/amazon/AmazonSearch.rb @@ -0,0 +1,3160 @@ +require 'xsd/qname' + +# {http://soap.amazon.com}ProductLineArray +class ProductLineArray < ::Array + @@schema_type = "ProductLine" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}ProductLine +class ProductLine + @@schema_type = "ProductLine" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["mode", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Mode")]], ["relevanceRank", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "RelevanceRank")]], ["productInfo", ["ProductInfo", XSD::QName.new("http://soap.amazon.com", "ProductInfo")]]] + + def Mode + @mode + end + + def Mode=(value) + @mode = value + end + + def RelevanceRank + @relevanceRank + end + + def RelevanceRank=(value) + @relevanceRank = value + end + + def ProductInfo + @productInfo + end + + def ProductInfo=(value) + @productInfo = value + end + + def initialize(mode = nil, relevanceRank = nil, productInfo = nil) + @mode = mode + @relevanceRank = relevanceRank + @productInfo = productInfo + end +end + +# {http://soap.amazon.com}ProductInfo +class ProductInfo + @@schema_type = "ProductInfo" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["totalResults", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "TotalResults")]], ["totalPages", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "TotalPages")]], ["listName", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ListName")]], ["details", ["DetailsArray", XSD::QName.new("http://soap.amazon.com", "Details")]]] + + def TotalResults + @totalResults + end + + def TotalResults=(value) + @totalResults = value + end + + def TotalPages + @totalPages + end + + def TotalPages=(value) + @totalPages = value + end + + def ListName + @listName + end + + def ListName=(value) + @listName = value + end + + def Details + @details + end + + def Details=(value) + @details = value + end + + def initialize(totalResults = nil, totalPages = nil, listName = nil, details = nil) + @totalResults = totalResults + @totalPages = totalPages + @listName = listName + @details = details + end +end + +# {http://soap.amazon.com}DetailsArray +class DetailsArray < ::Array + @@schema_type = "Details" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}Details +class Details + @@schema_type = "Details" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["url", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Url")]], ["asin", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Asin")]], ["productName", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ProductName")]], ["catalog", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Catalog")]], ["keyPhrases", ["KeyPhraseArray", XSD::QName.new("http://soap.amazon.com", "KeyPhrases")]], ["artists", ["ArtistArray", XSD::QName.new("http://soap.amazon.com", "Artists")]], ["authors", ["AuthorArray", XSD::QName.new("http://soap.amazon.com", "Authors")]], ["mpn", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Mpn")]], ["starring", ["StarringArray", XSD::QName.new("http://soap.amazon.com", "Starring")]], ["directors", ["DirectorArray", XSD::QName.new("http://soap.amazon.com", "Directors")]], ["theatricalReleaseDate", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "TheatricalReleaseDate")]], ["releaseDate", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ReleaseDate")]], ["manufacturer", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Manufacturer")]], ["distributor", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Distributor")]], ["imageUrlSmall", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ImageUrlSmall")]], ["imageUrlMedium", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ImageUrlMedium")]], ["imageUrlLarge", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ImageUrlLarge")]], ["merchantId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MerchantId")]], ["minPrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MinPrice")]], ["maxPrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MaxPrice")]], ["minSalePrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MinSalePrice")]], ["maxSalePrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MaxSalePrice")]], ["multiMerchant", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MultiMerchant")]], ["merchantSku", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MerchantSku")]], ["listPrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ListPrice")]], ["ourPrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "OurPrice")]], ["usedPrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "UsedPrice")]], ["refurbishedPrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "RefurbishedPrice")]], ["collectiblePrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "CollectiblePrice")]], ["thirdPartyNewPrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ThirdPartyNewPrice")]], ["numberOfOfferings", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "NumberOfOfferings")]], ["thirdPartyNewCount", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ThirdPartyNewCount")]], ["usedCount", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "UsedCount")]], ["collectibleCount", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "CollectibleCount")]], ["refurbishedCount", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "RefurbishedCount")]], ["thirdPartyProductInfo", ["ThirdPartyProductInfo", XSD::QName.new("http://soap.amazon.com", "ThirdPartyProductInfo")]], ["salesRank", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "SalesRank")]], ["browseList", ["BrowseNodeArray", XSD::QName.new("http://soap.amazon.com", "BrowseList")]], ["media", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Media")]], ["readingLevel", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ReadingLevel")]], ["numberOfPages", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "NumberOfPages")]], ["numberOfIssues", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "NumberOfIssues")]], ["issuesPerYear", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "IssuesPerYear")]], ["subscriptionLength", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "SubscriptionLength")]], ["deweyNumber", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "DeweyNumber")]], ["runningTime", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "RunningTime")]], ["publisher", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Publisher")]], ["numMedia", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "NumMedia")]], ["isbn", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Isbn")]], ["features", ["FeaturesArray", XSD::QName.new("http://soap.amazon.com", "Features")]], ["mpaaRating", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MpaaRating")]], ["esrbRating", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "EsrbRating")]], ["ageGroup", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "AgeGroup")]], ["availability", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Availability")]], ["upc", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Upc")]], ["tracks", ["TrackArray", XSD::QName.new("http://soap.amazon.com", "Tracks")]], ["accessories", ["AccessoryArray", XSD::QName.new("http://soap.amazon.com", "Accessories")]], ["platforms", ["PlatformArray", XSD::QName.new("http://soap.amazon.com", "Platforms")]], ["encoding", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Encoding")]], ["productDescription", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ProductDescription")]], ["reviews", ["Reviews", XSD::QName.new("http://soap.amazon.com", "Reviews")]], ["similarProducts", ["SimilarProductsArray", XSD::QName.new("http://soap.amazon.com", "SimilarProducts")]], ["featuredProducts", ["FeaturedProductsArray", XSD::QName.new("http://soap.amazon.com", "FeaturedProducts")]], ["lists", ["ListArray", XSD::QName.new("http://soap.amazon.com", "Lists")]], ["status", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Status")]], ["variations", ["VariationArray", XSD::QName.new("http://soap.amazon.com", "Variations")]]] + + def Url + @url + end + + def Url=(value) + @url = value + end + + def Asin + @asin + end + + def Asin=(value) + @asin = value + end + + def ProductName + @productName + end + + def ProductName=(value) + @productName = value + end + + def Catalog + @catalog + end + + def Catalog=(value) + @catalog = value + end + + def KeyPhrases + @keyPhrases + end + + def KeyPhrases=(value) + @keyPhrases = value + end + + def Artists + @artists + end + + def Artists=(value) + @artists = value + end + + def Authors + @authors + end + + def Authors=(value) + @authors = value + end + + def Mpn + @mpn + end + + def Mpn=(value) + @mpn = value + end + + def Starring + @starring + end + + def Starring=(value) + @starring = value + end + + def Directors + @directors + end + + def Directors=(value) + @directors = value + end + + def TheatricalReleaseDate + @theatricalReleaseDate + end + + def TheatricalReleaseDate=(value) + @theatricalReleaseDate = value + end + + def ReleaseDate + @releaseDate + end + + def ReleaseDate=(value) + @releaseDate = value + end + + def Manufacturer + @manufacturer + end + + def Manufacturer=(value) + @manufacturer = value + end + + def Distributor + @distributor + end + + def Distributor=(value) + @distributor = value + end + + def ImageUrlSmall + @imageUrlSmall + end + + def ImageUrlSmall=(value) + @imageUrlSmall = value + end + + def ImageUrlMedium + @imageUrlMedium + end + + def ImageUrlMedium=(value) + @imageUrlMedium = value + end + + def ImageUrlLarge + @imageUrlLarge + end + + def ImageUrlLarge=(value) + @imageUrlLarge = value + end + + def MerchantId + @merchantId + end + + def MerchantId=(value) + @merchantId = value + end + + def MinPrice + @minPrice + end + + def MinPrice=(value) + @minPrice = value + end + + def MaxPrice + @maxPrice + end + + def MaxPrice=(value) + @maxPrice = value + end + + def MinSalePrice + @minSalePrice + end + + def MinSalePrice=(value) + @minSalePrice = value + end + + def MaxSalePrice + @maxSalePrice + end + + def MaxSalePrice=(value) + @maxSalePrice = value + end + + def MultiMerchant + @multiMerchant + end + + def MultiMerchant=(value) + @multiMerchant = value + end + + def MerchantSku + @merchantSku + end + + def MerchantSku=(value) + @merchantSku = value + end + + def ListPrice + @listPrice + end + + def ListPrice=(value) + @listPrice = value + end + + def OurPrice + @ourPrice + end + + def OurPrice=(value) + @ourPrice = value + end + + def UsedPrice + @usedPrice + end + + def UsedPrice=(value) + @usedPrice = value + end + + def RefurbishedPrice + @refurbishedPrice + end + + def RefurbishedPrice=(value) + @refurbishedPrice = value + end + + def CollectiblePrice + @collectiblePrice + end + + def CollectiblePrice=(value) + @collectiblePrice = value + end + + def ThirdPartyNewPrice + @thirdPartyNewPrice + end + + def ThirdPartyNewPrice=(value) + @thirdPartyNewPrice = value + end + + def NumberOfOfferings + @numberOfOfferings + end + + def NumberOfOfferings=(value) + @numberOfOfferings = value + end + + def ThirdPartyNewCount + @thirdPartyNewCount + end + + def ThirdPartyNewCount=(value) + @thirdPartyNewCount = value + end + + def UsedCount + @usedCount + end + + def UsedCount=(value) + @usedCount = value + end + + def CollectibleCount + @collectibleCount + end + + def CollectibleCount=(value) + @collectibleCount = value + end + + def RefurbishedCount + @refurbishedCount + end + + def RefurbishedCount=(value) + @refurbishedCount = value + end + + def ThirdPartyProductInfo + @thirdPartyProductInfo + end + + def ThirdPartyProductInfo=(value) + @thirdPartyProductInfo = value + end + + def SalesRank + @salesRank + end + + def SalesRank=(value) + @salesRank = value + end + + def BrowseList + @browseList + end + + def BrowseList=(value) + @browseList = value + end + + def Media + @media + end + + def Media=(value) + @media = value + end + + def ReadingLevel + @readingLevel + end + + def ReadingLevel=(value) + @readingLevel = value + end + + def NumberOfPages + @numberOfPages + end + + def NumberOfPages=(value) + @numberOfPages = value + end + + def NumberOfIssues + @numberOfIssues + end + + def NumberOfIssues=(value) + @numberOfIssues = value + end + + def IssuesPerYear + @issuesPerYear + end + + def IssuesPerYear=(value) + @issuesPerYear = value + end + + def SubscriptionLength + @subscriptionLength + end + + def SubscriptionLength=(value) + @subscriptionLength = value + end + + def DeweyNumber + @deweyNumber + end + + def DeweyNumber=(value) + @deweyNumber = value + end + + def RunningTime + @runningTime + end + + def RunningTime=(value) + @runningTime = value + end + + def Publisher + @publisher + end + + def Publisher=(value) + @publisher = value + end + + def NumMedia + @numMedia + end + + def NumMedia=(value) + @numMedia = value + end + + def Isbn + @isbn + end + + def Isbn=(value) + @isbn = value + end + + def Features + @features + end + + def Features=(value) + @features = value + end + + def MpaaRating + @mpaaRating + end + + def MpaaRating=(value) + @mpaaRating = value + end + + def EsrbRating + @esrbRating + end + + def EsrbRating=(value) + @esrbRating = value + end + + def AgeGroup + @ageGroup + end + + def AgeGroup=(value) + @ageGroup = value + end + + def Availability + @availability + end + + def Availability=(value) + @availability = value + end + + def Upc + @upc + end + + def Upc=(value) + @upc = value + end + + def Tracks + @tracks + end + + def Tracks=(value) + @tracks = value + end + + def Accessories + @accessories + end + + def Accessories=(value) + @accessories = value + end + + def Platforms + @platforms + end + + def Platforms=(value) + @platforms = value + end + + def Encoding + @encoding + end + + def Encoding=(value) + @encoding = value + end + + def ProductDescription + @productDescription + end + + def ProductDescription=(value) + @productDescription = value + end + + def Reviews + @reviews + end + + def Reviews=(value) + @reviews = value + end + + def SimilarProducts + @similarProducts + end + + def SimilarProducts=(value) + @similarProducts = value + end + + def FeaturedProducts + @featuredProducts + end + + def FeaturedProducts=(value) + @featuredProducts = value + end + + def Lists + @lists + end + + def Lists=(value) + @lists = value + end + + def Status + @status + end + + def Status=(value) + @status = value + end + + def Variations + @variations + end + + def Variations=(value) + @variations = value + end + + def initialize(url = nil, asin = nil, productName = nil, catalog = nil, keyPhrases = nil, artists = nil, authors = nil, mpn = nil, starring = nil, directors = nil, theatricalReleaseDate = nil, releaseDate = nil, manufacturer = nil, distributor = nil, imageUrlSmall = nil, imageUrlMedium = nil, imageUrlLarge = nil, merchantId = nil, minPrice = nil, maxPrice = nil, minSalePrice = nil, maxSalePrice = nil, multiMerchant = nil, merchantSku = nil, listPrice = nil, ourPrice = nil, usedPrice = nil, refurbishedPrice = nil, collectiblePrice = nil, thirdPartyNewPrice = nil, numberOfOfferings = nil, thirdPartyNewCount = nil, usedCount = nil, collectibleCount = nil, refurbishedCount = nil, thirdPartyProductInfo = nil, salesRank = nil, browseList = nil, media = nil, readingLevel = nil, numberOfPages = nil, numberOfIssues = nil, issuesPerYear = nil, subscriptionLength = nil, deweyNumber = nil, runningTime = nil, publisher = nil, numMedia = nil, isbn = nil, features = nil, mpaaRating = nil, esrbRating = nil, ageGroup = nil, availability = nil, upc = nil, tracks = nil, accessories = nil, platforms = nil, encoding = nil, productDescription = nil, reviews = nil, similarProducts = nil, featuredProducts = nil, lists = nil, status = nil, variations = nil) + @url = url + @asin = asin + @productName = productName + @catalog = catalog + @keyPhrases = keyPhrases + @artists = artists + @authors = authors + @mpn = mpn + @starring = starring + @directors = directors + @theatricalReleaseDate = theatricalReleaseDate + @releaseDate = releaseDate + @manufacturer = manufacturer + @distributor = distributor + @imageUrlSmall = imageUrlSmall + @imageUrlMedium = imageUrlMedium + @imageUrlLarge = imageUrlLarge + @merchantId = merchantId + @minPrice = minPrice + @maxPrice = maxPrice + @minSalePrice = minSalePrice + @maxSalePrice = maxSalePrice + @multiMerchant = multiMerchant + @merchantSku = merchantSku + @listPrice = listPrice + @ourPrice = ourPrice + @usedPrice = usedPrice + @refurbishedPrice = refurbishedPrice + @collectiblePrice = collectiblePrice + @thirdPartyNewPrice = thirdPartyNewPrice + @numberOfOfferings = numberOfOfferings + @thirdPartyNewCount = thirdPartyNewCount + @usedCount = usedCount + @collectibleCount = collectibleCount + @refurbishedCount = refurbishedCount + @thirdPartyProductInfo = thirdPartyProductInfo + @salesRank = salesRank + @browseList = browseList + @media = media + @readingLevel = readingLevel + @numberOfPages = numberOfPages + @numberOfIssues = numberOfIssues + @issuesPerYear = issuesPerYear + @subscriptionLength = subscriptionLength + @deweyNumber = deweyNumber + @runningTime = runningTime + @publisher = publisher + @numMedia = numMedia + @isbn = isbn + @features = features + @mpaaRating = mpaaRating + @esrbRating = esrbRating + @ageGroup = ageGroup + @availability = availability + @upc = upc + @tracks = tracks + @accessories = accessories + @platforms = platforms + @encoding = encoding + @productDescription = productDescription + @reviews = reviews + @similarProducts = similarProducts + @featuredProducts = featuredProducts + @lists = lists + @status = status + @variations = variations + end +end + +# {http://soap.amazon.com}KeyPhraseArray +class KeyPhraseArray < ::Array + @@schema_type = "KeyPhrase" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}KeyPhrase +class KeyPhrase + @@schema_type = "KeyPhrase" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["keyPhrase", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "KeyPhrase")]], ["type", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Type")]]] + + def KeyPhrase + @keyPhrase + end + + def KeyPhrase=(value) + @keyPhrase = value + end + + def Type + @type + end + + def Type=(value) + @type = value + end + + def initialize(keyPhrase = nil, type = nil) + @keyPhrase = keyPhrase + @type = type + end +end + +# {http://soap.amazon.com}ArtistArray +class ArtistArray < ::Array + @@schema_type = "string" + @@schema_ns = "http://www.w3.org/2001/XMLSchema" +end + +# {http://soap.amazon.com}AuthorArray +class AuthorArray < ::Array + @@schema_type = "string" + @@schema_ns = "http://www.w3.org/2001/XMLSchema" +end + +# {http://soap.amazon.com}StarringArray +class StarringArray < ::Array + @@schema_type = "string" + @@schema_ns = "http://www.w3.org/2001/XMLSchema" +end + +# {http://soap.amazon.com}DirectorArray +class DirectorArray < ::Array + @@schema_type = "string" + @@schema_ns = "http://www.w3.org/2001/XMLSchema" +end + +# {http://soap.amazon.com}BrowseNodeArray +class BrowseNodeArray < ::Array + @@schema_type = "BrowseNode" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}BrowseNode +class BrowseNode + @@schema_type = "BrowseNode" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["browseId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "BrowseId")]], ["browseName", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "BrowseName")]]] + + def BrowseId + @browseId + end + + def BrowseId=(value) + @browseId = value + end + + def BrowseName + @browseName + end + + def BrowseName=(value) + @browseName = value + end + + def initialize(browseId = nil, browseName = nil) + @browseId = browseId + @browseName = browseName + end +end + +# {http://soap.amazon.com}FeaturesArray +class FeaturesArray < ::Array + @@schema_type = "string" + @@schema_ns = "http://www.w3.org/2001/XMLSchema" +end + +# {http://soap.amazon.com}TrackArray +class TrackArray < ::Array + @@schema_type = "Track" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}Track +class Track + @@schema_type = "Track" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["trackName", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "TrackName")]], ["byArtist", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ByArtist")]]] + + def TrackName + @trackName + end + + def TrackName=(value) + @trackName = value + end + + def ByArtist + @byArtist + end + + def ByArtist=(value) + @byArtist = value + end + + def initialize(trackName = nil, byArtist = nil) + @trackName = trackName + @byArtist = byArtist + end +end + +# {http://soap.amazon.com}AccessoryArray +class AccessoryArray < ::Array + @@schema_type = "string" + @@schema_ns = "http://www.w3.org/2001/XMLSchema" +end + +# {http://soap.amazon.com}PlatformArray +class PlatformArray < ::Array + @@schema_type = "string" + @@schema_ns = "http://www.w3.org/2001/XMLSchema" +end + +# {http://soap.amazon.com}Reviews +class Reviews + @@schema_type = "Reviews" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["avgCustomerRating", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "AvgCustomerRating")]], ["totalCustomerReviews", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "TotalCustomerReviews")]], ["customerReviews", ["CustomerReviewArray", XSD::QName.new("http://soap.amazon.com", "CustomerReviews")]]] + + def AvgCustomerRating + @avgCustomerRating + end + + def AvgCustomerRating=(value) + @avgCustomerRating = value + end + + def TotalCustomerReviews + @totalCustomerReviews + end + + def TotalCustomerReviews=(value) + @totalCustomerReviews = value + end + + def CustomerReviews + @customerReviews + end + + def CustomerReviews=(value) + @customerReviews = value + end + + def initialize(avgCustomerRating = nil, totalCustomerReviews = nil, customerReviews = nil) + @avgCustomerRating = avgCustomerRating + @totalCustomerReviews = totalCustomerReviews + @customerReviews = customerReviews + end +end + +# {http://soap.amazon.com}CustomerReviewArray +class CustomerReviewArray < ::Array + @@schema_type = "CustomerReview" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}CustomerReview +class CustomerReview + @@schema_type = "CustomerReview" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["rating", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Rating")]], ["date", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Date")]], ["summary", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Summary")]], ["comment", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Comment")]]] + + def Rating + @rating + end + + def Rating=(value) + @rating = value + end + + def Date + @date + end + + def Date=(value) + @date = value + end + + def Summary + @summary + end + + def Summary=(value) + @summary = value + end + + def Comment + @comment + end + + def Comment=(value) + @comment = value + end + + def initialize(rating = nil, date = nil, summary = nil, comment = nil) + @rating = rating + @date = date + @summary = summary + @comment = comment + end +end + +# {http://soap.amazon.com}SimilarProductsArray +class SimilarProductsArray < ::Array + @@schema_type = "string" + @@schema_ns = "http://www.w3.org/2001/XMLSchema" +end + +# {http://soap.amazon.com}FeaturedProductsArray +class FeaturedProductsArray < ::Array + @@schema_type = "FeaturedProduct" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}FeaturedProduct +class FeaturedProduct + @@schema_type = "FeaturedProduct" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["asin", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Asin")]], ["comment", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Comment")]]] + + def Asin + @asin + end + + def Asin=(value) + @asin = value + end + + def Comment + @comment + end + + def Comment=(value) + @comment = value + end + + def initialize(asin = nil, comment = nil) + @asin = asin + @comment = comment + end +end + +# {http://soap.amazon.com}ListArray +class ListArray < ::Array + @@schema_type = "string" + @@schema_ns = "http://www.w3.org/2001/XMLSchema" +end + +# {http://soap.amazon.com}VariationArray +class VariationArray < ::Array + @@schema_type = "Variation" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}Variation +class Variation + @@schema_type = "Variation" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["asin", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Asin")]], ["clothingSize", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ClothingSize")]], ["clothingColor", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ClothingColor")]], ["price", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Price")]], ["salePrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "SalePrice")]], ["availability", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Availability")]], ["multiMerchant", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MultiMerchant")]], ["merchantSku", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MerchantSku")]]] + + def Asin + @asin + end + + def Asin=(value) + @asin = value + end + + def ClothingSize + @clothingSize + end + + def ClothingSize=(value) + @clothingSize = value + end + + def ClothingColor + @clothingColor + end + + def ClothingColor=(value) + @clothingColor = value + end + + def Price + @price + end + + def Price=(value) + @price = value + end + + def SalePrice + @salePrice + end + + def SalePrice=(value) + @salePrice = value + end + + def Availability + @availability + end + + def Availability=(value) + @availability = value + end + + def MultiMerchant + @multiMerchant + end + + def MultiMerchant=(value) + @multiMerchant = value + end + + def MerchantSku + @merchantSku + end + + def MerchantSku=(value) + @merchantSku = value + end + + def initialize(asin = nil, clothingSize = nil, clothingColor = nil, price = nil, salePrice = nil, availability = nil, multiMerchant = nil, merchantSku = nil) + @asin = asin + @clothingSize = clothingSize + @clothingColor = clothingColor + @price = price + @salePrice = salePrice + @availability = availability + @multiMerchant = multiMerchant + @merchantSku = merchantSku + end +end + +# {http://soap.amazon.com}MarketplaceSearch +class MarketplaceSearch + @@schema_type = "MarketplaceSearch" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["marketplaceSearchDetails", ["MarketplaceSearchDetailsArray", XSD::QName.new("http://soap.amazon.com", "MarketplaceSearchDetails")]]] + + def MarketplaceSearchDetails + @marketplaceSearchDetails + end + + def MarketplaceSearchDetails=(value) + @marketplaceSearchDetails = value + end + + def initialize(marketplaceSearchDetails = nil) + @marketplaceSearchDetails = marketplaceSearchDetails + end +end + +# {http://soap.amazon.com}SellerProfile +class SellerProfile + @@schema_type = "SellerProfile" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["sellerProfileDetails", ["SellerProfileDetailsArray", XSD::QName.new("http://soap.amazon.com", "SellerProfileDetails")]]] + + def SellerProfileDetails + @sellerProfileDetails + end + + def SellerProfileDetails=(value) + @sellerProfileDetails = value + end + + def initialize(sellerProfileDetails = nil) + @sellerProfileDetails = sellerProfileDetails + end +end + +# {http://soap.amazon.com}SellerSearch +class SellerSearch + @@schema_type = "SellerSearch" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["sellerSearchDetails", ["SellerSearchDetailsArray", XSD::QName.new("http://soap.amazon.com", "SellerSearchDetails")]]] + + def SellerSearchDetails + @sellerSearchDetails + end + + def SellerSearchDetails=(value) + @sellerSearchDetails = value + end + + def initialize(sellerSearchDetails = nil) + @sellerSearchDetails = sellerSearchDetails + end +end + +# {http://soap.amazon.com}MarketplaceSearchDetails +class MarketplaceSearchDetails + @@schema_type = "MarketplaceSearchDetails" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["numberOfOpenListings", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "NumberOfOpenListings")]], ["listingProductInfo", ["ListingProductInfo", XSD::QName.new("http://soap.amazon.com", "ListingProductInfo")]]] + + def NumberOfOpenListings + @numberOfOpenListings + end + + def NumberOfOpenListings=(value) + @numberOfOpenListings = value + end + + def ListingProductInfo + @listingProductInfo + end + + def ListingProductInfo=(value) + @listingProductInfo = value + end + + def initialize(numberOfOpenListings = nil, listingProductInfo = nil) + @numberOfOpenListings = numberOfOpenListings + @listingProductInfo = listingProductInfo + end +end + +# {http://soap.amazon.com}MarketplaceSearchDetailsArray +class MarketplaceSearchDetailsArray < ::Array + @@schema_type = "MarketplaceSearchDetails" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}SellerProfileDetails +class SellerProfileDetails + @@schema_type = "SellerProfileDetails" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["sellerNickname", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "SellerNickname")]], ["overallFeedbackRating", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "OverallFeedbackRating")]], ["numberOfFeedback", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "NumberOfFeedback")]], ["numberOfCanceledBids", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "NumberOfCanceledBids")]], ["numberOfCanceledAuctions", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "NumberOfCanceledAuctions")]], ["storeId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "StoreId")]], ["storeName", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "StoreName")]], ["sellerFeedback", ["SellerFeedback", XSD::QName.new("http://soap.amazon.com", "SellerFeedback")]]] + + def SellerNickname + @sellerNickname + end + + def SellerNickname=(value) + @sellerNickname = value + end + + def OverallFeedbackRating + @overallFeedbackRating + end + + def OverallFeedbackRating=(value) + @overallFeedbackRating = value + end + + def NumberOfFeedback + @numberOfFeedback + end + + def NumberOfFeedback=(value) + @numberOfFeedback = value + end + + def NumberOfCanceledBids + @numberOfCanceledBids + end + + def NumberOfCanceledBids=(value) + @numberOfCanceledBids = value + end + + def NumberOfCanceledAuctions + @numberOfCanceledAuctions + end + + def NumberOfCanceledAuctions=(value) + @numberOfCanceledAuctions = value + end + + def StoreId + @storeId + end + + def StoreId=(value) + @storeId = value + end + + def StoreName + @storeName + end + + def StoreName=(value) + @storeName = value + end + + def SellerFeedback + @sellerFeedback + end + + def SellerFeedback=(value) + @sellerFeedback = value + end + + def initialize(sellerNickname = nil, overallFeedbackRating = nil, numberOfFeedback = nil, numberOfCanceledBids = nil, numberOfCanceledAuctions = nil, storeId = nil, storeName = nil, sellerFeedback = nil) + @sellerNickname = sellerNickname + @overallFeedbackRating = overallFeedbackRating + @numberOfFeedback = numberOfFeedback + @numberOfCanceledBids = numberOfCanceledBids + @numberOfCanceledAuctions = numberOfCanceledAuctions + @storeId = storeId + @storeName = storeName + @sellerFeedback = sellerFeedback + end +end + +# {http://soap.amazon.com}SellerProfileDetailsArray +class SellerProfileDetailsArray < ::Array + @@schema_type = "SellerProfileDetails" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}SellerSearchDetails +class SellerSearchDetails + @@schema_type = "SellerSearchDetails" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["sellerNickname", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "SellerNickname")]], ["storeId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "StoreId")]], ["storeName", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "StoreName")]], ["numberOfOpenListings", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "NumberOfOpenListings")]], ["listingProductInfo", ["ListingProductInfo", XSD::QName.new("http://soap.amazon.com", "ListingProductInfo")]]] + + def SellerNickname + @sellerNickname + end + + def SellerNickname=(value) + @sellerNickname = value + end + + def StoreId + @storeId + end + + def StoreId=(value) + @storeId = value + end + + def StoreName + @storeName + end + + def StoreName=(value) + @storeName = value + end + + def NumberOfOpenListings + @numberOfOpenListings + end + + def NumberOfOpenListings=(value) + @numberOfOpenListings = value + end + + def ListingProductInfo + @listingProductInfo + end + + def ListingProductInfo=(value) + @listingProductInfo = value + end + + def initialize(sellerNickname = nil, storeId = nil, storeName = nil, numberOfOpenListings = nil, listingProductInfo = nil) + @sellerNickname = sellerNickname + @storeId = storeId + @storeName = storeName + @numberOfOpenListings = numberOfOpenListings + @listingProductInfo = listingProductInfo + end +end + +# {http://soap.amazon.com}SellerSearchDetailsArray +class SellerSearchDetailsArray < ::Array + @@schema_type = "SellerSearchDetails" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}ListingProductInfo +class ListingProductInfo + @@schema_type = "ListingProductInfo" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["listingProductDetails", ["ListingProductDetailsArray", XSD::QName.new("http://soap.amazon.com", "ListingProductDetails")]]] + + def ListingProductDetails + @listingProductDetails + end + + def ListingProductDetails=(value) + @listingProductDetails = value + end + + def initialize(listingProductDetails = nil) + @listingProductDetails = listingProductDetails + end +end + +# {http://soap.amazon.com}ListingProductDetailsArray +class ListingProductDetailsArray < ::Array + @@schema_type = "ListingProductDetails" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}ListingProductDetails +class ListingProductDetails + @@schema_type = "ListingProductDetails" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["exchangeId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeId")]], ["listingId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ListingId")]], ["exchangeTitle", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeTitle")]], ["exchangeDescription", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeDescription")]], ["exchangePrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangePrice")]], ["exchangeAsin", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeAsin")]], ["exchangeEndDate", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeEndDate")]], ["exchangeTinyImage", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeTinyImage")]], ["exchangeSellerId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeSellerId")]], ["exchangeSellerNickname", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeSellerNickname")]], ["exchangeStartDate", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeStartDate")]], ["exchangeStatus", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeStatus")]], ["exchangeQuantity", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeQuantity")]], ["exchangeQuantityAllocated", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeQuantityAllocated")]], ["exchangeFeaturedCategory", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeFeaturedCategory")]], ["exchangeCondition", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeCondition")]], ["exchangeConditionType", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeConditionType")]], ["exchangeAvailability", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeAvailability")]], ["exchangeOfferingType", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeOfferingType")]], ["exchangeSellerState", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeSellerState")]], ["exchangeSellerCountry", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeSellerCountry")]], ["exchangeSellerRating", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeSellerRating")]]] + + def ExchangeId + @exchangeId + end + + def ExchangeId=(value) + @exchangeId = value + end + + def ListingId + @listingId + end + + def ListingId=(value) + @listingId = value + end + + def ExchangeTitle + @exchangeTitle + end + + def ExchangeTitle=(value) + @exchangeTitle = value + end + + def ExchangeDescription + @exchangeDescription + end + + def ExchangeDescription=(value) + @exchangeDescription = value + end + + def ExchangePrice + @exchangePrice + end + + def ExchangePrice=(value) + @exchangePrice = value + end + + def ExchangeAsin + @exchangeAsin + end + + def ExchangeAsin=(value) + @exchangeAsin = value + end + + def ExchangeEndDate + @exchangeEndDate + end + + def ExchangeEndDate=(value) + @exchangeEndDate = value + end + + def ExchangeTinyImage + @exchangeTinyImage + end + + def ExchangeTinyImage=(value) + @exchangeTinyImage = value + end + + def ExchangeSellerId + @exchangeSellerId + end + + def ExchangeSellerId=(value) + @exchangeSellerId = value + end + + def ExchangeSellerNickname + @exchangeSellerNickname + end + + def ExchangeSellerNickname=(value) + @exchangeSellerNickname = value + end + + def ExchangeStartDate + @exchangeStartDate + end + + def ExchangeStartDate=(value) + @exchangeStartDate = value + end + + def ExchangeStatus + @exchangeStatus + end + + def ExchangeStatus=(value) + @exchangeStatus = value + end + + def ExchangeQuantity + @exchangeQuantity + end + + def ExchangeQuantity=(value) + @exchangeQuantity = value + end + + def ExchangeQuantityAllocated + @exchangeQuantityAllocated + end + + def ExchangeQuantityAllocated=(value) + @exchangeQuantityAllocated = value + end + + def ExchangeFeaturedCategory + @exchangeFeaturedCategory + end + + def ExchangeFeaturedCategory=(value) + @exchangeFeaturedCategory = value + end + + def ExchangeCondition + @exchangeCondition + end + + def ExchangeCondition=(value) + @exchangeCondition = value + end + + def ExchangeConditionType + @exchangeConditionType + end + + def ExchangeConditionType=(value) + @exchangeConditionType = value + end + + def ExchangeAvailability + @exchangeAvailability + end + + def ExchangeAvailability=(value) + @exchangeAvailability = value + end + + def ExchangeOfferingType + @exchangeOfferingType + end + + def ExchangeOfferingType=(value) + @exchangeOfferingType = value + end + + def ExchangeSellerState + @exchangeSellerState + end + + def ExchangeSellerState=(value) + @exchangeSellerState = value + end + + def ExchangeSellerCountry + @exchangeSellerCountry + end + + def ExchangeSellerCountry=(value) + @exchangeSellerCountry = value + end + + def ExchangeSellerRating + @exchangeSellerRating + end + + def ExchangeSellerRating=(value) + @exchangeSellerRating = value + end + + def initialize(exchangeId = nil, listingId = nil, exchangeTitle = nil, exchangeDescription = nil, exchangePrice = nil, exchangeAsin = nil, exchangeEndDate = nil, exchangeTinyImage = nil, exchangeSellerId = nil, exchangeSellerNickname = nil, exchangeStartDate = nil, exchangeStatus = nil, exchangeQuantity = nil, exchangeQuantityAllocated = nil, exchangeFeaturedCategory = nil, exchangeCondition = nil, exchangeConditionType = nil, exchangeAvailability = nil, exchangeOfferingType = nil, exchangeSellerState = nil, exchangeSellerCountry = nil, exchangeSellerRating = nil) + @exchangeId = exchangeId + @listingId = listingId + @exchangeTitle = exchangeTitle + @exchangeDescription = exchangeDescription + @exchangePrice = exchangePrice + @exchangeAsin = exchangeAsin + @exchangeEndDate = exchangeEndDate + @exchangeTinyImage = exchangeTinyImage + @exchangeSellerId = exchangeSellerId + @exchangeSellerNickname = exchangeSellerNickname + @exchangeStartDate = exchangeStartDate + @exchangeStatus = exchangeStatus + @exchangeQuantity = exchangeQuantity + @exchangeQuantityAllocated = exchangeQuantityAllocated + @exchangeFeaturedCategory = exchangeFeaturedCategory + @exchangeCondition = exchangeCondition + @exchangeConditionType = exchangeConditionType + @exchangeAvailability = exchangeAvailability + @exchangeOfferingType = exchangeOfferingType + @exchangeSellerState = exchangeSellerState + @exchangeSellerCountry = exchangeSellerCountry + @exchangeSellerRating = exchangeSellerRating + end +end + +# {http://soap.amazon.com}SellerFeedback +class SellerFeedback + @@schema_type = "SellerFeedback" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["feedback", ["FeedbackArray", XSD::QName.new("http://soap.amazon.com", "Feedback")]]] + + def Feedback + @feedback + end + + def Feedback=(value) + @feedback = value + end + + def initialize(feedback = nil) + @feedback = feedback + end +end + +# {http://soap.amazon.com}FeedbackArray +class FeedbackArray < ::Array + @@schema_type = "Feedback" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}Feedback +class Feedback + @@schema_type = "Feedback" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["feedbackRating", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "FeedbackRating")]], ["feedbackComments", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "FeedbackComments")]], ["feedbackDate", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "FeedbackDate")]], ["feedbackRater", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "FeedbackRater")]]] + + def FeedbackRating + @feedbackRating + end + + def FeedbackRating=(value) + @feedbackRating = value + end + + def FeedbackComments + @feedbackComments + end + + def FeedbackComments=(value) + @feedbackComments = value + end + + def FeedbackDate + @feedbackDate + end + + def FeedbackDate=(value) + @feedbackDate = value + end + + def FeedbackRater + @feedbackRater + end + + def FeedbackRater=(value) + @feedbackRater = value + end + + def initialize(feedbackRating = nil, feedbackComments = nil, feedbackDate = nil, feedbackRater = nil) + @feedbackRating = feedbackRating + @feedbackComments = feedbackComments + @feedbackDate = feedbackDate + @feedbackRater = feedbackRater + end +end + +# {http://soap.amazon.com}ThirdPartyProductInfo +class ThirdPartyProductInfo + @@schema_type = "ThirdPartyProductInfo" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["thirdPartyProductDetails", ["ThirdPartyProductDetailsArray", XSD::QName.new("http://soap.amazon.com", "ThirdPartyProductDetails")]]] + + def ThirdPartyProductDetails + @thirdPartyProductDetails + end + + def ThirdPartyProductDetails=(value) + @thirdPartyProductDetails = value + end + + def initialize(thirdPartyProductDetails = nil) + @thirdPartyProductDetails = thirdPartyProductDetails + end +end + +# {http://soap.amazon.com}ThirdPartyProductDetailsArray +class ThirdPartyProductDetailsArray < ::Array + @@schema_type = "ThirdPartyProductDetails" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}ThirdPartyProductDetails +class ThirdPartyProductDetails + @@schema_type = "ThirdPartyProductDetails" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["offeringType", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "OfferingType")]], ["sellerId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "SellerId")]], ["sellerNickname", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "SellerNickname")]], ["exchangeId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeId")]], ["offeringPrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "OfferingPrice")]], ["condition", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Condition")]], ["conditionType", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ConditionType")]], ["exchangeAvailability", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeAvailability")]], ["sellerCountry", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "SellerCountry")]], ["sellerState", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "SellerState")]], ["shipComments", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ShipComments")]], ["sellerRating", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "SellerRating")]]] + + def OfferingType + @offeringType + end + + def OfferingType=(value) + @offeringType = value + end + + def SellerId + @sellerId + end + + def SellerId=(value) + @sellerId = value + end + + def SellerNickname + @sellerNickname + end + + def SellerNickname=(value) + @sellerNickname = value + end + + def ExchangeId + @exchangeId + end + + def ExchangeId=(value) + @exchangeId = value + end + + def OfferingPrice + @offeringPrice + end + + def OfferingPrice=(value) + @offeringPrice = value + end + + def Condition + @condition + end + + def Condition=(value) + @condition = value + end + + def ConditionType + @conditionType + end + + def ConditionType=(value) + @conditionType = value + end + + def ExchangeAvailability + @exchangeAvailability + end + + def ExchangeAvailability=(value) + @exchangeAvailability = value + end + + def SellerCountry + @sellerCountry + end + + def SellerCountry=(value) + @sellerCountry = value + end + + def SellerState + @sellerState + end + + def SellerState=(value) + @sellerState = value + end + + def ShipComments + @shipComments + end + + def ShipComments=(value) + @shipComments = value + end + + def SellerRating + @sellerRating + end + + def SellerRating=(value) + @sellerRating = value + end + + def initialize(offeringType = nil, sellerId = nil, sellerNickname = nil, exchangeId = nil, offeringPrice = nil, condition = nil, conditionType = nil, exchangeAvailability = nil, sellerCountry = nil, sellerState = nil, shipComments = nil, sellerRating = nil) + @offeringType = offeringType + @sellerId = sellerId + @sellerNickname = sellerNickname + @exchangeId = exchangeId + @offeringPrice = offeringPrice + @condition = condition + @conditionType = conditionType + @exchangeAvailability = exchangeAvailability + @sellerCountry = sellerCountry + @sellerState = sellerState + @shipComments = shipComments + @sellerRating = sellerRating + end +end + +# {http://soap.amazon.com}KeywordRequest +class KeywordRequest + @@schema_type = "KeywordRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["keyword", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["mode", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["sort", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"], ["price", "SOAP::SOAPString"]] + + attr_accessor :keyword + attr_accessor :page + attr_accessor :mode + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :sort + attr_accessor :locale + attr_accessor :price + + def initialize(keyword = nil, page = nil, mode = nil, tag = nil, type = nil, devtag = nil, sort = nil, locale = nil, price = nil) + @keyword = keyword + @page = page + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @sort = sort + @locale = locale + @price = price + end +end + +# {http://soap.amazon.com}TextStreamRequest +class TextStreamRequest + @@schema_type = "TextStreamRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["textStream", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["mode", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["sort", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"], ["price", "SOAP::SOAPString"]] + + attr_accessor :textStream + attr_accessor :page + attr_accessor :mode + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :sort + attr_accessor :locale + attr_accessor :price + + def initialize(textStream = nil, page = nil, mode = nil, tag = nil, type = nil, devtag = nil, sort = nil, locale = nil, price = nil) + @textStream = textStream + @page = page + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @sort = sort + @locale = locale + @price = price + end +end + +# {http://soap.amazon.com}PowerRequest +class PowerRequest + @@schema_type = "PowerRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["power", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["mode", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["sort", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"]] + + attr_accessor :power + attr_accessor :page + attr_accessor :mode + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :sort + attr_accessor :locale + + def initialize(power = nil, page = nil, mode = nil, tag = nil, type = nil, devtag = nil, sort = nil, locale = nil) + @power = power + @page = page + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @sort = sort + @locale = locale + end +end + +# {http://soap.amazon.com}BrowseNodeRequest +class BrowseNodeRequest + @@schema_type = "BrowseNodeRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["browse_node", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["mode", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["sort", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"], ["keywords", "SOAP::SOAPString"], ["price", "SOAP::SOAPString"]] + + attr_accessor :browse_node + attr_accessor :page + attr_accessor :mode + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :sort + attr_accessor :locale + attr_accessor :keywords + attr_accessor :price + + def initialize(browse_node = nil, page = nil, mode = nil, tag = nil, type = nil, devtag = nil, sort = nil, locale = nil, keywords = nil, price = nil) + @browse_node = browse_node + @page = page + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @sort = sort + @locale = locale + @keywords = keywords + @price = price + end +end + +# {http://soap.amazon.com}AsinRequest +class AsinRequest + @@schema_type = "AsinRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["asin", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["offer", "SOAP::SOAPString"], ["offerpage", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"], ["mode", "SOAP::SOAPString"]] + + attr_accessor :asin + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :offer + attr_accessor :offerpage + attr_accessor :locale + attr_accessor :mode + + def initialize(asin = nil, tag = nil, type = nil, devtag = nil, offer = nil, offerpage = nil, locale = nil, mode = nil) + @asin = asin + @tag = tag + @type = type + @devtag = devtag + @offer = offer + @offerpage = offerpage + @locale = locale + @mode = mode + end +end + +# {http://soap.amazon.com}BlendedRequest +class BlendedRequest + @@schema_type = "BlendedRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["blended", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"]] + + attr_accessor :blended + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :locale + + def initialize(blended = nil, tag = nil, type = nil, devtag = nil, locale = nil) + @blended = blended + @tag = tag + @type = type + @devtag = devtag + @locale = locale + end +end + +# {http://soap.amazon.com}UpcRequest +class UpcRequest + @@schema_type = "UpcRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["upc", "SOAP::SOAPString"], ["mode", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["sort", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"]] + + attr_accessor :upc + attr_accessor :mode + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :sort + attr_accessor :locale + + def initialize(upc = nil, mode = nil, tag = nil, type = nil, devtag = nil, sort = nil, locale = nil) + @upc = upc + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @sort = sort + @locale = locale + end +end + +# {http://soap.amazon.com}SkuRequest +class SkuRequest + @@schema_type = "SkuRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["sku", "SOAP::SOAPString"], ["mode", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["merchant_id", "SOAP::SOAPString"], ["keywords", "SOAP::SOAPString"], ["sort", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"]] + + attr_accessor :sku + attr_accessor :mode + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :merchant_id + attr_accessor :keywords + attr_accessor :sort + attr_accessor :locale + + def initialize(sku = nil, mode = nil, tag = nil, type = nil, devtag = nil, merchant_id = nil, keywords = nil, sort = nil, locale = nil) + @sku = sku + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @merchant_id = merchant_id + @keywords = keywords + @sort = sort + @locale = locale + end +end + +# {http://soap.amazon.com}ArtistRequest +class ArtistRequest + @@schema_type = "ArtistRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["artist", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["mode", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["sort", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"], ["keywords", "SOAP::SOAPString"], ["price", "SOAP::SOAPString"]] + + attr_accessor :artist + attr_accessor :page + attr_accessor :mode + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :sort + attr_accessor :locale + attr_accessor :keywords + attr_accessor :price + + def initialize(artist = nil, page = nil, mode = nil, tag = nil, type = nil, devtag = nil, sort = nil, locale = nil, keywords = nil, price = nil) + @artist = artist + @page = page + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @sort = sort + @locale = locale + @keywords = keywords + @price = price + end +end + +# {http://soap.amazon.com}AuthorRequest +class AuthorRequest + @@schema_type = "AuthorRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["author", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["mode", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["sort", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"], ["keywords", "SOAP::SOAPString"], ["price", "SOAP::SOAPString"]] + + attr_accessor :author + attr_accessor :page + attr_accessor :mode + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :sort + attr_accessor :locale + attr_accessor :keywords + attr_accessor :price + + def initialize(author = nil, page = nil, mode = nil, tag = nil, type = nil, devtag = nil, sort = nil, locale = nil, keywords = nil, price = nil) + @author = author + @page = page + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @sort = sort + @locale = locale + @keywords = keywords + @price = price + end +end + +# {http://soap.amazon.com}ActorRequest +class ActorRequest + @@schema_type = "ActorRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["actor", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["mode", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["sort", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"], ["keywords", "SOAP::SOAPString"], ["price", "SOAP::SOAPString"]] + + attr_accessor :actor + attr_accessor :page + attr_accessor :mode + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :sort + attr_accessor :locale + attr_accessor :keywords + attr_accessor :price + + def initialize(actor = nil, page = nil, mode = nil, tag = nil, type = nil, devtag = nil, sort = nil, locale = nil, keywords = nil, price = nil) + @actor = actor + @page = page + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @sort = sort + @locale = locale + @keywords = keywords + @price = price + end +end + +# {http://soap.amazon.com}DirectorRequest +class DirectorRequest + @@schema_type = "DirectorRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["director", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["mode", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["sort", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"], ["keywords", "SOAP::SOAPString"], ["price", "SOAP::SOAPString"]] + + attr_accessor :director + attr_accessor :page + attr_accessor :mode + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :sort + attr_accessor :locale + attr_accessor :keywords + attr_accessor :price + + def initialize(director = nil, page = nil, mode = nil, tag = nil, type = nil, devtag = nil, sort = nil, locale = nil, keywords = nil, price = nil) + @director = director + @page = page + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @sort = sort + @locale = locale + @keywords = keywords + @price = price + end +end + +# {http://soap.amazon.com}ExchangeRequest +class ExchangeRequest + @@schema_type = "ExchangeRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["exchange_id", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"]] + + attr_accessor :exchange_id + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :locale + + def initialize(exchange_id = nil, tag = nil, type = nil, devtag = nil, locale = nil) + @exchange_id = exchange_id + @tag = tag + @type = type + @devtag = devtag + @locale = locale + end +end + +# {http://soap.amazon.com}ManufacturerRequest +class ManufacturerRequest + @@schema_type = "ManufacturerRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["manufacturer", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["mode", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["sort", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"], ["keywords", "SOAP::SOAPString"], ["price", "SOAP::SOAPString"]] + + attr_accessor :manufacturer + attr_accessor :page + attr_accessor :mode + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :sort + attr_accessor :locale + attr_accessor :keywords + attr_accessor :price + + def initialize(manufacturer = nil, page = nil, mode = nil, tag = nil, type = nil, devtag = nil, sort = nil, locale = nil, keywords = nil, price = nil) + @manufacturer = manufacturer + @page = page + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @sort = sort + @locale = locale + @keywords = keywords + @price = price + end +end + +# {http://soap.amazon.com}ListManiaRequest +class ListManiaRequest + @@schema_type = "ListManiaRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["lm_id", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"]] + + attr_accessor :lm_id + attr_accessor :page + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :locale + + def initialize(lm_id = nil, page = nil, tag = nil, type = nil, devtag = nil, locale = nil) + @lm_id = lm_id + @page = page + @tag = tag + @type = type + @devtag = devtag + @locale = locale + end +end + +# {http://soap.amazon.com}WishlistRequest +class WishlistRequest + @@schema_type = "WishlistRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["wishlist_id", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"]] + + attr_accessor :wishlist_id + attr_accessor :page + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :locale + + def initialize(wishlist_id = nil, page = nil, tag = nil, type = nil, devtag = nil, locale = nil) + @wishlist_id = wishlist_id + @page = page + @tag = tag + @type = type + @devtag = devtag + @locale = locale + end +end + +# {http://soap.amazon.com}MarketplaceRequest +class MarketplaceRequest + @@schema_type = "MarketplaceRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["marketplace_search", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["keyword", "SOAP::SOAPString"], ["keyword_search", "SOAP::SOAPString"], ["browse_id", "SOAP::SOAPString"], ["zipcode", "SOAP::SOAPString"], ["area_id", "SOAP::SOAPString"], ["geo", "SOAP::SOAPString"], ["sort", "SOAP::SOAPString"], ["listing_id", "SOAP::SOAPString"], ["desc", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"], ["index", "SOAP::SOAPString"]] + + attr_accessor :marketplace_search + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :page + attr_accessor :keyword + attr_accessor :keyword_search + attr_accessor :browse_id + attr_accessor :zipcode + attr_accessor :area_id + attr_accessor :geo + attr_accessor :sort + attr_accessor :listing_id + attr_accessor :desc + attr_accessor :locale + attr_accessor :index + + def initialize(marketplace_search = nil, tag = nil, type = nil, devtag = nil, page = nil, keyword = nil, keyword_search = nil, browse_id = nil, zipcode = nil, area_id = nil, geo = nil, sort = nil, listing_id = nil, desc = nil, locale = nil, index = nil) + @marketplace_search = marketplace_search + @tag = tag + @type = type + @devtag = devtag + @page = page + @keyword = keyword + @keyword_search = keyword_search + @browse_id = browse_id + @zipcode = zipcode + @area_id = area_id + @geo = geo + @sort = sort + @listing_id = listing_id + @desc = desc + @locale = locale + @index = index + end +end + +# {http://soap.amazon.com}SellerProfileRequest +class SellerProfileRequest + @@schema_type = "SellerProfileRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["seller_id", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["desc", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"]] + + attr_accessor :seller_id + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :page + attr_accessor :desc + attr_accessor :locale + + def initialize(seller_id = nil, tag = nil, type = nil, devtag = nil, page = nil, desc = nil, locale = nil) + @seller_id = seller_id + @tag = tag + @type = type + @devtag = devtag + @page = page + @desc = desc + @locale = locale + end +end + +# {http://soap.amazon.com}SellerRequest +class SellerRequest + @@schema_type = "SellerRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["seller_id", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["offerstatus", "SOAP::SOAPString"], ["page", "SOAP::SOAPString"], ["seller_browse_id", "SOAP::SOAPString"], ["keyword", "SOAP::SOAPString"], ["desc", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"], ["index", "SOAP::SOAPString"]] + + attr_accessor :seller_id + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :offerstatus + attr_accessor :page + attr_accessor :seller_browse_id + attr_accessor :keyword + attr_accessor :desc + attr_accessor :locale + attr_accessor :index + + def initialize(seller_id = nil, tag = nil, type = nil, devtag = nil, offerstatus = nil, page = nil, seller_browse_id = nil, keyword = nil, desc = nil, locale = nil, index = nil) + @seller_id = seller_id + @tag = tag + @type = type + @devtag = devtag + @offerstatus = offerstatus + @page = page + @seller_browse_id = seller_browse_id + @keyword = keyword + @desc = desc + @locale = locale + @index = index + end +end + +# {http://soap.amazon.com}SimilarityRequest +class SimilarityRequest + @@schema_type = "SimilarityRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["asin", "SOAP::SOAPString"], ["tag", "SOAP::SOAPString"], ["type", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["locale", "SOAP::SOAPString"]] + + attr_accessor :asin + attr_accessor :tag + attr_accessor :type + attr_accessor :devtag + attr_accessor :locale + + def initialize(asin = nil, tag = nil, type = nil, devtag = nil, locale = nil) + @asin = asin + @tag = tag + @type = type + @devtag = devtag + @locale = locale + end +end + +# {http://soap.amazon.com}ItemIdArray +class ItemIdArray < ::Array + @@schema_type = "string" + @@schema_ns = "http://www.w3.org/2001/XMLSchema" +end + +# {http://soap.amazon.com}ItemArray +class ItemArray < ::Array + @@schema_type = "Item" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}Item +class Item + @@schema_type = "Item" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["itemId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ItemId")]], ["productName", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ProductName")]], ["catalog", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Catalog")]], ["asin", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Asin")]], ["exchangeId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeId")]], ["quantity", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Quantity")]], ["listPrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ListPrice")]], ["ourPrice", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "OurPrice")]], ["merchantSku", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MerchantSku")]]] + + def ItemId + @itemId + end + + def ItemId=(value) + @itemId = value + end + + def ProductName + @productName + end + + def ProductName=(value) + @productName = value + end + + def Catalog + @catalog + end + + def Catalog=(value) + @catalog = value + end + + def Asin + @asin + end + + def Asin=(value) + @asin = value + end + + def ExchangeId + @exchangeId + end + + def ExchangeId=(value) + @exchangeId = value + end + + def Quantity + @quantity + end + + def Quantity=(value) + @quantity = value + end + + def ListPrice + @listPrice + end + + def ListPrice=(value) + @listPrice = value + end + + def OurPrice + @ourPrice + end + + def OurPrice=(value) + @ourPrice = value + end + + def MerchantSku + @merchantSku + end + + def MerchantSku=(value) + @merchantSku = value + end + + def initialize(itemId = nil, productName = nil, catalog = nil, asin = nil, exchangeId = nil, quantity = nil, listPrice = nil, ourPrice = nil, merchantSku = nil) + @itemId = itemId + @productName = productName + @catalog = catalog + @asin = asin + @exchangeId = exchangeId + @quantity = quantity + @listPrice = listPrice + @ourPrice = ourPrice + @merchantSku = merchantSku + end +end + +# {http://soap.amazon.com}ItemQuantityArray +class ItemQuantityArray < ::Array + @@schema_type = "ItemQuantity" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}ItemQuantity +class ItemQuantity + @@schema_type = "ItemQuantity" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["itemId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ItemId")]], ["quantity", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Quantity")]]] + + def ItemId + @itemId + end + + def ItemId=(value) + @itemId = value + end + + def Quantity + @quantity + end + + def Quantity=(value) + @quantity = value + end + + def initialize(itemId = nil, quantity = nil) + @itemId = itemId + @quantity = quantity + end +end + +# {http://soap.amazon.com}AddItemArray +class AddItemArray < ::Array + @@schema_type = "AddItem" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}AddItem +class AddItem + @@schema_type = "AddItem" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["parentAsin", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ParentAsin")]], ["asin", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Asin")]], ["merchantId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MerchantId")]], ["exchangeId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeId")]], ["quantity", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Quantity")]]] + + def ParentAsin + @parentAsin + end + + def ParentAsin=(value) + @parentAsin = value + end + + def Asin + @asin + end + + def Asin=(value) + @asin = value + end + + def MerchantId + @merchantId + end + + def MerchantId=(value) + @merchantId = value + end + + def ExchangeId + @exchangeId + end + + def ExchangeId=(value) + @exchangeId = value + end + + def Quantity + @quantity + end + + def Quantity=(value) + @quantity = value + end + + def initialize(parentAsin = nil, asin = nil, merchantId = nil, exchangeId = nil, quantity = nil) + @parentAsin = parentAsin + @asin = asin + @merchantId = merchantId + @exchangeId = exchangeId + @quantity = quantity + end +end + +# {http://soap.amazon.com}ShoppingCart +class ShoppingCart + @@schema_type = "ShoppingCart" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["cartId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "CartId")]], ["hMAC", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "HMAC")]], ["purchaseUrl", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "PurchaseUrl")]], ["items", ["ItemArray", XSD::QName.new("http://soap.amazon.com", "Items")]], ["similarProducts", ["SimilarProductsArray", XSD::QName.new("http://soap.amazon.com", "SimilarProducts")]]] + + def CartId + @cartId + end + + def CartId=(value) + @cartId = value + end + + def HMAC + @hMAC + end + + def HMAC=(value) + @hMAC = value + end + + def PurchaseUrl + @purchaseUrl + end + + def PurchaseUrl=(value) + @purchaseUrl = value + end + + def Items + @items + end + + def Items=(value) + @items = value + end + + def SimilarProducts + @similarProducts + end + + def SimilarProducts=(value) + @similarProducts = value + end + + def initialize(cartId = nil, hMAC = nil, purchaseUrl = nil, items = nil, similarProducts = nil) + @cartId = cartId + @hMAC = hMAC + @purchaseUrl = purchaseUrl + @items = items + @similarProducts = similarProducts + end +end + +# {http://soap.amazon.com}GetShoppingCartRequest +class GetShoppingCartRequest + @@schema_type = "GetShoppingCartRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["tag", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["cartId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "CartId")]], ["hMAC", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "HMAC")]], ["locale", "SOAP::SOAPString"], ["sims", "SOAP::SOAPString"], ["mergeCart", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MergeCart")]]] + + attr_accessor :tag + attr_accessor :devtag + attr_accessor :locale + attr_accessor :sims + + def CartId + @cartId + end + + def CartId=(value) + @cartId = value + end + + def HMAC + @hMAC + end + + def HMAC=(value) + @hMAC = value + end + + def MergeCart + @mergeCart + end + + def MergeCart=(value) + @mergeCart = value + end + + def initialize(tag = nil, devtag = nil, cartId = nil, hMAC = nil, locale = nil, sims = nil, mergeCart = nil) + @tag = tag + @devtag = devtag + @cartId = cartId + @hMAC = hMAC + @locale = locale + @sims = sims + @mergeCart = mergeCart + end +end + +# {http://soap.amazon.com}ClearShoppingCartRequest +class ClearShoppingCartRequest + @@schema_type = "ClearShoppingCartRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["tag", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["cartId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "CartId")]], ["hMAC", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "HMAC")]], ["locale", "SOAP::SOAPString"], ["mergeCart", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MergeCart")]]] + + attr_accessor :tag + attr_accessor :devtag + attr_accessor :locale + + def CartId + @cartId + end + + def CartId=(value) + @cartId = value + end + + def HMAC + @hMAC + end + + def HMAC=(value) + @hMAC = value + end + + def MergeCart + @mergeCart + end + + def MergeCart=(value) + @mergeCart = value + end + + def initialize(tag = nil, devtag = nil, cartId = nil, hMAC = nil, locale = nil, mergeCart = nil) + @tag = tag + @devtag = devtag + @cartId = cartId + @hMAC = hMAC + @locale = locale + @mergeCart = mergeCart + end +end + +# {http://soap.amazon.com}AddShoppingCartItemsRequest +class AddShoppingCartItemsRequest + @@schema_type = "AddShoppingCartItemsRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["tag", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["cartId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "CartId")]], ["hMAC", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "HMAC")]], ["items", ["AddItemArray", XSD::QName.new("http://soap.amazon.com", "Items")]], ["locale", "SOAP::SOAPString"], ["sims", "SOAP::SOAPString"], ["mergeCart", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MergeCart")]]] + + attr_accessor :tag + attr_accessor :devtag + attr_accessor :locale + attr_accessor :sims + + def CartId + @cartId + end + + def CartId=(value) + @cartId = value + end + + def HMAC + @hMAC + end + + def HMAC=(value) + @hMAC = value + end + + def Items + @items + end + + def Items=(value) + @items = value + end + + def MergeCart + @mergeCart + end + + def MergeCart=(value) + @mergeCart = value + end + + def initialize(tag = nil, devtag = nil, cartId = nil, hMAC = nil, items = nil, locale = nil, sims = nil, mergeCart = nil) + @tag = tag + @devtag = devtag + @cartId = cartId + @hMAC = hMAC + @items = items + @locale = locale + @sims = sims + @mergeCart = mergeCart + end +end + +# {http://soap.amazon.com}RemoveShoppingCartItemsRequest +class RemoveShoppingCartItemsRequest + @@schema_type = "RemoveShoppingCartItemsRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["tag", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["cartId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "CartId")]], ["hMAC", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "HMAC")]], ["items", ["ItemIdArray", XSD::QName.new("http://soap.amazon.com", "Items")]], ["locale", "SOAP::SOAPString"], ["sims", "SOAP::SOAPString"], ["mergeCart", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MergeCart")]]] + + attr_accessor :tag + attr_accessor :devtag + attr_accessor :locale + attr_accessor :sims + + def CartId + @cartId + end + + def CartId=(value) + @cartId = value + end + + def HMAC + @hMAC + end + + def HMAC=(value) + @hMAC = value + end + + def Items + @items + end + + def Items=(value) + @items = value + end + + def MergeCart + @mergeCart + end + + def MergeCart=(value) + @mergeCart = value + end + + def initialize(tag = nil, devtag = nil, cartId = nil, hMAC = nil, items = nil, locale = nil, sims = nil, mergeCart = nil) + @tag = tag + @devtag = devtag + @cartId = cartId + @hMAC = hMAC + @items = items + @locale = locale + @sims = sims + @mergeCart = mergeCart + end +end + +# {http://soap.amazon.com}ModifyShoppingCartItemsRequest +class ModifyShoppingCartItemsRequest + @@schema_type = "ModifyShoppingCartItemsRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["tag", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["cartId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "CartId")]], ["hMAC", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "HMAC")]], ["items", ["ItemQuantityArray", XSD::QName.new("http://soap.amazon.com", "Items")]], ["locale", "SOAP::SOAPString"], ["sims", "SOAP::SOAPString"], ["mergeCart", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "MergeCart")]]] + + attr_accessor :tag + attr_accessor :devtag + attr_accessor :locale + attr_accessor :sims + + def CartId + @cartId + end + + def CartId=(value) + @cartId = value + end + + def HMAC + @hMAC + end + + def HMAC=(value) + @hMAC = value + end + + def Items + @items + end + + def Items=(value) + @items = value + end + + def MergeCart + @mergeCart + end + + def MergeCart=(value) + @mergeCart = value + end + + def initialize(tag = nil, devtag = nil, cartId = nil, hMAC = nil, items = nil, locale = nil, sims = nil, mergeCart = nil) + @tag = tag + @devtag = devtag + @cartId = cartId + @hMAC = hMAC + @items = items + @locale = locale + @sims = sims + @mergeCart = mergeCart + end +end + +# {http://soap.amazon.com}OrderIdArray +class OrderIdArray < ::Array + @@schema_type = "string" + @@schema_ns = "http://www.w3.org/2001/XMLSchema" +end + +# {http://soap.amazon.com}Price +class Price + @@schema_type = "Price" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["amount", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Amount")]], ["currencyCode", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "CurrencyCode")]]] + + def Amount + @amount + end + + def Amount=(value) + @amount = value + end + + def CurrencyCode + @currencyCode + end + + def CurrencyCode=(value) + @currencyCode = value + end + + def initialize(amount = nil, currencyCode = nil) + @amount = amount + @currencyCode = currencyCode + end +end + +# {http://soap.amazon.com}Package +class Package + @@schema_type = "Package" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["trackingNumber", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "TrackingNumber")]], ["carrierName", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "CarrierName")]]] + + def TrackingNumber + @trackingNumber + end + + def TrackingNumber=(value) + @trackingNumber = value + end + + def CarrierName + @carrierName + end + + def CarrierName=(value) + @carrierName = value + end + + def initialize(trackingNumber = nil, carrierName = nil) + @trackingNumber = trackingNumber + @carrierName = carrierName + end +end + +# {http://soap.amazon.com}PackageArray +class PackageArray < ::Array + @@schema_type = "Package" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}OrderItem +class OrderItem + @@schema_type = "OrderItem" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["itemNumber", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ItemNumber")]], ["aSIN", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ASIN")]], ["exchangeId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ExchangeId")]], ["quantity", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Quantity")]], ["unitPrice", ["Price", XSD::QName.new("http://soap.amazon.com", "UnitPrice")]], ["totalPrice", ["Price", XSD::QName.new("http://soap.amazon.com", "TotalPrice")]]] + + def ItemNumber + @itemNumber + end + + def ItemNumber=(value) + @itemNumber = value + end + + def ASIN + @aSIN + end + + def ASIN=(value) + @aSIN = value + end + + def ExchangeId + @exchangeId + end + + def ExchangeId=(value) + @exchangeId = value + end + + def Quantity + @quantity + end + + def Quantity=(value) + @quantity = value + end + + def UnitPrice + @unitPrice + end + + def UnitPrice=(value) + @unitPrice = value + end + + def TotalPrice + @totalPrice + end + + def TotalPrice=(value) + @totalPrice = value + end + + def initialize(itemNumber = nil, aSIN = nil, exchangeId = nil, quantity = nil, unitPrice = nil, totalPrice = nil) + @itemNumber = itemNumber + @aSIN = aSIN + @exchangeId = exchangeId + @quantity = quantity + @unitPrice = unitPrice + @totalPrice = totalPrice + end +end + +# {http://soap.amazon.com}OrderItemArray +class OrderItemArray < ::Array + @@schema_type = "OrderItem" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}ShortSummary +class ShortSummary + @@schema_type = "ShortSummary" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["orderId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "OrderId")]], ["sellerId", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "SellerId")]], ["condition", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "Condition")]], ["transactionDate", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "TransactionDate")]], ["transactionDateEpoch", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "TransactionDateEpoch")]], ["total", ["Price", XSD::QName.new("http://soap.amazon.com", "Total")]], ["subtotal", ["Price", XSD::QName.new("http://soap.amazon.com", "Subtotal")]], ["shipping", ["Price", XSD::QName.new("http://soap.amazon.com", "Shipping")]], ["tax", ["Price", XSD::QName.new("http://soap.amazon.com", "Tax")]], ["promotion", ["Price", XSD::QName.new("http://soap.amazon.com", "Promotion")]], ["storeName", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "StoreName")]], ["packages", ["PackageArray", XSD::QName.new("http://soap.amazon.com", "Packages")]], ["orderItems", ["OrderItemArray", XSD::QName.new("http://soap.amazon.com", "OrderItems")]], ["errorCode", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ErrorCode")]], ["errorString", ["SOAP::SOAPString", XSD::QName.new("http://soap.amazon.com", "ErrorString")]]] + + def OrderId + @orderId + end + + def OrderId=(value) + @orderId = value + end + + def SellerId + @sellerId + end + + def SellerId=(value) + @sellerId = value + end + + def Condition + @condition + end + + def Condition=(value) + @condition = value + end + + def TransactionDate + @transactionDate + end + + def TransactionDate=(value) + @transactionDate = value + end + + def TransactionDateEpoch + @transactionDateEpoch + end + + def TransactionDateEpoch=(value) + @transactionDateEpoch = value + end + + def Total + @total + end + + def Total=(value) + @total = value + end + + def Subtotal + @subtotal + end + + def Subtotal=(value) + @subtotal = value + end + + def Shipping + @shipping + end + + def Shipping=(value) + @shipping = value + end + + def Tax + @tax + end + + def Tax=(value) + @tax = value + end + + def Promotion + @promotion + end + + def Promotion=(value) + @promotion = value + end + + def StoreName + @storeName + end + + def StoreName=(value) + @storeName = value + end + + def Packages + @packages + end + + def Packages=(value) + @packages = value + end + + def OrderItems + @orderItems + end + + def OrderItems=(value) + @orderItems = value + end + + def ErrorCode + @errorCode + end + + def ErrorCode=(value) + @errorCode = value + end + + def ErrorString + @errorString + end + + def ErrorString=(value) + @errorString = value + end + + def initialize(orderId = nil, sellerId = nil, condition = nil, transactionDate = nil, transactionDateEpoch = nil, total = nil, subtotal = nil, shipping = nil, tax = nil, promotion = nil, storeName = nil, packages = nil, orderItems = nil, errorCode = nil, errorString = nil) + @orderId = orderId + @sellerId = sellerId + @condition = condition + @transactionDate = transactionDate + @transactionDateEpoch = transactionDateEpoch + @total = total + @subtotal = subtotal + @shipping = shipping + @tax = tax + @promotion = promotion + @storeName = storeName + @packages = packages + @orderItems = orderItems + @errorCode = errorCode + @errorString = errorString + end +end + +# {http://soap.amazon.com}ShortSummaryArray +class ShortSummaryArray < ::Array + @@schema_type = "ShortSummary" + @@schema_ns = "http://soap.amazon.com" +end + +# {http://soap.amazon.com}GetTransactionDetailsRequest +class GetTransactionDetailsRequest + @@schema_type = "GetTransactionDetailsRequest" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["tag", "SOAP::SOAPString"], ["devtag", "SOAP::SOAPString"], ["key", "SOAP::SOAPString"], ["orderIds", ["OrderIdArray", XSD::QName.new("http://soap.amazon.com", "OrderIds")]], ["locale", "SOAP::SOAPString"]] + + attr_accessor :tag + attr_accessor :devtag + attr_accessor :key + attr_accessor :locale + + def OrderIds + @orderIds + end + + def OrderIds=(value) + @orderIds = value + end + + def initialize(tag = nil, devtag = nil, key = nil, orderIds = nil, locale = nil) + @tag = tag + @devtag = devtag + @key = key + @orderIds = orderIds + @locale = locale + end +end + +# {http://soap.amazon.com}GetTransactionDetailsResponse +class GetTransactionDetailsResponse + @@schema_type = "GetTransactionDetailsResponse" + @@schema_ns = "http://soap.amazon.com" + @@schema_element = [["shortSummaries", ["ShortSummaryArray", XSD::QName.new("http://soap.amazon.com", "ShortSummaries")]]] + + def ShortSummaries + @shortSummaries + end + + def ShortSummaries=(value) + @shortSummaries = value + end + + def initialize(shortSummaries = nil) + @shortSummaries = shortSummaries + end +end diff --git a/sample/showcase/wsdl/amazon/AmazonSearchDriver.rb b/sample/showcase/wsdl/amazon/AmazonSearchDriver.rb new file mode 100644 index 0000000..7148c27 --- /dev/null +++ b/sample/showcase/wsdl/amazon/AmazonSearchDriver.rb @@ -0,0 +1,546 @@ +require 'AmazonSearch.rb' + +require 'soap/rpc/driver' + +class AmazonSearchPort < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://soap.amazon.com/onca/soap3" + MappingRegistry = ::SOAP::Mapping::Registry.new + + MappingRegistry.set( + KeywordRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "KeywordRequest") } + ) + MappingRegistry.set( + ProductInfo, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ProductInfo") } + ) + MappingRegistry.set( + DetailsArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "Details") } + ) + MappingRegistry.set( + TextStreamRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "TextStreamRequest") } + ) + MappingRegistry.set( + PowerRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "PowerRequest") } + ) + MappingRegistry.set( + BrowseNodeRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "BrowseNodeRequest") } + ) + MappingRegistry.set( + AsinRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "AsinRequest") } + ) + MappingRegistry.set( + BlendedRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "BlendedRequest") } + ) + MappingRegistry.set( + ProductLineArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ProductLine") } + ) + MappingRegistry.set( + UpcRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "UpcRequest") } + ) + MappingRegistry.set( + SkuRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "SkuRequest") } + ) + MappingRegistry.set( + AuthorRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "AuthorRequest") } + ) + MappingRegistry.set( + ArtistRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ArtistRequest") } + ) + MappingRegistry.set( + ActorRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ActorRequest") } + ) + MappingRegistry.set( + ManufacturerRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ManufacturerRequest") } + ) + MappingRegistry.set( + DirectorRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "DirectorRequest") } + ) + MappingRegistry.set( + ListManiaRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ListManiaRequest") } + ) + MappingRegistry.set( + WishlistRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "WishlistRequest") } + ) + MappingRegistry.set( + ExchangeRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ExchangeRequest") } + ) + MappingRegistry.set( + ListingProductDetails, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ListingProductDetails") } + ) + MappingRegistry.set( + MarketplaceRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "MarketplaceRequest") } + ) + MappingRegistry.set( + MarketplaceSearch, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "MarketplaceSearch") } + ) + MappingRegistry.set( + MarketplaceSearchDetailsArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "MarketplaceSearchDetails") } + ) + MappingRegistry.set( + SellerProfileRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "SellerProfileRequest") } + ) + MappingRegistry.set( + SellerProfile, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "SellerProfile") } + ) + MappingRegistry.set( + SellerProfileDetailsArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "SellerProfileDetails") } + ) + MappingRegistry.set( + SellerRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "SellerRequest") } + ) + MappingRegistry.set( + SellerSearch, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "SellerSearch") } + ) + MappingRegistry.set( + SellerSearchDetailsArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "SellerSearchDetails") } + ) + MappingRegistry.set( + SimilarityRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "SimilarityRequest") } + ) + MappingRegistry.set( + GetShoppingCartRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "GetShoppingCartRequest") } + ) + MappingRegistry.set( + ShoppingCart, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ShoppingCart") } + ) + MappingRegistry.set( + ItemArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "Item") } + ) + MappingRegistry.set( + SimilarProductsArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") } + ) + MappingRegistry.set( + ClearShoppingCartRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ClearShoppingCartRequest") } + ) + MappingRegistry.set( + AddShoppingCartItemsRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "AddShoppingCartItemsRequest") } + ) + MappingRegistry.set( + AddItemArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "AddItem") } + ) + MappingRegistry.set( + RemoveShoppingCartItemsRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "RemoveShoppingCartItemsRequest") } + ) + MappingRegistry.set( + ItemIdArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") } + ) + MappingRegistry.set( + ModifyShoppingCartItemsRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ModifyShoppingCartItemsRequest") } + ) + MappingRegistry.set( + ItemQuantityArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ItemQuantity") } + ) + MappingRegistry.set( + GetTransactionDetailsRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "GetTransactionDetailsRequest") } + ) + MappingRegistry.set( + OrderIdArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") } + ) + MappingRegistry.set( + GetTransactionDetailsResponse, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "GetTransactionDetailsResponse") } + ) + MappingRegistry.set( + ShortSummaryArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ShortSummary") } + ) + MappingRegistry.set( + Details, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "Details") } + ) + MappingRegistry.set( + ProductLine, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ProductLine") } + ) + MappingRegistry.set( + MarketplaceSearchDetails, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "MarketplaceSearchDetails") } + ) + MappingRegistry.set( + SellerProfileDetails, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "SellerProfileDetails") } + ) + MappingRegistry.set( + SellerSearchDetails, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "SellerSearchDetails") } + ) + MappingRegistry.set( + Item, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "Item") } + ) + MappingRegistry.set( + AddItem, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "AddItem") } + ) + MappingRegistry.set( + ItemQuantity, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ItemQuantity") } + ) + MappingRegistry.set( + ShortSummary, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ShortSummary") } + ) + + Methods = [ + ["KeywordSearchRequest", "keywordSearchRequest", + [ + [:in, "KeywordSearchRequest", ["KeywordRequest", "http://soap.amazon.com", "KeywordRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["TextStreamSearchRequest", "textStreamSearchRequest", + [ + [:in, "TextStreamSearchRequest", ["TextStreamRequest", "http://soap.amazon.com", "TextStreamRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["PowerSearchRequest", "powerSearchRequest", + [ + [:in, "PowerSearchRequest", ["PowerRequest", "http://soap.amazon.com", "PowerRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["BrowseNodeSearchRequest", "browseNodeSearchRequest", + [ + [:in, "BrowseNodeSearchRequest", ["BrowseNodeRequest", "http://soap.amazon.com", "BrowseNodeRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["AsinSearchRequest", "asinSearchRequest", + [ + [:in, "AsinSearchRequest", ["AsinRequest", "http://soap.amazon.com", "AsinRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["BlendedSearchRequest", "blendedSearchRequest", + [ + [:in, "BlendedSearchRequest", ["BlendedRequest", "http://soap.amazon.com", "BlendedRequest"]], + [:retval, "return", ["ProductLine[]", "http://soap.amazon.com", "ProductLine"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["UpcSearchRequest", "upcSearchRequest", + [ + [:in, "UpcSearchRequest", ["UpcRequest", "http://soap.amazon.com", "UpcRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["SkuSearchRequest", "skuSearchRequest", + [ + [:in, "SkuSearchRequest", ["SkuRequest", "http://soap.amazon.com", "SkuRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["AuthorSearchRequest", "authorSearchRequest", + [ + [:in, "AuthorSearchRequest", ["AuthorRequest", "http://soap.amazon.com", "AuthorRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["ArtistSearchRequest", "artistSearchRequest", + [ + [:in, "ArtistSearchRequest", ["ArtistRequest", "http://soap.amazon.com", "ArtistRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["ActorSearchRequest", "actorSearchRequest", + [ + [:in, "ActorSearchRequest", ["ActorRequest", "http://soap.amazon.com", "ActorRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["ManufacturerSearchRequest", "manufacturerSearchRequest", + [ + [:in, "ManufacturerSearchRequest", ["ManufacturerRequest", "http://soap.amazon.com", "ManufacturerRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["DirectorSearchRequest", "directorSearchRequest", + [ + [:in, "DirectorSearchRequest", ["DirectorRequest", "http://soap.amazon.com", "DirectorRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["ListManiaSearchRequest", "listManiaSearchRequest", + [ + [:in, "ListManiaSearchRequest", ["ListManiaRequest", "http://soap.amazon.com", "ListManiaRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["WishlistSearchRequest", "wishlistSearchRequest", + [ + [:in, "WishlistSearchRequest", ["WishlistRequest", "http://soap.amazon.com", "WishlistRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["ExchangeSearchRequest", "exchangeSearchRequest", + [ + [:in, "ExchangeSearchRequest", ["ExchangeRequest", "http://soap.amazon.com", "ExchangeRequest"]], + [:retval, "return", ["ListingProductDetails", "http://soap.amazon.com", "ListingProductDetails"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["MarketplaceSearchRequest", "marketplaceSearchRequest", + [ + [:in, "MarketplaceSearchRequest", ["MarketplaceRequest", "http://soap.amazon.com", "MarketplaceRequest"]], + [:retval, "return", ["MarketplaceSearch", "http://soap.amazon.com", "MarketplaceSearch"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["SellerProfileSearchRequest", "sellerProfileSearchRequest", + [ + [:in, "SellerProfileSearchRequest", ["SellerProfileRequest", "http://soap.amazon.com", "SellerProfileRequest"]], + [:retval, "return", ["SellerProfile", "http://soap.amazon.com", "SellerProfile"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["SellerSearchRequest", "sellerSearchRequest", + [ + [:in, "SellerSearchRequest", ["SellerRequest", "http://soap.amazon.com", "SellerRequest"]], + [:retval, "return", ["SellerSearch", "http://soap.amazon.com", "SellerSearch"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["SimilaritySearchRequest", "similaritySearchRequest", + [ + [:in, "SimilaritySearchRequest", ["SimilarityRequest", "http://soap.amazon.com", "SimilarityRequest"]], + [:retval, "return", ["ProductInfo", "http://soap.amazon.com", "ProductInfo"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["GetShoppingCartRequest", "getShoppingCartRequest", + [ + [:in, "GetShoppingCartRequest", ["GetShoppingCartRequest", "http://soap.amazon.com", "GetShoppingCartRequest"]], + [:retval, "ShoppingCart", ["ShoppingCart", "http://soap.amazon.com", "ShoppingCart"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["ClearShoppingCartRequest", "clearShoppingCartRequest", + [ + [:in, "ClearShoppingCartRequest", ["ClearShoppingCartRequest", "http://soap.amazon.com", "ClearShoppingCartRequest"]], + [:retval, "ShoppingCart", ["ShoppingCart", "http://soap.amazon.com", "ShoppingCart"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["AddShoppingCartItemsRequest", "addShoppingCartItemsRequest", + [ + [:in, "AddShoppingCartItemsRequest", ["AddShoppingCartItemsRequest", "http://soap.amazon.com", "AddShoppingCartItemsRequest"]], + [:retval, "ShoppingCart", ["ShoppingCart", "http://soap.amazon.com", "ShoppingCart"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["RemoveShoppingCartItemsRequest", "removeShoppingCartItemsRequest", + [ + [:in, "RemoveShoppingCartItemsRequest", ["RemoveShoppingCartItemsRequest", "http://soap.amazon.com", "RemoveShoppingCartItemsRequest"]], + [:retval, "ShoppingCart", ["ShoppingCart", "http://soap.amazon.com", "ShoppingCart"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["ModifyShoppingCartItemsRequest", "modifyShoppingCartItemsRequest", + [ + [:in, "ModifyShoppingCartItemsRequest", ["ModifyShoppingCartItemsRequest", "http://soap.amazon.com", "ModifyShoppingCartItemsRequest"]], + [:retval, "ShoppingCart", ["ShoppingCart", "http://soap.amazon.com", "ShoppingCart"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ], + ["GetTransactionDetailsRequest", "getTransactionDetailsRequest", + [ + [:in, "GetTransactionDetailsRequest", ["GetTransactionDetailsRequest", "http://soap.amazon.com", "GetTransactionDetailsRequest"]], + [:retval, "GetTransactionDetailsResponse", ["GetTransactionDetailsResponse", "http://soap.amazon.com", "GetTransactionDetailsResponse"]] + ], + "http://soap.amazon.com", "http://soap.amazon.com", :rpc + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = MappingRegistry + init_methods + end + +private + + def init_methods + Methods.each do |name_as, name, params, soapaction, namespace, style| + qname = XSD::QName.new(namespace, name_as) + if style == :document + @proxy.add_document_method(soapaction, name, params) + add_document_method_interface(name, params) + else + @proxy.add_rpc_method(qname, soapaction, name, params) + add_rpc_method_interface(name, params) + end + if name_as != name and name_as.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, name_as) do |*arg| + __send__(name, *arg) + end + end + end + end +end + diff --git a/sample/showcase/wsdl/amazon/sampleClient.rb b/sample/showcase/wsdl/amazon/sampleClient.rb new file mode 100644 index 0000000..3caad84 --- /dev/null +++ b/sample/showcase/wsdl/amazon/sampleClient.rb @@ -0,0 +1,37 @@ +#!/usr/bin/env ruby + +# This file is a sample based on AmazonSearchServiceClient.rb, which can be +# generated by WSDL file and wsdl2ruby.rb. +# +# $ wsdl2ruby.rb --type client --force \ +# --wsdl http://soap.amazon.com/schemas3/AmazonWebServices.wsdl +# +# See wsdlDriver.rb to use WSDL file directly (slow). +require 'AmazonSearchDriver.rb' + +endpoint_url = ARGV.shift +obj = AmazonSearchPort.new(endpoint_url) + +# Uncomment the below line to see SOAP wiredumps. +# obj.wiredump_dev = STDERR + +# SYNOPSIS +# KeywordSearchRequest(keywordSearchRequest) +# +# ARGS +# keywordSearchRequest KeywordRequest - {urn:PI/DevCentral/SoapService}KeywordRequest +# +# RETURNS +# return ProductInfo - {urn:PI/DevCentral/SoapService}ProductInfo +# +# RAISES +# N/A +# +keywordSearchRequest = KeywordRequest.new("Ruby Object", "1", "books", "webservices-20", "lite", "", "+salesrank") +obj.keywordSearchRequest(keywordSearchRequest).Details.each do |detail| + puts "== #{detail.ProductName}" + puts "Author: #{detail.Authors.join(", ")}" + puts "Release date: #{detail.ReleaseDate}" + puts "List price: #{detail.ListPrice}, our price: #{detail.OurPrice}" + puts +end diff --git a/sample/showcase/wsdl/amazon/wsdlDriver.rb b/sample/showcase/wsdl/amazon/wsdlDriver.rb new file mode 100644 index 0000000..a0db57b --- /dev/null +++ b/sample/showcase/wsdl/amazon/wsdlDriver.rb @@ -0,0 +1,52 @@ +require 'soap/wsdlDriver' + +book = ARGV.shift || "Ruby" + +# AmazonSearch.rb is generated from WSDL. +# Run "wsdl2ruby.rb --wsdl http://soap.amazon.com/schemas3/AmazonWebServices.wsdl --classdef --force" +# http://soap.amazon.com/schemas3/AmazonWebServices.wsdl +require 'AmazonSearch.rb' + +=begin +Or, define the class by yourself like this. + +class KeywordRequest + def initialize(keyword = nil, + page = nil, + mode = nil, + tag = nil, + type = nil, + devtag = nil, + sort = nil) + @keyword = keyword + @page = page + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @sort = sort + end +end +=end + +# You must get 'developer's token" from http://associates.amazon.com/exec/panama/associates/ntg/browse/-/1067662 to use Amazon Web Services 2.0. +#devtag = File.open(File.expand_path("~/.amazon_key")) { |f| f.read }.chomp +devtag = nil + +# v2: AMAZON_WSDL = 'http://soap.amazon.com/schemas2/AmazonWebServices.wsdl' +AMAZON_WSDL = 'http://soap.amazon.com/schemas3/AmazonWebServices.wsdl' +amazon = SOAP::WSDLDriverFactory.new(AMAZON_WSDL).create_rpc_driver +p "WSDL loaded" +amazon.generate_explicit_type = true +amazon.mandatorycharset = 'utf-8' # AWS should fix this bug. +#amazon.wiredump_dev = STDERR + +# Show sales rank. +req = KeywordRequest.new(book, "1", "books", "webservices-20", "lite", devtag, "+salesrank") +amazon.KeywordSearchRequest(req).Details.each do |detail| + puts "== #{detail.ProductName}" + puts "Author: #{detail.Authors.join(", ")}" + puts "Release date: #{detail.ReleaseDate}" + puts "List price: #{detail.ListPrice}, our price: #{detail.OurPrice}" + puts +end diff --git a/sample/showcase/wsdl/amazonEC/client.rb b/sample/showcase/wsdl/amazonEC/client.rb new file mode 100644 index 0000000..313f01d --- /dev/null +++ b/sample/showcase/wsdl/amazonEC/client.rb @@ -0,0 +1,13 @@ +require 'soap/wsdlDriver' + +wsdl = 'http://webservices.amazon.com/AWSECommerceService/JP/AWSECommerceService.wsdl' +wsdl = 'AWSECommerceService.wsdl' + +require 'default' +drv = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver +drv.wiredump_dev = STDOUT if $DEBUG + +# I don't have an account of AWSECommerce so the following code is not tested. +# Please tell me (nahi@ruby-lang.org) if you will get good/bad result in +# communicating with AWSECommerce Server... +p drv.ItemSearch(ItemSearch.new("123", "tag", "Double", "validate")) diff --git a/sample/showcase/wsdl/eBaySvc/sampleclient.rb b/sample/showcase/wsdl/eBaySvc/sampleclient.rb new file mode 100755 index 0000000..a4388f2 --- /dev/null +++ b/sample/showcase/wsdl/eBaySvc/sampleclient.rb @@ -0,0 +1,60 @@ +#!/usr/bin/env ruby + +# This client sample is contributed by Garry Dolley at soap4r ML. +# You need to generate default.rb and defaultDriver.rb by wsdl2ruby.rb tool. +# +# % ruby wsdl2ruby.rb --wsdl http://developer.ebay.com/webservices/latest/eBaySvc.wsdl --type client --force +# +# You may need to get eBaySvc.wsdl and patch it with eBaySvc.wsdl.diff in the +# same directory to avoid eBaySvc.wsdl's namespace usage problem. + +require 'defaultDriver.rb' +require 'soap/header/simplehandler' + +class RequesterCredentialsHandler < SOAP::Header::SimpleHandler + HeaderName = XSD::QName.new('urn:ebay:apis:eBLBaseComponents', 'RequesterCredentials') + Credentials = XSD::QName.new('urn:ebay:apis:eBLBaseComponents', 'Credentials') + + EbayAuthToken = XSD::QName.new(nil, 'eBayAuthToken') + DevId = XSD::QName.new(nil, 'DevId') + AppId = XSD::QName.new(nil, 'AppId') + AuthCert = XSD::QName.new(nil, 'AuthCert') + + def initialize(eBayAuthToken, devId, appId, authCert) + super(HeaderName) + @token, @devId, @appId, @cert = eBayAuthToken, devId, appId, authCert + end + + def on_simple_outbound + { EbayAuthToken => @token, + Credentials => { DevId => @devId, AppId => @appId, AuthCert => @cert } } + end +end + +callName = 'GeteBayOfficialTime' +siteId = '0' +appId = '__appid__' +devId = '__devid__' +certId = '__certid__' +version = '433' + +authToken = '__authtoken__' + +endpoint_url = 'https://api.sandbox.ebay.com/wsapi' + +request_url = endpoint_url + '?callname=' + callName + + '&siteid=' + siteId + + '&appid=' + appId + + '&version=' + version + + '&routing=default' + +service = EBayAPIInterface.new(request_url) +service.headerhandler << RequesterCredentialsHandler.new(authToken, +devId, appId, certId) + +request = GeteBayOfficialTimeRequestType.new() +request.version = version + +response = service.geteBayOfficialTime(request) + +puts response.timestamp diff --git a/sample/showcase/wsdl/googleAdwords/CampaignService.wsdl b/sample/showcase/wsdl/googleAdwords/CampaignService.wsdl new file mode 100644 index 0000000..2f45a6b --- /dev/null +++ b/sample/showcase/wsdl/googleAdwords/CampaignService.wsdl @@ -0,0 +1,785 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/showcase/wsdl/googleAdwords/ca.pem b/sample/showcase/wsdl/googleAdwords/ca.pem new file mode 100644 index 0000000..51285e3 --- /dev/null +++ b/sample/showcase/wsdl/googleAdwords/ca.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx +FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD +VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy +dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t +MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB +MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG +A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp +b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl +cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv +bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE +VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ +ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR +uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG +9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI +hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM +pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg== +-----END CERTIFICATE----- diff --git a/sample/showcase/wsdl/googleAdwords/client.rb b/sample/showcase/wsdl/googleAdwords/client.rb new file mode 100644 index 0000000..266905a --- /dev/null +++ b/sample/showcase/wsdl/googleAdwords/client.rb @@ -0,0 +1,40 @@ +# To generate default.rb, do like this; +# % wsdl2ruby.rb --wsdl "https://adwords.google.com/api/adwords/v2/CampaignService?WSDL" --classdef --force + +require 'soap/wsdlDriver' +require 'soap/header/simplehandler' +require 'default' + +class HeaderHandler < SOAP::Header::SimpleHandler + def initialize(tag, value) + super(XSD::QName.new(nil, tag)) + @tag = tag + @value = value + end + + def on_simple_outbound + @value + end +end + +wsdl = 'https://adwords.google.com/api/adwords/v2/CampaignService?WSDL' + +client = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + +client.wiredump_dev = STDOUT # Log high-level activity +client.wiredump_file_base = "log" # Log SOAP request and response + +# My Client Center manager account +client.headerhandler << HeaderHandler.new('email', 'email@example.com') + +client.headerhandler << HeaderHandler.new('password', 'mypassword') +client.headerhandler << HeaderHandler.new('useragent', 'soap4r test') +client.headerhandler << HeaderHandler.new('token', 'XYZ1234567890') + +# (Optional) Any client account you manage +client.headerhandler << HeaderHandler.new('clientEmail', 'abc@mail.com') + +camplist = client.call("getAllAdWordsCampaigns", + GetAllAdWordsCampaigns.new(123)) + +p camplist diff --git a/sample/showcase/wsdl/googleAdwords/soap/property b/sample/showcase/wsdl/googleAdwords/soap/property new file mode 100644 index 0000000..17bdac3 --- /dev/null +++ b/sample/showcase/wsdl/googleAdwords/soap/property @@ -0,0 +1 @@ +client.protocol.http.ssl_config.ca_file = ca.pem diff --git a/sample/showcase/wsdl/googleSearch/GoogleSearch.rb b/sample/showcase/wsdl/googleSearch/GoogleSearch.rb new file mode 100644 index 0000000..f89ac96 --- /dev/null +++ b/sample/showcase/wsdl/googleSearch/GoogleSearch.rb @@ -0,0 +1,97 @@ +require 'xsd/qname' + +# {urn:GoogleSearch}GoogleSearchResult +class GoogleSearchResult + @@schema_type = "GoogleSearchResult" + @@schema_ns = "urn:GoogleSearch" + @@schema_element = [["documentFiltering", "SOAP::SOAPBoolean"], ["searchComments", "SOAP::SOAPString"], ["estimatedTotalResultsCount", "SOAP::SOAPInt"], ["estimateIsExact", "SOAP::SOAPBoolean"], ["resultElements", "ResultElementArray"], ["searchQuery", "SOAP::SOAPString"], ["startIndex", "SOAP::SOAPInt"], ["endIndex", "SOAP::SOAPInt"], ["searchTips", "SOAP::SOAPString"], ["directoryCategories", "DirectoryCategoryArray"], ["searchTime", "SOAP::SOAPDouble"]] + + attr_accessor :documentFiltering + attr_accessor :searchComments + attr_accessor :estimatedTotalResultsCount + attr_accessor :estimateIsExact + attr_accessor :resultElements + attr_accessor :searchQuery + attr_accessor :startIndex + attr_accessor :endIndex + attr_accessor :searchTips + attr_accessor :directoryCategories + attr_accessor :searchTime + + def initialize(documentFiltering = nil, searchComments = nil, estimatedTotalResultsCount = nil, estimateIsExact = nil, resultElements = nil, searchQuery = nil, startIndex = nil, endIndex = nil, searchTips = nil, directoryCategories = nil, searchTime = nil) + @documentFiltering = documentFiltering + @searchComments = searchComments + @estimatedTotalResultsCount = estimatedTotalResultsCount + @estimateIsExact = estimateIsExact + @resultElements = resultElements + @searchQuery = searchQuery + @startIndex = startIndex + @endIndex = endIndex + @searchTips = searchTips + @directoryCategories = directoryCategories + @searchTime = searchTime + end +end + +# {urn:GoogleSearch}ResultElement +class ResultElement + @@schema_type = "ResultElement" + @@schema_ns = "urn:GoogleSearch" + @@schema_element = [["summary", "SOAP::SOAPString"], ["uRL", ["SOAP::SOAPString", XSD::QName.new("urn:GoogleSearch", "URL")]], ["snippet", "SOAP::SOAPString"], ["title", "SOAP::SOAPString"], ["cachedSize", "SOAP::SOAPString"], ["relatedInformationPresent", "SOAP::SOAPBoolean"], ["hostName", "SOAP::SOAPString"], ["directoryCategory", "DirectoryCategory"], ["directoryTitle", "SOAP::SOAPString"]] + + attr_accessor :summary + attr_accessor :snippet + attr_accessor :title + attr_accessor :cachedSize + attr_accessor :relatedInformationPresent + attr_accessor :hostName + attr_accessor :directoryCategory + attr_accessor :directoryTitle + + def URL + @uRL + end + + def URL=(value) + @uRL = value + end + + def initialize(summary = nil, uRL = nil, snippet = nil, title = nil, cachedSize = nil, relatedInformationPresent = nil, hostName = nil, directoryCategory = nil, directoryTitle = nil) + @summary = summary + @uRL = uRL + @snippet = snippet + @title = title + @cachedSize = cachedSize + @relatedInformationPresent = relatedInformationPresent + @hostName = hostName + @directoryCategory = directoryCategory + @directoryTitle = directoryTitle + end +end + +# {urn:GoogleSearch}ResultElementArray +class ResultElementArray < ::Array + @@schema_type = "ResultElement" + @@schema_ns = "urn:GoogleSearch" +end + +# {urn:GoogleSearch}DirectoryCategoryArray +class DirectoryCategoryArray < ::Array + @@schema_type = "DirectoryCategory" + @@schema_ns = "urn:GoogleSearch" +end + +# {urn:GoogleSearch}DirectoryCategory +class DirectoryCategory + @@schema_type = "DirectoryCategory" + @@schema_ns = "urn:GoogleSearch" + @@schema_element = [["fullViewableName", "SOAP::SOAPString"], ["specialEncoding", "SOAP::SOAPString"]] + + attr_accessor :fullViewableName + attr_accessor :specialEncoding + + def initialize(fullViewableName = nil, specialEncoding = nil) + @fullViewableName = fullViewableName + @specialEncoding = specialEncoding + end +end diff --git a/sample/showcase/wsdl/googleSearch/GoogleSearchDriver.rb b/sample/showcase/wsdl/googleSearch/GoogleSearchDriver.rb new file mode 100644 index 0000000..0324ae7 --- /dev/null +++ b/sample/showcase/wsdl/googleSearch/GoogleSearchDriver.rb @@ -0,0 +1,102 @@ +require 'GoogleSearch.rb' + +require 'soap/rpc/driver' + +class GoogleSearchPort < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://api.google.com/search/beta2" + MappingRegistry = ::SOAP::Mapping::Registry.new + + MappingRegistry.set( + GoogleSearchResult, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("urn:GoogleSearch", "GoogleSearchResult") } + ) + MappingRegistry.set( + ResultElementArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("urn:GoogleSearch", "ResultElement") } + ) + MappingRegistry.set( + DirectoryCategoryArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("urn:GoogleSearch", "DirectoryCategory") } + ) + MappingRegistry.set( + ResultElement, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("urn:GoogleSearch", "ResultElement") } + ) + MappingRegistry.set( + DirectoryCategory, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("urn:GoogleSearch", "DirectoryCategory") } + ) + + Methods = [ + ["doGetCachedPage", "doGetCachedPage", + [ + [:in, "key", ["::SOAP::SOAPString"]], + [:in, "url", ["::SOAP::SOAPString"]], + [:retval, "return", ["::SOAP::SOAPBase64"]] + ], + "urn:GoogleSearchAction", "urn:GoogleSearch", :rpc + ], + ["doSpellingSuggestion", "doSpellingSuggestion", + [ + [:in, "key", ["::SOAP::SOAPString"]], + [:in, "phrase", ["::SOAP::SOAPString"]], + [:retval, "return", ["::SOAP::SOAPString"]] + ], + "urn:GoogleSearchAction", "urn:GoogleSearch", :rpc + ], + ["doGoogleSearch", "doGoogleSearch", + [ + [:in, "key", ["::SOAP::SOAPString"]], + [:in, "q", ["::SOAP::SOAPString"]], + [:in, "start", ["::SOAP::SOAPInt"]], + [:in, "maxResults", ["::SOAP::SOAPInt"]], + [:in, "filter", ["::SOAP::SOAPBoolean"]], + [:in, "restrict", ["::SOAP::SOAPString"]], + [:in, "safeSearch", ["::SOAP::SOAPBoolean"]], + [:in, "lr", ["::SOAP::SOAPString"]], + [:in, "ie", ["::SOAP::SOAPString"]], + [:in, "oe", ["::SOAP::SOAPString"]], + [:retval, "return", ["GoogleSearchResult", "urn:GoogleSearch", "GoogleSearchResult"]] + ], + "urn:GoogleSearchAction", "urn:GoogleSearch", :rpc + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = MappingRegistry + init_methods + end + +private + + def init_methods + Methods.each do |name_as, name, params, soapaction, namespace, style| + qname = XSD::QName.new(namespace, name_as) + if style == :document + @proxy.add_document_method(soapaction, name, params) + add_document_method_interface(name, params) + else + @proxy.add_rpc_method(qname, soapaction, name, params) + add_rpc_method_interface(name, params) + end + if name_as != name and name_as.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, name_as) do |*arg| + __send__(name, *arg) + end + end + end + end +end + diff --git a/sample/showcase/wsdl/googleSearch/README b/sample/showcase/wsdl/googleSearch/README new file mode 100644 index 0000000..461a563 --- /dev/null +++ b/sample/showcase/wsdl/googleSearch/README @@ -0,0 +1,6 @@ +wsdlDriver.rb: Do google search using WSDL. + +Whole files except wsdl.rb in this directory is created by wsdl2ruby.rb from +GoogleSearch.wsdl with options; + +% wsdl2ruby.rb --wsdl http://api.google.com/GoogleSearch.wsdl --classdef --client_skelton --servant_skelton --cgi_stub --standalone_server_stub --driver --force diff --git a/sample/showcase/wsdl/googleSearch/httpd.rb b/sample/showcase/wsdl/googleSearch/httpd.rb new file mode 100644 index 0000000..bebcff9 --- /dev/null +++ b/sample/showcase/wsdl/googleSearch/httpd.rb @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby + +require 'webrick' +require 'soap/property' + +docroot = "." +port = 8808 +if opt = SOAP::Property.loadproperty("samplehttpd.conf") + docroot = opt["docroot"] + port = Integer(opt["port"]) +end + +s = WEBrick::HTTPServer.new( + :BindAddress => "0.0.0.0", + :Port => port, + :DocumentRoot => docroot, + :CGIPathEnv => ENV['PATH'] +) +trap(:INT){ s.shutdown } +s.start diff --git a/sample/showcase/wsdl/googleSearch/sampleClient.rb b/sample/showcase/wsdl/googleSearch/sampleClient.rb new file mode 100644 index 0000000..b05d57b --- /dev/null +++ b/sample/showcase/wsdl/googleSearch/sampleClient.rb @@ -0,0 +1,56 @@ +#!/usr/bin/env ruby + +# This file is a sample based on GoogleSearchClient.rb, which can be +# generated by WSDL file and wsdl2ruby.rb. +# +# $ wsdl2ruby.rb --type client --force \ +# --wsdl http://api.google.com/GoogleSearch.wsdl +# +# See wsdlDriver.rb to use WSDL file directly (slow). +require 'GoogleSearchDriver.rb' + +endpoint_url = ARGV.shift +obj = GoogleSearchPort.new(endpoint_url) + +# Uncomment the below line to see SOAP wiredumps. +# obj.wiredump_dev = STDERR + +# SYNOPSIS +# doGoogleSearch(key, q, start, maxResults, filter, restrict, safeSearch, lr, ie, oe) +# +# ARGS +# key - {http://www.w3.org/2001/XMLSchema}string +# q - {http://www.w3.org/2001/XMLSchema}string +# start - {http://www.w3.org/2001/XMLSchema}int +# maxResults - {http://www.w3.org/2001/XMLSchema}int +# filter - {http://www.w3.org/2001/XMLSchema}boolean +# restrict - {http://www.w3.org/2001/XMLSchema}string +# safeSearch - {http://www.w3.org/2001/XMLSchema}boolean +# lr - {http://www.w3.org/2001/XMLSchema}string +# ie - {http://www.w3.org/2001/XMLSchema}string +# oe - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# return GoogleSearchResult - {urn:GoogleSearch}GoogleSearchResult +# +# RAISES +# N/A +# +key = q = start = maxResults = filter = restrict = safeSearch = lr = ie = oe = nil +key = File.open(File.expand_path("~/.google_key")) { |f| f.read }.chomp +q = "Ruby" +start = 0 +maxResults = 10 +filter = false +restrict = "" +safeSearch = false +lr = "" +ie = "utf-8" +oe = "utf-8" +result = obj.doGoogleSearch(key, q, start, maxResults, filter, restrict, safeSearch, lr, ie, oe) + +result.resultElements.each do |ele| + puts "== #{ele.title}: #{ele.URL}" + puts ele.snippet + puts +end diff --git a/sample/showcase/wsdl/googleSearch/samplehttpd.conf b/sample/showcase/wsdl/googleSearch/samplehttpd.conf new file mode 100644 index 0000000..85e9995 --- /dev/null +++ b/sample/showcase/wsdl/googleSearch/samplehttpd.conf @@ -0,0 +1,2 @@ +docroot = . +port = 8808 diff --git a/sample/showcase/wsdl/googleSearch/sjissearch.sh b/sample/showcase/wsdl/googleSearch/sjissearch.sh new file mode 100644 index 0000000..b8efb20 --- /dev/null +++ b/sample/showcase/wsdl/googleSearch/sjissearch.sh @@ -0,0 +1,3 @@ +#!/bin/sh - + +ruby -Ks wsdlDriver.rb 'Ruby Ȃ' diff --git a/sample/showcase/wsdl/googleSearch/wsdlDriver.rb b/sample/showcase/wsdl/googleSearch/wsdlDriver.rb new file mode 100644 index 0000000..da1dd13 --- /dev/null +++ b/sample/showcase/wsdl/googleSearch/wsdlDriver.rb @@ -0,0 +1,29 @@ +#require 'uconv' +require 'soap/wsdlDriver' + +word = ARGV.shift +# You must get key from http://www.google.com/apis/ to use Google Web APIs. +key = File.open(File.expand_path("~/.google_key")) { |f| f.read }.chomp + +GOOGLE_WSDL = 'http://api.google.com/GoogleSearch.wsdl' +# GOOGLE_WSDL = 'GoogleSearch.wsdl' + +def html2rd(str) + str.gsub(%r((.*?)), '((*\\1*))').strip +end + + +google = SOAP::WSDLDriverFactory.new(GOOGLE_WSDL).create_rpc_driver +google.options["soap.envelope.use_numeric_character_reference"] = true +google.wiredump_dev = STDOUT if $DEBUG +#google.generate_explicit_type = false + +result = google.doGoogleSearch( key, word, 0, 10, false, "", false, "", 'utf-8', 'utf-8' ) + +exit + +result.resultElements.each do |ele| + puts "== #{html2rd(ele.title)}: #{ele["URL"]}" + puts html2rd(ele.snippet) + puts +end diff --git a/sample/showcase/wsdl/noaa/README.txt b/sample/showcase/wsdl/noaa/README.txt new file mode 100644 index 0000000..e378677 --- /dev/null +++ b/sample/showcase/wsdl/noaa/README.txt @@ -0,0 +1,5 @@ +1. run wsdl2ruby.rb againt ndfdXML.wsdl + +% bin/wsdl2ruby.rb --wsdl ndfdXML.wsdl --type client --force + +2. run client.rb to see how it works. diff --git a/sample/showcase/wsdl/noaa/client.rb b/sample/showcase/wsdl/noaa/client.rb new file mode 100644 index 0000000..f516d85 --- /dev/null +++ b/sample/showcase/wsdl/noaa/client.rb @@ -0,0 +1,44 @@ +## preparing + +t = Time.now +starter = Time.local(t.year,t.mon, t.day) + (24 *3600) +ender = starter + 7 * 24 *3600 +lattitude = 39.0 +longitude = -77.0 + +## accessing through dynamically generated driver + +require 'soap/wsdlDriver' + +params = {:maxt => false, :mint => false, :temp => true, :dew => true, + :pop12 => false, :qpf => false, :sky => false, :snow => false, + :wspd => false, :wdir => false, :wx => false, :waveh => false, + :icons => false} + +wsdl = "http://weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl" +drv = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver +drv.wiredump_dev = STDOUT if $DEBUG +dwml = drv.nDFDgen(lattitude, longitude, 'time-series', starter, ender, params) +puts dwml + +require 'xsd/mapping' +data = XSD::Mapping.xml2obj(dwml).data + +data.parameters.temperature.each do |temp| + p temp.name + p temp.value +end + +## accessing through statically generated driver + +# run wsdl2ruby.rb to create needed files like this; +# wsdl2ruby.rb --wsdl http://weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl --type client +require 'defaultDriver.rb' +params = WeatherParametersType.new(false, false, true, true, false, false, + false, false, false, false, false, false, false) + +drv = NdfdXMLPortType.new +drv.wiredump_dev = STDOUT if $DEBUG +dwml = drv.nDFDgen(lattitude, longitude, ProductType::TimeSeries, starter, + ender, params) +puts dwml diff --git a/sample/showcase/wsdl/noaa/default.rb b/sample/showcase/wsdl/noaa/default.rb new file mode 100644 index 0000000..2beaa8f --- /dev/null +++ b/sample/showcase/wsdl/noaa/default.rb @@ -0,0 +1,46 @@ +require 'xsd/qname' + +# {http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd}weatherParametersType +class WeatherParametersType + attr_accessor :maxt + attr_accessor :mint + attr_accessor :temp + attr_accessor :dew + attr_accessor :pop12 + attr_accessor :qpf + attr_accessor :sky + attr_accessor :snow + attr_accessor :wspd + attr_accessor :wdir + attr_accessor :wx + attr_accessor :waveh + attr_accessor :icons + + def initialize(maxt = nil, mint = nil, temp = nil, dew = nil, pop12 = nil, qpf = nil, sky = nil, snow = nil, wspd = nil, wdir = nil, wx = nil, waveh = nil, icons = nil) + @maxt = maxt + @mint = mint + @temp = temp + @dew = dew + @pop12 = pop12 + @qpf = qpf + @sky = sky + @snow = snow + @wspd = wspd + @wdir = wdir + @wx = wx + @waveh = waveh + @icons = icons + end +end + +# {http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd}formatType +class FormatType < ::String + C_12Hourly = FormatType.new("12 hourly") + C_24Hourly = FormatType.new("24 hourly") +end + +# {http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd}productType +class ProductType < ::String + Glance = ProductType.new("glance") + TimeSeries = ProductType.new("time-series") +end diff --git a/sample/showcase/wsdl/noaa/defaultDriver.rb b/sample/showcase/wsdl/noaa/defaultDriver.rb new file mode 100644 index 0000000..47c8b05 --- /dev/null +++ b/sample/showcase/wsdl/noaa/defaultDriver.rb @@ -0,0 +1,66 @@ +require 'default.rb' +require 'defaultMappingRegistry.rb' +require 'soap/rpc/driver' + +class NdfdXMLPortType < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php" + + Methods = [ + [ XSD::QName.new("http://weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl", "NDFDgen"), + "http://weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl#NDFDgen", + "nDFDgen", + [ [:in, "latitude", ["::SOAP::SOAPDecimal"]], + [:in, "longitude", ["::SOAP::SOAPDecimal"]], + [:in, "product", [nil, "http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd", "productType"]], + [:in, "startTime", ["::SOAP::SOAPDateTime"]], + [:in, "endTime", ["::SOAP::SOAPDateTime"]], + [:in, "weatherParameters", ["WeatherParametersType", "http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd", "weatherParametersType"]], + [:retval, "dwmlOut", ["::SOAP::SOAPString"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("http://weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl", "NDFDgenByDay"), + "http://weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl#NDFDgenByDay", + "nDFDgenByDay", + [ [:in, "latitude", ["::SOAP::SOAPDecimal"]], + [:in, "longitude", ["::SOAP::SOAPDecimal"]], + [:in, "startDate", ["::SOAP::SOAPDate"]], + [:in, "numDays", ["::SOAP::SOAPInteger"]], + [:in, "format", [nil, "http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd", "formatType"]], + [:retval, "dwmlByDayOut", ["::SOAP::SOAPString"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = DefaultMappingRegistry::EncodedRegistry + self.literal_mapping_registry = DefaultMappingRegistry::LiteralRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end + diff --git a/sample/showcase/wsdl/noaa/defaultMappingRegistry.rb b/sample/showcase/wsdl/noaa/defaultMappingRegistry.rb new file mode 100644 index 0000000..d0bfe63 --- /dev/null +++ b/sample/showcase/wsdl/noaa/defaultMappingRegistry.rb @@ -0,0 +1,74 @@ +require 'default.rb' +require 'soap/mapping' + +module DefaultMappingRegistry + EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new + LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new + + EncodedRegistry.register( + :class => WeatherParametersType, + :schema_ns => "http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd", + :schema_type => "weatherParametersType", + :schema_element => [ + ["maxt", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "maxt")]], + ["mint", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "mint")]], + ["temp", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "temp")]], + ["dew", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "dew")]], + ["pop12", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "pop12")]], + ["qpf", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "qpf")]], + ["sky", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "sky")]], + ["snow", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "snow")]], + ["wspd", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "wspd")]], + ["wdir", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "wdir")]], + ["wx", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "wx")]], + ["waveh", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "waveh")]], + ["icons", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "icons")]] + ] + ) + + EncodedRegistry.register( + :class => FormatType, + :schema_ns => "http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd", + :schema_type => "formatType" + ) + + EncodedRegistry.register( + :class => ProductType, + :schema_ns => "http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd", + :schema_type => "productType" + ) + + LiteralRegistry.register( + :class => WeatherParametersType, + :schema_ns => "http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd", + :schema_type => "weatherParametersType", + :schema_qualified => false, + :schema_element => [ + ["maxt", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "maxt")]], + ["mint", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "mint")]], + ["temp", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "temp")]], + ["dew", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "dew")]], + ["pop12", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "pop12")]], + ["qpf", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "qpf")]], + ["sky", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "sky")]], + ["snow", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "snow")]], + ["wspd", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "wspd")]], + ["wdir", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "wdir")]], + ["wx", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "wx")]], + ["waveh", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "waveh")]], + ["icons", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "icons")]] + ] + ) + + LiteralRegistry.register( + :class => FormatType, + :schema_ns => "http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd", + :schema_type => "formatType" + ) + + LiteralRegistry.register( + :class => ProductType, + :schema_ns => "http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd", + :schema_type => "productType" + ) +end diff --git a/sample/showcase/wsdl/noaa/ndfdXMLClient.rb b/sample/showcase/wsdl/noaa/ndfdXMLClient.rb new file mode 100644 index 0000000..af4e4b8 --- /dev/null +++ b/sample/showcase/wsdl/noaa/ndfdXMLClient.rb @@ -0,0 +1,43 @@ +#!/usr/bin/env ruby +require 'defaultDriver.rb' + +endpoint_url = ARGV.shift +obj = NdfdXMLPortType.new(endpoint_url) + +# run ruby with -d to see SOAP wiredumps. +obj.wiredump_dev = STDERR if $DEBUG + +# SYNOPSIS +# NDFDgen(latitude, longitude, product, startTime, endTime, weatherParameters) +# +# ARGS +# latitude Decimal - {http://www.w3.org/2001/XMLSchema}decimal +# longitude Decimal - {http://www.w3.org/2001/XMLSchema}decimal +# product ProductType - {http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd}productType +# startTime DateTime - {http://www.w3.org/2001/XMLSchema}dateTime +# endTime DateTime - {http://www.w3.org/2001/XMLSchema}dateTime +# weatherParameters WeatherParametersType - {http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd}weatherParametersType +# +# RETURNS +# dwmlOut C_String - {http://www.w3.org/2001/XMLSchema}string +# +latitude = longitude = product = startTime = endTime = weatherParameters = nil +puts obj.nDFDgen(latitude, longitude, product, startTime, endTime, weatherParameters) + +# SYNOPSIS +# NDFDgenByDay(latitude, longitude, startDate, numDays, format) +# +# ARGS +# latitude Decimal - {http://www.w3.org/2001/XMLSchema}decimal +# longitude Decimal - {http://www.w3.org/2001/XMLSchema}decimal +# startDate Date - {http://www.w3.org/2001/XMLSchema}date +# numDays C_Integer - {http://www.w3.org/2001/XMLSchema}integer +# format FormatType - {http://weather.gov/forecasts/xml/DWMLgen/schema/ndfdXML.xsd}formatType +# +# RETURNS +# dwmlByDayOut C_String - {http://www.w3.org/2001/XMLSchema}string +# +latitude = longitude = startDate = numDays = format = nil +puts obj.nDFDgenByDay(latitude, longitude, startDate, numDays, format) + + diff --git a/sample/showcase/wsdl/raa2.4/raa.rb b/sample/showcase/wsdl/raa2.4/raa.rb new file mode 100644 index 0000000..2d0d769 --- /dev/null +++ b/sample/showcase/wsdl/raa2.4/raa.rb @@ -0,0 +1,134 @@ +require 'xsd/qname' + +# {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}Gem +# id - SOAP::SOAPInt +# category - Category +# owner - Owner +# project - Project +# updated - SOAP::SOAPDateTime +# created - SOAP::SOAPDateTime +class Gem + attr_accessor :id + attr_accessor :category + attr_accessor :owner + attr_accessor :project + attr_accessor :updated + attr_accessor :created + + def initialize(id = nil, category = nil, owner = nil, project = nil, updated = nil, created = nil) + @id = id + @category = category + @owner = owner + @project = project + @updated = updated + @created = created + end +end + +# {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}Category +# major - SOAP::SOAPString +# minor - SOAP::SOAPString +class Category + attr_accessor :major + attr_accessor :minor + + def initialize(major = nil, minor = nil) + @major = major + @minor = minor + end +end + +# {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}Owner +# id - SOAP::SOAPInt +# email - SOAP::SOAPAnyURI +# name - SOAP::SOAPString +class Owner + attr_accessor :id + attr_accessor :email + attr_accessor :name + + def initialize(id = nil, email = nil, name = nil) + @id = id + @email = email + @name = name + end +end + +# {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}Project +# name - SOAP::SOAPString +# short_description - SOAP::SOAPString +# version - SOAP::SOAPString +# status - SOAP::SOAPString +# url - SOAP::SOAPAnyURI +# download - SOAP::SOAPAnyURI +# license - SOAP::SOAPString +# description - SOAP::SOAPString +# description_style - SOAP::SOAPString +# updated - SOAP::SOAPDateTime +# history - ProjectArray +# dependency - ProjectDependencyArray +class Project + attr_accessor :name + attr_accessor :short_description + attr_accessor :version + attr_accessor :status + attr_accessor :url + attr_accessor :download + attr_accessor :license + attr_accessor :description + attr_accessor :description_style + attr_accessor :updated + attr_accessor :history + attr_accessor :dependency + + def initialize(name = nil, short_description = nil, version = nil, status = nil, url = nil, download = nil, license = nil, description = nil, description_style = nil, updated = nil, history = nil, dependency = nil) + @name = name + @short_description = short_description + @version = version + @status = status + @url = url + @download = download + @license = license + @description = description + @description_style = description_style + @updated = updated + @history = history + @dependency = dependency + end +end + +# {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}ProjectDependency +# project - SOAP::SOAPString +# version - SOAP::SOAPString +# description - SOAP::SOAPString +class ProjectDependency + attr_accessor :project + attr_accessor :version + attr_accessor :description + + def initialize(project = nil, version = nil, description = nil) + @project = project + @version = version + @description = description + end +end + +# {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}GemArray +class GemArray < ::Array +end + +# {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}OwnerArray +class OwnerArray < ::Array +end + +# {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}ProjectArray +class ProjectArray < ::Array +end + +# {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}ProjectDependencyArray +class ProjectDependencyArray < ::Array +end + +# {http://www.ruby-lang.org/xmlns/soap/type/RAA/0.0.3/}StringArray +class StringArray < ::Array +end diff --git a/sample/showcase/wsdl/raa2.4/raa.wsdl b/sample/showcase/wsdl/raa2.4/raa.wsdl new file mode 100644 index 0000000..71bb161 --- /dev/null +++ b/sample/showcase/wsdl/raa2.4/raa.wsdl @@ -0,0 +1,644 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/showcase/wsdl/raa2.4/wsdlDriver.rb b/sample/showcase/wsdl/raa2.4/wsdlDriver.rb new file mode 100644 index 0000000..9504a04 --- /dev/null +++ b/sample/showcase/wsdl/raa2.4/wsdlDriver.rb @@ -0,0 +1,117 @@ +#!/usr/bin/env ruby + +# You can generate raa.rb required here with the command; +# wsdl2ruby.rb --wsdl http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/ --classdef +require 'raa' +require 'soap/wsdlDriver' +require 'pp' + +RAA_WSDL = 'http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.4/' + +raa = SOAP::WSDLDriverFactory.new(RAA_WSDL).create_rpc_driver +raa.generate_explicit_type = true +# raa.wiredump_dev = STDERR + +def sec(msg) + puts + puts "--------" + puts "-- " + msg + puts +end + +def subsec(msg) + puts "-- " + msg +end + +sec("retrieve a gem (RAA Information) which has specified name") +name = 'soap4r' +pp raa.gem(name) + +sec("retrieve dependents of the project") +name = 'http-access2'; version = nil +pp raa.dependents(name, version) + +sec("number of registered gems") +puts raa.size + +sec("retrieve all registered gem names") +p raa.names + +sec("retrieve gems of specified category") +major = 'Library'; minor = 'XML' +p raa.list_by_category(major, minor) + +sec("retrieve category tree") +pp raa.tree_by_category + +sec("retrieve gems which is updated recently") +idx = 0 +p raa.list_recent_updated(idx) +subsec("next 10 gems") +idx += 1 +p raa.list_recent_updated(idx) +subsec("next 10 gems") +idx += 1 +p raa.list_recent_updated(idx) + +sec("retrieve gems which is created recently") +p raa.list_recent_created(idx) + +sec("retrieve gems which is updated in 7 days") +date = Time.now - 7 * 24 * 60 * 60; idx = 0 +p raa.list_updated_since(date, idx) + +sec("retrieve gems which is created in 7 days") +p raa.list_created_since(date, idx) + +sec("retrieve gems of specified owner") +owner_id = 8 # NaHi +p raa.list_by_owner(owner_id) + +sec("search gems with keyword") +substring = 'soap' +pp raa.search(substring) + +# There are several search interface to search a field explicitly. +# puts raa.search_name(substring, idx) +# puts raa.search_short_description(substring, idx) +# puts raa.search_owner(substring, idx) +# puts raa.search_version(substring, idx) +# puts raa.search_status(substring, idx) +# puts raa.search_description(substring, idx) + +sec("retrieve owner info") +owner_id = 8 +pp raa.owner(owner_id) + +sec("retrieve owners") +idx = 0 +p raa.list_owner(idx) + +sec("update 'sampleproject'") +name = 'sampleproject' +pass = 'sampleproject' +gem = raa.gem(name) +p gem.project.version +gem.project.version.succ! +gem.updated = Time.now +raa.update(name, pass, gem) +p raa.gem(name).project.version + +sec("update pass phrase") +raa.update_pass(name, 'sampleproject', 'foo') +subsec("update check") +gem = raa.gem(name) +gem.project.description = 'Current pass phrase is "foo"' +gem.updated = Time.now +raa.update(name, 'foo', gem) +# +subsec("recover pass phrase") +raa.update_pass(name, 'foo', 'sampleproject') +subsec("update check") +gem = raa.gem(name) +gem.project.description = 'Current pass phrase is "sampleproject"' +gem.updated = Time.now +raa.update(name, 'sampleproject', gem) + +sec("done") diff --git a/sample/showcase/wsdl/rnn/client.rb b/sample/showcase/wsdl/rnn/client.rb new file mode 100644 index 0000000..46e4f32 --- /dev/null +++ b/sample/showcase/wsdl/rnn/client.rb @@ -0,0 +1,59 @@ +#!/usr/bin/env ruby + + +# RNNSOAPӥѤ륵ץǤܺ٤ˤĤƤϡ +# http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/*checkout*/rnn/rnn/doc/articles/xmlrpc.txt +# +# http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=RNN%A4%C8SOAP4R%A4%C7%CD%B7%A4%DC%A4%A6 +# 򻲾ȤƤ + + +require 'soap/wsdlDriver' +#wsdl = 'http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/*checkout*/rnn/rnn/app/rnn-hash.wsdl' +wsdl = 'rnn-hash.wsdl' +rnn = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver +rnn.generate_explicit_type = true +rnn.wiredump_dev = STDOUT + +test_article_id = 1 +POST_COMMENT_DIRECT = 0 + + +# դǿ˥ȤơposܤnĤΥ˥塼Фޤ +pos = 0 +n = 5 +topicid = nil +puts rnn.list(pos, n, topicid) +exit + +# ID id εޤ +rnn.article(test_article_id).each do |k, v| + puts "#{k}: #{v}" +end + +# ID id εˤĤƤΤ٤ƤΥȤޤ +puts rnn.comments(test_article_id) + +# Ƕ days ֤εޤ +days = 1 +topic = nil +rnn.recent_articles(days, topic).each do |article| + article.each do |k, v| + puts "#{k}: #{v}" + end +end + +# Ƕ days ֤ΥȤޤ +days = 1 +rnn.recent_comments(days).each do |comment| + comment.each do |k, v| + puts "#{k}: #{v}" + end +end + +# ȥԥåʬޤ +rnn.topics.each do |topic| + topic.each do |k, v| + puts "#{k}: #{v}" + end +end diff --git a/sample/showcase/wsdl/rnn/post.rb b/sample/showcase/wsdl/rnn/post.rb new file mode 100644 index 0000000..94fc1a4 --- /dev/null +++ b/sample/showcase/wsdl/rnn/post.rb @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby -Ke + + +# RNNSOAPӥѤ륵ץǤƥȵФ륳Ȥ +# Ƥޤ¹Ԥˡ +# http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/*checkout*/rnn/rnn/doc/articles/xmlrpc.txt +# +# http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=RNN%A4%C8SOAP4R%A4%C7%CD%B7%A4%DC%A4%A6 +# 򻲾ȤƤ + + +require 'soap/wsdlDriver' +wsdl = 'http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/*checkout*/rnn/rnn/app/rnn-hash.wsdl' +rnn = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver +rnn.generate_explicit_type = true +rnn.wiredump_dev = STDERR + + +test_article_id = 1 +POST_COMMENT_DIRECT = 0 + +subject = "SOAP4Rˤƥ by NaHi̵̾" +text =<<__EOS__ +euc-jpǤΥƥƤǤ +__EOS__ + +p rnn.post_comment(test_article_id, POST_COMMENT_DIRECT, subject, text) diff --git a/sample/showcase/wsdl/rnn/rnn-hash.wsdl b/sample/showcase/wsdl/rnn/rnn-hash.wsdl new file mode 100644 index 0000000..1e91b68 --- /dev/null +++ b/sample/showcase/wsdl/rnn/rnn-hash.wsdl @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/showcase/wsdl/rnn/rnn.wsdl b/sample/showcase/wsdl/rnn/rnn.wsdl new file mode 100644 index 0000000..d4aa609 --- /dev/null +++ b/sample/showcase/wsdl/rnn/rnn.wsdl @@ -0,0 +1,310 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/showcase/wsdl/rnn/submit.rb b/sample/showcase/wsdl/rnn/submit.rb new file mode 100644 index 0000000..5b985f2 --- /dev/null +++ b/sample/showcase/wsdl/rnn/submit.rb @@ -0,0 +1,63 @@ +require 'soap/wsdlDriver' +wsdl = 'http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/*checkout*/rnn/rnn/app/rnn-hash.wsdl' +rnn = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver +rnn.generate_explicit_type = true +rnn.wiredump_dev = STDOUT + +topic_map = {} +rnn.topics.each do |topic| + topic_id = topic['topic_id'] + topic['children'] = {} + topic_map[topic_id] = topic +end + +topic_tree = {} +topic_map.each do |id, topic| + topic_pid = topic['topic_pid'] + topic_title = topic['topic_title'] + if topic_pid.zero? + topic_tree[topic_title] = topic + else + topic_map[topic_pid]['children'][topic_title] = topic + end +end + +topic_id = topic_tree['饤֥']['children']['XML']['topic_id'] + +title = "soap4r/1.4.8.1꡼줿" +text =<<'__EOS__' +soap4r/1.4.8.1꡼줿 + +1.4.7ѹϰʲ̤ꡣ +* Ruby/1.8ѻȯwarningФʤ褦ˤޤ +* WSDLɤߡ饤Ȥñ˥᥽åɤƤӽФ褦ˤ + wsdlDriverɲäޤGoogle򸡺륵ץ롣 + require 'soap/wsdlDriver' + searchWord = ARGV.shift + # http://www.google.com/apis/饤󥹥ɬפޤ + key = File.open(File.expand_path("~/.google_key")).read.chomp + GOOGLE_WSDL = 'http://api.google.com/GoogleSearch.wsdl' + # Load WSDL and create driver. + google = SOAP::WSDLDriverFactory.new(GOOGLE_WSDL).create_rpc_driver + # Just invoke! + result = google.doGoogleSearch(key, searchWord, 0, 10, false, "", false, "", 'utf-8', 'utf-8') + result.resultElements.each do |ele| + puts "== #{ele.title}: #{ele.URL}" + puts ele.snippet + puts + end + ץȤơAmazonWebServicesRAARNNwsdlDriverѥץ + sampleǥ쥯ȥ֤Ƥޤ +* xmlscanΥݡȡ +* XML processorθмѹxmlscanREXMLXMLParserNQXMLν + ޤ +* ɥϥɥ󥰤euc-jp⤷shift_jisȤˤϡ + xmlscan-0.2Ȥuconv⥸塼뤬ʤƤ⤫ޤޤ󡣤¾XML + processorȤuconv⥸塼뤬ɬפǤ +* cgistub.rb: SOAP쥹ݥ󥹤ΥǥפѹǤ褦ˤ + Javaǡtext/xml򿩤ʤĤ +* wsdl2ruby: --forceץɲäޤ +* ΥХ +__EOS__ + +p rnn.submit(title, text, topic_id) diff --git a/sample/showcase/wsdl/salesforce/SforceServiceClient.rb b/sample/showcase/wsdl/salesforce/SforceServiceClient.rb new file mode 100644 index 0000000..24f01fc --- /dev/null +++ b/sample/showcase/wsdl/salesforce/SforceServiceClient.rb @@ -0,0 +1,280 @@ +#!/usr/bin/env ruby +require 'defaultDriver.rb' + +endpoint_url = ARGV.shift +obj = Soap.new(endpoint_url) + +# run ruby with -d to see SOAP wiredumps. +obj.wiredump_dev = STDERR if $DEBUG + +# SYNOPSIS +# login(parameters) +# +# ARGS +# parameters Login - {urn:partner.soap.sforce.com}login +# +# RETURNS +# parameters LoginResponse - {urn:partner.soap.sforce.com}loginResponse +# +# RAISES +# # fault LoginFault - {urn:fault.partner.soap.sforce.com}LoginFault, # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.login(parameters) + +# SYNOPSIS +# describeSObject(parameters) +# +# ARGS +# parameters DescribeSObject - {urn:partner.soap.sforce.com}describeSObject +# +# RETURNS +# parameters DescribeSObjectResponse - {urn:partner.soap.sforce.com}describeSObjectResponse +# +# RAISES +# # fault InvalidSObjectFault - {urn:fault.partner.soap.sforce.com}InvalidSObjectFault, # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.describeSObject(parameters) + +# SYNOPSIS +# describeGlobal(parameters) +# +# ARGS +# parameters DescribeGlobal - {urn:partner.soap.sforce.com}describeGlobal +# +# RETURNS +# parameters DescribeGlobalResponse - {urn:partner.soap.sforce.com}describeGlobalResponse +# +# RAISES +# # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.describeGlobal(parameters) + +# SYNOPSIS +# describeLayout(parameters) +# +# ARGS +# parameters DescribeLayout - {urn:partner.soap.sforce.com}describeLayout +# +# RETURNS +# parameters DescribeLayoutResponse - {urn:partner.soap.sforce.com}describeLayoutResponse +# +# RAISES +# # fault InvalidSObjectFault - {urn:fault.partner.soap.sforce.com}InvalidSObjectFault, # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.describeLayout(parameters) + +# SYNOPSIS +# create(parameters) +# +# ARGS +# parameters Create - {urn:partner.soap.sforce.com}create +# +# RETURNS +# parameters CreateResponse - {urn:partner.soap.sforce.com}createResponse +# +# RAISES +# # fault InvalidSObjectFault - {urn:fault.partner.soap.sforce.com}InvalidSObjectFault, # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.create(parameters) + +# SYNOPSIS +# update(parameters) +# +# ARGS +# parameters Update - {urn:partner.soap.sforce.com}update +# +# RETURNS +# parameters UpdateResponse - {urn:partner.soap.sforce.com}updateResponse +# +# RAISES +# # fault InvalidSObjectFault - {urn:fault.partner.soap.sforce.com}InvalidSObjectFault, # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.update(parameters) + +# SYNOPSIS +# delete(parameters) +# +# ARGS +# parameters Delete - {urn:partner.soap.sforce.com}delete +# +# RETURNS +# parameters DeleteResponse - {urn:partner.soap.sforce.com}deleteResponse +# +# RAISES +# # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.delete(parameters) + +# SYNOPSIS +# retrieve(parameters) +# +# ARGS +# parameters Retrieve - {urn:partner.soap.sforce.com}retrieve +# +# RETURNS +# parameters RetrieveResponse - {urn:partner.soap.sforce.com}retrieveResponse +# +# RAISES +# # fault InvalidSObjectFault - {urn:fault.partner.soap.sforce.com}InvalidSObjectFault, # fault InvalidFieldFault - {urn:fault.partner.soap.sforce.com}InvalidFieldFault, # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.retrieve(parameters) + +# SYNOPSIS +# convertLead(parameters) +# +# ARGS +# parameters ConvertLead - {urn:partner.soap.sforce.com}convertLead +# +# RETURNS +# parameters ConvertLeadResponse - {urn:partner.soap.sforce.com}convertLeadResponse +# +# RAISES +# # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.convertLead(parameters) + +# SYNOPSIS +# getDeleted(parameters) +# +# ARGS +# parameters GetDeleted - {urn:partner.soap.sforce.com}getDeleted +# +# RETURNS +# parameters GetDeletedResponse - {urn:partner.soap.sforce.com}getDeletedResponse +# +# RAISES +# # fault InvalidSObjectFault - {urn:fault.partner.soap.sforce.com}InvalidSObjectFault, # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.getDeleted(parameters) + +# SYNOPSIS +# getUpdated(parameters) +# +# ARGS +# parameters GetUpdated - {urn:partner.soap.sforce.com}getUpdated +# +# RETURNS +# parameters GetUpdatedResponse - {urn:partner.soap.sforce.com}getUpdatedResponse +# +# RAISES +# # fault InvalidSObjectFault - {urn:fault.partner.soap.sforce.com}InvalidSObjectFault, # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.getUpdated(parameters) + +# SYNOPSIS +# query(parameters) +# +# ARGS +# parameters Query - {urn:partner.soap.sforce.com}query +# +# RETURNS +# parameters QueryResponse - {urn:partner.soap.sforce.com}queryResponse +# +# RAISES +# # fault InvalidSObjectFault - {urn:fault.partner.soap.sforce.com}InvalidSObjectFault, # fault InvalidFieldFault - {urn:fault.partner.soap.sforce.com}InvalidFieldFault, # fault MalformedQueryFault - {urn:fault.partner.soap.sforce.com}MalformedQueryFault, # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.query(parameters) + +# SYNOPSIS +# queryMore(parameters) +# +# ARGS +# parameters QueryMore - {urn:partner.soap.sforce.com}queryMore +# +# RETURNS +# parameters QueryMoreResponse - {urn:partner.soap.sforce.com}queryMoreResponse +# +# RAISES +# # fault InvalidQueryLocatorFault - {urn:fault.partner.soap.sforce.com}InvalidQueryLocatorFault, # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.queryMore(parameters) + +# SYNOPSIS +# search(parameters) +# +# ARGS +# parameters Search - {urn:partner.soap.sforce.com}search +# +# RETURNS +# parameters SearchResponse - {urn:partner.soap.sforce.com}searchResponse +# +# RAISES +# # fault InvalidSObjectFault - {urn:fault.partner.soap.sforce.com}InvalidSObjectFault, # fault InvalidFieldFault - {urn:fault.partner.soap.sforce.com}InvalidFieldFault, # fault MalformedSearchFault - {urn:fault.partner.soap.sforce.com}MalformedSearchFault, # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.search(parameters) + +# SYNOPSIS +# getServerTimestamp(parameters) +# +# ARGS +# parameters GetServerTimestamp - {urn:partner.soap.sforce.com}getServerTimestamp +# +# RETURNS +# parameters GetServerTimestampResponse - {urn:partner.soap.sforce.com}getServerTimestampResponse +# +# RAISES +# # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.getServerTimestamp(parameters) + +# SYNOPSIS +# setPassword(parameters) +# +# ARGS +# parameters SetPassword - {urn:partner.soap.sforce.com}setPassword +# +# RETURNS +# parameters SetPasswordResponse - {urn:partner.soap.sforce.com}setPasswordResponse +# +# RAISES +# # fault InvalidIdFault - {urn:fault.partner.soap.sforce.com}InvalidIdFault, # fault InvalidNewPasswordFault - {urn:fault.partner.soap.sforce.com}InvalidNewPasswordFault, # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.setPassword(parameters) + +# SYNOPSIS +# resetPassword(parameters) +# +# ARGS +# parameters ResetPassword - {urn:partner.soap.sforce.com}resetPassword +# +# RETURNS +# parameters ResetPasswordResponse - {urn:partner.soap.sforce.com}resetPasswordResponse +# +# RAISES +# # fault InvalidIdFault - {urn:fault.partner.soap.sforce.com}InvalidIdFault, # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.resetPassword(parameters) + +# SYNOPSIS +# getUserInfo(parameters) +# +# ARGS +# parameters GetUserInfo - {urn:partner.soap.sforce.com}getUserInfo +# +# RETURNS +# parameters GetUserInfoResponse - {urn:partner.soap.sforce.com}getUserInfoResponse +# +# RAISES +# # fault UnexpectedErrorFault - {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +# +parameters = nil +puts obj.getUserInfo(parameters) + + diff --git a/sample/showcase/wsdl/salesforce/ca.pem b/sample/showcase/wsdl/salesforce/ca.pem new file mode 100644 index 0000000..9bfdbef --- /dev/null +++ b/sample/showcase/wsdl/salesforce/ca.pem @@ -0,0 +1,35 @@ +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz +cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 +MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV +BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE +BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is +I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G +CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do +lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc +AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDgzCCAuygAwIBAgIQJUuKhThCzONY+MXdriJupDANBgkqhkiG9w0BAQUFADBf +MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xNzA1BgNVBAsT +LkNsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw +HhcNOTcwNDE3MDAwMDAwWhcNMTExMDI0MjM1OTU5WjCBujEfMB0GA1UEChMWVmVy +aVNpZ24gVHJ1c3QgTmV0d29yazEXMBUGA1UECxMOVmVyaVNpZ24sIEluYy4xMzAx +BgNVBAsTKlZlcmlTaWduIEludGVybmF0aW9uYWwgU2VydmVyIENBIC0gQ2xhc3Mg +MzFJMEcGA1UECxNAd3d3LnZlcmlzaWduLmNvbS9DUFMgSW5jb3JwLmJ5IFJlZi4g +TElBQklMSVRZIExURC4oYyk5NyBWZXJpU2lnbjCBnzANBgkqhkiG9w0BAQEFAAOB +jQAwgYkCgYEA2IKA6NYZAn0fhRg5JaJlK+G/1AXTvOY2O6rwTGxbtueqPHNFVbLx +veqXQu2aNAoV1Klc9UAl3dkHwTKydWzEyruj/lYncUOqY/UwPpMo5frxCTvzt01O +OfdcSVq4wR3Tsor+cDCVQsv+K1GLWjw6+SJPkLICp1OcTzTnqwSye28CAwEAAaOB +4zCB4DAPBgNVHRMECDAGAQH/AgEAMEQGA1UdIAQ9MDswOQYLYIZIAYb4RQEHAQEw +KjAoBggrBgEFBQcCARYcaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL0NQUzA0BgNV +HSUELTArBggrBgEFBQcDAQYIKwYBBQUHAwIGCWCGSAGG+EIEAQYKYIZIAYb4RQEI +ATALBgNVHQ8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgEGMDEGA1UdHwQqMCgwJqAk +oCKGIGh0dHA6Ly9jcmwudmVyaXNpZ24uY29tL3BjYTMuY3JsMA0GCSqGSIb3DQEB +BQUAA4GBAAgB7ORolANC8XPxI6I63unx2sZUxCM+hurPajozq+qcBBQHNgYL+Yhv +1RPuKSvD5HKNRO3RrCAJLeH24RkFOLA9D59/+J4C3IYChmFOJl9en5IeDCSk9dBw +E88mw0M9SR2egi5SX7w+xmYpAY5Okiy8RnUDgqxz6dl+C2fvVFIa +-----END CERTIFICATE----- diff --git a/sample/showcase/wsdl/salesforce/client.rb b/sample/showcase/wsdl/salesforce/client.rb new file mode 100644 index 0000000..13dafde --- /dev/null +++ b/sample/showcase/wsdl/salesforce/client.rb @@ -0,0 +1,156 @@ +#!/usr/bin/env ruby + +require 'defaultDriver.rb' +require 'soap/header/simplehandler' +include XSD +include SOAP + +class SessionHeaderHandler < SOAP::Header::SimpleHandler + HeaderName = XSD::QName.new('urn:partner.soap.sforce.com', 'SessionHeader') + + attr_accessor :sessionid + + def initialize + super(HeaderName) + @sessionid = nil + end + + def on_simple_outbound + if @sessionid + {'sessionId' => @sessionid} + else + nil # no header + end + end +end + +class CallOptionsHandler < SOAP::Header::SimpleHandler + HeaderName = XSD::QName.new('urn:partner.soap.sforce.com', 'CallOptions') + + attr_accessor :client + + def initialize + super(HeaderName) + @client = nil + end + + def on_simple_outbound + if @client + {'client' => @client} + else + nil # no header + end + end +end + +sessionid_handler = SessionHeaderHandler.new +calloptions_handler = CallOptionsHandler.new + +endpoint_url = ARGV.shift +obj = Soap.new(endpoint_url) +obj.headerhandler << sessionid_handler +obj.headerhandler << calloptions_handler +obj.wiredump_dev = STDOUT + +p obj.delete(Delete.new([1, 2, 3])) +p obj.describeSObject(:sObjectType => "hello world") +p obj.describeSObject(DescribeSObject.new("hello world")) + +if false +require 'soap/wsdlDriver' +obj = SOAP::WSDLDriverFactory.new("partner.wsdl").create_rpc_driver +end + +ns = "urn:sobject.partner.soap.sforce.com" + +if false +require 'orderedhash' +sobj = OrderedHash.new +sobj[QName.new(ns, "type")] = "Contact" +sobj[QName.new(ns, "Id")] = "012345678901234567" +#sobj["type"] = "Contact" +#sobj["Id"] = "012345678901234567" +sobj[:FirstName] = "Joe" +sobj[:lastname] = "Blow" +sobj[:Salutation] = "Mr." +sobj[:Phone] = "999.999.9999" +sobj[:Title] = "Purchasing Director" +obj.test_loopback_response << '' +obj.create(:sObjects => [sobj, sobj]) +end + +if false +ns1 = 'urn:partner.soap.sforce.com' +ns2 = "urn:sobject.partner.soap.sforce.com" +ele = SOAPElement.new(QName.new(ns1, 'create')) +sobj = SOAPElement.new(QName.new(ns1, 'sObjects')) +sobj.add(SOAPElement.new(QName.new(ns2, "type"), "Contact")) +sobj.add(SOAPElement.new(QName.new(ns2, 'Id'), "012345678901234567")) +sobj.add(SOAPElement.new(QName.new(nil, 'FirstName'), 'Joe')) +sobj.add(SOAPElement.new(QName.new(nil, 'lastname'), 'Blow')) +sobj.add(SOAPElement.new(QName.new(nil, 'Salutation'), 'Mr.')) +sobj.add(SOAPElement.new(QName.new(nil, 'Phone'), '999.999.9999')) +sobj.add(SOAPElement.new(QName.new(nil, 'Title'), 'Purchasing Director')) +ele.add(sobj) +ele.add(sobj) +obj.test_loopback_response << '' +obj.create(:sObjects => [sobj, sobj]) rescue nil +end + +sobj = [ + [QName.new(ns, "type"), "Contact"], + [QName.new(ns, "Id"), "012345678901234567"], + [:FirstName, "Joe"], + [:lastname, "Blow"], + [:Salutation, "Mr."], + [:Phone, "999.999.9999"], + [:Title, "Purchasing Director"] +] +obj.test_loopback_response << '' +obj.create(:sObjects => [sobj, sobj]) rescue nil + + +mycontact = SObject.new +mycontact.type = "Contact" +mycontact.Id = "012345678901234567" +mycontact.set_any([ + [:FirstName, "Joe"], + [:lastname, "Blow"], + [:Salutation, "Mr."], + [:Phone, "999.999.9999"], + [:Title, "Purchasing Director"] +]) + +obj.test_loopback_response << '' +obj.create(Create.new([mycontact, mycontact])) rescue nil +exit + + + +ns = "urn:sobject.partner.soap.sforce.com" +ele = SOAP::SOAPElement.new(XSD::QName.new(nil, "type")) +ele.text = "Contact" +ele.extraattr["xmlns"] = ns + +sobj = SObject.new("Contact") +sobj.instance_eval do + @Id = "id" + @FirstName = "Joe" + @lastname = "Blow" + @Salutation = "Mr." + @Phone = "999.999.9999" + @Title = "Purchasing Director" +end + +obj.create(Create.new([sobj])) +#obj.create(Create.new([SObject.new(ele, ["fields", "To", "Null"], "id", {"LastName" => "Spaceley"}) ])) + +exit + +calloptions_handler.client = 'client' + +parameters = Login.new('NaHi', 'password') +login_result = obj.login(parameters).result +sessionid_handler.sessionid = login_result.sessionId + +obj.delete(Delete.new([1, 2, 3])) diff --git a/sample/showcase/wsdl/salesforce/default.rb b/sample/showcase/wsdl/salesforce/default.rb new file mode 100644 index 0000000..d525dd1 --- /dev/null +++ b/sample/showcase/wsdl/salesforce/default.rb @@ -0,0 +1,1740 @@ +require 'xsd/qname' + +# {urn:partner.soap.sforce.com}login +class Login + @@schema_type = "login" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["username", "SOAP::SOAPString"], + ["password", "SOAP::SOAPString"] + ] + + attr_accessor :username + attr_accessor :password + + def initialize(username = nil, password = nil) + @username = username + @password = password + end +end + +# {urn:partner.soap.sforce.com}loginResponse +class LoginResponse + @@schema_type = "loginResponse" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["result", "LoginResult"] + ] + + attr_accessor :result + + def initialize(result = nil) + @result = result + end +end + +# {urn:partner.soap.sforce.com}describeSObject +class DescribeSObject + @@schema_type = "describeSObject" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["sObjectType", "SOAP::SOAPString"] + ] + + attr_accessor :sObjectType + + def initialize(sObjectType = nil) + @sObjectType = sObjectType + end +end + +# {urn:partner.soap.sforce.com}describeSObjectResponse +class DescribeSObjectResponse + @@schema_type = "describeSObjectResponse" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["result", "DescribeSObjectResult"] + ] + + attr_accessor :result + + def initialize(result = nil) + @result = result + end +end + +# {urn:partner.soap.sforce.com}describeGlobal +class DescribeGlobal + @@schema_type = "describeGlobal" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [] + + def initialize + end +end + +# {urn:partner.soap.sforce.com}describeGlobalResponse +class DescribeGlobalResponse + @@schema_type = "describeGlobalResponse" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["result", "DescribeGlobalResult"] + ] + + attr_accessor :result + + def initialize(result = nil) + @result = result + end +end + +# {urn:partner.soap.sforce.com}describeLayout +class DescribeLayout + @@schema_type = "describeLayout" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["sObjectType", "SOAP::SOAPString"] + ] + + attr_accessor :sObjectType + + def initialize(sObjectType = nil) + @sObjectType = sObjectType + end +end + +# {urn:partner.soap.sforce.com}describeLayoutResponse +class DescribeLayoutResponse + @@schema_type = "describeLayoutResponse" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["result", "DescribeLayoutResult"] + ] + + attr_accessor :result + + def initialize(result = nil) + @result = result + end +end + +# {urn:partner.soap.sforce.com}create +class Create < ::Array + @@schema_type = "sObject" + @@schema_ns = "urn:sobject.partner.soap.sforce.com" + @@schema_element = [ + ["sObjects", ["SObject[]", XSD::QName.new("urn:partner.soap.sforce.com", "sObjects")]] + ] +end + +# {urn:partner.soap.sforce.com}createResponse +class CreateResponse < ::Array + @@schema_type = "SaveResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["result", ["SaveResult[]", XSD::QName.new("urn:partner.soap.sforce.com", "result")]] + ] +end + +# {urn:partner.soap.sforce.com}update +class Update < ::Array + @@schema_type = "sObject" + @@schema_ns = "urn:sobject.partner.soap.sforce.com" + @@schema_element = [ + ["sObjects", ["SObject[]", XSD::QName.new("urn:partner.soap.sforce.com", "sObjects")]] + ] +end + +# {urn:partner.soap.sforce.com}updateResponse +class UpdateResponse < ::Array + @@schema_type = "SaveResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["result", ["SaveResult[]", XSD::QName.new("urn:partner.soap.sforce.com", "result")]] + ] +end + +# {urn:partner.soap.sforce.com}delete +class Delete < ::Array + @@schema_type = "ID" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["ids", ["SOAP::SOAPString[]", XSD::QName.new("urn:partner.soap.sforce.com", "ids")]] + ] +end + +# {urn:partner.soap.sforce.com}deleteResponse +class DeleteResponse < ::Array + @@schema_type = "DeleteResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["result", ["DeleteResult[]", XSD::QName.new("urn:partner.soap.sforce.com", "result")]] + ] +end + +# {urn:partner.soap.sforce.com}retrieve +class Retrieve + @@schema_type = "retrieve" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["fieldList", "SOAP::SOAPString"], + ["sObjectType", "SOAP::SOAPString"], + ["ids", "SOAP::SOAPString[]"] + ] + + attr_accessor :fieldList + attr_accessor :sObjectType + attr_accessor :ids + + def initialize(fieldList = nil, sObjectType = nil, ids = []) + @fieldList = fieldList + @sObjectType = sObjectType + @ids = ids + end +end + +# {urn:partner.soap.sforce.com}retrieveResponse +class RetrieveResponse < ::Array + @@schema_type = "sObject" + @@schema_ns = "urn:sobject.partner.soap.sforce.com" + @@schema_element = [ + ["result", ["SObject[]", XSD::QName.new("urn:partner.soap.sforce.com", "result")]] + ] +end + +# {urn:partner.soap.sforce.com}convertLead +class ConvertLead < ::Array + @@schema_type = "LeadConvert" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["leadConverts", ["LeadConvert[]", XSD::QName.new("urn:partner.soap.sforce.com", "leadConverts")]] + ] +end + +# {urn:partner.soap.sforce.com}convertLeadResponse +class ConvertLeadResponse < ::Array + @@schema_type = "LeadConvertResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["result", ["LeadConvertResult[]", XSD::QName.new("urn:partner.soap.sforce.com", "result")]] + ] +end + +# {urn:partner.soap.sforce.com}getUpdated +class GetUpdated + @@schema_type = "getUpdated" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["sObjectType", "SOAP::SOAPString"], + ["startDate", "SOAP::SOAPDateTime"], + ["endDate", "SOAP::SOAPDateTime"] + ] + + attr_accessor :sObjectType + attr_accessor :startDate + attr_accessor :endDate + + def initialize(sObjectType = nil, startDate = nil, endDate = nil) + @sObjectType = sObjectType + @startDate = startDate + @endDate = endDate + end +end + +# {urn:partner.soap.sforce.com}getUpdatedResponse +class GetUpdatedResponse + @@schema_type = "getUpdatedResponse" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["result", "GetUpdatedResult"] + ] + + attr_accessor :result + + def initialize(result = nil) + @result = result + end +end + +# {urn:partner.soap.sforce.com}getDeleted +class GetDeleted + @@schema_type = "getDeleted" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["sObjectType", "SOAP::SOAPString"], + ["startDate", "SOAP::SOAPDateTime"], + ["endDate", "SOAP::SOAPDateTime"] + ] + + attr_accessor :sObjectType + attr_accessor :startDate + attr_accessor :endDate + + def initialize(sObjectType = nil, startDate = nil, endDate = nil) + @sObjectType = sObjectType + @startDate = startDate + @endDate = endDate + end +end + +# {urn:partner.soap.sforce.com}getDeletedResponse +class GetDeletedResponse + @@schema_type = "getDeletedResponse" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["result", "GetDeletedResult"] + ] + + attr_accessor :result + + def initialize(result = nil) + @result = result + end +end + +# {urn:partner.soap.sforce.com}query +class Query + @@schema_type = "query" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["queryString", "SOAP::SOAPString"] + ] + + attr_accessor :queryString + + def initialize(queryString = nil) + @queryString = queryString + end +end + +# {urn:partner.soap.sforce.com}queryResponse +class QueryResponse + @@schema_type = "queryResponse" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["result", "QueryResult"] + ] + + attr_accessor :result + + def initialize(result = nil) + @result = result + end +end + +# {urn:partner.soap.sforce.com}queryMore +class QueryMore + @@schema_type = "queryMore" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["queryLocator", "SOAP::SOAPString"] + ] + + attr_accessor :queryLocator + + def initialize(queryLocator = nil) + @queryLocator = queryLocator + end +end + +# {urn:partner.soap.sforce.com}queryMoreResponse +class QueryMoreResponse + @@schema_type = "queryMoreResponse" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["result", "QueryResult"] + ] + + attr_accessor :result + + def initialize(result = nil) + @result = result + end +end + +# {urn:partner.soap.sforce.com}search +class Search + @@schema_type = "search" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["searchString", "SOAP::SOAPString"] + ] + + attr_accessor :searchString + + def initialize(searchString = nil) + @searchString = searchString + end +end + +# {urn:partner.soap.sforce.com}searchResponse +class SearchResponse + @@schema_type = "searchResponse" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["result", "SearchResult"] + ] + + attr_accessor :result + + def initialize(result = nil) + @result = result + end +end + +# {urn:partner.soap.sforce.com}getServerTimestamp +class GetServerTimestamp + @@schema_type = "getServerTimestamp" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [] + + def initialize + end +end + +# {urn:partner.soap.sforce.com}getServerTimestampResponse +class GetServerTimestampResponse + @@schema_type = "getServerTimestampResponse" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["result", "GetServerTimestampResult"] + ] + + attr_accessor :result + + def initialize(result = nil) + @result = result + end +end + +# {urn:partner.soap.sforce.com}setPassword +class SetPassword + @@schema_type = "setPassword" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["userId", "SOAP::SOAPString"], + ["password", "SOAP::SOAPString"] + ] + + attr_accessor :userId + attr_accessor :password + + def initialize(userId = nil, password = nil) + @userId = userId + @password = password + end +end + +# {urn:partner.soap.sforce.com}setPasswordResponse +class SetPasswordResponse + @@schema_type = "setPasswordResponse" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["result", "SetPasswordResult"] + ] + + attr_accessor :result + + def initialize(result = nil) + @result = result + end +end + +# {urn:partner.soap.sforce.com}resetPassword +class ResetPassword + @@schema_type = "resetPassword" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["userId", "SOAP::SOAPString"] + ] + + attr_accessor :userId + + def initialize(userId = nil) + @userId = userId + end +end + +# {urn:partner.soap.sforce.com}resetPasswordResponse +class ResetPasswordResponse + @@schema_type = "resetPasswordResponse" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["result", "ResetPasswordResult"] + ] + + attr_accessor :result + + def initialize(result = nil) + @result = result + end +end + +# {urn:partner.soap.sforce.com}getUserInfo +class GetUserInfo + @@schema_type = "getUserInfo" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [] + + def initialize + end +end + +# {urn:partner.soap.sforce.com}getUserInfoResponse +class GetUserInfoResponse + @@schema_type = "getUserInfoResponse" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["result", "GetUserInfoResult"] + ] + + attr_accessor :result + + def initialize(result = nil) + @result = result + end +end + +# {urn:partner.soap.sforce.com}SessionHeader +class SessionHeader + @@schema_type = "SessionHeader" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["sessionId", "SOAP::SOAPString"] + ] + + attr_accessor :sessionId + + def initialize(sessionId = nil) + @sessionId = sessionId + end +end + +# {urn:partner.soap.sforce.com}CallOptions +class CallOptions + @@schema_type = "CallOptions" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["client", "SOAP::SOAPString"] + ] + + attr_accessor :client + + def initialize(client = nil) + @client = client + end +end + +# {urn:partner.soap.sforce.com}QueryOptions +class QueryOptions + @@schema_type = "QueryOptions" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["batchSize", "SOAP::SOAPInt"] + ] + + attr_accessor :batchSize + + def initialize(batchSize = nil) + @batchSize = batchSize + end +end + +# {urn:partner.soap.sforce.com}SaveOptions +class SaveOptions + @@schema_type = "SaveOptions" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["autoAssign", "SOAP::SOAPBoolean"], + ["assignmentRuleId", "SOAP::SOAPString"] + ] + + attr_accessor :autoAssign + attr_accessor :assignmentRuleId + + def initialize(autoAssign = nil, assignmentRuleId = nil) + @autoAssign = autoAssign + @assignmentRuleId = assignmentRuleId + end +end + +# {urn:partner.soap.sforce.com}AssignmentRuleHeader +class AssignmentRuleHeader + @@schema_type = "AssignmentRuleHeader" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_qualified = "true" + @@schema_element = [ + ["assignmentRuleId", "SOAP::SOAPString"], + ["useDefaultRule", "SOAP::SOAPBoolean"] + ] + + attr_accessor :assignmentRuleId + attr_accessor :useDefaultRule + + def initialize(assignmentRuleId = nil, useDefaultRule = nil) + @assignmentRuleId = assignmentRuleId + @useDefaultRule = useDefaultRule + end +end + +# {urn:sobject.partner.soap.sforce.com}sObject +class SObject + @@schema_type = "sObject" + @@schema_ns = "urn:sobject.partner.soap.sforce.com" + @@schema_element = [ + ["type", "SOAP::SOAPString"], + ["fieldsToNull", "SOAP::SOAPString[]"], + ["id", ["SOAP::SOAPString", XSD::QName.new("urn:sobject.partner.soap.sforce.com", "Id")]], + ["any", [nil, XSD::QName.new("http://www.w3.org/2001/XMLSchema", "anyType")]] + ] + + attr_accessor :type + attr_accessor :fieldsToNull + attr_accessor :id + attr_reader :__xmlele_any + + def set_any(elements) + @__xmlele_any = elements + end + + def initialize(type = nil, fieldsToNull = [], id = nil) + @type = type + @fieldsToNull = fieldsToNull + @id = id + @__xmlele_any = nil + end +end + +# {urn:partner.soap.sforce.com}QueryResult +class QueryResult + @@schema_type = "QueryResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["done", "SOAP::SOAPBoolean"], + ["queryLocator", "SOAP::SOAPString"], + ["records", "SObject[]"], + ["size", "SOAP::SOAPInt"] + ] + + attr_accessor :done + attr_accessor :queryLocator + attr_accessor :records + attr_accessor :size + + def initialize(done = nil, queryLocator = nil, records = [], size = nil) + @done = done + @queryLocator = queryLocator + @records = records + @size = size + end +end + +# {urn:partner.soap.sforce.com}SearchResult +class SearchResult + @@schema_type = "SearchResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["searchRecords", "SearchRecord[]"], + ["sforceReserved", "SOAP::SOAPString"] + ] + + attr_accessor :searchRecords + attr_accessor :sforceReserved + + def initialize(searchRecords = [], sforceReserved = nil) + @searchRecords = searchRecords + @sforceReserved = sforceReserved + end +end + +# {urn:partner.soap.sforce.com}SearchRecord +class SearchRecord + @@schema_type = "SearchRecord" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["record", "SObject"] + ] + + attr_accessor :record + + def initialize(record = nil) + @record = record + end +end + +# {urn:partner.soap.sforce.com}GetUpdatedResult +class GetUpdatedResult + @@schema_type = "GetUpdatedResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["ids", "SOAP::SOAPString[]"], + ["sforceReserved", "SOAP::SOAPString"] + ] + + attr_accessor :ids + attr_accessor :sforceReserved + + def initialize(ids = [], sforceReserved = nil) + @ids = ids + @sforceReserved = sforceReserved + end +end + +# {urn:partner.soap.sforce.com}GetDeletedResult +class GetDeletedResult + @@schema_type = "GetDeletedResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["deletedRecords", "DeletedRecord[]"], + ["sforceReserved", "SOAP::SOAPString"] + ] + + attr_accessor :deletedRecords + attr_accessor :sforceReserved + + def initialize(deletedRecords = [], sforceReserved = nil) + @deletedRecords = deletedRecords + @sforceReserved = sforceReserved + end +end + +# {urn:partner.soap.sforce.com}DeletedRecord +class DeletedRecord + @@schema_type = "DeletedRecord" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["deletedDate", "SOAP::SOAPDateTime"], + ["id", "SOAP::SOAPString"] + ] + + attr_accessor :deletedDate + attr_accessor :id + + def initialize(deletedDate = nil, id = nil) + @deletedDate = deletedDate + @id = id + end +end + +# {urn:partner.soap.sforce.com}GetServerTimestampResult +class GetServerTimestampResult + @@schema_type = "GetServerTimestampResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["timestamp", "SOAP::SOAPDateTime"] + ] + + attr_accessor :timestamp + + def initialize(timestamp = nil) + @timestamp = timestamp + end +end + +# {urn:partner.soap.sforce.com}SetPasswordResult +class SetPasswordResult + @@schema_type = "SetPasswordResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [] + + def initialize + end +end + +# {urn:partner.soap.sforce.com}ResetPasswordResult +class ResetPasswordResult + @@schema_type = "ResetPasswordResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["password", "SOAP::SOAPString"] + ] + + attr_accessor :password + + def initialize(password = nil) + @password = password + end +end + +# {urn:partner.soap.sforce.com}GetUserInfoResult +class GetUserInfoResult + @@schema_type = "GetUserInfoResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["currencySymbol", "SOAP::SOAPString"], + ["organizationId", "SOAP::SOAPString"], + ["organizationMultiCurrency", "SOAP::SOAPBoolean"], + ["organizationName", "SOAP::SOAPString"], + ["userDefaultCurrencyIsoCode", "SOAP::SOAPString"], + ["userEmail", "SOAP::SOAPString"], + ["userFullName", "SOAP::SOAPString"], + ["userId", "SOAP::SOAPString"], + ["userLanguage", "SOAP::SOAPString"], + ["userLocale", "SOAP::SOAPString"], + ["userTimeZone", "SOAP::SOAPString"] + ] + + attr_accessor :currencySymbol + attr_accessor :organizationId + attr_accessor :organizationMultiCurrency + attr_accessor :organizationName + attr_accessor :userDefaultCurrencyIsoCode + attr_accessor :userEmail + attr_accessor :userFullName + attr_accessor :userId + attr_accessor :userLanguage + attr_accessor :userLocale + attr_accessor :userTimeZone + + def initialize(currencySymbol = nil, organizationId = nil, organizationMultiCurrency = nil, organizationName = nil, userDefaultCurrencyIsoCode = nil, userEmail = nil, userFullName = nil, userId = nil, userLanguage = nil, userLocale = nil, userTimeZone = nil) + @currencySymbol = currencySymbol + @organizationId = organizationId + @organizationMultiCurrency = organizationMultiCurrency + @organizationName = organizationName + @userDefaultCurrencyIsoCode = userDefaultCurrencyIsoCode + @userEmail = userEmail + @userFullName = userFullName + @userId = userId + @userLanguage = userLanguage + @userLocale = userLocale + @userTimeZone = userTimeZone + end +end + +# {urn:partner.soap.sforce.com}LoginResult +class LoginResult + @@schema_type = "LoginResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["passwordExpired", "SOAP::SOAPBoolean"], + ["serverUrl", "SOAP::SOAPString"], + ["sessionId", "SOAP::SOAPString"], + ["userId", "SOAP::SOAPString"] + ] + + attr_accessor :passwordExpired + attr_accessor :serverUrl + attr_accessor :sessionId + attr_accessor :userId + + def initialize(passwordExpired = nil, serverUrl = nil, sessionId = nil, userId = nil) + @passwordExpired = passwordExpired + @serverUrl = serverUrl + @sessionId = sessionId + @userId = userId + end +end + +# {urn:partner.soap.sforce.com}Error +class Error + @@schema_type = "Error" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["fields", "SOAP::SOAPString[]"], + ["message", "SOAP::SOAPString"], + ["statusCode", "SOAP::SOAPString"] + ] + + attr_accessor :fields + attr_accessor :message + attr_accessor :statusCode + + def initialize(fields = [], message = nil, statusCode = nil) + @fields = fields + @message = message + @statusCode = statusCode + end +end + +# {urn:partner.soap.sforce.com}SaveResult +class SaveResult + @@schema_type = "SaveResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["errors", "Error[]"], + ["id", "SOAP::SOAPString"], + ["success", "SOAP::SOAPBoolean"] + ] + + attr_accessor :errors + attr_accessor :id + attr_accessor :success + + def initialize(errors = [], id = nil, success = nil) + @errors = errors + @id = id + @success = success + end +end + +# {urn:partner.soap.sforce.com}DeleteResult +class DeleteResult + @@schema_type = "DeleteResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["errors", "Error[]"], + ["id", "SOAP::SOAPString"], + ["success", "SOAP::SOAPBoolean"] + ] + + attr_accessor :errors + attr_accessor :id + attr_accessor :success + + def initialize(errors = [], id = nil, success = nil) + @errors = errors + @id = id + @success = success + end +end + +# {urn:partner.soap.sforce.com}LeadConvert +class LeadConvert + @@schema_type = "LeadConvert" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["accountId", "SOAP::SOAPString"], + ["contactId", "SOAP::SOAPString"], + ["convertedStatus", "SOAP::SOAPString"], + ["doNotCreateOpportunity", "SOAP::SOAPBoolean"], + ["leadId", "SOAP::SOAPString"], + ["opportunityName", "SOAP::SOAPString"], + ["overwriteLeadSource", "SOAP::SOAPBoolean"], + ["ownerId", "SOAP::SOAPString"], + ["sendNotificationEmail", "SOAP::SOAPBoolean"] + ] + + attr_accessor :accountId + attr_accessor :contactId + attr_accessor :convertedStatus + attr_accessor :doNotCreateOpportunity + attr_accessor :leadId + attr_accessor :opportunityName + attr_accessor :overwriteLeadSource + attr_accessor :ownerId + attr_accessor :sendNotificationEmail + + def initialize(accountId = nil, contactId = nil, convertedStatus = nil, doNotCreateOpportunity = nil, leadId = nil, opportunityName = nil, overwriteLeadSource = nil, ownerId = nil, sendNotificationEmail = nil) + @accountId = accountId + @contactId = contactId + @convertedStatus = convertedStatus + @doNotCreateOpportunity = doNotCreateOpportunity + @leadId = leadId + @opportunityName = opportunityName + @overwriteLeadSource = overwriteLeadSource + @ownerId = ownerId + @sendNotificationEmail = sendNotificationEmail + end +end + +# {urn:partner.soap.sforce.com}LeadConvertResult +class LeadConvertResult + @@schema_type = "LeadConvertResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["accountId", "SOAP::SOAPString"], + ["contactId", "SOAP::SOAPString"], + ["errors", "Error[]"], + ["leadId", "SOAP::SOAPString"], + ["opportunityId", "SOAP::SOAPString"], + ["success", "SOAP::SOAPBoolean"] + ] + + attr_accessor :accountId + attr_accessor :contactId + attr_accessor :errors + attr_accessor :leadId + attr_accessor :opportunityId + attr_accessor :success + + def initialize(accountId = nil, contactId = nil, errors = [], leadId = nil, opportunityId = nil, success = nil) + @accountId = accountId + @contactId = contactId + @errors = errors + @leadId = leadId + @opportunityId = opportunityId + @success = success + end +end + +# {urn:partner.soap.sforce.com}DescribeSObjectResult +class DescribeSObjectResult + @@schema_type = "DescribeSObjectResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["activateable", "SOAP::SOAPBoolean"], + ["createable", "SOAP::SOAPBoolean"], + ["custom", "SOAP::SOAPBoolean"], + ["deletable", "SOAP::SOAPBoolean"], + ["fields", "Field[]"], + ["keyPrefix", "SOAP::SOAPString"], + ["label", "SOAP::SOAPString"], + ["layoutable", "SOAP::SOAPBoolean"], + ["name", "SOAP::SOAPString"], + ["queryable", "SOAP::SOAPBoolean"], + ["replicateable", "SOAP::SOAPBoolean"], + ["retrieveable", "SOAP::SOAPBoolean"], + ["searchable", "SOAP::SOAPBoolean"], + ["undeletable", "SOAP::SOAPBoolean"], + ["updateable", "SOAP::SOAPBoolean"], + ["urlDetail", "SOAP::SOAPString"], + ["urlEdit", "SOAP::SOAPString"], + ["urlNew", "SOAP::SOAPString"] + ] + + attr_accessor :activateable + attr_accessor :createable + attr_accessor :custom + attr_accessor :deletable + attr_accessor :fields + attr_accessor :keyPrefix + attr_accessor :label + attr_accessor :layoutable + attr_accessor :name + attr_accessor :queryable + attr_accessor :replicateable + attr_accessor :retrieveable + attr_accessor :searchable + attr_accessor :undeletable + attr_accessor :updateable + attr_accessor :urlDetail + attr_accessor :urlEdit + attr_accessor :urlNew + + def initialize(activateable = nil, createable = nil, custom = nil, deletable = nil, fields = [], keyPrefix = nil, label = nil, layoutable = nil, name = nil, queryable = nil, replicateable = nil, retrieveable = nil, searchable = nil, undeletable = nil, updateable = nil, urlDetail = nil, urlEdit = nil, urlNew = nil) + @activateable = activateable + @createable = createable + @custom = custom + @deletable = deletable + @fields = fields + @keyPrefix = keyPrefix + @label = label + @layoutable = layoutable + @name = name + @queryable = queryable + @replicateable = replicateable + @retrieveable = retrieveable + @searchable = searchable + @undeletable = undeletable + @updateable = updateable + @urlDetail = urlDetail + @urlEdit = urlEdit + @urlNew = urlNew + end +end + +# {urn:partner.soap.sforce.com}DescribeGlobalResult +class DescribeGlobalResult + @@schema_type = "DescribeGlobalResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["encoding", "SOAP::SOAPString"], + ["maxBatchSize", "SOAP::SOAPInt"], + ["types", "SOAP::SOAPString[]"] + ] + + attr_accessor :encoding + attr_accessor :maxBatchSize + attr_accessor :types + + def initialize(encoding = nil, maxBatchSize = nil, types = []) + @encoding = encoding + @maxBatchSize = maxBatchSize + @types = types + end +end + +# {urn:partner.soap.sforce.com}Field +class Field + @@schema_type = "Field" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["autoNumber", "SOAP::SOAPBoolean"], + ["byteLength", "SOAP::SOAPInt"], + ["createable", "SOAP::SOAPBoolean"], + ["custom", "SOAP::SOAPBoolean"], + ["defaultedOnCreate", "SOAP::SOAPBoolean"], + ["digits", "SOAP::SOAPInt"], + ["filterable", "SOAP::SOAPBoolean"], + ["label", "SOAP::SOAPString"], + ["length", "SOAP::SOAPInt"], + ["name", "SOAP::SOAPString"], + ["nameField", "SOAP::SOAPBoolean"], + ["nillable", "SOAP::SOAPBoolean"], + ["picklistValues", "PicklistEntry[]"], + ["precision", "SOAP::SOAPInt"], + ["referenceTo", "SOAP::SOAPString[]"], + ["restrictedPicklist", "SOAP::SOAPBoolean"], + ["scale", "SOAP::SOAPInt"], + ["soapType", "SOAP::SOAPString"], + ["type", "SOAP::SOAPString"], + ["updateable", "SOAP::SOAPBoolean"] + ] + + attr_accessor :autoNumber + attr_accessor :byteLength + attr_accessor :createable + attr_accessor :custom + attr_accessor :defaultedOnCreate + attr_accessor :digits + attr_accessor :filterable + attr_accessor :label + attr_accessor :length + attr_accessor :name + attr_accessor :nameField + attr_accessor :nillable + attr_accessor :picklistValues + attr_accessor :precision + attr_accessor :referenceTo + attr_accessor :restrictedPicklist + attr_accessor :scale + attr_accessor :soapType + attr_accessor :type + attr_accessor :updateable + + def initialize(autoNumber = nil, byteLength = nil, createable = nil, custom = nil, defaultedOnCreate = nil, digits = nil, filterable = nil, label = nil, length = nil, name = nil, nameField = nil, nillable = nil, picklistValues = [], precision = nil, referenceTo = [], restrictedPicklist = nil, scale = nil, soapType = nil, type = nil, updateable = nil) + @autoNumber = autoNumber + @byteLength = byteLength + @createable = createable + @custom = custom + @defaultedOnCreate = defaultedOnCreate + @digits = digits + @filterable = filterable + @label = label + @length = length + @name = name + @nameField = nameField + @nillable = nillable + @picklistValues = picklistValues + @precision = precision + @referenceTo = referenceTo + @restrictedPicklist = restrictedPicklist + @scale = scale + @soapType = soapType + @type = type + @updateable = updateable + end +end + +# {urn:partner.soap.sforce.com}PicklistEntry +class PicklistEntry + @@schema_type = "PicklistEntry" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["active", "SOAP::SOAPBoolean"], + ["defaultValue", "SOAP::SOAPBoolean"], + ["label", "SOAP::SOAPString"], + ["value", "SOAP::SOAPString"] + ] + + attr_accessor :active + attr_accessor :defaultValue + attr_accessor :label + attr_accessor :value + + def initialize(active = nil, defaultValue = nil, label = nil, value = nil) + @active = active + @defaultValue = defaultValue + @label = label + @value = value + end +end + +# {urn:partner.soap.sforce.com}DescribeLayoutResult +class DescribeLayoutResult + @@schema_type = "DescribeLayoutResult" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["layouts", "DescribeLayout[]"], + ["recordTypeMappings", "RecordTypeMapping[]"] + ] + + attr_accessor :layouts + attr_accessor :recordTypeMappings + + def initialize(layouts = [], recordTypeMappings = []) + @layouts = layouts + @recordTypeMappings = recordTypeMappings + end +end + +# {urn:partner.soap.sforce.com}DescribeLayout +class DescribeLayout + @@schema_type = "DescribeLayout" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["detailLayoutSections", "DescribeLayoutSection[]"], + ["editLayoutSections", "DescribeLayoutSection[]"], + ["id", "SOAP::SOAPString"] + ] + + attr_accessor :detailLayoutSections + attr_accessor :editLayoutSections + attr_accessor :id + + def initialize(detailLayoutSections = [], editLayoutSections = [], id = nil) + @detailLayoutSections = detailLayoutSections + @editLayoutSections = editLayoutSections + @id = id + end +end + +# {urn:partner.soap.sforce.com}DescribeLayoutSection +class DescribeLayoutSection + @@schema_type = "DescribeLayoutSection" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["columns", "SOAP::SOAPInt"], + ["heading", "SOAP::SOAPString"], + ["layoutRows", "DescribeLayoutRow[]"], + ["rows", "SOAP::SOAPInt"], + ["useHeading", "SOAP::SOAPBoolean"] + ] + + attr_accessor :columns + attr_accessor :heading + attr_accessor :layoutRows + attr_accessor :rows + attr_accessor :useHeading + + def initialize(columns = nil, heading = nil, layoutRows = [], rows = nil, useHeading = nil) + @columns = columns + @heading = heading + @layoutRows = layoutRows + @rows = rows + @useHeading = useHeading + end +end + +# {urn:partner.soap.sforce.com}DescribeLayoutRow +class DescribeLayoutRow + @@schema_type = "DescribeLayoutRow" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["layoutItems", "DescribeLayoutItem[]"], + ["numItems", "SOAP::SOAPInt"] + ] + + attr_accessor :layoutItems + attr_accessor :numItems + + def initialize(layoutItems = [], numItems = nil) + @layoutItems = layoutItems + @numItems = numItems + end +end + +# {urn:partner.soap.sforce.com}DescribeLayoutItem +class DescribeLayoutItem + @@schema_type = "DescribeLayoutItem" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["editable", "SOAP::SOAPBoolean"], + ["label", "SOAP::SOAPString"], + ["layoutComponents", "DescribeLayoutComponent[]"], + ["placeholder", "SOAP::SOAPBoolean"], + ["required", "SOAP::SOAPBoolean"] + ] + + attr_accessor :editable + attr_accessor :label + attr_accessor :layoutComponents + attr_accessor :placeholder + attr_accessor :required + + def initialize(editable = nil, label = nil, layoutComponents = [], placeholder = nil, required = nil) + @editable = editable + @label = label + @layoutComponents = layoutComponents + @placeholder = placeholder + @required = required + end +end + +# {urn:partner.soap.sforce.com}DescribeLayoutComponent +class DescribeLayoutComponent + @@schema_type = "DescribeLayoutComponent" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["tabOrder", "SOAP::SOAPInt"], + ["type", "SOAP::SOAPString"], + ["value", "SOAP::SOAPString"] + ] + + attr_accessor :tabOrder + attr_accessor :type + attr_accessor :value + + def initialize(tabOrder = nil, type = nil, value = nil) + @tabOrder = tabOrder + @type = type + @value = value + end +end + +# {urn:partner.soap.sforce.com}RecordTypeMapping +class RecordTypeMapping + @@schema_type = "RecordTypeMapping" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["available", "SOAP::SOAPBoolean"], + ["defaultRecordTypeMapping", "SOAP::SOAPBoolean"], + ["layoutId", "SOAP::SOAPString"], + ["name", "SOAP::SOAPString"], + ["picklistsForRecordType", "PicklistForRecordType[]"], + ["recordTypeId", "SOAP::SOAPString"] + ] + + attr_accessor :available + attr_accessor :defaultRecordTypeMapping + attr_accessor :layoutId + attr_accessor :name + attr_accessor :picklistsForRecordType + attr_accessor :recordTypeId + + def initialize(available = nil, defaultRecordTypeMapping = nil, layoutId = nil, name = nil, picklistsForRecordType = [], recordTypeId = nil) + @available = available + @defaultRecordTypeMapping = defaultRecordTypeMapping + @layoutId = layoutId + @name = name + @picklistsForRecordType = picklistsForRecordType + @recordTypeId = recordTypeId + end +end + +# {urn:partner.soap.sforce.com}PicklistForRecordType +class PicklistForRecordType + @@schema_type = "PicklistForRecordType" + @@schema_ns = "urn:partner.soap.sforce.com" + @@schema_element = [ + ["picklistName", "SOAP::SOAPString"], + ["picklistValues", "PicklistEntry[]"] + ] + + attr_accessor :picklistName + attr_accessor :picklistValues + + def initialize(picklistName = nil, picklistValues = []) + @picklistName = picklistName + @picklistValues = picklistValues + end +end + +# {urn:fault.partner.soap.sforce.com}ApiFault +class ApiFault + @@schema_type = "ApiFault" + @@schema_ns = "urn:fault.partner.soap.sforce.com" + @@schema_element = [ + ["exceptionCode", "SOAP::SOAPString"], + ["exceptionMessage", "SOAP::SOAPString"] + ] + + attr_accessor :exceptionCode + attr_accessor :exceptionMessage + + def initialize(exceptionCode = nil, exceptionMessage = nil) + @exceptionCode = exceptionCode + @exceptionMessage = exceptionMessage + end +end + +# {urn:fault.partner.soap.sforce.com}LoginFault +class LoginFault + @@schema_type = "LoginFault" + @@schema_ns = "urn:fault.partner.soap.sforce.com" + @@schema_element = [ + ["exceptionCode", "SOAP::SOAPString"], + ["exceptionMessage", "SOAP::SOAPString"] + ] + + attr_accessor :exceptionCode + attr_accessor :exceptionMessage + + def initialize(exceptionCode = nil, exceptionMessage = nil) + @exceptionCode = exceptionCode + @exceptionMessage = exceptionMessage + end +end + +# {urn:fault.partner.soap.sforce.com}InvalidSObjectFault +class InvalidSObjectFault + @@schema_type = "InvalidSObjectFault" + @@schema_ns = "urn:fault.partner.soap.sforce.com" + @@schema_element = [ + ["exceptionCode", "SOAP::SOAPString"], + ["exceptionMessage", "SOAP::SOAPString"] + ] + + attr_accessor :exceptionCode + attr_accessor :exceptionMessage + + def initialize(exceptionCode = nil, exceptionMessage = nil) + @exceptionCode = exceptionCode + @exceptionMessage = exceptionMessage + end +end + +# {urn:fault.partner.soap.sforce.com}InvalidFieldFault +class InvalidFieldFault + @@schema_type = "InvalidFieldFault" + @@schema_ns = "urn:fault.partner.soap.sforce.com" + @@schema_element = [ + ["exceptionCode", "SOAP::SOAPString"], + ["exceptionMessage", "SOAP::SOAPString"] + ] + + attr_accessor :exceptionCode + attr_accessor :exceptionMessage + + def initialize(exceptionCode = nil, exceptionMessage = nil) + @exceptionCode = exceptionCode + @exceptionMessage = exceptionMessage + end +end + +# {urn:fault.partner.soap.sforce.com}MalformedQueryFault +class MalformedQueryFault + @@schema_type = "MalformedQueryFault" + @@schema_ns = "urn:fault.partner.soap.sforce.com" + @@schema_element = [ + ["exceptionCode", "SOAP::SOAPString"], + ["exceptionMessage", "SOAP::SOAPString"] + ] + + attr_accessor :exceptionCode + attr_accessor :exceptionMessage + + def initialize(exceptionCode = nil, exceptionMessage = nil) + @exceptionCode = exceptionCode + @exceptionMessage = exceptionMessage + end +end + +# {urn:fault.partner.soap.sforce.com}InvalidQueryLocatorFault +class InvalidQueryLocatorFault + @@schema_type = "InvalidQueryLocatorFault" + @@schema_ns = "urn:fault.partner.soap.sforce.com" + @@schema_element = [ + ["exceptionCode", "SOAP::SOAPString"], + ["exceptionMessage", "SOAP::SOAPString"] + ] + + attr_accessor :exceptionCode + attr_accessor :exceptionMessage + + def initialize(exceptionCode = nil, exceptionMessage = nil) + @exceptionCode = exceptionCode + @exceptionMessage = exceptionMessage + end +end + +# {urn:fault.partner.soap.sforce.com}MalformedSearchFault +class MalformedSearchFault + @@schema_type = "MalformedSearchFault" + @@schema_ns = "urn:fault.partner.soap.sforce.com" + @@schema_element = [ + ["exceptionCode", "SOAP::SOAPString"], + ["exceptionMessage", "SOAP::SOAPString"] + ] + + attr_accessor :exceptionCode + attr_accessor :exceptionMessage + + def initialize(exceptionCode = nil, exceptionMessage = nil) + @exceptionCode = exceptionCode + @exceptionMessage = exceptionMessage + end +end + +# {urn:fault.partner.soap.sforce.com}InvalidNewPasswordFault +class InvalidNewPasswordFault + @@schema_type = "InvalidNewPasswordFault" + @@schema_ns = "urn:fault.partner.soap.sforce.com" + @@schema_element = [ + ["exceptionCode", "SOAP::SOAPString"], + ["exceptionMessage", "SOAP::SOAPString"] + ] + + attr_accessor :exceptionCode + attr_accessor :exceptionMessage + + def initialize(exceptionCode = nil, exceptionMessage = nil) + @exceptionCode = exceptionCode + @exceptionMessage = exceptionMessage + end +end + +# {urn:fault.partner.soap.sforce.com}InvalidIdFault +class InvalidIdFault + @@schema_type = "InvalidIdFault" + @@schema_ns = "urn:fault.partner.soap.sforce.com" + @@schema_element = [ + ["exceptionCode", "SOAP::SOAPString"], + ["exceptionMessage", "SOAP::SOAPString"] + ] + + attr_accessor :exceptionCode + attr_accessor :exceptionMessage + + def initialize(exceptionCode = nil, exceptionMessage = nil) + @exceptionCode = exceptionCode + @exceptionMessage = exceptionMessage + end +end + +# {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault +class UnexpectedErrorFault + @@schema_type = "UnexpectedErrorFault" + @@schema_ns = "urn:fault.partner.soap.sforce.com" + @@schema_element = [ + ["exceptionCode", "SOAP::SOAPString"], + ["exceptionMessage", "SOAP::SOAPString"] + ] + + attr_accessor :exceptionCode + attr_accessor :exceptionMessage + + def initialize(exceptionCode = nil, exceptionMessage = nil) + @exceptionCode = exceptionCode + @exceptionMessage = exceptionMessage + end +end + +# {urn:partner.soap.sforce.com}StatusCode +module StatusCode + ASSIGNEE_TYPE_REQUIRED = "ASSIGNEE_TYPE_REQUIRED" + BAD_CUSTOM_ENTITY_PARENT_DOMAIN = "BAD_CUSTOM_ENTITY_PARENT_DOMAIN" + CANNOT_CASCADE_PRODUCT_ACTIVE = "CANNOT_CASCADE_PRODUCT_ACTIVE" + CANNOT_DEACTIVATE_DIVISION = "CANNOT_DEACTIVATE_DIVISION" + CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY = "CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY" + CANNOT_REPARENT_RECORD = "CANNOT_REPARENT_RECORD" + CANNOT_RESOLVE_NAME = "CANNOT_RESOLVE_NAME" + CANNOT_UPDATE_CONVERTED_LEAD = "CANNOT_UPDATE_CONVERTED_LEAD" + CANT_DISABLE_CORP_CURRENCY = "CANT_DISABLE_CORP_CURRENCY" + CANT_UNSET_CORP_CURRENCY = "CANT_UNSET_CORP_CURRENCY" + CHILD_SHARE_FAILS_PARENT = "CHILD_SHARE_FAILS_PARENT" + CIRCULAR_DEPENDENCY = "CIRCULAR_DEPENDENCY" + CUSTOM_ENTITY_OR_FIELD_LIMIT = "CUSTOM_ENTITY_OR_FIELD_LIMIT" + CUSTOM_FIELD_INDEX_LIMIT_EXCEEDED = "CUSTOM_FIELD_INDEX_LIMIT_EXCEEDED" + CUSTOM_INDEX_EXISTS = "CUSTOM_INDEX_EXISTS" + DELETE_FAILED = "DELETE_FAILED" + DELETE_REQUIRED_ON_CASCADE = "DELETE_REQUIRED_ON_CASCADE" + DEPENDENCY_EXISTS = "DEPENDENCY_EXISTS" + DUPLICATE_CASE_SOLUTION = "DUPLICATE_CASE_SOLUTION" + DUPLICATE_CUSTOM_TAB_MOTIF = "DUPLICATE_CUSTOM_TAB_MOTIF" + DUPLICATE_DEVELOPER_NAME = "DUPLICATE_DEVELOPER_NAME" + DUPLICATE_MASTER_LABEL = "DUPLICATE_MASTER_LABEL" + DUPLICATE_USERNAME = "DUPLICATE_USERNAME" + DUPLICATE_VALUE = "DUPLICATE_VALUE" + ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE = "ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE" + ENTITY_IS_ARCHIVED = "ENTITY_IS_ARCHIVED" + ENTITY_IS_DELETED = "ENTITY_IS_DELETED" + ENTITY_IS_LOCKED = "ENTITY_IS_LOCKED" + FAILED_ACTIVATION = "FAILED_ACTIVATION" + FIELD_INTEGRITY_EXCEPTION = "FIELD_INTEGRITY_EXCEPTION" + INACTIVE_OWNER_OR_USER = "INACTIVE_OWNER_OR_USER" + INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY = "INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY" + INSUFFICIENT_ACCESS_OR_READONLY = "INSUFFICIENT_ACCESS_OR_READONLY" + INVALID_ACCESS_LEVEL = "INVALID_ACCESS_LEVEL" + INVALID_ARGUMENT_TYPE = "INVALID_ARGUMENT_TYPE" + INVALID_ASSIGNEE_TYPE = "INVALID_ASSIGNEE_TYPE" + INVALID_ASSIGNMENT_RULE = "INVALID_ASSIGNMENT_RULE" + INVALID_BATCH_OPERATION = "INVALID_BATCH_OPERATION" + INVALID_CREDIT_CARD_INFO = "INVALID_CREDIT_CARD_INFO" + INVALID_CROSS_REFERENCE_KEY = "INVALID_CROSS_REFERENCE_KEY" + INVALID_CROSS_REFERENCE_TYPE_FOR_FIELD = "INVALID_CROSS_REFERENCE_TYPE_FOR_FIELD" + INVALID_CURRENCY_ISO = "INVALID_CURRENCY_ISO" + INVALID_EMAIL_ADDRESS = "INVALID_EMAIL_ADDRESS" + INVALID_EMPTY_KEY_OWNER = "INVALID_EMPTY_KEY_OWNER" + INVALID_FIELD = "INVALID_FIELD" + INVALID_FIELD_FOR_INSERT_UPDATE = "INVALID_FIELD_FOR_INSERT_UPDATE" + INVALID_FILTER_ACTION = "INVALID_FILTER_ACTION" + INVALID_ID_FIELD = "INVALID_ID_FIELD" + INVALID_LINEITEM_CLONE_STATE = "INVALID_LINEITEM_CLONE_STATE" + INVALID_OPERATOR = "INVALID_OPERATOR" + INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST = "INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST" + INVALID_STATUS = "INVALID_STATUS" + INVALID_TYPE = "INVALID_TYPE" + INVALID_TYPE_FOR_OPERATION = "INVALID_TYPE_FOR_OPERATION" + INVALID_TYPE_ON_FIELD_IN_RECORD = "INVALID_TYPE_ON_FIELD_IN_RECORD" + LAST_MODIFIED_SINCE_TOO_OLD = "LAST_MODIFIED_SINCE_TOO_OLD" + LICENSE_LIMIT_EXCEEDED = "LICENSE_LIMIT_EXCEEDED" + MALFORMED_ID = "MALFORMED_ID" + MAXIMUM_CCEMAILS_EXCEEDED = "MAXIMUM_CCEMAILS_EXCEEDED" + MAXIMUM_DASHBOARD_COMPONENTS_EXCEEDED = "MAXIMUM_DASHBOARD_COMPONENTS_EXCEEDED" + MAXIMUM_SIZE_OF_ATTACHMENT = "MAXIMUM_SIZE_OF_ATTACHMENT" + MAXIMUM_SIZE_OF_DOCUMENT = "MAXIMUM_SIZE_OF_DOCUMENT" + MAX_ACTIONS_PER_RULE_EXCEEDED = "MAX_ACTIONS_PER_RULE_EXCEEDED" + MAX_ACTIVE_RULES_EXCEEDED = "MAX_ACTIVE_RULES_EXCEEDED" + MAX_TASK_DESCRIPTION_EXCEEEDED = "MAX_TASK_DESCRIPTION_EXCEEEDED" + MISSING_ARGUMENT = "MISSING_ARGUMENT" + NONUNIQUE_SHIPPING_ADDRESS = "NONUNIQUE_SHIPPING_ADDRESS" + NUMBER_OUTSIDE_VALID_RANGE = "NUMBER_OUTSIDE_VALID_RANGE" + PRIVATE_CONTACT_ON_ASSET = "PRIVATE_CONTACT_ON_ASSET" + REQUIRED_FIELD_MISSING = "REQUIRED_FIELD_MISSING" + SHARE_NEEDED_FOR_CHILD_OWNER = "SHARE_NEEDED_FOR_CHILD_OWNER" + STANDARD_PRICE_NOT_DEFINED = "STANDARD_PRICE_NOT_DEFINED" + STORAGE_LIMIT_EXCEEDED = "STORAGE_LIMIT_EXCEEDED" + TEXT_DATA_OUTSIDE_SUPPORTED_CHARSET = "TEXT_DATA_OUTSIDE_SUPPORTED_CHARSET" + TOO_MANY_ENUM_VALUE = "TOO_MANY_ENUM_VALUE" + TRANSFER_REQUIRES_READ = "TRANSFER_REQUIRES_READ" + UNKNOWN_EXCEPTION = "UNKNOWN_EXCEPTION" + UNSPECIFIED_EMAIL_ADDRESS = "UNSPECIFIED_EMAIL_ADDRESS" +end + +# {urn:partner.soap.sforce.com}fieldType +module FieldType + Base64 = "base64" + Boolean = "boolean" + Combobox = "combobox" + Currency = "currency" + Date = "date" + Datetime = "datetime" + Double = "double" + Email = "email" + Id = "id" + Int = "int" + Multipicklist = "multipicklist" + Percent = "percent" + Phone = "phone" + Picklist = "picklist" + Reference = "reference" + String = "string" + Textarea = "textarea" + Url = "url" +end + +# {urn:partner.soap.sforce.com}soapType +module SoapType + TnsID = "tns:ID" + XsdBase64Binary = "xsd:base64Binary" + XsdBoolean = "xsd:boolean" + XsdDate = "xsd:date" + XsdDateTime = "xsd:dateTime" + XsdDouble = "xsd:double" + XsdInt = "xsd:int" + XsdString = "xsd:string" +end + +# {urn:partner.soap.sforce.com}layoutComponentType +module LayoutComponentType + Field = "Field" + Separator = "Separator" +end + +# {urn:fault.partner.soap.sforce.com}ExceptionCode +module ExceptionCode + API_CURRENTLY_DISABLED = "API_CURRENTLY_DISABLED" + API_DISABLED_FOR_ORG = "API_DISABLED_FOR_ORG" + EXCEEDED_ID_LIMIT = "EXCEEDED_ID_LIMIT" + EXCEEDED_LEAD_CONVERT_LIMIT = "EXCEEDED_LEAD_CONVERT_LIMIT" + EXCEEDED_MAX_SIZE_REQUEST = "EXCEEDED_MAX_SIZE_REQUEST" + EXCEEDED_QUOTA = "EXCEEDED_QUOTA" + EXCEEDED_RATE_LIMIT = "EXCEEDED_RATE_LIMIT" + FUNCTIONALITY_NOT_ENABLED = "FUNCTIONALITY_NOT_ENABLED" + INSUFFICIENT_ACCESS = "INSUFFICIENT_ACCESS" + INVALID_ASSIGNMENT_RULE = "INVALID_ASSIGNMENT_RULE" + INVALID_BATCH_SIZE = "INVALID_BATCH_SIZE" + INVALID_CLIENT = "INVALID_CLIENT" + INVALID_FIELD = "INVALID_FIELD" + INVALID_ID_FIELD = "INVALID_ID_FIELD" + INVALID_LOGIN = "INVALID_LOGIN" + INVALID_NEW_PASSWORD = "INVALID_NEW_PASSWORD" + INVALID_OPERATION_WITH_EXPIRED_PASSWORD = "INVALID_OPERATION_WITH_EXPIRED_PASSWORD" + INVALID_QUERY_FILTER_OPERATOR = "INVALID_QUERY_FILTER_OPERATOR" + INVALID_QUERY_LOCATOR = "INVALID_QUERY_LOCATOR" + INVALID_QUERY_SCOPE = "INVALID_QUERY_SCOPE" + INVALID_REPLICATION_DATE = "INVALID_REPLICATION_DATE" + INVALID_SEARCH = "INVALID_SEARCH" + INVALID_SEARCH_SCOPE = "INVALID_SEARCH_SCOPE" + INVALID_SESSION_ID = "INVALID_SESSION_ID" + INVALID_SSO_GATEWAY_URL = "INVALID_SSO_GATEWAY_URL" + INVALID_TYPE = "INVALID_TYPE" + LOGIN_DURING_RESTRICTED_DOMAIN = "LOGIN_DURING_RESTRICTED_DOMAIN" + LOGIN_DURING_RESTRICTED_TIME = "LOGIN_DURING_RESTRICTED_TIME" + MALFORMED_QUERY = "MALFORMED_QUERY" + MALFORMED_SEARCH = "MALFORMED_SEARCH" + ORG_LOCKED = "ORG_LOCKED" + PASSWORD_LOCKOUT = "PASSWORD_LOCKOUT" + QUERY_TIMEOUT = "QUERY_TIMEOUT" + SERVER_UNAVAILABLE = "SERVER_UNAVAILABLE" + SSO_SERVICE_DOWN = "SSO_SERVICE_DOWN" + TRIAL_EXPIRED = "TRIAL_EXPIRED" + UNKNOWN_EXCEPTION = "UNKNOWN_EXCEPTION" + UNSUPPORTED_API_VERSION = "UNSUPPORTED_API_VERSION" + UNSUPPORTED_CLIENT = "UNSUPPORTED_CLIENT" +end + +# {urn:fault.partner.soap.sforce.com}FaultCode +module FaultCode + FnsAPI_CURRENTLY_DISABLED = "fns:API_CURRENTLY_DISABLED" + FnsAPI_DISABLED_FOR_ORG = "fns:API_DISABLED_FOR_ORG" + FnsEXCEEDED_ID_LIMIT = "fns:EXCEEDED_ID_LIMIT" + FnsEXCEEDED_LEAD_CONVERT_LIMIT = "fns:EXCEEDED_LEAD_CONVERT_LIMIT" + FnsEXCEEDED_MAX_SIZE_REQUEST = "fns:EXCEEDED_MAX_SIZE_REQUEST" + FnsEXCEEDED_QUOTA = "fns:EXCEEDED_QUOTA" + FnsEXCEEDED_RATE_LIMIT = "fns:EXCEEDED_RATE_LIMIT" + FnsFUNCTIONALITY_NOT_ENABLED = "fns:FUNCTIONALITY_NOT_ENABLED" + FnsINSUFFICIENT_ACCESS = "fns:INSUFFICIENT_ACCESS" + FnsINVALID_ASSIGNMENT_RULE = "fns:INVALID_ASSIGNMENT_RULE" + FnsINVALID_BATCH_SIZE = "fns:INVALID_BATCH_SIZE" + FnsINVALID_CLIENT = "fns:INVALID_CLIENT" + FnsINVALID_FIELD = "fns:INVALID_FIELD" + FnsINVALID_ID_FIELD = "fns:INVALID_ID_FIELD" + FnsINVALID_LOGIN = "fns:INVALID_LOGIN" + FnsINVALID_NEW_PASSWORD = "fns:INVALID_NEW_PASSWORD" + FnsINVALID_OPERATION_WITH_EXPIRED_PASSWORD = "fns:INVALID_OPERATION_WITH_EXPIRED_PASSWORD" + FnsINVALID_QUERY_FILTER_OPERATOR = "fns:INVALID_QUERY_FILTER_OPERATOR" + FnsINVALID_QUERY_LOCATOR = "fns:INVALID_QUERY_LOCATOR" + FnsINVALID_QUERY_SCOPE = "fns:INVALID_QUERY_SCOPE" + FnsINVALID_REPLICATION_DATE = "fns:INVALID_REPLICATION_DATE" + FnsINVALID_SEARCH = "fns:INVALID_SEARCH" + FnsINVALID_SEARCH_SCOPE = "fns:INVALID_SEARCH_SCOPE" + FnsINVALID_SESSION_ID = "fns:INVALID_SESSION_ID" + FnsINVALID_SSO_GATEWAY_URL = "fns:INVALID_SSO_GATEWAY_URL" + FnsINVALID_TYPE = "fns:INVALID_TYPE" + FnsLOGIN_DURING_RESTRICTED_DOMAIN = "fns:LOGIN_DURING_RESTRICTED_DOMAIN" + FnsLOGIN_DURING_RESTRICTED_TIME = "fns:LOGIN_DURING_RESTRICTED_TIME" + FnsMALFORMED_QUERY = "fns:MALFORMED_QUERY" + FnsMALFORMED_SEARCH = "fns:MALFORMED_SEARCH" + FnsORG_LOCKED = "fns:ORG_LOCKED" + FnsPASSWORD_LOCKOUT = "fns:PASSWORD_LOCKOUT" + FnsQUERY_TIMEOUT = "fns:QUERY_TIMEOUT" + FnsSERVER_UNAVAILABLE = "fns:SERVER_UNAVAILABLE" + FnsSSO_SERVICE_DOWN = "fns:SSO_SERVICE_DOWN" + FnsTRIAL_EXPIRED = "fns:TRIAL_EXPIRED" + FnsUNKNOWN_EXCEPTION = "fns:UNKNOWN_EXCEPTION" + FnsUNSUPPORTED_API_VERSION = "fns:UNSUPPORTED_API_VERSION" + FnsUNSUPPORTED_CLIENT = "fns:UNSUPPORTED_CLIENT" +end diff --git a/sample/showcase/wsdl/salesforce/defaultDriver.rb b/sample/showcase/wsdl/salesforce/defaultDriver.rb new file mode 100644 index 0000000..757fe2a --- /dev/null +++ b/sample/showcase/wsdl/salesforce/defaultDriver.rb @@ -0,0 +1,165 @@ +require 'default.rb' + +require 'soap/rpc/driver' + +class Soap < ::SOAP::RPC::Driver + DefaultEndpointUrl = "https://www.salesforce.com/services/Soap/u/5.0" + MappingRegistry = ::SOAP::Mapping::Registry.new + + Methods = [ + [ "", + "login", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "login"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "loginResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "describeSObject", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "describeSObject"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "describeSObjectResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "describeGlobal", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "describeGlobal"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "describeGlobalResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "describeLayout", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "describeLayout"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "describeLayoutResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "create", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "create"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "createResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "update", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "update"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "updateResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "delete", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "delete"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "deleteResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "retrieve", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "retrieve"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "retrieveResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "convertLead", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "convertLead"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "convertLeadResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "getDeleted", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "getDeleted"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "getDeletedResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "getUpdated", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "getUpdated"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "getUpdatedResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "query", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "query"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "queryResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "queryMore", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "queryMore"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "queryMoreResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "search", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "search"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "searchResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "getServerTimestamp", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "getServerTimestamp"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "getServerTimestampResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "setPassword", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "setPassword"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "setPasswordResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "resetPassword", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "resetPassword"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "resetPasswordResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "", + "getUserInfo", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "getUserInfo"], true], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:partner.soap.sforce.com", "getUserInfoResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = MappingRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end + diff --git a/sample/showcase/wsdl/salesforce/soap/property b/sample/showcase/wsdl/salesforce/soap/property new file mode 100644 index 0000000..17bdac3 --- /dev/null +++ b/sample/showcase/wsdl/salesforce/soap/property @@ -0,0 +1 @@ +client.protocol.http.ssl_config.ca_file = ca.pem diff --git a/sample/soapheader/authheader/authmgr.rb b/sample/soapheader/authheader/authmgr.rb new file mode 100644 index 0000000..a4d3b66 --- /dev/null +++ b/sample/soapheader/authheader/authmgr.rb @@ -0,0 +1,41 @@ +class Authmgr + def initialize + @users = { + 'NaHi' => 'passwd', + 'HiNa' => 'wspass' + } + @sessions = {} + end + + def login(userid, passwd) + userid and passwd and @users[userid] == passwd + end + + # returns userid + def auth(sessionid) + @sessions[sessionid] + end + + def create_session(userid) + while true + key = create_sessionkey + break unless @sessions[key] + end + @sessions[key] = userid + key + end + + def get_session(userid) + @sessions.index(userid) + end + + def destroy_session(sessionkey) + @sessions.delete(sessionkey) + end + +private + + def create_sessionkey + Time.now.usec.to_s + end +end diff --git a/sample/soapheader/authheader/client.rb b/sample/soapheader/authheader/client.rb new file mode 100644 index 0000000..4055fe6 --- /dev/null +++ b/sample/soapheader/authheader/client.rb @@ -0,0 +1,40 @@ +require 'soap/rpc/driver' +require 'soap/header/simplehandler' + +server = ARGV.shift || 'http://localhost:7000/' + +class ClientAuthHeaderHandler < SOAP::Header::SimpleHandler + MyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "auth") + + def initialize(userid, passwd) + super(MyHeaderName) + @sessionid = nil + @userid = userid + @passwd = passwd + @mustunderstand = true + end + + def on_simple_outbound + if @sessionid + { "sessionid" => @sessionid } + else + { "userid" => @userid, "passwd" => @passwd } + end + end + + def on_simple_inbound(my_header, mustunderstand) + @sessionid = my_header["sessionid"] + end +end + +ns = 'http://tempuri.org/authHeaderPort' +serv = SOAP::RPC::Driver.new(server, ns) +serv.add_method('deposit', 'amt') +serv.add_method('withdrawal', 'amt') + +serv.headerhandler << ClientAuthHeaderHandler.new('NaHi', 'passwd') + +serv.wiredump_dev = STDOUT + +p serv.deposit(150) +p serv.withdrawal(120) diff --git a/sample/soapheader/authheader/client2.rb b/sample/soapheader/authheader/client2.rb new file mode 100644 index 0000000..aa5172a --- /dev/null +++ b/sample/soapheader/authheader/client2.rb @@ -0,0 +1,42 @@ +require 'soap/rpc/driver' +require 'soap/header/simplehandler' + +server = ARGV.shift || 'http://localhost:7000/' + +class ClientAuthHeaderHandler < SOAP::Header::SimpleHandler + MyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "auth") + + attr_accessor :sessionid + + def initialize + super(MyHeaderName) + @sessionid = nil + end + + def on_simple_outbound + if @sessionid + { "sessionid" => @sessionid } + end + end + + def on_simple_inbound(my_header, mustunderstand) + @sessionid = my_header["sessionid"] + end +end + +ns = 'http://tempuri.org/authHeaderPort' +serv = SOAP::RPC::Driver.new(server, ns) +serv.add_method('login', 'userid', 'passwd') +serv.add_method('deposit', 'amt') +serv.add_method('withdrawal', 'amt') + +h = ClientAuthHeaderHandler.new + +serv.headerhandler << h + +serv.wiredump_dev = STDOUT + +sessionid = serv.login('NaHi', 'passwd') +h.sessionid = sessionid +p serv.deposit(150) +p serv.withdrawal(120) diff --git a/sample/soapheader/authheader/server.rb b/sample/soapheader/authheader/server.rb new file mode 100644 index 0000000..67b3e5d --- /dev/null +++ b/sample/soapheader/authheader/server.rb @@ -0,0 +1,73 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/standaloneServer' +require 'soap/header/simplehandler' +require 'authmgr' + +class AuthHeaderPortServer < SOAP::RPC::StandaloneServer + class AuthHeaderService + def self.create + new + end + + def deposit(amt) + "deposit #{amt} OK" + end + + def withdrawal(amt) + "withdrawal #{amt} OK" + end + end + + Name = 'http://tempuri.org/authHeaderPort' + def initialize(*arg) + super + add_rpc_servant(AuthHeaderService.new, Name) + # header handler must be a per request handler. + add_request_headerhandler(ServerAuthHeaderHandler) + end + + class ServerAuthHeaderHandler < SOAP::Header::SimpleHandler + MyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "auth") + + @authmgr = Authmgr.new + def self.create + new(@authmgr) + end + + def initialize(authmgr) + super(MyHeaderName) + @authmgr = authmgr + @userid = @sessionid = nil + end + + def on_simple_outbound + { "sessionid" => @sessionid } + end + + def on_simple_inbound(my_header, mu) + auth = false + userid = my_header["userid"] + passwd = my_header["passwd"] + if @authmgr.login(userid, passwd) + auth = true + elsif sessionid = my_header["sessionid"] + if userid = @authmgr.auth(sessionid) + @authmgr.destroy_session(sessionid) + auth = true + end + end + raise RuntimeError.new("authentication failed") unless auth + @userid = userid + @sessionid = @authmgr.create_session(userid) + end + end +end + +if $0 == __FILE__ + svr = AuthHeaderPortServer.new('AuthHeaderPortServer', nil, '0.0.0.0', 7000) + trap(:INT) do + svr.shutdown + end + status = svr.start +end diff --git a/sample/soapheader/authheader/server2.rb b/sample/soapheader/authheader/server2.rb new file mode 100644 index 0000000..b17d3a8 --- /dev/null +++ b/sample/soapheader/authheader/server2.rb @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/standaloneServer' +require 'soap/header/simplehandler' +require 'authmgr' + +class AuthHeaderPortServer < SOAP::RPC::StandaloneServer + class AuthHeaderService + def initialize(authmgr) + @authmgr = authmgr + end + + def login(userid, passwd) + if @authmgr.login(userid, passwd) + @authmgr.create_session(userid) + else + raise RuntimeError.new("authentication failed") + end + end + + def deposit(amt) + "deposit #{amt} OK" + end + + def withdrawal(amt) + "withdrawal #{amt} OK" + end + end + + Name = 'http://tempuri.org/authHeaderPort' + def initialize(*arg) + super + authmgr = Authmgr.new + add_rpc_servant(AuthHeaderService.new(authmgr), Name) + ServerAuthHeaderHandler.init(authmgr) + # header handler must be a per request handler. + add_request_headerhandler(ServerAuthHeaderHandler) + end + + class ServerAuthHeaderHandler < SOAP::Header::SimpleHandler + MyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "auth") + + def self.init(authmgr) + @authmgr = authmgr + end + + def self.create + new(@authmgr) + end + + def initialize(authmgr) + super(MyHeaderName) + @authmgr = authmgr + @sessionid = nil + end + + def on_simple_outbound + if @sessionid + { "sessionid" => @sessionid } + end + end + + def on_simple_inbound(my_header, mu) + auth = false + if sessionid = my_header["sessionid"] + if userid = @authmgr.auth(sessionid) + @authmgr.destroy_session(sessionid) + @sessionid = @authmgr.create_session(userid) + auth = true + end + end + raise RuntimeError.new("authentication failed") unless auth + end + end +end + +if $0 == __FILE__ + svr = AuthHeaderPortServer.new('AuthHeaderPortServer', nil, '0.0.0.0', 7000) + trap(:INT) do + svr.shutdown + end + status = svr.start +end diff --git a/sample/soapheader/soapext_basicauth/client.rb b/sample/soapheader/soapext_basicauth/client.rb new file mode 100644 index 0000000..c25b5e3 --- /dev/null +++ b/sample/soapheader/soapext_basicauth/client.rb @@ -0,0 +1,25 @@ +require 'soap/header/simplehandler' +require 'mms_MizGISDriver.rb' + +class BasicAuthHeaderHandler < SOAP::Header::SimpleHandler + MyHeaderName = XSD::QName.new('http://soap-authentication.org/basic/2001/10/', 'BasicAuth') + + def initialize(name, password) + super(MyHeaderName) + @name = name + @password = password + end + + def on_simple_outbound + { 'Name' => @name, 'Password' => @password } + end + + def on_simple_inbound(header, mustunderstand) + p [header, mustunderstand] + end +end + +obj = Mms_MizGISPortType.new +obj.headerhandler << BasicAuthHeaderHandler.new('NaHi', 'HiNa') +obj.wiredump_dev = STDOUT +obj.getVersion diff --git a/sample/soapheader/soapext_basicauth/mms_MizGIS.rb b/sample/soapheader/soapext_basicauth/mms_MizGIS.rb new file mode 100644 index 0000000..ed26a0b --- /dev/null +++ b/sample/soapheader/soapext_basicauth/mms_MizGIS.rb @@ -0,0 +1,701 @@ +require 'xsd/qname' + +# {urn:mms_MizGIS}ArrayOfint +class ArrayOfint < ::Array +end + +# {urn:mms_MizGIS}ArrayOfstring +class ArrayOfstring < ::Array +end + +# {urn:mms_MizGIS}AccessCredentialsType +class AccessCredentialsType + attr_accessor :name + attr_accessor :password + + def initialize(name = nil, password = nil) + @name = name + @password = password + end +end + +# {urn:mms_MizGIS}AddressSearchType +class AddressSearchType + attr_accessor :languageCode + attr_accessor :countryCode + attr_accessor :place + attr_accessor :street + attr_accessor :houseNumber + + def initialize(languageCode = nil, countryCode = nil, place = nil, street = nil, houseNumber = nil) + @languageCode = languageCode + @countryCode = countryCode + @place = place + @street = street + @houseNumber = houseNumber + end +end + +# {urn:mms_MizGIS}CoordinatesType +class CoordinatesType + attr_accessor :longitude + attr_accessor :latitude + + def initialize(longitude = nil, latitude = nil) + @longitude = longitude + @latitude = latitude + end +end + +# {urn:mms_MizGIS}BoxType +class BoxType + attr_accessor :bottomLeft + attr_accessor :topRight + + def initialize(bottomLeft = nil, topRight = nil) + @bottomLeft = bottomLeft + @topRight = topRight + end +end + +# {urn:mms_MizGIS}AreaType +class AreaType + attr_accessor :center + attr_accessor :radius + + def initialize(center = nil, radius = nil) + @center = center + @radius = radius + end +end + +# {urn:mms_MizGIS}ArrayOfAreaType +class ArrayOfAreaType < ::Array +end + +# {urn:mms_MizGIS}GeocodeType +class GeocodeType + attr_accessor :areaId + attr_accessor :streetNameId + attr_accessor :lineId + attr_accessor :position + attr_accessor :direction + attr_accessor :highway + + def initialize(areaId = nil, streetNameId = nil, lineId = nil, position = nil, direction = nil, highway = nil) + @areaId = areaId + @streetNameId = streetNameId + @lineId = lineId + @position = position + @direction = direction + @highway = highway + end +end + +# {urn:mms_MizGIS}ArrayOfGeocodeType +class ArrayOfGeocodeType < ::Array +end + +# {urn:mms_MizGIS}AddressType +class AddressType + attr_accessor :countryCode + attr_accessor :languageCode + attr_accessor :countryName + attr_accessor :region + attr_accessor :municipality + attr_accessor :languageCodeDistrict + attr_accessor :district + attr_accessor :languageCodeStreetName + attr_accessor :streetName + attr_accessor :houseNumber + attr_accessor :postCode + attr_accessor :coordinates + attr_accessor :geocode + + def initialize(countryCode = nil, languageCode = nil, countryName = nil, region = nil, municipality = nil, languageCodeDistrict = nil, district = nil, languageCodeStreetName = nil, streetName = nil, houseNumber = nil, postCode = nil, coordinates = nil, geocode = nil) + @countryCode = countryCode + @languageCode = languageCode + @countryName = countryName + @region = region + @municipality = municipality + @languageCodeDistrict = languageCodeDistrict + @district = district + @languageCodeStreetName = languageCodeStreetName + @streetName = streetName + @houseNumber = houseNumber + @postCode = postCode + @coordinates = coordinates + @geocode = geocode + end +end + +# {urn:mms_MizGIS}ArrayOfAddressType +class ArrayOfAddressType < ::Array +end + +# {urn:mms_MizGIS}PoiMacrocategoryType +class PoiMacrocategoryType + attr_accessor :macrocategoryId + attr_accessor :description + + def initialize(macrocategoryId = nil, description = nil) + @macrocategoryId = macrocategoryId + @description = description + end +end + +# {urn:mms_MizGIS}ArrayOfPoiMacrocategoryType +class ArrayOfPoiMacrocategoryType < ::Array +end + +# {urn:mms_MizGIS}PoiCategoryType +class PoiCategoryType + attr_accessor :categoryId + attr_accessor :macrocategoryId + attr_accessor :description + attr_accessor :populated + + def initialize(categoryId = nil, macrocategoryId = nil, description = nil, populated = nil) + @categoryId = categoryId + @macrocategoryId = macrocategoryId + @description = description + @populated = populated + end +end + +# {urn:mms_MizGIS}ArrayOfPoiCategoryType +class ArrayOfPoiCategoryType < ::Array +end + +# {urn:mms_MizGIS}PoiInfoType +class PoiInfoType + attr_accessor :type + attr_accessor :value + + def initialize(type = nil, value = nil) + @type = type + @value = value + end +end + +# {urn:mms_MizGIS}ArrayOfPoiInfoType +class ArrayOfPoiInfoType < ::Array +end + +# {urn:mms_MizGIS}PoiType +class PoiType + attr_accessor :poiId + attr_accessor :categories + attr_accessor :name + attr_accessor :coordinates + attr_accessor :geocode + attr_accessor :address + attr_accessor :postCode + attr_accessor :place + attr_accessor :country + attr_accessor :info + attr_accessor :distance + + def initialize(poiId = nil, categories = nil, name = nil, coordinates = nil, geocode = nil, address = nil, postCode = nil, place = nil, country = nil, info = nil, distance = nil) + @poiId = poiId + @categories = categories + @name = name + @coordinates = coordinates + @geocode = geocode + @address = address + @postCode = postCode + @place = place + @country = country + @info = info + @distance = distance + end +end + +# {urn:mms_MizGIS}ArrayOfPoiType +class ArrayOfPoiType < ::Array +end + +# {urn:mms_MizGIS}TmcIdType +class TmcIdType + attr_accessor :cid + attr_accessor :tabCd + attr_accessor :lcd + + def initialize(cid = nil, tabCd = nil, lcd = nil) + @cid = cid + @tabCd = tabCd + @lcd = lcd + end +end + +# {urn:mms_MizGIS}ArrayOfTmcIdType +class ArrayOfTmcIdType < ::Array +end + +# {urn:mms_MizGIS}TmcRoadQueryType +class TmcRoadQueryType + attr_accessor :cid + attr_accessor :tabCd + attr_accessor :roadLcds + attr_accessor :roadCodes + attr_accessor :roadTypes + attr_accessor :roadName + attr_accessor :status + + def initialize(cid = nil, tabCd = nil, roadLcds = nil, roadCodes = nil, roadTypes = nil, roadName = nil, status = nil) + @cid = cid + @tabCd = tabCd + @roadLcds = roadLcds + @roadCodes = roadCodes + @roadTypes = roadTypes + @roadName = roadName + @status = status + end +end + +# {urn:mms_MizGIS}ArrayOfTmcRoadQueryType +class ArrayOfTmcRoadQueryType < ::Array +end + +# {urn:mms_MizGIS}TmcRoadOptionsType +class TmcRoadOptionsType + attr_accessor :provideBox + attr_accessor :nameDirections + attr_accessor :listPoints + attr_accessor :minPointImportance + + def initialize(provideBox = nil, nameDirections = nil, listPoints = nil, minPointImportance = nil) + @provideBox = provideBox + @nameDirections = nameDirections + @listPoints = listPoints + @minPointImportance = minPointImportance + end +end + +# {urn:mms_MizGIS}TmcPointType +class TmcPointType + attr_accessor :pointId + attr_accessor :roadLcd + attr_accessor :segmentLcd + attr_accessor :areaLcd + attr_accessor :coordinates + attr_accessor :pointName + attr_accessor :importance + + def initialize(pointId = nil, roadLcd = nil, segmentLcd = nil, areaLcd = nil, coordinates = nil, pointName = nil, importance = nil) + @pointId = pointId + @roadLcd = roadLcd + @segmentLcd = segmentLcd + @areaLcd = areaLcd + @coordinates = coordinates + @pointName = pointName + @importance = importance + end +end + +# {urn:mms_MizGIS}ArrayOfTmcPointType +class ArrayOfTmcPointType < ::Array +end + +# {urn:mms_MizGIS}TmcRoadType +class TmcRoadType + attr_accessor :roadId + attr_accessor :roadType + attr_accessor :roadCode + attr_accessor :roadName + attr_accessor :box + attr_accessor :status + attr_accessor :positiveDirName + attr_accessor :negativeDirName + attr_accessor :points + + def initialize(roadId = nil, roadType = nil, roadCode = nil, roadName = nil, box = nil, status = nil, positiveDirName = nil, negativeDirName = nil, points = nil) + @roadId = roadId + @roadType = roadType + @roadCode = roadCode + @roadName = roadName + @box = box + @status = status + @positiveDirName = positiveDirName + @negativeDirName = negativeDirName + @points = points + end +end + +# {urn:mms_MizGIS}ArrayOfTmcRoadType +class ArrayOfTmcRoadType < ::Array +end + +# {urn:mms_MizGIS}TmcTrafficQueryType +class TmcTrafficQueryType + attr_accessor :area + attr_accessor :box + attr_accessor :roadIds + attr_accessor :fromPoint + attr_accessor :toPoint + attr_accessor :traffIds + + def initialize(area = nil, box = nil, roadIds = nil, fromPoint = nil, toPoint = nil, traffIds = nil) + @area = area + @box = box + @roadIds = roadIds + @fromPoint = fromPoint + @toPoint = toPoint + @traffIds = traffIds + end +end + +# {urn:mms_MizGIS}ArrayOfTmcTrafficQueryType +class ArrayOfTmcTrafficQueryType < ::Array +end + +# {urn:mms_MizGIS}TmcTrafficOptionsType +class TmcTrafficOptionsType + attr_accessor :languageCode + attr_accessor :maxResults + attr_accessor :orderBySeverity + + def initialize(languageCode = nil, maxResults = nil, orderBySeverity = nil) + @languageCode = languageCode + @maxResults = maxResults + @orderBySeverity = orderBySeverity + end +end + +# {urn:mms_MizGIS}TrafficInfoType +class TrafficInfoType + attr_accessor :id + attr_accessor :cat + attr_accessor :dob + attr_accessor :dob2 + attr_accessor :dateTime + attr_accessor :coordinates + attr_accessor :distance + attr_accessor :road + attr_accessor :roadName + attr_accessor :directionName + attr_accessor :segmentName + attr_accessor :areaName + attr_accessor :place + attr_accessor :extraPlace + attr_accessor :text + attr_accessor :extraText + attr_accessor :source + + def initialize(id = nil, cat = nil, dob = nil, dob2 = nil, dateTime = nil, coordinates = nil, distance = nil, road = nil, roadName = nil, directionName = nil, segmentName = nil, areaName = nil, place = nil, extraPlace = nil, text = nil, extraText = nil, source = nil) + @id = id + @cat = cat + @dob = dob + @dob2 = dob2 + @dateTime = dateTime + @coordinates = coordinates + @distance = distance + @road = road + @roadName = roadName + @directionName = directionName + @segmentName = segmentName + @areaName = areaName + @place = place + @extraPlace = extraPlace + @text = text + @extraText = extraText + @source = source + end +end + +# {urn:mms_MizGIS}ArrayOfTrafficInfoType +class ArrayOfTrafficInfoType < ::Array +end + +# {urn:mms_MizGIS}RouteParametersType +class RouteParametersType + attr_accessor :startingTime + attr_accessor :arrivalTime + attr_accessor :mode + attr_accessor :optimization + attr_accessor :realTime + attr_accessor :descriptionLevel + attr_accessor :descriptionLanguageCode + attr_accessor :providePath + attr_accessor :providePathPoints + + def initialize(startingTime = nil, arrivalTime = nil, mode = nil, optimization = nil, realTime = nil, descriptionLevel = nil, descriptionLanguageCode = nil, providePath = nil, providePathPoints = nil) + @startingTime = startingTime + @arrivalTime = arrivalTime + @mode = mode + @optimization = optimization + @realTime = realTime + @descriptionLevel = descriptionLevel + @descriptionLanguageCode = descriptionLanguageCode + @providePath = providePath + @providePathPoints = providePathPoints + end +end + +# {urn:mms_MizGIS}RouteStepType +class RouteStepType + attr_accessor :time + attr_accessor :duration + attr_accessor :distance + attr_accessor :action + attr_accessor :description + + def initialize(time = nil, duration = nil, distance = nil, action = nil, description = nil) + @time = time + @duration = duration + @distance = distance + @action = action + @description = description + end +end + +# {urn:mms_MizGIS}ArrayOfRouteStepType +class ArrayOfRouteStepType < ::Array +end + +# {urn:mms_MizGIS}RouteSegmentType +class RouteSegmentType + attr_accessor :origin + attr_accessor :destination + attr_accessor :startingTime + attr_accessor :duration + attr_accessor :distance + attr_accessor :vehicle + attr_accessor :steps + attr_accessor :path + + def initialize(origin = nil, destination = nil, startingTime = nil, duration = nil, distance = nil, vehicle = nil, steps = nil, path = nil) + @origin = origin + @destination = destination + @startingTime = startingTime + @duration = duration + @distance = distance + @vehicle = vehicle + @steps = steps + @path = path + end +end + +# {urn:mms_MizGIS}ArrayOfRouteSegmentType +class ArrayOfRouteSegmentType < ::Array +end + +# {urn:mms_MizGIS}RoutePartType +class RoutePartType + attr_accessor :origin + attr_accessor :destination + attr_accessor :startingTime + attr_accessor :duration + attr_accessor :distance + attr_accessor :segments + + def initialize(origin = nil, destination = nil, startingTime = nil, duration = nil, distance = nil, segments = nil) + @origin = origin + @destination = destination + @startingTime = startingTime + @duration = duration + @distance = distance + @segments = segments + end +end + +# {urn:mms_MizGIS}ArrayOfRoutePartType +class ArrayOfRoutePartType < ::Array +end + +# {urn:mms_MizGIS}RouteType +class RouteType + attr_accessor :routeId + attr_accessor :origin + attr_accessor :destination + attr_accessor :startingTime + attr_accessor :duration + attr_accessor :distance + attr_accessor :parts + + def initialize(routeId = nil, origin = nil, destination = nil, startingTime = nil, duration = nil, distance = nil, parts = nil) + @routeId = routeId + @origin = origin + @destination = destination + @startingTime = startingTime + @duration = duration + @distance = distance + @parts = parts + end +end + +# {urn:mms_MizGIS}ArrayOfRouteType +class ArrayOfRouteType < ::Array +end + +# {urn:mms_MizGIS}ImagePointType +class ImagePointType + attr_accessor :x + attr_accessor :y + + def initialize(x = nil, y = nil) + @x = x + @y = y + end +end + +# {urn:mms_MizGIS}ImageSizeType +class ImageSizeType + attr_accessor :width + attr_accessor :height + + def initialize(width = nil, height = nil) + @width = width + @height = height + end +end + +# {urn:mms_MizGIS}MapIconType +class MapIconType + attr_accessor :iconId + attr_accessor :iconType + attr_accessor :description + attr_accessor :dimmed + attr_accessor :minimize + attr_accessor :coordinates + attr_accessor :point + + def initialize(iconId = nil, iconType = nil, description = nil, dimmed = nil, minimize = nil, coordinates = nil, point = nil) + @iconId = iconId + @iconType = iconType + @description = description + @dimmed = dimmed + @minimize = minimize + @coordinates = coordinates + @point = point + end +end + +# {urn:mms_MizGIS}ArrayOfMapIconType +class ArrayOfMapIconType < ::Array +end + +# {urn:mms_MizGIS}MapOptionsType +class MapOptionsType + attr_accessor :format + attr_accessor :showTrafficEvents + attr_accessor :trafficIconPrefix + attr_accessor :trafficIconsDimmed + attr_accessor :roadId + attr_accessor :routeId + attr_accessor :poiIds + attr_accessor :trafficInfoIds + attr_accessor :icons + attr_accessor :routeIds + attr_accessor :showBasicPois + + def initialize(format = nil, showTrafficEvents = nil, trafficIconPrefix = nil, trafficIconsDimmed = nil, roadId = nil, routeId = nil, poiIds = nil, trafficInfoIds = nil, icons = nil, routeIds = nil, showBasicPois = nil) + @format = format + @showTrafficEvents = showTrafficEvents + @trafficIconPrefix = trafficIconPrefix + @trafficIconsDimmed = trafficIconsDimmed + @roadId = roadId + @routeId = routeId + @poiIds = poiIds + @trafficInfoIds = trafficInfoIds + @icons = icons + @routeIds = routeIds + @showBasicPois = showBasicPois + end +end + +# {urn:mms_MizGIS}MapType +class MapType + attr_accessor :imageSize + attr_accessor :box + attr_accessor :width + attr_accessor :height + attr_accessor :imageUrl + attr_accessor :icons + + def initialize(imageSize = nil, box = nil, width = nil, height = nil, imageUrl = nil, icons = nil) + @imageSize = imageSize + @box = box + @width = width + @height = height + @imageUrl = imageUrl + @icons = icons + end +end + +# {urn:mms_MizGIS}ModeType +class ModeType < ::String + RmCAR = ModeType.new("rmCAR") + RmONFOOT = ModeType.new("rmONFOOT") + RmPT = ModeType.new("rmPT") +end + +# {urn:mms_MizGIS}VehicleType +class VehicleType < ::String + VtAIRPLANE = VehicleType.new("vtAIRPLANE") + VtANY = VehicleType.new("vtANY") + VtBICYCLE = VehicleType.new("vtBICYCLE") + VtBUS = VehicleType.new("vtBUS") + VtCAR = VehicleType.new("vtCAR") + VtDELIVERYTRUCK = VehicleType.new("vtDELIVERY-TRUCK") + VtEMERGENCYVEHICLE = VehicleType.new("vtEMERGENCY-VEHICLE") + VtMETRO = VehicleType.new("vtMETRO") + VtNULL = VehicleType.new("vtNULL") + VtPEDESTRIAN = VehicleType.new("vtPEDESTRIAN") + VtPUBLICBUS = VehicleType.new("vtPUBLIC-BUS") + VtRESIDENTIALVEHICLE = VehicleType.new("vtRESIDENTIAL-VEHICLE") + VtTAXI = VehicleType.new("vtTAXI") + VtTRAIN = VehicleType.new("vtTRAIN") + VtTRAM = VehicleType.new("vtTRAM") +end + +# {urn:mms_MizGIS}OptimizationType +class OptimizationType < ::String + OtCHEAPEST = OptimizationType.new("otCHEAPEST") + OtFASTEST = OptimizationType.new("otFASTEST") + OtSHORTEST = OptimizationType.new("otSHORTEST") +end + +# {urn:mms_MizGIS}DescriptionLevelType +class DescriptionLevelType < ::String + DlBRIEF = DescriptionLevelType.new("dlBRIEF") + DlNONE = DescriptionLevelType.new("dlNONE") + DlNORMAL = DescriptionLevelType.new("dlNORMAL") +end + +# {urn:mms_MizGIS}StepActionType +class StepActionType < ::String + SaARRIVE = StepActionType.new("saARRIVE") + SaCHANGECOUNTRY = StepActionType.new("saCHANGECOUNTRY") + SaCONTINUE = StepActionType.new("saCONTINUE") + SaFERRY = StepActionType.new("saFERRY") + SaMOTORWAYBEGIN = StepActionType.new("saMOTORWAYBEGIN") + SaMOTORWAYCHANGE = StepActionType.new("saMOTORWAYCHANGE") + SaMOTORWAYCONTINUE = StepActionType.new("saMOTORWAYCONTINUE") + SaMOTORWAYEND = StepActionType.new("saMOTORWAYEND") + SaMOTORWAYENTER = StepActionType.new("saMOTORWAYENTER") + SaMOTORWAYLEAVE = StepActionType.new("saMOTORWAYLEAVE") + SaNULL = StepActionType.new("saNULL") + SaONFOOTARRIVE = StepActionType.new("saONFOOTARRIVE") + SaONFOOTSTART = StepActionType.new("saONFOOTSTART") + SaPTTRAVEL = StepActionType.new("saPTTRAVEL") + SaPTWAIT = StepActionType.new("saPTWAIT") + SaSTART = StepActionType.new("saSTART") + SaSTOP = StepActionType.new("saSTOP") + SaTURNLEFT = StepActionType.new("saTURNLEFT") + SaTURNRIGHT = StepActionType.new("saTURNRIGHT") +end + +# {urn:mms_MizGIS}TmcRoadTypeType +class TmcRoadTypeType < ::String + RtITAAUTOS = TmcRoadTypeType.new("rtITA-AUTOS") + RtITADIR = TmcRoadTypeType.new("rtITA-DIR") + RtITARACC = TmcRoadTypeType.new("rtITA-RACC") + RtITASGC = TmcRoadTypeType.new("rtITA-SGC") + RtITASS = TmcRoadTypeType.new("rtITA-SS") + RtITATANG = TmcRoadTypeType.new("rtITA-TANG") + RtITATRAF = TmcRoadTypeType.new("rtITA-TRAF") + RtNLDA = TmcRoadTypeType.new("rtNLD-A") + RtNLDN = TmcRoadTypeType.new("rtNLD-N") + RtUNDEF = TmcRoadTypeType.new("rtUNDEF") +end diff --git a/sample/soapheader/soapext_basicauth/mms_MizGIS.wsdl b/sample/soapheader/soapext_basicauth/mms_MizGIS.wsdl new file mode 100644 index 0000000..a79e237 --- /dev/null +++ b/sample/soapheader/soapext_basicauth/mms_MizGIS.wsdl @@ -0,0 +1,1007 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Service definition of function mms__getVersion + + + + + Service definition of function mms__getAvailableCountries + + + + + Service definition of function mms__findAddress + + + + + Service definition of function mms__getAddressFromGeocode + + + + + Service definition of function mms__findGeocodeFromCoordinates + + + + + Service definition of function mms__findAddressFromCoordinates + + + + + Service definition of function mms__getListOfPoiMacrocategories + + + + + Service definition of function mms__getListOfPoiCategories + + + + + Service definition of function mms__findPois + + + + + Service definition of function mms__getPoiInfo + + + + + Service definition of function mms__getListOfRoads + + + + + Service definition of function mms__getTrafficInfo + + + + + Service definition of function mms__getTrafficStatus + + + + + Service definition of function mms__findRoute + + + + + Service definition of function mms__getMap + + + + + Service definition of function mms__getMapAround + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MizGIS Web Service + + + + + + diff --git a/sample/soapheader/soapext_basicauth/mms_MizGISClient.rb b/sample/soapheader/soapext_basicauth/mms_MizGISClient.rb new file mode 100644 index 0000000..a0e4ed9 --- /dev/null +++ b/sample/soapheader/soapext_basicauth/mms_MizGISClient.rb @@ -0,0 +1,231 @@ +#!/usr/bin/env ruby +require 'mms_MizGISDriver.rb' + +endpoint_url = ARGV.shift +obj = Mms_MizGISPortType.new(endpoint_url) + +# run ruby with -d to see SOAP wiredumps. +obj.wiredump_dev = STDERR if $DEBUG + +# SYNOPSIS +# getVersion +# +# ARGS +# N/A +# +# RETURNS +# name C_String - {http://www.w3.org/2001/XMLSchema}string +# version C_String - {http://www.w3.org/2001/XMLSchema}string +# date C_String - {http://www.w3.org/2001/XMLSchema}string +# cartographyVersion C_String - {http://www.w3.org/2001/XMLSchema}string +# poiCartographyVersion C_String - {http://www.w3.org/2001/XMLSchema}string +# + +puts obj.getVersion + +# SYNOPSIS +# getAvailableCountries +# +# ARGS +# N/A +# +# RETURNS +# countries ArrayOfstring - {urn:mms_MizGIS}ArrayOfstring +# + +puts obj.getAvailableCountries + +# SYNOPSIS +# findAddress(addressSearch, maxResults, onlyMunicipalities) +# +# ARGS +# addressSearch AddressSearchType - {urn:mms_MizGIS}AddressSearchType +# maxResults Int - {http://www.w3.org/2001/XMLSchema}int +# onlyMunicipalities Boolean - {http://www.w3.org/2001/XMLSchema}boolean +# +# RETURNS +# addresses ArrayOfAddressType - {urn:mms_MizGIS}ArrayOfAddressType +# +addressSearch = maxResults = onlyMunicipalities = nil +puts obj.findAddress(addressSearch, maxResults, onlyMunicipalities) + +# SYNOPSIS +# getAddressFromGeocode(geocode, languageCode) +# +# ARGS +# geocode GeocodeType - {urn:mms_MizGIS}GeocodeType +# languageCode C_String - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# address AddressType - {urn:mms_MizGIS}AddressType +# +geocode = languageCode = nil +puts obj.getAddressFromGeocode(geocode, languageCode) + +# SYNOPSIS +# findGeocodeFromCoordinates(coordinates, vehicle) +# +# ARGS +# coordinates CoordinatesType - {urn:mms_MizGIS}CoordinatesType +# vehicle Int - {http://www.w3.org/2001/XMLSchema}int +# +# RETURNS +# found Boolean - {http://www.w3.org/2001/XMLSchema}boolean +# geocode GeocodeType - {urn:mms_MizGIS}GeocodeType +# distance Double - {http://www.w3.org/2001/XMLSchema}double +# +coordinates = vehicle = nil +puts obj.findGeocodeFromCoordinates(coordinates, vehicle) + +# SYNOPSIS +# findAddressFromCoordinates(coordinates, vehicle, languageCode) +# +# ARGS +# coordinates CoordinatesType - {urn:mms_MizGIS}CoordinatesType +# vehicle Int - {http://www.w3.org/2001/XMLSchema}int +# languageCode C_String - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# found Boolean - {http://www.w3.org/2001/XMLSchema}boolean +# address AddressType - {urn:mms_MizGIS}AddressType +# distance Double - {http://www.w3.org/2001/XMLSchema}double +# +coordinates = vehicle = languageCode = nil +puts obj.findAddressFromCoordinates(coordinates, vehicle, languageCode) + +# SYNOPSIS +# getListOfPoiMacrocategories(languageCode) +# +# ARGS +# languageCode C_String - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# macrocategories ArrayOfPoiMacrocategoryType - {urn:mms_MizGIS}ArrayOfPoiMacrocategoryType +# +languageCode = nil +puts obj.getListOfPoiMacrocategories(languageCode) + +# SYNOPSIS +# getListOfPoiCategories(languageCode, onlyPopulated) +# +# ARGS +# languageCode C_String - {http://www.w3.org/2001/XMLSchema}string +# onlyPopulated Boolean - {http://www.w3.org/2001/XMLSchema}boolean +# +# RETURNS +# categories ArrayOfPoiCategoryType - {urn:mms_MizGIS}ArrayOfPoiCategoryType +# +languageCode = onlyPopulated = nil +puts obj.getListOfPoiCategories(languageCode, onlyPopulated) + +# SYNOPSIS +# findPois(area, box, maxResults, macroCategoryIds, categoryIds, provideInfo) +# +# ARGS +# area AreaType - {urn:mms_MizGIS}AreaType +# box BoxType - {urn:mms_MizGIS}BoxType +# maxResults Int - {http://www.w3.org/2001/XMLSchema}int +# macroCategoryIds ArrayOfstring - {urn:mms_MizGIS}ArrayOfstring +# categoryIds ArrayOfstring - {urn:mms_MizGIS}ArrayOfstring +# provideInfo Boolean - {http://www.w3.org/2001/XMLSchema}boolean +# +# RETURNS +# pois ArrayOfPoiType - {urn:mms_MizGIS}ArrayOfPoiType +# +area = box = maxResults = macroCategoryIds = categoryIds = provideInfo = nil +puts obj.findPois(area, box, maxResults, macroCategoryIds, categoryIds, provideInfo) + +# SYNOPSIS +# getPoiInfo(poiIds, provideInfo) +# +# ARGS +# poiIds ArrayOfint - {urn:mms_MizGIS}ArrayOfint +# provideInfo Boolean - {http://www.w3.org/2001/XMLSchema}boolean +# +# RETURNS +# pois ArrayOfPoiType - {urn:mms_MizGIS}ArrayOfPoiType +# +poiIds = provideInfo = nil +puts obj.getPoiInfo(poiIds, provideInfo) + +# SYNOPSIS +# getListOfRoads(roadQueries, roadOptions) +# +# ARGS +# roadQueries ArrayOfTmcRoadQueryType - {urn:mms_MizGIS}ArrayOfTmcRoadQueryType +# roadOptions TmcRoadOptionsType - {urn:mms_MizGIS}TmcRoadOptionsType +# +# RETURNS +# roads ArrayOfTmcRoadType - {urn:mms_MizGIS}ArrayOfTmcRoadType +# +roadQueries = roadOptions = nil +puts obj.getListOfRoads(roadQueries, roadOptions) + +# SYNOPSIS +# getTrafficInfo(trafficQuery, trafficOptions) +# +# ARGS +# trafficQuery TmcTrafficQueryType - {urn:mms_MizGIS}TmcTrafficQueryType +# trafficOptions TmcTrafficOptionsType - {urn:mms_MizGIS}TmcTrafficOptionsType +# +# RETURNS +# info ArrayOfTrafficInfoType - {urn:mms_MizGIS}ArrayOfTrafficInfoType +# +trafficQuery = trafficOptions = nil +puts obj.getTrafficInfo(trafficQuery, trafficOptions) + +# SYNOPSIS +# getTrafficStatus(areas) +# +# ARGS +# areas ArrayOfAreaType - {urn:mms_MizGIS}ArrayOfAreaType +# +# RETURNS +# status ArrayOfint - {urn:mms_MizGIS}ArrayOfint +# +areas = nil +puts obj.getTrafficStatus(areas) + +# SYNOPSIS +# findRoute(places, params) +# +# ARGS +# places ArrayOfGeocodeType - {urn:mms_MizGIS}ArrayOfGeocodeType +# params RouteParametersType - {urn:mms_MizGIS}RouteParametersType +# +# RETURNS +# route RouteType - {urn:mms_MizGIS}RouteType +# +places = params = nil +puts obj.findRoute(places, params) + +# SYNOPSIS +# getMap(imageSize, box, options) +# +# ARGS +# imageSize ImageSizeType - {urn:mms_MizGIS}ImageSizeType +# box BoxType - {urn:mms_MizGIS}BoxType +# options MapOptionsType - {urn:mms_MizGIS}MapOptionsType +# +# RETURNS +# map MapType - {urn:mms_MizGIS}MapType +# +imageSize = box = options = nil +puts obj.getMap(imageSize, box, options) + +# SYNOPSIS +# getMapAround(imageSize, center, radius, options) +# +# ARGS +# imageSize ImageSizeType - {urn:mms_MizGIS}ImageSizeType +# center CoordinatesType - {urn:mms_MizGIS}CoordinatesType +# radius Double - {http://www.w3.org/2001/XMLSchema}double +# options MapOptionsType - {urn:mms_MizGIS}MapOptionsType +# +# RETURNS +# map MapType - {urn:mms_MizGIS}MapType +# +imageSize = center = radius = options = nil +puts obj.getMapAround(imageSize, center, radius, options) + + diff --git a/sample/soapheader/soapext_basicauth/mms_MizGISDriver.rb b/sample/soapheader/soapext_basicauth/mms_MizGISDriver.rb new file mode 100644 index 0000000..0ceb50c --- /dev/null +++ b/sample/soapheader/soapext_basicauth/mms_MizGISDriver.rb @@ -0,0 +1,210 @@ +require 'mms_MizGIS.rb' +require 'mms_MizGISMappingRegistry.rb' +require 'soap/rpc/driver' + +class Mms_MizGISPortType < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://www.verona.miz.it/mizgis-api/3.4/server" + + Methods = [ + [ XSD::QName.new("urn:mms_MizGIS", "getVersion"), + "", + "getVersion", + [ [:retval, "name", ["::SOAP::SOAPString"]], + [:out, "version", ["::SOAP::SOAPString"]], + [:out, "date", ["::SOAP::SOAPString"]], + [:out, "cartographyVersion", ["::SOAP::SOAPString"]], + [:out, "poiCartographyVersion", ["::SOAP::SOAPString"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "getAvailableCountries"), + "", + "getAvailableCountries", + [ [:retval, "countries", ["C_String[]", "urn:mms_MizGIS", "ArrayOfstring"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "findAddress"), + "", + "findAddress", + [ [:in, "addressSearch", ["AddressSearchType", "urn:mms_MizGIS", "AddressSearchType"]], + [:in, "maxResults", ["::SOAP::SOAPInt"]], + [:in, "onlyMunicipalities", ["::SOAP::SOAPBoolean"]], + [:retval, "addresses", ["AddressType[]", "urn:mms_MizGIS", "ArrayOfAddressType"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "getAddressFromGeocode"), + "", + "getAddressFromGeocode", + [ [:in, "geocode", ["GeocodeType", "urn:mms_MizGIS", "GeocodeType"]], + [:in, "languageCode", ["::SOAP::SOAPString"]], + [:retval, "address", ["AddressType", "urn:mms_MizGIS", "AddressType"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "findGeocodeFromCoordinates"), + "", + "findGeocodeFromCoordinates", + [ [:in, "coordinates", ["CoordinatesType", "urn:mms_MizGIS", "CoordinatesType"]], + [:in, "vehicle", ["::SOAP::SOAPInt"]], + [:retval, "found", ["::SOAP::SOAPBoolean"]], + [:out, "geocode", ["GeocodeType", "urn:mms_MizGIS", "GeocodeType"]], + [:out, "distance", ["::SOAP::SOAPDouble"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "findAddressFromCoordinates"), + "", + "findAddressFromCoordinates", + [ [:in, "coordinates", ["CoordinatesType", "urn:mms_MizGIS", "CoordinatesType"]], + [:in, "vehicle", ["::SOAP::SOAPInt"]], + [:in, "languageCode", ["::SOAP::SOAPString"]], + [:retval, "found", ["::SOAP::SOAPBoolean"]], + [:out, "address", ["AddressType", "urn:mms_MizGIS", "AddressType"]], + [:out, "distance", ["::SOAP::SOAPDouble"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "getListOfPoiMacrocategories"), + "", + "getListOfPoiMacrocategories", + [ [:in, "languageCode", ["::SOAP::SOAPString"]], + [:retval, "macrocategories", ["PoiMacrocategoryType[]", "urn:mms_MizGIS", "ArrayOfPoiMacrocategoryType"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "getListOfPoiCategories"), + "", + "getListOfPoiCategories", + [ [:in, "languageCode", ["::SOAP::SOAPString"]], + [:in, "onlyPopulated", ["::SOAP::SOAPBoolean"]], + [:retval, "categories", ["PoiCategoryType[]", "urn:mms_MizGIS", "ArrayOfPoiCategoryType"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "findPois"), + "", + "findPois", + [ [:in, "area", ["AreaType", "urn:mms_MizGIS", "AreaType"]], + [:in, "box", ["BoxType", "urn:mms_MizGIS", "BoxType"]], + [:in, "maxResults", ["::SOAP::SOAPInt"]], + [:in, "macroCategoryIds", ["C_String[]", "urn:mms_MizGIS", "ArrayOfstring"]], + [:in, "categoryIds", ["C_String[]", "urn:mms_MizGIS", "ArrayOfstring"]], + [:in, "provideInfo", ["::SOAP::SOAPBoolean"]], + [:retval, "pois", ["PoiType[]", "urn:mms_MizGIS", "ArrayOfPoiType"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "getPoiInfo"), + "", + "getPoiInfo", + [ [:in, "poiIds", ["Int[]", "urn:mms_MizGIS", "ArrayOfint"]], + [:in, "provideInfo", ["::SOAP::SOAPBoolean"]], + [:retval, "pois", ["PoiType[]", "urn:mms_MizGIS", "ArrayOfPoiType"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "getListOfRoads"), + "", + "getListOfRoads", + [ [:in, "roadQueries", ["TmcRoadQueryType[]", "urn:mms_MizGIS", "ArrayOfTmcRoadQueryType"]], + [:in, "roadOptions", ["TmcRoadOptionsType", "urn:mms_MizGIS", "TmcRoadOptionsType"]], + [:retval, "roads", ["TmcRoadType[]", "urn:mms_MizGIS", "ArrayOfTmcRoadType"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "getTrafficInfo"), + "", + "getTrafficInfo", + [ [:in, "trafficQuery", ["TmcTrafficQueryType", "urn:mms_MizGIS", "TmcTrafficQueryType"]], + [:in, "trafficOptions", ["TmcTrafficOptionsType", "urn:mms_MizGIS", "TmcTrafficOptionsType"]], + [:retval, "info", ["TrafficInfoType[]", "urn:mms_MizGIS", "ArrayOfTrafficInfoType"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "getTrafficStatus"), + "", + "getTrafficStatus", + [ [:in, "areas", ["AreaType[]", "urn:mms_MizGIS", "ArrayOfAreaType"]], + [:retval, "status", ["Int[]", "urn:mms_MizGIS", "ArrayOfint"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "findRoute"), + "", + "findRoute", + [ [:in, "places", ["GeocodeType[]", "urn:mms_MizGIS", "ArrayOfGeocodeType"]], + [:in, "params", ["RouteParametersType", "urn:mms_MizGIS", "RouteParametersType"]], + [:retval, "route", ["RouteType", "urn:mms_MizGIS", "RouteType"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "getMap"), + "", + "getMap", + [ [:in, "imageSize", ["ImageSizeType", "urn:mms_MizGIS", "ImageSizeType"]], + [:in, "box", ["BoxType", "urn:mms_MizGIS", "BoxType"]], + [:in, "options", ["MapOptionsType", "urn:mms_MizGIS", "MapOptionsType"]], + [:retval, "map", ["MapType", "urn:mms_MizGIS", "MapType"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("urn:mms_MizGIS", "getMapAround"), + "", + "getMapAround", + [ [:in, "imageSize", ["ImageSizeType", "urn:mms_MizGIS", "ImageSizeType"]], + [:in, "center", ["CoordinatesType", "urn:mms_MizGIS", "CoordinatesType"]], + [:in, "radius", ["::SOAP::SOAPDouble"]], + [:in, "options", ["MapOptionsType", "urn:mms_MizGIS", "MapOptionsType"]], + [:retval, "map", ["MapType", "urn:mms_MizGIS", "MapType"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = Mms_MizGISMappingRegistry::EncodedRegistry + self.literal_mapping_registry = Mms_MizGISMappingRegistry::LiteralRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end + diff --git a/sample/soapheader/soapext_basicauth/mms_MizGISMappingRegistry.rb b/sample/soapheader/soapext_basicauth/mms_MizGISMappingRegistry.rb new file mode 100644 index 0000000..fb92b5e --- /dev/null +++ b/sample/soapheader/soapext_basicauth/mms_MizGISMappingRegistry.rb @@ -0,0 +1,1232 @@ +require 'mms_MizGIS.rb' +require 'soap/mapping' + +module Mms_MizGISMappingRegistry + EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new + LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new + + EncodedRegistry.set( + ArrayOfint, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "int") } + ) + + EncodedRegistry.set( + ArrayOfstring, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") } + ) + + EncodedRegistry.register( + :class => AccessCredentialsType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "AccessCredentialsType", + :schema_element => [ + ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "Name")]], + ["password", ["SOAP::SOAPString", XSD::QName.new(nil, "Password")]] + ] + ) + + EncodedRegistry.register( + :class => AddressSearchType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "AddressSearchType", + :schema_element => [ + ["languageCode", ["SOAP::SOAPString", XSD::QName.new(nil, "languageCode")]], + ["countryCode", ["SOAP::SOAPString", XSD::QName.new(nil, "countryCode")]], + ["place", ["SOAP::SOAPString", XSD::QName.new(nil, "place")]], + ["street", ["SOAP::SOAPString", XSD::QName.new(nil, "street")]], + ["houseNumber", ["SOAP::SOAPString", XSD::QName.new(nil, "houseNumber")]] + ] + ) + + EncodedRegistry.register( + :class => CoordinatesType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "CoordinatesType", + :schema_element => [ + ["longitude", ["SOAP::SOAPDouble", XSD::QName.new(nil, "longitude")]], + ["latitude", ["SOAP::SOAPDouble", XSD::QName.new(nil, "latitude")]] + ] + ) + + EncodedRegistry.register( + :class => BoxType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "BoxType", + :schema_element => [ + ["bottomLeft", ["CoordinatesType", XSD::QName.new(nil, "bottomLeft")]], + ["topRight", ["CoordinatesType", XSD::QName.new(nil, "topRight")]] + ] + ) + + EncodedRegistry.register( + :class => AreaType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "AreaType", + :schema_element => [ + ["center", ["CoordinatesType", XSD::QName.new(nil, "center")]], + ["radius", ["SOAP::SOAPDouble", XSD::QName.new(nil, "radius")]] + ] + ) + + EncodedRegistry.set( + ArrayOfAreaType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "AreaType") } + ) + + EncodedRegistry.register( + :class => GeocodeType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "GeocodeType", + :schema_element => [ + ["areaId", ["SOAP::SOAPInt", XSD::QName.new(nil, "areaId")]], + ["streetNameId", ["SOAP::SOAPInt", XSD::QName.new(nil, "streetNameId")]], + ["lineId", ["SOAP::SOAPInt", XSD::QName.new(nil, "lineId")]], + ["position", ["SOAP::SOAPDouble", XSD::QName.new(nil, "position")]], + ["direction", ["SOAP::SOAPInt", XSD::QName.new(nil, "direction")]], + ["highway", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "highway")]] + ] + ) + + EncodedRegistry.set( + ArrayOfGeocodeType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "GeocodeType") } + ) + + EncodedRegistry.register( + :class => AddressType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "AddressType", + :schema_element => [ + ["countryCode", ["SOAP::SOAPString", XSD::QName.new(nil, "countryCode")]], + ["languageCode", ["SOAP::SOAPString", XSD::QName.new(nil, "languageCode")]], + ["countryName", ["SOAP::SOAPString", XSD::QName.new(nil, "countryName")]], + ["region", ["SOAP::SOAPString", XSD::QName.new(nil, "region")]], + ["municipality", ["SOAP::SOAPString", XSD::QName.new(nil, "municipality")]], + ["languageCodeDistrict", ["SOAP::SOAPString", XSD::QName.new(nil, "languageCodeDistrict")]], + ["district", ["SOAP::SOAPString", XSD::QName.new(nil, "district")]], + ["languageCodeStreetName", ["SOAP::SOAPString", XSD::QName.new(nil, "languageCodeStreetName")]], + ["streetName", ["SOAP::SOAPString", XSD::QName.new(nil, "streetName")]], + ["houseNumber", ["SOAP::SOAPString", XSD::QName.new(nil, "houseNumber")]], + ["postCode", ["SOAP::SOAPString", XSD::QName.new(nil, "postCode")]], + ["coordinates", ["CoordinatesType", XSD::QName.new(nil, "coordinates")]], + ["geocode", ["GeocodeType", XSD::QName.new(nil, "geocode")]] + ] + ) + + EncodedRegistry.set( + ArrayOfAddressType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "AddressType") } + ) + + EncodedRegistry.register( + :class => PoiMacrocategoryType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "PoiMacrocategoryType", + :schema_element => [ + ["macrocategoryId", ["SOAP::SOAPString", XSD::QName.new(nil, "macrocategoryId")]], + ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]] + ] + ) + + EncodedRegistry.set( + ArrayOfPoiMacrocategoryType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "PoiMacrocategoryType") } + ) + + EncodedRegistry.register( + :class => PoiCategoryType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "PoiCategoryType", + :schema_element => [ + ["categoryId", ["SOAP::SOAPString", XSD::QName.new(nil, "categoryId")]], + ["macrocategoryId", ["SOAP::SOAPString", XSD::QName.new(nil, "macrocategoryId")]], + ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]], + ["populated", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "populated")]] + ] + ) + + EncodedRegistry.set( + ArrayOfPoiCategoryType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "PoiCategoryType") } + ) + + EncodedRegistry.register( + :class => PoiInfoType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "PoiInfoType", + :schema_element => [ + ["type", ["SOAP::SOAPInt", XSD::QName.new(nil, "type")]], + ["value", ["SOAP::SOAPString", XSD::QName.new(nil, "value")]] + ] + ) + + EncodedRegistry.set( + ArrayOfPoiInfoType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "PoiInfoType") } + ) + + EncodedRegistry.register( + :class => PoiType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "PoiType", + :schema_element => [ + ["poiId", ["SOAP::SOAPInt", XSD::QName.new(nil, "poiId")]], + ["categories", ["ArrayOfstring", XSD::QName.new(nil, "categories")]], + ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]], + ["coordinates", ["CoordinatesType", XSD::QName.new(nil, "coordinates")]], + ["geocode", ["GeocodeType", XSD::QName.new(nil, "geocode")]], + ["address", ["SOAP::SOAPString", XSD::QName.new(nil, "address")]], + ["postCode", ["SOAP::SOAPString", XSD::QName.new(nil, "postCode")]], + ["place", ["SOAP::SOAPString", XSD::QName.new(nil, "place")]], + ["country", ["SOAP::SOAPString", XSD::QName.new(nil, "country")]], + ["info", ["ArrayOfPoiInfoType", XSD::QName.new(nil, "info")]], + ["distance", ["SOAP::SOAPDouble", XSD::QName.new(nil, "distance")]] + ] + ) + + EncodedRegistry.set( + ArrayOfPoiType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "PoiType") } + ) + + EncodedRegistry.register( + :class => TmcIdType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcIdType", + :schema_element => [ + ["cid", ["SOAP::SOAPInt", XSD::QName.new(nil, "cid")]], + ["tabCd", ["SOAP::SOAPInt", XSD::QName.new(nil, "tabCd")]], + ["lcd", ["SOAP::SOAPInt", XSD::QName.new(nil, "lcd")]] + ] + ) + + EncodedRegistry.set( + ArrayOfTmcIdType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "TmcIdType") } + ) + + EncodedRegistry.register( + :class => TmcRoadQueryType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcRoadQueryType", + :schema_element => [ + ["cid", ["SOAP::SOAPInt", XSD::QName.new(nil, "cid")]], + ["tabCd", ["SOAP::SOAPInt", XSD::QName.new(nil, "tabCd")]], + ["roadLcds", ["ArrayOfint", XSD::QName.new(nil, "roadLcds")]], + ["roadCodes", ["ArrayOfstring", XSD::QName.new(nil, "roadCodes")]], + ["roadTypes", ["ArrayOfint", XSD::QName.new(nil, "roadTypes")]], + ["roadName", ["SOAP::SOAPString", XSD::QName.new(nil, "roadName")]], + ["status", ["SOAP::SOAPInt", XSD::QName.new(nil, "status")]] + ] + ) + + EncodedRegistry.set( + ArrayOfTmcRoadQueryType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "TmcRoadQueryType") } + ) + + EncodedRegistry.register( + :class => TmcRoadOptionsType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcRoadOptionsType", + :schema_element => [ + ["provideBox", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "provideBox")]], + ["nameDirections", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "nameDirections")]], + ["listPoints", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "listPoints")]], + ["minPointImportance", ["SOAP::SOAPInt", XSD::QName.new(nil, "minPointImportance")]] + ] + ) + + EncodedRegistry.register( + :class => TmcPointType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcPointType", + :schema_element => [ + ["pointId", ["TmcIdType", XSD::QName.new(nil, "pointId")]], + ["roadLcd", ["SOAP::SOAPInt", XSD::QName.new(nil, "roadLcd")]], + ["segmentLcd", ["SOAP::SOAPInt", XSD::QName.new(nil, "segmentLcd")]], + ["areaLcd", ["SOAP::SOAPInt", XSD::QName.new(nil, "areaLcd")]], + ["coordinates", ["CoordinatesType", XSD::QName.new(nil, "coordinates")]], + ["pointName", ["SOAP::SOAPString", XSD::QName.new(nil, "pointName")]], + ["importance", ["SOAP::SOAPInt", XSD::QName.new(nil, "importance")]] + ] + ) + + EncodedRegistry.set( + ArrayOfTmcPointType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "TmcPointType") } + ) + + EncodedRegistry.register( + :class => TmcRoadType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcRoadType", + :schema_element => [ + ["roadId", ["TmcIdType", XSD::QName.new(nil, "roadId")]], + ["roadType", ["SOAP::SOAPInt", XSD::QName.new(nil, "roadType")]], + ["roadCode", ["SOAP::SOAPString", XSD::QName.new(nil, "roadCode")]], + ["roadName", ["SOAP::SOAPString", XSD::QName.new(nil, "roadName")]], + ["box", ["BoxType", XSD::QName.new(nil, "box")]], + ["status", ["SOAP::SOAPInt", XSD::QName.new(nil, "status")]], + ["positiveDirName", ["SOAP::SOAPString", XSD::QName.new(nil, "positiveDirName")]], + ["negativeDirName", ["SOAP::SOAPString", XSD::QName.new(nil, "negativeDirName")]], + ["points", ["ArrayOfTmcPointType", XSD::QName.new(nil, "points")]] + ] + ) + + EncodedRegistry.set( + ArrayOfTmcRoadType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "TmcRoadType") } + ) + + EncodedRegistry.register( + :class => TmcTrafficQueryType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcTrafficQueryType", + :schema_element => [ + ["area", ["AreaType", XSD::QName.new(nil, "area")]], + ["box", ["BoxType", XSD::QName.new(nil, "box")]], + ["roadIds", ["ArrayOfTmcIdType", XSD::QName.new(nil, "roadIds")]], + ["fromPoint", ["TmcIdType", XSD::QName.new(nil, "fromPoint")]], + ["toPoint", ["TmcIdType", XSD::QName.new(nil, "toPoint")]], + ["traffIds", ["ArrayOfstring", XSD::QName.new(nil, "traffIds")]] + ] + ) + + EncodedRegistry.set( + ArrayOfTmcTrafficQueryType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "TmcTrafficQueryType") } + ) + + EncodedRegistry.register( + :class => TmcTrafficOptionsType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcTrafficOptionsType", + :schema_element => [ + ["languageCode", ["SOAP::SOAPString", XSD::QName.new(nil, "languageCode")]], + ["maxResults", ["SOAP::SOAPInt", XSD::QName.new(nil, "maxResults")]], + ["orderBySeverity", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "orderBySeverity")]] + ] + ) + + EncodedRegistry.register( + :class => TrafficInfoType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TrafficInfoType", + :schema_element => [ + ["id", ["SOAP::SOAPString", XSD::QName.new(nil, "id")]], + ["cat", ["SOAP::SOAPInt", XSD::QName.new(nil, "cat")]], + ["dob", ["SOAP::SOAPString", XSD::QName.new(nil, "dob")]], + ["dob2", ["SOAP::SOAPString", XSD::QName.new(nil, "dob2")]], + ["dateTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "dateTime")]], + ["coordinates", ["CoordinatesType", XSD::QName.new(nil, "coordinates")]], + ["distance", ["SOAP::SOAPDouble", XSD::QName.new(nil, "distance")]], + ["road", ["TmcRoadType", XSD::QName.new(nil, "road")]], + ["roadName", ["SOAP::SOAPString", XSD::QName.new(nil, "roadName")]], + ["directionName", ["SOAP::SOAPString", XSD::QName.new(nil, "directionName")]], + ["segmentName", ["SOAP::SOAPString", XSD::QName.new(nil, "segmentName")]], + ["areaName", ["SOAP::SOAPString", XSD::QName.new(nil, "areaName")]], + ["place", ["SOAP::SOAPString", XSD::QName.new(nil, "place")]], + ["extraPlace", ["SOAP::SOAPString", XSD::QName.new(nil, "extraPlace")]], + ["text", ["SOAP::SOAPString", XSD::QName.new(nil, "text")]], + ["extraText", ["SOAP::SOAPString", XSD::QName.new(nil, "extraText")]], + ["source", ["SOAP::SOAPString", XSD::QName.new(nil, "source")]] + ] + ) + + EncodedRegistry.set( + ArrayOfTrafficInfoType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "TrafficInfoType") } + ) + + EncodedRegistry.register( + :class => RouteParametersType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "RouteParametersType", + :schema_element => [ + ["startingTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "startingTime")]], + ["arrivalTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "arrivalTime")]], + ["mode", ["SOAP::SOAPInt", XSD::QName.new(nil, "mode")]], + ["optimization", ["SOAP::SOAPInt", XSD::QName.new(nil, "optimization")]], + ["realTime", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "realTime")]], + ["descriptionLevel", ["SOAP::SOAPInt", XSD::QName.new(nil, "descriptionLevel")]], + ["descriptionLanguageCode", ["SOAP::SOAPString", XSD::QName.new(nil, "descriptionLanguageCode")]], + ["providePath", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "providePath")]], + ["providePathPoints", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "providePathPoints")]] + ] + ) + + EncodedRegistry.register( + :class => RouteStepType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "RouteStepType", + :schema_element => [ + ["time", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "time")]], + ["duration", ["SOAP::SOAPInt", XSD::QName.new(nil, "duration")]], + ["distance", ["SOAP::SOAPDouble", XSD::QName.new(nil, "distance")]], + ["action", ["SOAP::SOAPInt", XSD::QName.new(nil, "action")]], + ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]] + ] + ) + + EncodedRegistry.set( + ArrayOfRouteStepType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "RouteStepType") } + ) + + EncodedRegistry.register( + :class => RouteSegmentType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "RouteSegmentType", + :schema_element => [ + ["origin", ["GeocodeType", XSD::QName.new(nil, "origin")]], + ["destination", ["GeocodeType", XSD::QName.new(nil, "destination")]], + ["startingTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "startingTime")]], + ["duration", ["SOAP::SOAPInt", XSD::QName.new(nil, "duration")]], + ["distance", ["SOAP::SOAPDouble", XSD::QName.new(nil, "distance")]], + ["vehicle", ["SOAP::SOAPInt", XSD::QName.new(nil, "vehicle")]], + ["steps", ["ArrayOfRouteStepType", XSD::QName.new(nil, "steps")]], + ["path", ["SOAP::SOAPString", XSD::QName.new(nil, "path")]] + ] + ) + + EncodedRegistry.set( + ArrayOfRouteSegmentType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "RouteSegmentType") } + ) + + EncodedRegistry.register( + :class => RoutePartType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "RoutePartType", + :schema_element => [ + ["origin", ["GeocodeType", XSD::QName.new(nil, "origin")]], + ["destination", ["GeocodeType", XSD::QName.new(nil, "destination")]], + ["startingTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "startingTime")]], + ["duration", ["SOAP::SOAPInt", XSD::QName.new(nil, "duration")]], + ["distance", ["SOAP::SOAPDouble", XSD::QName.new(nil, "distance")]], + ["segments", ["ArrayOfRouteSegmentType", XSD::QName.new(nil, "segments")]] + ] + ) + + EncodedRegistry.set( + ArrayOfRoutePartType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "RoutePartType") } + ) + + EncodedRegistry.register( + :class => RouteType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "RouteType", + :schema_element => [ + ["routeId", ["SOAP::SOAPString", XSD::QName.new(nil, "routeId")]], + ["origin", ["GeocodeType", XSD::QName.new(nil, "origin")]], + ["destination", ["GeocodeType", XSD::QName.new(nil, "destination")]], + ["startingTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "startingTime")]], + ["duration", ["SOAP::SOAPInt", XSD::QName.new(nil, "duration")]], + ["distance", ["SOAP::SOAPDouble", XSD::QName.new(nil, "distance")]], + ["parts", ["ArrayOfRoutePartType", XSD::QName.new(nil, "parts")]] + ] + ) + + EncodedRegistry.set( + ArrayOfRouteType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "RouteType") } + ) + + EncodedRegistry.register( + :class => ImagePointType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ImagePointType", + :schema_element => [ + ["x", ["SOAP::SOAPInt", XSD::QName.new(nil, "x")]], + ["y", ["SOAP::SOAPInt", XSD::QName.new(nil, "y")]] + ] + ) + + EncodedRegistry.register( + :class => ImageSizeType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ImageSizeType", + :schema_element => [ + ["width", ["SOAP::SOAPInt", XSD::QName.new(nil, "width")]], + ["height", ["SOAP::SOAPInt", XSD::QName.new(nil, "height")]] + ] + ) + + EncodedRegistry.register( + :class => MapIconType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "MapIconType", + :schema_element => [ + ["iconId", ["SOAP::SOAPString", XSD::QName.new(nil, "iconId")]], + ["iconType", ["SOAP::SOAPString", XSD::QName.new(nil, "iconType")]], + ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]], + ["dimmed", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "dimmed")]], + ["minimize", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "minimize")]], + ["coordinates", ["CoordinatesType", XSD::QName.new(nil, "coordinates")]], + ["point", ["ImagePointType", XSD::QName.new(nil, "point")]] + ] + ) + + EncodedRegistry.set( + ArrayOfMapIconType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("urn:mms_MizGIS", "MapIconType") } + ) + + EncodedRegistry.register( + :class => MapOptionsType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "MapOptionsType", + :schema_element => [ + ["format", ["SOAP::SOAPString", XSD::QName.new(nil, "format")]], + ["showTrafficEvents", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "showTrafficEvents")]], + ["trafficIconPrefix", ["SOAP::SOAPString", XSD::QName.new(nil, "trafficIconPrefix")]], + ["trafficIconsDimmed", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "trafficIconsDimmed")]], + ["roadId", ["TmcIdType", XSD::QName.new(nil, "roadId")]], + ["routeId", ["SOAP::SOAPString", XSD::QName.new(nil, "routeId")]], + ["poiIds", ["ArrayOfint", XSD::QName.new(nil, "poiIds")]], + ["trafficInfoIds", ["ArrayOfstring", XSD::QName.new(nil, "trafficInfoIds")]], + ["icons", ["ArrayOfMapIconType", XSD::QName.new(nil, "icons")]], + ["routeIds", ["ArrayOfstring", XSD::QName.new(nil, "routeIds")]], + ["showBasicPois", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "showBasicPois")]] + ] + ) + + EncodedRegistry.register( + :class => MapType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "MapType", + :schema_element => [ + ["imageSize", ["ImageSizeType", XSD::QName.new(nil, "imageSize")]], + ["box", ["BoxType", XSD::QName.new(nil, "box")]], + ["width", ["SOAP::SOAPDouble", XSD::QName.new(nil, "width")]], + ["height", ["SOAP::SOAPDouble", XSD::QName.new(nil, "height")]], + ["imageUrl", ["SOAP::SOAPString", XSD::QName.new(nil, "imageUrl")]], + ["icons", ["ArrayOfMapIconType", XSD::QName.new(nil, "icons")]] + ] + ) + + EncodedRegistry.register( + :class => ModeType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ModeType" + ) + + EncodedRegistry.register( + :class => VehicleType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "VehicleType" + ) + + EncodedRegistry.register( + :class => OptimizationType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "OptimizationType" + ) + + EncodedRegistry.register( + :class => DescriptionLevelType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "DescriptionLevelType" + ) + + EncodedRegistry.register( + :class => StepActionType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "StepActionType" + ) + + EncodedRegistry.register( + :class => TmcRoadTypeType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcRoadTypeType" + ) + + LiteralRegistry.register( + :class => ArrayOfint, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfint", + :schema_element => [ + ["item", ["SOAP::SOAPInt[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfstring, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfstring", + :schema_element => [ + ["item", ["SOAP::SOAPString[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => AccessCredentialsType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "AccessCredentialsType", + :schema_qualified => false, + :schema_element => [ + ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "Name")]], + ["password", ["SOAP::SOAPString", XSD::QName.new(nil, "Password")]] + ] + ) + + LiteralRegistry.register( + :class => AddressSearchType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "AddressSearchType", + :schema_qualified => false, + :schema_element => [ + ["languageCode", ["SOAP::SOAPString", XSD::QName.new(nil, "languageCode")]], + ["countryCode", ["SOAP::SOAPString", XSD::QName.new(nil, "countryCode")]], + ["place", ["SOAP::SOAPString", XSD::QName.new(nil, "place")]], + ["street", ["SOAP::SOAPString", XSD::QName.new(nil, "street")]], + ["houseNumber", ["SOAP::SOAPString", XSD::QName.new(nil, "houseNumber")]] + ] + ) + + LiteralRegistry.register( + :class => CoordinatesType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "CoordinatesType", + :schema_qualified => false, + :schema_element => [ + ["longitude", ["SOAP::SOAPDouble", XSD::QName.new(nil, "longitude")]], + ["latitude", ["SOAP::SOAPDouble", XSD::QName.new(nil, "latitude")]] + ] + ) + + LiteralRegistry.register( + :class => BoxType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "BoxType", + :schema_qualified => false, + :schema_element => [ + ["bottomLeft", ["CoordinatesType", XSD::QName.new(nil, "bottomLeft")]], + ["topRight", ["CoordinatesType", XSD::QName.new(nil, "topRight")]] + ] + ) + + LiteralRegistry.register( + :class => AreaType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "AreaType", + :schema_qualified => false, + :schema_element => [ + ["center", ["CoordinatesType", XSD::QName.new(nil, "center")]], + ["radius", ["SOAP::SOAPDouble", XSD::QName.new(nil, "radius")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfAreaType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfAreaType", + :schema_element => [ + ["item", ["AreaType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => GeocodeType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "GeocodeType", + :schema_qualified => false, + :schema_element => [ + ["areaId", ["SOAP::SOAPInt", XSD::QName.new(nil, "areaId")]], + ["streetNameId", ["SOAP::SOAPInt", XSD::QName.new(nil, "streetNameId")]], + ["lineId", ["SOAP::SOAPInt", XSD::QName.new(nil, "lineId")]], + ["position", ["SOAP::SOAPDouble", XSD::QName.new(nil, "position")]], + ["direction", ["SOAP::SOAPInt", XSD::QName.new(nil, "direction")]], + ["highway", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "highway")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfGeocodeType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfGeocodeType", + :schema_element => [ + ["item", ["GeocodeType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => AddressType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "AddressType", + :schema_qualified => false, + :schema_element => [ + ["countryCode", ["SOAP::SOAPString", XSD::QName.new(nil, "countryCode")]], + ["languageCode", ["SOAP::SOAPString", XSD::QName.new(nil, "languageCode")]], + ["countryName", ["SOAP::SOAPString", XSD::QName.new(nil, "countryName")]], + ["region", ["SOAP::SOAPString", XSD::QName.new(nil, "region")]], + ["municipality", ["SOAP::SOAPString", XSD::QName.new(nil, "municipality")]], + ["languageCodeDistrict", ["SOAP::SOAPString", XSD::QName.new(nil, "languageCodeDistrict")]], + ["district", ["SOAP::SOAPString", XSD::QName.new(nil, "district")]], + ["languageCodeStreetName", ["SOAP::SOAPString", XSD::QName.new(nil, "languageCodeStreetName")]], + ["streetName", ["SOAP::SOAPString", XSD::QName.new(nil, "streetName")]], + ["houseNumber", ["SOAP::SOAPString", XSD::QName.new(nil, "houseNumber")]], + ["postCode", ["SOAP::SOAPString", XSD::QName.new(nil, "postCode")]], + ["coordinates", ["CoordinatesType", XSD::QName.new(nil, "coordinates")]], + ["geocode", ["GeocodeType", XSD::QName.new(nil, "geocode")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfAddressType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfAddressType", + :schema_element => [ + ["item", ["AddressType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => PoiMacrocategoryType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "PoiMacrocategoryType", + :schema_qualified => false, + :schema_element => [ + ["macrocategoryId", ["SOAP::SOAPString", XSD::QName.new(nil, "macrocategoryId")]], + ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfPoiMacrocategoryType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfPoiMacrocategoryType", + :schema_element => [ + ["item", ["PoiMacrocategoryType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => PoiCategoryType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "PoiCategoryType", + :schema_qualified => false, + :schema_element => [ + ["categoryId", ["SOAP::SOAPString", XSD::QName.new(nil, "categoryId")]], + ["macrocategoryId", ["SOAP::SOAPString", XSD::QName.new(nil, "macrocategoryId")]], + ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]], + ["populated", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "populated")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfPoiCategoryType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfPoiCategoryType", + :schema_element => [ + ["item", ["PoiCategoryType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => PoiInfoType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "PoiInfoType", + :schema_qualified => false, + :schema_element => [ + ["type", ["SOAP::SOAPInt", XSD::QName.new(nil, "type")]], + ["value", ["SOAP::SOAPString", XSD::QName.new(nil, "value")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfPoiInfoType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfPoiInfoType", + :schema_element => [ + ["item", ["PoiInfoType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => PoiType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "PoiType", + :schema_qualified => false, + :schema_element => [ + ["poiId", ["SOAP::SOAPInt", XSD::QName.new(nil, "poiId")]], + ["categories", ["ArrayOfstring", XSD::QName.new(nil, "categories")]], + ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]], + ["coordinates", ["CoordinatesType", XSD::QName.new(nil, "coordinates")]], + ["geocode", ["GeocodeType", XSD::QName.new(nil, "geocode")]], + ["address", ["SOAP::SOAPString", XSD::QName.new(nil, "address")]], + ["postCode", ["SOAP::SOAPString", XSD::QName.new(nil, "postCode")]], + ["place", ["SOAP::SOAPString", XSD::QName.new(nil, "place")]], + ["country", ["SOAP::SOAPString", XSD::QName.new(nil, "country")]], + ["info", ["ArrayOfPoiInfoType", XSD::QName.new(nil, "info")]], + ["distance", ["SOAP::SOAPDouble", XSD::QName.new(nil, "distance")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfPoiType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfPoiType", + :schema_element => [ + ["item", ["PoiType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => TmcIdType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcIdType", + :schema_qualified => false, + :schema_element => [ + ["cid", ["SOAP::SOAPInt", XSD::QName.new(nil, "cid")]], + ["tabCd", ["SOAP::SOAPInt", XSD::QName.new(nil, "tabCd")]], + ["lcd", ["SOAP::SOAPInt", XSD::QName.new(nil, "lcd")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfTmcIdType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfTmcIdType", + :schema_element => [ + ["item", ["TmcIdType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => TmcRoadQueryType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcRoadQueryType", + :schema_qualified => false, + :schema_element => [ + ["cid", ["SOAP::SOAPInt", XSD::QName.new(nil, "cid")]], + ["tabCd", ["SOAP::SOAPInt", XSD::QName.new(nil, "tabCd")]], + ["roadLcds", ["ArrayOfint", XSD::QName.new(nil, "roadLcds")]], + ["roadCodes", ["ArrayOfstring", XSD::QName.new(nil, "roadCodes")]], + ["roadTypes", ["ArrayOfint", XSD::QName.new(nil, "roadTypes")]], + ["roadName", ["SOAP::SOAPString", XSD::QName.new(nil, "roadName")]], + ["status", ["SOAP::SOAPInt", XSD::QName.new(nil, "status")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfTmcRoadQueryType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfTmcRoadQueryType", + :schema_element => [ + ["item", ["TmcRoadQueryType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => TmcRoadOptionsType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcRoadOptionsType", + :schema_qualified => false, + :schema_element => [ + ["provideBox", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "provideBox")]], + ["nameDirections", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "nameDirections")]], + ["listPoints", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "listPoints")]], + ["minPointImportance", ["SOAP::SOAPInt", XSD::QName.new(nil, "minPointImportance")]] + ] + ) + + LiteralRegistry.register( + :class => TmcPointType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcPointType", + :schema_qualified => false, + :schema_element => [ + ["pointId", ["TmcIdType", XSD::QName.new(nil, "pointId")]], + ["roadLcd", ["SOAP::SOAPInt", XSD::QName.new(nil, "roadLcd")]], + ["segmentLcd", ["SOAP::SOAPInt", XSD::QName.new(nil, "segmentLcd")]], + ["areaLcd", ["SOAP::SOAPInt", XSD::QName.new(nil, "areaLcd")]], + ["coordinates", ["CoordinatesType", XSD::QName.new(nil, "coordinates")]], + ["pointName", ["SOAP::SOAPString", XSD::QName.new(nil, "pointName")]], + ["importance", ["SOAP::SOAPInt", XSD::QName.new(nil, "importance")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfTmcPointType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfTmcPointType", + :schema_element => [ + ["item", ["TmcPointType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => TmcRoadType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcRoadType", + :schema_qualified => false, + :schema_element => [ + ["roadId", ["TmcIdType", XSD::QName.new(nil, "roadId")]], + ["roadType", ["SOAP::SOAPInt", XSD::QName.new(nil, "roadType")]], + ["roadCode", ["SOAP::SOAPString", XSD::QName.new(nil, "roadCode")]], + ["roadName", ["SOAP::SOAPString", XSD::QName.new(nil, "roadName")]], + ["box", ["BoxType", XSD::QName.new(nil, "box")]], + ["status", ["SOAP::SOAPInt", XSD::QName.new(nil, "status")]], + ["positiveDirName", ["SOAP::SOAPString", XSD::QName.new(nil, "positiveDirName")]], + ["negativeDirName", ["SOAP::SOAPString", XSD::QName.new(nil, "negativeDirName")]], + ["points", ["ArrayOfTmcPointType", XSD::QName.new(nil, "points")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfTmcRoadType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfTmcRoadType", + :schema_element => [ + ["item", ["TmcRoadType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => TmcTrafficQueryType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcTrafficQueryType", + :schema_qualified => false, + :schema_element => [ + ["area", ["AreaType", XSD::QName.new(nil, "area")]], + ["box", ["BoxType", XSD::QName.new(nil, "box")]], + ["roadIds", ["ArrayOfTmcIdType", XSD::QName.new(nil, "roadIds")]], + ["fromPoint", ["TmcIdType", XSD::QName.new(nil, "fromPoint")]], + ["toPoint", ["TmcIdType", XSD::QName.new(nil, "toPoint")]], + ["traffIds", ["ArrayOfstring", XSD::QName.new(nil, "traffIds")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfTmcTrafficQueryType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfTmcTrafficQueryType", + :schema_element => [ + ["item", ["TmcTrafficQueryType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => TmcTrafficOptionsType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcTrafficOptionsType", + :schema_qualified => false, + :schema_element => [ + ["languageCode", ["SOAP::SOAPString", XSD::QName.new(nil, "languageCode")]], + ["maxResults", ["SOAP::SOAPInt", XSD::QName.new(nil, "maxResults")]], + ["orderBySeverity", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "orderBySeverity")]] + ] + ) + + LiteralRegistry.register( + :class => TrafficInfoType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TrafficInfoType", + :schema_qualified => false, + :schema_element => [ + ["id", ["SOAP::SOAPString", XSD::QName.new(nil, "id")]], + ["cat", ["SOAP::SOAPInt", XSD::QName.new(nil, "cat")]], + ["dob", ["SOAP::SOAPString", XSD::QName.new(nil, "dob")]], + ["dob2", ["SOAP::SOAPString", XSD::QName.new(nil, "dob2")]], + ["dateTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "dateTime")]], + ["coordinates", ["CoordinatesType", XSD::QName.new(nil, "coordinates")]], + ["distance", ["SOAP::SOAPDouble", XSD::QName.new(nil, "distance")]], + ["road", ["TmcRoadType", XSD::QName.new(nil, "road")]], + ["roadName", ["SOAP::SOAPString", XSD::QName.new(nil, "roadName")]], + ["directionName", ["SOAP::SOAPString", XSD::QName.new(nil, "directionName")]], + ["segmentName", ["SOAP::SOAPString", XSD::QName.new(nil, "segmentName")]], + ["areaName", ["SOAP::SOAPString", XSD::QName.new(nil, "areaName")]], + ["place", ["SOAP::SOAPString", XSD::QName.new(nil, "place")]], + ["extraPlace", ["SOAP::SOAPString", XSD::QName.new(nil, "extraPlace")]], + ["text", ["SOAP::SOAPString", XSD::QName.new(nil, "text")]], + ["extraText", ["SOAP::SOAPString", XSD::QName.new(nil, "extraText")]], + ["source", ["SOAP::SOAPString", XSD::QName.new(nil, "source")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfTrafficInfoType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfTrafficInfoType", + :schema_element => [ + ["item", ["TrafficInfoType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => RouteParametersType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "RouteParametersType", + :schema_qualified => false, + :schema_element => [ + ["startingTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "startingTime")]], + ["arrivalTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "arrivalTime")]], + ["mode", ["SOAP::SOAPInt", XSD::QName.new(nil, "mode")]], + ["optimization", ["SOAP::SOAPInt", XSD::QName.new(nil, "optimization")]], + ["realTime", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "realTime")]], + ["descriptionLevel", ["SOAP::SOAPInt", XSD::QName.new(nil, "descriptionLevel")]], + ["descriptionLanguageCode", ["SOAP::SOAPString", XSD::QName.new(nil, "descriptionLanguageCode")]], + ["providePath", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "providePath")]], + ["providePathPoints", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "providePathPoints")]] + ] + ) + + LiteralRegistry.register( + :class => RouteStepType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "RouteStepType", + :schema_qualified => false, + :schema_element => [ + ["time", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "time")]], + ["duration", ["SOAP::SOAPInt", XSD::QName.new(nil, "duration")]], + ["distance", ["SOAP::SOAPDouble", XSD::QName.new(nil, "distance")]], + ["action", ["SOAP::SOAPInt", XSD::QName.new(nil, "action")]], + ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfRouteStepType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfRouteStepType", + :schema_element => [ + ["item", ["RouteStepType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => RouteSegmentType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "RouteSegmentType", + :schema_qualified => false, + :schema_element => [ + ["origin", ["GeocodeType", XSD::QName.new(nil, "origin")]], + ["destination", ["GeocodeType", XSD::QName.new(nil, "destination")]], + ["startingTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "startingTime")]], + ["duration", ["SOAP::SOAPInt", XSD::QName.new(nil, "duration")]], + ["distance", ["SOAP::SOAPDouble", XSD::QName.new(nil, "distance")]], + ["vehicle", ["SOAP::SOAPInt", XSD::QName.new(nil, "vehicle")]], + ["steps", ["ArrayOfRouteStepType", XSD::QName.new(nil, "steps")]], + ["path", ["SOAP::SOAPString", XSD::QName.new(nil, "path")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfRouteSegmentType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfRouteSegmentType", + :schema_element => [ + ["item", ["RouteSegmentType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => RoutePartType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "RoutePartType", + :schema_qualified => false, + :schema_element => [ + ["origin", ["GeocodeType", XSD::QName.new(nil, "origin")]], + ["destination", ["GeocodeType", XSD::QName.new(nil, "destination")]], + ["startingTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "startingTime")]], + ["duration", ["SOAP::SOAPInt", XSD::QName.new(nil, "duration")]], + ["distance", ["SOAP::SOAPDouble", XSD::QName.new(nil, "distance")]], + ["segments", ["ArrayOfRouteSegmentType", XSD::QName.new(nil, "segments")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfRoutePartType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfRoutePartType", + :schema_element => [ + ["item", ["RoutePartType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => RouteType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "RouteType", + :schema_qualified => false, + :schema_element => [ + ["routeId", ["SOAP::SOAPString", XSD::QName.new(nil, "routeId")]], + ["origin", ["GeocodeType", XSD::QName.new(nil, "origin")]], + ["destination", ["GeocodeType", XSD::QName.new(nil, "destination")]], + ["startingTime", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "startingTime")]], + ["duration", ["SOAP::SOAPInt", XSD::QName.new(nil, "duration")]], + ["distance", ["SOAP::SOAPDouble", XSD::QName.new(nil, "distance")]], + ["parts", ["ArrayOfRoutePartType", XSD::QName.new(nil, "parts")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfRouteType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfRouteType", + :schema_element => [ + ["item", ["RouteType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => ImagePointType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ImagePointType", + :schema_qualified => false, + :schema_element => [ + ["x", ["SOAP::SOAPInt", XSD::QName.new(nil, "x")]], + ["y", ["SOAP::SOAPInt", XSD::QName.new(nil, "y")]] + ] + ) + + LiteralRegistry.register( + :class => ImageSizeType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ImageSizeType", + :schema_qualified => false, + :schema_element => [ + ["width", ["SOAP::SOAPInt", XSD::QName.new(nil, "width")]], + ["height", ["SOAP::SOAPInt", XSD::QName.new(nil, "height")]] + ] + ) + + LiteralRegistry.register( + :class => MapIconType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "MapIconType", + :schema_qualified => false, + :schema_element => [ + ["iconId", ["SOAP::SOAPString", XSD::QName.new(nil, "iconId")]], + ["iconType", ["SOAP::SOAPString", XSD::QName.new(nil, "iconType")]], + ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]], + ["dimmed", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "dimmed")]], + ["minimize", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "minimize")]], + ["coordinates", ["CoordinatesType", XSD::QName.new(nil, "coordinates")]], + ["point", ["ImagePointType", XSD::QName.new(nil, "point")]] + ] + ) + + LiteralRegistry.register( + :class => ArrayOfMapIconType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ArrayOfMapIconType", + :schema_element => [ + ["item", ["MapIconType[]", XSD::QName.new(nil, "item")]] + ] + ) + + LiteralRegistry.register( + :class => MapOptionsType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "MapOptionsType", + :schema_qualified => false, + :schema_element => [ + ["format", ["SOAP::SOAPString", XSD::QName.new(nil, "format")]], + ["showTrafficEvents", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "showTrafficEvents")]], + ["trafficIconPrefix", ["SOAP::SOAPString", XSD::QName.new(nil, "trafficIconPrefix")]], + ["trafficIconsDimmed", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "trafficIconsDimmed")]], + ["roadId", ["TmcIdType", XSD::QName.new(nil, "roadId")]], + ["routeId", ["SOAP::SOAPString", XSD::QName.new(nil, "routeId")]], + ["poiIds", ["ArrayOfint", XSD::QName.new(nil, "poiIds")]], + ["trafficInfoIds", ["ArrayOfstring", XSD::QName.new(nil, "trafficInfoIds")]], + ["icons", ["ArrayOfMapIconType", XSD::QName.new(nil, "icons")]], + ["routeIds", ["ArrayOfstring", XSD::QName.new(nil, "routeIds")]], + ["showBasicPois", ["SOAP::SOAPBoolean", XSD::QName.new(nil, "showBasicPois")]] + ] + ) + + LiteralRegistry.register( + :class => MapType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "MapType", + :schema_qualified => false, + :schema_element => [ + ["imageSize", ["ImageSizeType", XSD::QName.new(nil, "imageSize")]], + ["box", ["BoxType", XSD::QName.new(nil, "box")]], + ["width", ["SOAP::SOAPDouble", XSD::QName.new(nil, "width")]], + ["height", ["SOAP::SOAPDouble", XSD::QName.new(nil, "height")]], + ["imageUrl", ["SOAP::SOAPString", XSD::QName.new(nil, "imageUrl")]], + ["icons", ["ArrayOfMapIconType", XSD::QName.new(nil, "icons")]] + ] + ) + + LiteralRegistry.register( + :class => ModeType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "ModeType" + ) + + LiteralRegistry.register( + :class => VehicleType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "VehicleType" + ) + + LiteralRegistry.register( + :class => OptimizationType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "OptimizationType" + ) + + LiteralRegistry.register( + :class => DescriptionLevelType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "DescriptionLevelType" + ) + + LiteralRegistry.register( + :class => StepActionType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "StepActionType" + ) + + LiteralRegistry.register( + :class => TmcRoadTypeType, + :schema_ns => "urn:mms_MizGIS", + :schema_type => "TmcRoadTypeType" + ) +end diff --git a/soap4r.gemspec b/soap4r.gemspec new file mode 100644 index 0000000..1eccdc1 --- /dev/null +++ b/soap4r.gemspec @@ -0,0 +1,22 @@ +# v0.2 gemspec for soap4r +# Walter Korman (shaper@waywardgeeks.org) + +require 'rubygems' +SPEC = Gem::Specification.new do |s| + s.name = "soap4r" + s.version = "1.5.8" + s.date = "2007-09-24" + s.author = "NAKAMURA, Hiroshi" + s.email = "nahi@ruby-lang.org" + s.homepage = "http://dev.ctor.org/soap4r" + s.platform = Gem::Platform::RUBY + s.summary = "An implementation of SOAP 1.1 for Ruby." + s.files = Dir.glob("{bin,lib,test}/**/*") + s.require_path = "lib" + s.executables = [ "wsdl2ruby.rb", "xsd2ruby.rb" ] + # don't reference the test until we see it execute fully and successfully + s.test_file = "test/runner.rb" + # disable rdoc generation until we've got more + s.has_rdoc = false + s.add_dependency("httpclient", ">= 2.1.1") +end diff --git a/test/16runner.rb b/test/16runner.rb new file mode 100644 index 0000000..e714c92 --- /dev/null +++ b/test/16runner.rb @@ -0,0 +1,68 @@ +require 'test/unit/testsuite' +require 'test/unit/testcase' + +$KCODE = 'UTF8' + +rcsid = %w$Id: 16runner.rb 1541 2005-05-10 11:28:20Z nahi $ +Version = rcsid[2].scan(/\d+/).collect!(&method(:Integer)).freeze +Release = rcsid[3].freeze + +module Test + module Unit + module Assertions + alias assert_raise assert_raises + end + end +end + +class BulkTestSuite < Test::Unit::TestSuite + def self.suite + suite = Test::Unit::TestSuite.new + ObjectSpace.each_object(Class) do |klass| + suite << klass.suite if (Test::Unit::TestCase > klass) + end + suite + end +end + +runners_map = { + 'console' => proc do |suite| + require 'test/unit/ui/console/testrunner' + passed = Test::Unit::UI::Console::TestRunner.run(suite).passed? + exit(passed ? 0 : 1) + end, + 'gtk' => proc do |suite| + require 'test/unit/ui/gtk/testrunner' + Test::Unit::UI::GTK::TestRunner.run(suite) + end, + 'fox' => proc do |suite| + require 'test/unit/ui/fox/testrunner' + Test::Unit::UI::Fox::TestRunner.run(suite) + end, +} + +def test_require(list) + list.each do |tc_name| + if File.directory?(tc_name) + newlist = Dir.glob(File.join(tc_name, "**", "test_*.rb")).sort + test_require(newlist) + else + dir = File.expand_path(File.dirname(tc_name)) + backup = $:.dup + $:.push(dir) + require tc_name + $:.replace(backup) + end + end +end + +argv = ARGV +if argv.empty? + argv = Dir.glob(File.join(File.dirname(__FILE__), "**", "test_*.rb")).sort +end + +test_require(argv) + +runner = 'console' +GC.start +runners_map[runner].call(BulkTestSuite.suite) diff --git a/test/interopR2/README.txt b/test/interopR2/README.txt new file mode 100644 index 0000000..bca58a2 --- /dev/null +++ b/test/interopR2/README.txt @@ -0,0 +1,2 @@ +Clients/Server for SOAPBuilders Interoperability Lab "Round 2" +http://www.whitemesa.com/interop.htm diff --git a/test/interopR2/SOAPBuildersInterop_R2.wsdl b/test/interopR2/SOAPBuildersInterop_R2.wsdl new file mode 100644 index 0000000..a7785d4 --- /dev/null +++ b/test/interopR2/SOAPBuildersInterop_R2.wsdl @@ -0,0 +1,461 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/interopR2/SOAPBuildersInterop_R2GrB.wsdl b/test/interopR2/SOAPBuildersInterop_R2GrB.wsdl new file mode 100644 index 0000000..61209c7 --- /dev/null +++ b/test/interopR2/SOAPBuildersInterop_R2GrB.wsdl @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/test/interopR2/base.rb b/test/interopR2/base.rb new file mode 100644 index 0000000..199bfea --- /dev/null +++ b/test/interopR2/base.rb @@ -0,0 +1,288 @@ +require 'soap/soap' +require 'soap/mapping' + + +InterfaceNS = 'http://soapinterop.org/' +TypeNS = 'http://soapinterop.org/xsd' +ApacheNS = 'http://xml.apache.org/xml-soap' + + +module SOAPBuildersInterop +extend SOAP + + +MethodsBase = [ + ['echoVoid'], + ['echoString', + [:in, 'inputString', nil], [:retval, 'return', nil]], + ['echoStringArray', + [:in, 'inputStringArray', nil], [:retval, 'return', nil]], + ['echoInteger', + [:in, 'inputInteger', nil], [:retval, 'return', nil]], + ['echoIntegerArray', + [:in, 'inputIntegerArray', nil], [:retval, 'return', nil]], + ['echoFloat', + [:in, 'inputFloat', nil], [:retval, 'return', nil]], + ['echoFloatArray', + [:in, 'inputFloatArray', nil], [:retval, 'return', nil]], + ['echoStruct', + [:in, 'inputStruct', nil], [:retval, 'return', nil]], + ['echoStructArray', + [:in, 'inputStructArray', nil], [:retval, 'return', nil]], + ['echoDate', + [:in, 'inputDate', nil], [:retval, 'return', nil]], + ['echoBase64', + [:in, 'inputBase64', nil], [:retval, 'return', nil]], + ['echoHexBinary', + [:in, 'inputHexBinary', nil], [:retval, 'return', nil]], + ['echoBoolean', + [:in, 'inputBoolean', nil], [:retval, 'return', nil]], + ['echoDecimal', + [:in, 'inputDecimal', nil], [:retval, 'return', nil]], + ['echoMap', + [:in, 'inputMap', nil], [:retval, 'return', nil]], + ['echoMapArray', + [:in, 'inputMapArray', nil], [:retval, 'return', nil]], + + ['echoDouble', + [:in, 'inputDouble', nil], [:retval, 'return', nil]], + ['echoXSDDateTime', + [:in, 'inputXSDDateTime', nil], [:retval, 'return', nil]], + ['echoXSDDate', + [:in, 'inputXSDDate', nil], [:retval, 'return', nil]], + ['echoXSDTime', + [:in, 'inputXSDTime', nil], [:retval, 'return', nil]], +] + +MethodsGroupB = [ + ['echoStructAsSimpleTypes', + [:in, 'inputStruct', nil], [:out, 'outputString', nil], [:out, 'outputInteger', nil], [:out, 'outputFloat', nil]], + ['echoSimpleTypesAsStruct', + [:in, 'inputString', nil], [:in, 'inputInteger', nil], [:in, 'inputFloat', nil], [:retval, 'return', nil]], + ['echo2DStringArray', + [:in, 'input2DStringArray', nil], [:retval, 'return', nil]], + ['echoNestedStruct', + [:in, 'inputStruct', nil], [:retval, 'return', nil]], + ['echoNestedArray', + [:in, 'inputStruct', nil], [:retval, 'return', nil]], +] + +MethodsPolyMorph = [ + ['echoPolyMorph', + [:in, 'inputPolyMorph', nil], [:retval, 'return', nil]], + ['echoPolyMorphStruct', + [:in, 'inputPolyMorphStruct', nil], [:retval, 'return', nil]], + ['echoPolyMorphArray', + [:in, 'inputPolyMorphArray', nil], [:retval, 'return', nil]], +] + + +module FloatSupport + def floatEquals( lhs, rhs ) + lhsVar = lhs.is_a?( SOAP::SOAPFloat )? lhs.data : lhs + rhsVar = rhs.is_a?( SOAP::SOAPFloat )? rhs.data : rhs + lhsVar == rhsVar + end +end + +class SOAPStruct + include SOAP::Marshallable + include FloatSupport + + attr_accessor :varInt, :varFloat, :varString + + def initialize( varInt, varFloat, varString ) + @varInt = varInt + @varFloat = varFloat ? SOAP::SOAPFloat.new( varFloat ) : nil + @varString = varString + end + + def ==( rhs ) + r = if rhs.is_a?( self.class ) + ( self.varInt == rhs.varInt && + floatEquals( self.varFloat, rhs.varFloat ) && + self.varString == rhs.varString ) + else + false + end + r + end + + def to_s + "#{ varInt }:#{ varFloat }:#{ varString }" + end +end + + +class SOAPStructStruct + include SOAP::Marshallable + include FloatSupport + + attr_accessor :varInt, :varFloat, :varString, :varStruct + + def initialize( varInt, varFloat, varString, varStruct = nil ) + @varInt = varInt + @varFloat = varFloat ? SOAP::SOAPFloat.new( varFloat ) : nil + @varString = varString + @varStruct = varStruct + end + + def ==( rhs ) + r = if rhs.is_a?( self.class ) + ( self.varInt == rhs.varInt && + floatEquals( self.varFloat, rhs.varFloat ) && + self.varString == rhs.varString && + self.varStruct == rhs.varStruct ) + else + false + end + r + end + + def to_s + "#{ varInt }:#{ varFloat }:#{ varString }:#{ varStruct }" + end +end + + +class PolyMorphStruct + include SOAP::Marshallable + + attr_reader :varA, :varB, :varC + + def initialize( varA, varB, varC ) + @varA = varA + @varB = varB + @varC = varC + end + + def ==( rhs ) + r = if rhs.is_a?( self.class ) + ( self.varA == rhs.varA && + self.varB == rhs.varB && + self.varC == rhs.varC ) + else + false + end + r + end + + def to_s + "#{ varA }:#{ varB }:#{ varC }" + end +end + + +class SOAPArrayStruct + include SOAP::Marshallable + include FloatSupport + + attr_accessor :varInt, :varFloat, :varString, :varArray + + def initialize( varInt, varFloat, varString, varArray = nil ) + @varInt = varInt + @varFloat = varFloat ? SOAP::SOAPFloat.new( varFloat ) : nil + @varString = varString + @varArray = varArray + end + + def ==( rhs ) + r = if rhs.is_a?( self.class ) + ( self.varInt == rhs.varInt && + floatEquals( self.varFloat, rhs.varFloat ) && + self.varString == rhs.varString && + self.varArray == rhs.varArray ) + else + false + end + r + end + + def to_s + "#{ varInt }:#{ varFloat }:#{ varString }:#{ varArray }" + end +end + + +class StringArray < Array; end +class IntArray < Array; end +class FloatArray < Array; end +class SOAPStructArray < Array; end +class SOAPMapArray < Array; end +class ArrayOfanyType < Array; end + + +MappingRegistry = SOAP::Mapping::Registry.new + +MappingRegistry.set( + ::SOAPBuildersInterop::SOAPStruct, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new( TypeNS, "SOAPStruct" ) } +) + +MappingRegistry.set( + ::SOAPBuildersInterop::SOAPStructStruct, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new( TypeNS, "SOAPStructStruct" ) } +) + +MappingRegistry.set( + ::SOAPBuildersInterop::PolyMorphStruct, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new( TypeNS, "PolyMorphStruct" ) } +) + +MappingRegistry.set( + ::SOAPBuildersInterop::SOAPArrayStruct, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new( TypeNS, "SOAPArrayStruct" ) } +) + +MappingRegistry.set( + ::SOAPBuildersInterop::StringArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new( XSD::Namespace, XSD::StringLiteral ) } +) + +MappingRegistry.set( + ::SOAPBuildersInterop::IntArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new( XSD::Namespace, XSD::IntLiteral ) } +) + +MappingRegistry.set( + ::SOAPBuildersInterop::FloatArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new( XSD::Namespace, XSD::FloatLiteral ) } +) + +MappingRegistry.set( + ::SOAPBuildersInterop::SOAPStructArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new( TypeNS, 'SOAPStruct' ) } +) + +MappingRegistry.set( + ::SOAPBuildersInterop::SOAPMapArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new( ApacheNS, 'Map' ) } +) + +MappingRegistry.set( + ::SOAPBuildersInterop::ArrayOfanyType, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::AnyTypeName } +) + + +end diff --git a/test/interopR2/client.NetRemoting.rb b/test/interopR2/client.NetRemoting.rb new file mode 100644 index 0000000..1403d87 --- /dev/null +++ b/test/interopR2/client.NetRemoting.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +$serverName = 'dotNetRemotingWebServices' +$serverBase = 'http://www.mssoapinterop.org/remoting/ServiceA.soap' +$serverGroupB = 'http://www.mssoapinterop.org/remoting/ServiceB.soap' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/client.rb b/test/interopR2/client.rb new file mode 100644 index 0000000..cc486ba --- /dev/null +++ b/test/interopR2/client.rb @@ -0,0 +1,1234 @@ +$KCODE = 'EUC' + +require 'test/unit' +require 'soap/rpc/driver' +require 'soap/mapping' +require 'base' +require 'interopResultBase' +require 'xsd/xmlparser/rexmlparser' +#XSD::Charset.encoding = 'EUC' + +class Float + Precision = 5 + def ==(rhs) + if rhs.is_a?(Float) + if self.nan? and rhs.nan? + true + elsif self.infinite? == rhs.infinite? + true + elsif (rhs - self).abs <= (10 ** (- Precision)) + true + else + false + end + else + false + end + end +end + +class FakeFloat < SOAP::SOAPFloat + def initialize(str) + super() + @data = str + end + + def to_s + @data.to_s + end +end + +class FakeDateTime < SOAP::SOAPDateTime + def initialize(str) + super() + @data = str + end + + def to_s + @data.to_s + end +end + +class FakeDecimal < SOAP::SOAPDecimal + def initialize(str) + super() + @data = str + end + + def to_s + @data.to_s + end +end + +class FakeInt < SOAP::SOAPInt + def initialize(str) + super() + @data = str + end + + def to_s + @data.to_s + end +end + +class SOAPBuildersTest < Test::Unit::TestCase + include SOAP + include SOAPBuildersInterop + + NegativeZero = (-1.0 / (1.0 / 0.0)) + + class << self + include SOAP + def setup(name, location) + setup_log(name) + setup_drv(location) + end + + def teardown + end + + private + + def setup_log(name) + filename = File.basename($0).sub(/\.rb$/, '') << '.log' + @@log = File.open(filename, 'w') + @@log << "File: #{ filename } - Wiredumps for SOAP4R client / #{ name } server.\n" + @@log << "Date: #{ Time.now }\n\n" + end + + def setup_drv(location) + namespace = InterfaceNS + soap_action = InterfaceNS + @@drv = RPC::Driver.new(location, namespace, soap_action) + @@drv.mapping_registry = SOAPBuildersInterop::MappingRegistry + if $DEBUG + @@drv.wiredump_dev = STDOUT + else + @@drv.wiredump_dev = @@log + end + method_def(@@drv, soap_action) + end + + def method_def(drv, soap_action = nil) + do_method_def(drv, SOAPBuildersInterop::MethodsBase, soap_action) + do_method_def(drv, SOAPBuildersInterop::MethodsGroupB, soap_action) + end + + def do_method_def(drv, defs, soap_action = nil) + defs.each do |name, *params| + drv.add_rpc_operation( + XSD::QName.new(InterfaceNS, name), soap_action, name, params) + end + end + end + + def setup + end + + def teardown + end + + def drv + @@drv + end + + def log_test + /`([^']+)'/ =~ caller(1)[0] + title = $1 + title = "==== " + title + " " << "=" * (title.length > 72 ? 0 : (72 - title.length)) + @@log << "#{title}\n\n" + end + + def assert_exception(klass_or_module) + begin + yield + assert(false, "Exception was not raised.") + rescue Exception => e + if klass_or_module.is_a?(Module) + assert_kind_of(klass_or_module, e) + elsif klass_or_module.is_a?(Class) + assert_instance_of(klass_or_module, e) + else + assert(false, "Must be a klass or a mogule.") + end + end + end + + def inspect_with_id(obj) + case obj + when Array + obj.collect { |ele| inspect_with_id(ele) } + else + # String#== compares content of args. + "#{ obj.class }##{ obj.__id__ }" + end + end + + def dump_result(title, result, resultStr) + @@test_result.add( + SOAPBuildersInteropResult::TestResult.new( + title, + result, + resultStr, + $wireDumpDev.dup + ) + ) + $wireDumpLogFile << "Result: #{ resultStr || 'OK' }\n\n" + $wireDumpLogFile << $wireDumpDev + $wireDumpLogFile << "\n" + + $wireDumpDev.replace('') + end + + def test_echoVoid + log_test + var = drv.echoVoid() + assert_equal(nil, var) + end + + def test_echoString + log_test + arg = "SOAP4R Interoperability Test" + var = drv.echoString(arg) + assert_equal(arg, var) + end + + def test_echoString_Entity_reference + log_test + arg = "<>\"& <>"& &&><<<" + var = drv.echoString(arg) + assert_equal(arg, var) + end + + def test_echoString_haracter_reference + log_test + arg = "\x20 \040 \x7f\177" + tobe = " \177\177\177\177" + var = drv.echoString(SOAP::SOAPRawString.new(arg)) + assert_equal(tobe, var) + end + + def test_echoString_Leading_and_trailing_whitespace + log_test + arg = " SOAP4R\nInteroperability\nTest " + var = drv.echoString(arg) + assert_equal(arg, var) + end + + def test_echoString_EUC_encoded + log_test + arg = "Hello (ܸJapanese) ˤ" + var = drv.echoString(arg) + assert_equal(arg, var) + end + + def test_echoString_EUC_encoded_again + log_test + arg = "Hello (ܸJapanese) ˤ" + var = drv.echoString(arg) + assert_equal(arg, var) + end + + def test_echoString_SJIS_encoded + log_test + arg = "Hello (ܸJapanese) ˤ" + require 'nkf' + arg = NKF.nkf("-sm0", arg) + drv.options["soap.mapping.external_ces"] = 'SJIS' + begin + var = drv.echoString(arg) + assert_equal(arg, var) + ensure + drv.options["soap.mapping.external_ces"] = nil + end + end + + def test_echoString_empty + log_test + arg = '' + var = drv.echoString(arg) + assert_equal(arg, var) + end + + def test_echoString_space + log_test + arg = ' ' + var = drv.echoString(arg) + assert_equal(arg, var) + end + + def test_echoString_whitespaces + log_test + arg = "\r \n \t \r \n \t" + var = drv.echoString(arg) + assert_equal(arg, var) + end + + def test_echoStringArray + log_test + arg = StringArray["SOAP4R\n", " Interoperability ", "\tTest\t"] + var = drv.echoStringArray(arg) + assert_equal(arg, var) + end + + def test_echoStringArray_multi_ref + log_test + str1 = "SOAP4R" + str2 = "SOAP4R" + arg = StringArray[str1, str2, str1] + var = drv.echoStringArray(arg) + assert_equal(arg, var) + end + + def test_echoStringArray_multi_ref_idmatch + log_test + str1 = "SOAP4R" + str2 = "SOAP4R" + arg = StringArray[str1, str2, str1] + var = drv.echoStringArray(arg) + assert_equal(inspect_with_id(var[0]), inspect_with_id(var[2])) + end + + def test_echoStringArray_empty_multi_ref_idmatch + log_test + str1 = "" + str2 = "" + arg = StringArray[str1, str2, str1] + var = drv.echoStringArray(arg) + assert_equal(inspect_with_id(var[0]), inspect_with_id(var[2])) + end + + def test_echoInteger_123 + log_test + arg = 123 + var = drv.echoInteger(arg) + assert_equal(arg, var) + end + + def test_echoInteger_2147483647 + log_test + arg = 2147483647 + var = drv.echoInteger(arg) + assert_equal(arg, var) + end + + def test_echoInteger_negative_2147483648 + log_test + arg = -2147483648 + var = drv.echoInteger(arg) + assert_equal(arg, var) + end + + def test_echoInteger_2147483648_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeInt.new("2147483648") + var = drv.echoInteger(arg) + end + end + + def test_echoInteger_negative_2147483649_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeInt.new("-2147483649") + var = drv.echoInteger(arg) + end + end + + def test_echoInteger_0_0_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeInt.new("0.0") + var = drv.echoInteger(arg) + end + end + + def test_echoInteger_negative_5_2_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeInt.new("-5.2") + var = drv.echoInteger(arg) + end + end + + def test_echoInteger_0_000000000a_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeInt.new("0.000000000a") + var = drv.echoInteger(arg) + end + end + + def test_echoInteger_plus_minus_5_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeInt.new("+-5") + var = drv.echoInteger(arg) + end + end + + def test_echoIntegerArray + log_test + arg = IntArray[1, 2, 3] + var = drv.echoIntegerArray(arg) + assert_equal(arg, var) + end + + def test_echoIntegerArray_empty + log_test + arg = SOAP::SOAPArray.new(SOAP::ValueArrayName, 1, XSD::XSDInt::Type) + var = drv.echoIntegerArray(arg) + assert_equal([], var) + end + + def test_echoFloat + log_test + arg = 3.14159265358979 + var = drv.echoFloat(SOAPFloat.new(arg)) + assert_equal(arg, var) + end + + def test_echoFloat_scientific_notation + log_test + arg = 12.34e36 + var = drv.echoFloat(SOAPFloat.new(arg)) + assert_equal(arg, var) + end + + def test_echoFloat_scientific_notation_2 + log_test + arg = FakeFloat.new("12.34e36") + var = drv.echoFloat(SOAPFloat.new(arg)) + assert_equal(12.34e36, var) + end + + def test_echoFloat_scientific_notation_3 + log_test + arg = FakeFloat.new("12.34E+36") + var = drv.echoFloat(SOAPFloat.new(arg)) + assert_equal(12.34e36, var) + end + + def test_echoFloat_scientific_notation_4 + log_test + arg = FakeFloat.new("-1.4E") + var = drv.echoFloat(SOAPFloat.new(arg)) + assert_equal(1.4, var) + end + + def test_echoFloat_positive_lower_boundary + log_test + arg = 1.4e-45 + var = drv.echoFloat(SOAPFloat.new(arg)) + assert_equal(arg, var) + end + + def test_echoFloat_negative_lower_boundary + log_test + arg = -1.4e-45 + var = drv.echoFloat(SOAPFloat.new(arg)) + assert_equal(arg, var) + end + + def test_echoFloat_special_values_positive_0 + log_test + arg = 0.0 + var = drv.echoFloat(SOAPFloat.new(arg)) + assert_equal(arg, var) + end + + def test_echoFloat_special_values_negative_0 + log_test + arg = NegativeZero + var = drv.echoFloat(SOAPFloat.new(arg)) + assert_equal(arg, var) + end + + def test_echoFloat_special_values_NaN + log_test + arg = 0.0/0.0 + var = drv.echoFloat(SOAPFloat.new(arg)) + assert_equal(arg, var) + end + + def test_echoFloat_special_values_positive_INF + log_test + arg = 1.0/0.0 + var = drv.echoFloat(SOAPFloat.new(arg)) + assert_equal(arg, var) + end + + def test_echoFloat_special_values_negative_INF + log_test + arg = -1.0/0.0 + var = drv.echoFloat(SOAPFloat.new(arg)) + assert_equal(arg, var) + end + + def test_echoFloat_0_000a_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeFloat.new("0.0000000000000000a") + var = drv.echoFloat(arg) + end + end + + def test_echoFloat_00a_0001_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeFloat.new("00a.000000000000001") + var = drv.echoFloat(arg) + end + end + + def test_echoFloat_plus_minus_5_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeFloat.new("+-5") + var = drv.echoFloat(arg) + end + end + + def test_echoFloat_5_0_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeFloat.new("5_0") + var = drv.echoFloat(arg) + end + end + + def test_echoFloatArray + log_test + arg = FloatArray[SOAPFloat.new(0.0001), SOAPFloat.new(1000.0), + SOAPFloat.new(0.0)] + var = drv.echoFloatArray(arg) + assert_equal(arg.collect { |ele| ele.data }, var) + end + + def test_echoFloatArray_special_values_NaN_positive_INF_negative_INF + log_test + nan = SOAPFloat.new(0.0/0.0) + inf = SOAPFloat.new(1.0/0.0) + inf_ = SOAPFloat.new(-1.0/0.0) + arg = FloatArray[nan, inf, inf_] + var = drv.echoFloatArray(arg) + assert_equal(arg.collect { |ele| ele.data }, var) + end + + def test_echoStruct + log_test + arg = SOAPStruct.new(1, 1.1, "a") + var = drv.echoStruct(arg) + assert_equal(arg, var) + end + + def test_echoStruct_nil_members + log_test + arg = SOAPStruct.new(nil, nil, nil) + var = drv.echoStruct(arg) + assert_equal(arg, var) + end + + def test_echoStructArray + log_test + s1 = SOAPStruct.new(1, 1.1, "a") + s2 = SOAPStruct.new(2, 2.2, "b") + s3 = SOAPStruct.new(3, 3.3, "c") + arg = SOAPStructArray[s1, s2, s3] + var = drv.echoStructArray(arg) + assert_equal(arg, var) + end + + def test_echoStructArray_anyType_Array + log_test + s1 = SOAPStruct.new(1, 1.1, "a") + s2 = SOAPStruct.new(2, 2.2, "b") + s3 = SOAPStruct.new(3, 3.3, "c") + arg = [s1, s2, s3] + var = drv.echoStructArray(arg) + assert_equal(arg, var) + end + + def test_echoStructArray_multi_ref + log_test + s1 = SOAPStruct.new(1, 1.1, "a") + s2 = SOAPStruct.new(2, 2.2, "b") + arg = SOAPStructArray[s1, s1, s2] + var = drv.echoStructArray(arg) + assert_equal(arg, var) + end + + def test_echoStructArray_multi_ref_idmatch + log_test + s1 = SOAPStruct.new(1, 1.1, "a") + s2 = SOAPStruct.new(2, 2.2, "b") + arg = SOAPStructArray[s1, s1, s2] + var = drv.echoStructArray(arg) + assert_equal(inspect_with_id(var[0]), inspect_with_id(var[1])) + end + + def test_echoStructArray_anyType_Array_multi_ref_idmatch + log_test + s1 = SOAPStruct.new(1, 1.1, "a") + s2 = SOAPStruct.new(2, 2.2, "b") + arg = [s1, s2, s2] + var = drv.echoStructArray(arg) + assert_equal(inspect_with_id(var[1]), inspect_with_id(var[2])) + end + + def test_echoStructArray_multi_ref_idmatch_varString_of_elem1_varString_of_elem2 + log_test + str1 = "a" + str2 = "a" + s1 = SOAPStruct.new(1, 1.1, str1) + s2 = SOAPStruct.new(2, 2.2, str1) + s3 = SOAPStruct.new(3, 3.3, str2) + arg = SOAPStructArray[s1, s2, s3] + var = drv.echoStructArray(arg) + assert_equal(inspect_with_id(var[0].varString), inspect_with_id(var[1].varString)) + end + + def test_echoStructArray_anyType_Array_multi_ref_idmatch_varString_of_elem2_varString_of_elem3 + log_test + str1 = "b" + str2 = "b" + s1 = SOAPStruct.new(1, 1.1, str2) + s2 = SOAPStruct.new(2, 2.2, str1) + s3 = SOAPStruct.new(3, 3.3, str1) + arg = [s1, s2, s3] + var = drv.echoStructArray(arg) + assert_equal(inspect_with_id(var[1].varString), inspect_with_id(var[2].varString)) + end + + def test_echoDate_now + log_test + t = Time.now.gmtime + arg = DateTime.new(t.year, t.mon, t.mday, t.hour, t.min, t.sec) + var = drv.echoDate(arg) + assert_equal(arg.to_s, var.to_s) + end + + def test_echoDate_before_1970 + log_test + t = Time.now.gmtime + arg = DateTime.new(1, 1, 1, 0, 0, 0) + var = drv.echoDate(arg) + assert_equal(arg.to_s, var.to_s) + end + + def test_echoDate_after_2038 + log_test + t = Time.now.gmtime + arg = DateTime.new(2038, 12, 31, 0, 0, 0) + var = drv.echoDate(arg) + assert_equal(arg.to_s, var.to_s) + end + + def test_echoDate_negative_10_01_01T00_00_00Z + log_test + t = Time.now.gmtime + arg = DateTime.new(-10, 1, 1, 0, 0, 0) + var = drv.echoDate(arg) + assert_equal(arg.to_s, var.to_s) + end + + def test_echoDate_time_precision_msec + log_test + arg = SOAP::SOAPDateTime.new('2001-06-16T18:13:40.012') + argDate = arg.data + var = drv.echoDate(arg) + assert_equal(argDate, var) + end + + def test_echoDate_time_precision_long + log_test + arg = SOAP::SOAPDateTime.new('2001-06-16T18:13:40.0000000000123456789012345678900000000000') + argDate = arg.data + var = drv.echoDate(arg) + assert_equal(argDate, var) + end + + def test_echoDate_positive_TZ + log_test + arg = SOAP::SOAPDateTime.new('2001-06-17T01:13:40+07:00') + argNormalized = DateTime.new(2001, 6, 16, 18, 13, 40) + var = drv.echoDate(arg) + assert_equal(argNormalized, var) + end + + def test_echoDate_negative_TZ + log_test + arg = SOAP::SOAPDateTime.new('2001-06-16T18:13:40-07:00') + argNormalized = DateTime.new(2001, 6, 17, 1, 13, 40) + var = drv.echoDate(arg) + assert_equal(argNormalized, var) + end + + def test_echoDate_positive_00_00_TZ + log_test + arg = SOAP::SOAPDateTime.new('2001-06-17T01:13:40+00:00') + argNormalized = DateTime.new(2001, 6, 17, 1, 13, 40) + var = drv.echoDate(arg) + assert_equal(argNormalized, var) + end + + def test_echoDate_negative_00_00_TZ + log_test + arg = SOAP::SOAPDateTime.new('2001-06-17T01:13:40-00:00') + argNormalized = DateTime.new(2001, 6, 17, 1, 13, 40) + var = drv.echoDate(arg) + assert_equal(argNormalized, var) + end + + def test_echoDate_min_TZ + log_test + arg = SOAP::SOAPDateTime.new('2001-06-16T00:00:01+00:01') + argNormalized = DateTime.new(2001, 6, 15, 23, 59, 1) + var = drv.echoDate(arg) + assert_equal(argNormalized, var) + end + + def test_echoDate_year_9999 + log_test + arg = SOAP::SOAPDateTime.new('10000-06-16T18:13:40-07:00') + argNormalized = DateTime.new(10000, 6, 17, 1, 13, 40) + var = drv.echoDate(arg) + assert_equal(argNormalized, var) + end + + def test_echoDate_year_0 + log_test + arg = SOAP::SOAPDateTime.new('-0001-06-16T18:13:40-07:00') + argNormalized = DateTime.new(0, 6, 17, 1, 13, 40) + var = drv.echoDate(arg) + assert_equal(argNormalized, var) + end + + def test_echoDate_year_4713 + log_test + arg = SOAP::SOAPDateTime.new('-4713-01-01T12:00:00') + argNormalized = DateTime.new(-4712, 1, 1, 12, 0, 0) + var = drv.echoDate(arg) + assert_equal(argNormalized, var) + end + + def test_echoDate_year_0000_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeDateTime.new("0000-05-18T16:52:20Z") + var = drv.echoDate(arg) + end + end + + def test_echoDate_year_nn_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeDateTime.new("05-05-18T16:52:20Z") + var = drv.echoDate(arg) + end + end + + def test_echoDate_no_day_part_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeDateTime.new("2002-05T16:52:20Z") + var = drv.echoDate(arg) + end + end + + def test_echoDate_no_sec_part_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeDateTime.new("2002-05-18T16:52Z") + var = drv.echoDate(arg) + end + end + + def test_echoDate_empty_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeDateTime.new("") + var = drv.echoDate(arg) + end + end + + def test_echoBase64_xsd_base64Binary + log_test + str = "Hello (ܸJapanese) ˤ" + arg = SOAP::SOAPBase64.new(str) + arg.as_xsd # Force xsd:base64Binary instead of soap-enc:base64 + var = drv.echoBase64(arg) + assert_equal(str, var) + end + + def test_echoBase64_xsd_base64Binary_empty + log_test + str = "" + arg = SOAP::SOAPBase64.new(str) + arg.as_xsd # Force xsd:base64Binary instead of soap-enc:base64 + var = drv.echoBase64(arg) + assert_equal(str, var) + end + + def test_echoBase64_SOAP_ENC_base64 + log_test + str = "Hello (ܸJapanese) ˤ" + arg = SOAP::SOAPBase64.new(str) + var = drv.echoBase64(arg) + assert_equal(str, var) + end + + def test_echoBase64_0 + log_test + str = "\0" + arg = SOAP::SOAPBase64.new(str) + var = drv.echoBase64(arg) + assert_equal(str, var) + end + + def test_echoBase64_0a_0 + log_test + str = "a\0b\0\0c\0\0\0" + arg = SOAP::SOAPBase64.new(str) + var = drv.echoBase64(arg) + assert_equal(str, var) + end + + def test_echoBase64_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = SOAP::SOAPBase64.new("dummy") + arg.instance_eval { @data = '-' } + var = drv.echoBase64(arg) + end + end + + def test_echoHexBinary + log_test + str = "Hello (ܸJapanese) ˤ" + arg = SOAP::SOAPHexBinary.new(str) + var = drv.echoHexBinary(arg) + assert_equal(str, var) + end + + def test_echoHexBinary_empty + log_test + str = "" + arg = SOAP::SOAPHexBinary.new(str) + var = drv.echoHexBinary(arg) + assert_equal(str, var) + end + + def test_echoHexBinary_0 + log_test + str = "\0" + arg = SOAP::SOAPHexBinary.new(str) + var = drv.echoHexBinary(arg) + assert_equal(str, var) + end + + def test_echoHexBinary_0a_0 + log_test + str = "a\0b\0\0c\0\0\0" + arg = SOAP::SOAPHexBinary.new(str) + var = drv.echoHexBinary(arg) + assert_equal(str, var) + end + + def test_echoHexBinary_lower_case + log_test + str = "lower case" + arg = SOAP::SOAPHexBinary.new + arg.set_encoded((str.unpack("H*")[0]).tr('A-F', 'a-f')) + var = drv.echoHexBinary(arg) + assert_equal(str, var) + end + + def test_echoHexBinary_0FG7_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = SOAP::SOAPHexBinary.new("dummy") + arg.instance_eval { @data = '0FG7' } + var = drv.echoHexBinary(arg) + end + end + + def test_echoBoolean_true + log_test + arg = true + var = drv.echoBoolean(arg) + assert_equal(arg, var) + end + + def test_echoBoolean_false + log_test + arg = false + var = drv.echoBoolean(arg) + assert_equal(arg, var) + end + + def test_echoBoolean_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = SOAP::SOAPBoolean.new(true) + arg.instance_eval { @data = 'junk' } + var = drv.echoBoolean(arg) + end + end + + def test_echoDecimal_123456 + log_test + arg = "123456789012345678" + var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg)) + normalized = arg + assert_equal(normalized, var) + end + + def test_echoDecimal_0_123 + log_test + arg = "+0.12345678901234567" + var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg)) + normalized = arg.sub(/0$/, '').sub(/^\+/, '') + assert_equal(normalized, var) + end + + def test_echoDecimal_00000123 + log_test + arg = ".00000123456789012" + var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg)) + normalized = '0' << arg.sub(/0$/, '') + assert_equal(normalized, var) + end + + def test_echoDecimal_negative_00000123 + log_test + arg = "-.00000123456789012" + var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg)) + normalized = '-0' << arg.sub(/0$/, '').sub(/-/, '') + assert_equal(normalized, var) + end + + def test_echoDecimal_123_456 + log_test + arg = "-123456789012345.008" + var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg)) + assert_equal(arg, var) + end + + def test_echoDecimal_123 + log_test + arg = "-12345678901234567." + normalized = arg.sub(/\.$/, '') + var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg)) + assert_equal(normalized, var) + end + + def test_echoDecimal_0_000a_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeDecimal.new("0.0000000000000000a") + var = drv.echoDecimal(arg) + end + end + + def test_echoDecimal_00a_0001_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeDecimal.new("00a.000000000000001") + var = drv.echoDecimal(arg) + end + end + + def test_echoDecimal_plus_minus_5_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeDecimal.new("+-5") + var = drv.echoDecimal(arg) + end + end + + def test_echoDecimal_5_0_junk + log_test + assert_exception(SOAP::RPC::ServerException) do + arg = FakeDecimal.new("5_0") + var = drv.echoDecimal(arg) + end + end + + def test_echoMap + log_test + arg = { "a" => 1, "b" => 2 } + var = drv.echoMap(arg) + assert_equal(arg, var) + end + + def test_echoMap_boolean_base64_nil_float + log_test + arg = { true => "\0", "\0" => nil, nil => 0.0001, 0.0001 => false } + var = drv.echoMap(arg) + assert_equal(arg, var) + end + + def test_echoMap_multibyte_char + log_test + arg = { "Hello (ܸJapanese) ˤ" => 1, 1 => "Hello (ܸJapanese) ˤ" } + var = drv.echoMap(arg) + assert_equal(arg, var) + end + + def test_echoMap_Struct + log_test + obj = SOAPStruct.new(1, 1.1, "a") + arg = { 1 => obj, 2 => obj } + var = drv.echoMap(arg) + assert_equal(arg, var) + end + + def test_echoMap_multi_ref_idmatch_value_for_key_a + log_test + value = "c" + arg = { "a" => value, "b" => value } + var = drv.echoMap(arg) + assert_equal(inspect_with_id(var["a"]), inspect_with_id(var["b"])) + end + + def test_echoMap_Struct_multi_ref_idmatch_varString_of_a_key + log_test + str = "" + obj = SOAPStruct.new(1, 1.1, str) + arg = { obj => "1", "1" => obj } + var = drv.echoMap(arg) + assert_equal(inspect_with_id(var.index("1").varString), inspect_with_id(var.fetch("1").varString)) + end + + def test_echoMapArray + log_test + map1 = { "a" => 1, "b" => 2 } + map2 = { "a" => 1, "b" => 2 } + map3 = { "a" => 1, "b" => 2 } + arg = [map1, map2, map3] + var = drv.echoMapArray(arg) + assert_equal(arg, var) + end + + def test_echoMapArray_boolean_base64_nil_float + log_test + map1 = { true => "\0", "\0" => nil, nil => 0.0001, 0.0001 => false } + map2 = { true => "\0", "\0" => nil, nil => 0.0001, 0.0001 => false } + map3 = { true => "\0", "\0" => nil, nil => 0.0001, 0.0001 => false } + arg = [map1, map2, map3] + var = drv.echoMapArray(arg) + assert_equal(arg, var) + end + + def test_echoMapArray_multibyte_char + log_test + map1 = { "Hello (ܸJapanese) ˤ" => 1, 1 => "Hello (ܸJapanese) ˤ" } + map2 = { "Hello (ܸJapanese) ˤ" => 1, 1 => "Hello (ܸJapanese) ˤ" } + map3 = { "Hello (ܸJapanese) ˤ" => 1, 1 => "Hello (ܸJapanese) ˤ" } + arg = [map1, map2, map3] + var = drv.echoMapArray(arg) + assert_equal(arg, var) + end + + def test_echoMapArray_multi_ref_idmatch + log_test + map1 = { "a" => 1, "b" => 2 } + map2 = { "a" => 1, "b" => 2 } + arg = [map1, map1, map2] + var = drv.echoMapArray(arg) + assert_equal(inspect_with_id(var[0]), inspect_with_id(var[1])) + end + + def test_echoStructAsSimpleTypes + log_test + arg = SOAPStruct.new(1, 1.1, "a") + ret, out1, out2 = drv.echoStructAsSimpleTypes(arg) + var = SOAPStruct.new(out1, out2, ret) + assert_equal(arg, var) + end + + def test_echoStructAsSimpleTypes_nil + log_test + arg = SOAPStruct.new(nil, nil, nil) + ret, out1, out2 = drv.echoStructAsSimpleTypes(arg) + var = SOAPStruct.new(out1, out2, ret) + assert_equal(arg, var) + end + + def test_echoSimpleTypesAsStruct + log_test + arg = SOAPStruct.new(1, 1.1, "a") + var = drv.echoSimpleTypesAsStruct(arg.varString, arg.varInt, arg.varFloat) + assert_equal(arg, var) + end + + def test_echoSimpleTypesAsStruct_nil + log_test + arg = SOAPStruct.new(nil, nil, nil) + var = drv.echoSimpleTypesAsStruct(arg.varString, arg.varInt, arg.varFloat) + assert_equal(arg, var) + end + + def test_echo2DStringArray + log_test +# arg = SOAP::SOAPArray.new(SOAP::ValueArrayName, 2, XSD::XSDString::Type) +# arg[0, 0] = obj2soap('r0c0') +# arg[1, 0] = obj2soap('r1c0') +# arg[2, 0] = obj2soap('r2c0') +# arg[0, 1] = obj2soap('r0c1') +# arg[1, 1] = obj2soap('r1c1') +# arg[2, 1] = obj2soap('r2c1') +# arg[0, 2] = obj2soap('r0c2') +# arg[1, 2] = obj2soap('r1c2') +# arg[2, 2] = obj2soap('r2c2') + + arg = SOAP::SOAPArray.new(XSD::QName.new('http://soapinterop.org/xsd', 'ArrayOfString2D'), 2, XSD::XSDString::Type) + arg.size = [3, 3] + arg.size_fixed = true + arg.add(SOAP::Mapping.obj2soap('r0c0', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r1c0', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r2c0', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r0c1', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r1c1', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r2c1', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r0c2', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r1c2', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r2c2', SOAPBuildersInterop::MappingRegistry)) + argNormalized = [ + ['r0c0', 'r1c0', 'r2c0'], + ['r0c1', 'r1c1', 'r2c1'], + ['r0c2', 'r1c2', 'r2c2'], + ] + + var = drv.echo2DStringArray(arg) + assert_equal(argNormalized, var) + end + + def test_echo2DStringArray_anyType_array + log_test + # ary2md converts Arry ((of Array)...) into M-D anyType Array + arg = [ + ['r0c0', 'r0c1', 'r0c2'], + ['r1c0', 'r1c1', 'r1c2'], + ['r2c0', 'r0c1', 'r2c2'], + ] + + paramArg = SOAP::Mapping.ary2md(arg, 2, XSD::Namespace, XSD::AnyTypeLiteral, SOAPBuildersInterop::MappingRegistry) + paramArg.type = XSD::QName.new('http://soapinterop.org/xsd', 'ArrayOfString2D') + var = drv.echo2DStringArray(paramArg) + assert_equal(arg, var) + end + + def test_echo2DStringArray_multi_ref + log_test + arg = SOAP::SOAPArray.new(XSD::QName.new('http://soapinterop.org/xsd', 'ArrayOfString2D'), 2, XSD::XSDString::Type) + arg.size = [3, 3] + arg.size_fixed = true + + item = 'item' + arg.add('r0c0') + arg.add('r1c0') + arg.add(item) + arg.add('r0c1') + arg.add('r1c1') + arg.add('r2c1') + arg.add(item) + arg.add('r1c2') + arg.add('r2c2') + argNormalized = [ + ['r0c0', 'r1c0', 'item'], + ['r0c1', 'r1c1', 'r2c1'], + ['item', 'r1c2', 'r2c2'], + ] + + var = drv.echo2DStringArray(arg) + assert_equal(argNormalized, var) + end + + def test_echo2DStringArray_multi_ref_idmatch + log_test + arg = SOAP::SOAPArray.new(XSD::QName.new('http://soapinterop.org/xsd', 'ArrayOfString2D'), 2, XSD::XSDString::Type) + arg.size = [3, 3] + arg.size_fixed = true + + item = 'item' + arg.add('r0c0') + arg.add('r1c0') + arg.add(item) + arg.add('r0c1') + arg.add('r1c1') + arg.add('r2c1') + arg.add(item) + arg.add('r1c2') + arg.add('r2c2') + + var = drv.echo2DStringArray(arg) + assert_equal(inspect_with_id(var[2][0]), inspect_with_id(var[0][2])) + end + + def test_echoNestedStruct + log_test + arg = SOAPStructStruct.new(1, 1.1, "a", + SOAPStruct.new(2, 2.2, "b") + ) + var = drv.echoNestedStruct(arg) + assert_equal(arg, var) + end + + def test_echoNestedStruct_nil + log_test + arg = SOAPStructStruct.new(nil, nil, nil, + SOAPStruct.new(nil, nil, nil) + ) + var = drv.echoNestedStruct(arg) + assert_equal(arg, var) + end + + def test_echoNestedStruct_multi_ref_idmatch + log_test + str1 = "" + arg = SOAPStructStruct.new(1, 1.1, str1, + SOAPStruct.new(2, 2.2, str1) + ) + var = drv.echoNestedStruct(arg) + assert_equal(inspect_with_id(var.varString), inspect_with_id(var.varStruct.varString)) + end + + def test_echoNestedArray + log_test + arg = SOAPArrayStruct.new(1, 1.1, "a", StringArray["2", "2.2", "b"]) + var = drv.echoNestedArray(arg) + assert_equal(arg, var) + end + + def test_echoNestedArray_anyType_array + log_test + arg = SOAPArrayStruct.new(1, 1.1, "a", ["2", "2.2", "b"]) + var = drv.echoNestedArray(arg) + assert_equal(arg, var) + end + + def test_echoNestedArray_multi_ref + log_test + str = "" + arg = SOAPArrayStruct.new(1, 1.1, str, StringArray["2", str, "b"]) + var = drv.echoNestedArray(arg) + assert_equal(arg, var) + end + + def test_echoNestedArray_multi_ref_idmatch + log_test + str = "" + arg = SOAPArrayStruct.new(1, 1.1, str, StringArray["2", str, "b"]) + var = drv.echoNestedArray(arg) + assert_equal(inspect_with_id(var.varString), inspect_with_id(var.varArray[1])) + end +end + +if $0 == __FILE__ + #name = ARGV.shift || 'localhost' + #location = ARGV.shift || 'http://localhost:10080/' + name = 'localhsot'; location = 'http://localhost:10080/' + SOAPBuildersTest.setup(name, location) +end diff --git a/test/interopR2/client4S4C.rb b/test/interopR2/client4S4C.rb new file mode 100644 index 0000000..cbc940b --- /dev/null +++ b/test/interopR2/client4S4C.rb @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +$serverName = '4S4C' +$server = 'http://soap.4s4c.com/ilab/soap.asp' +$noEchoMap = true + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) + +methodDef(drv) + +doTestBase(drv) +doTestGroupB(drv) +submitTestResult diff --git a/test/interopR2/client4S4C2.rb b/test/interopR2/client4S4C2.rb new file mode 100644 index 0000000..8bb67fb --- /dev/null +++ b/test/interopR2/client4S4C2.rb @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +$serverName = '4S4C2' +$server = 'http://soap.4s4c.com/ilab2/soap.asp' + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) + +methodDef(drv) + +doTestBase(drv) +doTestGroupB(drv) +submitTestResult diff --git a/test/interopR2/clientASP.NET.rb b/test/interopR2/clientASP.NET.rb new file mode 100644 index 0000000..aa65325 --- /dev/null +++ b/test/interopR2/clientASP.NET.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +$serverName = 'MSASPdotNETWebServices' +$serverBase = 'http://www.mssoapinterop.org/asmx/simple.asmx' +$serverGroupB = 'http://www.mssoapinterop.org/asmx/simpleB.asmx' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientApacheAxis.rb b/test/interopR2/clientApacheAxis.rb new file mode 100644 index 0000000..da4b769 --- /dev/null +++ b/test/interopR2/clientApacheAxis.rb @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby + +$serverName = 'ApacheAxis' +$server = 'http://nagoya.apache.org:5049/axis/services/echo' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientApacheSOAP.rb b/test/interopR2/clientApacheSOAP.rb new file mode 100644 index 0000000..7740a0b --- /dev/null +++ b/test/interopR2/clientApacheSOAP.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +$serverName = 'ApacheSOAP2.2' +$serverBase = 'http://nagoya.apache.org:5049/soap/servlet/rpcrouter' +$serverGroupB = 'None' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase( drvBase ) + +#drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +#methodDefGroupB( drvGroupB ) + +doTestBase( drvBase ) +#doTestGroupB( drvGroupB ) +submitTestResult diff --git a/test/interopR2/clientBEAWebLogic.rb b/test/interopR2/clientBEAWebLogic.rb new file mode 100644 index 0000000..8513e4c --- /dev/null +++ b/test/interopR2/clientBEAWebLogic.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +$serverName = 'BEAWebLogic8.1' +$serverBase = 'http://webservice.bea.com:7001/base/SoapInteropBaseService' +$serverGroupB = 'http://webservice.bea.com:7001/groupb/SoapInteropGroupBService' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientBase.rb b/test/interopR2/clientBase.rb new file mode 100644 index 0000000..af308f9 --- /dev/null +++ b/test/interopR2/clientBase.rb @@ -0,0 +1,1967 @@ +$KCODE = 'EUC' + +require 'logger' +require 'soap/rpc/driver' +require 'soap/mapping' +require 'base' +require 'interopResultBase' + +include SOAP +include SOAPBuildersInterop + +$soapAction = 'http://soapinterop.org/' +$testResultServer = 'http://dev.ctor.org/soapsrv' +$testResultDrv = SOAP::RPC::Driver.new($testResultServer, + SOAPBuildersInteropResult::InterfaceNS) + +SOAPBuildersInteropResult::Methods.each do |name, *params| + $testResultDrv.add_rpc_operation( + XSD::QName.new(SOAPBuildersInteropResult::InterfaceNS, name), + nil, name, params) +end + +client = SOAPBuildersInteropResult::Endpoint.new +client.processorName = 'SOAP4R' +client.processorVersion = '1.5' +client.uri = '*:*' +client.wsdl = "#{$wsdlBase} #{$wsdlGroupB}" + +server = SOAPBuildersInteropResult::Endpoint.new +server.endpointName = $serverName +server.uri = $server || "#{ $serverBase }, #{ $serverGroupB }" +server.wsdl = "#{$wsdlBase} #{$wsdlGroupB}" + +$testResults = SOAPBuildersInteropResult::InteropResults.new(client, server) + +$wireDumpDev = '' +def $wireDumpDev.close; end + +$wireDumpLogFile = STDERR + + +### +## Method definition. +# +def methodDef(drv) + drv.soapaction = $soapAction + methodDefBase(drv) + methodDefGroupB(drv) +end + +def methodDefBase(drv) + SOAPBuildersInterop::MethodsBase.each do |name, *params| + drv.add_rpc_operation( + XSD::QName.new(InterfaceNS, name), $soapAction, name, params) + end +end + +def methodDefGroupB(drv) + SOAPBuildersInterop::MethodsGroupB.each do |name, *params| + drv.add_rpc_operation( + XSD::QName.new(InterfaceNS, name), $soapAction, name, params) + end +end + + +### +## Helper function +# +class Float + Precision = 5 + + def ==(rhs) + if rhs.is_a?(Float) + if self.nan? and rhs.nan? + true + elsif self.infinite? == rhs.infinite? + true + elsif (rhs - self).abs <= (10 ** (- Precision)) + true + else + false + end + else + false + end + end +end + +def assert(expected, actual) + if expected == actual + 'OK' + else + "Expected = " << expected.inspect << " // Actual = " << actual.inspect + end +end + +def setWireDumpLogFile(postfix = "") + logFilename = File.basename($0).sub(/\.rb$/, '') << postfix << '.log' + f = File.open(logFilename, 'w') + f << "File: #{ logFilename } - Wiredumps for SOAP4R client / #{ $serverName } server.\n" + f << "Date: #{ Time.now }\n\n" + $wireDumpLogFile = f +end + +def getWireDumpLogFileBase(postfix = "") + File.basename($0).sub(/\.rb$/, '') + postfix +end + +def getIdObj(obj) + case obj + when Array + obj.collect { |ele| + getIdObj(ele) + } + else + # String#== compares content of args. + "#{ obj.class }##{ obj.__id__ }" + end +end + +def dumpTitle(title) + p title + $wireDumpLogFile << "##########\n# " << title << "\n\n" +end + +def dumpNormal(title, expected, actual) + result = assert(expected, actual) + if result == 'OK' + dumpResult(title, true, nil) + else + dumpResult(title, false, result) + end +end + +def dumpException(title) + result = "Exception: #{ $! } (#{ $!.class})\n" << $@.join("\n") + dumpResult(title, false, result) +end + +def dumpResult(title, result, resultStr) + $testResults.add( + SOAPBuildersInteropResult::TestResult.new( + title, + result, + resultStr, + $wireDumpDev.dup + ) + ) + $wireDumpLogFile << "Result: #{ resultStr || 'OK' }\n\n" + $wireDumpLogFile << $wireDumpDev + $wireDumpLogFile << "\n" + + $wireDumpDev.replace('') +end + +def submitTestResult + $testResultDrv.addResults($testResults) +end + +class FakeFloat < SOAP::SOAPFloat + def initialize(str) + super() + @data = str + end + + def to_s + @data.to_s + end +end + +class FakeDateTime < SOAP::SOAPDateTime + def initialize(str) + super() + @data = str + end + + def to_s + @data.to_s + end +end + +class FakeDecimal < SOAP::SOAPDecimal + def initialize(str) + super() + @data = str + end + + def to_s + @data.to_s + end +end + +class FakeInt < SOAP::SOAPInt + def initialize(str) + super() + @data = str + end + + def to_s + @data.to_s + end +end + + +### +## Invoke methods. +# +def doTest(drv) + doTestBase(drv) + doTestGroupB(drv) +end + +def doTestBase(drv) + setWireDumpLogFile('_Base') + drv.wiredump_dev = $wireDumpDev +# drv.wiredump_filebase = getWireDumpLogFileBase('_Base') + + drv.mapping_registry = SOAPBuildersInterop::MappingRegistry + + title = 'echoVoid' + dumpTitle(title) + begin + var = drv.echoVoid() + dumpNormal(title, nil, var) + rescue Exception + dumpException(title) + end + + title = 'echoString' + dumpTitle(title) + begin + arg = "SOAP4R Interoperability Test" + var = drv.echoString(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoString (Entity reference)' + dumpTitle(title) + begin + arg = "<>\"& <>"& &&><<<" + var = drv.echoString(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoString (Character reference)' + dumpTitle(title) + begin + arg = "\x20 \040 \x7f\177" + tobe = " \177\177\177\177" + var = drv.echoString(SOAP::SOAPRawString.new(arg)) + dumpNormal(title, tobe, var) + rescue Exception + dumpException(title) + end + + title = 'echoString (Leading and trailing whitespace)' + dumpTitle(title) + begin + arg = " SOAP4R\nInteroperability\nTest " + var = drv.echoString(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoString (EUC encoded)' + dumpTitle(title) + begin + arg = "Hello (ܸJapanese) ˤ" + var = drv.echoString(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoString (EUC encoded) again' + dumpTitle(title) + begin + arg = "Hello (ܸJapanese) ˤ" + var = drv.echoString(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoString (empty)' + dumpTitle(title) + begin + arg = '' + var = drv.echoString(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoString (space)' + dumpTitle(title) + begin + arg = ' ' + var = drv.echoString(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoString (whitespaces:\r \n \t \r \n \t)' + dumpTitle(title) + begin + arg = "\r \n \t \r \n \t" + var = drv.echoString(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoStringArray' + dumpTitle(title) + begin + arg = StringArray["SOAP4R\n", " Interoperability ", "\tTest\t"] + var = drv.echoStringArray(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + +# title = 'echoStringArray (sparse)' +# dumpTitle(title) +# begin +# arg = [nil, "SOAP4R\n", nil, " Interoperability ", nil, "\tTest\t", nil] +# soapAry = SOAP::Mapping.ary2soap(arg, XSD::Namespace, XSD::StringLiteral, SOAPBuildersInterop::MappingRegistry) +# soapAry.sparse = true +# var = drv.echoStringArray(soapAry) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end + + title = 'echoStringArray (multi-ref)' + dumpTitle(title) + begin + str1 = "SOAP4R" + str2 = "SOAP4R" + arg = StringArray[str1, str2, str1] + var = drv.echoStringArray(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoStringArray (multi-ref: elem1 == elem3)' + dumpTitle(title) + begin + str1 = "SOAP4R" + str2 = "SOAP4R" + arg = StringArray[str1, str2, str1] + var = drv.echoStringArray(arg) + dumpNormal(title, getIdObj(var[0]), getIdObj(var[2])) + rescue Exception + dumpException(title) + end + + title = 'echoStringArray (empty, multi-ref: elem1 == elem3)' + dumpTitle(title) + begin + str1 = "" + str2 = "" + arg = StringArray[str1, str2, str1] + var = drv.echoStringArray(arg) + dumpNormal(title, getIdObj(var[0]), getIdObj(var[2])) + rescue Exception + dumpException(title) + end + +# title = 'echoStringArray (sparse, multi-ref)' +# dumpTitle(title) +# begin +# str = "SOAP4R" +# arg = StringArray[nil, nil, nil, nil, nil, str, nil, str] +# soapAry = SOAP::Mapping.ary2soap(arg, XSD::Namespace, XSD::StringLiteral, SOAPBuildersInterop::MappingRegistry) +# soapAry.sparse = true +# var = drv.echoStringArray(soapAry) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end + + title = 'echoInteger (Int: 123)' + dumpTitle(title) + begin + arg = 123 + var = drv.echoInteger(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoInteger (Int: 2147483647)' + dumpTitle(title) + begin + arg = 2147483647 + var = drv.echoInteger(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoInteger (Int: -2147483648)' + dumpTitle(title) + begin + arg = -2147483648 + var = drv.echoInteger(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoInteger (2147483648: junk)' + dumpTitle(title) + begin + begin + arg = FakeInt.new("2147483648") + var = drv.echoInteger(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoInteger (-2147483649: junk)' + dumpTitle(title) + begin + begin + arg = FakeInt.new("-2147483649") + var = drv.echoInteger(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoInteger (0.0: junk)' + dumpTitle(title) + begin + begin + arg = FakeInt.new("0.0") + var = drv.echoInteger(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoInteger (-5.2: junk)' + dumpTitle(title) + begin + begin + arg = FakeInt.new("-5.2") + var = drv.echoInteger(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoInteger (0.000000000a: junk)' + dumpTitle(title) + begin + begin + arg = FakeInt.new("0.000000000a") + var = drv.echoInteger(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoInteger (+-5: junk)' + dumpTitle(title) + begin + begin + arg = FakeInt.new("+-5") + var = drv.echoInteger(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoIntegerArray' + dumpTitle(title) + begin + arg = IntArray[1, 2, 3] + var = drv.echoIntegerArray(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + +# title = 'echoIntegerArray (nil)' +# dumpTitle(title) +# begin +# arg = IntArray[nil, nil, nil] +# var = drv.echoIntegerArray(arg) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end + + title = 'echoIntegerArray (empty)' + dumpTitle(title) + begin + arg = SOAP::SOAPArray.new(SOAP::ValueArrayName, 1, XSD::XSDInt::Type) + var = drv.echoIntegerArray(arg) + dumpNormal(title, [], var) + rescue Exception + dumpException(title) + end + +# title = 'echoIntegerArray (sparse)' +# dumpTitle(title) +# begin +# arg = [nil, 1, nil, 2, nil, 3, nil] +# soapAry = SOAP::Mapping.ary2soap(arg, XSD::Namespace, XSD::XSDInt::Type, SOAPBuildersInterop::MappingRegistry) +# soapAry.sparse = true +# var = drv.echoIntegerArray(soapAry) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end + + title = 'echoFloat' + dumpTitle(title) + begin + arg = 3.14159265358979 + var = drv.echoFloat(SOAPFloat.new(arg)) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoFloat (scientific notation)' + dumpTitle(title) + begin + arg = 12.34e36 + var = drv.echoFloat(SOAPFloat.new(arg)) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoFloat (scientific notation 2)' + dumpTitle(title) + begin + arg = FakeFloat.new("12.34e36") + var = drv.echoFloat(SOAPFloat.new(arg)) + dumpNormal(title, 12.34e36, var) + rescue Exception + dumpException(title) + end + + title = 'echoFloat (scientific notation 3)' + dumpTitle(title) + begin + arg = FakeFloat.new("12.34E+36") + var = drv.echoFloat(SOAPFloat.new(arg)) + dumpNormal(title, 12.34e36, var) + rescue Exception + dumpException(title) + end + + title = 'echoFloat (scientific notation 4)' + dumpTitle(title) + begin + arg = FakeFloat.new("-1.4E") + var = drv.echoFloat(SOAPFloat.new(arg)) + dumpNormal(title, 1.4, var) + rescue Exception + dumpException(title) + end + + title = 'echoFloat (positive lower boundary)' + dumpTitle(title) + begin + arg = 1.4e-45 + var = drv.echoFloat(SOAPFloat.new(arg)) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoFloat (negative lower boundary)' + dumpTitle(title) + begin + arg = -1.4e-45 + var = drv.echoFloat(SOAPFloat.new(arg)) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoFloat (special values: +0)' + dumpTitle(title) + begin + arg = 0.0 + var = drv.echoFloat(SOAPFloat.new(arg)) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoFloat (special values: -0)' + dumpTitle(title) + begin + arg = (-1.0 / (1.0 / 0.0)) + var = drv.echoFloat(SOAPFloat.new(arg)) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoFloat (special values: NaN)' + dumpTitle(title) + begin + arg = 0.0/0.0 + var = drv.echoFloat(SOAPFloat.new(arg)) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoFloat (special values: INF)' + dumpTitle(title) + begin + arg = 1.0/0.0 + var = drv.echoFloat(SOAPFloat.new(arg)) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoFloat (special values: -INF)' + dumpTitle(title) + begin + arg = -1.0/0.0 + var = drv.echoFloat(SOAPFloat.new(arg)) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoFloat (0.000a: junk)' + dumpTitle(title) + begin + begin + arg = FakeFloat.new("0.0000000000000000a") + var = drv.echoFloat(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoFloat (00a.0001: junk)' + dumpTitle(title) + begin + begin + arg = FakeFloat.new("00a.000000000000001") + var = drv.echoFloat(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoFloat (+-5: junk)' + dumpTitle(title) + begin + begin + arg = FakeFloat.new("+-5") + var = drv.echoFloat(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoFloat (5_0: junk)' + dumpTitle(title) + begin + begin + arg = FakeFloat.new("5_0") + var = drv.echoFloat(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoFloatArray' + dumpTitle(title) + begin + arg = FloatArray[SOAPFloat.new(0.0001), SOAPFloat.new(1000.0), SOAPFloat.new(0.0)] + var = drv.echoFloatArray(arg) + dumpNormal(title, arg.collect { |ele| ele.data }, var) + rescue Exception + dumpException(title) + end + + title = 'echoFloatArray (special values: NaN, INF, -INF)' + dumpTitle(title) + begin + nan = SOAPFloat.new(0.0/0.0) + inf = SOAPFloat.new(1.0/0.0) + inf_ = SOAPFloat.new(-1.0/0.0) + arg = FloatArray[nan, inf, inf_] + var = drv.echoFloatArray(arg) + dumpNormal(title, arg.collect { |ele| ele.data }, var) + rescue Exception + dumpException(title) + end + +# title = 'echoFloatArray (sparse)' +# dumpTitle(title) +# begin +# arg = [nil, nil, 0.0001, 1000.0, 0.0, nil, nil] +# soapAry = SOAP::Mapping.ary2soap(arg, XSD::Namespace, XSD::FloatLiteral, SOAPBuildersInterop::MappingRegistry) +# soapAry.sparse = true +# var = drv.echoFloatArray(soapAry) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end + + title = 'echoStruct' + dumpTitle(title) + begin + arg = SOAPStruct.new(1, 1.1, "a") + var = drv.echoStruct(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoStruct (nil members)' + dumpTitle(title) + begin + arg = SOAPStruct.new(nil, nil, nil) + var = drv.echoStruct(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoStructArray' + dumpTitle(title) + begin + s1 = SOAPStruct.new(1, 1.1, "a") + s2 = SOAPStruct.new(2, 2.2, "b") + s3 = SOAPStruct.new(3, 3.3, "c") + arg = SOAPStructArray[s1, s2, s3] + var = drv.echoStructArray(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoStructArray (anyType Array)' + dumpTitle(title) + begin + s1 = SOAPStruct.new(1, 1.1, "a") + s2 = SOAPStruct.new(2, 2.2, "b") + s3 = SOAPStruct.new(3, 3.3, "c") + arg = [s1, s2, s3] + var = drv.echoStructArray(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + +# title = 'echoStructArray (sparse)' +# dumpTitle(title) +# begin +# s1 = SOAPStruct.new(1, 1.1, "a") +# s2 = SOAPStruct.new(2, 2.2, "b") +# s3 = SOAPStruct.new(3, 3.3, "c") +# arg = [nil, s1, s2, s3] +# soapAry = SOAP::Mapping.ary2soap(arg, TypeNS, "SOAPStruct", SOAPBuildersInterop::MappingRegistry) +# soapAry.sparse = true +# var = drv.echoStructArray(soapAry) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end + + title = 'echoStructArray (multi-ref)' + dumpTitle(title) + begin + s1 = SOAPStruct.new(1, 1.1, "a") + s2 = SOAPStruct.new(2, 2.2, "b") + arg = SOAPStructArray[s1, s1, s2] + var = drv.echoStructArray(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoStructArray (multi-ref: elem1 == elem2)' + dumpTitle(title) + begin + s1 = SOAPStruct.new(1, 1.1, "a") + s2 = SOAPStruct.new(2, 2.2, "b") + arg = SOAPStructArray[s1, s1, s2] + var = drv.echoStructArray(arg) + dumpNormal(title, getIdObj(var[0]), getIdObj(var[1])) + rescue Exception + dumpException(title) + end + + title = 'echoStructArray (anyType Array, multi-ref: elem2 == elem3)' + dumpTitle(title) + begin + s1 = SOAPStruct.new(1, 1.1, "a") + s2 = SOAPStruct.new(2, 2.2, "b") + arg = [s1, s2, s2] + var = drv.echoStructArray(arg) + dumpNormal(title, getIdObj(var[1]), getIdObj(var[2])) + rescue Exception + dumpException(title) + end + +# title = 'echoStructArray (sparse, multi-ref)' +# dumpTitle(title) +# begin +# s1 = SOAPStruct.new(1, 1.1, "a") +# s2 = SOAPStruct.new(2, 2.2, "b") +# arg = [nil, s1, nil, nil, s2, nil, s2] +# soapAry = SOAP::Mapping.ary2soap(arg, TypeNS, "SOAPStruct", SOAPBuildersInterop::MappingRegistry) +# soapAry.sparse = true +# var = drv.echoStructArray(soapAry) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end + +# title = 'echoStructArray (sparse, multi-ref: elem5 == elem7)' +# dumpTitle(title) +# begin +# s1 = SOAPStruct.new(1, 1.1, "a") +# s2 = SOAPStruct.new(2, 2.2, "b") +# arg = [nil, s1, nil, nil, s2, nil, s2] +# soapAry = SOAP::Mapping.ary2soap(arg, TypeNS, "SOAPStruct", SOAPBuildersInterop::MappingRegistry) +# soapAry.sparse = true +# var = drv.echoStructArray(soapAry) +# dumpNormal(title, getIdObj(var[4]), getIdObj(var[6])) +# rescue Exception +# dumpException(title) +# end + + title = 'echoStructArray (multi-ref: varString of elem1 == varString of elem2)' + dumpTitle(title) + begin + str1 = "a" + str2 = "a" + s1 = SOAPStruct.new(1, 1.1, str1) + s2 = SOAPStruct.new(2, 2.2, str1) + s3 = SOAPStruct.new(3, 3.3, str2) + arg = SOAPStructArray[s1, s2, s3] + var = drv.echoStructArray(arg) + dumpNormal(title, getIdObj(var[0].varString), getIdObj(var[1].varString)) + rescue Exception + dumpException(title) + end + + title = 'echoStructArray (anyType Array, multi-ref: varString of elem2 == varString of elem3)' + dumpTitle(title) + begin + str1 = "b" + str2 = "b" + s1 = SOAPStruct.new(1, 1.1, str2) + s2 = SOAPStruct.new(2, 2.2, str1) + s3 = SOAPStruct.new(3, 3.3, str1) + arg = [s1, s2, s3] + var = drv.echoStructArray(arg) + dumpNormal(title, getIdObj(var[1].varString), getIdObj(var[2].varString)) + rescue Exception + dumpException(title) + end + +# title = 'echoStructArray (sparse, multi-ref: varString of elem5 == varString of elem7)' +# dumpTitle(title) +# begin +# str1 = "c" +# str2 = "c" +# s1 = SOAPStruct.new(1, 1.1, str2) +# s2 = SOAPStruct.new(2, 2.2, str1) +# s3 = SOAPStruct.new(3, 3.3, str1) +# arg = [nil, s1, nil, nil, s2, nil, s3] +# soapAry = SOAP::Mapping.ary2soap(arg, TypeNS, "SOAPStruct", SOAPBuildersInterop::MappingRegistry) +# soapAry.sparse = true +# var = drv.echoStructArray(soapAry) +# dumpNormal(title, getIdObj(var[4].varString), getIdObj(var[6].varString)) +# rescue Exception +# dumpException(title) +# end + +# title = 'echoStructArray (2D Array)' +# dumpTitle(title) +# begin +# s1 = SOAPStruct.new(1, 1.1, "a") +# s2 = SOAPStruct.new(2, 2.2, "b") +# s3 = SOAPStruct.new(3, 3.3, "c") +# arg = [ +# [s1, nil, s2], +# [nil, s2, s3], +# ] +# md = SOAP::Mapping.ary2md(arg, 2, XSD::Namespace, XSD::AnyTypeLiteral, SOAPBuildersInterop::MappingRegistry) +# +# var = drv.echoStructArray(md) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end +# +# title = 'echoStructArray (2D Array, sparse)' +# dumpTitle(title) +# begin +# s1 = SOAPStruct.new(1, 1.1, "a") +# s2 = SOAPStruct.new(2, 2.2, "b") +# s3 = SOAPStruct.new(3, 3.3, "c") +# arg = [ +# [s1, nil, s2], +# [nil, s2, s3], +# ] +# md = SOAP::Mapping.ary2md(arg, 2, TypeNS, "SOAPStruct", SOAPBuildersInterop::MappingRegistry) +## md.sparse = true +# +# var = drv.echoStructArray(md) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end +# +# title = 'echoStructArray (anyType, 2D Array, sparse)' +# dumpTitle(title) +# begin +# s1 = SOAPStruct.new(1, 1.1, "a") +# s2 = SOAPStruct.new(2, 2.2, "b") +# s3 = SOAPStruct.new(3, 3.3, "c") +# arg = [ +# [s1, nil, s2], +# [nil, s2, s3], +# ] +# md = SOAP::Mapping.ary2md(arg, 2, XSD::Namespace, XSD::AnyTypeLiteral, SOAPBuildersInterop::MappingRegistry) +# md.sparse = true +# +# var = drv.echoStructArray(md) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end + + title = 'echoDate (now)' + dumpTitle(title) + begin + t = Time.now.gmtime + arg = DateTime.new(t.year, t.mon, t.mday, t.hour, t.min, t.sec) + var = drv.echoDate(arg) + dumpNormal(title, arg.to_s, var.to_s) + rescue Exception + dumpException(title) + end + + title = 'echoDate (before 1970: 1-01-01T00:00:00Z)' + dumpTitle(title) + begin + t = Time.now.gmtime + arg = DateTime.new(1, 1, 1, 0, 0, 0) + var = drv.echoDate(arg) + dumpNormal(title, arg.to_s, var.to_s) + rescue Exception + dumpException(title) + end + + title = 'echoDate (after 2038: 2038-12-31T00:00:00Z)' + dumpTitle(title) + begin + t = Time.now.gmtime + arg = DateTime.new(2038, 12, 31, 0, 0, 0) + var = drv.echoDate(arg) + dumpNormal(title, arg.to_s, var.to_s) + rescue Exception + dumpException(title) + end + + title = 'echoDate (negative: -10-01-01T00:00:00Z)' + dumpTitle(title) + begin + t = Time.now.gmtime + arg = DateTime.new(-10, 1, 1, 0, 0, 0) + var = drv.echoDate(arg) + dumpNormal(title, arg.to_s, var.to_s) + rescue Exception + dumpException(title) + end + + title = 'echoDate (time precision: msec)' + dumpTitle(title) + begin + arg = SOAP::SOAPDateTime.new('2001-06-16T18:13:40.012') + argDate = arg.data + var = drv.echoDate(arg) + dumpNormal(title, argDate, var) + rescue Exception + dumpException(title) + end + + title = 'echoDate (time precision: long)' + dumpTitle(title) + begin + arg = SOAP::SOAPDateTime.new('2001-06-16T18:13:40.0000000000123456789012345678900000000000') + argDate = arg.data + var = drv.echoDate(arg) + dumpNormal(title, argDate, var) + rescue Exception + dumpException(title) + end + + title = 'echoDate (positive TZ)' + dumpTitle(title) + begin + arg = SOAP::SOAPDateTime.new('2001-06-17T01:13:40+07:00') + argNormalized = DateTime.new(2001, 6, 16, 18, 13, 40) + var = drv.echoDate(arg) + dumpNormal(title, argNormalized, var) + rescue Exception + dumpException(title) + end + + title = 'echoDate (negative TZ)' + dumpTitle(title) + begin + arg = SOAP::SOAPDateTime.new('2001-06-16T18:13:40-07:00') + argNormalized = DateTime.new(2001, 6, 17, 1, 13, 40) + var = drv.echoDate(arg) + dumpNormal(title, argNormalized, var) + rescue Exception + dumpException(title) + end + + title = 'echoDate (+00:00 TZ)' + dumpTitle(title) + begin + arg = SOAP::SOAPDateTime.new('2001-06-17T01:13:40+00:00') + argNormalized = DateTime.new(2001, 6, 17, 1, 13, 40) + var = drv.echoDate(arg) + dumpNormal(title, argNormalized, var) + rescue Exception + dumpException(title) + end + + title = 'echoDate (-00:00 TZ)' + dumpTitle(title) + begin + arg = SOAP::SOAPDateTime.new('2001-06-17T01:13:40-00:00') + argNormalized = DateTime.new(2001, 6, 17, 1, 13, 40) + var = drv.echoDate(arg) + dumpNormal(title, argNormalized, var) + rescue Exception + dumpException(title) + end + + title = 'echoDate (min TZ)' + dumpTitle(title) + begin + arg = SOAP::SOAPDateTime.new('2001-06-16T00:00:01+00:01') + argNormalized = DateTime.new(2001, 6, 15, 23, 59, 1) + var = drv.echoDate(arg) + dumpNormal(title, argNormalized, var) + rescue Exception + dumpException(title) + end + + title = 'echoDate (year > 9999)' + dumpTitle(title) + begin + arg = SOAP::SOAPDateTime.new('10000-06-16T18:13:40-07:00') + argNormalized = DateTime.new(10000, 6, 17, 1, 13, 40) + var = drv.echoDate(arg) + dumpNormal(title, argNormalized, var) + rescue Exception + dumpException(title) + end + + title = 'echoDate (year < 0)' + dumpTitle(title) + begin + arg = SOAP::SOAPDateTime.new('-0001-06-16T18:13:40-07:00') + argNormalized = DateTime.new(0, 6, 17, 1, 13, 40) + var = drv.echoDate(arg) + dumpNormal(title, argNormalized, var) + rescue Exception + dumpException(title) + end + + title = 'echoDate (year == -4713)' + dumpTitle(title) + begin + arg = SOAP::SOAPDateTime.new('-4713-01-01T12:00:00') + argNormalized = DateTime.new(-4712, 1, 1, 12, 0, 0) + var = drv.echoDate(arg) + dumpNormal(title, argNormalized, var) + rescue Exception + dumpException(title) + end + + title = 'echoDate (year 0000: junk)' + dumpTitle(title) + begin + begin + arg = FakeDateTime.new("0000-05-18T16:52:20Z") + var = drv.echoDate(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoDate (year nn: junk)' + dumpTitle(title) + begin + begin + arg = FakeDateTime.new("05-05-18T16:52:20Z") + var = drv.echoDate(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoDate (no day part: junk)' + dumpTitle(title) + begin + begin + arg = FakeDateTime.new("2002-05T16:52:20Z") + var = drv.echoDate(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoDate (no sec part: junk)' + dumpTitle(title) + begin + begin + arg = FakeDateTime.new("2002-05-18T16:52Z") + var = drv.echoDate(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoDate (empty: junk)' + dumpTitle(title) + begin + begin + arg = FakeDateTime.new("") + var = drv.echoDate(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoBase64 (xsd:base64Binary)' + dumpTitle(title) + begin + str = "Hello (ܸJapanese) ˤ" + arg = SOAP::SOAPBase64.new(str) + arg.as_xsd # Force xsd:base64Binary instead of soap-enc:base64 + var = drv.echoBase64(arg) + dumpNormal(title, str, var) + rescue Exception + dumpException(title) + end + + title = 'echoBase64 (xsd:base64Binary, empty)' + dumpTitle(title) + begin + str = "" + arg = SOAP::SOAPBase64.new(str) + arg.as_xsd # Force xsd:base64Binary instead of soap-enc:base64 + var = drv.echoBase64(arg) + dumpNormal(title, str, var) + rescue Exception + dumpException(title) + end + + title = 'echoBase64 (SOAP-ENC:base64)' + dumpTitle(title) + begin + str = "Hello (ܸJapanese) ˤ" + arg = SOAP::SOAPBase64.new(str) + var = drv.echoBase64(arg) + dumpNormal(title, str, var) + rescue Exception + dumpException(title) + end + + title = 'echoBase64 (\0)' + dumpTitle(title) + begin + str = "\0" + arg = SOAP::SOAPBase64.new(str) + var = drv.echoBase64(arg) + dumpNormal(title, str, var) + rescue Exception + dumpException(title) + end + + title = 'echoBase64 (\0a\0)' + dumpTitle(title) + begin + str = "a\0b\0\0c\0\0\0" + arg = SOAP::SOAPBase64.new(str) + var = drv.echoBase64(arg) + dumpNormal(title, str, var) + rescue Exception + dumpException(title) + end + + title = 'echoBase64 (-: junk)' + dumpTitle(title) + begin + begin + arg = SOAP::SOAPBase64.new("dummy") + arg.instance_eval { @data = '-' } + var = drv.echoBase64(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoHexBinary' + dumpTitle(title) + begin + str = "Hello (ܸJapanese) ˤ" + arg = SOAP::SOAPHexBinary.new(str) + var = drv.echoHexBinary(arg) + dumpNormal(title, str, var) + rescue Exception + dumpException(title) + end + + title = 'echoHexBinary(empty)' + dumpTitle(title) + begin + str = "" + arg = SOAP::SOAPHexBinary.new(str) + var = drv.echoHexBinary(arg) + dumpNormal(title, str, var) + rescue Exception + dumpException(title) + end + + title = 'echoHexBinary(\0)' + dumpTitle(title) + begin + str = "\0" + arg = SOAP::SOAPHexBinary.new(str) + var = drv.echoHexBinary(arg) + dumpNormal(title, str, var) + rescue Exception + dumpException(title) + end + + title = 'echoHexBinary(\0a\0)' + dumpTitle(title) + begin + str = "a\0b\0\0c\0\0\0" + arg = SOAP::SOAPHexBinary.new(str) + var = drv.echoHexBinary(arg) + dumpNormal(title, str, var) + rescue Exception + dumpException(title) + end + + title = 'echoHexBinary(lower case)' + dumpTitle(title) + begin + str = "lower case" + arg = SOAP::SOAPHexBinary.new + arg.set_encoded((str.unpack("H*")[0]).tr('A-F', 'a-f')) + var = drv.echoHexBinary(arg) + dumpNormal(title, str, var) + rescue Exception + dumpException(title) + end + + title = 'echoHexBinary (0FG7: junk)' + dumpTitle(title) + begin + begin + arg = SOAP::SOAPHexBinary.new("dummy") + arg.instance_eval { @data = '0FG7' } + var = drv.echoHexBinary(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoBoolean (true)' + dumpTitle(title) + begin + arg = true + var = drv.echoBoolean(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoBoolean (false)' + dumpTitle(title) + begin + arg = false + var = drv.echoBoolean(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoBoolean (junk)' + dumpTitle(title) + begin + begin + arg = SOAP::SOAPBoolean.new(true) + arg.instance_eval { @data = 'junk' } + var = drv.echoBoolean(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoDecimal (123456)' + dumpTitle(title) + begin + arg = "123456789012345678" + var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg)) + normalized = arg + dumpNormal(title, normalized, var) + rescue Exception + dumpException(title) + end + + title = 'echoDecimal (+0.123)' + dumpTitle(title) + begin + arg = "+0.12345678901234567" + var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg)) + normalized = arg.sub(/0$/, '').sub(/^\+/, '') + dumpNormal(title, normalized, var) + rescue Exception + dumpException(title) + end + + title = 'echoDecimal (.00000123)' + dumpTitle(title) + begin + arg = ".00000123456789012" + var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg)) + normalized = '0' << arg.sub(/0$/, '') + dumpNormal(title, normalized, var) + rescue Exception + dumpException(title) + end + + title = 'echoDecimal (-.00000123)' + dumpTitle(title) + begin + arg = "-.00000123456789012" + var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg)) + normalized = '-0' << arg.sub(/0$/, '').sub(/-/, '') + dumpNormal(title, normalized, var) + rescue Exception + dumpException(title) + end + + title = 'echoDecimal (-123.456)' + dumpTitle(title) + begin + arg = "-123456789012345.008" + var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg)) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoDecimal (-123.)' + dumpTitle(title) + begin + arg = "-12345678901234567." + normalized = arg.sub(/\.$/, '') + var = drv.echoDecimal(SOAP::SOAPDecimal.new(arg)) + dumpNormal(title, normalized, var) + rescue Exception + dumpException(title) + end + + title = 'echoDecimal (0.000a: junk)' + dumpTitle(title) + begin + begin + arg = FakeDecimal.new("0.0000000000000000a") + var = drv.echoDecimal(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoDecimal (00a.0001: junk)' + dumpTitle(title) + begin + begin + arg = FakeDecimal.new("00a.000000000000001") + var = drv.echoDecimal(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoDecimal (+-5: junk)' + dumpTitle(title) + begin + begin + arg = FakeDecimal.new("+-5") + var = drv.echoDecimal(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + + title = 'echoDecimal (5_0: junk)' + dumpTitle(title) + begin + begin + arg = FakeDecimal.new("5_0") + var = drv.echoDecimal(arg) + dumpNormal(title, 'Fault', 'No error occurred.') + rescue SOAP::RPC::ServerException, SOAP::FaultError + dumpNormal(title, true, true) + end + rescue Exception + dumpException(title) + end + +if false # unless $noEchoMap + + title = 'echoMap' + dumpTitle(title) + begin + arg = { "a" => 1, "b" => 2 } + var = drv.echoMap(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoMap (boolean, base64, nil, float)' + dumpTitle(title) + begin + arg = { true => "\0", "\0" => nil, nil => 0.0001, 0.0001 => false } + var = drv.echoMap(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoMap (multibyte char)' + dumpTitle(title) + begin + arg = { "Hello (ܸJapanese) ˤ" => 1, 1 => "Hello (ܸJapanese) ˤ" } + var = drv.echoMap(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoMap (Struct)' + dumpTitle(title) + begin + obj = SOAPStruct.new(1, 1.1, "a") + arg = { 1 => obj, 2 => obj } + var = drv.echoMap(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoMap (multi-ref: value for key "a" == value for key "b")' + dumpTitle(title) + begin + value = "c" + arg = { "a" => value, "b" => value } + var = drv.echoMap(arg) + dumpNormal(title, getIdObj(var["a"]), getIdObj(var["b"])) + rescue Exception + dumpException(title) + end + + title = 'echoMap (Struct, multi-ref: varString of a key == varString of a value)' + dumpTitle(title) + begin + str = "" + obj = SOAPStruct.new(1, 1.1, str) + arg = { obj => "1", "1" => obj } + var = drv.echoMap(arg) + dumpNormal(title, getIdObj(var.index("1").varString), getIdObj(var.fetch("1").varString)) + rescue Exception + dumpException(title) + end + + title = 'echoMapArray' + dumpTitle(title) + begin + map1 = { "a" => 1, "b" => 2 } + map2 = { "a" => 1, "b" => 2 } + map3 = { "a" => 1, "b" => 2 } + arg = [map1, map2, map3] + var = drv.echoMapArray(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoMapArray (boolean, base64, nil, float)' + dumpTitle(title) + begin + map1 = { true => "\0", "\0" => nil, nil => 0.0001, 0.0001 => false } + map2 = { true => "\0", "\0" => nil, nil => 0.0001, 0.0001 => false } + map3 = { true => "\0", "\0" => nil, nil => 0.0001, 0.0001 => false } + arg = [map1, map2, map3] + var = drv.echoMapArray(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + +# title = 'echoMapArray (sparse)' +# dumpTitle(title) +# begin +# map1 = { "a" => 1, "b" => 2 } +# map2 = { "a" => 1, "b" => 2 } +# map3 = { "a" => 1, "b" => 2 } +# arg = [nil, nil, map1, nil, map2, nil, map3, nil, nil] +# soapAry = SOAP::Mapping.ary2soap(arg, ApacheNS, "Map", SOAPBuildersInterop::MappingRegistry) +# soapAry.sparse = true +# var = drv.echoMapArray(soapAry) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end + + title = 'echoMapArray (multibyte char)' + dumpTitle(title) + begin + map1 = { "Hello (ܸJapanese) ˤ" => 1, 1 => "Hello (ܸJapanese) ˤ" } + map2 = { "Hello (ܸJapanese) ˤ" => 1, 1 => "Hello (ܸJapanese) ˤ" } + map3 = { "Hello (ܸJapanese) ˤ" => 1, 1 => "Hello (ܸJapanese) ˤ" } + arg = [map1, map2, map3] + var = drv.echoMapArray(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + +# title = 'echoMapArray (sparse, multi-ref)' +# dumpTitle(title) +# begin +# map1 = { "a" => 1, "b" => 2 } +# map2 = { "a" => 1, "b" => 2 } +# arg = [nil, nil, map1, nil, map2, nil, map1, nil, nil] +# soapAry = SOAP::Mapping.ary2soap(arg, ApacheNS, "Map", SOAPBuildersInterop::MappingRegistry) +# soapAry.sparse = true +# var = drv.echoMapArray(soapAry) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end + + title = 'echoMapArray (multi-ref: elem1 == elem2)' + dumpTitle(title) + begin + map1 = { "a" => 1, "b" => 2 } + map2 = { "a" => 1, "b" => 2 } + arg = [map1, map1, map2] + var = drv.echoMapArray(arg) + dumpNormal(title, getIdObj(var[0]), getIdObj(var[1])) + rescue Exception + dumpException(title) + end +end + +end + + +### +## Invoke methods. +# +def doTestGroupB(drv) + setWireDumpLogFile('_GroupB') + drv.wiredump_dev = $wireDumpDev +# drv.wiredump_filebase = getWireDumpLogFileBase('_GroupB') + + drv.mapping_registry = SOAPBuildersInterop::MappingRegistry + + title = 'echoStructAsSimpleTypes' + dumpTitle(title) + begin + arg = SOAPStruct.new(1, 1.1, "a") + ret, out1, out2 = drv.echoStructAsSimpleTypes(arg) + var = SOAPStruct.new(out1, out2, ret) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoStructAsSimpleTypes (nil)' + dumpTitle(title) + begin + arg = SOAPStruct.new(nil, nil, nil) + ret, out1, out2 = drv.echoStructAsSimpleTypes(arg) + var = SOAPStruct.new(out1, out2, ret) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoSimpleTypesAsStruct' + dumpTitle(title) + begin + arg = SOAPStruct.new(1, 1.1, "a") + var = drv.echoSimpleTypesAsStruct(arg.varString, arg.varInt, arg.varFloat) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoSimpleTypesAsStruct (nil)' + dumpTitle(title) + begin + arg = SOAPStruct.new(nil, nil, nil) + var = drv.echoSimpleTypesAsStruct(arg.varString, arg.varInt, arg.varFloat) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echo2DStringArray' + dumpTitle(title) + begin + +# arg = SOAP::SOAPArray.new(SOAP::ValueArrayName, 2, XSD::XSDString::Type) +# arg[0, 0] = obj2soap('r0c0') +# arg[1, 0] = obj2soap('r1c0') +# arg[2, 0] = obj2soap('r2c0') +# arg[0, 1] = obj2soap('r0c1') +# arg[1, 1] = obj2soap('r1c1') +# arg[2, 1] = obj2soap('r2c1') +# arg[0, 2] = obj2soap('r0c2') +# arg[1, 2] = obj2soap('r1c2') +# arg[2, 2] = obj2soap('r2c2') + + arg = SOAP::SOAPArray.new(XSD::QName.new('http://soapinterop.org/xsd', 'ArrayOfString2D'), 2, XSD::XSDString::Type) + arg.size = [3, 3] + arg.size_fixed = true + arg.add(SOAP::Mapping.obj2soap('r0c0', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r1c0', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r2c0', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r0c1', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r1c1', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r2c1', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r0c2', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r1c2', SOAPBuildersInterop::MappingRegistry)) + arg.add(SOAP::Mapping.obj2soap('r2c2', SOAPBuildersInterop::MappingRegistry)) + argNormalized = [ + ['r0c0', 'r1c0', 'r2c0'], + ['r0c1', 'r1c1', 'r2c1'], + ['r0c2', 'r1c2', 'r2c2'], + ] + + var = drv.echo2DStringArray(arg) + dumpNormal(title, argNormalized, var) + rescue Exception + dumpException(title) + end + + title = 'echo2DStringArray (anyType array)' + dumpTitle(title) + begin + # ary2md converts Arry ((of Array)...) into M-D anyType Array + arg = [ + ['r0c0', 'r0c1', 'r0c2'], + ['r1c0', 'r1c1', 'r1c2'], + ['r2c0', 'r0c1', 'r2c2'], + ] + + paramArg = SOAP::Mapping.ary2md(arg, 2, XSD::Namespace, XSD::AnyTypeLiteral, SOAPBuildersInterop::MappingRegistry) + paramArg.type = XSD::QName.new('http://soapinterop.org/xsd', 'ArrayOfString2D') + var = drv.echo2DStringArray(paramArg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + +# title = 'echo2DStringArray (sparse)' +# dumpTitle(title) +# begin +# # ary2md converts Arry ((of Array)...) into M-D anyType Array +# arg = [ +# ['r0c0', nil, 'r0c2'], +# [nil, 'r1c1', 'r1c2'], +# ] +# md = SOAP::Mapping.ary2md(arg, 2, XSD::Namespace, XSD::StringLiteral, SOAPBuildersInterop::MappingRegistry) +# md.sparse = true +# +# var = drv.echo2DStringArray(md) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end + +# title = 'echo2DStringArray (anyType, sparse)' +# dumpTitle(title) +# begin +# # ary2md converts Arry ((of Array)...) into M-D anyType Array +# arg = [ +# ['r0c0', nil, 'r0c2'], +# [nil, 'r1c1', 'r1c2'], +# ] +# md = SOAP::Mapping.ary2md(arg, 2, XSD::Namespace, XSD::StringLiteral, SOAPBuildersInterop::MappingRegistry) +# md.sparse = true +# +# var = drv.echo2DStringArray(md) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end + + title = 'echo2DStringArray (multi-ref)' + dumpTitle(title) + begin + arg = SOAP::SOAPArray.new(XSD::QName.new('http://soapinterop.org/xsd', 'ArrayOfString2D'), 2, XSD::XSDString::Type) + arg.size = [3, 3] + arg.size_fixed = true + + item = 'item' + arg.add('r0c0') + arg.add('r1c0') + arg.add(item) + arg.add('r0c1') + arg.add('r1c1') + arg.add('r2c1') + arg.add(item) + arg.add('r1c2') + arg.add('r2c2') + argNormalized = [ + ['r0c0', 'r1c0', 'item'], + ['r0c1', 'r1c1', 'r2c1'], + ['item', 'r1c2', 'r2c2'], + ] + + var = drv.echo2DStringArray(arg) + dumpNormal(title, argNormalized, var) + rescue Exception + dumpException(title) + end + + title = 'echo2DStringArray (multi-ref: ele[2, 0] == ele[0, 2])' + dumpTitle(title) + begin + arg = SOAP::SOAPArray.new(XSD::QName.new('http://soapinterop.org/xsd', 'ArrayOfString2D'), 2, XSD::XSDString::Type) + arg.size = [3, 3] + arg.size_fixed = true + + item = 'item' + arg.add('r0c0') + arg.add('r1c0') + arg.add(item) + arg.add('r0c1') + arg.add('r1c1') + arg.add('r2c1') + arg.add(item) + arg.add('r1c2') + arg.add('r2c2') + + var = drv.echo2DStringArray(arg) + dumpNormal(title, getIdObj(var[2][0]), getIdObj(var[0][2])) + rescue Exception + dumpException(title) + end + +# title = 'echo2DStringArray (sparse, multi-ref)' +# dumpTitle(title) +# begin +# # ary2md converts Arry ((of Array)...) into M-D anyType Array +# str = "BANG!" +# arg = [ +# ['r0c0', nil, str ], +# [nil, str, 'r1c2'], +# ] +# md = SOAP::Mapping.ary2md(arg, 2, XSD::Namespace, XSD::StringLiteral, SOAPBuildersInterop::MappingRegistry) +# md.sparse = true +# +# var = drv.echo2DStringArray(md) +# dumpNormal(title, arg, var) +# rescue Exception +# dumpException(title) +# end + + title = 'echoNestedStruct' + dumpTitle(title) + begin + arg = SOAPStructStruct.new(1, 1.1, "a", + SOAPStruct.new(2, 2.2, "b") + ) + var = drv.echoNestedStruct(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoNestedStruct (nil)' + dumpTitle(title) + begin + arg = SOAPStructStruct.new(nil, nil, nil, + SOAPStruct.new(nil, nil, nil) + ) + var = drv.echoNestedStruct(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoNestedStruct (multi-ref: varString of StructStruct == varString of Struct)' + dumpTitle(title) + begin + str1 = "" + arg = SOAPStructStruct.new(1, 1.1, str1, + SOAPStruct.new(2, 2.2, str1) + ) + var = drv.echoNestedStruct(arg) + dumpNormal(title, getIdObj(var.varString), getIdObj(var.varStruct.varString)) + rescue Exception + dumpException(title) + end + + title = 'echoNestedArray' + dumpTitle(title) + begin + arg = SOAPArrayStruct.new(1, 1.1, "a", StringArray["2", "2.2", "b"]) + var = drv.echoNestedArray(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoNestedArray (anyType array)' + dumpTitle(title) + begin + arg = SOAPArrayStruct.new(1, 1.1, "a", ["2", "2.2", "b"]) + var = drv.echoNestedArray(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoNestedArray (multi-ref)' + dumpTitle(title) + begin + str = "" + arg = SOAPArrayStruct.new(1, 1.1, str, StringArray["2", str, "b"]) + var = drv.echoNestedArray(arg) + dumpNormal(title, arg, var) + rescue Exception + dumpException(title) + end + + title = 'echoNestedArray (multi-ref: varString == varArray[1])' + dumpTitle(title) + begin + str = "" + arg = SOAPArrayStruct.new(1, 1.1, str, StringArray["2", str, "b"]) + var = drv.echoNestedArray(arg) + dumpNormal(title, getIdObj(var.varString), getIdObj(var.varArray[1])) + rescue Exception + dumpException(title) + end + +# title = 'echoNestedArray (sparse, multi-ref)' +# dumpTitle(title) +# begin +# str = "!" +# subAry = [nil, nil, str, nil, str, nil] +# ary = SOAP::Mapping.ary2soap(subAry, XSD::Namespace, XSD::StringLiteral, SOAPBuildersInterop::MappingRegistry) +# ary.sparse = true +# arg = SOAPArrayStruct.new(1, 1.1, str, ary) +# argNormalized = SOAPArrayStruct.new(1, 1.1, str, subAry) +# var = drv.echoNestedArray(arg) +# dumpNormal(title, argNormalized, var) +# rescue Exception +# dumpException(title) +# end + +end diff --git a/test/interopR2/clientCapeConnect.rb b/test/interopR2/clientCapeConnect.rb new file mode 100644 index 0000000..32a9147 --- /dev/null +++ b/test/interopR2/clientCapeConnect.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +$serverName = 'CapeConnect' + +$server = 'http://interop.capeclear.com/ccx/soapbuilders-round2' +$noEchoMap = true + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDefBase(drvBase) + +#drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +#methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +#doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientDelphi.rb b/test/interopR2/clientDelphi.rb new file mode 100644 index 0000000..344b098 --- /dev/null +++ b/test/interopR2/clientDelphi.rb @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +$serverName = 'Delphi' + +$serverBase = 'http://soap-server.borland.com/WebServices/Interop/cgi-bin/InteropService.exe/soap/InteropTestPortType' +$serverGroupB = 'http://soap-server.borland.com/WebServices/Interop/cgi-bin/InteropGroupB.exe/soap/InteropTestPortTypeB' +$noEchoMap = true + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientEasySoap.rb b/test/interopR2/clientEasySoap.rb new file mode 100644 index 0000000..579decb --- /dev/null +++ b/test/interopR2/clientEasySoap.rb @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +$serverName = 'EasySoap++' + +$server = 'http://easysoap.sourceforge.net/cgi-bin/interopserver' + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDef(drv) + +doTestBase(drv) +doTestGroupB(drv) +submitTestResult diff --git a/test/interopR2/clientFrontier.rb b/test/interopR2/clientFrontier.rb new file mode 100644 index 0000000..ce56921 --- /dev/null +++ b/test/interopR2/clientFrontier.rb @@ -0,0 +1,25 @@ +#!/usr/bin/env ruby + +$serverName = 'Frontier' + +$serverBase = 'http://www.soapware.org/xmethodsInterop' + +#$wsdlBase = 'http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInterop/SOAP4R_SOAPBuildersInteropTest_R2base.wsdl' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +#drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +#methodDefGroupB(drvGroupB) + +=begin +require 'soap/wsdlDriver' +drvBase = SOAP::WSDLDriverFactory.new($wsdlBase).create_rpc_driver +drvBase.endpoint_url = $serverBase +=end + +doTestBase(drvBase) +#doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientGLUE.rb b/test/interopR2/clientGLUE.rb new file mode 100644 index 0000000..f32cf46 --- /dev/null +++ b/test/interopR2/clientGLUE.rb @@ -0,0 +1,32 @@ +#!/usr/bin/env ruby + +$serverName = 'GLUE' + +$serverBase = 'http://www.themindelectric.net:8005/glue/round2' +$serverGroupB = 'http://www.themindelectric.net:8005/glue/round2B' + +$wsdlBase = 'http://www.themindelectric.net:8005/glue/round2.wsdl' +$wsdlGroupB = 'http://www.themindelectric.net:8005/glue/round2B.wsdl' + +$noEchoMap = true + +require 'clientBase' + +=begin +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) +=end + +require 'soap/wsdlDriver' +drvBase = SOAP::WSDLDriverFactory.new($wsdlBase).create_rpc_driver +drvBase.endpoint_url = $serverBase +drvBase.wiredump_dev = STDOUT +drvGroupB = SOAP::WSDLDriverFactory.new($wsdlGroupB).create_rpc_driver +drvGroupB.endpoint_url = $serverGroupB + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientHP.rb b/test/interopR2/clientHP.rb new file mode 100644 index 0000000..ca018a5 --- /dev/null +++ b/test/interopR2/clientHP.rb @@ -0,0 +1,13 @@ +#!/usr/bin/env ruby + +$serverName = 'HPSOAP' +$server = 'http://soap.bluestone.com/hpws/soap/EchoService' + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) + +methodDef(drv) + +doTest(drv) +submitTestResult diff --git a/test/interopR2/clientJAX-RPC.rb b/test/interopR2/clientJAX-RPC.rb new file mode 100644 index 0000000..471f932 --- /dev/null +++ b/test/interopR2/clientJAX-RPC.rb @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +$serverName = 'JAX-RPC' + +$serverBase = 'http://soapinterop.java.sun.com:80/round2/base' +$serverGroupB = 'http://soapinterop.java.sun.com:80/round2/groupb' +$noEchoMap = true + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDef( drvBase ) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB( drvGroupB ) + +doTestBase( drvBase ) +doTestGroupB( drvGroupB ) +submitTestResult diff --git a/test/interopR2/clientJSOAP.rb b/test/interopR2/clientJSOAP.rb new file mode 100644 index 0000000..69ca858 --- /dev/null +++ b/test/interopR2/clientJSOAP.rb @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +$serverName = 'SpheonJSOAP' +$server = 'http://soap.fmui.de/RPC' + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) + +methodDef(drv) + +doTestBase(drv) +doTestGroupB(drv) +submitTestResult diff --git a/test/interopR2/clientKafkaXSLT.rb b/test/interopR2/clientKafkaXSLT.rb new file mode 100644 index 0000000..0980350 --- /dev/null +++ b/test/interopR2/clientKafkaXSLT.rb @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +$serverName = 'KafkaXSLTSOAP' + +$server = 'http://www.thoughtpost.com/services/interop.asmx' +$noEchoMap = true + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDef(drv) + +doTestBase(drv) +doTestGroupB(drv) +submitTestResult diff --git a/test/interopR2/clientMSSOAPToolkit2.0.rb b/test/interopR2/clientMSSOAPToolkit2.0.rb new file mode 100644 index 0000000..3c3e323 --- /dev/null +++ b/test/interopR2/clientMSSOAPToolkit2.0.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +$serverName = 'MicrosoftSoapToolkitV2' +$serverBase = 'http://mssoapinterop.org/stk/InteropB.wsdl' +$serverGroupB = 'http://mssoapinterop.org/stk/InteropBtyped.wsdl' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientMSSOAPToolkit3.0.rb b/test/interopR2/clientMSSOAPToolkit3.0.rb new file mode 100644 index 0000000..a878edd --- /dev/null +++ b/test/interopR2/clientMSSOAPToolkit3.0.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +$serverName = 'MicrosoftSoapToolkit3.0' +$serverBase = 'http://mssoapinterop.org/stkV3/InteropTyped.wsdl' +$serverGroupB = 'http://mssoapinterop.org/stkV3/InteropBtyped.wsdl' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientNuSOAP.rb b/test/interopR2/clientNuSOAP.rb new file mode 100644 index 0000000..51fa2fd --- /dev/null +++ b/test/interopR2/clientNuSOAP.rb @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +$serverName = 'NuSOAP' + +$serverBase = 'http://dietrich.ganx4.com/nusoap/testbed/round2_base_server.php' +$serverGroupB = 'http://dietrich.ganx4.com/nusoap/testbed/round2_groupb_server.php' +$noEchoMap = true + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientNuWave.rb b/test/interopR2/clientNuWave.rb new file mode 100644 index 0000000..934bf97 --- /dev/null +++ b/test/interopR2/clientNuWave.rb @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +$serverName = 'NuWave' + +$server = ' http://interop.nuwave-tech.com:7070/interop/base.wsdl' +$noEchoMap = true + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDef(drv) + +doTestBase(drv) +#doTestGroupB(drv) +submitTestResult diff --git a/test/interopR2/clientOpenLink.rb b/test/interopR2/clientOpenLink.rb new file mode 100644 index 0000000..210d2da --- /dev/null +++ b/test/interopR2/clientOpenLink.rb @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +$serverName = 'OpenLink' + +$server = 'http://demo.openlinksw.com:8890/Interop' +$noEchoMap = true + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDef(drv) + +doTestBase(drv) +doTestGroupB(drv) +submitTestResult diff --git a/test/interopR2/clientOracle.rb b/test/interopR2/clientOracle.rb new file mode 100644 index 0000000..273f51f --- /dev/null +++ b/test/interopR2/clientOracle.rb @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +$serverName = 'Oracle' + +$server = 'http://ws-interop.oracle.com/soapbuilder/r2/InteropTest' +$noEchoMap = true + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDef(drv) + +doTestBase(drv) +#doTestGroupB(drv) +submitTestResult diff --git a/test/interopR2/clientPEAR.rb b/test/interopR2/clientPEAR.rb new file mode 100644 index 0000000..9cb612e --- /dev/null +++ b/test/interopR2/clientPEAR.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +$serverName = 'PEAR' + +$server = 'http://www.caraveo.com/soap_interop/server_round2.php' +$noEchoMap = true + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientPhalanx.rb b/test/interopR2/clientPhalanx.rb new file mode 100644 index 0000000..f1e0ddc --- /dev/null +++ b/test/interopR2/clientPhalanx.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +$serverName = 'Phalanx' + +$serverBase = 'http://www.phalanxsys.com/ilabA/typed/target.asp' +$serverGroupB = 'http://www.phalanxsys.com/ilabB/typed/target.asp' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientSIMACE.rb b/test/interopR2/clientSIMACE.rb new file mode 100644 index 0000000..41ab1de --- /dev/null +++ b/test/interopR2/clientSIMACE.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +$serverName = 'SIM' +$serverBase = 'http://soapinterop.simdb.com/round2' +$serverGroupB = 'http://soapinterop.simdb.com/round2B' +$noEchoMap = true + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientSOAP4R.rb b/test/interopR2/clientSOAP4R.rb new file mode 100644 index 0000000..65001cd --- /dev/null +++ b/test/interopR2/clientSOAP4R.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +$serverName = 'SOAP4R' + +$server = 'http://dev.ctor.org/soapsrv' +#$server = 'http://rrr.jin.gr.jp/soapsrv' +#$server = 'http://dev.ctor.org/soapsrv' +#$server = 'http://localhost:10080' +#require 'xsd/datatypes1999' + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDef(drv) + +doTestBase(drv) +doTestGroupB(drv) +#submitTestResult diff --git a/test/interopR2/clientSOAP__Lite.rb b/test/interopR2/clientSOAP__Lite.rb new file mode 100644 index 0000000..85e636c --- /dev/null +++ b/test/interopR2/clientSOAP__Lite.rb @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +$serverName = 'SOAP::Lite' + +$server = 'http://services.soaplite.com/interop.cgi' + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDef(drv) + +doTestBase(drv) +doTestGroupB(drv) +submitTestResult diff --git a/test/interopR2/clientSQLData.rb b/test/interopR2/clientSQLData.rb new file mode 100644 index 0000000..1b414e4 --- /dev/null +++ b/test/interopR2/clientSQLData.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +$serverName = 'SQLDataSOAPServer' +$serverBase = 'http://soapclient.com/interop/sqldatainterop.wsdl' +$serverGroupB = 'http://soapclient.com/interop/InteropB.wsdl' +$noEchoMap = true + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientSilverStream.rb b/test/interopR2/clientSilverStream.rb new file mode 100644 index 0000000..77a7a7f --- /dev/null +++ b/test/interopR2/clientSilverStream.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +$serverName = 'SilverStream' + +$server = 'http://explorer.ne.mediaone.net/app/interop/interop' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDefBase(drvBase) + +#drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +#methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +#doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientSpray2001.rb b/test/interopR2/clientSpray2001.rb new file mode 100644 index 0000000..8b6de9c --- /dev/null +++ b/test/interopR2/clientSpray2001.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +$serverName = 'Spray2001' +$serverBase = 'http://www.dolphinharbor.org/services/interop2001' +$serverGroupB = 'http://www.dolphinharbor.org/services/interopB2001' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDef(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientSun.rb b/test/interopR2/clientSun.rb new file mode 100644 index 0000000..f447e8a --- /dev/null +++ b/test/interopR2/clientSun.rb @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +$serverName = 'SunMicrosystems' + +$serverBase = 'http://soapinterop.java.sun.com:80/round2/base' +$serverGroupB = 'http://soapinterop.java.sun.com:80/round2/groupb' +$noEchoMap = true + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientVWOpentalkSoap.rb b/test/interopR2/clientVWOpentalkSoap.rb new file mode 100644 index 0000000..83a94aa --- /dev/null +++ b/test/interopR2/clientVWOpentalkSoap.rb @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +$serverName = 'VWOpentalkSoap' + +$server = 'http://www.cincomsmalltalk.com/soap/interop' +$serverGroupB = 'http://www.cincomsmalltalk.com/r2groupb/interop' +$noEchoMap = true + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDefBase(drv) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drv) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientWASP.rb b/test/interopR2/clientWASP.rb new file mode 100644 index 0000000..d8fe389 --- /dev/null +++ b/test/interopR2/clientWASP.rb @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +$serverName = 'WASPforJava' + +$serverBase = 'http://soap.systinet.net:6060/InteropService/' +$serverGroupB = 'http://soap.systinet.net:6060/InteropBService/' +$noEchoMap = true + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientWASPC.rb b/test/interopR2/clientWASPC.rb new file mode 100644 index 0000000..65aaa89 --- /dev/null +++ b/test/interopR2/clientWASPC.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +$serverName = 'WASPforC++' + +$serverBase = 'http://soap.systinet.net:6070/InteropService/' +$serverGroupB = 'http://soap.systinet.net:6070/InteropBService/' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientWebMethods.rb b/test/interopR2/clientWebMethods.rb new file mode 100644 index 0000000..ceee312 --- /dev/null +++ b/test/interopR2/clientWebMethods.rb @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +$serverName = 'webMethods' + +$server = 'http://ewsdemo.webMethods.com:80/soap/rpc' +$noEchoMap = true + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDef(drv) + +doTestBase(drv) +doTestGroupB(drv) +submitTestResult diff --git a/test/interopR2/clientWhiteMesa.rb b/test/interopR2/clientWhiteMesa.rb new file mode 100644 index 0000000..544278d --- /dev/null +++ b/test/interopR2/clientWhiteMesa.rb @@ -0,0 +1,28 @@ +#!/usr/bin/env ruby + +$serverName = 'WhiteMesaSOAPServer' +$serverBase = 'http://www.whitemesa.net/interop/std' +$serverGroupB = 'http://www.whitemesa.net/interop/std/groupB' + +$wsdlBase = 'http://www.whitemesa.net/wsdl/std/interop.wsdl' +$wsdlGroupB = 'http://www.whitemesa.net/wsdl/std/interopB.wsdl' + +require 'clientBase' + +=begin +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) +=end + +require 'soap/wsdlDriver' +drvBase = SOAP::WSDLDriverFactory.new($wsdlBase).create_rpc_driver +drvBase.endpoint_url = $serverBase +drvGroupB = SOAP::WSDLDriverFactory.new($wsdlGroupB).create_rpc_driver +drvGroupB.endpoint_url = $serverGroupB + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientWingfoot.rb b/test/interopR2/clientWingfoot.rb new file mode 100644 index 0000000..91d0323 --- /dev/null +++ b/test/interopR2/clientWingfoot.rb @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +$serverName = 'WingfootSOAPServer' + +$server = 'http://www.wingfoot.com/servlet/wserver' +$noEchoMap = true + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDef(drv) + +doTestBase(drv) +doTestGroupB(drv) +submitTestResult diff --git a/test/interopR2/clientXMLBus.rb b/test/interopR2/clientXMLBus.rb new file mode 100644 index 0000000..9f58d0b --- /dev/null +++ b/test/interopR2/clientXMLBus.rb @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +$serverName = 'IONAXMLBus' + +$serverBase = 'http://interop.xmlbus.com:7002/xmlbus/container/InteropTest/BaseService/BasePort' +$serverGroupB = 'http://interop.xmlbus.com:7002/xmlbus/container/InteropTest/GroupBService/GroupBPort' +$noEchoMap = true + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDef(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientXMLRPC-EPI.rb b/test/interopR2/clientXMLRPC-EPI.rb new file mode 100644 index 0000000..5de7e34 --- /dev/null +++ b/test/interopR2/clientXMLRPC-EPI.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +$serverName = 'XMLRPC-EPI' +$serverBase = 'http://xmlrpc-epi.sourceforge.net/xmlrpc_php/interop-server.php' +#$serverGroupB = 'http://soapinterop.simdb.com/round2B' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase( drvBase ) + +#drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +#methodDefGroupB( drvGroupB ) + +doTestBase( drvBase ) +#doTestGroupB( drvGroupB ) +submitTestResult diff --git a/test/interopR2/clientXSOAP.rb b/test/interopR2/clientXSOAP.rb new file mode 100644 index 0000000..d6fb2f7 --- /dev/null +++ b/test/interopR2/clientXSOAP.rb @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +$serverName = 'XSOAP1.2' + +$server = 'http://www.wingfoot.com/servlet/wserver' + +require 'clientBase' + +drv = SOAP::RPC::Driver.new($server, InterfaceNS) +methodDefBase(drv) + +doTestBase(drv) +#doTestGroupB(drv) +submitTestResult diff --git a/test/interopR2/clientZSI.rb b/test/interopR2/clientZSI.rb new file mode 100644 index 0000000..343282c --- /dev/null +++ b/test/interopR2/clientZSI.rb @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby + +$serverName = 'ZSI' + +$serverBase = 'http://63.142.188.184:1122/' +$serverGroupB = 'http://63.142.188.184:1122/' + +require 'clientBase' +#$soapAction = 'urn:soapinterop' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDef( drvBase ) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB( drvGroupB ) + +doTestBase( drvBase ) +doTestGroupB( drvGroupB ) +submitTestResult diff --git a/test/interopR2/clienteSOAP.rb b/test/interopR2/clienteSOAP.rb new file mode 100644 index 0000000..b82b358 --- /dev/null +++ b/test/interopR2/clienteSOAP.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +$serverName = 'eSoap' + +$serverBase = 'http://www.quakersoft.net/cgi-bin/interop2_server.cgi' +$noEchoMap = true + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDefBase(drvBase) + +#drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +#methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +#doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientgSOAP.rb b/test/interopR2/clientgSOAP.rb new file mode 100644 index 0000000..0951ee1 --- /dev/null +++ b/test/interopR2/clientgSOAP.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +$serverName = 'gSOAP' + +$serverBase = 'http://websrv.cs.fsu.edu/~engelen/interop2.cgi' +$serverGroupB = 'http://websrv.cs.fsu.edu/~engelen/interop2B.cgi' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDef(drvBase) + +drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/clientkSOAP.rb b/test/interopR2/clientkSOAP.rb new file mode 100644 index 0000000..0037a38 --- /dev/null +++ b/test/interopR2/clientkSOAP.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +$serverName = 'kSOAP' + +$serverBase = 'http://kissen.cs.uni-dortmund.de:8080/ksoapinterop' + +require 'clientBase' + +drvBase = SOAP::RPC::Driver.new($serverBase, InterfaceNS) +methodDef(drvBase) + +#drvGroupB = SOAP::RPC::Driver.new($serverGroupB, InterfaceNS) +#methodDefGroupB(drvGroupB) + +doTestBase(drvBase) +#doTestGroupB(drvGroupB) +submitTestResult diff --git a/test/interopR2/iSimonReg.rb b/test/interopR2/iSimonReg.rb new file mode 100644 index 0000000..7b27eb2 --- /dev/null +++ b/test/interopR2/iSimonReg.rb @@ -0,0 +1,112 @@ +require 'soap/soap' +require 'soap/rpcUtils' + +module SimonReg + TypeNS = 'http://soap.pocketsoap.com/registration/types' + + module Services + + InterfaceNS = 'http://soap.pocketsoap.com/registration/services' + + class Service + include SOAP::Marshallable + @typeName = 'Service' + @typeNamespace = SimonReg::TypeNS + + attr_accessor :id, :name, :description, :wsdlURL, :websiteURL + + def initialize( id = nil, name = nil, description = nil, wsdlURL = nil, websiteURL = nil ) + + @id = id + @name = name + @description = description + @wsdlURL = wsdlURL + @websiteURL = websiteURL + end + end + + Methods = { + 'ServiceList' => [ 'services' ], + 'Servers' => [ 'Servers', 'serviceID' ], + 'Clients' => [ 'Clients', 'serviceID' ], + } + end + + module Clients + + InterfaceNS = 'http://soap.pocketsoap.com/registration/clients' + + class ClientInfo + include SOAP::Marshallable + @typeName = 'clientInfo' + @typeNamespace = SimonReg::TypeNS + + attr_accessor :name, :version, :resultsURL + + def initialize( name = nil, version = nil, resultsURL = nil ) + + @name = name + @version = version + @resultsURL = resultsURL + end + end + + Methods = { + 'RegisterClient' => [ 'clientID', 'serviceID', 'clientInfo' ], + 'UpdateClient' => [ 'void', 'clientID', 'clientInfo' ], + 'RemoveClient' => [ 'void', 'clientID' ], + } + end + + module Servers + + InterfaceNS = 'http://soap.pocketsoap.com/registration/servers' + + class ServerInfo + include SOAP::Marshallable + @typeName = 'serverInfo' + @typeNamespace = SimonReg::TypeNS + + attr_accessor :name, :version, :endpointURL, :wsdlURL + + def initialize( name = nil, version = nil, endpointURL = nil, wsdlURL = nil ) + + @name = name + @version = version + @endpointURL = endpointURL + @wsdlURL = wsdlURL + end + end + + Methods = { + 'RegisterServer' => [ 'serverID', 'serviceID', 'serverInfo' ], + 'UpdateServer' => [ 'void', 'serverID', 'serverInfo' ], + 'RemoveServer' => [ 'void', 'serverID' ], + } + end + + module Subscriber + + InterfaceNS = 'http://soap.pocketsoap.com/registration/subscriber' + + class SubscriberInfo + include SOAP::Marshallable + @typeName = 'subscriberInfo' + @typeNamespace = SimonReg::TypeNS + + attr_accessor :notificationID, :expires + + def initialize( notificationID = nil, expires = nil ) + + @notificationID = notificationID + @expires = expires + end + end + + Methods = { + 'Subscribe' => [ 'subscriberInfo', 'serviceID', 'ServerChanges', 'ClientChanges', 'NotificationURL' ], + 'Renew' => [ 'expires', 'notificationID' ], + 'Cancel' => [ 'void', 'notificationID' ], + } + end +end diff --git a/test/interopR2/interopResultBase.rb b/test/interopR2/interopResultBase.rb new file mode 100644 index 0000000..bf53ce0 --- /dev/null +++ b/test/interopR2/interopResultBase.rb @@ -0,0 +1,114 @@ +require 'soap/mapping' + + +module SOAPBuildersInteropResult +extend SOAP + + +InterfaceNS = 'http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInteropResult/0.0.1' +TypeNS = 'http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInteropResult/type/0.0.1' + + +class Endpoint + include SOAP::Marshallable + + attr_accessor :processorName, :processorVersion, :endpointName, :uri, :wsdl + + def initialize( endpointName = nil, uri = nil, wsdl = nil ) + @processorName = 'unknown' + @processorVersion = nil + @endpointName = endpointName + @uri = uri + @wsdl = wsdl + end + + def name + if @endpointName + @endpointName + elsif @processorVersion + "#{ @processorName }-#{ @processorVersion }" + else + "#{ @processorName }" + end + end +end + + +class TestResult + include SOAP::Marshallable + + attr_accessor :testName, :result, :comment, :wiredump + + def initialize( testName, result, comment = nil, wiredump = nil ) + @testName = testName + @result = result + @comment = comment + @wiredump = wiredump + end +end + + +class InteropResults + include SOAP::Marshallable + include Enumerable + + attr_accessor :dateTime, :server, :client + + def initialize( client = nil, server = nil ) + @dateTime = Time.now + @server = server + @client = client + @testResults = [] + end + + def add( testResult ) + @testResults << testResult + end + + def clear + @testResults.clear + end + + def each + @testResults.each do | item | + yield( item ) + end + end + + def size + @testResults.size + end +end + + +Methods = [ + [ 'addResults', [:in, 'interopResults' ]], + [ 'deleteResults', [:in, 'client'], [:in, 'server']], +] + + + +MappingRegistry = SOAP::Mapping::Registry.new + +MappingRegistry.set( + ::SOAPBuildersInteropResult::Endpoint, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + [ XSD::QName.new(TypeNS, 'Endpoint') ] +) + +MappingRegistry.set( + ::SOAPBuildersInteropResult::TestResult, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + [ XSD::QName.new(TypeNS, 'TestResult') ] +) +MappingRegistry.set( + ::SOAPBuildersInteropResult::InteropResults, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + [ XSD::QName.new(TypeNS, 'InteropResults') ] +) + + +end diff --git a/test/interopR2/interopService.rb b/test/interopR2/interopService.rb new file mode 100644 index 0000000..5844d7b --- /dev/null +++ b/test/interopR2/interopService.rb @@ -0,0 +1,247 @@ +require 'interopbase' + +class InteropService + include SOAP + + # In echoVoid, 'retval' is not defined. So nothing will be returned. + def echoVoid + return SOAP::RPC::SOAPVoid.new + end + + def echoBoolean(inputBoolean) + inputBoolean + end + + def echoString(inputString) + clone(inputString) + end + + def echoStringArray(inputStringArray) + clone(inputStringArray) + end + + def echoInteger(inputInteger) + SOAP::SOAPInt.new(clone(inputInteger)) + end + + def echoIntegerArray(inputIntegerArray) + clone(inputIntegerArray) + end + + # Float is mapped to SOAPDouble by default. + def echoFloat(inputFloat) + SOAP::SOAPFloat.new(inputFloat) + end + + def echoDecimal(inputDecimal) + SOAP::SOAPDecimal.new(clone(inputDecimal)) + end + + def echoFloatArray(inputFloatArray) + outArray = SOAPBuildersInterop::FloatArray.new + inputFloatArray.each do |f| + outArray << SOAPFloat.new(f) + end + outArray + end + + def echoStruct(inputStruct) + clone_Struct(inputStruct) + end + + def echoStructArray(inputStructArray) + clone_StructArray(inputStructArray) + end + + def echoDate(inputDate) + clone(inputDate) + end + + def echoBase64(inputBase64) + o = SOAP::SOAPBase64.new(clone(inputBase64)) + o.as_xsd + o + end + + def echoHexBinary(inputHexBinary) + SOAP::SOAPHexBinary.new(clone(inputHexBinary)) + end + + def echoDouble(inputDouble) + SOAP::SOAPDouble.new(inputDouble) + end + + # for Round 2 group B + def echoStructAsSimpleTypes(inputStruct) + outputString = inputStruct.varString + outputInteger = inputStruct.varInt + outputFloat = inputStruct.varFloat ? SOAPFloat.new(inputStruct.varFloat) : nil + # retVal is not returned to SOAP client because retVal of this method is + # not defined in method definition. + # retVal, out, out, out + return nil, outputString, outputInteger, outputFloat + end + + def echoSimpleTypesAsStruct(inputString, inputInt, inputFloat) + SOAPBuildersInterop::SOAPStruct.new(inputInt, inputFloat, inputString) + end + + def echo2DStringArray(ary) + # In Ruby, M-D Array is converted to Array of Array now. + mdary = SOAP::Mapping.ary2md(ary, 2, XSD::Namespace, XSD::StringLiteral) + if mdary.include?(nil) + mdary.sparse = true + end + mdary + end + + def echoNestedStruct(inputStruct) + clone_StructStruct(inputStruct) + end + + def echoNestedArray(inputStruct) + clone_Struct(inputStruct) + end + + def echoMap(inputMap) + clone(inputMap) + end + + def echoMapArray(inputMapArray) + clone(inputMapArray) + end + + def echoPolyMorph(anObject) + clone(anObject) + end + + alias echoPolyMorphStruct echoPolyMorph + alias echoPolyMorphArray echoPolyMorph + + + def echoXSDBoolean(inputBoolean) + inputBoolean + end + + def echoXSDString(inputString) + clone(inputString) + end + + def echoXSDDecimal(inputDecimal) + SOAP::SOAPDecimal.new(clone(inputDecimal)) + end + + def echoXSDFloat(inputFloat) + SOAPFloat.new(inputFloat) + end + + def echoXSDDouble(inputDouble) + SOAP::SOAPDouble.new(clone(inputDouble)) + end + + def echoXSDDuration(inputDuration) + SOAP::SOAPDuration.new(clone(inputDuration)) + end + + def echoXSDDateTime(inputXSDDateTime) + clone(inputXSDDateTime) + end + + def echoXSDTime(inputXSDTime) + SOAP::SOAPTime.new(clone(inputXSDTime)) + end + + def echoXSDDate(inputXSDDate) + SOAP::SOAPDate.new(clone(inputXSDDate)) + end + + def echoXSDgYearMonth(inputGYearMonth) + SOAP::SOAPgYearMonth.new(clone(inputGYearMonth)) + end + + def echoXSDgYear(inputGYear) + SOAP::SOAPgYear.new(clone(inputGYear)) + end + + def echoXSDgMonthDay(inputGMonthDay) + SOAP::SOAPgMonthDay.new(clone(inputGMonthDay)) + end + + def echoXSDgDay(inputGDay) + SOAP::SOAPgDay.new(clone(inputGDay)) + end + + def echoXSDgMonth(inputGMonth) + SOAP::SOAPgMonth.new(clone(inputGMonth)) + end + + def echoXSDHexBinary(inputHexBinary) + SOAP::SOAPHexBinary.new(clone(inputHexBinary)) + end + + def echoXSDBase64(inputBase64) + o = SOAP::SOAPBase64.new(clone(inputBase64)) + o.as_xsd + o + end + + def echoXSDanyURI(inputAnyURI) + clone(inputAnyURI) + end + + def echoXSDQName(inputQName) + SOAP::SOAPQName.new(clone(inputQName)) + end + + def echoXSDInteger(inputXSDInteger) + clone(inputXSDInteger) + end + + def echoXSDLong(inputLong) + SOAP::SOAPLong.new(clone(inputLong)) + end + + def echoXSDInt(inputInt) + SOAP::SOAPInt.new(clone(inputInteger)) + end + + def echoPolyMorph(anObject) + clone(anObject) + end + + alias echoPolyMorphStruct echoPolyMorph + alias echoPolyMorphArray echoPolyMorph + +private + + def clone(obj) + begin + return Marshal.load(Marshal.dump(obj)) + rescue TypeError + return obj + end + end + + def clone_Struct(struct) + result = clone(struct) + result.varFloat = SOAPFloat.new(struct.varFloat) if struct.varFloat + result + end + + def clone_StructArray(structArray) + result = clone(structArray) + result.map { |ele| + ele.varFloat = SOAPFloat.new(ele.varFloat) if ele.varFloat + } + result + end + + def clone_StructStruct(structStruct) + result = clone(structStruct) + result.varFloat = SOAPFloat.new(structStruct.varFloat) if structStruct.varFloat + if struct = result.varStruct + struct.varFloat = SOAPFloat.new(struct.varFloat) if struct.varFloat + end + result + end +end diff --git a/test/interopR2/rwikiInteropService.rb b/test/interopR2/rwikiInteropService.rb new file mode 100644 index 0000000..3d1ba3e --- /dev/null +++ b/test/interopR2/rwikiInteropService.rb @@ -0,0 +1,105 @@ +require 'drb/drb' +require 'rw-lib' +require 'interopResultBase' + +class RWikiInteropService + def initialize + @rwiki_uri = 'druby://localhost:7174' + @rwiki = DRbObject.new(nil, @rwiki_uri) + end + + # [ 'addResults', [:in, 'interopResults' ]] + # [ 'deleteResults', [:in, 'client'], [:in, 'server']] + + def addResults(interopResults) + pageName = pageName(interopResults.client, interopResults.server) + + passResults = interopResults.find_all { | testResult | + testResult.result + } + passStr = passResults.collect { | passResult | + str = "* #{ passResult.testName } ((<[wiredump]|\"##{passResult.testName}\">))\n" + if passResult.comment + str << "\n #{ passResult.comment.gsub(/[\r\n]/, '') }\n" + end + str + } + passStr = 'Nothing...' if passStr.empty? + + failResults = interopResults.find_all { | testResult | + !testResult.result + } + failStr = failResults.collect { | failResult | + str = ":#{ failResult.testName } ((<[wiredump]|\"##{failResult.testName}\">))\n Result:\n" + resultStr = failResult.comment.gsub(/\r?\n/, "\n ") + str << " #{ resultStr }\n" + str + } + failStr = 'Nothing!' if failStr.empty? + + pageStr =<<__EOS__ += #{ pageName } + +* Date: #{ interopResults.dateTime } +* Server + * Name: #{ interopResults.server.name } + * Endpoint: #{ interopResults.server.uri } + * WSDL: #{ interopResults.server.wsdl } +* Client + * Name: #{ interopResults.client.name } + * Endpoint: #{ interopResults.client.uri } + * WSDL: #{ interopResults.client.wsdl } + +== Pass + +#{ passResults.size } / #{ interopResults.size } + +#{ passStr } + +== Fail + +#{ failResults.size } / #{ interopResults.size } + +#{ failStr } + +== Wiredumps + +__EOS__ + + interopResults.each do | testResult | + pageStr <<<<__EOS__ +=== #{ testResult.testName } + + #{ testResult.wiredump.gsub(/\r/, '^M').gsub(/\t/, '^I').gsub(/\n/, "\n ") } + +__EOS__ + end + + set(pageName, pageStr) + + msg = "; #{ passResults.size } / #{ interopResults.size } (#{ interopResults.dateTime })" + addLink(pageName, msg) + end + + def deleteResults(client, server) + set(pageName(client, server), '') + end + +private + + def set(pageName, pageSrc) + page = @rwiki.page(pageName) + page.src = pageSrc + end + + def pageName(client, server) + "InteropResults::#{ client.name }-#{ server.name }" + end + + def addLink(pageName, msg) + page = @rwiki.page('InteropResults') + # Race condition... Page source might be mixed with others's. + page.src = (page.src || '') << "\n* ((<\"#{ pageName }\">))\n #{ msg }" + end +end + diff --git a/test/interopR2/server.cgi b/test/interopR2/server.cgi new file mode 100755 index 0000000..69dd3fb --- /dev/null +++ b/test/interopR2/server.cgi @@ -0,0 +1,270 @@ +#!/usr/bin/env ruby + +$:.unshift(".") + +#$KCODE = "UTF8" # Set $KCODE before loading 'soap/xmlparser'. +#$KCODE = "EUC" +$KCODE = "SJIS" + +require 'soap/rpc/cgistub' +require 'base' + +class InteropApp < SOAP::CGIStub + include SOAP + + def initialize(*arg) + super(*arg) + self.mapping_registry = SOAPBuildersInterop::MappingRegistry + self.level = Logger::Severity::ERROR + end + + def on_init + (SOAPBuildersInterop::MethodsBase + SOAPBuildersInterop::MethodsGroupB + SOAPBuildersInterop::MethodsPolyMorph).each do |name, *params| + add_method(self, name, params) + end + end + + # In echoVoid, 'retval' is not defined. So nothing will be returned. + def echoVoid + return SOAP::RPC::SOAPVoid.new + end + + def echoBoolean(inputBoolean) + inputBoolean + end + + def echoString(inputString) + clone(inputString) + end + + def echoStringArray(inputStringArray) + clone(inputStringArray) + end + + def echoInteger(inputInteger) + SOAP::SOAPInt.new(clone(inputInteger)) + end + + def echoIntegerArray(inputIntegerArray) + clone(inputIntegerArray) + end + + # Float is mapped to SOAPDouble by default. + def echoFloat(inputFloat) + SOAP::SOAPFloat.new(inputFloat) + end + + def echoDecimal(inputDecimal) + SOAP::SOAPDecimal.new(clone(inputDecimal)) + end + + def echoFloatArray(inputFloatArray) + outArray = SOAPBuildersInterop::FloatArray.new + inputFloatArray.each do |f| + outArray << SOAPFloat.new(f) + end + outArray + end + + def echoStruct(inputStruct) + clone_Struct(inputStruct) + end + + def echoStructArray(inputStructArray) + clone_StructArray(inputStructArray) + end + + def echoDate(inputDate) + clone(inputDate) + end + + def echoBase64(inputBase64) + o = SOAP::SOAPBase64.new(clone(inputBase64)) + o.as_xsd + o + end + + def echoHexBinary(inputHexBinary) + SOAP::SOAPHexBinary.new(clone(inputHexBinary)) + end + + def echoDouble(inputDouble) + SOAP::SOAPDouble.new(inputDouble) + end + + # for Round 2 group B + def echoStructAsSimpleTypes(inputStruct) + outputString = inputStruct.varString + outputInteger = inputStruct.varInt + outputFloat = inputStruct.varFloat ? SOAPFloat.new(inputStruct.varFloat) : nil + # retVal is not returned to SOAP client because retVal of this method is + # not defined in method definition. + # retVal, out, out, out + return nil, outputString, outputInteger, outputFloat + end + + def echoSimpleTypesAsStruct(inputString, inputInt, inputFloat) + SOAPBuildersInterop::SOAPStruct.new(inputInt, inputFloat, inputString) + end + + def echo2DStringArray(ary) + # In Ruby, M-D Array is converted to Array of Array now. + mdary = SOAP::Mapping.ary2md(ary, 2, XSD::Namespace, XSD::StringLiteral) + if mdary.include?(nil) + mdary.sparse = true + end + mdary + end + + def echoNestedStruct(inputStruct) + clone_StructStruct(inputStruct) + end + + def echoNestedArray(inputStruct) + clone_Struct(inputStruct) + end + + def echoMap(inputMap) + clone(inputMap) + end + + def echoMapArray(inputMapArray) + clone(inputMapArray) + end + + def echoPolyMorph(anObject) + clone(anObject) + end + + alias echoPolyMorphStruct echoPolyMorph + alias echoPolyMorphArray echoPolyMorph + + + def echoXSDBoolean(inputBoolean) + inputBoolean + end + + def echoXSDString(inputString) + clone(inputString) + end + + def echoXSDDecimal(inputDecimal) + SOAP::SOAPDecimal.new(clone(inputDecimal)) + end + + def echoXSDFloat(inputFloat) + SOAPFloat.new(inputFloat) + end + + def echoXSDDouble(inputDouble) + SOAP::SOAPDouble.new(clone(inputDouble)) + end + + def echoXSDDuration(inputDuration) + SOAP::SOAPDuration.new(clone(inputDuration)) + end + + def echoXSDDateTime(inputXSDDateTime) + clone(inputXSDDateTime) + end + + def echoXSDTime(inputXSDTime) + SOAP::SOAPTime.new(clone(inputXSDTime)) + end + + def echoXSDDate(inputXSDDate) + SOAP::SOAPDate.new(clone(inputXSDDate)) + end + + def echoXSDgYearMonth(inputGYearMonth) + SOAP::SOAPgYearMonth.new(clone(inputGYearMonth)) + end + + def echoXSDgYear(inputGYear) + SOAP::SOAPgYear.new(clone(inputGYear)) + end + + def echoXSDgMonthDay(inputGMonthDay) + SOAP::SOAPgMonthDay.new(clone(inputGMonthDay)) + end + + def echoXSDgDay(inputGDay) + SOAP::SOAPgDay.new(clone(inputGDay)) + end + + def echoXSDgMonth(inputGMonth) + SOAP::SOAPgMonth.new(clone(inputGMonth)) + end + + def echoXSDHexBinary(inputHexBinary) + SOAP::SOAPHexBinary.new(clone(inputHexBinary)) + end + + def echoXSDBase64(inputBase64) + o = SOAP::SOAPBase64.new(clone(inputBase64)) + o.as_xsd + o + end + + def echoXSDanyURI(inputAnyURI) + clone(inputAnyURI) + end + + def echoXSDQName(inputQName) + SOAP::SOAPQName.new(clone(inputQName)) + end + + def echoXSDInteger(inputXSDInteger) + clone(inputXSDInteger) + end + + def echoXSDLong(inputLong) + SOAP::SOAPLong.new(clone(inputLong)) + end + + def echoXSDInt(inputInt) + SOAP::SOAPInt.new(clone(inputInteger)) + end + + def echoPolyMorph(anObject) + clone(anObject) + end + + alias echoPolyMorphStruct echoPolyMorph + alias echoPolyMorphArray echoPolyMorph + +private + + def clone(obj) + begin + return Marshal.load(Marshal.dump(obj)) + rescue TypeError + return obj + end + end + + def clone_Struct(struct) + result = clone(struct) + result.varFloat = SOAPFloat.new(struct.varFloat) if struct.varFloat + result + end + + def clone_StructArray(structArray) + result = clone(structArray) + result.map { |ele| + ele.varFloat = SOAPFloat.new(ele.varFloat) if ele.varFloat + } + result + end + + def clone_StructStruct(structStruct) + result = clone(structStruct) + result.varFloat = SOAPFloat.new(structStruct.varFloat) if structStruct.varFloat + if struct = result.varStruct + struct.varFloat = SOAPFloat.new(struct.varFloat) if struct.varFloat + end + result + end +end + +InteropApp.new('InteropApp', InterfaceNS).start diff --git a/test/interopR2/server.rb b/test/interopR2/server.rb new file mode 100644 index 0000000..d3085a8 --- /dev/null +++ b/test/interopR2/server.rb @@ -0,0 +1,275 @@ +#!/usr/bin/env ruby + +$:.unshift(".") + +#$KCODE = "UTF8" # Set $KCODE before loading 'soap/xmlparser'. +#$KCODE = "EUC" +$KCODE = "SJIS" + +require 'soap/rpc/standaloneServer' +require 'base' +require 'xsd/xmlparser/rexmlparser' + +class InteropApp < SOAP::RPC::StandaloneServer + include SOAP + + def initialize(*arg) + super(*arg) + self.mapping_registry = SOAPBuildersInterop::MappingRegistry + self.level = Logger::Severity::ERROR + end + + def on_init + (SOAPBuildersInterop::MethodsBase + SOAPBuildersInterop::MethodsGroupB + SOAPBuildersInterop::MethodsPolyMorph).each do |name, *params| + add_method(self, name, params) + end + end + + # In echoVoid, 'retval' is not defined. So nothing will be returned. + def echoVoid + return SOAP::RPC::SOAPVoid.new + end + + def echoBoolean(inputBoolean) + inputBoolean + end + + def echoString(inputString) + clone(inputString) + end + + def echoStringArray(inputStringArray) + clone(inputStringArray) + end + + def echoInteger(inputInteger) + SOAP::SOAPInt.new(clone(inputInteger)) + end + + def echoIntegerArray(inputIntegerArray) + clone(inputIntegerArray) + end + + # Float is mapped to SOAPDouble by default. + def echoFloat(inputFloat) + SOAP::SOAPFloat.new(inputFloat) + end + + def echoDecimal(inputDecimal) + SOAP::SOAPDecimal.new(clone(inputDecimal)) + end + + def echoFloatArray(inputFloatArray) + outArray = SOAPBuildersInterop::FloatArray.new + inputFloatArray.each do |f| + outArray << SOAPFloat.new(f) + end + outArray + end + + def echoStruct(inputStruct) + clone_Struct(inputStruct) + end + + def echoStructArray(inputStructArray) + clone_StructArray(inputStructArray) + end + + def echoDate(inputDate) + clone(inputDate) + end + + def echoBase64(inputBase64) + o = SOAP::SOAPBase64.new(clone(inputBase64)) + o.as_xsd + o + end + + def echoHexBinary(inputHexBinary) + SOAP::SOAPHexBinary.new(clone(inputHexBinary)) + end + + def echoDouble(inputDouble) + SOAP::SOAPDouble.new(inputDouble) + end + + # for Round 2 group B + def echoStructAsSimpleTypes(inputStruct) + outputString = inputStruct.varString + outputInteger = inputStruct.varInt + outputFloat = inputStruct.varFloat ? SOAPFloat.new(inputStruct.varFloat) : nil + # retVal is not returned to SOAP client because retVal of this method is + # not defined in method definition. + # retVal, out, out, out + return nil, outputString, outputInteger, outputFloat + end + + def echoSimpleTypesAsStruct(inputString, inputInt, inputFloat) + SOAPBuildersInterop::SOAPStruct.new(inputInt, inputFloat, inputString) + end + + def echo2DStringArray(ary) + # In Ruby, M-D Array is converted to Array of Array now. + mdary = SOAP::Mapping.ary2md(ary, 2, XSD::Namespace, XSD::StringLiteral) + if mdary.include?(nil) + mdary.sparse = true + end + mdary + end + + def echoNestedStruct(inputStruct) + clone_StructStruct(inputStruct) + end + + def echoNestedArray(inputStruct) + clone_Struct(inputStruct) + end + + def echoMap(inputMap) + clone(inputMap) + end + + def echoMapArray(inputMapArray) + clone(inputMapArray) + end + + def echoPolyMorph(anObject) + clone(anObject) + end + + alias echoPolyMorphStruct echoPolyMorph + alias echoPolyMorphArray echoPolyMorph + + + def echoXSDBoolean(inputBoolean) + inputBoolean + end + + def echoXSDString(inputString) + clone(inputString) + end + + def echoXSDDecimal(inputDecimal) + SOAP::SOAPDecimal.new(clone(inputDecimal)) + end + + def echoXSDFloat(inputFloat) + SOAPFloat.new(inputFloat) + end + + def echoXSDDouble(inputDouble) + SOAP::SOAPDouble.new(clone(inputDouble)) + end + + def echoXSDDuration(inputDuration) + SOAP::SOAPDuration.new(clone(inputDuration)) + end + + def echoXSDDateTime(inputXSDDateTime) + clone(inputXSDDateTime) + end + + def echoXSDTime(inputXSDTime) + SOAP::SOAPTime.new(clone(inputXSDTime)) + end + + def echoXSDDate(inputXSDDate) + SOAP::SOAPDate.new(clone(inputXSDDate)) + end + + def echoXSDgYearMonth(inputGYearMonth) + SOAP::SOAPgYearMonth.new(clone(inputGYearMonth)) + end + + def echoXSDgYear(inputGYear) + SOAP::SOAPgYear.new(clone(inputGYear)) + end + + def echoXSDgMonthDay(inputGMonthDay) + SOAP::SOAPgMonthDay.new(clone(inputGMonthDay)) + end + + def echoXSDgDay(inputGDay) + SOAP::SOAPgDay.new(clone(inputGDay)) + end + + def echoXSDgMonth(inputGMonth) + SOAP::SOAPgMonth.new(clone(inputGMonth)) + end + + def echoXSDHexBinary(inputHexBinary) + SOAP::SOAPHexBinary.new(clone(inputHexBinary)) + end + + def echoXSDBase64(inputBase64) + o = SOAP::SOAPBase64.new(clone(inputBase64)) + o.as_xsd + o + end + + def echoXSDanyURI(inputAnyURI) + clone(inputAnyURI) + end + + def echoXSDQName(inputQName) + SOAP::SOAPQName.new(clone(inputQName)) + end + + def echoXSDInteger(inputXSDInteger) + clone(inputXSDInteger) + end + + def echoXSDLong(inputLong) + SOAP::SOAPLong.new(clone(inputLong)) + end + + def echoXSDInt(inputInt) + SOAP::SOAPInt.new(clone(inputInteger)) + end + + def echoPolyMorph(anObject) + clone(anObject) + end + + alias echoPolyMorphStruct echoPolyMorph + alias echoPolyMorphArray echoPolyMorph + +private + + def clone(obj) + begin + return Marshal.load(Marshal.dump(obj)) + rescue TypeError + return obj + end + end + + def clone_Struct(struct) + result = clone(struct) + result.varFloat = SOAPFloat.new(struct.varFloat) if struct.varFloat + result + end + + def clone_StructArray(structArray) + result = clone(structArray) + result.map { |ele| + ele.varFloat = SOAPFloat.new(ele.varFloat) if ele.varFloat + } + result + end + + def clone_StructStruct(structStruct) + result = clone(structStruct) + result.varFloat = SOAPFloat.new(structStruct.varFloat) if structStruct.varFloat + if struct = result.varStruct + struct.varFloat = SOAPFloat.new(struct.varFloat) if struct.varFloat + end + result + end +end + +if __FILE__ == $0 + svr = InteropApp.new('InteropApp', InterfaceNS, '0.0.0.0', 10080) + trap("INT") { svr.shutdown } + svr.start +end diff --git a/test/interopR2/simonReg.rb b/test/interopR2/simonReg.rb new file mode 100644 index 0000000..552702c --- /dev/null +++ b/test/interopR2/simonReg.rb @@ -0,0 +1,123 @@ +#!/usr/bin/env ruby + +proxy = ARGV.shift || nil + +require 'soap/driver' +require 'logger' + +require 'iSimonReg' + +server = 'http://www.4s4c.com/services/4s4c.ashx' + +class SimonRegApp < Logger::Application + include SimonReg + +private + + AppName = 'SimonRegApp' + + def initialize( server, proxy ) + super( AppName ) + @server = server + @proxy = proxy + @logId = Time.now.gmtime.strftime( "%Y-%m-%dT%X+0000" ) + @drvServices = nil + @drvClients = nil + @drvServers = nil + @drvSubscriber = nil + end + + def run() + @log.level = WARN + wireDump = getWireDumpLogFile + + # Services portType + @drvServices = SOAP::Driver.new( @log, @logId, Services::InterfaceNS, @server, @proxy ) + @drvServices.setWireDumpDev( wireDump ) + + Services::Methods.each do | method, params | + @drvServices.addMethod( method, *( params[1..-1] )) + end + @drvServices.extend( Services ) + + # Clients portType + @drvClients = SOAP::Driver.new( @log, @logId, Clients::InterfaceNS, @server, @proxy ) + @drvClients.setWireDumpDev( wireDump ) + + Clients::Methods.each do | method, params | + @drvClients.addMethod( method, *( params[1..-1] )) + end + @drvClients.extend( Clients ) + + # Servers portType + @drvServers = SOAP::Driver.new( @log, @logId, Servers::InterfaceNS, @server, @proxy ) + @drvServers.setWireDumpDev( wireDump ) + + Servers::Methods.each do | method, params | + @drvServers.addMethod( method, *( params[1..-1] )) + end + @drvServers.extend( Services ) + + # Services portType + @drvSubscriber = SOAP::Driver.new( @log, @logId, Subscriber::InterfaceNS, @server, @proxy ) + @drvSubscriber.setWireDumpDev( wireDump ) + + Subscriber::Methods.each do | method, params | + @drvSubscriber.addMethod( method, *( params[1..-1] )) + end + @drvSubscriber.extend( Subscriber ) + + # Service information + #services = @drvServices.ServiceList + #groupA = services.find { | service | service.name == 'SoapBuilders Interop Group A' } + #groupB = services.find { | service | service.name == 'SoapBuilders Interop Group B' } + + # SOAP4R information + version = '1.4.1' + soap4rClientInfo = Clients::ClientInfo.new( 'SOAP4R', version, + 'http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/wiki.cgi?cmd=view;name=InteropResults' + ) + soap4rServerInfo = Servers::ServerInfo.new( 'SOAP4R', version, + 'http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInterop/', + 'http://www.jin.gr.jp/~nahi/Ruby/SOAP4R/SOAPBuildersInterop/SOAP4R_SOAPBuildersInteropTest_R2base.wsdl' ) + soap4rGroupAClientID = '{7B1DF876-055E-4259-ACAE-55E13E399264}' + soap4rGroupBClientID = '{62723003-BC86-4BC0-AABC-C6A3FDE11655}' + soap4rGroupAServerID = '{3094F6C7-F6AA-4BE5-A4EB-194C82103728}' + soap4rGroupBServerID = '{A16357C9-6C7F-45CD-AC3D-72F0FC5F4F99}' + + # Client registration + # clientID = @drvClients.RegisterClient( groupA.id, soap4rClientInfo ) + # clientID = @drvClients.RegisterClient( groupB.id, soap4rClientInfo ) + + # Client remove + # @drvClients.RemoveClient( soap4rClientID ) + + # Server registration + # serverID = @drvServers.RegisterServer( groupA.id, soap4rServerInfo ) + # serverID = @drvServers.RegisterServer( groupB.id, soap4rServerInfo ) + # p serverID + + # Update + @drvClients.UpdateClient( soap4rGroupAClientID, soap4rClientInfo ) + @drvClients.UpdateClient( soap4rGroupBClientID, soap4rClientInfo ) + @drvServers.UpdateServer( soap4rGroupAServerID, soap4rServerInfo ) + @drvServers.UpdateServer( soap4rGroupBServerID, soap4rServerInfo ) + end + + + ### + ## Other utility methods + # + def log( sev, message ) + @log.add( sev, "<#{ @logId }> #{ message }", @appName ) if @log + end + + def getWireDumpLogFile + logFilename = File.basename( $0 ) + '.log' + f = File.open( logFilename, 'w' ) + f << "File: #{ logFilename } - Wiredumps for SOAP4R client.\n" + f << "Date: #{ Time.now }\n\n" + end +end + +app = SimonRegApp.new( server, proxy ).start() diff --git a/test/interopR2/test.sh b/test/interopR2/test.sh new file mode 100644 index 0000000..75d0ef1 --- /dev/null +++ b/test/interopR2/test.sh @@ -0,0 +1,49 @@ +#!/bin/sh - + +ruby clientSOAP4R.rb + +ruby client4S4C.rb +ruby client4S4C2.rb +ruby clientApacheAxis.rb +ruby clientApacheSOAP.rb +ruby clientASP.NET.rb +ruby clientBEAWebLogic.rb +ruby clientCapeConnect.rb +ruby clientDelphi.rb +ruby clientEasySoap.rb +ruby clienteSOAP.rb +ruby clientgSOAP.rb +ruby clientFrontier.rb +ruby clientGLUE.rb +ruby clientHP.rb +ruby clientXMLBus.rb +ruby clientKafkaXSLT.rb +ruby clientkSOAP.rb +ruby client.NetRemoting.rb +ruby clientMSSOAPToolkit2.0.rb +ruby clientMSSOAPToolkit3.0.rb +ruby clientNuSOAP.rb +ruby clientNuWave.rb +ruby clientOpenLink.rb +ruby clientOracle.rb +ruby clientPEAR.rb +ruby clientPhalanx.rb +ruby clientSilverStream.rb +ruby clientSIMACE.rb +ruby clientSOAP::Lite.rb +ruby clientJSOAP.rb +ruby clientSpray2001.rb +ruby clientSQLData.rb +ruby clientSun.rb +ruby clientVWOpentalkSoap.rb +ruby clientWASP.rb +ruby clientWASPC.rb +ruby clientWebMethods.rb +ruby clientWhiteMesa.rb +ruby clientWingfoot.rb +ruby clientXSOAP.rb + +# Permanent +#ruby clientTclSOAP.rb +#ruby clientXMLRPC-EPI.rb +#ruby clientZSI.rb diff --git a/test/interopR4/client.rb b/test/interopR4/client.rb new file mode 100644 index 0000000..480f22b --- /dev/null +++ b/test/interopR4/client.rb @@ -0,0 +1,112 @@ +require 'test/unit' +require 'soap/rpc/driver' + + +class TestInteropR4 < Test::Unit::TestCase + include SOAP + + class ArrayOfBinary < Array; end + MappingRegistry = Mapping::DefaultRegistry.dup + MappingRegistry.add( + ArrayOfBinary, + SOAPArray, + Mapping::Registry::TypedArrayFactory, + { :type => XSD::XSDBase64Binary::Type } + ) + + class << self + include SOAP + def setup(name, location) + setup_log(name) + setup_drv(location) + end + + def teardown + end + + private + + def setup_log(name) + filename = File.basename($0).sub(/\.rb$/, '') << '.log' + @@log = File.open(filename, 'w') + @@log << "File: #{ filename } - Wiredumps for SOAP4R client / #{ name } server.\n" + @@log << "Date: #{ Time.now }\n\n" + end + + def setup_drv(location) + namespace = "http://soapinterop.org/attachments/" + soap_action = "http://soapinterop.org/attachments/" + @@drv = RPC::Driver.new(location, namespace, soap_action) + @@drv.mapping_registry = MappingRegistry + @@drv.wiredump_dev = @@log + method_def(@@drv, soap_action) + end + + def method_def(drv, soap_action = nil) + drv.add_method("EchoAttachment", + [[:in, 'In', nil], [:retval, 'Out', nil]]) + drv.add_method("EchoAttachments", + [[:in, 'In', nil], [:retval, 'Out', nil]]) + drv.add_method("EchoAttachmentAsBase64", + [[:in, 'In', nil], [:retval, 'Out', nil]]) + drv.add_method("EchoBase64AsAttachment", + [[:in, 'In', nil], [:retval, 'Out', nil]]) + end + end + + def setup + end + + def teardown + end + + def drv + @@drv + end + + def log_test + /`([^']+)'/ =~ caller(1)[0] + title = $1 + title = "==== " + title + " " << "=" * (title.length > 72 ? 0 : (72 - title.length)) + @@log << "#{title}\n\n" + end + + def test_EchoAttachment + log_test + var = drv.EchoAttachment(Attachment.new("foobar")) + assert_equal("foobar", var.content) + end + + def test_EchoAttachments + log_test + var = drv.EchoAttachments( + ArrayOfBinary[ + Attachment.new("foobar"), + Attachment.new("abc\0\0\0def"), + Attachment.new("ghi") + ] + ) + assert_equal(3, var.size) + assert_equal("foobar", var[0].content) + assert_equal("abc\0\0\0def", var[1].content) + assert_equal("ghi", var[2].content) + end + + def test_EchoAttachmentAsBase64 + log_test + var = drv.EchoAttachmentAsBase64(Attachment.new("foobar")) + assert_equal("foobar", var) + end + + def test_EchoBase64AsAttachment + log_test + var = drv.EchoBase64AsAttachment("abc\0\1\2def") + assert_equal("abc\0\1\2def", var.content) + end +end + +if $0 == __FILE__ + name = ARGV.shift || 'localhost' + location = ARGV.shift || 'http://localhost:10080/' + TestInteropR4.setup(name, location) +end diff --git a/test/results b/test/results new file mode 100644 index 0000000..7838580 --- /dev/null +++ b/test/results @@ -0,0 +1,4810 @@ +Loaded suite . +Started +EFFEEEFFE.EEE.E.FEEE.................EE...............................EEEEEEEEE +EEEEEEEEEEEEEEEEFEEEEFFEEEFEEEEEE.EEEEEEEEEEEEEEEEEEE.EEEEEEEEEEEEEEEFEEEEEEEEE +EEEEEEEEEEEEEEEEEEEEEEEE.EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE +EE.EEE......................................F.FFFFFEEEE + +Finished in 457.805577116 seconds. + + 1) Error: +test_normal(SOAP::TestCookie): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `do_server_proc' + /home/spox/Projects/soap4r/test/soap/test_cookie.rb:103:in `test_normal' + + 2) Failure: +test_custom_ns(SOAP::TestCustomNs) [/home/spox/Projects/soap4r/test/soap/test_custom_ns.rb:72]: +<"\n\n \n hi\n \n \n bi\n \n"> expected but was +<"\n\n \n hi\n \n \n bi\n \n">. + +diff: + +- +? + +- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + hi + + + bi + + + + 3) Failure: +test_default_namespace(SOAP::TestCustomNs) [/home/spox/Projects/soap4r/test/soap/test_custom_ns.rb:100]: +<"\n\n \n hi\n \n \n bi\n \n"> expected but was +<"\n\n \n hi\n \n \n bi\n \n">. + +diff: + +- +? + +- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + hi + + ++ bi +? ++++++++++ +- xmlns="my:foo">bi + + + + 4) Error: +test_empty_header(SOAP::TestEmpty): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `nop' + /home/spox/Projects/soap4r/test/soap/test_empty.rb:91:in `test_empty_header' + + 5) Error: +test_nop(SOAP::TestEmpty): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `nop' + /home/spox/Projects/soap4r/test/soap/test_empty.rb:76:in `test_nop' + + 6) Error: +test_nop_nil(SOAP::TestEmpty): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `nop_nil' + /home/spox/Projects/soap4r/test/soap/test_empty.rb:83:in `test_nop_nil' + + 7) Failure: +test_normal(SOAP::TestEnvelopeNamespace) [/home/spox/Projects/soap4r/test/soap/test_envelopenamespace.rb:75]: + exception expected but was +Class: +Message: <"illegal element format: env:encodingStyle"> +---Backtrace--- +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' +(eval):6:in `do_server_proc' +/home/spox/Projects/soap4r/test/soap/test_envelopenamespace.rb:76:in `block in test_normal' +/home/spox/Projects/soap4r/test/soap/test_envelopenamespace.rb:75:in `test_normal' +--------------- + + 8) Failure: +test_extraattr(SOAP::TestExtrAttr) [/home/spox/Projects/soap4r/test/soap/test_extraattr.rb:40]: +<"\n\n \n \n \n \n \n \n"> expected but was +<"\n\n \n \n \n \n \n \n">. + +diff: + ++ +? - ++ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ++ xmlns:xsd="http://www.w3.org/2001/XMLSchema" ++ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> + + + + + + + + + 9) Error: +test_encode(SOAP::TestGenerator): +TypeError: can't dup NilClass + /home/spox/Projects/soap4r/test/soap/test_generator.rb:17:in `dup' + /home/spox/Projects/soap4r/test/soap/test_generator.rb:17:in `test_encode' + + 10) Error: +test_map(SOAP::TestMap): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/Projects/soap4r/test/soap/test_custommap.rb:82:in `test_map' + + 11) Error: +test_rpc(SOAP::TestMap): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `echo' + /home/spox/Projects/soap4r/test/soap/test_custommap.rb:94:in `test_rpc' + + 12) Error: +test_date(SOAP::TestMapping): +NoMethodError: private method `jd_to_ajd' called for DateTime:Class + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/datatypes.rb:542:in `to_date' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/datatypes.rb:517:in `to_obj' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/mapping/factory.rb:198:in `soap2obj' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/mapping/encodedregistry.rb:86:in `block in soap2obj' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/mapping/encodedregistry.rb:84:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/mapping/encodedregistry.rb:84:in `soap2obj' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/mapping/encodedregistry.rb:379:in `_soap2obj' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/mapping/encodedregistry.rb:309:in `soap2obj' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/mapping/mapping.rb:154:in `_soap2obj' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/mapping/mapping.rb:65:in `block in soap2obj' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/mapping/mapping.rb:560:in `block in protect_mapping' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/mapping/mapping.rb:533:in `protect_threadvars' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/mapping/mapping.rb:549:in `protect_mapping' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/mapping/mapping.rb:64:in `soap2obj' + /home/spox/Projects/soap4r/test/soap/test_mapping.rb:126:in `convert' + /home/spox/Projects/soap4r/test/soap/test_mapping.rb:98:in `block in test_date' + /home/spox/Projects/soap4r/test/soap/test_mapping.rb:96:in `each' + /home/spox/Projects/soap4r/test/soap/test_mapping.rb:96:in `test_date' + + 13) Error: +test_mappable(SOAP::TestMapping): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/test_mapping.rb:51:in `test_mappable' + + 14) Failure: +test_nestedexception(SOAP::TestNestedException) + [/home/spox/Projects/soap4r/test/soap/test_nestedexception.rb:37:in `rescue in test_nestedexception' + /home/spox/Projects/soap4r/test/soap/test_nestedexception.rb:32:in `test_nestedexception']: +<[":15:in `foo'", + ":33:in `test_nestedexception'", + ":23:in `bar': bar (SOAP::TestNestedException::MyError) [NESTED]", + ":13:in `foo'", + ":33:in `test_nestedexception'", + ":28:in `baz': baz (SOAP::TestNestedException::MyError) [NESTED]", + ":21:in `bar'", + ":13:in `foo'", + ":33:in `test_nestedexception'"]> expected but was +<[":15:in `rescue in foo'", + ":12:in `foo'", + ":33:in `test_nestedexception'", + ":7:in `
'", + ":23:in `rescue in bar': bar (SOAP::TestNestedException::MyError) [NESTED]", + ":20:in `bar'", + ":13:in `foo'", + ":33:in `test_nestedexception'", + ":7:in `
'", + ":28:in `baz': baz (SOAP::TestNestedException::MyError) [NESTED]", + ":21:in `bar'", + ":13:in `foo'", + ":33:in `test_nestedexception'", + ":7:in `
'"]>. + +diff: ++ [":15:in `rescue in foo'", +- [":15:in `foo'", +? ^ ^ ++ ":12:in `foo'", +? ^ ^ + ":33:in `test_nestedexception'", ++ ":7:in `
'", +- ":23:in `bar': bar (SOAP::TestNestedException::MyError) [NESTED]", ++ ":23:in `rescue in bar': bar (SOAP::TestNestedException::MyError) [NESTED]", +? ++++++++++ ++ ":20:in `bar'", + ":13:in `foo'", + ":33:in `test_nestedexception'", ++ ":7:in `
'", + ":28:in `baz': baz (SOAP::TestNestedException::MyError) [NESTED]", + ":21:in `bar'", + ":13:in `foo'", +- ":33:in `test_nestedexception'"] +? ^ ++ ":33:in `test_nestedexception'", +? ^ ++ ":7:in `
'"] + + 15) Error: +test_soaplite_nil(SOAP::TestNil): +REXML::UndefinedNamespaceException: Undefined prefix xsi found + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:419:in `block in pull' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/set.rb:211:in `block in each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/set.rb:211:in `each_key' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/set.rb:211:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:417:in `pull' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/treeparser.rb:22:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:228:in `build' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:43:in `initialize' + /home/spox/Projects/soap4r/test/soap/test_nil.rb:47:in `new' + /home/spox/Projects/soap4r/test/soap/test_nil.rb:47:in `test_soaplite_nil' + + 16) Error: +test_indent(SOAP::TestNoIndent): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `nop' + /home/spox/Projects/soap4r/test/soap/test_no_indent.rb:69:in `test_indent' + + 17) Error: +test_no_indent(SOAP::TestNoIndent): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `nop' + /home/spox/Projects/soap4r/test/soap/test_no_indent.rb:76:in `test_no_indent' + + 18) Error: +test_cdata(SOAP::TestResponseAsXml): +SOAP::ResponseFormatError: response is not a SOAP envelope: # + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:296:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `hellodoc' + /home/spox/Projects/soap4r/test/soap/test_response_as_xml.rb:101:in `test_cdata' + + 19) Error: +test_hello(SOAP::TestResponseAsXml): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `hello' + /home/spox/Projects/soap4r/test/soap/test_response_as_xml.rb:78:in `test_hello' + + 20) Error: +test_basic_auth(SOAP::TestStreamHandler): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `do_server_proc_basic_auth' + /home/spox/Projects/soap4r/test/soap/test_streamhandler.rb:168:in `test_basic_auth' + + 21) Error: +test_charset(SOAP::TestStreamHandler): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `do_server_proc' + /home/spox/Projects/soap4r/test/soap/test_streamhandler.rb:204:in `test_charset' + + 22) Error: +test_custom_streamhandler(SOAP::TestStreamHandler): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `do_server_proc' + /home/spox/Projects/soap4r/test/soap/test_streamhandler.rb:217:in `test_custom_streamhandler' + + 23) Error: +test_normal(SOAP::TestStreamHandler): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `do_server_proc' + /home/spox/Projects/soap4r/test/soap/test_streamhandler.rb:138:in `test_normal' + + 24) Error: +test_proxy(SOAP::TestStreamHandler): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `do_server_proc' + /home/spox/Projects/soap4r/test/soap/test_streamhandler.rb:185:in `test_proxy' + + 25) Error: +test_uri(SOAP::TestStreamHandler): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `do_server_proc' + /home/spox/Projects/soap4r/test/soap/test_streamhandler.rb:151:in `test_uri' + + 26) Error: +test_doc_enc_doc_enc(SOAP::TestStyleUse): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `rpc_enc_rpc_enc' + /home/spox/Projects/soap4r/test/soap/test_styleuse.rb:292:in `test_doc_enc_doc_enc' + + 27) Error: +test_doc_enc_doc_lit(SOAP::TestStyleUse): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `doc_enc_doc_lit' + /home/spox/Projects/soap4r/test/soap/test_styleuse.rb:309:in `test_doc_enc_doc_lit' + + 28) Error: +test_doc_lit_doc_enc(SOAP::TestStyleUse): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `doc_lit_doc_enc' + /home/spox/Projects/soap4r/test/soap/test_styleuse.rb:299:in `test_doc_lit_doc_enc' + + 29) Error: +test_doc_lit_doc_lit(SOAP::TestStyleUse): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `doc_lit_doc_lit' + /home/spox/Projects/soap4r/test/soap/test_styleuse.rb:319:in `test_doc_lit_doc_lit' + + 30) Error: +test_rpc_enc_rpc_enc(SOAP::TestStyleUse): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `rpc_enc_rpc_enc' + /home/spox/Projects/soap4r/test/soap/test_styleuse.rb:252:in `test_rpc_enc_rpc_enc' + + 31) Error: +test_rpc_enc_rpc_lit(SOAP::TestStyleUse): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `rpc_enc_rpc_lit' + /home/spox/Projects/soap4r/test/soap/test_styleuse.rb:278:in `test_rpc_enc_rpc_lit' + + 32) Error: +test_rpc_lit_rpc_enc(SOAP::TestStyleUse): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `rpc_lit_rpc_enc' + /home/spox/Projects/soap4r/test/soap/test_styleuse.rb:261:in `test_rpc_lit_rpc_enc' + + 33) Error: +test_rpc_lit_rpc_lit(SOAP::TestStyleUse): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `rpc_lit_rpc_lit' + /home/spox/Projects/soap4r/test/soap/test_styleuse.rb:283:in `test_rpc_lit_rpc_lit' + + 34) Error: +test_aspdotnethandler(SOAP::ASPDotNet::TestASPDotNet): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `sayHello' + /home/spox/Projects/soap4r/test/soap/asp.net/test_aspdotnet.rb:87:in `test_aspdotnethandler' + + 35) Error: +test_aspdotnethandler_envelope(SOAP::ASPDotNet::TestASPDotNet): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `sayHello' + /home/spox/Projects/soap4r/test/soap/asp.net/test_aspdotnet.rb:110:in `test_aspdotnethandler_envelope' + + 36) Error: +test_document_method(SOAP::ASPDotNet::TestASPDotNet): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `sayHello' + /home/spox/Projects/soap4r/test/soap/asp.net/test_aspdotnet.rb:61:in `test_document_method' + + 37) Error: +test_xml(SOAP::ASPDotNet::TestASPDotNet): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `sayHello' + /home/spox/Projects/soap4r/test/soap/asp.net/test_aspdotnet.rb:77:in `test_xml' + + 38) Error: +test_direct(SOAP::Auth::TestBasic): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `do_server_proc' + /home/spox/Projects/soap4r/test/soap/auth/test_basic.rb:104:in `test_direct' + + 39) Error: +test_proxy(SOAP::Auth::TestBasic): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `do_server_proc' + /home/spox/Projects/soap4r/test/soap/auth/test_basic.rb:112:in `test_proxy' + + 40) Error: +test_direct(SOAP::Auth::TestDigest): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `do_server_proc' + /home/spox/Projects/soap4r/test/soap/auth/test_digest.rb:105:in `test_direct' + + 41) Error: +test_proxy(SOAP::Auth::TestDigest): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `do_server_proc' + /home/spox/Projects/soap4r/test/soap/auth/test_digest.rb:113:in `test_proxy' + + 42) Error: +test_calc(SOAP::Calc::TestCalc): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `add' + /home/spox/Projects/soap4r/test/soap/calc/test_calc.rb:37:in `test_calc' + + 43) Error: +test_calc2(SOAP::Calc::TestCalc2): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `set_value' + /home/spox/Projects/soap4r/test/soap/calc/test_calc2.rb:41:in `test_calc2' + + 44) Error: +test_calc_cgi(SOAP::Calc::TestCalcCGI): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `add' + /home/spox/Projects/soap4r/test/soap/calc/test_calc_cgi.rb:57:in `test_calc_cgi' + + 45) Failure: +test_mapping(SOAP::Case::TestMapping) [/home/spox/Projects/soap4r/test/soap/case/test_mapping.rb:52]: +<"\n\n \n \n dsn\n password\n schema\n username\n \n \n"> expected but was +<"\n\n \n \n dsn\n password\n schema\n username\n \n \n">. + +diff: + +- +? + +- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + +- +? ^^^ - ++ +- dsn +? ^ ^ ++ dsn +? ^ ^ +- password +? ^ ^ ++ password +? ^ ^ +- schema +? ^ ^ ++ schema +? ^ ^ +- username +? ^ ^ ++ username +? ^ ^ + + + + +folded diff: + +- +? + +- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + +- +? ++++++++++++ + +- env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> +- dsn +? ^ ^ ++ dsn +? ^ ^ +- password +? ^ ^ ++ password +? ^ ^ +- schema +? ^ ^ ++ schema +? ^ ^ +- username +? ^ ^ ++ username +? ^ ^ + + + + + 46) Error: +test_custom_fault(SOAP::Fault::TestCustomFault): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `fault' + /home/spox/Projects/soap4r/test/soap/fault/test_customfault.rb:49:in `test_custom_fault' + + 47) Error: +test_fault(SOAP::Fault::TestFault): +SOAP::ResponseFormatError: response is not a SOAP envelope: soap:Body: soap:Fault: faultcode: soap:Server +faultstring: DN cannot be empty +detail: + + + + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:296:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `hello' + /home/spox/Projects/soap4r/test/soap/fault/test_fault.rb:36:in `test_fault' + + 48) Error: +test_parse_fault(SOAP::Fault::TestSOAPArray): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/Projects/soap4r/test/soap/fault/test_soaparray.rb:17:in `test_parse_fault' + + 49) Error: +test_call(SOAP::Filter::TestFilter): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `echo' + /home/spox/Projects/soap4r/test/soap/filter/test_filter.rb:140:in `test_call' + + 50) Failure: +test_authfailure(SOAP::Header::TestAuthHeader) [/home/spox/Projects/soap4r/test/soap/header/test_authheader.rb:232]: + exception expected but was +Class: +Message: <"illegal element format: env:encodingStyle"> +---Backtrace--- +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' +(eval):6:in `deposit' +/home/spox/Projects/soap4r/test/soap/header/test_authheader.rb:233:in `block in test_authfailure' +/home/spox/Projects/soap4r/test/soap/header/test_authheader.rb:232:in `test_authfailure' +--------------- + + 51) Failure: +test_mu(SOAP::Header::TestAuthHeader) [/home/spox/Projects/soap4r/test/soap/header/test_authheader.rb:212]: + exception expected but was +Class: +Message: <"illegal element format: env:encodingStyle"> +---Backtrace--- +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' +(eval):6:in `deposit' +/home/spox/Projects/soap4r/test/soap/header/test_authheader.rb:213:in `block in test_mu' +/home/spox/Projects/soap4r/test/soap/header/test_authheader.rb:212:in `test_mu' +--------------- + + 52) Error: +test_no_mu(SOAP::Header::TestAuthHeader): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `deposit' + /home/spox/Projects/soap4r/test/soap/header/test_authheader.rb:221:in `do_transaction_check' + /home/spox/Projects/soap4r/test/soap/header/test_authheader.rb:205:in `test_no_mu' + + 53) Error: +test_success_mu(SOAP::Header::TestAuthHeader): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `deposit' + /home/spox/Projects/soap4r/test/soap/header/test_authheader.rb:221:in `do_transaction_check' + /home/spox/Projects/soap4r/test/soap/header/test_authheader.rb:198:in `test_success_mu' + + 54) Error: +test_success_no_mu(SOAP::Header::TestAuthHeader): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `deposit' + /home/spox/Projects/soap4r/test/soap/header/test_authheader.rb:221:in `do_transaction_check' + /home/spox/Projects/soap4r/test/soap/header/test_authheader.rb:192:in `test_success_no_mu' + + 55) Failure: +test_authfailure(SOAP::Header::TestAuthHeaderCGI) [/home/spox/Projects/soap4r/test/soap/header/test_authheader_cgi.rb:113]: + exception expected but was +Class: +Message: <"illegal element format: env:encodingStyle"> +---Backtrace--- +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' +(eval):6:in `deposit' +/home/spox/Projects/soap4r/test/soap/header/test_authheader_cgi.rb:114:in `block in test_authfailure' +/home/spox/Projects/soap4r/test/soap/header/test_authheader_cgi.rb:113:in `test_authfailure' +--------------- + + 56) Error: +test_authfailure(SOAP::Header::TestAuthHeaderCGI): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `delete_sessiondb' + /home/spox/Projects/soap4r/test/soap/header/test_authheader_cgi.rb:87:in `teardown' + + 57) Error: +test_success(SOAP::Header::TestAuthHeaderCGI): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/Projects/soap4r/test/soap/header/test_authheader_cgi.rb:62:in `new' + /home/spox/Projects/soap4r/test/soap/header/test_authheader_cgi.rb:62:in `setup_server' + /home/spox/Projects/soap4r/test/soap/header/test_authheader_cgi.rb:54:in `setup' + + 58) Error: +test_string(SOAP::Header::TestSimpleHandler): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/soap/header/test_simplehandler.rb:27:in `initialize' + /home/spox/Projects/soap4r/test/soap/header/test_simplehandler.rb:78:in `new' + /home/spox/Projects/soap4r/test/soap/header/test_simplehandler.rb:78:in `setup_server' + /home/spox/Projects/soap4r/test/soap/header/test_simplehandler.rb:73:in `setup' + + 59) Error: +test_hello_world(SOAP::HelloWorld::TestHelloWorld): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/soap/helloworld/test_helloworld.rb:14:in `new' + /home/spox/Projects/soap4r/test/soap/helloworld/test_helloworld.rb:14:in `setup' + + 60) Error: +test_amazonresponse(SOAP::Marshal::TestDefinedArray): +XSD::NS::FormatError: illegal element format: Name + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:291:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:190:in `route' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/proxy.rb:149:in `call' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/driver.rb:151:in `call' + (eval):6:in `itemSearch' + /home/spox/Projects/soap4r/test/soap/literalArrayMapping/test_definedarray.rb:27:in `test_amazonresponse' + + 61) Error: +test_marshal(SOAP::Marshal::TestDigraph): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/Projects/soap4r/test/soap/marshal/test_digraph.rb:42:in `test_marshal' + + 62) Error: +test_array(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:84:in `test_array' + + 63) Error: +test_array_ivar(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:95:in `test_array_ivar' + + 64) Error: +test_array_subclass(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:89:in `test_array_subclass' + + 65) Error: +test_bignum(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:165:in `test_bignum' + + 66) Error: +test_exception(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:100:in `test_exception' + + 67) Error: +test_exception_subclass(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:105:in `test_exception_subclass' + + 68) Error: +test_extend(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:431:in `test_extend' + + 69) Error: +test_extend_string(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:444:in `test_extend_string' + + 70) Error: +test_false(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:109:in `test_false' + + 71) Error: +test_fixnum(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:172:in `test_fixnum' + + 72) Error: +test_fixnum_ivar(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:183:in `test_fixnum_ivar' + + 73) Error: +test_fixnum_ivar_self(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:191:in `test_fixnum_ivar_self' + + 74) Error: +test_float(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:197:in `test_float' + + 75) Error: +test_float_extend(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:224:in `test_float_extend' + + 76) Error: +test_float_inf_nan(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:203:in `test_float_inf_nan' + + 77) Error: +test_float_ivar(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:212:in `test_float_ivar' + + 78) Error: +test_float_ivar_self(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: href + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:218:in `test_float_ivar_self' + + 79) Error: +test_hash(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:114:in `test_hash' + + 80) Error: +test_hash_default(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:120:in `test_hash_default' + + 81) Error: +test_hash_extend(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:143:in `test_hash_extend' + + 82) Error: +test_hash_ivar(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:137:in `test_hash_ivar' + + 83) Error: +test_hash_subclass(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:126:in `test_hash_subclass' + + 84) Error: +test_hash_subclass_extend(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:155:in `test_hash_subclass_extend' + + 85) Error: +test_nil(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:391:in `test_nil' + + 86) Error: +test_object(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:46:in `test_object' + + 87) Error: +test_object_extend(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:56:in `test_object_extend' + + 88) Error: +test_object_subclass(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:50:in `test_object_subclass' + + 89) Error: +test_object_subclass_extend(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:68:in `test_object_subclass_extend' + + 90) Error: +test_range(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:235:in `test_range' + + 91) Error: +test_range_cyclic(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: href + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:408:in `test_range_cyclic' + + 92) Error: +test_range_subclass(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:240:in `test_range_subclass' + + 93) Error: +test_regexp(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:245:in `test_regexp' + + 94) Error: +test_regexp_subclass(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:251:in `test_regexp_subclass' + + 95) Error: +test_share(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:397:in `test_share' + + 96) Failure: +test_singleton(SOAP::Marshal::TestMarshal) [/home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:424]: + exception expected but was +Class: +Message: <"illegal element format: env:encodingStyle"> +---Backtrace--- +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' +/home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' +/home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' +/home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' +/home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:424:in `block in test_singleton' +/home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:424:in `test_singleton' +--------------- + + 97) Error: +test_string(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:256:in `test_string' + + 98) Error: +test_string_crlf(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:468:in `test_string_crlf' + + 99) Error: +test_string_empty(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:464:in `test_string_empty' + +100) Error: +test_string_escape(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:472:in `test_string_escape' + +101) Error: +test_string_ivar(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:262:in `test_string_ivar' + +102) Error: +test_string_subclass(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:266:in `test_string_subclass' + +103) Error: +test_string_subclass_cycle(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: href + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:272:in `test_string_subclass_cycle' + +104) Error: +test_string_subclass_extend(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:282:in `test_string_subclass_extend' + +105) Error: +test_struct(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:304:in `test_struct' + +106) Error: +test_struct_ivar(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:319:in `test_struct_ivar' + +107) Error: +test_struct_subclass(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:313:in `test_struct_subclass' + +108) Error: +test_struct_subclass_extend(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:325:in `test_struct_subclass_extend' + +109) Error: +test_struct_toplevel(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:492:in `test_struct_toplevel' + +110) Error: +test_symbol(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:335:in `test_symbol' + +111) Error: +test_time(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:372:in `block in test_time' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:370:in `times' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:370:in `test_time' + +112) Error: +test_time_ivar(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:383:in `test_time_ivar' + +113) Error: +test_time_subclass(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:377:in `test_time_subclass' + +114) Error: +test_true(SOAP::Marshal::TestMarshal): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/soap/marshal/test_marshal.rb:19:in `decode' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:21:in `marshaltest' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:27:in `marshal_equal' + /home/spox/Projects/soap4r/test/soap/marshal/marshaltestlib.rb:387:in `test_true' + +115) Error: +test_foo1(SOAP::Marshal::TestStruct): +XSD::NS::FormatError: illegal element format: href + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/Projects/soap4r/test/soap/marshal/test_struct.rb:41:in `convert' + /home/spox/Projects/soap4r/test/soap/marshal/test_struct.rb:19:in `test_foo1' + +116) Error: +test_foo2(SOAP::Marshal::TestStruct): +XSD::NS::FormatError: illegal element format: href + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/Projects/soap4r/test/soap/marshal/test_struct.rb:41:in `convert' + /home/spox/Projects/soap4r/test/soap/marshal/test_struct.rb:27:in `test_foo2' + +117) Error: +test_foo3(SOAP::Marshal::TestStruct): +XSD::NS::FormatError: illegal element format: href + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/Projects/soap4r/test/soap/marshal/test_struct.rb:41:in `convert' + /home/spox/Projects/soap4r/test/soap/marshal/test_struct.rb:35:in `test_foo3' + +118) Error: +test_ciphers(SOAP::SSL::TestSSL): +NoMethodError: undefined method `chomp' for nil:NilClass + /home/spox/Projects/soap4r/test/soap/ssl/test_ssl.rb:206:in `setup_server' + /home/spox/Projects/soap4r/test/soap/ssl/test_ssl.rb:27:in `setup' + +119) Error: +test_options(SOAP::SSL::TestSSL): +NoMethodError: undefined method `chomp' for nil:NilClass + /home/spox/Projects/soap4r/test/soap/ssl/test_ssl.rb:206:in `setup_server' + /home/spox/Projects/soap4r/test/soap/ssl/test_ssl.rb:27:in `setup' + +120) Error: +test_property(SOAP::SSL::TestSSL): +NoMethodError: undefined method `chomp' for nil:NilClass + /home/spox/Projects/soap4r/test/soap/ssl/test_ssl.rb:206:in `setup_server' + /home/spox/Projects/soap4r/test/soap/ssl/test_ssl.rb:27:in `setup' + +121) Error: +test_verification(SOAP::SSL::TestSSL): +NoMethodError: undefined method `chomp' for nil:NilClass + /home/spox/Projects/soap4r/test/soap/ssl/test_ssl.rb:206:in `setup_server' + /home/spox/Projects/soap4r/test/soap/ssl/test_ssl.rb:27:in `setup' + +122) Error: +test_struct(SOAP::Struct::TestStruct): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/Projects/soap4r/test/soap/struct/test_struct.rb:32:in `new' + /home/spox/Projects/soap4r/test/soap/struct/test_struct.rb:32:in `setup_server' + /home/spox/Projects/soap4r/test/soap/struct/test_struct.rb:27:in `setup' + +123) Error: +test_get_file(SOAP::SWA::TestFile): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/soap/swa/test_file.rb:29:in `new' + /home/spox/Projects/soap4r/test/soap/swa/test_file.rb:29:in `setup' + +124) Error: +test_put_file(SOAP::SWA::TestFile): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/soap/swa/test_file.rb:29:in `new' + /home/spox/Projects/soap4r/test/soap/swa/test_file.rb:29:in `setup' + +125) Error: +test_rpc_driver(SOAP::TestCalc): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/Projects/soap4r/test/soap/wsdlDriver/test_calc.rb:30:in `new' + /home/spox/Projects/soap4r/test/soap/wsdlDriver/test_calc.rb:30:in `setup_server' + /home/spox/Projects/soap4r/test/soap/wsdlDriver/test_calc.rb:25:in `setup' + +126) Error: +test_document(SOAP::TestDocument): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/soap/wsdlDriver/test_document.rb:33:in `new' + /home/spox/Projects/soap4r/test/soap/wsdlDriver/test_document.rb:33:in `setup_server' + /home/spox/Projects/soap4r/test/soap/wsdlDriver/test_document.rb:28:in `setup' + +127) Error: +test_ping(SOAP::TestSimpleType): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/Projects/soap4r/test/soap/wsdlDriver/test_simpletype.rb:33:in `new' + /home/spox/Projects/soap4r/test/soap/wsdlDriver/test_simpletype.rb:33:in `setup_server' + /home/spox/Projects/soap4r/test/soap/wsdlDriver/test_simpletype.rb:28:in `setup' + +128) Error: +test_by_wsdl(WSDL::TestFault): +XSD::NS::FormatError: illegal element format: env:encodingStyle + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/Projects/soap4r/test/wsdl/test_fault.rb:40:in `test_by_wsdl' + +129) Error: +test_multiplefault(WSDL::TestMultipleFault): +NameError: uninitialized constant WSDL::TestMultipleFault::AuthenticationError + /home/spox/Projects/soap4r/test/wsdl/test_multiplefault.rb:21:in `block in test_multiplefault' + /home/spox/Projects/soap4r/test/wsdl/test_multiplefault.rb:34:in `yield_eval_binding' + /home/spox/Projects/soap4r/test/wsdl/test_multiplefault.rb:19:in `test_multiplefault' + +130) Error: +test_literal_stub(WSDL::Abstract::TestAbstract): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {http://schemas.xmlsoap.org/wsdl/}wsdl:definitions + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:31:in `rescue in parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:28:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:206:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:36:in `run' + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:80:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:49:in `setup' + +131) Error: +test_literal_stub(WSDL::Abstract::TestAbstract): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/abstract/abstract.rb + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:57:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:57:in `teardown' + +132) Error: +test_stub(WSDL::Abstract::TestAbstract): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {http://schemas.xmlsoap.org/wsdl/}wsdl:definitions + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:31:in `rescue in parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:28:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:206:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:36:in `run' + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:80:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:49:in `setup' + +133) Error: +test_stub(WSDL::Abstract::TestAbstract): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/abstract/abstract.rb + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:57:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:57:in `teardown' + +134) Error: +test_stub_derived(WSDL::Abstract::TestAbstract): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {http://schemas.xmlsoap.org/wsdl/}wsdl:definitions + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:31:in `rescue in parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:28:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:206:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:36:in `run' + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:80:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:49:in `setup' + +135) Error: +test_stub_derived(WSDL::Abstract::TestAbstract): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/abstract/abstract.rb + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:57:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:57:in `teardown' + +136) Error: +test_wsdl(WSDL::Abstract::TestAbstract): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {http://schemas.xmlsoap.org/wsdl/}wsdl:definitions + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:31:in `rescue in parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:28:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:206:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:36:in `run' + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:80:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:49:in `setup' + +137) Error: +test_wsdl(WSDL::Abstract::TestAbstract): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/abstract/abstract.rb + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:57:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/abstract/test_abstract.rb:57:in `teardown' + +138) Error: +test_anonymous_mapping(WSDL::Anonymous::TestAnonymous): +NoMethodError: undefined method `each' for "WSDL::Anonymous":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/anonymous/test_anonymous.rb:83:in `setup_clientdef' + /home/spox/Projects/soap4r/test/wsdl/anonymous/test_anonymous.rb:52:in `setup' + +139) Error: +test_stub(WSDL::Anonymous::TestAnonymous): +NoMethodError: undefined method `each' for "WSDL::Anonymous":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/anonymous/test_anonymous.rb:83:in `setup_clientdef' + /home/spox/Projects/soap4r/test/wsdl/anonymous/test_anonymous.rb:52:in `setup' + +140) Error: +test_stubgeneration(WSDL::Anonymous::TestAnonymous): +NoMethodError: undefined method `each' for "WSDL::Anonymous":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/anonymous/test_anonymous.rb:83:in `setup_clientdef' + /home/spox/Projects/soap4r/test/wsdl/anonymous/test_anonymous.rb:52:in `setup' + +141) Error: +test_any(WSDL::Any::TestAny): +RuntimeError: {http://schemas.xmlsoap.org/wsdl/}tns:echo_binding not found + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/port.rb:36:in `find_binding' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:25:in `on_init' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:41:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:89:in `new' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:89:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:70:in `setup' + +142) Error: +test_anyreturl_wsdl(WSDL::Any::TestAny): +RuntimeError: {http://schemas.xmlsoap.org/wsdl/}tns:echo_binding not found + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/port.rb:36:in `find_binding' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:25:in `on_init' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:41:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:89:in `new' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:89:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:70:in `setup' + +143) Error: +test_naive(WSDL::Any::TestAny): +RuntimeError: {http://schemas.xmlsoap.org/wsdl/}tns:echo_binding not found + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/port.rb:36:in `find_binding' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:25:in `on_init' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:41:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:89:in `new' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:89:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:70:in `setup' + +144) Error: +test_wsdl(WSDL::Any::TestAny): +RuntimeError: {http://schemas.xmlsoap.org/wsdl/}tns:echo_binding not found + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/port.rb:36:in `find_binding' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:25:in `on_init' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:41:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:89:in `new' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:89:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/any/test_any.rb:70:in `setup' + +145) Error: +test_by_stub(WSDL::AxisArray::TestAxisArray): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {http://schemas.xmlsoap.org/wsdl/}wsdl:definitions + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:31:in `rescue in parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:28:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:206:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:36:in `run' + /home/spox/Projects/soap4r/test/wsdl/axisArray/test_axisarray.rb:63:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/axisArray/test_axisarray.rb:42:in `setup' + +146) Error: +test_by_stub(WSDL::AxisArray::TestAxisArray): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/axisArray/itemList.rb + /home/spox/Projects/soap4r/test/wsdl/axisArray/test_axisarray.rb:47:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/axisArray/test_axisarray.rb:47:in `teardown' + +147) Error: +test_by_wsdl(WSDL::AxisArray::TestAxisArray): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {http://schemas.xmlsoap.org/wsdl/}wsdl:definitions + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:31:in `rescue in parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:28:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:206:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:36:in `run' + /home/spox/Projects/soap4r/test/wsdl/axisArray/test_axisarray.rb:63:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/axisArray/test_axisarray.rb:42:in `setup' + +148) Error: +test_by_wsdl(WSDL::AxisArray::TestAxisArray): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/axisArray/itemList.rb + /home/spox/Projects/soap4r/test/wsdl/axisArray/test_axisarray.rb:47:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/axisArray/test_axisarray.rb:47:in `teardown' + +149) Error: +test_multiref_long(WSDL::AxisArray::TestAxisArray): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {http://schemas.xmlsoap.org/wsdl/}wsdl:definitions + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:31:in `rescue in parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:28:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:206:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:36:in `run' + /home/spox/Projects/soap4r/test/wsdl/axisArray/test_axisarray.rb:63:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/axisArray/test_axisarray.rb:42:in `setup' + +150) Error: +test_multiref_long(WSDL::AxisArray::TestAxisArray): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/axisArray/itemList.rb + /home/spox/Projects/soap4r/test/wsdl/axisArray/test_axisarray.rb:47:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/axisArray/test_axisarray.rb:47:in `teardown' + +151) Error: +test_naive(WSDL::Choice::TestChoice): +NoMethodError: undefined method `each' for "WSDL::Choice":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:90:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:59:in `setup' + +152) Error: +test_naive_with_map_complex(WSDL::Choice::TestChoice): +NoMethodError: undefined method `each' for "WSDL::Choice":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:90:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:59:in `setup' + +153) Error: +test_naive_with_stub_complex(WSDL::Choice::TestChoice): +NoMethodError: undefined method `each' for "WSDL::Choice":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:90:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:59:in `setup' + +154) Error: +test_stub_emptyArrayAtFirst(WSDL::Choice::TestChoice): +NoMethodError: undefined method `each' for "WSDL::Choice":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:90:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:59:in `setup' + +155) Error: +test_wsdl(WSDL::Choice::TestChoice): +NoMethodError: undefined method `each' for "WSDL::Choice":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:90:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:59:in `setup' + +156) Error: +test_wsdl_with_map_complex(WSDL::Choice::TestChoice): +NoMethodError: undefined method `each' for "WSDL::Choice":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:90:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:59:in `setup' + +157) Error: +test_wsdl_with_stub_complex(WSDL::Choice::TestChoice): +NoMethodError: undefined method `each' for "WSDL::Choice":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:90:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/choice/test_choice.rb:59:in `setup' + +158) Error: +test_wsdl(WSDL::ComplexContent::TestEcho): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/complexcontent/test_echo.rb:50:in `new' + /home/spox/Projects/soap4r/test/wsdl/complexcontent/test_echo.rb:50:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/complexcontent/test_echo.rb:35:in `setup' + +159) Error: +test_wsdl(WSDL::ComplexContent::TestEcho): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/complexcontent/complexContent.rb + /home/spox/Projects/soap4r/test/wsdl/complexcontent/test_echo.rb:43:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/complexcontent/test_echo.rb:43:in `teardown' + +160) Error: +test_datetime(WSDL::Datetime::TestDatetime): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/datetime/DatetimeService.rb:23:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/datetime/test_datetime.rb:21:in `new' + /home/spox/Projects/soap4r/test/wsdl/datetime/test_datetime.rb:21:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/datetime/test_datetime.rb:16:in `setup' + +161) Error: +test_nil(WSDL::Datetime::TestDatetime): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/datetime/DatetimeService.rb:23:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/datetime/test_datetime.rb:21:in `new' + /home/spox/Projects/soap4r/test/wsdl/datetime/test_datetime.rb:21:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/datetime/test_datetime.rb:16:in `setup' + +162) Error: +test_time(WSDL::Datetime::TestDatetime): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/datetime/DatetimeService.rb:23:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/datetime/test_datetime.rb:21:in `new' + /home/spox/Projects/soap4r/test/wsdl/datetime/test_datetime.rb:21:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/datetime/test_datetime.rb:16:in `setup' + +163) Error: +test_with_soapaction(WSDL::Document::TestNoSOAPAction): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/document/test_nosoapaction.rb:63:in `new' + /home/spox/Projects/soap4r/test/wsdl/document/test_nosoapaction.rb:63:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/document/test_nosoapaction.rb:53:in `setup' + +164) Error: +test_without_soapaction(WSDL::Document::TestNoSOAPAction): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/document/test_nosoapaction.rb:63:in `new' + /home/spox/Projects/soap4r/test/wsdl/document/test_nosoapaction.rb:63:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/document/test_nosoapaction.rb:53:in `setup' + +165) Error: +test_wsdl(WSDL::Document::TestNumber): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/document/test_number.rb:47:in `new' + /home/spox/Projects/soap4r/test/wsdl/document/test_number.rb:47:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/document/test_number.rb:35:in `setup' + +166) Error: +test_wsdl(WSDL::Document::TestNumber): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/document/foo.rb + /home/spox/Projects/soap4r/test/wsdl/document/test_number.rb:42:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/document/test_number.rb:42:in `teardown' + +167) Error: +test_driver_stub(WSDL::Document::TestRPC): +NoMethodError: undefined method `each' for "WSDL::Document":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:108:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:79:in `setup' + +168) Error: +test_empty(WSDL::Document::TestRPC): +NoMethodError: undefined method `each' for "WSDL::Document":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:108:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:79:in `setup' + +169) Error: +test_naive(WSDL::Document::TestRPC): +NoMethodError: undefined method `each' for "WSDL::Document":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:108:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:79:in `setup' + +170) Error: +test_nil(WSDL::Document::TestRPC): +NoMethodError: undefined method `each' for "WSDL::Document":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:108:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:79:in `setup' + +171) Error: +test_nil_attribute(WSDL::Document::TestRPC): +NoMethodError: undefined method `each' for "WSDL::Document":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:108:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:79:in `setup' + +172) Error: +test_to_xml(WSDL::Document::TestRPC): +NoMethodError: undefined method `each' for "WSDL::Document":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:108:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:79:in `setup' + +173) Error: +test_wsdl(WSDL::Document::TestRPC): +NoMethodError: undefined method `each' for "WSDL::Document":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:108:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:79:in `setup' + +174) Error: +test_wsdl_with_map(WSDL::Document::TestRPC): +NoMethodError: undefined method `each' for "WSDL::Document":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:108:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/document/test_rpc.rb:79:in `setup' + +175) Error: +test_attribute_array(WSDL::Document::TestArray): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {}wsdl:definitions + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:31:in `rescue in parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:28:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:206:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:36:in `run' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:90:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:59:in `setup' + +176) Error: +test_attribute_array(WSDL::Document::TestArray): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/document/array/double.rb + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:67:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:67:in `teardown' + +177) Error: +test_stub(WSDL::Document::TestArray): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {}wsdl:definitions + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:31:in `rescue in parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:28:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:206:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:36:in `run' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:90:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:59:in `setup' + +178) Error: +test_stub(WSDL::Document::TestArray): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/document/array/double.rb + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:67:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:67:in `teardown' + +179) Error: +test_stub_nil(WSDL::Document::TestArray): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {}wsdl:definitions + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:31:in `rescue in parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:28:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:206:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:36:in `run' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:90:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:59:in `setup' + +180) Error: +test_stub_nil(WSDL::Document::TestArray): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/document/array/double.rb + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:67:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:67:in `teardown' + +181) Error: +test_wsdl(WSDL::Document::TestArray): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {}wsdl:definitions + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:31:in `rescue in parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:28:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:206:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:36:in `run' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:90:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:59:in `setup' + +182) Error: +test_wsdl(WSDL::Document::TestArray): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/document/array/double.rb + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:67:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:67:in `teardown' + +183) Error: +test_wsdl_stubclassdef(WSDL::Document::TestArray): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {}wsdl:definitions + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:31:in `rescue in parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:28:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:206:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:36:in `run' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:90:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:59:in `setup' + +184) Error: +test_wsdl_stubclassdef(WSDL::Document::TestArray): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/document/array/double.rb + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:67:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/document/array/test_array.rb:67:in `teardown' + +185) Error: +test_driver(WSDL::Fault::TestFault): +NoMethodError: undefined method `collect' for "WSDL::Fault":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/servantSkeltonCreator.rb:34:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:110:in `block in create_servant_skelton' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:108:in `create_servant_skelton' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:64:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/fault/test_fault.rb:60:in `block in setup_classdef' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:28:in `silent' + /home/spox/Projects/soap4r/test/wsdl/fault/test_fault.rb:59:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/fault/test_fault.rb:15:in `setup' + +186) Error: +test_driver(WSDL::Fault::TestFault): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/fault/AddService.rb + /home/spox/Projects/soap4r/test/wsdl/fault/test_fault.rb:26:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/fault/test_fault.rb:26:in `teardown' + +187) Error: +test_wsdl(WSDL::Fault::TestFault): +NoMethodError: undefined method `collect' for "WSDL::Fault":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/servantSkeltonCreator.rb:34:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:110:in `block in create_servant_skelton' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:108:in `create_servant_skelton' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:64:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/fault/test_fault.rb:60:in `block in setup_classdef' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:28:in `silent' + /home/spox/Projects/soap4r/test/wsdl/fault/test_fault.rb:59:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/fault/test_fault.rb:15:in `setup' + +188) Error: +test_wsdl(WSDL::Fault::TestFault): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/fault/AddService.rb + /home/spox/Projects/soap4r/test/wsdl/fault/test_fault.rb:26:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/fault/test_fault.rb:26:in `teardown' + +189) Error: +test_driver(WSDL::Fault::TestMultiFault): +NoMethodError: undefined method `collect' for "WSDL::Fault":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/servantSkeltonCreator.rb:34:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:110:in `block in create_servant_skelton' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:108:in `create_servant_skelton' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:64:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/fault/test_multifault.rb:66:in `block in setup_classdef' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:28:in `silent' + /home/spox/Projects/soap4r/test/wsdl/fault/test_multifault.rb:65:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/fault/test_multifault.rb:15:in `setup' + +190) Error: +test_driver(WSDL::Fault::TestMultiFault): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/fault/AddService.rb + /home/spox/Projects/soap4r/test/wsdl/fault/test_multifault.rb:26:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/fault/test_multifault.rb:26:in `teardown' + +191) Error: +test_wsdl(WSDL::Fault::TestMultiFault): +NoMethodError: undefined method `collect' for "WSDL::Fault":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/servantSkeltonCreator.rb:34:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:110:in `block in create_servant_skelton' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:108:in `create_servant_skelton' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:64:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/fault/test_multifault.rb:66:in `block in setup_classdef' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:28:in `silent' + /home/spox/Projects/soap4r/test/wsdl/fault/test_multifault.rb:65:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/fault/test_multifault.rb:15:in `setup' + +192) Error: +test_wsdl(WSDL::Fault::TestMultiFault): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/fault/AddService.rb + /home/spox/Projects/soap4r/test/wsdl/fault/test_multifault.rb:26:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/fault/test_multifault.rb:26:in `teardown' + +193) Error: +test_generate(WSDL::Group::TestGroup): +NoMethodError: undefined method `each' for "WSDL::Group":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/group/test_rpc.rb:73:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/group/test_rpc.rb:44:in `setup' + +194) Error: +test_naive(WSDL::Group::TestGroup): +NoMethodError: undefined method `each' for "WSDL::Group":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/group/test_rpc.rb:73:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/group/test_rpc.rb:44:in `setup' + +195) Error: +test_stub(WSDL::Group::TestGroup): +NoMethodError: undefined method `each' for "WSDL::Group":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/group/test_rpc.rb:73:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/group/test_rpc.rb:44:in `setup' + +196) Error: +test_wsdl(WSDL::Group::TestGroup): +NoMethodError: undefined method `each' for "WSDL::Group":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/group/test_rpc.rb:73:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/group/test_rpc.rb:44:in `setup' + +197) Error: +test_naive(WSDL::List::TestList): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:50:in `new' + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:50:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:36:in `setup' + +198) Error: +test_naive(WSDL::List::TestList): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/list/list.rb + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:43:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:43:in `teardown' + +199) Error: +test_string_as_a_value(WSDL::List::TestList): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:50:in `new' + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:50:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:36:in `setup' + +200) Error: +test_string_as_a_value(WSDL::List::TestList): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/list/list.rb + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:43:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:43:in `teardown' + +201) Error: +test_wsdl(WSDL::List::TestList): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:50:in `new' + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:50:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:36:in `setup' + +202) Error: +test_wsdl(WSDL::List::TestList): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/list/list.rb + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:43:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/list/test_list.rb:43:in `teardown' + +203) Error: +test_by_wsdl(WSDL::TestMap): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/map/test_map.rb:34:in `new' + /home/spox/Projects/soap4r/test/wsdl/map/test_map.rb:34:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/map/test_map.rb:29:in `setup' + +204) Error: +test_wsdldriver(WSDL::TestMap): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/map/test_map.rb:34:in `new' + /home/spox/Projects/soap4r/test/wsdl/map/test_map.rb:34:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/map/test_map.rb:29:in `setup' + +205) Error: +test_classdef(TestWSDLMarshal): +RuntimeError: Person.rb is different from person_org.rb + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:39:in `filecompare' + /home/spox/Projects/soap4r/test/wsdl/marshal/test_wsdlmarshal.rb:70:in `compare' + /home/spox/Projects/soap4r/test/wsdl/marshal/test_wsdlmarshal.rb:65:in `test_classdef' + +206) Error: +test_marshal(TestWSDLMarshal): +NoMethodError: undefined method `type' for nil:NilClass + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/encodingstyle/soapHandler.rb:357:in `decode_tag_by_wsdl' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/encodingstyle/soapHandler.rb:163:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:181:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:143:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/Projects/soap4r/test/wsdl/marshal/test_wsdlmarshal.rb:28:in `load' + /home/spox/Projects/soap4r/test/wsdl/marshal/test_wsdlmarshal.rb:52:in `test_marshal' + +207) Error: +test_stub(WSDL::Oneway::TestOneway): +NoMethodError: undefined method `each' for "WSDL::Oneway":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/oneway/test_oneway.rb:74:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/oneway/test_oneway.rb:43:in `setup' + +208) Error: +test_wsdl(WSDL::Oneway::TestOneway): +NoMethodError: undefined method `each' for "WSDL::Oneway":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/oneway/test_oneway.rb:74:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/oneway/test_oneway.rb:43:in `setup' + +209) Error: +test_compare(WSDL::Overload::TestOverload): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:70:in `new' + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:70:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:52:in `setup' + +210) Error: +test_compare(WSDL::Overload::TestOverload): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/overload/default.rb + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:60:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:60:in `teardown' + +211) Error: +test_native(WSDL::Overload::TestOverload): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:70:in `new' + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:70:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:52:in `setup' + +212) Error: +test_native(WSDL::Overload::TestOverload): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/overload/default.rb + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:60:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:60:in `teardown' + +213) Error: +test_wsdl(WSDL::Overload::TestOverload): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:70:in `new' + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:70:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:52:in `setup' + +214) Error: +test_wsdl(WSDL::Overload::TestOverload): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/overload/default.rb + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:60:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/overload/test_overload.rb:60:in `teardown' + +215) Error: +test_naive(WSDL::TestQualified): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_qualified.rb:52:in `new' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_qualified.rb:52:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_qualified.rb:36:in `setup' + +216) Error: +test_naive(WSDL::TestQualified): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/qualified/default.rb + /home/spox/Projects/soap4r/test/wsdl/qualified/test_qualified.rb:44:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_qualified.rb:44:in `teardown' + +217) Error: +test_wsdl(WSDL::TestQualified): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_qualified.rb:52:in `new' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_qualified.rb:52:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_qualified.rb:36:in `setup' + +218) Error: +test_wsdl(WSDL::TestQualified): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/qualified/default.rb + /home/spox/Projects/soap4r/test/wsdl/qualified/test_qualified.rb:44:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_qualified.rb:44:in `teardown' + +219) Error: +test_naive(WSDL::TestUnqualified): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_unqualified.rb:52:in `new' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_unqualified.rb:52:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_unqualified.rb:36:in `setup' + +220) Error: +test_naive(WSDL::TestUnqualified): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/qualified/lp.rb + /home/spox/Projects/soap4r/test/wsdl/qualified/test_unqualified.rb:44:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_unqualified.rb:44:in `teardown' + +221) Error: +test_wsdl(WSDL::TestUnqualified): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_unqualified.rb:52:in `new' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_unqualified.rb:52:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_unqualified.rb:36:in `setup' + +222) Error: +test_wsdl(WSDL::TestUnqualified): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/qualified/lp.rb + /home/spox/Projects/soap4r/test/wsdl/qualified/test_unqualified.rb:44:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/qualified/test_unqualified.rb:44:in `teardown' + +223) Error: +test_raa(WSDL::RAA::TestRAA): +RuntimeError: unknown kind of complexContent: + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:251:in `create_complextypedef' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:117:in `block in dump_complextype' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:115:in `collect' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:115:in `dump_complextype' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:57:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:77:in `block in create_classdef' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:76:in `create_classdef' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:62:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/raa/test_raa.rb:32:in `setup_stub' + /home/spox/Projects/soap4r/test/wsdl/raa/test_raa.rb:17:in `setup' + +224) Error: +test_raa(WSDL::RAA::TestRAA): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/raa/RAAMappingRegistry.rb + /home/spox/Projects/soap4r/test/wsdl/raa/test_raa.rb:60:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/raa/test_raa.rb:60:in `teardown' + +225) Error: +test_stub(WSDL::RAA::TestRAA): +RuntimeError: unknown kind of complexContent: + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:251:in `create_complextypedef' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:117:in `block in dump_complextype' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:115:in `collect' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:115:in `dump_complextype' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:57:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:77:in `block in create_classdef' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:76:in `create_classdef' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:62:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/raa/test_raa.rb:32:in `setup_stub' + /home/spox/Projects/soap4r/test/wsdl/raa/test_raa.rb:17:in `setup' + +226) Error: +test_stub(WSDL::RAA::TestRAA): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/raa/RAAMappingRegistry.rb + /home/spox/Projects/soap4r/test/wsdl/raa/test_raa.rb:60:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/raa/test_raa.rb:60:in `teardown' + +227) Error: +test_stubgeneration(WSDL::RAA::TestRAA): +RuntimeError: unknown kind of complexContent: + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:251:in `create_complextypedef' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:117:in `block in dump_complextype' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:115:in `collect' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:115:in `dump_complextype' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.rb:57:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:77:in `block in create_classdef' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:76:in `create_classdef' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:62:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/raa/test_raa.rb:32:in `setup_stub' + /home/spox/Projects/soap4r/test/wsdl/raa/test_raa.rb:17:in `setup' + +228) Error: +test_stubgeneration(WSDL::RAA::TestRAA): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/raa/RAAMappingRegistry.rb + /home/spox/Projects/soap4r/test/wsdl/raa/test_raa.rb:60:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/raa/test_raa.rb:60:in `teardown' + +229) Error: +test_classdef(WSDL::Ref::TestRef): +NoMethodError: undefined method `each' for "WSDL::Ref":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/ref/test_ref.rb:91:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/ref/test_ref.rb:60:in `setup' + +230) Error: +test_naive(WSDL::Ref::TestRef): +NoMethodError: undefined method `each' for "WSDL::Ref":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/ref/test_ref.rb:91:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/ref/test_ref.rb:60:in `setup' + +231) Error: +test_wsdl(WSDL::Ref::TestRef): +NoMethodError: undefined method `each' for "WSDL::Ref":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/ref/test_ref.rb:91:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/ref/test_ref.rb:60:in `setup' + +232) Error: +test_wsdl_with_classdef(WSDL::Ref::TestRef): +NoMethodError: undefined method `each' for "WSDL::Ref":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/ref/test_ref.rb:91:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/ref/test_ref.rb:60:in `setup' + +233) Error: +test_basetype_stub(WSDL::RPC::TestRPC): +NoMethodError: undefined method `each' for "Prefix":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc.rb:97:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc.rb:63:in `setup' + +234) Error: +test_stub(WSDL::RPC::TestRPC): +NoMethodError: undefined method `each' for "Prefix":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc.rb:97:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc.rb:63:in `setup' + +235) Error: +test_stub_nil(WSDL::RPC::TestRPC): +NoMethodError: undefined method `each' for "Prefix":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc.rb:97:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc.rb:63:in `setup' + +236) Error: +test_wsdl(WSDL::RPC::TestRPC): +NoMethodError: undefined method `each' for "Prefix":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc.rb:97:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc.rb:63:in `setup' + +237) Error: +test_stub_echoNestedStruct(WSDL::RPC::TestRPCLIT): +NoMethodError: undefined method `each' for "WSDL::RPC":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:132:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:101:in `setup' + +238) Error: +test_stub_echoNestedStruct_nil(WSDL::RPC::TestRPCLIT): +NoMethodError: undefined method `each' for "WSDL::RPC":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:132:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:101:in `setup' + +239) Error: +test_stub_echoStringArray(WSDL::RPC::TestRPCLIT): +NoMethodError: undefined method `each' for "WSDL::RPC":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:132:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:101:in `setup' + +240) Error: +test_stub_echoStringArrayInline(WSDL::RPC::TestRPCLIT): +NoMethodError: undefined method `each' for "WSDL::RPC":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:132:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:101:in `setup' + +241) Error: +test_stub_echoStructArray(WSDL::RPC::TestRPCLIT): +NoMethodError: undefined method `each' for "WSDL::RPC":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:132:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:101:in `setup' + +242) Error: +test_wsdl_echoNestedStruct(WSDL::RPC::TestRPCLIT): +NoMethodError: undefined method `each' for "WSDL::RPC":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:132:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:101:in `setup' + +243) Error: +test_wsdl_echoNestedStruct_nil(WSDL::RPC::TestRPCLIT): +NoMethodError: undefined method `each' for "WSDL::RPC":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:132:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:101:in `setup' + +244) Error: +test_wsdl_echoStringArray(WSDL::RPC::TestRPCLIT): +NoMethodError: undefined method `each' for "WSDL::RPC":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:132:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:101:in `setup' + +245) Error: +test_wsdl_echoStructArray(WSDL::RPC::TestRPCLIT): +NoMethodError: undefined method `each' for "WSDL::RPC":String + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/driverCreator.rb:36:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:162:in `block in create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:159:in `create_driver' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:68:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:132:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/rpc/test_rpc_lit.rb:101:in `setup' + +246) Error: +test_stub(WSDL::SimpleContent::TestSimpleContent): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {http://schemas.xmlsoap.org/wsdl/}wsdl:definitions + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:31:in `rescue in parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:28:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:206:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:36:in `run' + /home/spox/Projects/soap4r/test/wsdl/simplecontent/test_simplecontent.rb:64:in `setup_classdef' + /home/spox/Projects/soap4r/test/wsdl/simplecontent/test_simplecontent.rb:33:in `setup' + +247) Error: +test_stub(WSDL::SimpleContent::TestSimpleContent): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/simplecontent/simpleContent.rb + /home/spox/Projects/soap4r/test/wsdl/simplecontent/test_simplecontent.rb:41:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/simplecontent/test_simplecontent.rb:41:in `teardown' + +248) Error: +test_ping(WSDL::SimpleType::TestSimpleType): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/simpletype/test_simpletype.rb:43:in `new' + /home/spox/Projects/soap4r/test/wsdl/simpletype/test_simpletype.rb:43:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/simpletype/test_simpletype.rb:38:in `setup' + +249) Error: +test_ping_id(WSDL::SimpleType::TestSimpleType): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/simpletype/test_simpletype.rb:43:in `new' + /home/spox/Projects/soap4r/test/wsdl/simpletype/test_simpletype.rb:43:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/simpletype/test_simpletype.rb:38:in `setup' + +250) Error: +test_rpc(WSDL::SimpleType::TestRPC): +RuntimeError: {http://schemas.xmlsoap.org/wsdl/}tns:echo_version_binding not found + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/port.rb:36:in `find_binding' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/port.rb:32:in `porttype' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/standaloneServerStubCreator.rb:42:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:136:in `block in create_standalone_server_stub' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:132:in `create_standalone_server_stub' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:66:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/simpletype/rpc/test_rpc.rb:29:in `block in test_rpc' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:28:in `silent' + /home/spox/Projects/soap4r/test/wsdl/simpletype/rpc/test_rpc.rb:28:in `test_rpc' + +251) Error: +test_soapbodyparts(WSDL::SOAP::TestSOAPBodyParts): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/soap/test_soapbodyparts.rb:39:in `new' + /home/spox/Projects/soap4r/test/wsdl/soap/test_soapbodyparts.rb:39:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/soap/test_soapbodyparts.rb:34:in `setup' + +252) Error: +test_classdefcreator(WSDL::SOAP::TestWSDL2Ruby): +RuntimeError: {http://schemas.xmlsoap.org/wsdl/}tns:echo_version_binding not found + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/port.rb:36:in `find_binding' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/port.rb:32:in `porttype' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/cgiStubCreator.rb:41:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:123:in `block in create_cgi_stub' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:119:in `create_cgi_stub' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:65:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb:28:in `block (2 levels) in setup' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:28:in `silent' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb:27:in `block in setup' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb:14:in `chdir' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb:14:in `setup' + +253) Error: +test_rpc(WSDL::SOAP::TestWSDL2Ruby): +RuntimeError: {http://schemas.xmlsoap.org/wsdl/}tns:echo_version_binding not found + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/port.rb:36:in `find_binding' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/port.rb:32:in `porttype' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/cgiStubCreator.rb:41:in `dump' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:123:in `block in create_cgi_stub' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:in `block in write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `open' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:in `write_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:119:in `create_cgi_stub' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:65:in `create_file' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:in `run' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb:28:in `block (2 levels) in setup' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:28:in `silent' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb:27:in `block in setup' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb:14:in `chdir' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb:14:in `setup' + +254) Error: +test_classdef(WSDL::SOAP::TestSection): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/section/mysample.rb + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:44:in `initialize' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:44:in `open' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:44:in `loadfile' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:37:in `filecompare' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/section/test_section.rb:48:in `compare' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/section/test_section.rb:23:in `test_classdef' + +255) Error: +test_classdef(WSDL::SOAP::TestSection): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/section/mysample.rb + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/section/test_section.rb:19:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/section/test_section.rb:19:in `teardown' + +256) Error: +test_marshal(WSDL::SOAP::TestSection): +LoadError: no such file to load -- mysample.rb + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:9:in `require' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:9:in `block (3 levels) in require' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:8:in `each' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:8:in `block (2 levels) in require' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:7:in `chdir' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:7:in `block in require' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:28:in `silent' + /home/spox/Projects/soap4r/test/soap/asp.net/../../testutil.rb:6:in `require' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/section/test_section.rb:31:in `test_marshal' + +257) Error: +test_marshal(WSDL::SOAP::TestSection): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/section/mysample.rb + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/section/test_section.rb:19:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/section/test_section.rb:19:in `teardown' + +258) Error: +test_wsdl(WSDL::SOAP::T_WSDL2Ruby::TestSOAPENC): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb:42:in `new' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb:42:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb:29:in `setup' + +259) Error: +test_native(WSDL::RPC::TestSOAPTYPE): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:53:in `new' + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:53:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:37:in `setup' + +260) Error: +test_native(WSDL::RPC::TestSOAPTYPE): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/soaptype/echo.rb + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:45:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:45:in `teardown' + +261) Error: +test_stub(WSDL::RPC::TestSOAPTYPE): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:53:in `new' + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:53:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:37:in `setup' + +262) Error: +test_stub(WSDL::RPC::TestSOAPTYPE): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/soaptype/echo.rb + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:45:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:45:in `teardown' + +263) Error: +test_wsdl(WSDL::RPC::TestSOAPTYPE): +Errno::EADDRINUSE: Address already in use - bind(2) + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:74:in `listen' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `new' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/httpserver.rb:42:in `initialize' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/rpc/standaloneServer.rb:22:in `initialize' + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:53:in `new' + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:53:in `setup_server' + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:37:in `setup' + +264) Error: +test_wsdl(WSDL::RPC::TestSOAPTYPE): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/wsdl/soaptype/echo.rb + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:45:in `unlink' + /home/spox/Projects/soap4r/test/wsdl/soaptype/test_soaptype.rb:45:in `teardown' + +265) Error: +test_no_default_namespace(XSD::TestNS): +XSD::NS::FormatError: illegal element format: attr + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/Projects/soap4r/test/xsd/test_ns.rb:19:in `test_no_default_namespace' + +266) Error: +test_xmllang(XSD::TestNS): +XSD::NS::FormatError: illegal element format: xml:lang + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/ns.rb:153:in `parse_local' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:191:in `block in decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `each' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:190:in `decode_attrs' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:129:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/parser.rb:102:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/processor.rb:39:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:46:in `unmarshal' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/marshal.rb:33:in `load' + /home/spox/Projects/soap4r/test/xsd/test_ns.rb:11:in `test_xmllang' + +267) Error: +test_wsdl(XSD::TestXMLSchemaParser): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {}xs:schema + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/Projects/soap4r/test/xsd/test_xmlschemaparser.rb:14:in `test_wsdl' + +268) Failure: +test_classdef_complex(XSD::CodeGen::TestClassDefCreator) [/home/spox/Projects/soap4r/test/xsd/codegen/test_classdef.rb:22]: +<"moduleFoo;moduleBarclassBaz expected but was +<"moduleFoo;moduleBar\n\nclassBaz. + +diff: +- moduleFoo;moduleBarclassBaz expected but was +<"require'foo/bar'\n# fooclassFooend">. + +diff: +- require'foo/bar'#fooclassFooend ++ require'foo/bar' ++ # fooclassFooend + +270) Failure: +test_emptymethod(XSD::CodeGen::TestClassDefCreator) [/home/spox/Projects/soap4r/test/xsd/codegen/test_classdef.rb:83]: +<"classFoodeffooenddefbarendend"> expected but was +<"classFoo deffooend\n defbarendend">. + +diff: +- classFoodeffooenddefbarendend ++ classFoo deffooend ++ defbarendend + +271) Failure: +test_full(XSD::CodeGen::TestClassDefCreator) [/home/spox/Projects/soap4r/test/xsd/codegen/test_classdef.rb:173]: +<"require'foo/bar'moduleFoo;moduleBar#foo#bar#bazclassHobbitName expected but was +<"require'foo/bar'\nmoduleFoo;moduleBar\n\n# foobarbazclassHobbitName. + +diff: +- require'foo/bar'moduleFoo;moduleBar#foo#bar#bazclassHobbitName expected but was +<"classFoo BAR=1\n classQuxdefquxxQuxx::QUXXXendendmoduleQuxxQUXXX=2end\n defbazQux.new.quxxendend">. + +diff: +- classFooBAR=1classQuxdefquxxQuxx::QUXXXendendmoduleQuxxQUXXX=2enddefbazQux.new.quxxendend ++ classFoo BAR=1 ++ classQuxdefquxxQuxx::QUXXXendendmoduleQuxxQUXXX=2end ++ defbazQux.new.quxxendend + +folded diff: ++ classFoo BAR=1 +- classFooBAR=1classQuxdefquxxQuxx::QUXXXendendmoduleQuxxQUXXX=2enddefbazQux.new +? ^^^^^^^^^^^^^ ------------- ++ classQuxdefquxxQuxx::QUXXXendendmoduleQuxxQUXXX=2end +? ^^ +- .quxxendend ++ defbazQux.new.quxxendend + +273) Failure: +test_require(XSD::CodeGen::TestClassDefCreator) [/home/spox/Projects/soap4r/test/xsd/codegen/test_classdef.rb:35]: +<"require'foo/bar'classFooend"> expected but was +<"require'foo/bar'\nclassFooend">. + +diff: +- require'foo/bar'classFooend ++ require'foo/bar' ++ classFooend + +274) Error: +test_generate(XSD::XSD2Ruby::TestXSD2Ruby): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {}xsd:schema + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:22:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/xsd2ruby.rb:163:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/xsd2ruby.rb:34:in `run' + /home/spox/Projects/soap4r/test/xsd/xsd2ruby/test_xsd2ruby.rb:23:in `block in setup' + /home/spox/Projects/soap4r/test/xsd/xsd2ruby/test_xsd2ruby.rb:13:in `chdir' + /home/spox/Projects/soap4r/test/xsd/xsd2ruby/test_xsd2ruby.rb:13:in `setup' + +275) Error: +test_generate(XSD::XSD2Ruby::TestXSD2Ruby): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/xsd/xsd2ruby/mysample.rb + /home/spox/Projects/soap4r/test/xsd/xsd2ruby/test_xsd2ruby.rb:30:in `unlink' + /home/spox/Projects/soap4r/test/xsd/xsd2ruby/test_xsd2ruby.rb:30:in `teardown' + +276) Error: +test_mapper(XSD::XSD2Ruby::TestXSD2Ruby): +WSDL::XMLSchema::Parser::UnknownElementError: unknown element: {}xsd:schema + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:117:in `decode_tag' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:83:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/parser.rb:71:in `start_element' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:34:in `tag_start' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:24:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/1.9.1/rexml/document.rb:202:in `parse_stream' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/xmlparser/rexmlparser.rb:27:in `do_parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/parser.rb:63:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:49:in `parse' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:37:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:22:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/xsd2ruby.rb:163:in `import' + /home/spox/languages/ruby-1.9.1-0/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/xsd2ruby.rb:34:in `run' + /home/spox/Projects/soap4r/test/xsd/xsd2ruby/test_xsd2ruby.rb:23:in `block in setup' + /home/spox/Projects/soap4r/test/xsd/xsd2ruby/test_xsd2ruby.rb:13:in `chdir' + /home/spox/Projects/soap4r/test/xsd/xsd2ruby/test_xsd2ruby.rb:13:in `setup' + +277) Error: +test_mapper(XSD::XSD2Ruby::TestXSD2Ruby): +Errno::ENOENT: No such file or directory - /home/spox/Projects/soap4r/test/xsd/xsd2ruby/mysample.rb + /home/spox/Projects/soap4r/test/xsd/xsd2ruby/test_xsd2ruby.rb:30:in `unlink' + /home/spox/Projects/soap4r/test/xsd/xsd2ruby/test_xsd2ruby.rb:30:in `teardown' + +331 tests, 1443 assertions, 16 failures, 261 errors, 0 pendings, 0 omissions, 0 notifications diff --git a/test/runner.rb b/test/runner.rb new file mode 100644 index 0000000..e0f00ee --- /dev/null +++ b/test/runner.rb @@ -0,0 +1,7 @@ +require 'test/unit' + +rcsid = %w$Id: runner.rb 1751 2007-05-02 08:15:55Z nahi $ +Version = rcsid[2].scan(/\d+/).collect!(&method(:Integer)).freeze +Release = rcsid[3].freeze + +exit Test::Unit::AutoRunner.run(true, File.dirname($0)) diff --git a/test/sm11/classDef.rb b/test/sm11/classDef.rb new file mode 100644 index 0000000..3badbda --- /dev/null +++ b/test/sm11/classDef.rb @@ -0,0 +1,156 @@ +# http://dopg.gr.jp/sm11.xsd +class C_struct + attr_accessor :e_boolean # {http://www.w3.org/2001/XMLSchema}boolean + attr_accessor :e_short # {http://www.w3.org/2001/XMLSchema}short + attr_accessor :e_int # {http://www.w3.org/2001/XMLSchema}int + attr_accessor :e_long # {http://www.w3.org/2001/XMLSchema}long + attr_accessor :e_float # {http://www.w3.org/2001/XMLSchema}float + attr_accessor :e_double # {http://www.w3.org/2001/XMLSchema}double + attr_accessor :e_String # {http://www.w3.org/2001/XMLSchema}string + + def initialize( e_boolean = nil, + e_short = nil, + e_int = nil, + e_long = nil, + e_float = nil, + e_double = nil, + e_String = nil ) + @e_boolean = nil + @e_short = nil + @e_int = nil + @e_long = nil + @e_float = nil + @e_double = nil + @e_String = nil + end +end + +# http://dopg.gr.jp/sm11.xsd +class ArrayOfboolean < Array; end + +# http://dopg.gr.jp/sm11.xsd +class ArrayOfshort < Array; end + +# http://dopg.gr.jp/sm11.xsd +class ArrayOfint < Array; end + +# http://dopg.gr.jp/sm11.xsd +class ArrayOflong < Array; end + +# http://dopg.gr.jp/sm11.xsd +class ArrayOffloat < Array; end + +# http://dopg.gr.jp/sm11.xsd +class ArrayOfdouble < Array; end + +# http://dopg.gr.jp/sm11.xsd +class ArrayOfstring < Array; end + +# http://dopg.gr.jp/sm11.xsd +class F_struct + attr_accessor :e_c_struct # {http://dopg.gr.jp/sm11.xsd}C_struct + attr_accessor :e_c_array_e_boolean # {http://dopg.gr.jp/sm11.xsd}ArrayOfboolean + attr_accessor :e_c_array_e_short # {http://dopg.gr.jp/sm11.xsd}ArrayOfshort + attr_accessor :e_c_array_e_int # {http://dopg.gr.jp/sm11.xsd}ArrayOfint + attr_accessor :e_c_array_e_long # {http://dopg.gr.jp/sm11.xsd}ArrayOflong + attr_accessor :e_c_array_e_float # {http://dopg.gr.jp/sm11.xsd}ArrayOffloat + attr_accessor :e_c_array_e_double # {http://dopg.gr.jp/sm11.xsd}ArrayOfdouble + attr_accessor :e_c_array_e_String # {http://dopg.gr.jp/sm11.xsd}ArrayOfstring + + def initialize( e_c_struct = nil, + e_c_array_e_boolean = nil, + e_c_array_e_short = nil, + e_c_array_e_int = nil, + e_c_array_e_long = nil, + e_c_array_e_float = nil, + e_c_array_e_double = nil, + e_c_array_e_String = nil ) + @e_c_struct = nil + @e_c_array_e_boolean = nil + @e_c_array_e_short = nil + @e_c_array_e_int = nil + @e_c_array_e_long = nil + @e_c_array_e_float = nil + @e_c_array_e_double = nil + @e_c_array_e_String = nil + end +end + +# http://dopg.gr.jp/sm11.xsd +class ArrayOfC_struct < Array; end + +# http://dopg.gr.jp/sm11.xsd +class A_except < StandardError + attr_accessor :v1 # {http://www.w3.org/2001/XMLSchema}boolean + attr_accessor :v4 # {http://www.w3.org/2001/XMLSchema}short + attr_accessor :v5 # {http://www.w3.org/2001/XMLSchema}int + attr_accessor :v6 # {http://www.w3.org/2001/XMLSchema}long + attr_accessor :v7 # {http://www.w3.org/2001/XMLSchema}float + attr_accessor :v8 # {http://www.w3.org/2001/XMLSchema}double + attr_accessor :v9 # {http://www.w3.org/2001/XMLSchema}string + + def initialize( v1 = nil, + v4 = nil, + v5 = nil, + v6 = nil, + v7 = nil, + v8 = nil, + v9 = nil ) + @v1 = nil + @v4 = nil + @v5 = nil + @v6 = nil + @v7 = nil + @v8 = nil + @v9 = nil + end +end + +# http://dopg.gr.jp/sm11.xsd +class C_except < StandardError + attr_accessor :v10 # {http://dopg.gr.jp/sm11.xsd}C_struct + attr_accessor :v21 # {http://dopg.gr.jp/sm11.xsd}ArrayOfboolean + attr_accessor :v24 # {http://dopg.gr.jp/sm11.xsd}ArrayOfshort + attr_accessor :v25 # {http://dopg.gr.jp/sm11.xsd}ArrayOfint + attr_accessor :v26 # {http://dopg.gr.jp/sm11.xsd}ArrayOflong + attr_accessor :v27 # {http://dopg.gr.jp/sm11.xsd}ArrayOffloat + attr_accessor :v28 # {http://dopg.gr.jp/sm11.xsd}ArrayOfdouble + attr_accessor :v29 # {http://dopg.gr.jp/sm11.xsd}ArrayOfstring + + def initialize( v10 = nil, + v21 = nil, + v24 = nil, + v25 = nil, + v26 = nil, + v27 = nil, + v28 = nil, + v29 = nil ) + @v10 = nil + @v21 = nil + @v24 = nil + @v25 = nil + @v26 = nil + @v27 = nil + @v28 = nil + @v29 = nil + end +end + +# http://dopg.gr.jp/sm11.xsd +class F_except1 < StandardError + attr_accessor :v40 # {http://dopg.gr.jp/sm11.xsd}F_struct + + def initialize( v40 = nil ) + @v40 = nil + end +end + +# http://dopg.gr.jp/sm11.xsd +class F_except2 < StandardError + attr_accessor :v50 # {http://dopg.gr.jp/sm11.xsd}ArrayOfC_struct + + def initialize( v50 = nil ) + @v50 = nil + end +end + diff --git a/test/sm11/client.rb b/test/sm11/client.rb new file mode 100644 index 0000000..c42e7db --- /dev/null +++ b/test/sm11/client.rb @@ -0,0 +1,542 @@ +# Done +# /^void/ def/ +# /^}/ end/ +# /System.out.print/STDOUT.puts/g +# /try { \(.*\) }/\1/ +# /\.set\([^(]*\)(\([^)]*\))/.\1 = \2/ +# /E_/e_/ +# /\.get\([^(]*\)()/.\1/ +# /(short)// +# +require 'soap/baseData' + +class Sm11Caller + include SOAP + + attr_reader :target + + def initialize( target ) + @target = target + end + +private + def cons_0000() + _v1 = C_struct.new() + _v1.e_boolean = false + _v1.e_short = SOAPShort.new(-100) + _v1.e_int = SOAPInt.new(-100000) + _v1.e_long = SOAPLong.new(-10000000000) + _v1.e_float = SOAPFloat.new(0.123) + _v1.e_double = 0.12e3 + _v1.e_String = "abc" + return(_v1) + end + def comp_0000(_v1) + return(true && + (_v1.e_boolean()) && + (_v1.e_short == -200) && + (_v1.e_int == -200000) && + (_v1.e_long == -20000000000) && + (_v1.e_float == 1.234) && + (_v1.e_double == 1.23e4) && + (_v1.e_String == "def") + ) + end + def cons_0001() + _v1 = C_struct.new() + _v1.e_boolean = false + _v1.e_short = SOAPShort.new(-100) + _v1.e_int = SOAPInt.new(-100000) + _v1.e_long = SOAPLong.new(-10000000000) + _v1.e_float = SOAPFloat.new(0.123) + _v1.e_double = 0.12e3 + _v1.e_String = "abc" + return(_v1) + end + def cons_0003() + _v1 = C_struct.new() + _v1.e_boolean = false + _v1.e_short = SOAPShort.new(-100) + _v1.e_int = SOAPInt.new(-100000) + _v1.e_long = SOAPLong.new(-10000000000) + _v1.e_float = SOAPFloat.new(0.123) + _v1.e_double = 0.12e3 + _v1.e_String = "abc" + return(_v1) + end + def cons_0002() + _v1 = F_struct.new() + _v1.e_c_struct = cons_0003() + _v1.e_c_array_e_boolean = ArrayOfboolean[false, false] + _v1.e_c_array_e_short = ArrayOfshort[-100, -100] + _v1.e_c_array_e_int = ArrayOfint[-100000, -100000] + _v1.e_c_array_e_long = ArrayOflong[-10000000000, -10000000000] + _v1.e_c_array_e_float = ArrayOffloat[0.123, 0.123] + _v1.e_c_array_e_double = ArrayOfdouble[0.12e3, 0.12e3] + _v1.e_c_array_e_String = ArrayOfstring["abc", "abc"] + return(_v1) + end + def comp_0002(_v1) + return(true && + (_v1.e_boolean()) && + (_v1.e_short == -200) && + (_v1.e_int == -200000) && + (_v1.e_long == -20000000000) && + (_v1.e_float == 1.234) && + (_v1.e_double == 1.23e4) && + (_v1.e_String == "def") + ) + end + def comp_0001(_v1) + return(true && + comp_0002(_v1.e_c_struct) && + (true && (_v1.e_c_array_e_boolean[0] == true) && (_v1.e_c_array_e_boolean[1] == true)) && + (true && (_v1.e_c_array_e_short[0] == -200) && (_v1.e_c_array_e_short[1] == -200)) && + (true && (_v1.e_c_array_e_int[0] == -200000) && (_v1.e_c_array_e_int[1] == -200000)) && + (true && (_v1.e_c_array_e_long[0] == -20000000000) && (_v1.e_c_array_e_long[1] == -20000000000)) && + (true && (_v1.e_c_array_e_float[0] == 1.234) && (_v1.e_c_array_e_float[1] == 1.234)) && + (true && (_v1.e_c_array_e_double[0] == 1.23e4) && (_v1.e_c_array_e_double[1] == 1.23e4)) && + (true && (_v1.e_c_array_e_String[0] == "def") && (_v1.e_c_array_e_String[1] == "def")) + ) + end + def cons_0004() + _v1 = C_struct.new() + _v1.e_boolean = false + _v1.e_short = SOAPShort.new(-100) + _v1.e_int = SOAPInt.new(-100000) + _v1.e_long = SOAPLong.new(-10000000000) + _v1.e_float = SOAPFloat.new(0.123) + _v1.e_double = 0.12e3 + _v1.e_String = "abc" + return(_v1) + end + def comp_0003(_v1) + return(true && + (_v1.e_boolean()) && + (_v1.e_short == -200) && + (_v1.e_int == -200000) && + (_v1.e_long == -20000000000) && + (_v1.e_float == 1.234) && + (_v1.e_double == 1.23e4) && + (_v1.e_String == "def") + ) + end + def cons_0006() + _v1 = C_struct.new() + _v1.e_boolean = false + _v1.e_short = SOAPShort.new(-100) + _v1.e_int = SOAPInt.new(-100000) + _v1.e_long = SOAPLong.new(-10000000000) + _v1.e_float = SOAPFloat.new(0.123) + _v1.e_double = 0.12e3 + _v1.e_String = "abc" + return(_v1) + end + def cons_0005() + _v1 = F_struct.new() + _v1.e_c_struct = cons_0006() + _v1.e_c_array_e_boolean = ArrayOfboolean[false, false] + _v1.e_c_array_e_short = ArrayOfshort[-100, -100] + _v1.e_c_array_e_int = ArrayOfint[-100000, -100000] + _v1.e_c_array_e_long = ArrayOflong[-10000000000, -10000000000] + _v1.e_c_array_e_float = ArrayOffloat[0.123, 0.123] + _v1.e_c_array_e_double = ArrayOfdouble[0.12e3, 0.12e3] + _v1.e_c_array_e_String = ArrayOfstring["abc", "abc"] + return(_v1) + end + def comp_0004(_v1) + return(true && + (_v1.v1()) && + (_v1.v4 == -200) && + (_v1.v5 == -200000) && + (_v1.v6 == -20000000000) && + (_v1.v7 == 1.234) && + (_v1.v8 == 1.23e4) && + (_v1.v9 == "def") + ) + end + def comp_0006(_v1) + return(true && + (_v1.e_boolean()) && + (_v1.e_short == -200) && + (_v1.e_int == -200000) && + (_v1.e_long == -20000000000) && + (_v1.e_float == 1.234) && + (_v1.e_double == 1.23e4) && + (_v1.e_String == "def") + ) + end + def comp_0005(_v1) + return(true && + comp_0006(_v1.v10) && + (true && (_v1.v21[0] == true) && (_v1.v21[1] == true)) && + (true && (_v1.v24[0] == -200) && (_v1.v24[1] == -200)) && + (true && (_v1.v25[0] == -200000) && (_v1.v25[1] == -200000)) && + (true && (_v1.v26[0] == -20000000000) && (_v1.v26[1] == -20000000000)) && + (true && (_v1.v27[0] == 1.234) && (_v1.v27[1] == 1.234)) && + (true && (_v1.v28[0] == 1.23e4) && (_v1.v28[1] == 1.23e4)) && + (true && (_v1.v29[0] == "def") && (_v1.v29[1] == "def")) + ) + end + def comp_0009(_v1) + return(true && + (_v1.e_boolean()) && + (_v1.e_short == -200) && + (_v1.e_int == -200000) && + (_v1.e_long == -20000000000) && + (_v1.e_float == 1.234) && + (_v1.e_double == 1.23e4) && + (_v1.e_String == "def") + ) + end + def comp_0008(_v1) + return(true && + comp_0009(_v1.e_c_struct) && + (true && (_v1.e_c_array_e_boolean[0] == true) && (_v1.e_c_array_e_boolean[1] == true)) && + (true && (_v1.e_c_array_e_short[0] == -200) && (_v1.e_c_array_e_short[1] == -200)) && + (true && (_v1.e_c_array_e_int[0] == -200000) && (_v1.e_c_array_e_int[1] == -200000)) && + (true && (_v1.e_c_array_e_long[0] == -20000000000) && (_v1.e_c_array_e_long[1] == -20000000000)) && + (true && (_v1.e_c_array_e_float[0] == 1.234) && (_v1.e_c_array_e_float[1] == 1.234)) && + (true && (_v1.e_c_array_e_double[0] == 1.23e4) && (_v1.e_c_array_e_double[1] == 1.23e4)) && + (true && (_v1.e_c_array_e_String[0] == "def") && (_v1.e_c_array_e_String[1] == "def")) + ) + end + def comp_0007(_v1) + return(true && + comp_0008(_v1.v40) + ) + end + def comp_0011(_v1) + return(true && + (_v1.e_boolean()) && + (_v1.e_short == -200) && + (_v1.e_int == -200000) && + (_v1.e_long == -20000000000) && + (_v1.e_float == 1.234) && + (_v1.e_double == 1.23e4) && + (_v1.e_String == "def") + ) + end + def comp_0010(_v1) + return(true && + (true && comp_0011(_v1.v50[0]) && comp_0011(_v1.v50[1])) + ) + end + + def call_op0() + STDOUT.puts("op0\n") + target.op0() + end + def call_op1() + STDOUT.puts("op1\n") + a1 = false + target.op1(a1) + end + def call_op4() + STDOUT.puts("op4\n") + a1 = SOAPShort.new(-100) + target.op4(a1) + end + def call_op5() + STDOUT.puts("op5\n") + a1 = -100000 + target.op5(a1) + end + def call_op6() + STDOUT.puts("op6\n") + a1 = -10000000000 + target.op6(a1) + end + def call_op7() + STDOUT.puts("op7\n") + a1 = SOAPFloat.new(0.123) + target.op7(a1) + end + def call_op8() + STDOUT.puts("op8\n") + a1 = 0.12e3 + target.op8(a1) + end + def call_op9() + STDOUT.puts("op9\n") + a1 = "abc" + target.op9(a1) + end + def call_op11() + STDOUT.puts("op11\n") + _ret = target.op11() + raise unless _ret.is_a?( TrueClass ) + if (!(_ret == true)); STDOUT.puts("_ret value error in op11\n"); end + end + def call_op14() + STDOUT.puts("op14\n") + _ret = target.op14() + raise unless _ret.is_a?( Integer ) + if (!(_ret == -200)); STDOUT.puts("_ret value error in op14\n"); end + end + def call_op15() + STDOUT.puts("op15\n") + _ret = target.op15() + raise unless _ret.is_a?( Integer ) + if (!(_ret == -200000)); STDOUT.puts("_ret value error in op15\n"); end + end + def call_op16() + STDOUT.puts("op16\n") + _ret = target.op16() + raise unless _ret.is_a?( Integer ) + if (!(_ret == -20000000000)); STDOUT.puts("_ret value error in op16\n"); end + end + def call_op17() + STDOUT.puts("op17\n") + _ret = target.op17() + raise unless _ret.is_a?( Float ) + if (!(_ret == 1.234)); STDOUT.puts("_ret value error in op17\n"); end + end + def call_op18() + STDOUT.puts("op18\n") + _ret = target.op18() + raise unless _ret.is_a?( Float ) + if (!(_ret == 1.23e4)); STDOUT.puts("_ret value error in op18\n"); end + end + def call_op19() + STDOUT.puts("op19\n") + _ret = target.op19() + raise unless _ret.is_a?( String ) + if (!(_ret == "def")); STDOUT.puts("_ret value error in op19\n"); end + end + def call_op21() + STDOUT.puts("op21\n") + a1 = false + _ret = target.op21(a1) + raise unless _ret.is_a?( TrueClass ) or _ret.is_a?( FalseClass ) + if (!(_ret == true)); STDOUT.puts("_ret value error in op21\n"); end + end + def call_op24() + STDOUT.puts("op24\n") + a1 = SOAPShort.new(-100) + a2 = SOAPInt.new(-100000) + a3 = SOAPLong.new(-10000000000) + _ret = target.op24(a1,a2,a3) + raise unless _ret.is_a?( Integer ) + if (!(_ret == -200)); STDOUT.puts("_ret value error in op24\n"); end + end + def call_op25() + STDOUT.puts("op25\n") + a1 = SOAPInt.new(-100000) + a2 = SOAPLong.new(-10000000000) + a3 = SOAPFloat.new(0.123) + _ret = target.op25(a1,a2,a3) + raise unless _ret.is_a?( Integer ) + if (!(_ret == -200000)); STDOUT.puts("_ret value error in op25\n"); end + end + def call_op26() + STDOUT.puts("op26\n") + a1 = SOAPLong.new(-10000000000) + a2 = SOAPFloat.new(0.123) + a3 = 0.12e3 + _ret = target.op26(a1,a2,a3) + raise unless _ret.is_a?( Integer ) + if (!(_ret == -20000000000)); STDOUT.puts("_ret value error in op26\n"); end + end + def call_op27() + STDOUT.puts("op27\n") + a1 = SOAPFloat.new(0.123) + a2 = 0.12e3 + a3 = "abc" + _ret = target.op27(a1,a2,a3) + raise unless _ret.is_a?( Float ) + if (!(_ret == 1.234)); STDOUT.puts("_ret value error in op27\n"); end + end + def call_op28() + STDOUT.puts("op28\n") + a1 = 0.12e3 + a2 = "abc" + a3 = false + _ret = target.op28(a1,a2,a3) + raise unless _ret.is_a?( Float ) + if (!(_ret == 1.23e4)); STDOUT.puts("_ret value error in op28\n"); end + end + def call_op29() + STDOUT.puts("op29\n") + a1 = "abc" + a2 = false + _ret = target.op29(a1,a2) + raise unless _ret.is_a?( String ) + if (!(_ret == "def")); STDOUT.puts("_ret value error in op29\n"); end + end + def call_op30() + STDOUT.puts("op30\n") + a1 = cons_0000() + _ret = target.op30(a1) + if (!comp_0000(_ret)); STDOUT.puts("_ret value error in op30\n"); end + end + def call_op31() + STDOUT.puts("op31\n") + a1 = ArrayOfboolean[false, false] + _ret = target.op31(a1) + if (!(true && (_ret[0] == true) && (_ret[1] == true))); STDOUT.puts("_ret value error in op31\n"); end + end + def call_op34() + STDOUT.puts("op34\n") + a1 = ArrayOfshort[-100, -100] + _ret = target.op34(a1) + if (!(true && (_ret[0] == -200) && (_ret[1] == -200))); STDOUT.puts("_ret value error in op34\n"); end + end + def call_op35() + STDOUT.puts("op35\n") + a1 = ArrayOfint[-100000, -100000] + _ret = target.op35(a1) + if (!(true && (_ret[0] == -200000) && (_ret[1] == -200000))); STDOUT.puts("_ret value error in op35\n"); end + end + def call_op36() + STDOUT.puts("op36\n") + a1 = ArrayOflong[-10000000000, -10000000000] + _ret = target.op36(a1) + if (!(true && (_ret[0] == -20000000000) && (_ret[1] == -20000000000))); STDOUT.puts("_ret value error in op36\n"); end + end + def call_op37() + STDOUT.puts("op37\n") + a1 = ArrayOffloat[0.123, 0.123] + _ret = target.op37(a1) + if (!(true && (_ret[0] == 1.234) && (_ret[1] == 1.234))); STDOUT.puts("_ret value error in op37\n"); end + end + def call_op38() + STDOUT.puts("op38\n") + a1 = ArrayOfdouble[0.12e3, 0.12e3] + _ret = target.op38(a1) + if (!(true && (_ret[0] == 1.23e4) && (_ret[1] == 1.23e4))); STDOUT.puts("_ret value error in op38\n"); end + end + def call_op39() + STDOUT.puts("op39\n") + a1 = ArrayOfstring["abc", "abc"] + _ret = target.op39(a1) + if (!(true && (_ret[0] == "def") && (_ret[1] == "def"))); STDOUT.puts("_ret value error in op39\n"); end + end + def call_op40() + STDOUT.puts("op40\n") + a1 = cons_0001() + a2 = ArrayOfboolean[false, false] + a3 = ArrayOfint[-100000, -100000] + a4 = ArrayOfdouble[0.12e3, 0.12e3] + a5 = ArrayOfstring["abc", "abc"] + target.op40(a1,a2,a3,a4,a5) + end + def call_op41() + STDOUT.puts("op41\n") + a1 = cons_0002() + _ret = target.op41(a1) + if (!comp_0001(_ret)); STDOUT.puts("_ret value error in op41\n"); end + end + def call_op42() + STDOUT.puts("op42\n") + a1 = ArrayOfC_struct[cons_0004(), cons_0004()] + _ret = target.op42(a1) + if (!(true && comp_0003(_ret[0]) && comp_0003(_ret[1]))); STDOUT.puts("_ret value error in op42\n"); end + end + def call_op43() + STDOUT.puts("op43\n") + a1 = cons_0005() + a2 = ArrayOfC_struct[cons_0006(), cons_0006()] + target.op43(a1,a2) + end + def call_excop1() + STDOUT.puts("excop1\n") + begin + target.excop1() + rescue A_except => _exc + if (!comp_0004(_exc)); STDOUT.puts("_exc value error in excop1\n"); end + return + end + STDOUT.puts("no exception raised in excop1\n") + end + def call_excop2() + STDOUT.puts("excop2\n") + begin + target.excop2() + rescue C_except => _exc + if (!comp_0005(_exc)); STDOUT.puts("_exc value error in excop2\n"); end + return + end + STDOUT.puts("no exception raised in excop2\n") + end + def call_excop3() + STDOUT.puts("excop3\n") + begin + target.excop3() + rescue F_except1 => _exc + if (!comp_0007(_exc)); STDOUT.puts("_exc value error in excop3\n"); end + return + end + STDOUT.puts("no exception raised in excop3\n") + end + def call_excop4() + STDOUT.puts("excop4\n") + begin + target.excop4() + rescue F_except2 => _exc + if (!comp_0010(_exc)); STDOUT.puts("_exc value error in excop4\n"); end + return + end + STDOUT.puts("no exception raised in excop4\n") + end + +public + + def dispatcher(argv, start, argc) + all = (start == argc) + i = all ? start-1 : start + while (i < argc) do + if (all || ("op0" == argv[i])); call_op0(); end + if (all || ("op1" == argv[i])); call_op1(); end + if (all || ("op4" == argv[i])); call_op4(); end + if (all || ("op5" == argv[i])); call_op5(); end + if (all || ("op6" == argv[i])); call_op6(); end + if (all || ("op7" == argv[i])); call_op7(); end + if (all || ("op8" == argv[i])); call_op8(); end + if (all || ("op9" == argv[i])); call_op9(); end + if (all || ("op11" == argv[i])); call_op11(); end + if (all || ("op14" == argv[i])); call_op14(); end + if (all || ("op15" == argv[i])); call_op15(); end + if (all || ("op16" == argv[i])); call_op16(); end + if (all || ("op17" == argv[i])); call_op17(); end + if (all || ("op18" == argv[i])); call_op18(); end + if (all || ("op19" == argv[i])); call_op19(); end + if (all || ("op21" == argv[i])); call_op21(); end + if (all || ("op24" == argv[i])); call_op24(); end + if (all || ("op25" == argv[i])); call_op25(); end + if (all || ("op26" == argv[i])); call_op26(); end + if (all || ("op27" == argv[i])); call_op27(); end + if (all || ("op28" == argv[i])); call_op28(); end + if (all || ("op29" == argv[i])); call_op29(); end + if (all || ("op30" == argv[i])); call_op30(); end + if (all || ("op31" == argv[i])); call_op31(); end + if (all || ("op34" == argv[i])); call_op34(); end + if (all || ("op35" == argv[i])); call_op35(); end + if (all || ("op36" == argv[i])); call_op36(); end + if (all || ("op37" == argv[i])); call_op37(); end + if (all || ("op38" == argv[i])); call_op38(); end + if (all || ("op39" == argv[i])); call_op39(); end + if (all || ("op40" == argv[i])); call_op40(); end + if (all || ("op41" == argv[i])); call_op41(); end + if (all || ("op42" == argv[i])); call_op42(); end + if (all || ("op43" == argv[i])); call_op43(); end + if (all || ("excop1" == argv[i])); call_excop1(); end + if (all || ("excop2" == argv[i])); call_excop2(); end + if (all || ("excop3" == argv[i])); call_excop3(); end + if (all || ("excop4" == argv[i])); call_excop4(); end + + i += 1 + end + end + +end + + +#url = "http://localhost:10080/" +#url = "http://16.175.170.131:8080/axis/services/sm11Port" +#url = "http://16.175.170.131/soapsrv" +url = ARGV.shift +require 'driver' +drv = Sm11PortType.new( url ) +#drv.setWireDumpDev( STDOUT ) +Sm11Caller.new( drv ).dispatcher( ARGV, 0, ARGV.size ) diff --git a/test/sm11/driver.rb b/test/sm11/driver.rb new file mode 100644 index 0000000..3b1b937 --- /dev/null +++ b/test/sm11/driver.rb @@ -0,0 +1,183 @@ +require 'classDef' +require 'soap/proxy' +require 'soap/rpcUtils' +require 'soap/streamHandler' + +class Sm11PortType + MappingRegistry = SOAP::RPCUtils::MappingRegistry.new + + MappingRegistry.set( + C_struct, + ::SOAP::SOAPStruct, + ::SOAP::RPCUtils::MappingRegistry::TypedStructFactory, + [ "http://dopg.gr.jp/sm11.xsd", "C_struct" ] + ) + MappingRegistry.set( + ArrayOfboolean, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "boolean" ] + ) + MappingRegistry.set( + ArrayOfshort, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "short" ] + ) + MappingRegistry.set( + ArrayOfint, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "int" ] + ) + MappingRegistry.set( + ArrayOflong, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "long" ] + ) + MappingRegistry.set( + ArrayOffloat, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "float" ] + ) + MappingRegistry.set( + ArrayOfdouble, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "double" ] + ) + MappingRegistry.set( + ArrayOfstring, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "string" ] + ) + MappingRegistry.set( + F_struct, + ::SOAP::SOAPStruct, + ::SOAP::RPCUtils::MappingRegistry::TypedStructFactory, + [ "http://dopg.gr.jp/sm11.xsd", "F_struct" ] + ) + MappingRegistry.set( + ArrayOfC_struct, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://dopg.gr.jp/sm11.xsd", "C_struct" ] + ) + + Methods = [ + [ "op0", "op0", [ ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op1", "op1", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op4", "op4", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op5", "op5", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op6", "op6", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op7", "op7", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op8", "op8", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op9", "op9", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op11", "op11", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op14", "op14", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op15", "op15", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op16", "op16", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op17", "op17", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op18", "op18", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op19", "op19", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op21", "op21", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op24", "op24", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :in, "arg2" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op25", "op25", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :in, "arg2" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op26", "op26", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :in, "arg2" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op27", "op27", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :in, "arg2" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op28", "op28", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :in, "arg2" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op29", "op29", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op30", "op30", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op31", "op31", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op34", "op34", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op35", "op35", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op36", "op36", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op37", "op37", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op38", "op38", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op39", "op39", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op40", "op40", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :in, "arg2" ], [ :in, "arg3" ], [ :in, "arg4" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op41", "op41", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op42", "op42", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op43", "op43", [ [ :in, "arg0" ], [ :in, "arg1" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "excop1", "excop1", [ ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "excop2", "excop2", [ ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "excop3", "excop3", [ ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "excop4", "excop4", [ ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ] + ] + + attr_reader :endpointUrl + attr_reader :proxyUrl + + def initialize( endpointUrl, proxyUrl = nil ) + @endpointUrl = endpointUrl + @proxyUrl = proxyUrl + @httpStreamHandler = SOAP::HTTPPostStreamHandler.new( @endpointUrl, + @proxyUrl ) + @proxy = SOAP::SOAPProxy.new( nil, @httpStreamHandler, nil ) + @proxy.allowUnqualifiedElement = true + @mappingRegistry = MappingRegistry + addMethod + end + + def setWireDumpDev( dumpDev ) + @httpStreamHandler.dumpDev = dumpDev + end + + def setDefaultEncodingStyle( encodingStyle ) + @proxy.defaultEncodingStyle = encodingStyle + end + + def getDefaultEncodingStyle + @proxy.defaultEncodingStyle + end + + def call( methodName, *params ) + # Convert parameters + params.collect! { | param | + SOAP::RPCUtils.obj2soap( param, @mappingRegistry ) + } + + # Then, call @proxy.call like the following. + header, body = @proxy.call( nil, methodName, *params ) + + # Check Fault. + begin + @proxy.checkFault( body ) + rescue SOAP::FaultError => e + SOAP::RPCUtils.fault2exception( e, @mappingRegistry ) + end + + ret = body.response ? + SOAP::RPCUtils.soap2obj( body.response, @mappingRegistry ) : nil + if body.outParams + outParams = body.outParams.collect { | outParam | + SOAP::RPCUtils.soap2obj( outParam ) + } + return [ ret ].concat( outParams ) + else + return ret + end + end + +private + + def addMethod + Methods.each do | methodNameAs, methodName, params, soapAction, namespace | + @proxy.addMethodAs( methodNameAs, methodName, params, soapAction, + namespace ) + addMethodInterface( methodNameAs, params ) + end + end + + def addMethodInterface( name, params ) + self.instance_eval <<-EOD + def #{ name }( *params ) + call( "#{ name }", *params ) + end + EOD + end +end + diff --git a/test/sm11/servant.rb b/test/sm11/servant.rb new file mode 100644 index 0000000..40142d3 --- /dev/null +++ b/test/sm11/servant.rb @@ -0,0 +1,1067 @@ +require 'classDef' + +# Done +# System.out.print -> STDOUT.puts +# a1 -> arg0 +# a2 -> arg1 +# a3 -> arg2 +# a4 -> arg3 +# a5 -> arg4 +# /if \([^{]*\){\([^}]*\)}/if \1; \2; end/ +# /\([0-9][0-9]*\)L/\1/ +# /\([0-9][0-9]*\)f/\1/ +# /\.equals(\([^)]*\))/ == \1/ +# /\.set\([^(]*\)(\([^)]*\))/.\1 = \2/ +# /E_/e_/ +# /\.get\([^(]*\)()/.\1/ +# /(short)// +# /\.V/.v/ +# +class Sm11PortType + include SOAP + + # SYNOPSIS + # op0 + # + # ARGS + # N/A + # + # RETURNS + # N/A + # + # RAISES + # N/A + # + def op0 + STDOUT.puts("op0\n") + return + end + + # SYNOPSIS + # op1( arg0 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}boolean + # + # RETURNS + # N/A + # + # RAISES + # N/A + # + def op1( arg0 ) + STDOUT.puts("op1\n") + if (!(arg0 == false)); STDOUT.puts("arg0 value error in op1\n"); end + return + end + + # SYNOPSIS + # op4( arg0 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}short + # + # RETURNS + # N/A + # + # RAISES + # N/A + # + def op4( arg0 ) + STDOUT.puts("op4\n") + if (!(arg0 == -100)); STDOUT.puts("arg0 value error in op4\n"); end + return + end + + # SYNOPSIS + # op5( arg0 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}int + # + # RETURNS + # N/A + # + # RAISES + # N/A + # + def op5( arg0 ) + STDOUT.puts("op5\n") + if (!(arg0 == -100000)); STDOUT.puts("arg0 value error in op5\n"); end + return + end + + # SYNOPSIS + # op6( arg0 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}long + # + # RETURNS + # N/A + # + # RAISES + # N/A + # + def op6( arg0 ) + STDOUT.puts("op6\n") + if (!(arg0 == -10000000000)); STDOUT.puts("arg0 value error in op6\n"); end + return + end + + # SYNOPSIS + # op7( arg0 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}float + # + # RETURNS + # N/A + # + # RAISES + # N/A + # + def op7( arg0 ) + STDOUT.puts("op7\n") + if (!(arg0 == 0.123)); STDOUT.puts("arg0 value error in op7\n"); end + return + end + + # SYNOPSIS + # op8( arg0 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}double + # + # RETURNS + # N/A + # + # RAISES + # N/A + # + def op8( arg0 ) + STDOUT.puts("op8\n") + if (!(arg0 == 0.12e3)); STDOUT.puts("arg0 value error in op8\n"); end + return + end + + # SYNOPSIS + # op9( arg0 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}string + # + # RETURNS + # N/A + # + # RAISES + # N/A + # + def op9( arg0 ) + STDOUT.puts("op9\n") + if (!(arg0 == "abc")); STDOUT.puts("arg0 value error in op9\n"); end + return + end + + # SYNOPSIS + # op11 + # + # ARGS + # N/A + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}boolean + # + # RAISES + # N/A + # + def op11 + STDOUT.puts("op11\n") + _ret = true + return(_ret) + end + + # SYNOPSIS + # op14 + # + # ARGS + # N/A + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}short + # + # RAISES + # N/A + # + def op14 + STDOUT.puts("op14\n") + _ret = SOAPShort.new(-200) + return(_ret) + end + + # SYNOPSIS + # op15 + # + # ARGS + # N/A + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}int + # + # RAISES + # N/A + # + def op15 + STDOUT.puts("op15\n") + _ret = SOAPInt.new( -200000 ) + return(_ret) + end + + # SYNOPSIS + # op16 + # + # ARGS + # N/A + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}long + # + # RAISES + # N/A + # + def op16 + STDOUT.puts("op16\n") + _ret = SOAPLong.new( -20000000000 ) + return(_ret) + end + + # SYNOPSIS + # op17 + # + # ARGS + # N/A + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}float + # + # RAISES + # N/A + # + def op17 + STDOUT.puts("op17\n") + _ret = SOAPFloat.new(1.234) + return(_ret) + end + + # SYNOPSIS + # op18 + # + # ARGS + # N/A + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}double + # + # RAISES + # N/A + # + def op18 + STDOUT.puts("op18\n") + _ret = 1.23e4 + return(_ret) + end + + # SYNOPSIS + # op19 + # + # ARGS + # N/A + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}string + # + # RAISES + # N/A + # + def op19 + STDOUT.puts("op19\n") + _ret = "def" + return(_ret) + end + + # SYNOPSIS + # op21( arg0 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}boolean + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}boolean + # + # RAISES + # N/A + # + def op21( arg0 ) + STDOUT.puts("op21\n") + if (!(arg0 == false)); STDOUT.puts("arg0 value error in op21\n"); end + _ret = true + return(_ret) + end + + # SYNOPSIS + # op24( arg0, arg1, arg2 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}short + # arg1 {http://www.w3.org/2001/XMLSchema}int + # arg2 {http://www.w3.org/2001/XMLSchema}long + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}short + # + # RAISES + # N/A + # + def op24( arg0, arg1, arg2 ) + STDOUT.puts("op24\n") + if (!(arg0 == -100)); STDOUT.puts("arg0 value error in op24\n"); end + if (!(arg1 == -100000)); STDOUT.puts("arg1 value error in op24\n"); end + if (!(arg2 == -10000000000)); STDOUT.puts("arg2 value error in op24\n"); end + _ret = SOAPShort.new(-200) + return(_ret) + end + + # SYNOPSIS + # op25( arg0, arg1, arg2 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}int + # arg1 {http://www.w3.org/2001/XMLSchema}long + # arg2 {http://www.w3.org/2001/XMLSchema}float + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}int + # + # RAISES + # N/A + # + def op25( arg0, arg1, arg2 ) + STDOUT.puts("op25\n") + if (!(arg0 == -100000)); STDOUT.puts("arg0 value error in op25\n"); end + if (!(arg1 == -10000000000)); STDOUT.puts("arg1 value error in op25\n"); end + if (!(arg2 == 0.123)); STDOUT.puts("arg2 value error in op25\n"); end + _ret = SOAPInt.new( -200000 ) + return(_ret) + end + + # SYNOPSIS + # op26( arg0, arg1, arg2 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}long + # arg1 {http://www.w3.org/2001/XMLSchema}float + # arg2 {http://www.w3.org/2001/XMLSchema}double + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}long + # + # RAISES + # N/A + # + def op26( arg0, arg1, arg2 ) + STDOUT.puts("op26\n") + if (!(arg0 == -10000000000)); STDOUT.puts("arg0 value error in op26\n"); end + if (!(arg1 == 0.123)); STDOUT.puts("arg1 value error in op26\n"); end + if (!(arg2 == 0.12e3)); STDOUT.puts("arg2 value error in op26\n"); end + _ret = SOAPLong.new( -20000000000 ) + return(_ret) + end + + # SYNOPSIS + # op27( arg0, arg1, arg2 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}float + # arg1 {http://www.w3.org/2001/XMLSchema}double + # arg2 {http://www.w3.org/2001/XMLSchema}string + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}float + # + # RAISES + # N/A + # + def op27( arg0, arg1, arg2 ) + STDOUT.puts("op27\n") + if (!(arg0 == 0.123)); STDOUT.puts("arg0 value error in op27\n"); end + if (!(arg1 == 0.12e3)); STDOUT.puts("arg1 value error in op27\n"); end + if (!(arg2 == "abc")); STDOUT.puts("arg2 value error in op27\n"); end + _ret = SOAPFloat.new(1.234) + return(_ret) + end + + # SYNOPSIS + # op28( arg0, arg1, arg2 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}double + # arg1 {http://www.w3.org/2001/XMLSchema}string + # arg2 {http://www.w3.org/2001/XMLSchema}boolean + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}double + # + # RAISES + # N/A + # + def op28( arg0, arg1, arg2 ) + STDOUT.puts("op28\n") + if (!(arg0 == 0.12e3)); STDOUT.puts("arg0 value error in op28\n"); end + if (!(arg1 == "abc")); STDOUT.puts("arg1 value error in op28\n"); end + if (!(arg2 == false)); STDOUT.puts("arg2 value error in op28\n"); end + _ret = 1.23e4 + return(_ret) + end + + # SYNOPSIS + # op29( arg0, arg1 ) + # + # ARGS + # arg0 {http://www.w3.org/2001/XMLSchema}string + # arg1 {http://www.w3.org/2001/XMLSchema}boolean + # + # RETURNS + # result {http://www.w3.org/2001/XMLSchema}string + # + # RAISES + # N/A + # + def op29( arg0, arg1 ) + STDOUT.puts("op29\n") + if (!(arg0 == "abc")); STDOUT.puts("arg0 value error in op29\n"); end + if (!(arg1 == false)); STDOUT.puts("arg1 value error in op29\n"); end + _ret = "def" + return(_ret) + end + + # SYNOPSIS + # op30( arg0 ) + # + # ARGS + # arg0 {http://dopg.gr.jp/sm11.xsd}C_struct + # + # RETURNS + # result {http://dopg.gr.jp/sm11.xsd}C_struct + # + # RAISES + # N/A + # + def op30( arg0 ) + STDOUT.puts("op30\n") + if (!comp_0012(arg0)); STDOUT.puts("arg0 value error in op30\n"); end + _ret = cons_0007() + return(_ret) + end + + # SYNOPSIS + # op31( arg0 ) + # + # ARGS + # arg0 {http://dopg.gr.jp/sm11.xsd}ArrayOfboolean + # + # RETURNS + # result {http://dopg.gr.jp/sm11.xsd}ArrayOfboolean + # + # RAISES + # N/A + # + def op31( arg0 ) + STDOUT.puts("op31\n") + if (!(true && (arg0[0] == false) && (arg0[1] == false))); STDOUT.puts("arg0 value error in op31\n"); end + _ret = ArrayOfboolean[true, true] + return(_ret) + end + + # SYNOPSIS + # op34( arg0 ) + # + # ARGS + # arg0 {http://dopg.gr.jp/sm11.xsd}ArrayOfshort + # + # RETURNS + # result {http://dopg.gr.jp/sm11.xsd}ArrayOfshort + # + # RAISES + # N/A + # + def op34( arg0 ) + STDOUT.puts("op34\n") + if (!(true && (arg0[0] == -100) && (arg0[1] == -100))); STDOUT.puts("arg0 value error in op34\n"); end + _ret = ArrayOfshort[-200, -200] + return(_ret) + end + + # SYNOPSIS + # op35( arg0 ) + # + # ARGS + # arg0 {http://dopg.gr.jp/sm11.xsd}ArrayOfint + # + # RETURNS + # result {http://dopg.gr.jp/sm11.xsd}ArrayOfint + # + # RAISES + # N/A + # + def op35( arg0 ) + STDOUT.puts("op35\n") + if (!(true && (arg0[0] == -100000) && (arg0[1] == -100000))); STDOUT.puts("arg0 value error in op35\n"); end + _ret = ArrayOfint[-200000, -200000] + return(_ret) + end + + # SYNOPSIS + # op36( arg0 ) + # + # ARGS + # arg0 {http://dopg.gr.jp/sm11.xsd}ArrayOflong + # + # RETURNS + # result {http://dopg.gr.jp/sm11.xsd}ArrayOflong + # + # RAISES + # N/A + # + def op36( arg0 ) + STDOUT.puts("op36\n") + if (!(true && (arg0[0] == -10000000000) && (arg0[1] == -10000000000))); STDOUT.puts("arg0 value error in op36\n"); end + _ret = ArrayOflong[-20000000000, -20000000000] + return(_ret) + end + + # SYNOPSIS + # op37( arg0 ) + # + # ARGS + # arg0 {http://dopg.gr.jp/sm11.xsd}ArrayOffloat + # + # RETURNS + # result {http://dopg.gr.jp/sm11.xsd}ArrayOffloat + # + # RAISES + # N/A + # + def op37( arg0 ) + STDOUT.puts("op37\n") + if (!(true && (arg0[0] == 0.123) && (arg0[1] == 0.123))); STDOUT.puts("arg0 value error in op37\n"); end + _ret = ArrayOffloat[1.234, 1.234] + return(_ret) + end + + # SYNOPSIS + # op38( arg0 ) + # + # ARGS + # arg0 {http://dopg.gr.jp/sm11.xsd}ArrayOfdouble + # + # RETURNS + # result {http://dopg.gr.jp/sm11.xsd}ArrayOfdouble + # + # RAISES + # N/A + # + def op38( arg0 ) + STDOUT.puts("op38\n") + if (!(true && (arg0[0] == 0.12e3) && (arg0[1] == 0.12e3))); STDOUT.puts("arg0 value error in op38\n"); end + _ret = ArrayOfdouble[1.23e4, 1.23e4] + return(_ret) + end + + # SYNOPSIS + # op39( arg0 ) + # + # ARGS + # arg0 {http://dopg.gr.jp/sm11.xsd}ArrayOfstring + # + # RETURNS + # result {http://dopg.gr.jp/sm11.xsd}ArrayOfstring + # + # RAISES + # N/A + # + def op39( arg0 ) + STDOUT.puts("op39\n") + if (!(true && (arg0[0] == "abc") && (arg0[1] == "abc"))); STDOUT.puts("arg0 value error in op39\n"); end + _ret = ArrayOfstring["def", "def"] + return(_ret) + end + + # SYNOPSIS + # op40( arg0, arg1, arg2, arg3, arg4 ) + # + # ARGS + # arg0 {http://dopg.gr.jp/sm11.xsd}C_struct + # arg1 {http://dopg.gr.jp/sm11.xsd}ArrayOfboolean + # arg2 {http://dopg.gr.jp/sm11.xsd}ArrayOfint + # arg3 {http://dopg.gr.jp/sm11.xsd}ArrayOfdouble + # arg4 {http://dopg.gr.jp/sm11.xsd}ArrayOfstring + # + # RETURNS + # N/A + # + # RAISES + # N/A + # + def op40( arg0, arg1, arg2, arg3, arg4 ) + STDOUT.puts("op40\n") + if (!comp_0013(arg0)); STDOUT.puts("arg0 value error in op40\n"); end + if (!(true && (arg1[0] == false) && (arg1[1] == false))); STDOUT.puts("arg1 value error in op40\n"); end + if (!(true && (arg2[0] == -100000) && (arg2[1] == -100000))); STDOUT.puts("arg2 value error in op40\n"); end + if (!(true && (arg3[0] == 0.12e3) && (arg3[1] == 0.12e3))); STDOUT.puts("arg3 value error in op40\n"); end + if (!(true && (arg4[0] == "abc") && (arg4[1] == "abc"))); STDOUT.puts("arg4 value error in op40\n"); end + return + end + + # SYNOPSIS + # op41( arg0 ) + # + # ARGS + # arg0 {http://dopg.gr.jp/sm11.xsd}F_struct + # + # RETURNS + # result {http://dopg.gr.jp/sm11.xsd}F_struct + # + # RAISES + # N/A + # + def op41( arg0 ) + STDOUT.puts("op41\n") + if (!comp_0014(arg0)); STDOUT.puts("arg0 value error in op41\n"); end + _ret = cons_0008() + return(_ret) + end + + # SYNOPSIS + # op42( arg0 ) + # + # ARGS + # arg0 {http://dopg.gr.jp/sm11.xsd}ArrayOfC_struct + # + # RETURNS + # result {http://dopg.gr.jp/sm11.xsd}ArrayOfC_struct + # + # RAISES + # N/A + # + def op42( arg0 ) + STDOUT.puts("op42\n") + if (!(true && comp_0016(arg0[0]) && comp_0016(arg0[1]))); STDOUT.puts("arg0 value error in op42\n"); end + _ret = ArrayOfC_struct[cons_0010(), cons_0010()] + return(_ret) + end + + # SYNOPSIS + # op43( arg0, arg1 ) + # + # ARGS + # arg0 {http://dopg.gr.jp/sm11.xsd}F_struct + # arg1 {http://dopg.gr.jp/sm11.xsd}ArrayOfC_struct + # + # RETURNS + # N/A + # + # RAISES + # N/A + # + def op43( arg0, arg1 ) + STDOUT.puts("op43\n") + if (!comp_0017(arg0)); STDOUT.puts("arg0 value error in op43\n"); end + if (!(true && comp_0018(arg1[0]) && comp_0018(arg1[1]))); STDOUT.puts("arg1 value error in op43\n"); end + return + end + + # SYNOPSIS + # excop1 + # + # ARGS + # N/A + # + # RETURNS + # N/A + # + # RAISES + # arg0 {http://dopg.gr.jp/sm11.xsd}A_except + # + def excop1 + STDOUT.puts("excop1\n") + _exc = cons_0011() + raise(_exc) + end + + # SYNOPSIS + # excop2 + # + # ARGS + # N/A + # + # RETURNS + # N/A + # + # RAISES + # arg0 {http://dopg.gr.jp/sm11.xsd}C_except + # + def excop2 + STDOUT.puts("excop2\n") + _exc = cons_0012() + raise(_exc) + end + + # SYNOPSIS + # excop3 + # + # ARGS + # N/A + # + # RETURNS + # N/A + # + # RAISES + # arg0 {http://dopg.gr.jp/sm11.xsd}F_except1 + # + def excop3 + STDOUT.puts("excop3\n") + _exc = cons_0014() + raise(_exc) + end + + # SYNOPSIS + # excop4 + # + # ARGS + # N/A + # + # RETURNS + # N/A + # + # RAISES + # arg0 {http://dopg.gr.jp/sm11.xsd}F_except2 + # + def excop4 + STDOUT.puts("excop4\n") + _exc = cons_0017() + raise(_exc) + end + + + require 'soap/rpcUtils' + MappingRegistry = SOAP::RPCUtils::MappingRegistry.new + + MappingRegistry.set( + C_struct, + ::SOAP::SOAPStruct, + ::SOAP::RPCUtils::MappingRegistry::TypedStructFactory, + [ "http://dopg.gr.jp/sm11.xsd", "C_struct" ] + ) + MappingRegistry.set( + ArrayOfboolean, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "boolean" ] + ) + MappingRegistry.set( + ArrayOfshort, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "short" ] + ) + MappingRegistry.set( + ArrayOfint, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "int" ] + ) + MappingRegistry.set( + ArrayOflong, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "long" ] + ) + MappingRegistry.set( + ArrayOffloat, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "float" ] + ) + MappingRegistry.set( + ArrayOfdouble, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "double" ] + ) + MappingRegistry.set( + ArrayOfstring, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://www.w3.org/2001/XMLSchema", "string" ] + ) + MappingRegistry.set( + F_struct, + ::SOAP::SOAPStruct, + ::SOAP::RPCUtils::MappingRegistry::TypedStructFactory, + [ "http://dopg.gr.jp/sm11.xsd", "F_struct" ] + ) + MappingRegistry.set( + ArrayOfC_struct, + ::SOAP::SOAPArray, + ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory, + [ "http://dopg.gr.jp/sm11.xsd", "C_struct" ] + ) + + Methods = [ + [ "op0", "op0", [ ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op1", "op1", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op4", "op4", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op5", "op5", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op6", "op6", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op7", "op7", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op8", "op8", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op9", "op9", [ [ :in, "arg0" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op11", "op11", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op14", "op14", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op15", "op15", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op16", "op16", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op17", "op17", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op18", "op18", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op19", "op19", [ [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op21", "op21", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op24", "op24", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :in, "arg2" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op25", "op25", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :in, "arg2" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op26", "op26", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :in, "arg2" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op27", "op27", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :in, "arg2" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op28", "op28", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :in, "arg2" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op29", "op29", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op30", "op30", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op31", "op31", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op34", "op34", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op35", "op35", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op36", "op36", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op37", "op37", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op38", "op38", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op39", "op39", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op40", "op40", [ [ :in, "arg0" ], [ :in, "arg1" ], [ :in, "arg2" ], [ :in, "arg3" ], [ :in, "arg4" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op41", "op41", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op42", "op42", [ [ :in, "arg0" ], [ :retval, "result" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "op43", "op43", [ [ :in, "arg0" ], [ :in, "arg1" ] ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "excop1", "excop1", [ ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "excop2", "excop2", [ ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "excop3", "excop3", [ ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ], + [ "excop4", "excop4", [ ], "http://dopg.gr.jp/sm11", "http://dopg.gr.jp/sm11" ] + ] + +private + + def comp_0012(_v1) + return(true && + (! _v1.e_boolean()) && + (_v1.e_short == -100) && + (_v1.e_int == -100000) && + (_v1.e_long == -10000000000) && + (_v1.e_float == 0.123) && + (_v1.e_double == 0.12e3) && + (_v1.e_String == "abc") + ) + end + def cons_0007() + _v1 = C_struct.new() + _v1.e_boolean = true + _v1.e_short = SOAPShort.new(-200) + _v1.e_int = SOAPInt.new(-200000) + _v1.e_long = SOAPLong.new(-20000000000) + _v1.e_float = SOAPFloat.new(1.234) + _v1.e_double = 1.23e4 + _v1.e_String = "def" + return(_v1) + end + def comp_0013(_v1) + return(true && + (! _v1.e_boolean()) && + (_v1.e_short == -100) && + (_v1.e_int == -100000) && + (_v1.e_long == -10000000000) && + (_v1.e_float == 0.123) && + (_v1.e_double == 0.12e3) && + (_v1.e_String == "abc") + ) + end + def comp_0015(_v1) + return(true && + (! _v1.e_boolean()) && + (_v1.e_short == -100) && + (_v1.e_int == -100000) && + (_v1.e_long == -10000000000) && + (_v1.e_float == 0.123) && + (_v1.e_double == 0.12e3) && + (_v1.e_String == "abc") + ) + end + def comp_0014(_v1) + return(true && + comp_0015(_v1.e_c_struct) && + (true && (_v1.e_c_array_e_boolean[0] == false) && (_v1.e_c_array_e_boolean[1] == false)) && + (true && (_v1.e_c_array_e_short[0] == -100) && (_v1.e_c_array_e_short[1] == -100)) && + (true && (_v1.e_c_array_e_int[0] == -100000) && (_v1.e_c_array_e_int[1] == -100000)) && + (true && (_v1.e_c_array_e_long[0] == -10000000000) && (_v1.e_c_array_e_long[1] == -10000000000)) && + (true && (_v1.e_c_array_e_float[0] == 0.123) && (_v1.e_c_array_e_float[1] == 0.123)) && + (true && (_v1.e_c_array_e_double[0] == 0.12e3) && (_v1.e_c_array_e_double[1] == 0.12e3)) && + (true && (_v1.e_c_array_e_String[0] == "abc") && (_v1.e_c_array_e_String[1] == "abc")) + ) + end + def cons_0009() + _v1 = C_struct.new() + _v1.e_boolean = true + _v1.e_short = SOAPShort.new(-200) + _v1.e_int = SOAPInt.new(-200000) + _v1.e_long = SOAPLong.new(-20000000000) + _v1.e_float = SOAPFloat.new(1.234) + _v1.e_double = 1.23e4 + _v1.e_String = "def" + return(_v1) + end + def cons_0008() + _v1 = F_struct.new() + _v1.e_c_struct = cons_0009() + _v1.e_c_array_e_boolean = ArrayOfboolean[true, true] + _v1.e_c_array_e_short = ArrayOfshort[-200, -200] + _v1.e_c_array_e_int = ArrayOfint[-200000, -200000] + _v1.e_c_array_e_long = ArrayOflong[-20000000000, -20000000000] + _v1.e_c_array_e_float = ArrayOffloat[1.234, 1.234] + _v1.e_c_array_e_double = ArrayOfdouble[1.23e4, 1.23e4] + _v1.e_c_array_e_String = ArrayOfstring["def", "def"] + return(_v1) + end + def comp_0016(_v1) + return(true && + (! _v1.e_boolean()) && + (_v1.e_short == -100) && + (_v1.e_int == -100000) && + (_v1.e_long == -10000000000) && + (_v1.e_float == 0.123) && + (_v1.e_double == 0.12e3) && + (_v1.e_String == "abc") + ) + end + def cons_0010() + _v1 = C_struct.new() + _v1.e_boolean = true + _v1.e_short = SOAPShort.new(-200) + _v1.e_int = SOAPInt.new(-200000) + _v1.e_long = SOAPLong.new(-20000000000) + _v1.e_float = SOAPFloat.new(1.234) + _v1.e_double = 1.23e4 + _v1.e_String = "def" + return(_v1) + end + def comp_0018(_v1) + return(true && + (! _v1.e_boolean()) && + (_v1.e_short == -100) && + (_v1.e_int == -100000) && + (_v1.e_long == -10000000000) && + (_v1.e_float == 0.123) && + (_v1.e_double == 0.12e3) && + (_v1.e_String == "abc") + ) + end + def comp_0017(_v1) + return(true && + comp_0018(_v1.e_c_struct) && + (true && (_v1.e_c_array_e_boolean[0] == false) && (_v1.e_c_array_e_boolean[1] == false)) && + (true && (_v1.e_c_array_e_short[0] == -100) && (_v1.e_c_array_e_short[1] == -100)) && + (true && (_v1.e_c_array_e_int[0] == -100000) && (_v1.e_c_array_e_int[1] == -100000)) && + (true && (_v1.e_c_array_e_long[0] == -10000000000) && (_v1.e_c_array_e_long[1] == -10000000000)) && + (true && (_v1.e_c_array_e_float[0] == 0.123) && (_v1.e_c_array_e_float[1] == 0.123)) && + (true && (_v1.e_c_array_e_double[0] == 0.12e3) && (_v1.e_c_array_e_double[1] == 0.12e3)) && + (true && (_v1.e_c_array_e_String[0] == "abc") && (_v1.e_c_array_e_String[1] == "abc")) + ) + end + def cons_0011() + _v1 = A_except.new() + _v1.v1 = true + _v1.v4 = SOAPShort.new(-200) + _v1.v5 = SOAPInt.new(-200000) + _v1.v6 = SOAPLong.new(-20000000000) + _v1.v7 = SOAPFloat.new(1.234) + _v1.v8 = 1.23e4 + _v1.v9 = "def" + return(_v1) + end + def cons_0013() + _v1 = C_struct.new() + _v1.e_boolean = true + _v1.e_short = SOAPShort.new(-200) + _v1.e_int = SOAPInt.new(-200000) + _v1.e_long = SOAPLong.new(-20000000000) + _v1.e_float = SOAPFloat.new(1.234) + _v1.e_double = 1.23e4 + _v1.e_String = "def" + return(_v1) + end + def cons_0012() + _v1 = C_except.new() + _v1.v10 = cons_0013() + _v1.v21 = ArrayOfboolean[true, true] + _v1.v24 = ArrayOfshort[-200, -200] + _v1.v25 = ArrayOfint[-200000, -200000] + _v1.v26 = ArrayOflong[-20000000000, -20000000000] + _v1.v27 = ArrayOffloat[1.234, 1.234] + _v1.v28 = ArrayOfdouble[1.23e4, 1.23e4] + _v1.v29 = ArrayOfstring["def", "def"] + return(_v1) + end + def cons_0016() + _v1 = C_struct.new() + _v1.e_boolean = true + _v1.e_short = SOAPShort.new(-200) + _v1.e_int = SOAPInt.new(-200000) + _v1.e_long = SOAPLong.new(-20000000000) + _v1.e_float = SOAPFloat.new(1.234) + _v1.e_double = 1.23e4 + _v1.e_String = "def" + return(_v1) + end + def cons_0015() + _v1 = F_struct.new() + _v1.e_c_struct = cons_0016() + _v1.e_c_array_e_boolean = ArrayOfboolean[true, true] + _v1.e_c_array_e_short = ArrayOfshort[-200, -200] + _v1.e_c_array_e_int = ArrayOfint[-200000, -200000] + _v1.e_c_array_e_long = ArrayOflong[-20000000000, -20000000000] + _v1.e_c_array_e_float = ArrayOffloat[1.234, 1.234] + _v1.e_c_array_e_double = ArrayOfdouble[1.23e4, 1.23e4] + _v1.e_c_array_e_String = ArrayOfstring["def", "def"] + return(_v1) + end + def cons_0014() + _v1 = F_except1.new() + _v1.v40 = cons_0015() + return(_v1) + end + def cons_0018() + _v1 = C_struct.new() + _v1.e_boolean = true + _v1.e_short = SOAPShort.new(-200) + _v1.e_int = SOAPInt.new(-200000) + _v1.e_long = SOAPLong.new(-20000000000) + _v1.e_float = SOAPFloat.new(1.234) + _v1.e_double = 1.23e4 + _v1.e_String = "def" + return(_v1) + end + def cons_0017() + _v1 = F_except2.new() + _v1.v50 = ArrayOfC_struct[cons_0018(), cons_0018()] + return(_v1) + end + +end + diff --git a/test/sm11/server.rb b/test/sm11/server.rb new file mode 100644 index 0000000..275b011 --- /dev/null +++ b/test/sm11/server.rb @@ -0,0 +1,25 @@ +#!/usr/bin/env ruby + +$KCODE = "UTF8" # Set $KCODE before loading 'soap/xmlparser'. + +require 'soap/standaloneServer' +require 'servant' + +class App < SOAP::StandaloneServer + def initialize( *arg ) + super( *arg ) + + # Explicit definition + servant = Sm11PortType.new + Sm11PortType::Methods.each do | methodNameAs, methodName, params, soapAction, namespace | + addMethodWithNSAs( namespace, servant, methodName, methodNameAs, params, soapAction ) + end + # Easy way to add all methods. + addServant( Sm11PortType.new ) + + self.mappingRegistry = Sm11PortType::MappingRegistry + self.level = Logger::Severity::ERROR + end +end + +App.new( 'App', nil, '0.0.0.0', 10080 ).start diff --git a/test/soap/asp.net/hello.wsdl b/test/soap/asp.net/hello.wsdl new file mode 100644 index 0000000..0a47c61 --- /dev/null +++ b/test/soap/asp.net/hello.wsdl @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/soap/asp.net/test_aspdotnet.rb b/test/soap/asp.net/test_aspdotnet.rb new file mode 100644 index 0000000..70a2916 --- /dev/null +++ b/test/soap/asp.net/test_aspdotnet.rb @@ -0,0 +1,123 @@ +require 'test/unit' +require 'soap/rpc/standaloneServer' +require 'soap/rpc/driver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module SOAP; module ASPDotNet + + +class TestASPDotNet < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = "http://localhost/WebService/" + + def on_init + add_document_method( + self, + Namespace + 'SayHello', + 'sayHello', + XSD::QName.new(Namespace, 'SayHello'), + XSD::QName.new(Namespace, 'SayHelloResponse') + ) + end + + def sayHello(arg) + name = arg['name'] + "Hello #{name}" + end + end + + Port = 17171 + Endpoint = "http://localhost:#{Port}/" + + def setup + setup_server + @client = nil + end + + def teardown + teardown_server if @server + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', Server::Namespace, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def test_document_method + @client = SOAP::RPC::Driver.new(Endpoint, Server::Namespace) + @client.wiredump_dev = STDOUT if $DEBUG + @client.add_document_method('sayHello', Server::Namespace + 'SayHello', + XSD::QName.new(Server::Namespace, 'SayHello'), + XSD::QName.new(Server::Namespace, 'SayHelloResponse')) + assert_equal("Hello Mike", @client.sayHello(:name => "Mike")) + end + + def test_xml + @client = SOAP::RPC::Driver.new(Endpoint, Server::Namespace) + @client.wiredump_dev = STDOUT if $DEBUG + @client.add_document_method('sayHello', Server::Namespace + 'SayHello', + XSD::QName.new(Server::Namespace, 'SayHello'), + XSD::QName.new(Server::Namespace, 'SayHelloResponse')) + require 'rexml/document' + xml = <<__XML__ + + Mike + +__XML__ + ele = REXML::Document.new(xml) + assert_equal("Hello Mike", @client.sayHello(ele)) + def xml.to_xmlpart; to_s; end + assert_equal("Hello Mike", @client.sayHello(xml)) + end + + def test_aspdotnethandler + @client = SOAP::RPC::Driver.new(Endpoint, Server::Namespace) + @client.wiredump_dev = STDOUT if $DEBUG + @client.add_method_with_soapaction('sayHello', Server::Namespace + 'SayHello', 'name') + @client.default_encodingstyle = SOAP::EncodingStyle::ASPDotNetHandler::Namespace + assert_equal("Hello Mike", @client.sayHello("Mike")) + end + + if defined?(HTTPClient) + + # qualified! + REQUEST_ASPDOTNETHANDLER = +%q[ + + + + Mike + + +] + + def test_aspdotnethandler_envelope + @client = SOAP::RPC::Driver.new(Endpoint, Server::Namespace) + @client.wiredump_dev = str = '' + @client.add_method_with_soapaction('sayHello', Server::Namespace + 'SayHello', 'name') + @client.default_encodingstyle = SOAP::EncodingStyle::ASPDotNetHandler::Namespace + assert_equal("Hello Mike", @client.sayHello("Mike")) + assert_equal(REQUEST_ASPDOTNETHANDLER, parse_requestxml(str), + [REQUEST_ASPDOTNETHANDLER, parse_requestxml(str)].join("\n\n")) + end + + def parse_requestxml(str) + str.split(/\r?\n\r?\n/)[3] + end + + end +end + + +end; end diff --git a/test/soap/auth/htdigest b/test/soap/auth/htdigest new file mode 100644 index 0000000..55893ea --- /dev/null +++ b/test/soap/auth/htdigest @@ -0,0 +1,2 @@ +admin:auth:4302fe65caa32f27721949149ccd3083 +guest:auth:402550d83a8289be65377d0e7d11fb6e diff --git a/test/soap/auth/htpasswd b/test/soap/auth/htpasswd new file mode 100644 index 0000000..70df50c --- /dev/null +++ b/test/soap/auth/htpasswd @@ -0,0 +1,2 @@ +admin:Qg266hq/YYKe2 +guest:gbPc4vPCH.h12 diff --git a/test/soap/auth/test_basic.rb b/test/soap/auth/test_basic.rb new file mode 100644 index 0000000..b0cbf42 --- /dev/null +++ b/test/soap/auth/test_basic.rb @@ -0,0 +1,117 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'webrick' +require 'webrick/httpproxy' +require 'logger' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module SOAP; module Auth + + +class TestBasic < Test::Unit::TestCase + Port = 17171 + ProxyPort = 17172 + + def setup + @logger = Logger.new(STDERR) + @logger.level = Logger::Severity::FATAL + @url = "http://localhost:#{Port}/" + @proxyurl = "http://localhost:#{ProxyPort}/" + @server = @proxyserver = @client = nil + @server_thread = @proxyserver_thread = nil + setup_server + setup_client + end + + def teardown + teardown_client if @server + teardown_proxyserver if @proxyserver + teardown_server if @client + end + + def setup_server + @server = WEBrick::HTTPServer.new( + :BindAddress => "0.0.0.0", + :Logger => @logger, + :Port => Port, + :AccessLog => [], + :DocumentRoot => File.dirname(File.expand_path(__FILE__)) + ) + htpasswd = File.join(File.dirname(__FILE__), 'htpasswd') + htpasswd_userdb = WEBrick::HTTPAuth::Htpasswd.new(htpasswd) + @basic_auth = WEBrick::HTTPAuth::BasicAuth.new( + :Logger => @logger, + :Realm => 'auth', + :UserDB => htpasswd_userdb + ) + @server.mount( + '/', + WEBrick::HTTPServlet::ProcHandler.new(method(:do_server_proc).to_proc) + ) + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_proxyserver + @proxyserver = WEBrick::HTTPProxyServer.new( + :BindAddress => "0.0.0.0", + :Logger => @logger, + :Port => ProxyPort, + :AccessLog => [] + ) + @proxyserver_thread = TestUtil.start_server_thread(@proxyserver) + end + + def setup_client + @client = SOAP::RPC::Driver.new(@url, '') + @client.add_method("do_server_proc") + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def teardown_proxyserver + @proxyserver.shutdown + @proxyserver_thread.kill + @proxyserver_thread.join + end + + def teardown_client + @client.reset_stream + end + + def do_server_proc(req, res) + @basic_auth.authenticate(req, res) + res['content-type'] = 'text/xml' + res.body = <<__EOX__ + + + + + OK + + + +__EOX__ + end + + def test_direct + @client.wiredump_dev = STDOUT if $DEBUG + @client.options["protocol.http.auth"] << [@url, "admin", "admin"] + assert_equal("OK", @client.do_server_proc) + end + + def test_proxy + setup_proxyserver + @client.wiredump_dev = STDOUT if $DEBUG + @client.options["protocol.http.proxy"] = @proxyurl + @client.options["protocol.http.auth"] << [@url, "guest", "guest"] + assert_equal("OK", @client.do_server_proc) + end +end + + +end; end diff --git a/test/soap/auth/test_digest.rb b/test/soap/auth/test_digest.rb new file mode 100644 index 0000000..4df4660 --- /dev/null +++ b/test/soap/auth/test_digest.rb @@ -0,0 +1,118 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'webrick' +require 'webrick/httpproxy' +require 'logger' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module SOAP; module Auth + + +class TestDigest < Test::Unit::TestCase + Port = 17171 + ProxyPort = 17172 + + def setup + @logger = Logger.new(STDERR) + @logger.level = Logger::Severity::FATAL + @url = "http://localhost:#{Port}/" + @proxyurl = "http://localhost:#{ProxyPort}/" + @server = @proxyserver = @client = nil + @server_thread = @proxyserver_thread = nil + setup_server + setup_client + end + + def teardown + teardown_client if @client + teardown_proxyserver if @proxyserver + teardown_server if @server + end + + def setup_server + @server = WEBrick::HTTPServer.new( + :BindAddress => "0.0.0.0", + :Logger => @logger, + :Port => Port, + :AccessLog => [], + :DocumentRoot => File.dirname(File.expand_path(__FILE__)) + ) + htdigest = File.join(File.dirname(__FILE__), 'htdigest') + htdigest_userdb = WEBrick::HTTPAuth::Htdigest.new(htdigest) + @digest_auth = WEBrick::HTTPAuth::DigestAuth.new( + :Logger => @logger, + :Algorithm => 'MD5', + :Realm => 'auth', + :UserDB => htdigest_userdb + ) + @server.mount( + '/', + WEBrick::HTTPServlet::ProcHandler.new(method(:do_server_proc).to_proc) + ) + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_proxyserver + @proxyserver = WEBrick::HTTPProxyServer.new( + :BindAddress => "0.0.0.0", + :Logger => @logger, + :Port => ProxyPort, + :AccessLog => [] + ) + @proxyserver_thread = TestUtil.start_server_thread(@proxyserver) + end + + def setup_client + @client = SOAP::RPC::Driver.new(@url, '') + @client.add_method("do_server_proc") + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def teardown_proxyserver + @proxyserver.shutdown + @proxyserver_thread.kill + @proxyserver_thread.join + end + + def teardown_client + @client.reset_stream + end + + def do_server_proc(req, res) + @digest_auth.authenticate(req, res) + res['content-type'] = 'text/xml' + res.body = <<__EOX__ + + + + + OK + + + +__EOX__ + end + + def test_direct + @client.wiredump_dev = STDOUT if $DEBUG + @client.options["protocol.http.auth"] << [@url, "admin", "admin"] + assert_equal("OK", @client.do_server_proc) + end + + def test_proxy + setup_proxyserver + @client.wiredump_dev = STDOUT if $DEBUG + @client.options["protocol.http.proxy"] = @proxyurl + @client.options["protocol.http.auth"] << [@url, "guest", "guest"] + assert_equal("OK", @client.do_server_proc) + end +end + + +end; end diff --git a/test/soap/calc/calc.rb b/test/soap/calc/calc.rb new file mode 100644 index 0000000..6bc7880 --- /dev/null +++ b/test/soap/calc/calc.rb @@ -0,0 +1,17 @@ +module CalcService + def self.add(lhs, rhs) + lhs + rhs + end + + def self.sub(lhs, rhs) + lhs - rhs + end + + def self.multi(lhs, rhs) + lhs * rhs + end + + def self.div(lhs, rhs) + lhs / rhs + end +end diff --git a/test/soap/calc/calc2.rb b/test/soap/calc/calc2.rb new file mode 100644 index 0000000..6949573 --- /dev/null +++ b/test/soap/calc/calc2.rb @@ -0,0 +1,29 @@ +class CalcService2 + def initialize(value = 0) + @value = value + end + + def set_value(value) + @value = value + end + + def get_value + @value + end + + def +(rhs) + @value + rhs + end + + def -(rhs) + @value - rhs + end + + def *(rhs) + @value * rhs + end + + def /(rhs) + @value / rhs + end +end diff --git a/test/soap/calc/server.cgi b/test/soap/calc/server.cgi new file mode 100755 index 0000000..1eb0d1d --- /dev/null +++ b/test/soap/calc/server.cgi @@ -0,0 +1,13 @@ +require 'soap/rpc/cgistub' + +class CalcServer < SOAP::RPC::CGIStub + def initialize(*arg) + super + + require 'calc' + servant = CalcService + add_servant(servant, 'http://tempuri.org/calcService') + end +end + +status = CalcServer.new('CalcServer', nil).start diff --git a/test/soap/calc/server.rb b/test/soap/calc/server.rb new file mode 100644 index 0000000..a93774d --- /dev/null +++ b/test/soap/calc/server.rb @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/standaloneServer' +require 'calc' + +class CalcServer < SOAP::RPC::StandaloneServer + def initialize(*arg) + super + + servant = CalcService + add_servant(servant, 'http://tempuri.org/calcService') + end +end + +if $0 == __FILE__ + status = CalcServer.new('CalcServer', nil, '0.0.0.0', 17171).start +end diff --git a/test/soap/calc/server2.rb b/test/soap/calc/server2.rb new file mode 100644 index 0000000..01c6d75 --- /dev/null +++ b/test/soap/calc/server2.rb @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/standaloneServer' +require 'calc2' + +class CalcServer2 < SOAP::RPC::StandaloneServer + def on_init + servant = CalcService2.new + add_method(servant, 'set_value', 'newValue') + add_method(servant, 'get_value') + add_method_as(servant, '+', 'add', 'lhs') + add_method_as(servant, '-', 'sub', 'lhs') + add_method_as(servant, '*', 'multi', 'lhs') + add_method_as(servant, '/', 'div', 'lhs') + end +end + +if $0 == __FILE__ + status = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', 17171).start +end diff --git a/test/soap/calc/test_calc.rb b/test/soap/calc/test_calc.rb new file mode 100644 index 0000000..7976bfb --- /dev/null +++ b/test/soap/calc/test_calc.rb @@ -0,0 +1,51 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'server.rb' + + +module SOAP +module Calc + + +class TestCalc < Test::Unit::TestCase + Port = 17171 + + def setup + @server = CalcServer.new(self.class.name, nil, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + @server.start + } + @endpoint = "http://localhost:#{Port}/" + @calc = SOAP::RPC::Driver.new(@endpoint, 'http://tempuri.org/calcService') + @calc.add_method('add', 'lhs', 'rhs') + @calc.add_method('sub', 'lhs', 'rhs') + @calc.add_method('multi', 'lhs', 'rhs') + @calc.add_method('div', 'lhs', 'rhs') + end + + def teardown + @server.shutdown if @server + if @t + @t.kill + @t.join + end + @calc.reset_stream if @calc + end + + def test_calc + assert_equal(3, @calc.add(1, 2)) + assert_equal(-1.1, @calc.sub(1.1, 2.2)) + assert_equal(2.42, @calc.multi(1.1, 2.2)) + assert_equal(2, @calc.div(5, 2)) + assert_equal(2.5, @calc.div(5.0, 2)) + assert_equal(1.0/0.0, @calc.div(1.1, 0)) + assert_raises(ZeroDivisionError) do + @calc.div(1, 0) + end + end +end + + +end +end diff --git a/test/soap/calc/test_calc2.rb b/test/soap/calc/test_calc2.rb new file mode 100644 index 0000000..277600b --- /dev/null +++ b/test/soap/calc/test_calc2.rb @@ -0,0 +1,55 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'server2.rb' + + +module SOAP +module Calc + + +class TestCalc2 < Test::Unit::TestCase + Port = 17171 + + def setup + @server = CalcServer2.new('CalcServer', 'http://tempuri.org/calcService', '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + Thread.current.abort_on_exception = true + @server.start + } + @endpoint = "http://localhost:#{Port}/" + @var = SOAP::RPC::Driver.new(@endpoint, 'http://tempuri.org/calcService') + @var.wiredump_dev = STDERR if $DEBUG + @var.add_method('set_value', 'newValue') + @var.add_method('get_value') + @var.add_method_as('+', 'add', 'rhs') + @var.add_method_as('-', 'sub', 'rhs') + @var.add_method_as('*', 'multi', 'rhs') + @var.add_method_as('/', 'div', 'rhs') + end + + def teardown + @server.shutdown if @server + if @t + @t.kill + @t.join + end + @var.reset_stream if @var + end + + def test_calc2 + assert_equal(1, @var.set_value(1)) + assert_equal(3, @var + 2) + assert_equal(-1.2, @var - 2.2) + assert_equal(2.2, @var * 2.2) + assert_equal(0, @var / 2) + assert_equal(0.5, @var / 2.0) + assert_raises(ZeroDivisionError) do + @var / 0 + end + end +end + + +end +end diff --git a/test/soap/calc/test_calc_cgi.rb b/test/soap/calc/test_calc_cgi.rb new file mode 100644 index 0000000..4f248f8 --- /dev/null +++ b/test/soap/calc/test_calc_cgi.rb @@ -0,0 +1,71 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'logger' +require 'webrick' +require 'rbconfig' + + +module SOAP +module Calc + + +class TestCalcCGI < Test::Unit::TestCase + # This test shuld be run after installing ruby. + RUBYBIN = File.join( + Config::CONFIG["bindir"], + Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"] + ) + RUBYBIN << " -d" if $DEBUG + + Port = 17171 + + def setup + logger = Logger.new(STDERR) + logger.level = Logger::Severity::ERROR + @server = WEBrick::HTTPServer.new( + :BindAddress => "0.0.0.0", + :Logger => logger, + :Port => Port, + :AccessLog => [], + :DocumentRoot => File.dirname(File.expand_path(__FILE__)), + :CGIPathEnv => ENV['PATH'], + :CGIInterpreter => RUBYBIN + ) + @t = Thread.new { + Thread.current.abort_on_exception = true + @server.start + } + @endpoint = "http://localhost:#{Port}/server.cgi" + @calc = SOAP::RPC::Driver.new(@endpoint, 'http://tempuri.org/calcService') + @calc.wiredump_dev = STDERR if $DEBUG + @calc.add_method('add', 'lhs', 'rhs') + @calc.add_method('sub', 'lhs', 'rhs') + @calc.add_method('multi', 'lhs', 'rhs') + @calc.add_method('div', 'lhs', 'rhs') + end + + def teardown + @server.shutdown if @server + if @t + @t.kill + @t.join + end + @calc.reset_stream if @calc + end + + def test_calc_cgi + assert_equal(3, @calc.add(1, 2)) + assert_equal(-1.1, @calc.sub(1.1, 2.2)) + assert_equal(2.42, @calc.multi(1.1, 2.2)) + assert_equal(2, @calc.div(5, 2)) + assert_equal(2.5, @calc.div(5.0, 2)) + assert_equal(1.0/0.0, @calc.div(1.1, 0)) + assert_raises(ZeroDivisionError) do + @calc.div(1, 0) + end + end +end + + +end +end diff --git a/test/soap/case/test_mapping.rb b/test/soap/case/test_mapping.rb new file mode 100644 index 0000000..3f29acb --- /dev/null +++ b/test/soap/case/test_mapping.rb @@ -0,0 +1,57 @@ +require 'test/unit' +require 'soap/marshal' + + +module SOAP; module Case + +# {urn:TruckMateTypes}TTMHeader +class TTMHeader + @@schema_type = "TTMHeader" + @@schema_ns = "urn:TruckMateTypes" + @@schema_element = [ + ["dSN", ["SOAP::SOAPString", XSD::QName.new(nil, "DSN")]], + ["password", ["SOAP::SOAPString", XSD::QName.new(nil, "Password")]], + ["schema", ["SOAP::SOAPString", XSD::QName.new(nil, "Schema")]], + ["username", ["SOAP::SOAPString", XSD::QName.new(nil, "Username")]] + ] + + attr_accessor :dSN + attr_accessor :password + attr_accessor :schema + attr_accessor :username + + def initialize(dSN = nil, password = nil, schema = nil, username = nil) + @dSN = dSN + @password = password + @schema = schema + @username = username + end +end + + +class TestMapping < Test::Unit::TestCase + def test_mapping + dump = <<__XML__.chomp + + + + + dsn + password + schema + username + + + +__XML__ + o = TTMHeader.new("dsn", "password", "schema", "username") + assert_equal(dump, SOAP::Marshal.dump(o)) + end +end + + +end; end diff --git a/test/soap/fault/test_customfault.rb b/test/soap/fault/test_customfault.rb new file mode 100644 index 0000000..1714f10 --- /dev/null +++ b/test/soap/fault/test_customfault.rb @@ -0,0 +1,60 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'soap/rpc/standaloneServer' + + +module SOAP +module Fault + + +class TestCustomFault < Test::Unit::TestCase + Port = 17171 + + class CustomFaultServer < SOAP::RPC::StandaloneServer + def on_init + add_method(self, 'fault', 'msg') + end + + def fault(msg) + SOAPFault.new(SOAPString.new("mycustom"), + SOAPString.new("error: #{msg}"), + SOAPString.new(self.class.name)) + end + end + + def setup + @server = CustomFaultServer.new('customfault', 'urn:customfault', '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + Thread.current.abort_on_exception = true + @server.start + } + @endpoint = "http://localhost:#{Port}/" + @client = SOAP::RPC::Driver.new(@endpoint, 'urn:customfault') + @client.wiredump_dev = STDERR if $DEBUG + @client.add_method("fault", "msg") + end + + def teardown + @server.shutdown if @server + if @t + @t.kill + @t.join + end + @client.reset_stream if @client + end + + def test_custom_fault + begin + @client.fault("message") + assert(false, 'exception not raised') + rescue SOAP::FaultError => e + assert(true, 'exception raised') + assert_equal('error: message', e.message) + end + end +end + + +end +end diff --git a/test/soap/fault/test_fault.rb b/test/soap/fault/test_fault.rb new file mode 100644 index 0000000..d5a2363 --- /dev/null +++ b/test/soap/fault/test_fault.rb @@ -0,0 +1,46 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'soap/rpc/standaloneServer' + + +module SOAP +module Fault + + +class TestFault < Test::Unit::TestCase + + def setup + @client = SOAP::RPC::Driver.new(nil, 'urn:fault') + @client.wiredump_dev = STDERR if $DEBUG + @client.add_method("hello", "msg") + end + + def teardown + @client.reset_stream if @client + end + + def test_fault + @client.mapping_registry = SOAP::Mapping::EncodedRegistry.new + @client.test_loopback_response << <<__XML__ + + + + soap:Server + DN cannot be empty + + + + +__XML__ + begin + @client.hello("world") + assert(false) + rescue ::SOAP::FaultError => e + assert_equal("DN cannot be empty", e.message) + end + end +end + + +end +end diff --git a/test/soap/fault/test_soaparray.rb b/test/soap/fault/test_soaparray.rb new file mode 100644 index 0000000..449e4ad --- /dev/null +++ b/test/soap/fault/test_soaparray.rb @@ -0,0 +1,35 @@ +require 'soap/rpc/router' +require 'soap/mapping/mapping' +require 'soap/processor' +require 'test/unit' + + +module SOAP +module Fault + + +class TestSOAPArray < Test::Unit::TestCase + + # simulate the soap fault creation and parsing on the client + def test_parse_fault + router = SOAP::RPC::Router.new('parse_SOAPArray_error') + soap_fault = pump_stack rescue router.create_fault_response($!) + env = SOAP::Processor.unmarshal(soap_fault.send_string) + soap_fault = SOAP::FaultError.new(env.body.fault) + # in literal service, RuntimeError is raised (not an ArgumentError) + # any chance to use Ruby's exception encoding in literal service? + assert_raises(RuntimeError) do + registry = SOAP::Mapping::LiteralRegistry.new + SOAP::Mapping.fault2exception(soap_fault, registry) + end + end + + def pump_stack(max = 0) + raise ArgumentError if max > 10 + pump_stack(max+1) + end +end + + +end +end diff --git a/test/soap/filter/test_filter.rb b/test/soap/filter/test_filter.rb new file mode 100644 index 0000000..5bafbb0 --- /dev/null +++ b/test/soap/filter/test_filter.rb @@ -0,0 +1,146 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'soap/rpc/standaloneServer' +require 'soap/filter' + + +module SOAP +module Filter + + +class TestFilter < Test::Unit::TestCase + Port = 17171 + PortName = 'http://tempuri.org/filterPort' + + class FilterTestServer < SOAP::RPC::StandaloneServer + class Servant + def self.create + new + end + + def echo(amt) + amt + end + end + + class ServerFilter1 < SOAP::Filter::Handler + # 15 -> 30 + def on_outbound(envelope, opt) + unless envelope.body.is_fault + node = envelope.body.root_node + node.retval = SOAPInt.new(node.retval.data * 2) + node.elename = XSD::QName.new(nil, 'return') + end + envelope + end + + # 4 -> 5 + def on_inbound(xml, opt) + xml = xml.sub(/4/, '5') + xml + end + end + + class ServerFilter2 < SOAP::Filter::Handler + # 5 -> 15 + def on_outbound(envelope, opt) + unless envelope.body.is_fault + node = envelope.body.root_node + node.retval = SOAPInt.new(node.retval.data + 10) + node.elename = XSD::QName.new(nil, 'return') + end + envelope + end + + # 5 -> 6 + def on_inbound(xml, opt) + xml = xml.sub(/5/, '6') + xml + end + end + + def initialize(*arg) + super + add_rpc_servant(Servant.new, PortName) + self.filterchain << ServerFilter1.new + self.filterchain << ServerFilter2.new + end + end + + def setup + @endpoint = "http://localhost:#{Port}/" + setup_server + setup_client + end + + def setup_server + @server = FilterTestServer.new(self.class.name, nil, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + @server.start + } + end + + def setup_client + @client = SOAP::RPC::Driver.new(@endpoint, PortName) + @client.wiredump_dev = STDERR if $DEBUG + @client.add_method('echo', 'amt') + end + + def teardown + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @t.kill + @t.join + end + + def teardown_client + @client.reset_stream + end + + class ClientFilter1 < SOAP::Filter::Handler + # 1 -> 2 + def on_outbound(envelope, opt) + param = envelope.body.root_node.inparam + param["amt"] = SOAPInt.new(param["amt"].data + 1) + param["amt"].elename = XSD::QName.new(nil, 'amt') + envelope + end + + # 31 -> 32 + def on_inbound(xml, opt) + xml = xml.sub(/31/, '32') + xml + end + end + + class ClientFilter2 < SOAP::Filter::Handler + # 2 -> 4 + def on_outbound(envelope, opt) + param = envelope.body.root_node.inparam + param["amt"] = SOAPInt.new(param["amt"].data * 2) + param["amt"].elename = XSD::QName.new(nil, 'amt') + envelope + end + + # 30 -> 31 + def on_inbound(xml, opt) + xml = xml.sub(/30/, '31') + xml + end + end + + def test_call + @client.filterchain << ClientFilter1.new + @client.filterchain << ClientFilter2.new + assert_equal(32, @client.echo(1)) + end +end + + +end +end diff --git a/test/soap/header/server.cgi b/test/soap/header/server.cgi new file mode 100755 index 0000000..2a18853 --- /dev/null +++ b/test/soap/header/server.cgi @@ -0,0 +1,119 @@ +require 'pstore' +require 'soap/rpc/cgistub' +require 'soap/header/simplehandler' + + +class AuthHeaderPortServer < SOAP::RPC::CGIStub + PortName = 'http://tempuri.org/authHeaderPort' + SupportPortName = 'http://tempuri.org/authHeaderSupportPort' + MyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "auth") + SessionDB = File.join(File.expand_path(File.dirname(__FILE__)), 'session.pstoredb') + + class AuthHeaderService + def self.create + new + end + + def deposit(amt) + "deposit #{amt} OK" + end + + def withdrawal(amt) + "withdrawal #{amt} OK" + end + end + + class AuthHeaderSupportService + def delete_sessiondb + File.unlink(SessionDB) if File.file?(SessionDB) + backup = SessionDB + "~" + File.unlink(backup) if File.file?(backup) + end + end + + def initialize(*arg) + super + add_rpc_servant(AuthHeaderService.new, PortName) + add_rpc_servant(AuthHeaderSupportService.new, SupportPortName) + add_rpc_headerhandler(ServerAuthHeaderHandler.new) + end + + class ServerAuthHeaderHandler < SOAP::Header::SimpleHandler + Users = { + 'NaHi' => 'passwd', + 'HiNa' => 'wspass' + } + + def initialize + super(MyHeaderName) + @db = PStore.new(SessionDB) + @db.transaction do + @db["root"] = {} unless @db.root?("root") + end + @userid = @sessionid = nil + end + + def login(userid, passwd) + userid and passwd and Users[userid] == passwd + end + + def auth(sessionid) + in_sessiondb do |root| + root[sessionid][0] + end + end + + def create_session(userid) + in_sessiondb do |root| + while true + key = create_sessionkey + break unless root[key] + end + root[key] = [userid] + key + end + end + + def destroy_session(sessionkey) + in_sessiondb do |root| + root.delete(sessionkey) + end + end + + def on_simple_outbound + { "sessionid" => @sessionid } + end + + def on_simple_inbound(my_header, mu) + succeeded = false + userid = my_header["userid"] + passwd = my_header["passwd"] + if login(userid, passwd) + succeeded = true + elsif sessionid = my_header["sessionid"] + if userid = auth(sessionid) + destroy_session(sessionid) + succeeded = true + end + end + raise RuntimeError.new("authentication failed") unless succeeded + @userid = userid + @sessionid = create_session(userid) + end + + private + + def create_sessionkey + Time.now.usec.to_s + end + + def in_sessiondb + @db.transaction do + yield(@db["root"]) + end + end + end +end + + +status = AuthHeaderPortServer.new('AuthHeaderPortServer', nil).start diff --git a/test/soap/header/session.pstoredb b/test/soap/header/session.pstoredb new file mode 100644 index 0000000..58601fa Binary files /dev/null and b/test/soap/header/session.pstoredb differ diff --git a/test/soap/header/test_authheader.rb b/test/soap/header/test_authheader.rb new file mode 100644 index 0000000..9c4b7c4 --- /dev/null +++ b/test/soap/header/test_authheader.rb @@ -0,0 +1,240 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'soap/rpc/standaloneServer' +require 'soap/header/simplehandler' + + +module SOAP +module Header + + +class TestAuthHeader < Test::Unit::TestCase + Port = 17171 + PortName = 'http://tempuri.org/authHeaderPort' + MyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "auth") + DummyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "dummy") + + class AuthHeaderPortServer < SOAP::RPC::StandaloneServer + class AuthHeaderService + def self.create + new + end + + def deposit(amt) + "deposit #{amt} OK" + end + + def withdrawal(amt) + "withdrawal #{amt} OK" + end + end + + def initialize(*arg) + super + add_rpc_servant(AuthHeaderService.new, PortName) + ServerAuthHeaderHandler.init + add_request_headerhandler(ServerAuthHeaderHandler) + end + + class ServerAuthHeaderHandler < SOAP::Header::SimpleHandler + class << self + def create + new + end + + def init + @users = { + 'NaHi' => 'passwd', + 'HiNa' => 'wspass' + } + @sessions = {} + end + + def login(userid, passwd) + userid and passwd and @users[userid] == passwd + end + + def auth(sessionid) + @sessions[sessionid][0] + end + + def create_session(userid) + while true + key = create_sessionkey + break unless @sessions[key] + end + @sessions[key] = [userid] + key + end + + def destroy_session(sessionkey) + @sessions.delete(sessionkey) + end + + def sessions + @sessions + end + + private + + def create_sessionkey + Time.now.usec.to_s + end + end + + def initialize + super(MyHeaderName) + @userid = @sessionid = nil + end + + def on_simple_outbound + { "sessionid" => @sessionid } + end + + def on_simple_inbound(my_header, mu) + auth = false + userid = my_header["userid"] + passwd = my_header["passwd"] + if self.class.login(userid, passwd) + auth = true + elsif sessionid = my_header["sessionid"] + if userid = self.class.auth(sessionid) + self.class.destroy_session(sessionid) + auth = true + end + end + raise RuntimeError.new("authentication failed") unless auth + @userid = userid + @sessionid = self.class.create_session(userid) + end + end + end + + class ClientAuthHeaderHandler < SOAP::Header::SimpleHandler + def initialize(userid, passwd, mustunderstand) + super(MyHeaderName) + @sessionid = nil + @userid = userid + @passwd = passwd + @mustunderstand = mustunderstand + end + + def on_simple_outbound + if @sessionid + { "sessionid" => @sessionid } + else + { "userid" => @userid, "passwd" => @passwd } + end + end + + def on_simple_inbound(my_header, mustunderstand) + @sessionid = my_header["sessionid"] + end + + def sessionid + @sessionid + end + end + + class DummyHeaderHandler < SOAP::Header::SimpleHandler + def initialize(mustunderstand) + super(DummyHeaderName) + @mustunderstand = mustunderstand + end + + def on_simple_outbound + { XSD::QName.new("foo", "bar") => nil } + end + + def on_simple_inbound(my_header, mustunderstand) + end + end + + def setup + @endpoint = "http://localhost:#{Port}/" + setup_server + setup_client + end + + def setup_server + @server = AuthHeaderPortServer.new(self.class.name, nil, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + @server.start + } + end + + def setup_client + @client = SOAP::RPC::Driver.new(@endpoint, PortName) + @client.wiredump_dev = STDERR if $DEBUG + @client.add_method('deposit', 'amt') + @client.add_method('withdrawal', 'amt') + end + + def teardown + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @t.kill + @t.join + end + + def teardown_client + @client.reset_stream + end + + def test_success_no_mu + h = ClientAuthHeaderHandler.new('NaHi', 'passwd', false) + @client.headerhandler << h + do_transaction_check(h) + end + + def test_success_mu + h = ClientAuthHeaderHandler.new('NaHi', 'passwd', true) + @client.headerhandler << h + do_transaction_check(h) + end + + def test_no_mu + h = ClientAuthHeaderHandler.new('NaHi', 'passwd', true) + @client.headerhandler << h + @client.headerhandler << DummyHeaderHandler.new(false) + do_transaction_check(h) + end + + def test_mu + h = ClientAuthHeaderHandler.new('NaHi', 'passwd', true) + @client.headerhandler << h + @client.headerhandler << (h2 = DummyHeaderHandler.new(true)) + assert_raise(SOAP::UnhandledMustUnderstandHeaderError) do + assert_equal("deposit 150 OK", @client.deposit(150)) + end + @client.headerhandler.delete(h2) + @client.headerhandler << (h2 = DummyHeaderHandler.new(false)) + do_transaction_check(h) + end + + def do_transaction_check(h) + assert_equal("deposit 150 OK", @client.deposit(150)) + serversess = AuthHeaderPortServer::ServerAuthHeaderHandler.sessions[h.sessionid] + assert_equal("NaHi", serversess[0]) + assert_equal("withdrawal 120 OK", @client.withdrawal(120)) + serversess = AuthHeaderPortServer::ServerAuthHeaderHandler.sessions[h.sessionid] + assert_equal("NaHi", serversess[0]) + end + + def test_authfailure + h = ClientAuthHeaderHandler.new('NaHi', 'pa', false) + @client.headerhandler << h + assert_raises(RuntimeError) do + @client.deposit(150) + end + end +end + + +end +end diff --git a/test/soap/header/test_authheader_cgi.rb b/test/soap/header/test_authheader_cgi.rb new file mode 100644 index 0000000..ce31fdf --- /dev/null +++ b/test/soap/header/test_authheader_cgi.rb @@ -0,0 +1,121 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'soap/rpc/standaloneServer' +require 'soap/header/simplehandler' +require 'logger' +require 'webrick' +require 'rbconfig' + + +module SOAP +module Header + + +class TestAuthHeaderCGI < Test::Unit::TestCase + # This test shuld be run after installing ruby. + RUBYBIN = File.join( + Config::CONFIG["bindir"], + Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"] + ) + RUBYBIN << " -d" if $DEBUG + + Port = 17171 + PortName = 'http://tempuri.org/authHeaderPort' + SupportPortName = 'http://tempuri.org/authHeaderSupportPort' + MyHeaderName = XSD::QName.new("http://tempuri.org/authHeader", "auth") + + class ClientAuthHeaderHandler < SOAP::Header::SimpleHandler + def initialize(userid, passwd) + super(MyHeaderName) + @sessionid = nil + @userid = userid + @passwd = passwd + end + + def on_simple_outbound + if @sessionid + { "sessionid" => @sessionid } + else + { "userid" => @userid, "passwd" => @passwd } + end + end + + def on_simple_inbound(my_header, mustunderstand) + @sessionid = my_header["sessionid"] + end + + def sessionid + @sessionid + end + end + + def setup + @endpoint = "http://localhost:#{Port}/" + setup_server + setup_client + end + + def setup_server + @endpoint = "http://localhost:#{Port}/server.cgi" + logger = Logger.new(STDERR) + logger.level = Logger::Severity::ERROR + @server = WEBrick::HTTPServer.new( + :BindAddress => "0.0.0.0", + :Logger => logger, + :Port => Port, + :AccessLog => [], + :DocumentRoot => File.dirname(File.expand_path(__FILE__)), + :CGIPathEnv => ENV['PATH'], + :CGIInterpreter => RUBYBIN + ) + @t = Thread.new { + Thread.current.abort_on_exception = true + @server.start + } + end + + def setup_client + @client = SOAP::RPC::Driver.new(@endpoint, PortName) + @client.wiredump_dev = STDERR if $DEBUG + @client.add_method('deposit', 'amt') + @client.add_method('withdrawal', 'amt') + @supportclient = SOAP::RPC::Driver.new(@endpoint, SupportPortName) + @supportclient.add_method('delete_sessiondb') + end + + def teardown + @supportclient.delete_sessiondb if @supportclient + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @t.kill + @t.join + end + + def teardown_client + @client.reset_stream + @supportclient.reset_stream + end + + def test_success + h = ClientAuthHeaderHandler.new('NaHi', 'passwd') + @client.headerhandler << h + assert_equal("deposit 150 OK", @client.deposit(150)) + assert_equal("withdrawal 120 OK", @client.withdrawal(120)) + end + + def test_authfailure + h = ClientAuthHeaderHandler.new('NaHi', 'pa') + @client.headerhandler << h + assert_raises(RuntimeError) do + @client.deposit(150) + end + end +end + + +end +end diff --git a/test/soap/header/test_simplehandler.rb b/test/soap/header/test_simplehandler.rb new file mode 100644 index 0000000..de28fff --- /dev/null +++ b/test/soap/header/test_simplehandler.rb @@ -0,0 +1,116 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'soap/rpc/standaloneServer' +require 'soap/header/simplehandler' + + +module SOAP +module Header + + +class TestSimpleHandler < Test::Unit::TestCase + Port = 17171 + PortName = 'http://tempuri.org/authHeaderPort' + + class PingPortServer < SOAP::RPC::StandaloneServer + class PingService + def self.create + new + end + + def ping + Thread.current[:pingheader] + end + end + + def initialize(*arg) + super + add_rpc_servant(PingService.new, PortName) + add_request_headerhandler(PingServerHeaderHandler) + end + + class PingServerHeaderHandler < SOAP::Header::SimpleHandler + MyHeaderName = XSD::QName.new("http://xmlsoap.org/Ping", "PingHeader") + + def self.create + new + end + + def initialize() + super(MyHeaderName) + end + + def on_simple_outbound + "dummy" + end + + def on_simple_inbound(my_header, mu) + Thread.current[:pingheader] = my_header + end + end + end + + class PingClientHeaderHandler < SOAP::Header::SimpleHandler + MyHeaderName = XSD::QName.new("http://xmlsoap.org/Ping", "PingHeader") + + def initialize(pingHeader) + super(MyHeaderName) + @pingHeader = pingHeader + @mustunderstand = false + end + + def on_simple_outbound + @pingHeader # --- note, not a Hash + end + + def on_simple_inbound(my_header, mustunderstand) + Thread.current[:pingheader] = my_header + end + end + + def setup + @endpoint = "http://localhost:#{Port}/" + setup_server + setup_client + end + + def setup_server + @server = PingPortServer.new(self.class.name, nil, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + @server.start + } + end + + def setup_client + @client = SOAP::RPC::Driver.new(@endpoint, PortName) + @client.wiredump_dev = STDERR if $DEBUG + @client.add_method('ping') + end + + def teardown + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @t.kill + @t.join + end + + def teardown_client + @client.reset_stream + end + + def test_string + h = PingClientHeaderHandler.new('pingheader') + @client.headerhandler << h + assert_equal("pingheader", @client.ping) + assert_equal("dummy", Thread.current[:pingheader]) + end +end + + +end +end diff --git a/test/soap/helloworld/hw_s.rb b/test/soap/helloworld/hw_s.rb new file mode 100644 index 0000000..1a54adb --- /dev/null +++ b/test/soap/helloworld/hw_s.rb @@ -0,0 +1,16 @@ +require 'soap/rpc/standaloneServer' + +class HelloWorldServer < SOAP::RPC::StandaloneServer + def on_init + add_method(self, 'hello_world', 'from') + end + + def hello_world(from) + "Hello World, from #{ from }" + end +end + +if $0 == __FILE__ + server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', 17171) + server.start +end diff --git a/test/soap/helloworld/test_helloworld.rb b/test/soap/helloworld/test_helloworld.rb new file mode 100644 index 0000000..9927bc6 --- /dev/null +++ b/test/soap/helloworld/test_helloworld.rb @@ -0,0 +1,43 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'hw_s.rb' + + +module SOAP +module HelloWorld + + +class TestHelloWorld < Test::Unit::TestCase + Port = 17171 + + def setup + @server = HelloWorldServer.new('hws', 'urn:hws', '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + Thread.current.abort_on_exception = true + @server.start + } + @endpoint = "http://localhost:#{Port}/" + @client = SOAP::RPC::Driver.new(@endpoint, 'urn:hws') + @client.wiredump_dev = STDERR if $DEBUG + @client.add_method("hello_world", "from") + end + + def teardown + @server.shutdown if @server + if @t + @t.kill + @t.join + end + @client.reset_stream if @client + end + + def test_hello_world + assert_equal("Hello World, from NaHi", @client.hello_world("NaHi")) + assert_equal("Hello World, from <&>", @client.hello_world("<&>")) + end +end + + +end +end diff --git a/test/soap/htpasswd b/test/soap/htpasswd new file mode 100644 index 0000000..70df50c --- /dev/null +++ b/test/soap/htpasswd @@ -0,0 +1,2 @@ +admin:Qg266hq/YYKe2 +guest:gbPc4vPCH.h12 diff --git a/test/soap/literalArrayMapping/amazonEc.rb b/test/soap/literalArrayMapping/amazonEc.rb new file mode 100644 index 0000000..8f1055e --- /dev/null +++ b/test/soap/literalArrayMapping/amazonEc.rb @@ -0,0 +1,4778 @@ +require 'xsd/qname' + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Bin +class Bin + @@schema_type = "Bin" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["binName", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BinName")]], + ["binItemCount", ["SOAP::SOAPPositiveInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BinItemCount")]], + ["binParameter", ["[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BinParameter")]] + ] + + attr_accessor :binName + attr_accessor :binItemCount + attr_accessor :binParameter + + def initialize(binName = nil, binItemCount = nil, binParameter = []) + @binName = binName + @binItemCount = binItemCount + @binParameter = binParameter + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SearchBinSet +class SearchBinSet + @@schema_type = "SearchBinSet" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_attribute = { + XSD::QName.new(nil, "NarrowBy") => "SOAP::SOAPString" + } + @@schema_element = [ + ["bin", ["Bin[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Bin")]] + ] + + attr_accessor :bin + + def xmlattr_NarrowBy + (@__xmlattr ||= {})[XSD::QName.new(nil, "NarrowBy")] + end + + def xmlattr_NarrowBy=(value) + (@__xmlattr ||= {})[XSD::QName.new(nil, "NarrowBy")] = value + end + + def initialize(bin = []) + @bin = bin + @__xmlattr = {} + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SearchBinSets +class SearchBinSets < ::Array + @@schema_element = [ + ["SearchBinSet", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SearchBinSet")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Help +class Help + @@schema_type = "Help" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["shared", ["HelpRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["HelpRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ItemSearch +class ItemSearch + @@schema_type = "ItemSearch" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["shared", ["ItemSearchRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["ItemSearchRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :xMLEscaping + attr_accessor :validate + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, xMLEscaping = nil, validate = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @xMLEscaping = xMLEscaping + @validate = validate + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ItemLookup +class ItemLookup + @@schema_type = "ItemLookup" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["ItemLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["ItemLookupRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ListSearch +class ListSearch + @@schema_type = "ListSearch" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["ListSearchRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["ListSearchRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ListLookup +class ListLookup + @@schema_type = "ListLookup" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["ListLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["ListLookupRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CustomerContentSearch +class CustomerContentSearch + @@schema_type = "CustomerContentSearch" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["CustomerContentSearchRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["CustomerContentSearchRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CustomerContentLookup +class CustomerContentLookup + @@schema_type = "CustomerContentLookup" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["CustomerContentLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["CustomerContentLookupRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SimilarityLookup +class SimilarityLookup + @@schema_type = "SimilarityLookup" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["SimilarityLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["SimilarityLookupRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SellerLookup +class SellerLookup + @@schema_type = "SellerLookup" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["SellerLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["SellerLookupRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartGet +class CartGet + @@schema_type = "CartGet" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["CartGetRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["CartGetRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartAdd +class CartAdd + @@schema_type = "CartAdd" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["CartAddRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["CartAddRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartCreate +class CartCreate + @@schema_type = "CartCreate" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["CartCreateRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["CartCreateRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartModify +class CartModify + @@schema_type = "CartModify" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["CartModifyRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["CartModifyRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartClear +class CartClear + @@schema_type = "CartClear" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["CartClearRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["CartClearRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}TransactionLookup +class TransactionLookup + @@schema_type = "TransactionLookup" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["TransactionLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["TransactionLookupRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SellerListingSearch +class SellerListingSearch + @@schema_type = "SellerListingSearch" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["SellerListingSearchRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["SellerListingSearchRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SellerListingLookup +class SellerListingLookup + @@schema_type = "SellerListingLookup" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["SellerListingLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["SellerListingLookupRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}BrowseNodeLookup +class BrowseNodeLookup + @@schema_type = "BrowseNodeLookup" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["marketplaceDomain", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MarketplaceDomain")]], + ["aWSAccessKeyId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AWSAccessKeyId")]], + ["subscriptionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionId")]], + ["associateTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AssociateTag")]], + ["validate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Validate")]], + ["xMLEscaping", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "XMLEscaping")]], + ["shared", ["BrowseNodeLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shared")]], + ["request", ["BrowseNodeLookupRequest[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]] + ] + + attr_accessor :marketplaceDomain + attr_accessor :aWSAccessKeyId + attr_accessor :subscriptionId + attr_accessor :associateTag + attr_accessor :validate + attr_accessor :xMLEscaping + attr_accessor :shared + attr_accessor :request + + def initialize(marketplaceDomain = nil, aWSAccessKeyId = nil, subscriptionId = nil, associateTag = nil, validate = nil, xMLEscaping = nil, shared = nil, request = []) + @marketplaceDomain = marketplaceDomain + @aWSAccessKeyId = aWSAccessKeyId + @subscriptionId = subscriptionId + @associateTag = associateTag + @validate = validate + @xMLEscaping = xMLEscaping + @shared = shared + @request = request + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Condition +class Condition < ::String + @@schema_type = "Condition" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + + All = Condition.new("All") + Collectible = Condition.new("Collectible") + New = Condition.new("New") + Refurbished = Condition.new("Refurbished") + Used = Condition.new("Used") +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}DeliveryMethod +class DeliveryMethod < ::String + @@schema_type = "DeliveryMethod" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + + ISPU = DeliveryMethod.new("ISPU") + Ship = DeliveryMethod.new("Ship") +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}AudienceRating +class AudienceRating < ::String + @@schema_type = "AudienceRating" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + + C_12 = AudienceRating.new("12") + C_16 = AudienceRating.new("16") + C_18 = AudienceRating.new("18") + C_6 = AudienceRating.new("6") + FamilyViewing = AudienceRating.new("FamilyViewing") + G = AudienceRating.new("G") + NC17 = AudienceRating.new("NC-17") + NR = AudienceRating.new("NR") + PG = AudienceRating.new("PG") + PG13 = AudienceRating.new("PG-13") + R = AudienceRating.new("R") + Unrated = AudienceRating.new("Unrated") +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}MultiOperation +class MultiOperation + @@schema_type = "MultiOperation" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["help", ["Help", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Help")]], + ["itemSearch", ["ItemSearch", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemSearch")]], + ["itemLookup", ["ItemLookup", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemLookup")]], + ["listSearch", ["ListSearch", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListSearch")]], + ["listLookup", ["ListLookup", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListLookup")]], + ["customerContentSearch", ["CustomerContentSearch", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerContentSearch")]], + ["customerContentLookup", ["CustomerContentLookup", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerContentLookup")]], + ["similarityLookup", ["SimilarityLookup", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SimilarityLookup")]], + ["sellerLookup", ["SellerLookup", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerLookup")]], + ["cartGet", ["CartGet", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartGet")]], + ["cartAdd", ["CartAdd", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartAdd")]], + ["cartCreate", ["CartCreate", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartCreate")]], + ["cartModify", ["CartModify", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartModify")]], + ["cartClear", ["CartClear", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartClear")]], + ["transactionLookup", ["TransactionLookup", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TransactionLookup")]], + ["sellerListingSearch", ["SellerListingSearch", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerListingSearch")]], + ["sellerListingLookup", ["SellerListingLookup", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerListingLookup")]], + ["browseNodeLookup", ["BrowseNodeLookup", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BrowseNodeLookup")]] + ] + + attr_accessor :help + attr_accessor :itemSearch + attr_accessor :itemLookup + attr_accessor :listSearch + attr_accessor :listLookup + attr_accessor :customerContentSearch + attr_accessor :customerContentLookup + attr_accessor :similarityLookup + attr_accessor :sellerLookup + attr_accessor :cartGet + attr_accessor :cartAdd + attr_accessor :cartCreate + attr_accessor :cartModify + attr_accessor :cartClear + attr_accessor :transactionLookup + attr_accessor :sellerListingSearch + attr_accessor :sellerListingLookup + attr_accessor :browseNodeLookup + + def initialize(help = nil, itemSearch = nil, itemLookup = nil, listSearch = nil, listLookup = nil, customerContentSearch = nil, customerContentLookup = nil, similarityLookup = nil, sellerLookup = nil, cartGet = nil, cartAdd = nil, cartCreate = nil, cartModify = nil, cartClear = nil, transactionLookup = nil, sellerListingSearch = nil, sellerListingLookup = nil, browseNodeLookup = nil) + @help = help + @itemSearch = itemSearch + @itemLookup = itemLookup + @listSearch = listSearch + @listLookup = listLookup + @customerContentSearch = customerContentSearch + @customerContentLookup = customerContentLookup + @similarityLookup = similarityLookup + @sellerLookup = sellerLookup + @cartGet = cartGet + @cartAdd = cartAdd + @cartCreate = cartCreate + @cartModify = cartModify + @cartClear = cartClear + @transactionLookup = transactionLookup + @sellerListingSearch = sellerListingSearch + @sellerListingLookup = sellerListingLookup + @browseNodeLookup = browseNodeLookup + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}HelpResponse +class HelpResponse + @@schema_type = "HelpResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["information", ["Information[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Information")]] + ] + + attr_accessor :operationRequest + attr_accessor :information + + def initialize(operationRequest = nil, information = []) + @operationRequest = operationRequest + @information = information + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ItemSearchResponse +class ItemSearchResponse + @@schema_type = "ItemSearchResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["items", ["Items[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Items")]] + ] + + attr_accessor :operationRequest + attr_accessor :items + + def initialize(operationRequest = nil, items = []) + @operationRequest = operationRequest + @items = items + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ItemLookupResponse +class ItemLookupResponse + @@schema_type = "ItemLookupResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["items", ["Items[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Items")]] + ] + + attr_accessor :operationRequest + attr_accessor :items + + def initialize(operationRequest = nil, items = []) + @operationRequest = operationRequest + @items = items + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ListSearchResponse +class ListSearchResponse + @@schema_type = "ListSearchResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["lists", ["Lists[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Lists")]] + ] + + attr_accessor :operationRequest + attr_accessor :lists + + def initialize(operationRequest = nil, lists = []) + @operationRequest = operationRequest + @lists = lists + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ListLookupResponse +class ListLookupResponse + @@schema_type = "ListLookupResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["lists", ["Lists[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Lists")]] + ] + + attr_accessor :operationRequest + attr_accessor :lists + + def initialize(operationRequest = nil, lists = []) + @operationRequest = operationRequest + @lists = lists + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CustomerContentSearchResponse +class CustomerContentSearchResponse + @@schema_type = "CustomerContentSearchResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["customers", ["Customers[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Customers")]] + ] + + attr_accessor :operationRequest + attr_accessor :customers + + def initialize(operationRequest = nil, customers = []) + @operationRequest = operationRequest + @customers = customers + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CustomerContentLookupResponse +class CustomerContentLookupResponse + @@schema_type = "CustomerContentLookupResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["customers", ["Customers[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Customers")]] + ] + + attr_accessor :operationRequest + attr_accessor :customers + + def initialize(operationRequest = nil, customers = []) + @operationRequest = operationRequest + @customers = customers + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SimilarityLookupResponse +class SimilarityLookupResponse + @@schema_type = "SimilarityLookupResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["items", ["Items[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Items")]] + ] + + attr_accessor :operationRequest + attr_accessor :items + + def initialize(operationRequest = nil, items = []) + @operationRequest = operationRequest + @items = items + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SellerLookupResponse +class SellerLookupResponse + @@schema_type = "SellerLookupResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["sellers", ["Sellers[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Sellers")]] + ] + + attr_accessor :operationRequest + attr_accessor :sellers + + def initialize(operationRequest = nil, sellers = []) + @operationRequest = operationRequest + @sellers = sellers + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartGetResponse +class CartGetResponse + @@schema_type = "CartGetResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["cart", ["Cart[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Cart")]] + ] + + attr_accessor :operationRequest + attr_accessor :cart + + def initialize(operationRequest = nil, cart = []) + @operationRequest = operationRequest + @cart = cart + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartAddResponse +class CartAddResponse + @@schema_type = "CartAddResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["cart", ["Cart[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Cart")]] + ] + + attr_accessor :operationRequest + attr_accessor :cart + + def initialize(operationRequest = nil, cart = []) + @operationRequest = operationRequest + @cart = cart + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartCreateResponse +class CartCreateResponse + @@schema_type = "CartCreateResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["cart", ["Cart[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Cart")]] + ] + + attr_accessor :operationRequest + attr_accessor :cart + + def initialize(operationRequest = nil, cart = []) + @operationRequest = operationRequest + @cart = cart + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartModifyResponse +class CartModifyResponse + @@schema_type = "CartModifyResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["cart", ["Cart[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Cart")]] + ] + + attr_accessor :operationRequest + attr_accessor :cart + + def initialize(operationRequest = nil, cart = []) + @operationRequest = operationRequest + @cart = cart + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartClearResponse +class CartClearResponse + @@schema_type = "CartClearResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["cart", ["Cart[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Cart")]] + ] + + attr_accessor :operationRequest + attr_accessor :cart + + def initialize(operationRequest = nil, cart = []) + @operationRequest = operationRequest + @cart = cart + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}TransactionLookupResponse +class TransactionLookupResponse + @@schema_type = "TransactionLookupResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["transactions", ["Transactions[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Transactions")]] + ] + + attr_accessor :operationRequest + attr_accessor :transactions + + def initialize(operationRequest = nil, transactions = []) + @operationRequest = operationRequest + @transactions = transactions + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SellerListingSearchResponse +class SellerListingSearchResponse + @@schema_type = "SellerListingSearchResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["sellerListings", ["SellerListings[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerListings")]] + ] + + attr_accessor :operationRequest + attr_accessor :sellerListings + + def initialize(operationRequest = nil, sellerListings = []) + @operationRequest = operationRequest + @sellerListings = sellerListings + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SellerListingLookupResponse +class SellerListingLookupResponse + @@schema_type = "SellerListingLookupResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["sellerListings", ["SellerListings[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerListings")]] + ] + + attr_accessor :operationRequest + attr_accessor :sellerListings + + def initialize(operationRequest = nil, sellerListings = []) + @operationRequest = operationRequest + @sellerListings = sellerListings + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}BrowseNodeLookupResponse +class BrowseNodeLookupResponse + @@schema_type = "BrowseNodeLookupResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["browseNodes", ["BrowseNodes[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BrowseNodes")]] + ] + + attr_accessor :operationRequest + attr_accessor :browseNodes + + def initialize(operationRequest = nil, browseNodes = []) + @operationRequest = operationRequest + @browseNodes = browseNodes + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}MultiOperationResponse +class MultiOperationResponse + @@schema_type = "MultiOperationResponse" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["operationRequest", ["OperationRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationRequest")]], + ["helpResponse", ["HelpResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HelpResponse")]], + ["itemSearchResponse", ["ItemSearchResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemSearchResponse")]], + ["itemLookupResponse", ["ItemLookupResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemLookupResponse")]], + ["listSearchResponse", ["ListSearchResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListSearchResponse")]], + ["listLookupResponse", ["ListLookupResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListLookupResponse")]], + ["customerContentSearchResponse", ["CustomerContentSearchResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerContentSearchResponse")]], + ["customerContentLookupResponse", ["CustomerContentLookupResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerContentLookupResponse")]], + ["similarityLookupResponse", ["SimilarityLookupResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SimilarityLookupResponse")]], + ["sellerLookupResponse", ["SellerLookupResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerLookupResponse")]], + ["cartGetResponse", ["CartGetResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartGetResponse")]], + ["cartAddResponse", ["CartAddResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartAddResponse")]], + ["cartCreateResponse", ["CartCreateResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartCreateResponse")]], + ["cartModifyResponse", ["CartModifyResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartModifyResponse")]], + ["cartClearResponse", ["CartClearResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartClearResponse")]], + ["transactionLookupResponse", ["TransactionLookupResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TransactionLookupResponse")]], + ["sellerListingSearchResponse", ["SellerListingSearchResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerListingSearchResponse")]], + ["sellerListingLookupResponse", ["SellerListingLookupResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerListingLookupResponse")]], + ["browseNodeLookupResponse", ["BrowseNodeLookupResponse", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BrowseNodeLookupResponse")]] + ] + + attr_accessor :operationRequest + attr_accessor :helpResponse + attr_accessor :itemSearchResponse + attr_accessor :itemLookupResponse + attr_accessor :listSearchResponse + attr_accessor :listLookupResponse + attr_accessor :customerContentSearchResponse + attr_accessor :customerContentLookupResponse + attr_accessor :similarityLookupResponse + attr_accessor :sellerLookupResponse + attr_accessor :cartGetResponse + attr_accessor :cartAddResponse + attr_accessor :cartCreateResponse + attr_accessor :cartModifyResponse + attr_accessor :cartClearResponse + attr_accessor :transactionLookupResponse + attr_accessor :sellerListingSearchResponse + attr_accessor :sellerListingLookupResponse + attr_accessor :browseNodeLookupResponse + + def initialize(operationRequest = nil, helpResponse = nil, itemSearchResponse = nil, itemLookupResponse = nil, listSearchResponse = nil, listLookupResponse = nil, customerContentSearchResponse = nil, customerContentLookupResponse = nil, similarityLookupResponse = nil, sellerLookupResponse = nil, cartGetResponse = nil, cartAddResponse = nil, cartCreateResponse = nil, cartModifyResponse = nil, cartClearResponse = nil, transactionLookupResponse = nil, sellerListingSearchResponse = nil, sellerListingLookupResponse = nil, browseNodeLookupResponse = nil) + @operationRequest = operationRequest + @helpResponse = helpResponse + @itemSearchResponse = itemSearchResponse + @itemLookupResponse = itemLookupResponse + @listSearchResponse = listSearchResponse + @listLookupResponse = listLookupResponse + @customerContentSearchResponse = customerContentSearchResponse + @customerContentLookupResponse = customerContentLookupResponse + @similarityLookupResponse = similarityLookupResponse + @sellerLookupResponse = sellerLookupResponse + @cartGetResponse = cartGetResponse + @cartAddResponse = cartAddResponse + @cartCreateResponse = cartCreateResponse + @cartModifyResponse = cartModifyResponse + @cartClearResponse = cartClearResponse + @transactionLookupResponse = transactionLookupResponse + @sellerListingSearchResponse = sellerListingSearchResponse + @sellerListingLookupResponse = sellerListingLookupResponse + @browseNodeLookupResponse = browseNodeLookupResponse + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}OperationRequest +class OperationRequest + @@schema_type = "OperationRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["hTTPHeaders", ["HTTPHeaders", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HTTPHeaders")]], + ["requestId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RequestId")]], + ["arguments", ["Arguments", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Arguments")]], + ["errors", ["Errors", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Errors")]], + ["requestProcessingTime", ["SOAP::SOAPFloat", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RequestProcessingTime")]] + ] + + attr_accessor :hTTPHeaders + attr_accessor :requestId + attr_accessor :arguments + attr_accessor :errors + attr_accessor :requestProcessingTime + + def initialize(hTTPHeaders = nil, requestId = nil, arguments = nil, errors = nil, requestProcessingTime = nil) + @hTTPHeaders = hTTPHeaders + @requestId = requestId + @arguments = arguments + @errors = errors + @requestProcessingTime = requestProcessingTime + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Request +class Request + @@schema_type = "Request" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["isValid", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IsValid")]], + ["helpRequest", ["HelpRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HelpRequest")]], + ["browseNodeLookupRequest", ["BrowseNodeLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BrowseNodeLookupRequest")]], + ["itemSearchRequest", ["ItemSearchRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemSearchRequest")]], + ["itemLookupRequest", ["ItemLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemLookupRequest")]], + ["listSearchRequest", ["ListSearchRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListSearchRequest")]], + ["listLookupRequest", ["ListLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListLookupRequest")]], + ["customerContentSearchRequest", ["CustomerContentSearchRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerContentSearchRequest")]], + ["customerContentLookupRequest", ["CustomerContentLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerContentLookupRequest")]], + ["similarityLookupRequest", ["SimilarityLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SimilarityLookupRequest")]], + ["cartGetRequest", ["CartGetRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartGetRequest")]], + ["cartAddRequest", ["CartAddRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartAddRequest")]], + ["cartCreateRequest", ["CartCreateRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartCreateRequest")]], + ["cartModifyRequest", ["CartModifyRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartModifyRequest")]], + ["cartClearRequest", ["CartClearRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartClearRequest")]], + ["transactionLookupRequest", ["TransactionLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TransactionLookupRequest")]], + ["sellerListingSearchRequest", ["SellerListingSearchRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerListingSearchRequest")]], + ["sellerListingLookupRequest", ["SellerListingLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerListingLookupRequest")]], + ["sellerLookupRequest", ["SellerLookupRequest", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerLookupRequest")]], + ["errors", ["Errors", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Errors")]] + ] + + attr_accessor :isValid + attr_accessor :helpRequest + attr_accessor :browseNodeLookupRequest + attr_accessor :itemSearchRequest + attr_accessor :itemLookupRequest + attr_accessor :listSearchRequest + attr_accessor :listLookupRequest + attr_accessor :customerContentSearchRequest + attr_accessor :customerContentLookupRequest + attr_accessor :similarityLookupRequest + attr_accessor :cartGetRequest + attr_accessor :cartAddRequest + attr_accessor :cartCreateRequest + attr_accessor :cartModifyRequest + attr_accessor :cartClearRequest + attr_accessor :transactionLookupRequest + attr_accessor :sellerListingSearchRequest + attr_accessor :sellerListingLookupRequest + attr_accessor :sellerLookupRequest + attr_accessor :errors + + def initialize(isValid = nil, helpRequest = nil, browseNodeLookupRequest = nil, itemSearchRequest = nil, itemLookupRequest = nil, listSearchRequest = nil, listLookupRequest = nil, customerContentSearchRequest = nil, customerContentLookupRequest = nil, similarityLookupRequest = nil, cartGetRequest = nil, cartAddRequest = nil, cartCreateRequest = nil, cartModifyRequest = nil, cartClearRequest = nil, transactionLookupRequest = nil, sellerListingSearchRequest = nil, sellerListingLookupRequest = nil, sellerLookupRequest = nil, errors = nil) + @isValid = isValid + @helpRequest = helpRequest + @browseNodeLookupRequest = browseNodeLookupRequest + @itemSearchRequest = itemSearchRequest + @itemLookupRequest = itemLookupRequest + @listSearchRequest = listSearchRequest + @listLookupRequest = listLookupRequest + @customerContentSearchRequest = customerContentSearchRequest + @customerContentLookupRequest = customerContentLookupRequest + @similarityLookupRequest = similarityLookupRequest + @cartGetRequest = cartGetRequest + @cartAddRequest = cartAddRequest + @cartCreateRequest = cartCreateRequest + @cartModifyRequest = cartModifyRequest + @cartClearRequest = cartClearRequest + @transactionLookupRequest = transactionLookupRequest + @sellerListingSearchRequest = sellerListingSearchRequest + @sellerListingLookupRequest = sellerListingLookupRequest + @sellerLookupRequest = sellerLookupRequest + @errors = errors + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Arguments +class Arguments < ::Array + @@schema_element = [ + ["Argument", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Argument")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}HTTPHeaders +class HTTPHeaders < ::Array + @@schema_element = [ + ["Header", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Header")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Errors +class Errors < ::Array + @@schema_element = [ + ["Error", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Error")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Information +class Information + @@schema_type = "Information" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["request", ["Request", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]], + ["operationInformation", ["OperationInformation[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OperationInformation")]], + ["responseGroupInformation", ["ResponseGroupInformation[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroupInformation")]] + ] + + attr_accessor :request + attr_accessor :operationInformation + attr_accessor :responseGroupInformation + + def initialize(request = nil, operationInformation = [], responseGroupInformation = []) + @request = request + @operationInformation = operationInformation + @responseGroupInformation = responseGroupInformation + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Items +class Items + @@schema_type = "Items" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["request", ["Request", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]], + ["correctedQuery", ["CorrectedQuery", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CorrectedQuery")]], + ["totalResults", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalResults")]], + ["totalPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalPages")]], + ["searchResultsMap", ["SearchResultsMap", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SearchResultsMap")]], + ["item", ["Item[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Item")]], + ["searchBinSets", ["SearchBinSets", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SearchBinSets")]] + ] + + attr_accessor :request + attr_accessor :correctedQuery + attr_accessor :totalResults + attr_accessor :totalPages + attr_accessor :searchResultsMap + attr_accessor :item + attr_accessor :searchBinSets + + def initialize(request = nil, correctedQuery = nil, totalResults = nil, totalPages = nil, searchResultsMap = nil, item = [], searchBinSets = nil) + @request = request + @correctedQuery = correctedQuery + @totalResults = totalResults + @totalPages = totalPages + @searchResultsMap = searchResultsMap + @item = item + @searchBinSets = searchBinSets + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CorrectedQuery +class CorrectedQuery + @@schema_type = "CorrectedQuery" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["keywords", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Keywords")]], + ["message", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Message")]] + ] + + attr_accessor :keywords + attr_accessor :message + + def initialize(keywords = nil, message = nil) + @keywords = keywords + @message = message + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Lists +class Lists + @@schema_type = "Lists" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["request", ["Request", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]], + ["totalResults", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalResults")]], + ["totalPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalPages")]], + ["list", ["List[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "List")]] + ] + + attr_accessor :request + attr_accessor :totalResults + attr_accessor :totalPages + attr_accessor :list + + def initialize(request = nil, totalResults = nil, totalPages = nil, list = []) + @request = request + @totalResults = totalResults + @totalPages = totalPages + @list = list + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Customers +class Customers + @@schema_type = "Customers" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["request", ["Request", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]], + ["totalResults", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalResults")]], + ["totalPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalPages")]], + ["customer", ["Customer[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Customer")]] + ] + + attr_accessor :request + attr_accessor :totalResults + attr_accessor :totalPages + attr_accessor :customer + + def initialize(request = nil, totalResults = nil, totalPages = nil, customer = []) + @request = request + @totalResults = totalResults + @totalPages = totalPages + @customer = customer + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Cart +class Cart + @@schema_type = "Cart" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["request", ["Request", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]], + ["cartId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartId")]], + ["hMAC", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HMAC")]], + ["uRLEncodedHMAC", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "URLEncodedHMAC")]], + ["purchaseURL", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PurchaseURL")]], + ["subTotal", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubTotal")]], + ["cartItems", ["CartItems", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartItems")]], + ["savedForLaterItems", ["SavedForLaterItems", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SavedForLaterItems")]], + ["similarProducts", ["SimilarProducts", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SimilarProducts")]], + ["topSellers", ["TopSellers", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TopSellers")]], + ["newReleases", ["NewReleases", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NewReleases")]], + ["similarViewedProducts", ["SimilarViewedProducts", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SimilarViewedProducts")]], + ["otherCategoriesSimilarProducts", ["OtherCategoriesSimilarProducts", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OtherCategoriesSimilarProducts")]] + ] + + attr_accessor :request + attr_accessor :cartId + attr_accessor :hMAC + attr_accessor :uRLEncodedHMAC + attr_accessor :purchaseURL + attr_accessor :subTotal + attr_accessor :cartItems + attr_accessor :savedForLaterItems + attr_accessor :similarProducts + attr_accessor :topSellers + attr_accessor :newReleases + attr_accessor :similarViewedProducts + attr_accessor :otherCategoriesSimilarProducts + + def initialize(request = nil, cartId = nil, hMAC = nil, uRLEncodedHMAC = nil, purchaseURL = nil, subTotal = nil, cartItems = nil, savedForLaterItems = nil, similarProducts = nil, topSellers = nil, newReleases = nil, similarViewedProducts = nil, otherCategoriesSimilarProducts = nil) + @request = request + @cartId = cartId + @hMAC = hMAC + @uRLEncodedHMAC = uRLEncodedHMAC + @purchaseURL = purchaseURL + @subTotal = subTotal + @cartItems = cartItems + @savedForLaterItems = savedForLaterItems + @similarProducts = similarProducts + @topSellers = topSellers + @newReleases = newReleases + @similarViewedProducts = similarViewedProducts + @otherCategoriesSimilarProducts = otherCategoriesSimilarProducts + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Transactions +class Transactions + @@schema_type = "Transactions" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["request", ["Request", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]], + ["totalResults", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalResults")]], + ["totalPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalPages")]], + ["transaction", ["Transaction[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Transaction")]] + ] + + attr_accessor :request + attr_accessor :totalResults + attr_accessor :totalPages + attr_accessor :transaction + + def initialize(request = nil, totalResults = nil, totalPages = nil, transaction = []) + @request = request + @totalResults = totalResults + @totalPages = totalPages + @transaction = transaction + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Sellers +class Sellers + @@schema_type = "Sellers" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["request", ["Request", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]], + ["totalResults", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalResults")]], + ["totalPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalPages")]], + ["seller", ["Seller[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Seller")]] + ] + + attr_accessor :request + attr_accessor :totalResults + attr_accessor :totalPages + attr_accessor :seller + + def initialize(request = nil, totalResults = nil, totalPages = nil, seller = []) + @request = request + @totalResults = totalResults + @totalPages = totalPages + @seller = seller + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SellerListings +class SellerListings + @@schema_type = "SellerListings" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["request", ["Request", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]], + ["totalResults", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalResults")]], + ["totalPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalPages")]], + ["sellerListing", ["SellerListing[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerListing")]] + ] + + attr_accessor :request + attr_accessor :totalResults + attr_accessor :totalPages + attr_accessor :sellerListing + + def initialize(request = nil, totalResults = nil, totalPages = nil, sellerListing = []) + @request = request + @totalResults = totalResults + @totalPages = totalPages + @sellerListing = sellerListing + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}OperationInformation +class OperationInformation + @@schema_type = "OperationInformation" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["name", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Name")]], + ["description", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Description")]], + ["requiredParameters", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RequiredParameters")]], + ["availableParameters", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AvailableParameters")]], + ["defaultResponseGroups", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DefaultResponseGroups")]], + ["availableResponseGroups", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AvailableResponseGroups")]] + ] + + attr_accessor :name + attr_accessor :description + attr_accessor :requiredParameters + attr_accessor :availableParameters + attr_accessor :defaultResponseGroups + attr_accessor :availableResponseGroups + + def initialize(name = nil, description = nil, requiredParameters = nil, availableParameters = nil, defaultResponseGroups = nil, availableResponseGroups = nil) + @name = name + @description = description + @requiredParameters = requiredParameters + @availableParameters = availableParameters + @defaultResponseGroups = defaultResponseGroups + @availableResponseGroups = availableResponseGroups + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ResponseGroupInformation +class ResponseGroupInformation + @@schema_type = "ResponseGroupInformation" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["name", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Name")]], + ["creationDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CreationDate")]], + ["validOperations", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ValidOperations")]], + ["elements", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Elements")]] + ] + + attr_accessor :name + attr_accessor :creationDate + attr_accessor :validOperations + attr_accessor :elements + + def initialize(name = nil, creationDate = nil, validOperations = nil, elements = nil) + @name = name + @creationDate = creationDate + @validOperations = validOperations + @elements = elements + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}List +class List + @@schema_type = "List" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["listId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListId")]], + ["listURL", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListURL")]], + ["registryNumber", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RegistryNumber")]], + ["listName", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListName")]], + ["listType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListType")]], + ["totalItems", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalItems")]], + ["totalPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalPages")]], + ["dateCreated", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DateCreated")]], + ["occasionDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OccasionDate")]], + ["customerName", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerName")]], + ["partnerName", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PartnerName")]], + ["additionalName", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AdditionalName")]], + ["comment", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Comment")]], + ["image", ["Image", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Image")]], + ["averageRating", ["SOAP::SOAPDecimal", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AverageRating")]], + ["totalVotes", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalVotes")]], + ["totalTimesRead", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalTimesRead")]], + ["listItem", ["ListItem[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListItem")]] + ] + + attr_accessor :listId + attr_accessor :listURL + attr_accessor :registryNumber + attr_accessor :listName + attr_accessor :listType + attr_accessor :totalItems + attr_accessor :totalPages + attr_accessor :dateCreated + attr_accessor :occasionDate + attr_accessor :customerName + attr_accessor :partnerName + attr_accessor :additionalName + attr_accessor :comment + attr_accessor :image + attr_accessor :averageRating + attr_accessor :totalVotes + attr_accessor :totalTimesRead + attr_accessor :listItem + + def initialize(listId = nil, listURL = nil, registryNumber = nil, listName = nil, listType = nil, totalItems = nil, totalPages = nil, dateCreated = nil, occasionDate = nil, customerName = nil, partnerName = nil, additionalName = nil, comment = nil, image = nil, averageRating = nil, totalVotes = nil, totalTimesRead = nil, listItem = []) + @listId = listId + @listURL = listURL + @registryNumber = registryNumber + @listName = listName + @listType = listType + @totalItems = totalItems + @totalPages = totalPages + @dateCreated = dateCreated + @occasionDate = occasionDate + @customerName = customerName + @partnerName = partnerName + @additionalName = additionalName + @comment = comment + @image = image + @averageRating = averageRating + @totalVotes = totalVotes + @totalTimesRead = totalTimesRead + @listItem = listItem + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ListItem +class ListItem + @@schema_type = "ListItem" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["listItemId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListItemId")]], + ["dateAdded", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DateAdded")]], + ["comment", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Comment")]], + ["quantityDesired", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "QuantityDesired")]], + ["quantityReceived", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "QuantityReceived")]], + ["item", ["Item", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Item")]] + ] + + attr_accessor :listItemId + attr_accessor :dateAdded + attr_accessor :comment + attr_accessor :quantityDesired + attr_accessor :quantityReceived + attr_accessor :item + + def initialize(listItemId = nil, dateAdded = nil, comment = nil, quantityDesired = nil, quantityReceived = nil, item = nil) + @listItemId = listItemId + @dateAdded = dateAdded + @comment = comment + @quantityDesired = quantityDesired + @quantityReceived = quantityReceived + @item = item + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Customer +class Customer + @@schema_type = "Customer" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["customerId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerId")]], + ["nickname", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Nickname")]], + ["birthday", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Birthday")]], + ["wishListId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "WishListId")]], + ["location", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Location")]], + ["customerReviews", ["CustomerReviews[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerReviews")]] + ] + + attr_accessor :customerId + attr_accessor :nickname + attr_accessor :birthday + attr_accessor :wishListId + attr_accessor :location + attr_accessor :customerReviews + + def initialize(customerId = nil, nickname = nil, birthday = nil, wishListId = nil, location = nil, customerReviews = []) + @customerId = customerId + @nickname = nickname + @birthday = birthday + @wishListId = wishListId + @location = location + @customerReviews = customerReviews + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SearchResultsMap +class SearchResultsMap < ::Array + @@schema_element = [ + ["SearchIndex", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SearchIndex")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Item +class Item + @@schema_type = "Item" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["aSIN", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ASIN")]], + ["errors", ["Errors", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Errors")]], + ["detailPageURL", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DetailPageURL")]], + ["salesRank", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SalesRank")]], + ["smallImage", ["Image", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SmallImage")]], + ["mediumImage", ["Image", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MediumImage")]], + ["largeImage", ["Image", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "LargeImage")]], + ["imageSets", ["[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ImageSets")]], + ["itemAttributes", ["ItemAttributes", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemAttributes")]], + ["merchantItemAttributes", ["MerchantItemAttributes", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MerchantItemAttributes")]], + ["subjects", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Subjects")]], + ["offerSummary", ["OfferSummary", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OfferSummary")]], + ["offers", ["Offers", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Offers")]], + ["variationSummary", ["VariationSummary", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "VariationSummary")]], + ["variations", ["Variations", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Variations")]], + ["customerReviews", ["CustomerReviews", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerReviews")]], + ["editorialReviews", ["EditorialReviews", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "EditorialReviews")]], + ["similarProducts", ["SimilarProducts", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SimilarProducts")]], + ["accessories", ["Accessories", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Accessories")]], + ["tracks", ["Tracks", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Tracks")]], + ["browseNodes", ["BrowseNodes", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BrowseNodes")]], + ["listmaniaLists", ["ListmaniaLists", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListmaniaLists")]], + ["searchInside", ["SearchInside", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SearchInside")]] + ] + + attr_accessor :aSIN + attr_accessor :errors + attr_accessor :detailPageURL + attr_accessor :salesRank + attr_accessor :smallImage + attr_accessor :mediumImage + attr_accessor :largeImage + attr_accessor :imageSets + attr_accessor :itemAttributes + attr_accessor :merchantItemAttributes + attr_accessor :subjects + attr_accessor :offerSummary + attr_accessor :offers + attr_accessor :variationSummary + attr_accessor :variations + attr_accessor :customerReviews + attr_accessor :editorialReviews + attr_accessor :similarProducts + attr_accessor :accessories + attr_accessor :tracks + attr_accessor :browseNodes + attr_accessor :listmaniaLists + attr_accessor :searchInside + + def initialize(aSIN = nil, errors = nil, detailPageURL = nil, salesRank = nil, smallImage = nil, mediumImage = nil, largeImage = nil, imageSets = [], itemAttributes = nil, merchantItemAttributes = nil, subjects = nil, offerSummary = nil, offers = nil, variationSummary = nil, variations = nil, customerReviews = nil, editorialReviews = nil, similarProducts = nil, accessories = nil, tracks = nil, browseNodes = nil, listmaniaLists = nil, searchInside = nil) + @aSIN = aSIN + @errors = errors + @detailPageURL = detailPageURL + @salesRank = salesRank + @smallImage = smallImage + @mediumImage = mediumImage + @largeImage = largeImage + @imageSets = imageSets + @itemAttributes = itemAttributes + @merchantItemAttributes = merchantItemAttributes + @subjects = subjects + @offerSummary = offerSummary + @offers = offers + @variationSummary = variationSummary + @variations = variations + @customerReviews = customerReviews + @editorialReviews = editorialReviews + @similarProducts = similarProducts + @accessories = accessories + @tracks = tracks + @browseNodes = browseNodes + @listmaniaLists = listmaniaLists + @searchInside = searchInside + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}OfferSummary +class OfferSummary + @@schema_type = "OfferSummary" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["lowestNewPrice", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "LowestNewPrice")]], + ["lowestUsedPrice", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "LowestUsedPrice")]], + ["lowestCollectiblePrice", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "LowestCollectiblePrice")]], + ["lowestRefurbishedPrice", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "LowestRefurbishedPrice")]], + ["totalNew", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalNew")]], + ["totalUsed", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalUsed")]], + ["totalCollectible", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalCollectible")]], + ["totalRefurbished", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalRefurbished")]] + ] + + attr_accessor :lowestNewPrice + attr_accessor :lowestUsedPrice + attr_accessor :lowestCollectiblePrice + attr_accessor :lowestRefurbishedPrice + attr_accessor :totalNew + attr_accessor :totalUsed + attr_accessor :totalCollectible + attr_accessor :totalRefurbished + + def initialize(lowestNewPrice = nil, lowestUsedPrice = nil, lowestCollectiblePrice = nil, lowestRefurbishedPrice = nil, totalNew = nil, totalUsed = nil, totalCollectible = nil, totalRefurbished = nil) + @lowestNewPrice = lowestNewPrice + @lowestUsedPrice = lowestUsedPrice + @lowestCollectiblePrice = lowestCollectiblePrice + @lowestRefurbishedPrice = lowestRefurbishedPrice + @totalNew = totalNew + @totalUsed = totalUsed + @totalCollectible = totalCollectible + @totalRefurbished = totalRefurbished + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Offers +class Offers + @@schema_type = "Offers" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["totalOffers", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalOffers")]], + ["totalOfferPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalOfferPages")]], + ["offer", ["Offer[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Offer")]] + ] + + attr_accessor :totalOffers + attr_accessor :totalOfferPages + attr_accessor :offer + + def initialize(totalOffers = nil, totalOfferPages = nil, offer = []) + @totalOffers = totalOffers + @totalOfferPages = totalOfferPages + @offer = offer + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Offer +class Offer + @@schema_type = "Offer" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["merchant", ["Merchant", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Merchant")]], + ["seller", ["Seller", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Seller")]], + ["offerAttributes", ["OfferAttributes", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OfferAttributes")]], + ["offerListing", ["OfferListing[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OfferListing")]] + ] + + attr_accessor :merchant + attr_accessor :seller + attr_accessor :offerAttributes + attr_accessor :offerListing + + def initialize(merchant = nil, seller = nil, offerAttributes = nil, offerListing = []) + @merchant = merchant + @seller = seller + @offerAttributes = offerAttributes + @offerListing = offerListing + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}OfferAttributes +class OfferAttributes + @@schema_type = "OfferAttributes" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["condition", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Condition")]], + ["subCondition", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubCondition")]], + ["conditionNote", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ConditionNote")]], + ["willShipExpedited", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "WillShipExpedited")]], + ["willShipInternational", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "WillShipInternational")]] + ] + + attr_accessor :condition + attr_accessor :subCondition + attr_accessor :conditionNote + attr_accessor :willShipExpedited + attr_accessor :willShipInternational + + def initialize(condition = nil, subCondition = nil, conditionNote = nil, willShipExpedited = nil, willShipInternational = nil) + @condition = condition + @subCondition = subCondition + @conditionNote = conditionNote + @willShipExpedited = willShipExpedited + @willShipInternational = willShipInternational + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Merchant +class Merchant + @@schema_type = "Merchant" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["merchantId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MerchantId")]], + ["name", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Name")]], + ["glancePage", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GlancePage")]], + ["averageFeedbackRating", ["SOAP::SOAPDecimal", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AverageFeedbackRating")]], + ["totalFeedback", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalFeedback")]], + ["totalFeedbackPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalFeedbackPages")]] + ] + + attr_accessor :merchantId + attr_accessor :name + attr_accessor :glancePage + attr_accessor :averageFeedbackRating + attr_accessor :totalFeedback + attr_accessor :totalFeedbackPages + + def initialize(merchantId = nil, name = nil, glancePage = nil, averageFeedbackRating = nil, totalFeedback = nil, totalFeedbackPages = nil) + @merchantId = merchantId + @name = name + @glancePage = glancePage + @averageFeedbackRating = averageFeedbackRating + @totalFeedback = totalFeedback + @totalFeedbackPages = totalFeedbackPages + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}OfferListing +class OfferListing + @@schema_type = "OfferListing" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["offerListingId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OfferListingId")]], + ["exchangeId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ExchangeId")]], + ["price", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Price")]], + ["salePrice", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SalePrice")]], + ["availability", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Availability")]], + ["iSPUStoreAddress", ["Address", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ISPUStoreAddress")]], + ["iSPUStoreHours", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ISPUStoreHours")]], + ["isEligibleForSuperSaverShipping", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IsEligibleForSuperSaverShipping")]] + ] + + attr_accessor :offerListingId + attr_accessor :exchangeId + attr_accessor :price + attr_accessor :salePrice + attr_accessor :availability + attr_accessor :iSPUStoreAddress + attr_accessor :iSPUStoreHours + attr_accessor :isEligibleForSuperSaverShipping + + def initialize(offerListingId = nil, exchangeId = nil, price = nil, salePrice = nil, availability = nil, iSPUStoreAddress = nil, iSPUStoreHours = nil, isEligibleForSuperSaverShipping = nil) + @offerListingId = offerListingId + @exchangeId = exchangeId + @price = price + @salePrice = salePrice + @availability = availability + @iSPUStoreAddress = iSPUStoreAddress + @iSPUStoreHours = iSPUStoreHours + @isEligibleForSuperSaverShipping = isEligibleForSuperSaverShipping + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}VariationSummary +class VariationSummary + @@schema_type = "VariationSummary" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["lowestPrice", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "LowestPrice")]], + ["highestPrice", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HighestPrice")]], + ["lowestSalePrice", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "LowestSalePrice")]], + ["highestSalePrice", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HighestSalePrice")]], + ["singleMerchantId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SingleMerchantId")]] + ] + + attr_accessor :lowestPrice + attr_accessor :highestPrice + attr_accessor :lowestSalePrice + attr_accessor :highestSalePrice + attr_accessor :singleMerchantId + + def initialize(lowestPrice = nil, highestPrice = nil, lowestSalePrice = nil, highestSalePrice = nil, singleMerchantId = nil) + @lowestPrice = lowestPrice + @highestPrice = highestPrice + @lowestSalePrice = lowestSalePrice + @highestSalePrice = highestSalePrice + @singleMerchantId = singleMerchantId + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Variations +class Variations + @@schema_type = "Variations" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["totalVariations", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalVariations")]], + ["totalVariationPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalVariationPages")]], + ["variationDimensions", ["VariationDimensions", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "VariationDimensions")]], + ["item", ["Item[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Item")]] + ] + + attr_accessor :totalVariations + attr_accessor :totalVariationPages + attr_accessor :variationDimensions + attr_accessor :item + + def initialize(totalVariations = nil, totalVariationPages = nil, variationDimensions = nil, item = []) + @totalVariations = totalVariations + @totalVariationPages = totalVariationPages + @variationDimensions = variationDimensions + @item = item + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}VariationDimensions +class VariationDimensions < ::Array + @@schema_element = [ + ["VariationDimension", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "VariationDimension")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}EditorialReviews +class EditorialReviews < ::Array + @@schema_element = [ + ["EditorialReview", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "EditorialReview")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}EditorialReview +class EditorialReview + @@schema_type = "EditorialReview" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["source", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Source")]], + ["content", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Content")]] + ] + + attr_accessor :source + attr_accessor :content + + def initialize(source = nil, content = nil) + @source = source + @content = content + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CustomerReviews +class CustomerReviews + @@schema_type = "CustomerReviews" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["averageRating", ["SOAP::SOAPDecimal", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AverageRating")]], + ["totalReviews", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalReviews")]], + ["totalReviewPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalReviewPages")]], + ["review", ["Review[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Review")]] + ] + + attr_accessor :averageRating + attr_accessor :totalReviews + attr_accessor :totalReviewPages + attr_accessor :review + + def initialize(averageRating = nil, totalReviews = nil, totalReviewPages = nil, review = []) + @averageRating = averageRating + @totalReviews = totalReviews + @totalReviewPages = totalReviewPages + @review = review + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Review +class Review + @@schema_type = "Review" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["aSIN", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ASIN")]], + ["rating", ["SOAP::SOAPDecimal", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Rating")]], + ["helpfulVotes", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HelpfulVotes")]], + ["customerId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerId")]], + ["totalVotes", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalVotes")]], + ["date", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Date")]], + ["summary", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Summary")]], + ["content", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Content")]] + ] + + attr_accessor :aSIN + attr_accessor :rating + attr_accessor :helpfulVotes + attr_accessor :customerId + attr_accessor :totalVotes + attr_accessor :date + attr_accessor :summary + attr_accessor :content + + def initialize(aSIN = nil, rating = nil, helpfulVotes = nil, customerId = nil, totalVotes = nil, date = nil, summary = nil, content = nil) + @aSIN = aSIN + @rating = rating + @helpfulVotes = helpfulVotes + @customerId = customerId + @totalVotes = totalVotes + @date = date + @summary = summary + @content = content + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Tracks +class Tracks < ::Array + @@schema_element = [ + ["Disc", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Disc")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SimilarProducts +class SimilarProducts < ::Array + @@schema_element = [ + ["SimilarProduct", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SimilarProduct")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}TopSellers +class TopSellers < ::Array + @@schema_element = [ + ["TopSeller", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TopSeller")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}NewReleases +class NewReleases < ::Array + @@schema_element = [ + ["NewRelease", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NewRelease")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SimilarViewedProducts +class SimilarViewedProducts < ::Array + @@schema_element = [ + ["SimilarViewedProduct", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SimilarViewedProduct")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}OtherCategoriesSimilarProducts +class OtherCategoriesSimilarProducts < ::Array + @@schema_element = [ + ["OtherCategoriesSimilarProduct", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OtherCategoriesSimilarProduct")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Accessories +class Accessories < ::Array + @@schema_element = [ + ["Accessory", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Accessory")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}BrowseNodes +class BrowseNodes + @@schema_type = "BrowseNodes" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["request", ["Request", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Request")]], + ["browseNode", ["BrowseNode[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BrowseNode")]] + ] + + attr_accessor :request + attr_accessor :browseNode + + def initialize(request = nil, browseNode = []) + @request = request + @browseNode = browseNode + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}BrowseNode +class BrowseNode + @@schema_type = "BrowseNode" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["browseNodeId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BrowseNodeId")]], + ["name", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Name")]], + ["children", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Children")]], + ["ancestors", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Ancestors")]], + ["topSellers", ["TopSellers", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TopSellers")]], + ["newReleases", ["NewReleases", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NewReleases")]] + ] + + attr_accessor :browseNodeId + attr_accessor :name + attr_accessor :children + attr_accessor :ancestors + attr_accessor :topSellers + attr_accessor :newReleases + + def initialize(browseNodeId = nil, name = nil, children = nil, ancestors = nil, topSellers = nil, newReleases = nil) + @browseNodeId = browseNodeId + @name = name + @children = children + @ancestors = ancestors + @topSellers = topSellers + @newReleases = newReleases + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ListmaniaLists +class ListmaniaLists < ::Array + @@schema_element = [ + ["ListmaniaList", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListmaniaList")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SearchInside +class SearchInside + @@schema_type = "SearchInside" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["totalExcerpts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalExcerpts")]], + ["excerpt", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Excerpt")]] + ] + + attr_accessor :totalExcerpts + attr_accessor :excerpt + + def initialize(totalExcerpts = nil, excerpt = nil) + @totalExcerpts = totalExcerpts + @excerpt = excerpt + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartItems +class CartItems + @@schema_type = "CartItems" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["subTotal", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubTotal")]], + ["cartItem", ["CartItem[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartItem")]] + ] + + attr_accessor :subTotal + attr_accessor :cartItem + + def initialize(subTotal = nil, cartItem = []) + @subTotal = subTotal + @cartItem = cartItem + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SavedForLaterItems +class SavedForLaterItems + @@schema_type = "SavedForLaterItems" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["subTotal", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubTotal")]], + ["savedForLaterItem", ["CartItem[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SavedForLaterItem")]] + ] + + attr_accessor :subTotal + attr_accessor :savedForLaterItem + + def initialize(subTotal = nil, savedForLaterItem = []) + @subTotal = subTotal + @savedForLaterItem = savedForLaterItem + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Transaction +class Transaction + @@schema_type = "Transaction" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["transactionId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TransactionId")]], + ["sellerId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerId")]], + ["condition", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Condition")]], + ["transactionDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TransactionDate")]], + ["transactionDateEpoch", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TransactionDateEpoch")]], + ["sellerName", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerName")]], + ["payingCustomerId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PayingCustomerId")]], + ["orderingCustomerId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OrderingCustomerId")]], + ["totals", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Totals")]], + ["transactionItems", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TransactionItems")]], + ["shipments", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Shipments")]] + ] + + attr_accessor :transactionId + attr_accessor :sellerId + attr_accessor :condition + attr_accessor :transactionDate + attr_accessor :transactionDateEpoch + attr_accessor :sellerName + attr_accessor :payingCustomerId + attr_accessor :orderingCustomerId + attr_accessor :totals + attr_accessor :transactionItems + attr_accessor :shipments + + def initialize(transactionId = nil, sellerId = nil, condition = nil, transactionDate = nil, transactionDateEpoch = nil, sellerName = nil, payingCustomerId = nil, orderingCustomerId = nil, totals = nil, transactionItems = nil, shipments = nil) + @transactionId = transactionId + @sellerId = sellerId + @condition = condition + @transactionDate = transactionDate + @transactionDateEpoch = transactionDateEpoch + @sellerName = sellerName + @payingCustomerId = payingCustomerId + @orderingCustomerId = orderingCustomerId + @totals = totals + @transactionItems = transactionItems + @shipments = shipments + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}TransactionItem +class TransactionItem + @@schema_type = "TransactionItem" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["transactionItemId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TransactionItemId")]], + ["quantity", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Quantity")]], + ["unitPrice", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "UnitPrice")]], + ["totalPrice", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalPrice")]], + ["aSIN", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ASIN")]], + ["childTransactionItems", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ChildTransactionItems")]] + ] + + attr_accessor :transactionItemId + attr_accessor :quantity + attr_accessor :unitPrice + attr_accessor :totalPrice + attr_accessor :aSIN + attr_accessor :childTransactionItems + + def initialize(transactionItemId = nil, quantity = nil, unitPrice = nil, totalPrice = nil, aSIN = nil, childTransactionItems = nil) + @transactionItemId = transactionItemId + @quantity = quantity + @unitPrice = unitPrice + @totalPrice = totalPrice + @aSIN = aSIN + @childTransactionItems = childTransactionItems + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Seller +class Seller + @@schema_type = "Seller" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["sellerId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerId")]], + ["sellerName", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerName")]], + ["sellerLegalName", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerLegalName")]], + ["nickname", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Nickname")]], + ["glancePage", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GlancePage")]], + ["about", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "About")]], + ["moreAbout", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MoreAbout")]], + ["location", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Location")]], + ["averageFeedbackRating", ["SOAP::SOAPDecimal", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AverageFeedbackRating")]], + ["totalFeedback", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalFeedback")]], + ["totalFeedbackPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalFeedbackPages")]], + ["sellerFeedbackSummary", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerFeedbackSummary")]], + ["sellerFeedback", ["SellerFeedback", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerFeedback")]] + ] + + attr_accessor :sellerId + attr_accessor :sellerName + attr_accessor :sellerLegalName + attr_accessor :nickname + attr_accessor :glancePage + attr_accessor :about + attr_accessor :moreAbout + attr_accessor :location + attr_accessor :averageFeedbackRating + attr_accessor :totalFeedback + attr_accessor :totalFeedbackPages + attr_accessor :sellerFeedbackSummary + attr_accessor :sellerFeedback + + def initialize(sellerId = nil, sellerName = nil, sellerLegalName = nil, nickname = nil, glancePage = nil, about = nil, moreAbout = nil, location = nil, averageFeedbackRating = nil, totalFeedback = nil, totalFeedbackPages = nil, sellerFeedbackSummary = nil, sellerFeedback = nil) + @sellerId = sellerId + @sellerName = sellerName + @sellerLegalName = sellerLegalName + @nickname = nickname + @glancePage = glancePage + @about = about + @moreAbout = moreAbout + @location = location + @averageFeedbackRating = averageFeedbackRating + @totalFeedback = totalFeedback + @totalFeedbackPages = totalFeedbackPages + @sellerFeedbackSummary = sellerFeedbackSummary + @sellerFeedback = sellerFeedback + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SellerFeedback +class SellerFeedback < ::Array + @@schema_element = [ + ["Feedback", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Feedback")]] + ] +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SellerListing +class SellerListing + @@schema_type = "SellerListing" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["exchangeId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ExchangeId")]], + ["listingId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListingId")]], + ["aSIN", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ASIN")]], + ["sKU", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SKU")]], + ["uPC", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "UPC")]], + ["eAN", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "EAN")]], + ["willShipExpedited", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "WillShipExpedited")]], + ["willShipInternational", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "WillShipInternational")]], + ["title", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Title")]], + ["price", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Price")]], + ["startDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "StartDate")]], + ["endDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "EndDate")]], + ["status", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Status")]], + ["quantity", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Quantity")]], + ["condition", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Condition")]], + ["subCondition", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubCondition")]], + ["seller", ["Seller", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Seller")]] + ] + + attr_accessor :exchangeId + attr_accessor :listingId + attr_accessor :aSIN + attr_accessor :sKU + attr_accessor :uPC + attr_accessor :eAN + attr_accessor :willShipExpedited + attr_accessor :willShipInternational + attr_accessor :title + attr_accessor :price + attr_accessor :startDate + attr_accessor :endDate + attr_accessor :status + attr_accessor :quantity + attr_accessor :condition + attr_accessor :subCondition + attr_accessor :seller + + def initialize(exchangeId = nil, listingId = nil, aSIN = nil, sKU = nil, uPC = nil, eAN = nil, willShipExpedited = nil, willShipInternational = nil, title = nil, price = nil, startDate = nil, endDate = nil, status = nil, quantity = nil, condition = nil, subCondition = nil, seller = nil) + @exchangeId = exchangeId + @listingId = listingId + @aSIN = aSIN + @sKU = sKU + @uPC = uPC + @eAN = eAN + @willShipExpedited = willShipExpedited + @willShipInternational = willShipInternational + @title = title + @price = price + @startDate = startDate + @endDate = endDate + @status = status + @quantity = quantity + @condition = condition + @subCondition = subCondition + @seller = seller + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ImageSet +class ImageSet + @@schema_type = "ImageSet" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_attribute = { + XSD::QName.new(nil, "Category") => "SOAP::SOAPString" + } + @@schema_element = [ + ["swatchImage", ["Image", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SwatchImage")]], + ["smallImage", ["Image", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SmallImage")]], + ["mediumImage", ["Image", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MediumImage")]], + ["largeImage", ["Image", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "LargeImage")]] + ] + + attr_accessor :swatchImage + attr_accessor :smallImage + attr_accessor :mediumImage + attr_accessor :largeImage + + def xmlattr_Category + (@__xmlattr ||= {})[XSD::QName.new(nil, "Category")] + end + + def xmlattr_Category=(value) + (@__xmlattr ||= {})[XSD::QName.new(nil, "Category")] = value + end + + def initialize(swatchImage = nil, smallImage = nil, mediumImage = nil, largeImage = nil) + @swatchImage = swatchImage + @smallImage = smallImage + @mediumImage = mediumImage + @largeImage = largeImage + @__xmlattr = {} + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ItemAttributes +class ItemAttributes + @@schema_type = "ItemAttributes" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["actor", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Actor")]], + ["address", ["Address", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Address")]], + ["amazonMaximumAge", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AmazonMaximumAge")]], + ["amazonMinimumAge", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AmazonMinimumAge")]], + ["apertureModes", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ApertureModes")]], + ["artist", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Artist")]], + ["aspectRatio", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AspectRatio")]], + ["audienceRating", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AudienceRating")]], + ["audioFormat", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AudioFormat")]], + ["author", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Author")]], + ["backFinding", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BackFinding")]], + ["bandMaterialType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BandMaterialType")]], + ["batteriesIncluded", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BatteriesIncluded")]], + ["batteries", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Batteries")]], + ["batteryDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BatteryDescription")]], + ["batteryType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BatteryType")]], + ["bezelMaterialType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BezelMaterialType")]], + ["binding", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Binding")]], + ["brand", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Brand")]], + ["calendarType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CalendarType")]], + ["cameraManualFeatures", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CameraManualFeatures")]], + ["caseDiameter", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CaseDiameter")]], + ["caseMaterialType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CaseMaterialType")]], + ["caseThickness", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CaseThickness")]], + ["caseType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CaseType")]], + ["cDRWDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CDRWDescription")]], + ["chainType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ChainType")]], + ["claspType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ClaspType")]], + ["clothingSize", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ClothingSize")]], + ["color", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Color")]], + ["compatibility", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Compatibility")]], + ["computerHardwareType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ComputerHardwareType")]], + ["computerPlatform", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ComputerPlatform")]], + ["connectivity", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Connectivity")]], + ["continuousShootingSpeed", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ContinuousShootingSpeed")]], + ["country", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Country")]], + ["cPUManufacturer", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CPUManufacturer")]], + ["cPUSpeed", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CPUSpeed")]], + ["cPUType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CPUType")]], + ["creator", ["[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Creator")]], + ["cuisine", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Cuisine")]], + ["delayBetweenShots", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DelayBetweenShots")]], + ["department", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Department")]], + ["deweyDecimalNumber", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DeweyDecimalNumber")]], + ["dialColor", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DialColor")]], + ["dialWindowMaterialType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DialWindowMaterialType")]], + ["digitalZoom", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DigitalZoom")]], + ["director", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Director")]], + ["displaySize", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DisplaySize")]], + ["drumSetPieceQuantity", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DrumSetPieceQuantity")]], + ["dVDLayers", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DVDLayers")]], + ["dVDRWDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DVDRWDescription")]], + ["dVDSides", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DVDSides")]], + ["eAN", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "EAN")]], + ["edition", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Edition")]], + ["eSRBAgeRating", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ESRBAgeRating")]], + ["externalDisplaySupportDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ExternalDisplaySupportDescription")]], + ["fabricType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "FabricType")]], + ["faxNumber", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "FaxNumber")]], + ["feature", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Feature")]], + ["firstIssueLeadTime", ["StringWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "FirstIssueLeadTime")]], + ["floppyDiskDriveDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "FloppyDiskDriveDescription")]], + ["format", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Format")]], + ["gemType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GemType")]], + ["graphicsCardInterface", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GraphicsCardInterface")]], + ["graphicsDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GraphicsDescription")]], + ["graphicsMemorySize", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GraphicsMemorySize")]], + ["guitarAttribute", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GuitarAttribute")]], + ["guitarBridgeSystem", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GuitarBridgeSystem")]], + ["guitarPickThickness", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GuitarPickThickness")]], + ["guitarPickupConfiguration", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GuitarPickupConfiguration")]], + ["hardDiskCount", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HardDiskCount")]], + ["hardDiskSize", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HardDiskSize")]], + ["hasAutoFocus", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasAutoFocus")]], + ["hasBurstMode", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasBurstMode")]], + ["hasInCameraEditing", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasInCameraEditing")]], + ["hasRedEyeReduction", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasRedEyeReduction")]], + ["hasSelfTimer", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasSelfTimer")]], + ["hasTripodMount", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasTripodMount")]], + ["hasVideoOut", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasVideoOut")]], + ["hasViewfinder", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasViewfinder")]], + ["hazardousMaterialType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HazardousMaterialType")]], + ["hoursOfOperation", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HoursOfOperation")]], + ["includedSoftware", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IncludedSoftware")]], + ["includesMp3Player", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IncludesMp3Player")]], + ["ingredients", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Ingredients")]], + ["instrumentKey", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "InstrumentKey")]], + ["isAdultProduct", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IsAdultProduct")]], + ["isAutographed", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IsAutographed")]], + ["iSBN", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ISBN")]], + ["isFragile", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IsFragile")]], + ["isLabCreated", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IsLabCreated")]], + ["isMemorabilia", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IsMemorabilia")]], + ["iSOEquivalent", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ISOEquivalent")]], + ["issuesPerYear", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IssuesPerYear")]], + ["itemDimensions", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemDimensions")]], + ["keyboardDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "KeyboardDescription")]], + ["label", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Label")]], + ["languages", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Languages")]], + ["legalDisclaimer", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "LegalDisclaimer")]], + ["lineVoltage", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "LineVoltage")]], + ["listPrice", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListPrice")]], + ["macroFocusRange", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MacroFocusRange")]], + ["magazineType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MagazineType")]], + ["malletHardness", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MalletHardness")]], + ["manufacturer", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Manufacturer")]], + ["manufacturerLaborWarrantyDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ManufacturerLaborWarrantyDescription")]], + ["manufacturerMaximumAge", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ManufacturerMaximumAge")]], + ["manufacturerMinimumAge", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ManufacturerMinimumAge")]], + ["manufacturerPartsWarrantyDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ManufacturerPartsWarrantyDescription")]], + ["materialType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaterialType")]], + ["maximumAperture", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumAperture")]], + ["maximumColorDepth", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumColorDepth")]], + ["maximumFocalLength", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumFocalLength")]], + ["maximumHighResolutionImages", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumHighResolutionImages")]], + ["maximumHorizontalResolution", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumHorizontalResolution")]], + ["maximumLowResolutionImages", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumLowResolutionImages")]], + ["maximumResolution", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumResolution")]], + ["maximumShutterSpeed", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumShutterSpeed")]], + ["maximumVerticalResolution", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumVerticalResolution")]], + ["maximumWeightRecommendation", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumWeightRecommendation")]], + ["memorySlotsAvailable", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MemorySlotsAvailable")]], + ["metalStamp", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MetalStamp")]], + ["metalType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MetalType")]], + ["miniMovieDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MiniMovieDescription")]], + ["minimumFocalLength", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MinimumFocalLength")]], + ["minimumShutterSpeed", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MinimumShutterSpeed")]], + ["model", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Model")]], + ["modelYear", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ModelYear")]], + ["modemDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ModemDescription")]], + ["monitorSize", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MonitorSize")]], + ["monitorViewableDiagonalSize", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MonitorViewableDiagonalSize")]], + ["mouseDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MouseDescription")]], + ["mPN", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MPN")]], + ["musicalStyle", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MusicalStyle")]], + ["nativeResolution", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NativeResolution")]], + ["neighborhood", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Neighborhood")]], + ["networkInterfaceDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NetworkInterfaceDescription")]], + ["notebookDisplayTechnology", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NotebookDisplayTechnology")]], + ["notebookPointingDeviceDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NotebookPointingDeviceDescription")]], + ["numberOfDiscs", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfDiscs")]], + ["numberOfIssues", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfIssues")]], + ["numberOfItems", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfItems")]], + ["numberOfKeys", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfKeys")]], + ["numberOfPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfPages")]], + ["numberOfPearls", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfPearls")]], + ["numberOfRapidFireShots", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfRapidFireShots")]], + ["numberOfStones", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfStones")]], + ["numberOfStrings", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfStrings")]], + ["numberOfTracks", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfTracks")]], + ["opticalZoom", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OpticalZoom")]], + ["outputWattage", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OutputWattage")]], + ["packageDimensions", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PackageDimensions")]], + ["pearlLustre", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlLustre")]], + ["pearlMinimumColor", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlMinimumColor")]], + ["pearlShape", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlShape")]], + ["pearlStringingMethod", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlStringingMethod")]], + ["pearlSurfaceBlemishes", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlSurfaceBlemishes")]], + ["pearlType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlType")]], + ["pearlUniformity", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlUniformity")]], + ["phoneNumber", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PhoneNumber")]], + ["photoFlashType", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PhotoFlashType")]], + ["pictureFormat", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PictureFormat")]], + ["platform", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Platform")]], + ["priceRating", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PriceRating")]], + ["processorCount", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ProcessorCount")]], + ["productGroup", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ProductGroup")]], + ["promotionalTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PromotionalTag")]], + ["publicationDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PublicationDate")]], + ["publisher", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Publisher")]], + ["readingLevel", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ReadingLevel")]], + ["recorderTrackCount", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RecorderTrackCount")]], + ["regionCode", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RegionCode")]], + ["regionOfOrigin", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RegionOfOrigin")]], + ["releaseDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ReleaseDate")]], + ["removableMemory", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RemovableMemory")]], + ["resolutionModes", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResolutionModes")]], + ["ringSize", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RingSize")]], + ["runningTime", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RunningTime")]], + ["secondaryCacheSize", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SecondaryCacheSize")]], + ["settingType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SettingType")]], + ["size", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Size")]], + ["sizePerPearl", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SizePerPearl")]], + ["skillLevel", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SkillLevel")]], + ["sKU", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SKU")]], + ["soundCardDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SoundCardDescription")]], + ["speakerCount", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SpeakerCount")]], + ["speakerDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SpeakerDescription")]], + ["specialFeatures", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SpecialFeatures")]], + ["stoneClarity", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "StoneClarity")]], + ["stoneColor", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "StoneColor")]], + ["stoneCut", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "StoneCut")]], + ["stoneShape", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "StoneShape")]], + ["stoneWeight", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "StoneWeight")]], + ["studio", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Studio")]], + ["subscriptionLength", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionLength")]], + ["supportedImageType", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SupportedImageType")]], + ["systemBusSpeed", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SystemBusSpeed")]], + ["systemMemorySizeMax", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SystemMemorySizeMax")]], + ["systemMemorySize", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SystemMemorySize")]], + ["systemMemoryType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SystemMemoryType")]], + ["theatricalReleaseDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TheatricalReleaseDate")]], + ["title", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Title")]], + ["totalDiamondWeight", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalDiamondWeight")]], + ["totalExternalBaysFree", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalExternalBaysFree")]], + ["totalFirewirePorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalFirewirePorts")]], + ["totalGemWeight", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalGemWeight")]], + ["totalInternalBaysFree", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalInternalBaysFree")]], + ["totalMetalWeight", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalMetalWeight")]], + ["totalNTSCPALPorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalNTSCPALPorts")]], + ["totalParallelPorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalParallelPorts")]], + ["totalPCCardSlots", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalPCCardSlots")]], + ["totalPCISlotsFree", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalPCISlotsFree")]], + ["totalSerialPorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalSerialPorts")]], + ["totalSVideoOutPorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalSVideoOutPorts")]], + ["totalUSB2Ports", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalUSB2Ports")]], + ["totalUSBPorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalUSBPorts")]], + ["totalVGAOutPorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalVGAOutPorts")]], + ["uPC", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "UPC")]], + ["variationDenomination", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "VariationDenomination")]], + ["variationDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "VariationDescription")]], + ["warranty", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Warranty")]], + ["watchMovementType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "WatchMovementType")]], + ["waterResistanceDepth", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "WaterResistanceDepth")]], + ["wirelessMicrophoneFrequency", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "WirelessMicrophoneFrequency")]] + ] + + attr_accessor :actor + attr_accessor :address + attr_accessor :amazonMaximumAge + attr_accessor :amazonMinimumAge + attr_accessor :apertureModes + attr_accessor :artist + attr_accessor :aspectRatio + attr_accessor :audienceRating + attr_accessor :audioFormat + attr_accessor :author + attr_accessor :backFinding + attr_accessor :bandMaterialType + attr_accessor :batteriesIncluded + attr_accessor :batteries + attr_accessor :batteryDescription + attr_accessor :batteryType + attr_accessor :bezelMaterialType + attr_accessor :binding + attr_accessor :brand + attr_accessor :calendarType + attr_accessor :cameraManualFeatures + attr_accessor :caseDiameter + attr_accessor :caseMaterialType + attr_accessor :caseThickness + attr_accessor :caseType + attr_accessor :cDRWDescription + attr_accessor :chainType + attr_accessor :claspType + attr_accessor :clothingSize + attr_accessor :color + attr_accessor :compatibility + attr_accessor :computerHardwareType + attr_accessor :computerPlatform + attr_accessor :connectivity + attr_accessor :continuousShootingSpeed + attr_accessor :country + attr_accessor :cPUManufacturer + attr_accessor :cPUSpeed + attr_accessor :cPUType + attr_accessor :creator + attr_accessor :cuisine + attr_accessor :delayBetweenShots + attr_accessor :department + attr_accessor :deweyDecimalNumber + attr_accessor :dialColor + attr_accessor :dialWindowMaterialType + attr_accessor :digitalZoom + attr_accessor :director + attr_accessor :displaySize + attr_accessor :drumSetPieceQuantity + attr_accessor :dVDLayers + attr_accessor :dVDRWDescription + attr_accessor :dVDSides + attr_accessor :eAN + attr_accessor :edition + attr_accessor :eSRBAgeRating + attr_accessor :externalDisplaySupportDescription + attr_accessor :fabricType + attr_accessor :faxNumber + attr_accessor :feature + attr_accessor :firstIssueLeadTime + attr_accessor :floppyDiskDriveDescription + attr_accessor :format + attr_accessor :gemType + attr_accessor :graphicsCardInterface + attr_accessor :graphicsDescription + attr_accessor :graphicsMemorySize + attr_accessor :guitarAttribute + attr_accessor :guitarBridgeSystem + attr_accessor :guitarPickThickness + attr_accessor :guitarPickupConfiguration + attr_accessor :hardDiskCount + attr_accessor :hardDiskSize + attr_accessor :hasAutoFocus + attr_accessor :hasBurstMode + attr_accessor :hasInCameraEditing + attr_accessor :hasRedEyeReduction + attr_accessor :hasSelfTimer + attr_accessor :hasTripodMount + attr_accessor :hasVideoOut + attr_accessor :hasViewfinder + attr_accessor :hazardousMaterialType + attr_accessor :hoursOfOperation + attr_accessor :includedSoftware + attr_accessor :includesMp3Player + attr_accessor :ingredients + attr_accessor :instrumentKey + attr_accessor :isAdultProduct + attr_accessor :isAutographed + attr_accessor :iSBN + attr_accessor :isFragile + attr_accessor :isLabCreated + attr_accessor :isMemorabilia + attr_accessor :iSOEquivalent + attr_accessor :issuesPerYear + attr_accessor :itemDimensions + attr_accessor :keyboardDescription + attr_accessor :label + attr_accessor :languages + attr_accessor :legalDisclaimer + attr_accessor :lineVoltage + attr_accessor :listPrice + attr_accessor :macroFocusRange + attr_accessor :magazineType + attr_accessor :malletHardness + attr_accessor :manufacturer + attr_accessor :manufacturerLaborWarrantyDescription + attr_accessor :manufacturerMaximumAge + attr_accessor :manufacturerMinimumAge + attr_accessor :manufacturerPartsWarrantyDescription + attr_accessor :materialType + attr_accessor :maximumAperture + attr_accessor :maximumColorDepth + attr_accessor :maximumFocalLength + attr_accessor :maximumHighResolutionImages + attr_accessor :maximumHorizontalResolution + attr_accessor :maximumLowResolutionImages + attr_accessor :maximumResolution + attr_accessor :maximumShutterSpeed + attr_accessor :maximumVerticalResolution + attr_accessor :maximumWeightRecommendation + attr_accessor :memorySlotsAvailable + attr_accessor :metalStamp + attr_accessor :metalType + attr_accessor :miniMovieDescription + attr_accessor :minimumFocalLength + attr_accessor :minimumShutterSpeed + attr_accessor :model + attr_accessor :modelYear + attr_accessor :modemDescription + attr_accessor :monitorSize + attr_accessor :monitorViewableDiagonalSize + attr_accessor :mouseDescription + attr_accessor :mPN + attr_accessor :musicalStyle + attr_accessor :nativeResolution + attr_accessor :neighborhood + attr_accessor :networkInterfaceDescription + attr_accessor :notebookDisplayTechnology + attr_accessor :notebookPointingDeviceDescription + attr_accessor :numberOfDiscs + attr_accessor :numberOfIssues + attr_accessor :numberOfItems + attr_accessor :numberOfKeys + attr_accessor :numberOfPages + attr_accessor :numberOfPearls + attr_accessor :numberOfRapidFireShots + attr_accessor :numberOfStones + attr_accessor :numberOfStrings + attr_accessor :numberOfTracks + attr_accessor :opticalZoom + attr_accessor :outputWattage + attr_accessor :packageDimensions + attr_accessor :pearlLustre + attr_accessor :pearlMinimumColor + attr_accessor :pearlShape + attr_accessor :pearlStringingMethod + attr_accessor :pearlSurfaceBlemishes + attr_accessor :pearlType + attr_accessor :pearlUniformity + attr_accessor :phoneNumber + attr_accessor :photoFlashType + attr_accessor :pictureFormat + attr_accessor :platform + attr_accessor :priceRating + attr_accessor :processorCount + attr_accessor :productGroup + attr_accessor :promotionalTag + attr_accessor :publicationDate + attr_accessor :publisher + attr_accessor :readingLevel + attr_accessor :recorderTrackCount + attr_accessor :regionCode + attr_accessor :regionOfOrigin + attr_accessor :releaseDate + attr_accessor :removableMemory + attr_accessor :resolutionModes + attr_accessor :ringSize + attr_accessor :runningTime + attr_accessor :secondaryCacheSize + attr_accessor :settingType + attr_accessor :size + attr_accessor :sizePerPearl + attr_accessor :skillLevel + attr_accessor :sKU + attr_accessor :soundCardDescription + attr_accessor :speakerCount + attr_accessor :speakerDescription + attr_accessor :specialFeatures + attr_accessor :stoneClarity + attr_accessor :stoneColor + attr_accessor :stoneCut + attr_accessor :stoneShape + attr_accessor :stoneWeight + attr_accessor :studio + attr_accessor :subscriptionLength + attr_accessor :supportedImageType + attr_accessor :systemBusSpeed + attr_accessor :systemMemorySizeMax + attr_accessor :systemMemorySize + attr_accessor :systemMemoryType + attr_accessor :theatricalReleaseDate + attr_accessor :title + attr_accessor :totalDiamondWeight + attr_accessor :totalExternalBaysFree + attr_accessor :totalFirewirePorts + attr_accessor :totalGemWeight + attr_accessor :totalInternalBaysFree + attr_accessor :totalMetalWeight + attr_accessor :totalNTSCPALPorts + attr_accessor :totalParallelPorts + attr_accessor :totalPCCardSlots + attr_accessor :totalPCISlotsFree + attr_accessor :totalSerialPorts + attr_accessor :totalSVideoOutPorts + attr_accessor :totalUSB2Ports + attr_accessor :totalUSBPorts + attr_accessor :totalVGAOutPorts + attr_accessor :uPC + attr_accessor :variationDenomination + attr_accessor :variationDescription + attr_accessor :warranty + attr_accessor :watchMovementType + attr_accessor :waterResistanceDepth + attr_accessor :wirelessMicrophoneFrequency + + def initialize(actor = [], address = nil, amazonMaximumAge = nil, amazonMinimumAge = nil, apertureModes = nil, artist = [], aspectRatio = nil, audienceRating = nil, audioFormat = [], author = [], backFinding = nil, bandMaterialType = nil, batteriesIncluded = nil, batteries = nil, batteryDescription = nil, batteryType = nil, bezelMaterialType = nil, binding = nil, brand = nil, calendarType = nil, cameraManualFeatures = [], caseDiameter = nil, caseMaterialType = nil, caseThickness = nil, caseType = nil, cDRWDescription = nil, chainType = nil, claspType = nil, clothingSize = nil, color = nil, compatibility = nil, computerHardwareType = nil, computerPlatform = nil, connectivity = nil, continuousShootingSpeed = nil, country = nil, cPUManufacturer = nil, cPUSpeed = nil, cPUType = nil, creator = [], cuisine = nil, delayBetweenShots = nil, department = nil, deweyDecimalNumber = nil, dialColor = nil, dialWindowMaterialType = nil, digitalZoom = nil, director = [], displaySize = nil, drumSetPieceQuantity = nil, dVDLayers = nil, dVDRWDescription = nil, dVDSides = nil, eAN = nil, edition = nil, eSRBAgeRating = nil, externalDisplaySupportDescription = nil, fabricType = nil, faxNumber = nil, feature = [], firstIssueLeadTime = nil, floppyDiskDriveDescription = nil, format = [], gemType = nil, graphicsCardInterface = nil, graphicsDescription = nil, graphicsMemorySize = nil, guitarAttribute = nil, guitarBridgeSystem = nil, guitarPickThickness = nil, guitarPickupConfiguration = nil, hardDiskCount = nil, hardDiskSize = nil, hasAutoFocus = nil, hasBurstMode = nil, hasInCameraEditing = nil, hasRedEyeReduction = nil, hasSelfTimer = nil, hasTripodMount = nil, hasVideoOut = nil, hasViewfinder = nil, hazardousMaterialType = nil, hoursOfOperation = nil, includedSoftware = nil, includesMp3Player = nil, ingredients = nil, instrumentKey = nil, isAdultProduct = nil, isAutographed = nil, iSBN = nil, isFragile = nil, isLabCreated = nil, isMemorabilia = nil, iSOEquivalent = nil, issuesPerYear = nil, itemDimensions = nil, keyboardDescription = nil, label = nil, languages = nil, legalDisclaimer = nil, lineVoltage = nil, listPrice = nil, macroFocusRange = nil, magazineType = nil, malletHardness = nil, manufacturer = nil, manufacturerLaborWarrantyDescription = nil, manufacturerMaximumAge = nil, manufacturerMinimumAge = nil, manufacturerPartsWarrantyDescription = nil, materialType = nil, maximumAperture = nil, maximumColorDepth = nil, maximumFocalLength = nil, maximumHighResolutionImages = nil, maximumHorizontalResolution = nil, maximumLowResolutionImages = nil, maximumResolution = nil, maximumShutterSpeed = nil, maximumVerticalResolution = nil, maximumWeightRecommendation = nil, memorySlotsAvailable = nil, metalStamp = nil, metalType = nil, miniMovieDescription = nil, minimumFocalLength = nil, minimumShutterSpeed = nil, model = nil, modelYear = nil, modemDescription = nil, monitorSize = nil, monitorViewableDiagonalSize = nil, mouseDescription = nil, mPN = nil, musicalStyle = nil, nativeResolution = nil, neighborhood = nil, networkInterfaceDescription = nil, notebookDisplayTechnology = nil, notebookPointingDeviceDescription = nil, numberOfDiscs = nil, numberOfIssues = nil, numberOfItems = nil, numberOfKeys = nil, numberOfPages = nil, numberOfPearls = nil, numberOfRapidFireShots = nil, numberOfStones = nil, numberOfStrings = nil, numberOfTracks = nil, opticalZoom = nil, outputWattage = nil, packageDimensions = nil, pearlLustre = nil, pearlMinimumColor = nil, pearlShape = nil, pearlStringingMethod = nil, pearlSurfaceBlemishes = nil, pearlType = nil, pearlUniformity = nil, phoneNumber = nil, photoFlashType = [], pictureFormat = [], platform = [], priceRating = nil, processorCount = nil, productGroup = nil, promotionalTag = nil, publicationDate = nil, publisher = nil, readingLevel = nil, recorderTrackCount = nil, regionCode = nil, regionOfOrigin = nil, releaseDate = nil, removableMemory = nil, resolutionModes = nil, ringSize = nil, runningTime = nil, secondaryCacheSize = nil, settingType = nil, size = nil, sizePerPearl = nil, skillLevel = nil, sKU = nil, soundCardDescription = nil, speakerCount = nil, speakerDescription = nil, specialFeatures = [], stoneClarity = nil, stoneColor = nil, stoneCut = nil, stoneShape = nil, stoneWeight = nil, studio = nil, subscriptionLength = nil, supportedImageType = [], systemBusSpeed = nil, systemMemorySizeMax = nil, systemMemorySize = nil, systemMemoryType = nil, theatricalReleaseDate = nil, title = nil, totalDiamondWeight = nil, totalExternalBaysFree = nil, totalFirewirePorts = nil, totalGemWeight = nil, totalInternalBaysFree = nil, totalMetalWeight = nil, totalNTSCPALPorts = nil, totalParallelPorts = nil, totalPCCardSlots = nil, totalPCISlotsFree = nil, totalSerialPorts = nil, totalSVideoOutPorts = nil, totalUSB2Ports = nil, totalUSBPorts = nil, totalVGAOutPorts = nil, uPC = nil, variationDenomination = nil, variationDescription = nil, warranty = nil, watchMovementType = nil, waterResistanceDepth = nil, wirelessMicrophoneFrequency = nil) + @actor = actor + @address = address + @amazonMaximumAge = amazonMaximumAge + @amazonMinimumAge = amazonMinimumAge + @apertureModes = apertureModes + @artist = artist + @aspectRatio = aspectRatio + @audienceRating = audienceRating + @audioFormat = audioFormat + @author = author + @backFinding = backFinding + @bandMaterialType = bandMaterialType + @batteriesIncluded = batteriesIncluded + @batteries = batteries + @batteryDescription = batteryDescription + @batteryType = batteryType + @bezelMaterialType = bezelMaterialType + @binding = binding + @brand = brand + @calendarType = calendarType + @cameraManualFeatures = cameraManualFeatures + @caseDiameter = caseDiameter + @caseMaterialType = caseMaterialType + @caseThickness = caseThickness + @caseType = caseType + @cDRWDescription = cDRWDescription + @chainType = chainType + @claspType = claspType + @clothingSize = clothingSize + @color = color + @compatibility = compatibility + @computerHardwareType = computerHardwareType + @computerPlatform = computerPlatform + @connectivity = connectivity + @continuousShootingSpeed = continuousShootingSpeed + @country = country + @cPUManufacturer = cPUManufacturer + @cPUSpeed = cPUSpeed + @cPUType = cPUType + @creator = creator + @cuisine = cuisine + @delayBetweenShots = delayBetweenShots + @department = department + @deweyDecimalNumber = deweyDecimalNumber + @dialColor = dialColor + @dialWindowMaterialType = dialWindowMaterialType + @digitalZoom = digitalZoom + @director = director + @displaySize = displaySize + @drumSetPieceQuantity = drumSetPieceQuantity + @dVDLayers = dVDLayers + @dVDRWDescription = dVDRWDescription + @dVDSides = dVDSides + @eAN = eAN + @edition = edition + @eSRBAgeRating = eSRBAgeRating + @externalDisplaySupportDescription = externalDisplaySupportDescription + @fabricType = fabricType + @faxNumber = faxNumber + @feature = feature + @firstIssueLeadTime = firstIssueLeadTime + @floppyDiskDriveDescription = floppyDiskDriveDescription + @format = format + @gemType = gemType + @graphicsCardInterface = graphicsCardInterface + @graphicsDescription = graphicsDescription + @graphicsMemorySize = graphicsMemorySize + @guitarAttribute = guitarAttribute + @guitarBridgeSystem = guitarBridgeSystem + @guitarPickThickness = guitarPickThickness + @guitarPickupConfiguration = guitarPickupConfiguration + @hardDiskCount = hardDiskCount + @hardDiskSize = hardDiskSize + @hasAutoFocus = hasAutoFocus + @hasBurstMode = hasBurstMode + @hasInCameraEditing = hasInCameraEditing + @hasRedEyeReduction = hasRedEyeReduction + @hasSelfTimer = hasSelfTimer + @hasTripodMount = hasTripodMount + @hasVideoOut = hasVideoOut + @hasViewfinder = hasViewfinder + @hazardousMaterialType = hazardousMaterialType + @hoursOfOperation = hoursOfOperation + @includedSoftware = includedSoftware + @includesMp3Player = includesMp3Player + @ingredients = ingredients + @instrumentKey = instrumentKey + @isAdultProduct = isAdultProduct + @isAutographed = isAutographed + @iSBN = iSBN + @isFragile = isFragile + @isLabCreated = isLabCreated + @isMemorabilia = isMemorabilia + @iSOEquivalent = iSOEquivalent + @issuesPerYear = issuesPerYear + @itemDimensions = itemDimensions + @keyboardDescription = keyboardDescription + @label = label + @languages = languages + @legalDisclaimer = legalDisclaimer + @lineVoltage = lineVoltage + @listPrice = listPrice + @macroFocusRange = macroFocusRange + @magazineType = magazineType + @malletHardness = malletHardness + @manufacturer = manufacturer + @manufacturerLaborWarrantyDescription = manufacturerLaborWarrantyDescription + @manufacturerMaximumAge = manufacturerMaximumAge + @manufacturerMinimumAge = manufacturerMinimumAge + @manufacturerPartsWarrantyDescription = manufacturerPartsWarrantyDescription + @materialType = materialType + @maximumAperture = maximumAperture + @maximumColorDepth = maximumColorDepth + @maximumFocalLength = maximumFocalLength + @maximumHighResolutionImages = maximumHighResolutionImages + @maximumHorizontalResolution = maximumHorizontalResolution + @maximumLowResolutionImages = maximumLowResolutionImages + @maximumResolution = maximumResolution + @maximumShutterSpeed = maximumShutterSpeed + @maximumVerticalResolution = maximumVerticalResolution + @maximumWeightRecommendation = maximumWeightRecommendation + @memorySlotsAvailable = memorySlotsAvailable + @metalStamp = metalStamp + @metalType = metalType + @miniMovieDescription = miniMovieDescription + @minimumFocalLength = minimumFocalLength + @minimumShutterSpeed = minimumShutterSpeed + @model = model + @modelYear = modelYear + @modemDescription = modemDescription + @monitorSize = monitorSize + @monitorViewableDiagonalSize = monitorViewableDiagonalSize + @mouseDescription = mouseDescription + @mPN = mPN + @musicalStyle = musicalStyle + @nativeResolution = nativeResolution + @neighborhood = neighborhood + @networkInterfaceDescription = networkInterfaceDescription + @notebookDisplayTechnology = notebookDisplayTechnology + @notebookPointingDeviceDescription = notebookPointingDeviceDescription + @numberOfDiscs = numberOfDiscs + @numberOfIssues = numberOfIssues + @numberOfItems = numberOfItems + @numberOfKeys = numberOfKeys + @numberOfPages = numberOfPages + @numberOfPearls = numberOfPearls + @numberOfRapidFireShots = numberOfRapidFireShots + @numberOfStones = numberOfStones + @numberOfStrings = numberOfStrings + @numberOfTracks = numberOfTracks + @opticalZoom = opticalZoom + @outputWattage = outputWattage + @packageDimensions = packageDimensions + @pearlLustre = pearlLustre + @pearlMinimumColor = pearlMinimumColor + @pearlShape = pearlShape + @pearlStringingMethod = pearlStringingMethod + @pearlSurfaceBlemishes = pearlSurfaceBlemishes + @pearlType = pearlType + @pearlUniformity = pearlUniformity + @phoneNumber = phoneNumber + @photoFlashType = photoFlashType + @pictureFormat = pictureFormat + @platform = platform + @priceRating = priceRating + @processorCount = processorCount + @productGroup = productGroup + @promotionalTag = promotionalTag + @publicationDate = publicationDate + @publisher = publisher + @readingLevel = readingLevel + @recorderTrackCount = recorderTrackCount + @regionCode = regionCode + @regionOfOrigin = regionOfOrigin + @releaseDate = releaseDate + @removableMemory = removableMemory + @resolutionModes = resolutionModes + @ringSize = ringSize + @runningTime = runningTime + @secondaryCacheSize = secondaryCacheSize + @settingType = settingType + @size = size + @sizePerPearl = sizePerPearl + @skillLevel = skillLevel + @sKU = sKU + @soundCardDescription = soundCardDescription + @speakerCount = speakerCount + @speakerDescription = speakerDescription + @specialFeatures = specialFeatures + @stoneClarity = stoneClarity + @stoneColor = stoneColor + @stoneCut = stoneCut + @stoneShape = stoneShape + @stoneWeight = stoneWeight + @studio = studio + @subscriptionLength = subscriptionLength + @supportedImageType = supportedImageType + @systemBusSpeed = systemBusSpeed + @systemMemorySizeMax = systemMemorySizeMax + @systemMemorySize = systemMemorySize + @systemMemoryType = systemMemoryType + @theatricalReleaseDate = theatricalReleaseDate + @title = title + @totalDiamondWeight = totalDiamondWeight + @totalExternalBaysFree = totalExternalBaysFree + @totalFirewirePorts = totalFirewirePorts + @totalGemWeight = totalGemWeight + @totalInternalBaysFree = totalInternalBaysFree + @totalMetalWeight = totalMetalWeight + @totalNTSCPALPorts = totalNTSCPALPorts + @totalParallelPorts = totalParallelPorts + @totalPCCardSlots = totalPCCardSlots + @totalPCISlotsFree = totalPCISlotsFree + @totalSerialPorts = totalSerialPorts + @totalSVideoOutPorts = totalSVideoOutPorts + @totalUSB2Ports = totalUSB2Ports + @totalUSBPorts = totalUSBPorts + @totalVGAOutPorts = totalVGAOutPorts + @uPC = uPC + @variationDenomination = variationDenomination + @variationDescription = variationDescription + @warranty = warranty + @watchMovementType = watchMovementType + @waterResistanceDepth = waterResistanceDepth + @wirelessMicrophoneFrequency = wirelessMicrophoneFrequency + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}MerchantItemAttributes +class MerchantItemAttributes + @@schema_type = "MerchantItemAttributes" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_qualified = "true" + @@schema_element = [ + ["actor", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Actor")]], + ["address", ["Address", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Address")]], + ["amazonMaximumAge", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AmazonMaximumAge")]], + ["amazonMinimumAge", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AmazonMinimumAge")]], + ["apertureModes", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ApertureModes")]], + ["artist", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Artist")]], + ["aspectRatio", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AspectRatio")]], + ["audienceRating", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AudienceRating")]], + ["audioFormat", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AudioFormat")]], + ["author", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Author")]], + ["backFinding", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BackFinding")]], + ["bandMaterialType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BandMaterialType")]], + ["batteriesIncluded", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BatteriesIncluded")]], + ["batteries", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Batteries")]], + ["batteryDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BatteryDescription")]], + ["batteryType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BatteryType")]], + ["bezelMaterialType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BezelMaterialType")]], + ["binding", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Binding")]], + ["brand", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Brand")]], + ["calendarType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CalendarType")]], + ["cameraManualFeatures", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CameraManualFeatures")]], + ["caseDiameter", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CaseDiameter")]], + ["caseMaterialType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CaseMaterialType")]], + ["caseThickness", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CaseThickness")]], + ["caseType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CaseType")]], + ["cDRWDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CDRWDescription")]], + ["chainType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ChainType")]], + ["claspType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ClaspType")]], + ["clothingSize", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ClothingSize")]], + ["color", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Color")]], + ["compatibility", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Compatibility")]], + ["computerHardwareType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ComputerHardwareType")]], + ["computerPlatform", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ComputerPlatform")]], + ["connectivity", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Connectivity")]], + ["continuousShootingSpeed", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ContinuousShootingSpeed")]], + ["country", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Country")]], + ["cPUManufacturer", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CPUManufacturer")]], + ["cPUSpeed", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CPUSpeed")]], + ["cPUType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CPUType")]], + ["creator", ["[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Creator")]], + ["cuisine", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Cuisine")]], + ["delayBetweenShots", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DelayBetweenShots")]], + ["department", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Department")]], + ["description", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Description")]], + ["deweyDecimalNumber", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DeweyDecimalNumber")]], + ["dialColor", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DialColor")]], + ["dialWindowMaterialType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DialWindowMaterialType")]], + ["digitalZoom", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DigitalZoom")]], + ["director", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Director")]], + ["displaySize", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DisplaySize")]], + ["drumSetPieceQuantity", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DrumSetPieceQuantity")]], + ["dVDLayers", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DVDLayers")]], + ["dVDRWDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DVDRWDescription")]], + ["dVDSides", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DVDSides")]], + ["eAN", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "EAN")]], + ["edition", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Edition")]], + ["eSRBAgeRating", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ESRBAgeRating")]], + ["externalDisplaySupportDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ExternalDisplaySupportDescription")]], + ["fabricType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "FabricType")]], + ["faxNumber", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "FaxNumber")]], + ["feature", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Feature")]], + ["firstIssueLeadTime", ["StringWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "FirstIssueLeadTime")]], + ["floppyDiskDriveDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "FloppyDiskDriveDescription")]], + ["format", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Format")]], + ["gemType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GemType")]], + ["graphicsCardInterface", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GraphicsCardInterface")]], + ["graphicsDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GraphicsDescription")]], + ["graphicsMemorySize", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GraphicsMemorySize")]], + ["guitarAttribute", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GuitarAttribute")]], + ["guitarBridgeSystem", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GuitarBridgeSystem")]], + ["guitarPickThickness", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GuitarPickThickness")]], + ["guitarPickupConfiguration", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "GuitarPickupConfiguration")]], + ["hardDiskCount", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HardDiskCount")]], + ["hardDiskSize", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HardDiskSize")]], + ["hasAutoFocus", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasAutoFocus")]], + ["hasBurstMode", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasBurstMode")]], + ["hasInCameraEditing", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasInCameraEditing")]], + ["hasRedEyeReduction", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasRedEyeReduction")]], + ["hasSelfTimer", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasSelfTimer")]], + ["hasTripodMount", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasTripodMount")]], + ["hasVideoOut", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasVideoOut")]], + ["hasViewfinder", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HasViewfinder")]], + ["hazardousMaterialType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HazardousMaterialType")]], + ["hoursOfOperation", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HoursOfOperation")]], + ["includedSoftware", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IncludedSoftware")]], + ["includesMp3Player", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IncludesMp3Player")]], + ["indications", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Indications")]], + ["ingredients", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Ingredients")]], + ["instrumentKey", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "InstrumentKey")]], + ["isAutographed", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IsAutographed")]], + ["iSBN", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ISBN")]], + ["isFragile", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IsFragile")]], + ["isLabCreated", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IsLabCreated")]], + ["isMemorabilia", ["SOAP::SOAPBoolean", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IsMemorabilia")]], + ["iSOEquivalent", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ISOEquivalent")]], + ["issuesPerYear", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IssuesPerYear")]], + ["itemDimensions", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemDimensions")]], + ["keyboardDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "KeyboardDescription")]], + ["label", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Label")]], + ["languages", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Languages")]], + ["legalDisclaimer", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "LegalDisclaimer")]], + ["lineVoltage", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "LineVoltage")]], + ["listPrice", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListPrice")]], + ["macroFocusRange", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MacroFocusRange")]], + ["magazineType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MagazineType")]], + ["malletHardness", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MalletHardness")]], + ["manufacturer", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Manufacturer")]], + ["manufacturerLaborWarrantyDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ManufacturerLaborWarrantyDescription")]], + ["manufacturerMaximumAge", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ManufacturerMaximumAge")]], + ["manufacturerMinimumAge", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ManufacturerMinimumAge")]], + ["manufacturerPartsWarrantyDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ManufacturerPartsWarrantyDescription")]], + ["materialType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaterialType")]], + ["maximumAperture", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumAperture")]], + ["maximumColorDepth", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumColorDepth")]], + ["maximumFocalLength", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumFocalLength")]], + ["maximumHighResolutionImages", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumHighResolutionImages")]], + ["maximumHorizontalResolution", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumHorizontalResolution")]], + ["maximumLowResolutionImages", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumLowResolutionImages")]], + ["maximumResolution", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumResolution")]], + ["maximumShutterSpeed", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumShutterSpeed")]], + ["maximumVerticalResolution", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumVerticalResolution")]], + ["maximumWeightRecommendation", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumWeightRecommendation")]], + ["memorySlotsAvailable", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MemorySlotsAvailable")]], + ["metalStamp", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MetalStamp")]], + ["metalType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MetalType")]], + ["miniMovieDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MiniMovieDescription")]], + ["minimumFocalLength", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MinimumFocalLength")]], + ["minimumShutterSpeed", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MinimumShutterSpeed")]], + ["model", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Model")]], + ["modelYear", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ModelYear")]], + ["modemDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ModemDescription")]], + ["monitorSize", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MonitorSize")]], + ["monitorViewableDiagonalSize", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MonitorViewableDiagonalSize")]], + ["mouseDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MouseDescription")]], + ["mPN", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MPN")]], + ["musicalStyle", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MusicalStyle")]], + ["nativeResolution", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NativeResolution")]], + ["neighborhood", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Neighborhood")]], + ["networkInterfaceDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NetworkInterfaceDescription")]], + ["notebookDisplayTechnology", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NotebookDisplayTechnology")]], + ["notebookPointingDeviceDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NotebookPointingDeviceDescription")]], + ["numberOfDiscs", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfDiscs")]], + ["numberOfIssues", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfIssues")]], + ["numberOfItems", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfItems")]], + ["numberOfKeys", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfKeys")]], + ["numberOfPages", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfPages")]], + ["numberOfPearls", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfPearls")]], + ["numberOfRapidFireShots", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfRapidFireShots")]], + ["numberOfStones", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfStones")]], + ["numberOfStrings", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfStrings")]], + ["numberOfTracks", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "NumberOfTracks")]], + ["opticalZoom", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OpticalZoom")]], + ["outputWattage", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OutputWattage")]], + ["packageDimensions", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PackageDimensions")]], + ["pearlLustre", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlLustre")]], + ["pearlMinimumColor", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlMinimumColor")]], + ["pearlShape", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlShape")]], + ["pearlStringingMethod", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlStringingMethod")]], + ["pearlSurfaceBlemishes", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlSurfaceBlemishes")]], + ["pearlType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlType")]], + ["pearlUniformity", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PearlUniformity")]], + ["phoneNumber", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PhoneNumber")]], + ["photoFlashType", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PhotoFlashType")]], + ["pictureFormat", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PictureFormat")]], + ["platform", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Platform")]], + ["priceRating", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PriceRating")]], + ["processorCount", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ProcessorCount")]], + ["productGroup", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ProductGroup")]], + ["promotionalTag", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PromotionalTag")]], + ["publicationDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PublicationDate")]], + ["publisher", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Publisher")]], + ["readingLevel", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ReadingLevel")]], + ["recorderTrackCount", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RecorderTrackCount")]], + ["regionCode", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RegionCode")]], + ["regionOfOrigin", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RegionOfOrigin")]], + ["releaseDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ReleaseDate")]], + ["removableMemory", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RemovableMemory")]], + ["resolutionModes", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResolutionModes")]], + ["ringSize", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "RingSize")]], + ["safetyWarning", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SafetyWarning")]], + ["secondaryCacheSize", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SecondaryCacheSize")]], + ["settingType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SettingType")]], + ["size", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Size")]], + ["sKU", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SKU")]], + ["sizePerPearl", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SizePerPearl")]], + ["skillLevel", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SkillLevel")]], + ["soundCardDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SoundCardDescription")]], + ["speakerCount", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SpeakerCount")]], + ["speakerDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SpeakerDescription")]], + ["specialFeatures", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SpecialFeatures")]], + ["stoneClarity", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "StoneClarity")]], + ["stoneColor", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "StoneColor")]], + ["stoneCut", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "StoneCut")]], + ["stoneShape", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "StoneShape")]], + ["stoneWeight", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "StoneWeight")]], + ["studio", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Studio")]], + ["subscriptionLength", ["NonNegativeIntegerWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SubscriptionLength")]], + ["supportedImageType", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SupportedImageType")]], + ["systemBusSpeed", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SystemBusSpeed")]], + ["systemMemorySizeMax", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SystemMemorySizeMax")]], + ["systemMemorySize", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SystemMemorySize")]], + ["systemMemoryType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SystemMemoryType")]], + ["theatricalReleaseDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TheatricalReleaseDate")]], + ["title", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Title")]], + ["totalDiamondWeight", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalDiamondWeight")]], + ["totalExternalBaysFree", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalExternalBaysFree")]], + ["totalFirewirePorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalFirewirePorts")]], + ["totalGemWeight", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalGemWeight")]], + ["totalInternalBaysFree", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalInternalBaysFree")]], + ["totalMetalWeight", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalMetalWeight")]], + ["totalNTSCPALPorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalNTSCPALPorts")]], + ["totalParallelPorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalParallelPorts")]], + ["totalPCCardSlots", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalPCCardSlots")]], + ["totalPCISlotsFree", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalPCISlotsFree")]], + ["totalSerialPorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalSerialPorts")]], + ["totalSVideoOutPorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalSVideoOutPorts")]], + ["totalUSB2Ports", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalUSB2Ports")]], + ["totalUSBPorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalUSBPorts")]], + ["totalVGAOutPorts", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TotalVGAOutPorts")]], + ["uPC", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "UPC")]], + ["variationDenomination", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "VariationDenomination")]], + ["variationDescription", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "VariationDescription")]], + ["warranty", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Warranty")]], + ["watchMovementType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "WatchMovementType")]], + ["waterResistanceDepth", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "WaterResistanceDepth")]], + ["wirelessMicrophoneFrequency", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "WirelessMicrophoneFrequency")]] + ] + + attr_accessor :actor + attr_accessor :address + attr_accessor :amazonMaximumAge + attr_accessor :amazonMinimumAge + attr_accessor :apertureModes + attr_accessor :artist + attr_accessor :aspectRatio + attr_accessor :audienceRating + attr_accessor :audioFormat + attr_accessor :author + attr_accessor :backFinding + attr_accessor :bandMaterialType + attr_accessor :batteriesIncluded + attr_accessor :batteries + attr_accessor :batteryDescription + attr_accessor :batteryType + attr_accessor :bezelMaterialType + attr_accessor :binding + attr_accessor :brand + attr_accessor :calendarType + attr_accessor :cameraManualFeatures + attr_accessor :caseDiameter + attr_accessor :caseMaterialType + attr_accessor :caseThickness + attr_accessor :caseType + attr_accessor :cDRWDescription + attr_accessor :chainType + attr_accessor :claspType + attr_accessor :clothingSize + attr_accessor :color + attr_accessor :compatibility + attr_accessor :computerHardwareType + attr_accessor :computerPlatform + attr_accessor :connectivity + attr_accessor :continuousShootingSpeed + attr_accessor :country + attr_accessor :cPUManufacturer + attr_accessor :cPUSpeed + attr_accessor :cPUType + attr_accessor :creator + attr_accessor :cuisine + attr_accessor :delayBetweenShots + attr_accessor :department + attr_accessor :description + attr_accessor :deweyDecimalNumber + attr_accessor :dialColor + attr_accessor :dialWindowMaterialType + attr_accessor :digitalZoom + attr_accessor :director + attr_accessor :displaySize + attr_accessor :drumSetPieceQuantity + attr_accessor :dVDLayers + attr_accessor :dVDRWDescription + attr_accessor :dVDSides + attr_accessor :eAN + attr_accessor :edition + attr_accessor :eSRBAgeRating + attr_accessor :externalDisplaySupportDescription + attr_accessor :fabricType + attr_accessor :faxNumber + attr_accessor :feature + attr_accessor :firstIssueLeadTime + attr_accessor :floppyDiskDriveDescription + attr_accessor :format + attr_accessor :gemType + attr_accessor :graphicsCardInterface + attr_accessor :graphicsDescription + attr_accessor :graphicsMemorySize + attr_accessor :guitarAttribute + attr_accessor :guitarBridgeSystem + attr_accessor :guitarPickThickness + attr_accessor :guitarPickupConfiguration + attr_accessor :hardDiskCount + attr_accessor :hardDiskSize + attr_accessor :hasAutoFocus + attr_accessor :hasBurstMode + attr_accessor :hasInCameraEditing + attr_accessor :hasRedEyeReduction + attr_accessor :hasSelfTimer + attr_accessor :hasTripodMount + attr_accessor :hasVideoOut + attr_accessor :hasViewfinder + attr_accessor :hazardousMaterialType + attr_accessor :hoursOfOperation + attr_accessor :includedSoftware + attr_accessor :includesMp3Player + attr_accessor :indications + attr_accessor :ingredients + attr_accessor :instrumentKey + attr_accessor :isAutographed + attr_accessor :iSBN + attr_accessor :isFragile + attr_accessor :isLabCreated + attr_accessor :isMemorabilia + attr_accessor :iSOEquivalent + attr_accessor :issuesPerYear + attr_accessor :itemDimensions + attr_accessor :keyboardDescription + attr_accessor :label + attr_accessor :languages + attr_accessor :legalDisclaimer + attr_accessor :lineVoltage + attr_accessor :listPrice + attr_accessor :macroFocusRange + attr_accessor :magazineType + attr_accessor :malletHardness + attr_accessor :manufacturer + attr_accessor :manufacturerLaborWarrantyDescription + attr_accessor :manufacturerMaximumAge + attr_accessor :manufacturerMinimumAge + attr_accessor :manufacturerPartsWarrantyDescription + attr_accessor :materialType + attr_accessor :maximumAperture + attr_accessor :maximumColorDepth + attr_accessor :maximumFocalLength + attr_accessor :maximumHighResolutionImages + attr_accessor :maximumHorizontalResolution + attr_accessor :maximumLowResolutionImages + attr_accessor :maximumResolution + attr_accessor :maximumShutterSpeed + attr_accessor :maximumVerticalResolution + attr_accessor :maximumWeightRecommendation + attr_accessor :memorySlotsAvailable + attr_accessor :metalStamp + attr_accessor :metalType + attr_accessor :miniMovieDescription + attr_accessor :minimumFocalLength + attr_accessor :minimumShutterSpeed + attr_accessor :model + attr_accessor :modelYear + attr_accessor :modemDescription + attr_accessor :monitorSize + attr_accessor :monitorViewableDiagonalSize + attr_accessor :mouseDescription + attr_accessor :mPN + attr_accessor :musicalStyle + attr_accessor :nativeResolution + attr_accessor :neighborhood + attr_accessor :networkInterfaceDescription + attr_accessor :notebookDisplayTechnology + attr_accessor :notebookPointingDeviceDescription + attr_accessor :numberOfDiscs + attr_accessor :numberOfIssues + attr_accessor :numberOfItems + attr_accessor :numberOfKeys + attr_accessor :numberOfPages + attr_accessor :numberOfPearls + attr_accessor :numberOfRapidFireShots + attr_accessor :numberOfStones + attr_accessor :numberOfStrings + attr_accessor :numberOfTracks + attr_accessor :opticalZoom + attr_accessor :outputWattage + attr_accessor :packageDimensions + attr_accessor :pearlLustre + attr_accessor :pearlMinimumColor + attr_accessor :pearlShape + attr_accessor :pearlStringingMethod + attr_accessor :pearlSurfaceBlemishes + attr_accessor :pearlType + attr_accessor :pearlUniformity + attr_accessor :phoneNumber + attr_accessor :photoFlashType + attr_accessor :pictureFormat + attr_accessor :platform + attr_accessor :priceRating + attr_accessor :processorCount + attr_accessor :productGroup + attr_accessor :promotionalTag + attr_accessor :publicationDate + attr_accessor :publisher + attr_accessor :readingLevel + attr_accessor :recorderTrackCount + attr_accessor :regionCode + attr_accessor :regionOfOrigin + attr_accessor :releaseDate + attr_accessor :removableMemory + attr_accessor :resolutionModes + attr_accessor :ringSize + attr_accessor :safetyWarning + attr_accessor :secondaryCacheSize + attr_accessor :settingType + attr_accessor :size + attr_accessor :sKU + attr_accessor :sizePerPearl + attr_accessor :skillLevel + attr_accessor :soundCardDescription + attr_accessor :speakerCount + attr_accessor :speakerDescription + attr_accessor :specialFeatures + attr_accessor :stoneClarity + attr_accessor :stoneColor + attr_accessor :stoneCut + attr_accessor :stoneShape + attr_accessor :stoneWeight + attr_accessor :studio + attr_accessor :subscriptionLength + attr_accessor :supportedImageType + attr_accessor :systemBusSpeed + attr_accessor :systemMemorySizeMax + attr_accessor :systemMemorySize + attr_accessor :systemMemoryType + attr_accessor :theatricalReleaseDate + attr_accessor :title + attr_accessor :totalDiamondWeight + attr_accessor :totalExternalBaysFree + attr_accessor :totalFirewirePorts + attr_accessor :totalGemWeight + attr_accessor :totalInternalBaysFree + attr_accessor :totalMetalWeight + attr_accessor :totalNTSCPALPorts + attr_accessor :totalParallelPorts + attr_accessor :totalPCCardSlots + attr_accessor :totalPCISlotsFree + attr_accessor :totalSerialPorts + attr_accessor :totalSVideoOutPorts + attr_accessor :totalUSB2Ports + attr_accessor :totalUSBPorts + attr_accessor :totalVGAOutPorts + attr_accessor :uPC + attr_accessor :variationDenomination + attr_accessor :variationDescription + attr_accessor :warranty + attr_accessor :watchMovementType + attr_accessor :waterResistanceDepth + attr_accessor :wirelessMicrophoneFrequency + + def initialize(actor = [], address = nil, amazonMaximumAge = nil, amazonMinimumAge = nil, apertureModes = nil, artist = [], aspectRatio = nil, audienceRating = nil, audioFormat = [], author = [], backFinding = nil, bandMaterialType = nil, batteriesIncluded = nil, batteries = nil, batteryDescription = nil, batteryType = nil, bezelMaterialType = nil, binding = nil, brand = nil, calendarType = nil, cameraManualFeatures = [], caseDiameter = nil, caseMaterialType = nil, caseThickness = nil, caseType = nil, cDRWDescription = nil, chainType = nil, claspType = nil, clothingSize = nil, color = nil, compatibility = nil, computerHardwareType = nil, computerPlatform = nil, connectivity = nil, continuousShootingSpeed = nil, country = nil, cPUManufacturer = nil, cPUSpeed = nil, cPUType = nil, creator = [], cuisine = nil, delayBetweenShots = nil, department = nil, description = nil, deweyDecimalNumber = nil, dialColor = nil, dialWindowMaterialType = nil, digitalZoom = nil, director = [], displaySize = nil, drumSetPieceQuantity = nil, dVDLayers = nil, dVDRWDescription = nil, dVDSides = nil, eAN = nil, edition = nil, eSRBAgeRating = nil, externalDisplaySupportDescription = nil, fabricType = nil, faxNumber = nil, feature = [], firstIssueLeadTime = nil, floppyDiskDriveDescription = nil, format = [], gemType = nil, graphicsCardInterface = nil, graphicsDescription = nil, graphicsMemorySize = nil, guitarAttribute = nil, guitarBridgeSystem = nil, guitarPickThickness = nil, guitarPickupConfiguration = nil, hardDiskCount = nil, hardDiskSize = nil, hasAutoFocus = nil, hasBurstMode = nil, hasInCameraEditing = nil, hasRedEyeReduction = nil, hasSelfTimer = nil, hasTripodMount = nil, hasVideoOut = nil, hasViewfinder = nil, hazardousMaterialType = nil, hoursOfOperation = nil, includedSoftware = nil, includesMp3Player = nil, indications = nil, ingredients = nil, instrumentKey = nil, isAutographed = nil, iSBN = nil, isFragile = nil, isLabCreated = nil, isMemorabilia = nil, iSOEquivalent = nil, issuesPerYear = nil, itemDimensions = nil, keyboardDescription = nil, label = nil, languages = nil, legalDisclaimer = nil, lineVoltage = nil, listPrice = nil, macroFocusRange = nil, magazineType = nil, malletHardness = nil, manufacturer = nil, manufacturerLaborWarrantyDescription = nil, manufacturerMaximumAge = nil, manufacturerMinimumAge = nil, manufacturerPartsWarrantyDescription = nil, materialType = nil, maximumAperture = nil, maximumColorDepth = nil, maximumFocalLength = nil, maximumHighResolutionImages = nil, maximumHorizontalResolution = nil, maximumLowResolutionImages = nil, maximumResolution = nil, maximumShutterSpeed = nil, maximumVerticalResolution = nil, maximumWeightRecommendation = nil, memorySlotsAvailable = nil, metalStamp = nil, metalType = nil, miniMovieDescription = nil, minimumFocalLength = nil, minimumShutterSpeed = nil, model = nil, modelYear = nil, modemDescription = nil, monitorSize = nil, monitorViewableDiagonalSize = nil, mouseDescription = nil, mPN = nil, musicalStyle = nil, nativeResolution = nil, neighborhood = nil, networkInterfaceDescription = nil, notebookDisplayTechnology = nil, notebookPointingDeviceDescription = nil, numberOfDiscs = nil, numberOfIssues = nil, numberOfItems = nil, numberOfKeys = nil, numberOfPages = nil, numberOfPearls = nil, numberOfRapidFireShots = nil, numberOfStones = nil, numberOfStrings = nil, numberOfTracks = nil, opticalZoom = nil, outputWattage = nil, packageDimensions = nil, pearlLustre = nil, pearlMinimumColor = nil, pearlShape = nil, pearlStringingMethod = nil, pearlSurfaceBlemishes = nil, pearlType = nil, pearlUniformity = nil, phoneNumber = nil, photoFlashType = [], pictureFormat = [], platform = [], priceRating = nil, processorCount = nil, productGroup = nil, promotionalTag = nil, publicationDate = nil, publisher = nil, readingLevel = nil, recorderTrackCount = nil, regionCode = nil, regionOfOrigin = nil, releaseDate = nil, removableMemory = nil, resolutionModes = nil, ringSize = nil, safetyWarning = nil, secondaryCacheSize = nil, settingType = nil, size = nil, sKU = nil, sizePerPearl = nil, skillLevel = nil, soundCardDescription = nil, speakerCount = nil, speakerDescription = nil, specialFeatures = [], stoneClarity = nil, stoneColor = nil, stoneCut = nil, stoneShape = nil, stoneWeight = nil, studio = nil, subscriptionLength = nil, supportedImageType = [], systemBusSpeed = nil, systemMemorySizeMax = nil, systemMemorySize = nil, systemMemoryType = nil, theatricalReleaseDate = nil, title = nil, totalDiamondWeight = nil, totalExternalBaysFree = nil, totalFirewirePorts = nil, totalGemWeight = nil, totalInternalBaysFree = nil, totalMetalWeight = nil, totalNTSCPALPorts = nil, totalParallelPorts = nil, totalPCCardSlots = nil, totalPCISlotsFree = nil, totalSerialPorts = nil, totalSVideoOutPorts = nil, totalUSB2Ports = nil, totalUSBPorts = nil, totalVGAOutPorts = nil, uPC = nil, variationDenomination = nil, variationDescription = nil, warranty = nil, watchMovementType = nil, waterResistanceDepth = nil, wirelessMicrophoneFrequency = nil) + @actor = actor + @address = address + @amazonMaximumAge = amazonMaximumAge + @amazonMinimumAge = amazonMinimumAge + @apertureModes = apertureModes + @artist = artist + @aspectRatio = aspectRatio + @audienceRating = audienceRating + @audioFormat = audioFormat + @author = author + @backFinding = backFinding + @bandMaterialType = bandMaterialType + @batteriesIncluded = batteriesIncluded + @batteries = batteries + @batteryDescription = batteryDescription + @batteryType = batteryType + @bezelMaterialType = bezelMaterialType + @binding = binding + @brand = brand + @calendarType = calendarType + @cameraManualFeatures = cameraManualFeatures + @caseDiameter = caseDiameter + @caseMaterialType = caseMaterialType + @caseThickness = caseThickness + @caseType = caseType + @cDRWDescription = cDRWDescription + @chainType = chainType + @claspType = claspType + @clothingSize = clothingSize + @color = color + @compatibility = compatibility + @computerHardwareType = computerHardwareType + @computerPlatform = computerPlatform + @connectivity = connectivity + @continuousShootingSpeed = continuousShootingSpeed + @country = country + @cPUManufacturer = cPUManufacturer + @cPUSpeed = cPUSpeed + @cPUType = cPUType + @creator = creator + @cuisine = cuisine + @delayBetweenShots = delayBetweenShots + @department = department + @description = description + @deweyDecimalNumber = deweyDecimalNumber + @dialColor = dialColor + @dialWindowMaterialType = dialWindowMaterialType + @digitalZoom = digitalZoom + @director = director + @displaySize = displaySize + @drumSetPieceQuantity = drumSetPieceQuantity + @dVDLayers = dVDLayers + @dVDRWDescription = dVDRWDescription + @dVDSides = dVDSides + @eAN = eAN + @edition = edition + @eSRBAgeRating = eSRBAgeRating + @externalDisplaySupportDescription = externalDisplaySupportDescription + @fabricType = fabricType + @faxNumber = faxNumber + @feature = feature + @firstIssueLeadTime = firstIssueLeadTime + @floppyDiskDriveDescription = floppyDiskDriveDescription + @format = format + @gemType = gemType + @graphicsCardInterface = graphicsCardInterface + @graphicsDescription = graphicsDescription + @graphicsMemorySize = graphicsMemorySize + @guitarAttribute = guitarAttribute + @guitarBridgeSystem = guitarBridgeSystem + @guitarPickThickness = guitarPickThickness + @guitarPickupConfiguration = guitarPickupConfiguration + @hardDiskCount = hardDiskCount + @hardDiskSize = hardDiskSize + @hasAutoFocus = hasAutoFocus + @hasBurstMode = hasBurstMode + @hasInCameraEditing = hasInCameraEditing + @hasRedEyeReduction = hasRedEyeReduction + @hasSelfTimer = hasSelfTimer + @hasTripodMount = hasTripodMount + @hasVideoOut = hasVideoOut + @hasViewfinder = hasViewfinder + @hazardousMaterialType = hazardousMaterialType + @hoursOfOperation = hoursOfOperation + @includedSoftware = includedSoftware + @includesMp3Player = includesMp3Player + @indications = indications + @ingredients = ingredients + @instrumentKey = instrumentKey + @isAutographed = isAutographed + @iSBN = iSBN + @isFragile = isFragile + @isLabCreated = isLabCreated + @isMemorabilia = isMemorabilia + @iSOEquivalent = iSOEquivalent + @issuesPerYear = issuesPerYear + @itemDimensions = itemDimensions + @keyboardDescription = keyboardDescription + @label = label + @languages = languages + @legalDisclaimer = legalDisclaimer + @lineVoltage = lineVoltage + @listPrice = listPrice + @macroFocusRange = macroFocusRange + @magazineType = magazineType + @malletHardness = malletHardness + @manufacturer = manufacturer + @manufacturerLaborWarrantyDescription = manufacturerLaborWarrantyDescription + @manufacturerMaximumAge = manufacturerMaximumAge + @manufacturerMinimumAge = manufacturerMinimumAge + @manufacturerPartsWarrantyDescription = manufacturerPartsWarrantyDescription + @materialType = materialType + @maximumAperture = maximumAperture + @maximumColorDepth = maximumColorDepth + @maximumFocalLength = maximumFocalLength + @maximumHighResolutionImages = maximumHighResolutionImages + @maximumHorizontalResolution = maximumHorizontalResolution + @maximumLowResolutionImages = maximumLowResolutionImages + @maximumResolution = maximumResolution + @maximumShutterSpeed = maximumShutterSpeed + @maximumVerticalResolution = maximumVerticalResolution + @maximumWeightRecommendation = maximumWeightRecommendation + @memorySlotsAvailable = memorySlotsAvailable + @metalStamp = metalStamp + @metalType = metalType + @miniMovieDescription = miniMovieDescription + @minimumFocalLength = minimumFocalLength + @minimumShutterSpeed = minimumShutterSpeed + @model = model + @modelYear = modelYear + @modemDescription = modemDescription + @monitorSize = monitorSize + @monitorViewableDiagonalSize = monitorViewableDiagonalSize + @mouseDescription = mouseDescription + @mPN = mPN + @musicalStyle = musicalStyle + @nativeResolution = nativeResolution + @neighborhood = neighborhood + @networkInterfaceDescription = networkInterfaceDescription + @notebookDisplayTechnology = notebookDisplayTechnology + @notebookPointingDeviceDescription = notebookPointingDeviceDescription + @numberOfDiscs = numberOfDiscs + @numberOfIssues = numberOfIssues + @numberOfItems = numberOfItems + @numberOfKeys = numberOfKeys + @numberOfPages = numberOfPages + @numberOfPearls = numberOfPearls + @numberOfRapidFireShots = numberOfRapidFireShots + @numberOfStones = numberOfStones + @numberOfStrings = numberOfStrings + @numberOfTracks = numberOfTracks + @opticalZoom = opticalZoom + @outputWattage = outputWattage + @packageDimensions = packageDimensions + @pearlLustre = pearlLustre + @pearlMinimumColor = pearlMinimumColor + @pearlShape = pearlShape + @pearlStringingMethod = pearlStringingMethod + @pearlSurfaceBlemishes = pearlSurfaceBlemishes + @pearlType = pearlType + @pearlUniformity = pearlUniformity + @phoneNumber = phoneNumber + @photoFlashType = photoFlashType + @pictureFormat = pictureFormat + @platform = platform + @priceRating = priceRating + @processorCount = processorCount + @productGroup = productGroup + @promotionalTag = promotionalTag + @publicationDate = publicationDate + @publisher = publisher + @readingLevel = readingLevel + @recorderTrackCount = recorderTrackCount + @regionCode = regionCode + @regionOfOrigin = regionOfOrigin + @releaseDate = releaseDate + @removableMemory = removableMemory + @resolutionModes = resolutionModes + @ringSize = ringSize + @safetyWarning = safetyWarning + @secondaryCacheSize = secondaryCacheSize + @settingType = settingType + @size = size + @sKU = sKU + @sizePerPearl = sizePerPearl + @skillLevel = skillLevel + @soundCardDescription = soundCardDescription + @speakerCount = speakerCount + @speakerDescription = speakerDescription + @specialFeatures = specialFeatures + @stoneClarity = stoneClarity + @stoneColor = stoneColor + @stoneCut = stoneCut + @stoneShape = stoneShape + @stoneWeight = stoneWeight + @studio = studio + @subscriptionLength = subscriptionLength + @supportedImageType = supportedImageType + @systemBusSpeed = systemBusSpeed + @systemMemorySizeMax = systemMemorySizeMax + @systemMemorySize = systemMemorySize + @systemMemoryType = systemMemoryType + @theatricalReleaseDate = theatricalReleaseDate + @title = title + @totalDiamondWeight = totalDiamondWeight + @totalExternalBaysFree = totalExternalBaysFree + @totalFirewirePorts = totalFirewirePorts + @totalGemWeight = totalGemWeight + @totalInternalBaysFree = totalInternalBaysFree + @totalMetalWeight = totalMetalWeight + @totalNTSCPALPorts = totalNTSCPALPorts + @totalParallelPorts = totalParallelPorts + @totalPCCardSlots = totalPCCardSlots + @totalPCISlotsFree = totalPCISlotsFree + @totalSerialPorts = totalSerialPorts + @totalSVideoOutPorts = totalSVideoOutPorts + @totalUSB2Ports = totalUSB2Ports + @totalUSBPorts = totalUSBPorts + @totalVGAOutPorts = totalVGAOutPorts + @uPC = uPC + @variationDenomination = variationDenomination + @variationDescription = variationDescription + @warranty = warranty + @watchMovementType = watchMovementType + @waterResistanceDepth = waterResistanceDepth + @wirelessMicrophoneFrequency = wirelessMicrophoneFrequency + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}HelpRequest +class HelpRequest + @@schema_type = "HelpRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["about", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "About")]], + ["helpType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HelpType")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]] + ] + + attr_accessor :about + attr_accessor :helpType + attr_accessor :responseGroup + + def initialize(about = nil, helpType = nil, responseGroup = []) + @about = about + @helpType = helpType + @responseGroup = responseGroup + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ItemSearchRequest +class ItemSearchRequest + @@schema_type = "ItemSearchRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["actor", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Actor")]], + ["artist", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Artist")]], + ["availability", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Availability")]], + ["audienceRating", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "AudienceRating")]], + ["author", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Author")]], + ["brand", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Brand")]], + ["browseNode", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BrowseNode")]], + ["city", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "City")]], + ["composer", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Composer")]], + ["condition", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Condition")]], + ["conductor", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Conductor")]], + ["count", ["SOAP::SOAPPositiveInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Count")]], + ["cuisine", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Cuisine")]], + ["deliveryMethod", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DeliveryMethod")]], + ["director", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Director")]], + ["futureLaunchDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "FutureLaunchDate")]], + ["iSPUPostalCode", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ISPUPostalCode")]], + ["itemPage", ["SOAP::SOAPPositiveInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemPage")]], + ["keywords", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Keywords")]], + ["manufacturer", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Manufacturer")]], + ["maximumPrice", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MaximumPrice")]], + ["merchantId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MerchantId")]], + ["minimumPrice", ["SOAP::SOAPNonNegativeInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MinimumPrice")]], + ["musicLabel", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MusicLabel")]], + ["neighborhood", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Neighborhood")]], + ["orchestra", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Orchestra")]], + ["postalCode", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PostalCode")]], + ["power", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Power")]], + ["publisher", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Publisher")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]], + ["searchIndex", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SearchIndex")]], + ["sort", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Sort")]], + ["state", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "State")]], + ["textStream", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TextStream")]], + ["title", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Title")]], + ["releaseDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ReleaseDate")]] + ] + + attr_accessor :actor + attr_accessor :artist + attr_accessor :availability + attr_accessor :audienceRating + attr_accessor :author + attr_accessor :brand + attr_accessor :browseNode + attr_accessor :city + attr_accessor :composer + attr_accessor :condition + attr_accessor :conductor + attr_accessor :count + attr_accessor :cuisine + attr_accessor :deliveryMethod + attr_accessor :director + attr_accessor :futureLaunchDate + attr_accessor :iSPUPostalCode + attr_accessor :itemPage + attr_accessor :keywords + attr_accessor :manufacturer + attr_accessor :maximumPrice + attr_accessor :merchantId + attr_accessor :minimumPrice + attr_accessor :musicLabel + attr_accessor :neighborhood + attr_accessor :orchestra + attr_accessor :postalCode + attr_accessor :power + attr_accessor :publisher + attr_accessor :responseGroup + attr_accessor :searchIndex + attr_accessor :sort + attr_accessor :state + attr_accessor :textStream + attr_accessor :title + attr_accessor :releaseDate + + def initialize(actor = nil, artist = nil, availability = nil, audienceRating = [], author = nil, brand = nil, browseNode = nil, city = nil, composer = nil, condition = nil, conductor = nil, count = nil, cuisine = nil, deliveryMethod = nil, director = nil, futureLaunchDate = nil, iSPUPostalCode = nil, itemPage = nil, keywords = nil, manufacturer = nil, maximumPrice = nil, merchantId = nil, minimumPrice = nil, musicLabel = nil, neighborhood = nil, orchestra = nil, postalCode = nil, power = nil, publisher = nil, responseGroup = [], searchIndex = nil, sort = nil, state = nil, textStream = nil, title = nil, releaseDate = nil) + @actor = actor + @artist = artist + @availability = availability + @audienceRating = audienceRating + @author = author + @brand = brand + @browseNode = browseNode + @city = city + @composer = composer + @condition = condition + @conductor = conductor + @count = count + @cuisine = cuisine + @deliveryMethod = deliveryMethod + @director = director + @futureLaunchDate = futureLaunchDate + @iSPUPostalCode = iSPUPostalCode + @itemPage = itemPage + @keywords = keywords + @manufacturer = manufacturer + @maximumPrice = maximumPrice + @merchantId = merchantId + @minimumPrice = minimumPrice + @musicLabel = musicLabel + @neighborhood = neighborhood + @orchestra = orchestra + @postalCode = postalCode + @power = power + @publisher = publisher + @responseGroup = responseGroup + @searchIndex = searchIndex + @sort = sort + @state = state + @textStream = textStream + @title = title + @releaseDate = releaseDate + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ItemLookupRequest +class ItemLookupRequest + @@schema_type = "ItemLookupRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["condition", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Condition")]], + ["deliveryMethod", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DeliveryMethod")]], + ["futureLaunchDate", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "FutureLaunchDate")]], + ["idType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IdType")]], + ["iSPUPostalCode", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ISPUPostalCode")]], + ["merchantId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MerchantId")]], + ["offerPage", ["SOAP::SOAPPositiveInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OfferPage")]], + ["itemId", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemId")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]], + ["reviewPage", ["SOAP::SOAPPositiveInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ReviewPage")]], + ["searchIndex", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SearchIndex")]], + ["searchInsideKeywords", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SearchInsideKeywords")]], + ["variationPage", ["PositiveIntegerOrAll", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "VariationPage")]] + ] + + attr_accessor :condition + attr_accessor :deliveryMethod + attr_accessor :futureLaunchDate + attr_accessor :idType + attr_accessor :iSPUPostalCode + attr_accessor :merchantId + attr_accessor :offerPage + attr_accessor :itemId + attr_accessor :responseGroup + attr_accessor :reviewPage + attr_accessor :searchIndex + attr_accessor :searchInsideKeywords + attr_accessor :variationPage + + def initialize(condition = nil, deliveryMethod = nil, futureLaunchDate = nil, idType = nil, iSPUPostalCode = nil, merchantId = nil, offerPage = nil, itemId = [], responseGroup = [], reviewPage = nil, searchIndex = nil, searchInsideKeywords = nil, variationPage = nil) + @condition = condition + @deliveryMethod = deliveryMethod + @futureLaunchDate = futureLaunchDate + @idType = idType + @iSPUPostalCode = iSPUPostalCode + @merchantId = merchantId + @offerPage = offerPage + @itemId = itemId + @responseGroup = responseGroup + @reviewPage = reviewPage + @searchIndex = searchIndex + @searchInsideKeywords = searchInsideKeywords + @variationPage = variationPage + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ListSearchRequest +class ListSearchRequest + @@schema_type = "ListSearchRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["city", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "City")]], + ["email", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Email")]], + ["firstName", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "FirstName")]], + ["lastName", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "LastName")]], + ["listPage", ["SOAP::SOAPPositiveInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListPage")]], + ["listType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListType")]], + ["name", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Name")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]], + ["state", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "State")]] + ] + + attr_accessor :city + attr_accessor :email + attr_accessor :firstName + attr_accessor :lastName + attr_accessor :listPage + attr_accessor :listType + attr_accessor :name + attr_accessor :responseGroup + attr_accessor :state + + def initialize(city = nil, email = nil, firstName = nil, lastName = nil, listPage = nil, listType = nil, name = nil, responseGroup = [], state = nil) + @city = city + @email = email + @firstName = firstName + @lastName = lastName + @listPage = listPage + @listType = listType + @name = name + @responseGroup = responseGroup + @state = state + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}ListLookupRequest +class ListLookupRequest + @@schema_type = "ListLookupRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["condition", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Condition")]], + ["deliveryMethod", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DeliveryMethod")]], + ["iSPUPostalCode", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ISPUPostalCode")]], + ["listId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListId")]], + ["listType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListType")]], + ["merchantId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MerchantId")]], + ["productGroup", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ProductGroup")]], + ["productPage", ["SOAP::SOAPPositiveInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ProductPage")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]], + ["sort", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Sort")]] + ] + + attr_accessor :condition + attr_accessor :deliveryMethod + attr_accessor :iSPUPostalCode + attr_accessor :listId + attr_accessor :listType + attr_accessor :merchantId + attr_accessor :productGroup + attr_accessor :productPage + attr_accessor :responseGroup + attr_accessor :sort + + def initialize(condition = nil, deliveryMethod = nil, iSPUPostalCode = nil, listId = nil, listType = nil, merchantId = nil, productGroup = nil, productPage = nil, responseGroup = [], sort = nil) + @condition = condition + @deliveryMethod = deliveryMethod + @iSPUPostalCode = iSPUPostalCode + @listId = listId + @listType = listType + @merchantId = merchantId + @productGroup = productGroup + @productPage = productPage + @responseGroup = responseGroup + @sort = sort + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CustomerContentSearchRequest +class CustomerContentSearchRequest + @@schema_type = "CustomerContentSearchRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["customerPage", ["SOAP::SOAPPositiveInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerPage")]], + ["email", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Email")]], + ["name", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Name")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]] + ] + + attr_accessor :customerPage + attr_accessor :email + attr_accessor :name + attr_accessor :responseGroup + + def initialize(customerPage = nil, email = nil, name = nil, responseGroup = []) + @customerPage = customerPage + @email = email + @name = name + @responseGroup = responseGroup + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CustomerContentLookupRequest +class CustomerContentLookupRequest + @@schema_type = "CustomerContentLookupRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["customerId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerId")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]], + ["reviewPage", ["SOAP::SOAPPositiveInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ReviewPage")]] + ] + + attr_accessor :customerId + attr_accessor :responseGroup + attr_accessor :reviewPage + + def initialize(customerId = nil, responseGroup = [], reviewPage = nil) + @customerId = customerId + @responseGroup = responseGroup + @reviewPage = reviewPage + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SimilarityLookupRequest +class SimilarityLookupRequest + @@schema_type = "SimilarityLookupRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["condition", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Condition")]], + ["deliveryMethod", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "DeliveryMethod")]], + ["itemId", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemId")]], + ["iSPUPostalCode", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ISPUPostalCode")]], + ["merchantId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MerchantId")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]], + ["similarityType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SimilarityType")]] + ] + + attr_accessor :condition + attr_accessor :deliveryMethod + attr_accessor :itemId + attr_accessor :iSPUPostalCode + attr_accessor :merchantId + attr_accessor :responseGroup + attr_accessor :similarityType + + def initialize(condition = nil, deliveryMethod = nil, itemId = [], iSPUPostalCode = nil, merchantId = nil, responseGroup = [], similarityType = nil) + @condition = condition + @deliveryMethod = deliveryMethod + @itemId = itemId + @iSPUPostalCode = iSPUPostalCode + @merchantId = merchantId + @responseGroup = responseGroup + @similarityType = similarityType + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SellerLookupRequest +class SellerLookupRequest + @@schema_type = "SellerLookupRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]], + ["sellerId", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerId")]], + ["feedbackPage", ["SOAP::SOAPPositiveInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "FeedbackPage")]] + ] + + attr_accessor :responseGroup + attr_accessor :sellerId + attr_accessor :feedbackPage + + def initialize(responseGroup = [], sellerId = [], feedbackPage = nil) + @responseGroup = responseGroup + @sellerId = sellerId + @feedbackPage = feedbackPage + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartGetRequest +class CartGetRequest + @@schema_type = "CartGetRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["cartId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartId")]], + ["hMAC", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HMAC")]], + ["mergeCart", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MergeCart")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]] + ] + + attr_accessor :cartId + attr_accessor :hMAC + attr_accessor :mergeCart + attr_accessor :responseGroup + + def initialize(cartId = nil, hMAC = nil, mergeCart = nil, responseGroup = []) + @cartId = cartId + @hMAC = hMAC + @mergeCart = mergeCart + @responseGroup = responseGroup + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartAddRequest +class CartAddRequest + @@schema_type = "CartAddRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["cartId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartId")]], + ["hMAC", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HMAC")]], + ["mergeCart", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MergeCart")]], + ["items", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Items")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]] + ] + + attr_accessor :cartId + attr_accessor :hMAC + attr_accessor :mergeCart + attr_accessor :items + attr_accessor :responseGroup + + def initialize(cartId = nil, hMAC = nil, mergeCart = nil, items = nil, responseGroup = []) + @cartId = cartId + @hMAC = hMAC + @mergeCart = mergeCart + @items = items + @responseGroup = responseGroup + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartCreateRequest +class CartCreateRequest + @@schema_type = "CartCreateRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["mergeCart", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MergeCart")]], + ["items", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Items")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]] + ] + + attr_accessor :mergeCart + attr_accessor :items + attr_accessor :responseGroup + + def initialize(mergeCart = nil, items = nil, responseGroup = []) + @mergeCart = mergeCart + @items = items + @responseGroup = responseGroup + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartModifyRequest +class CartModifyRequest + @@schema_type = "CartModifyRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["cartId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartId")]], + ["hMAC", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HMAC")]], + ["mergeCart", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MergeCart")]], + ["items", [nil, XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Items")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]] + ] + + attr_accessor :cartId + attr_accessor :hMAC + attr_accessor :mergeCart + attr_accessor :items + attr_accessor :responseGroup + + def initialize(cartId = nil, hMAC = nil, mergeCart = nil, items = nil, responseGroup = []) + @cartId = cartId + @hMAC = hMAC + @mergeCart = mergeCart + @items = items + @responseGroup = responseGroup + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartClearRequest +class CartClearRequest + @@schema_type = "CartClearRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["cartId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartId")]], + ["hMAC", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HMAC")]], + ["mergeCart", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MergeCart")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]] + ] + + attr_accessor :cartId + attr_accessor :hMAC + attr_accessor :mergeCart + attr_accessor :responseGroup + + def initialize(cartId = nil, hMAC = nil, mergeCart = nil, responseGroup = []) + @cartId = cartId + @hMAC = hMAC + @mergeCart = mergeCart + @responseGroup = responseGroup + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}TransactionLookupRequest +class TransactionLookupRequest + @@schema_type = "TransactionLookupRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]], + ["transactionId", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TransactionId")]] + ] + + attr_accessor :responseGroup + attr_accessor :transactionId + + def initialize(responseGroup = [], transactionId = []) + @responseGroup = responseGroup + @transactionId = transactionId + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SellerListingSearchRequest +class SellerListingSearchRequest + @@schema_type = "SellerListingSearchRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["keywords", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Keywords")]], + ["listingPage", ["SOAP::SOAPPositiveInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListingPage")]], + ["offerStatus", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "OfferStatus")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]], + ["sellerId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerId")]], + ["sort", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Sort")]], + ["title", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Title")]] + ] + + attr_accessor :keywords + attr_accessor :listingPage + attr_accessor :offerStatus + attr_accessor :responseGroup + attr_accessor :sellerId + attr_accessor :sort + attr_accessor :title + + def initialize(keywords = nil, listingPage = nil, offerStatus = nil, responseGroup = [], sellerId = nil, sort = nil, title = nil) + @keywords = keywords + @listingPage = listingPage + @offerStatus = offerStatus + @responseGroup = responseGroup + @sellerId = sellerId + @sort = sort + @title = title + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}SellerListingLookupRequest +class SellerListingLookupRequest + @@schema_type = "SellerListingLookupRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["id", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Id")]], + ["sellerId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerId")]], + ["idType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IdType")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]] + ] + + attr_accessor :id + attr_accessor :sellerId + attr_accessor :idType + attr_accessor :responseGroup + + def initialize(id = nil, sellerId = nil, idType = nil, responseGroup = []) + @id = id + @sellerId = sellerId + @idType = idType + @responseGroup = responseGroup + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}BrowseNodeLookupRequest +class BrowseNodeLookupRequest + @@schema_type = "BrowseNodeLookupRequest" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["browseNodeId", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BrowseNodeId")]], + ["responseGroup", ["SOAP::SOAPString[]", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ResponseGroup")]] + ] + + attr_accessor :browseNodeId + attr_accessor :responseGroup + + def initialize(browseNodeId = [], responseGroup = []) + @browseNodeId = browseNodeId + @responseGroup = responseGroup + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}CartItem +class CartItem + @@schema_type = "CartItem" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["cartItemId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartItemId")]], + ["aSIN", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ASIN")]], + ["exchangeId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ExchangeId")]], + ["merchantId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MerchantId")]], + ["sellerId", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerId")]], + ["sellerNickname", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerNickname")]], + ["quantity", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Quantity")]], + ["title", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Title")]], + ["productGroup", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ProductGroup")]], + ["listOwner", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListOwner")]], + ["listType", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListType")]], + ["price", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Price")]], + ["itemTotal", ["Price", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemTotal")]] + ] + + attr_accessor :cartItemId + attr_accessor :aSIN + attr_accessor :exchangeId + attr_accessor :merchantId + attr_accessor :sellerId + attr_accessor :sellerNickname + attr_accessor :quantity + attr_accessor :title + attr_accessor :productGroup + attr_accessor :listOwner + attr_accessor :listType + attr_accessor :price + attr_accessor :itemTotal + + def initialize(cartItemId = nil, aSIN = nil, exchangeId = nil, merchantId = nil, sellerId = nil, sellerNickname = nil, quantity = nil, title = nil, productGroup = nil, listOwner = nil, listType = nil, price = nil, itemTotal = nil) + @cartItemId = cartItemId + @aSIN = aSIN + @exchangeId = exchangeId + @merchantId = merchantId + @sellerId = sellerId + @sellerNickname = sellerNickname + @quantity = quantity + @title = title + @productGroup = productGroup + @listOwner = listOwner + @listType = listType + @price = price + @itemTotal = itemTotal + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Address +class Address + @@schema_type = "Address" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["name", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Name")]], + ["address1", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Address1")]], + ["address2", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Address2")]], + ["address3", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Address3")]], + ["city", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "City")]], + ["state", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "State")]], + ["postalCode", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "PostalCode")]], + ["country", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Country")]] + ] + + attr_accessor :name + attr_accessor :address1 + attr_accessor :address2 + attr_accessor :address3 + attr_accessor :city + attr_accessor :state + attr_accessor :postalCode + attr_accessor :country + + def initialize(name = nil, address1 = nil, address2 = nil, address3 = nil, city = nil, state = nil, postalCode = nil, country = nil) + @name = name + @address1 = address1 + @address2 = address2 + @address3 = address3 + @city = city + @state = state + @postalCode = postalCode + @country = country + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Price +class Price + @@schema_type = "Price" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["amount", ["SOAP::SOAPInteger", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Amount")]], + ["currencyCode", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CurrencyCode")]], + ["formattedPrice", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "FormattedPrice")]] + ] + + attr_accessor :amount + attr_accessor :currencyCode + attr_accessor :formattedPrice + + def initialize(amount = nil, currencyCode = nil, formattedPrice = nil) + @amount = amount + @currencyCode = currencyCode + @formattedPrice = formattedPrice + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}Image +class Image + @@schema_type = "Image" + @@schema_ns = "http://webservices.amazon.com/AWSECommerceService/2006-06-07" + @@schema_element = [ + ["uRL", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "URL")]], + ["height", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Height")]], + ["width", ["DecimalWithUnits", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Width")]], + ["isVerified", ["SOAP::SOAPString", XSD::QName.new("http://webservices.amazon.com/AWSECommerceService/2006-06-07", "IsVerified")]] + ] + + attr_accessor :uRL + attr_accessor :height + attr_accessor :width + attr_accessor :isVerified + + def initialize(uRL = nil, height = nil, width = nil, isVerified = nil) + @uRL = uRL + @height = height + @width = width + @isVerified = isVerified + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}NonNegativeIntegerWithUnits +# contains SOAP::SOAPNonNegativeInteger +class NonNegativeIntegerWithUnits < ::String + @@schema_attribute = { + XSD::QName.new(nil, "Units") => "SOAP::SOAPString" + } + + def xmlattr_Units + (@__xmlattr ||= {})[XSD::QName.new(nil, "Units")] + end + + def xmlattr_Units=(value) + (@__xmlattr ||= {})[XSD::QName.new(nil, "Units")] = value + end + + def initialize(*arg) + super + @__xmlattr = {} + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}DecimalWithUnits +# contains SOAP::SOAPDecimal +class DecimalWithUnits < ::String + @@schema_attribute = { + XSD::QName.new(nil, "Units") => "SOAP::SOAPString" + } + + def xmlattr_Units + (@__xmlattr ||= {})[XSD::QName.new(nil, "Units")] + end + + def xmlattr_Units=(value) + (@__xmlattr ||= {})[XSD::QName.new(nil, "Units")] = value + end + + def initialize(*arg) + super + @__xmlattr = {} + end +end + +# {http://webservices.amazon.com/AWSECommerceService/2006-06-07}StringWithUnits +# contains SOAP::SOAPString +class StringWithUnits < ::String + @@schema_attribute = { + XSD::QName.new(nil, "Units") => "SOAP::SOAPString" + } + + def xmlattr_Units + (@__xmlattr ||= {})[XSD::QName.new(nil, "Units")] + end + + def xmlattr_Units=(value) + (@__xmlattr ||= {})[XSD::QName.new(nil, "Units")] = value + end + + def initialize(*arg) + super + @__xmlattr = {} + end +end diff --git a/test/soap/literalArrayMapping/amazonEcDriver.rb b/test/soap/literalArrayMapping/amazonEcDriver.rb new file mode 100644 index 0000000..3a1376c --- /dev/null +++ b/test/soap/literalArrayMapping/amazonEcDriver.rb @@ -0,0 +1,172 @@ +require 'amazonEc.rb' + +require 'soap/rpc/driver' + +class AWSECommerceServicePortType < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://soap.amazon.com/onca/soap?Service=AWSECommerceService" + MappingRegistry = ::SOAP::Mapping::Registry.new + + Methods = [ + [ "http://soap.amazon.com", + "help", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "Help"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "HelpResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "itemSearch", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemSearch"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemSearchResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "itemLookup", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemLookup"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ItemLookupResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "browseNodeLookup", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BrowseNodeLookup"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "BrowseNodeLookupResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "listSearch", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListSearch"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListSearchResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "listLookup", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListLookup"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "ListLookupResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "customerContentSearch", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerContentSearch"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerContentSearchResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "customerContentLookup", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerContentLookup"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CustomerContentLookupResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "similarityLookup", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SimilarityLookup"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SimilarityLookupResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "sellerLookup", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerLookup"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerLookupResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "cartGet", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartGet"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartGetResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "cartCreate", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartCreate"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartCreateResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "cartAdd", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartAdd"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartAddResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "cartModify", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartModify"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartModifyResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "cartClear", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartClear"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "CartClearResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "transactionLookup", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TransactionLookup"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "TransactionLookupResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "sellerListingSearch", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerListingSearch"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerListingSearchResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "sellerListingLookup", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerListingLookup"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "SellerListingLookupResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ], + [ "http://soap.amazon.com", + "multiOperation", + [ [:in, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MultiOperation"], true], + [:out, "body", ["::SOAP::SOAPElement", "http://webservices.amazon.com/AWSECommerceService/2006-06-07", "MultiOperationResponse"], true] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = MappingRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end + diff --git a/test/soap/literalArrayMapping/amazonresponse.xml b/test/soap/literalArrayMapping/amazonresponse.xml new file mode 100644 index 0000000..e4d02e5 --- /dev/null +++ b/test/soap/literalArrayMapping/amazonresponse.xml @@ -0,0 +1,100 @@ + + + + + + +
+
+
+ 00000000000000000000 + + + + + 0.17442512512207 +
+ + + True + + 11 + 2 + + B000AMF800 + the_url_is_too_long + + Andreas Bieber, Pia Douwes, Thomas Borchert, Felix Martin Uwe + Ar-Express (Sony BMG) + Music + Musical Stars + + + + 852 + EUR + EUR 8,52 + + + 852 + EUR + EUR 8,52 + + 12 + 2 + 0 + 0 + + + + Totale Finsternis (Tanz der Vampire) + Ich mir (Elisabeth) + The Winner Takes It All ("Mamma Mia") + Cindy (Cindy) + Beauty And The Beast (Disney's Beauty & The Best) + Somewhere Out There (American Tail) + Mamma Mia - Musicalstars singen Abba-Hits + Dies ist die Stunde (Jekyll & Hyde) + Bring ihn heim (Les ) + New Hampshire Nights (An Unfinished Song) + The Door Is Open + Pinball Wizard (Tommy) + Ocean Of Love (Poe: Pech und Schwefel) + + + Written In The Stars ("Aida" + I Am (Hero) + Waterloo - Musicalstars singen Abba-Hits + Don't Cry For Me Argentina (Evita) + Gib mir Kraft (Bonifatius: Das Musical) + Break The Silence (Paradise Of Pain) + Irgendetwas fehlt (Letterland) + A Dangerous Game (Jekyll & Hyde) + I Am A Mirror (Freudiana) + Easy Terms (Blood Brothers) + The Shades Of Night (Elisabeth) + Gold von den Sternen (Mozart!) + Die Musik der Nacht (Das Phantom der Oper) + + + Schlag ein (Poe: Pech und Schwefel) - Edited Version + Ein Leben lang (Bonifatius: Das Musical) + Memory (Cats) + Any Fool Could Se / Oh, Paris (Paris) + Does Your Mother Know (Mamma Mia) + Out Of My Pain + Lullaby From Faraway + Die unstillbare Gier (Tanz der Vampire) + Make A Wish Come True (Make-A-Wish-Foundation Song) + Somewhere In Heaven (Arena) + Are We Really Angels + Lost My Mind (Peggy: Das Musical) + Our Time (Merrily We Roll Along) + Follow Your Star + + + + +
+
+
diff --git a/test/soap/literalArrayMapping/test_definedarray.rb b/test/soap/literalArrayMapping/test_definedarray.rb new file mode 100644 index 0000000..4a87e2d --- /dev/null +++ b/test/soap/literalArrayMapping/test_definedarray.rb @@ -0,0 +1,34 @@ +require 'test/unit' +require 'soap/mapping' +require 'soap/processor' +require 'soap/rpc/element' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module SOAP +module Marshal + + +class TestDefinedArray < Test::Unit::TestCase + DIR = File.dirname(File.expand_path(__FILE__)) + + def pathname(filename) + File.join(DIR, filename) + end + + def setup + TestUtil.require(DIR, 'amazonEcDriver.rb') + end + + def test_amazonresponse + drv = AWSECommerceServicePortType.new + drv.wiredump_dev = STDOUT if $DEBUG + drv.test_loopback_response << File.read(pathname('amazonresponse.xml')) + obj = drv.itemSearch(ItemSearch.new) + assert_equal(3, obj.items.item.tracks.disc.size) + end +end + + +end +end diff --git a/test/soap/marshal/marshaltestlib.rb b/test/soap/marshal/marshaltestlib.rb new file mode 100644 index 0000000..96cb2ce --- /dev/null +++ b/test/soap/marshal/marshaltestlib.rb @@ -0,0 +1,494 @@ +module MarshalTestLib + # include this module to a Test::Unit::TestCase and definde encode(o) and + # decode(s) methods. e.g. + # + # def encode(o) + # SOAPMarshal.dump(o) + # end + # + # def decode(s) + # SOAPMarshal.load(s) + # end + + NegativeZero = (-1.0 / (1.0 / 0.0)) + + module Mod1; end + module Mod2; end + + def marshaltest(o1) + str = encode(o1) + print str, "\n" if $DEBUG + o2 = decode(str) + o2 + end + + def marshal_equal(o1, msg = nil) + msg = msg ? msg + "(#{ caller[0] })" : caller[0] + o2 = marshaltest(o1) + assert_equal(o1.class, o2.class, msg) + iv1 = o1.instance_variables.sort + iv2 = o2.instance_variables.sort + assert_equal(iv1, iv2) + val1 = iv1.map {|var| o1.instance_eval {eval var}} + val2 = iv1.map {|var| o2.instance_eval {eval var}} + assert_equal(val1, val2, msg) + if block_given? + assert_equal(yield(o1), yield(o2), msg) + else + assert_equal(o1, o2, msg) + end + end + + class MyObject; def initialize(v) @v = v end; attr_reader :v; end + def test_object + o1 = Object.new + o1.instance_eval { @iv = 1 } + marshal_equal(o1) {|o| o.instance_eval { @iv }} + end + + def test_object_subclass + marshal_equal(MyObject.new(2)) {|o| o.v} + end + + def test_object_extend + o1 = Object.new + o1.extend(Mod1) + marshal_equal(o1) { |o| + (class << self; self; end).ancestors + } + o1.extend(Mod2) + marshal_equal(o1) { |o| + (class << self; self; end).ancestors + } + end + + def test_object_subclass_extend + o1 = MyObject.new(2) + o1.extend(Mod1) + marshal_equal(o1) { |o| + (class << self; self; end).ancestors + } + o1.extend(Mod2) + marshal_equal(o1) { |o| + (class << self; self; end).ancestors + } + end + + class MyArray < Array + def initialize(v, *args) + super(args) + @v = v + end + end + def test_array + marshal_equal(5) + marshal_equal([1,2,3]) + end + + def test_array_subclass + marshal_equal(MyArray.new(0, 1, 2, 3)) + end + + def test_array_ivar + o1 = Array.new + o1.instance_eval { @iv = 1 } + marshal_equal(o1) {|o| o.instance_eval { @iv }} + end + + class MyException < Exception; def initialize(v, *args) super(*args); @v = v; end; attr_reader :v; end + def test_exception + marshal_equal(Exception.new('foo')) {|o| o.message} + marshal_equal(assert_raise(NoMethodError) {no_such_method()}) {|o| o.message} + end + + def test_exception_subclass + marshal_equal(MyException.new(20, "bar")) {|o| [o.message, o.v]} + end + + def test_false + marshal_equal(false) + end + + class MyHash < Hash; def initialize(v, *args) super(*args); @v = v; end end + def test_hash + marshal_equal({1=>2, 3=>4}) + end + + def test_hash_default + h = Hash.new(:default) + h[5] = 6 + marshal_equal(h) + end + + def test_hash_subclass + h = MyHash.new(7, 8) + h[4] = 5 + marshal_equal(h) + end + + def test_hash_default_proc + h = Hash.new {} + assert_raises(TypeError) { marshaltest(h) } + end + + def test_hash_ivar + o1 = Hash.new + o1.instance_eval { @iv = 1 } + marshal_equal(o1) {|o| o.instance_eval { @iv }} + end + + def test_hash_extend + o1 = Hash.new + o1.extend(Mod1) + marshal_equal(o1) { |o| + (class << self; self; end).ancestors + } + o1.extend(Mod2) + marshal_equal(o1) { |o| + (class << self; self; end).ancestors + } + end + + def test_hash_subclass_extend + o1 = MyHash.new(2) + o1.extend(Mod1) + marshal_equal(o1) { |o| + (class << self; self; end).ancestors + } + o1.extend(Mod2) + marshal_equal(o1) { |o| + (class << self; self; end).ancestors + } + end + + def test_bignum + marshal_equal(-0x4000_0000_0000_0001) + marshal_equal(-0x4000_0001) + marshal_equal(0x4000_0000) + marshal_equal(0x4000_0000_0000_0000) + end + + def test_fixnum + marshal_equal(-0x4000_0000) + marshal_equal(-0x3fff_ffff) + marshal_equal(-1) + marshal_equal(0) + marshal_equal(1) + marshal_equal(0x3fff_ffff) + end + + def test_fixnum_ivar + o1 = 1 + o1.instance_eval { @iv = 2 } + marshal_equal(o1) {|o| o.instance_eval { @iv }} + ensure + 1.instance_eval { remove_instance_variable("@iv") } + end + + def test_fixnum_ivar_self + o1 = 1 + o1.instance_eval { @iv = 1 } + marshal_equal(o1) {|o| o.instance_eval { @iv }} + ensure + 1.instance_eval { remove_instance_variable("@iv") } + end + + def test_float + marshal_equal(-1.0) + marshal_equal(0.0) + marshal_equal(1.0) + end + + def test_float_inf_nan + marshal_equal(1.0/0.0) + marshal_equal(-1.0/0.0) + marshal_equal(0.0/0.0) {|o| o.nan?} + marshal_equal(NegativeZero) {|o| 1.0/o} + end + + def test_float_ivar + o1 = 1.23 + o1.instance_eval { @iv = 1 } + marshal_equal(o1) {|o| o.instance_eval { @iv }} + end + + def test_float_ivar_self + o1 = 5.5 + o1.instance_eval { @iv = o1 } + marshal_equal(o1) {|o| o.instance_eval { @iv }} + end + + def test_float_extend + o1 = 0.0/0.0 + o1.extend(Mod1) + marshal_equal(o1) { |o| + (class << self; self; end).ancestors + } + o1.extend(Mod2) + marshal_equal(o1) { |o| + (class << self; self; end).ancestors + } + end + + class MyRange < Range; def initialize(v, *args) super(*args); @v = v; end end + def test_range + marshal_equal(1..2) + marshal_equal(1...3) + end + + def test_range_subclass + marshal_equal(MyRange.new(4,5,8, false)) + end + + class MyRegexp < Regexp; def initialize(v, *args) super(*args); @v = v; end end + def test_regexp + marshal_equal(/a/) + marshal_equal(/A/i) + marshal_equal(/A/mx) + end + + def test_regexp_subclass + marshal_equal(MyRegexp.new(10, "a")) + end + + class MyString < String; def initialize(v, *args) super(*args); @v = v; end end + def test_string + marshal_equal("abc") + end + + def test_string_ivar + o1 = "" + o1.instance_eval { @iv = 1 } + marshal_equal(o1) {|o| o.instance_eval { @iv }} + end + + def test_string_subclass + marshal_equal(MyString.new(10, "a")) + end + + def test_string_subclass_cycle + str = MyString.new(10, "b") + str.instance_eval { @v = str } + marshal_equal(str) { |o| + assert_equal(o.__id__, o.instance_eval { @v }.__id__) + o.instance_eval { @v } + } + end + + def test_string_subclass_extend + o = "abc" + o.extend(Mod1) + str = MyString.new(o, "c") + marshal_equal(str) { |o| + assert(o.instance_eval { @v }).kind_of?(Mod1) + } + end + + MyStruct = Struct.new("MyStruct", :a, :b) + if RUBY_VERSION < "1.8.0" + # Struct#== is not defined in ruby/1.6 + class MyStruct + def ==(rhs) + return true if __id__ == rhs.__id__ + return false unless rhs.is_a?(::Struct) + return false if self.class != rhs.class + members.each do |member| + return false if self.__send__(member) != rhs.__send__(member) + end + return true + end + end + end + class MySubStruct < MyStruct; def initialize(v, *args) super(*args); @v = v; end end + def test_struct + marshal_equal(MyStruct.new(1,2)) + end + + def test_struct_subclass + if RUBY_VERSION < "1.8.0" + # Substruct instance cannot be dumped in ruby/1.6 + # ::Marshal.dump(MySubStruct.new(10, 1, 2)) #=> uninitialized struct + return false + end + marshal_equal(MySubStruct.new(10,1,2)) + end + + def test_struct_ivar + o1 = MyStruct.new + o1.instance_eval { @iv = 1 } + marshal_equal(o1) {|o| o.instance_eval { @iv }} + end + + def test_struct_subclass_extend + o1 = MyStruct.new + o1.extend(Mod1) + marshal_equal(o1) { |o| + (class << self; self; end).ancestors + } + o1.extend(Mod2) + marshal_equal(o1) { |o| + (class << self; self; end).ancestors + } + end + + def test_symbol + marshal_equal(:a) + marshal_equal(:a?) + marshal_equal(:a!) + marshal_equal(:a=) + marshal_equal(:|) + marshal_equal(:^) + marshal_equal(:&) + marshal_equal(:<=>) + marshal_equal(:==) + marshal_equal(:===) + marshal_equal(:=~) + marshal_equal(:>) + marshal_equal(:>=) + marshal_equal(:<) + marshal_equal(:<=) + marshal_equal(:<<) + marshal_equal(:>>) + marshal_equal(:+) + marshal_equal(:-) + marshal_equal(:*) + marshal_equal(:/) + marshal_equal(:%) + marshal_equal(:**) + marshal_equal(:~) + marshal_equal(:+@) + marshal_equal(:-@) + marshal_equal(:[]) + marshal_equal(:[]=) + marshal_equal(:`) #` + marshal_equal("a b".intern) + end + + class MyTime < Time; def initialize(v, *args) super(*args); @v = v; end end + def test_time + # once there was a bug caused by usec overflow. try a little harder. + 10.times do + t = Time.now + marshal_equal(t, t.usec.to_s) + end + end + + def test_time_subclass + marshal_equal(MyTime.new(10)) + end + + def test_time_ivar + o1 = Time.now + o1.instance_eval { @iv = 1 } + marshal_equal(o1) {|o| o.instance_eval { @iv }} + end + + def test_true + marshal_equal(true) + end + + def test_nil + marshal_equal(nil) + end + + def test_share + o = [:share] + o1 = [o, o] + o2 = marshaltest(o1) + assert_same(o2.first, o2.last) + end + + class CyclicRange < Range + def <=>(other); true; end + end + def test_range_cyclic + return unless CyclicRange.respond_to?(:allocate) # test for 1.8 + o1 = CyclicRange.allocate + o1.instance_eval { initialize(o1, o1) } + o2 = marshaltest(o1) + assert_same(o2, o2.begin) + assert_same(o2, o2.end) + end + + def test_singleton + o = Object.new + def o.m() end + assert_raises(TypeError) { marshaltest(o) } + o = Object.new + c = class << o + @v = 1 + class C; self; end + end + assert_raises(TypeError) { marshaltest(o) } + assert_raises(TypeError) { marshaltest(c) } + assert_raises(TypeError) { marshaltest(ARGF) } + assert_raises(TypeError) { marshaltest(ENV) } + end + + def test_extend + o = Object.new + o.extend Mod1 + marshal_equal(o) { |obj| obj.kind_of? Mod1 } + o = Object.new + o.extend Mod1 + o.extend Mod2 + marshal_equal(o) {|obj| class << obj; ancestors end} + o = Object.new + o.extend Module.new + assert_raises(TypeError) { marshaltest(o) } + end + + def test_extend_string + o = "" + o.extend Mod1 + marshal_equal(o) { |obj| obj.kind_of? Mod1 } + o = "" + o.extend Mod1 + o.extend Mod2 + marshal_equal(o) {|obj| class << obj; ancestors end} + o = "" + o.extend Module.new + assert_raises(TypeError) { marshaltest(o) } + end + + def test_anonymous + c = Class.new + assert_raises(TypeError) { marshaltest(c) } + o = c.new + assert_raises(TypeError) { marshaltest(o) } + m = Module.new + assert_raises(TypeError) { marshaltest(m) } + end + + def test_string_empty + marshal_equal("") + end + + def test_string_crlf + marshal_equal("\r\n") + end + + def test_string_escape + marshal_equal("<;;>&\r'\";;>") + end + + MyStruct2 = Struct.new(:a, :b) + if RUBY_VERSION < "1.8.0" + # Struct#== is not defined in ruby/1.6 + class MyStruct2 + def ==(rhs) + return true if __id__ == rhs.__id__ + return false unless rhs.is_a?(::Struct) + return false if self.class != rhs.class + members.each do |member| + return false if self.__send__(member) != rhs.__send__(member) + end + return true + end + end + end + def test_struct_toplevel + o = MyStruct2.new(1,2) + marshal_equal(o) + end +end diff --git a/test/soap/marshal/test_digraph.rb b/test/soap/marshal/test_digraph.rb new file mode 100644 index 0000000..d7f3065 --- /dev/null +++ b/test/soap/marshal/test_digraph.rb @@ -0,0 +1,56 @@ +require 'test/unit' +require 'soap/marshal' + + +module SOAP +module Marshal + + +class Node; include SOAP::Marshallable + attr_reader :first, :second, :str + + def initialize(*init_next) + @first = init_next[0] + @second = init_next[1] + end +end + +class TestDigraph < Test::Unit::TestCase + def setup + @n9 = Node.new + @n81 = Node.new(@n9) + @n82 = Node.new(@n9) + @n7 = Node.new(@n81, @n82) + @n61 = Node.new(@n7) + @n62 = Node.new(@n7) + @n5 = Node.new(@n61, @n62) + @n41 = Node.new(@n5) + @n42 = Node.new(@n5) + @n3 = Node.new(@n41, @n42) + @n21 = Node.new(@n3) + @n22 = Node.new(@n3) + @n1 = Node.new(@n21, @n22) + end + + def test_marshal + f = File.open("digraph_marshalled_string.soap", "wb") + SOAP::Marshal.dump(@n1, f) + f.close + f = File.open("digraph_marshalled_string.soap") + str = f.read + f.close + newnode = SOAP::Marshal.unmarshal(str) + assert_equal(newnode.first.first.__id__, newnode.second.first.__id__) + assert_equal(newnode.first.first.first.first.__id__, newnode.second.first.second.first.__id__) + end + + def teardown + if File.exist?("digraph_marshalled_string.soap") + File.unlink("digraph_marshalled_string.soap") + end + end +end + + +end +end diff --git a/test/soap/marshal/test_marshal.rb b/test/soap/marshal/test_marshal.rb new file mode 100644 index 0000000..d8f900c --- /dev/null +++ b/test/soap/marshal/test_marshal.rb @@ -0,0 +1,26 @@ +require 'test/unit' +require 'soap/marshal' +require File.join(File.dirname(File.expand_path(__FILE__)), 'marshaltestlib') + + +if RUBY_VERSION > "1.7.0" + + +module SOAP +module Marshal +class TestMarshal < Test::Unit::TestCase + include MarshalTestLib + + def encode(o) + SOAPMarshal.dump(o) + end + + def decode(s) + SOAPMarshal.load(s) + end +end +end +end + + +end diff --git a/test/soap/marshal/test_struct.rb b/test/soap/marshal/test_struct.rb new file mode 100644 index 0000000..33975c3 --- /dev/null +++ b/test/soap/marshal/test_struct.rb @@ -0,0 +1,47 @@ +require 'test/unit' +require 'soap/marshal' + + +module SOAP +module Marshal + + +Foo1 = ::Struct.new("Foo1", :m) +Foo2 = ::Struct.new(:m) +class Foo3 + attr_accessor :m +end + +class TestStruct < Test::Unit::TestCase + def test_foo1 + org = Foo1.new + org.m = org + obj = convert(org) + assert_equal(Foo1, obj.class) + assert_equal(obj.m, obj) + end + + def test_foo2 + org = Foo2.new + org.m = org + obj = convert(org) + assert_equal(Foo2, obj.class) + assert_equal(obj.m, obj) + end + + def test_foo3 + org = Foo3.new + org.m = org + obj = convert(org) + assert_equal(Foo3, obj.class) + assert_equal(obj.m, obj) + end + + def convert(obj) + SOAP::Marshal.unmarshal(SOAP::Marshal.marshal(obj)) + end +end + + +end +end diff --git a/test/soap/ssl/README b/test/soap/ssl/README new file mode 100644 index 0000000..927c738 --- /dev/null +++ b/test/soap/ssl/README @@ -0,0 +1 @@ +* certificates and keys in this directory is copied from httpclient test. diff --git a/test/soap/ssl/ca.cert b/test/soap/ssl/ca.cert new file mode 100644 index 0000000..bcabbee --- /dev/null +++ b/test/soap/ssl/ca.cert @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID0DCCArigAwIBAgIBADANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGDAJKUDES +MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxCzAJBgNVBAMMAkNBMB4X +DTA0MDEzMDAwNDIzMloXDTM2MDEyMjAwNDIzMlowPDELMAkGA1UEBgwCSlAxEjAQ +BgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMQswCQYDVQQDDAJDQTCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANbv0x42BTKFEQOE+KJ2XmiSdZpR +wjzQLAkPLRnLB98tlzs4xo+y4RyY/rd5TT9UzBJTIhP8CJi5GbS1oXEerQXB3P0d +L5oSSMwGGyuIzgZe5+vZ1kgzQxMEKMMKlzA73rbMd4Jx3u5+jdbP0EDrPYfXSvLY +bS04n2aX7zrN3x5KdDrNBfwBio2/qeaaj4+9OxnwRvYP3WOvqdW0h329eMfHw0pi +JI0drIVdsEqClUV4pebT/F+CPUPkEh/weySgo9wANockkYu5ujw2GbLFcO5LXxxm +dEfcVr3r6t6zOA4bJwL0W/e6LBcrwiG/qPDFErhwtgTLYf6Er67SzLyA66UCAwEA +AaOB3DCB2TAPBgNVHRMBAf8EBTADAQH/MDEGCWCGSAGG+EIBDQQkFiJSdWJ5L09w +ZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBRJ7Xd380KzBV7f +USKIQ+O/vKbhDzAOBgNVHQ8BAf8EBAMCAQYwZAYDVR0jBF0wW4AUSe13d/NCswVe +31EiiEPjv7ym4Q+hQKQ+MDwxCzAJBgNVBAYMAkpQMRIwEAYDVQQKDAlKSU4uR1Iu +SlAxDDAKBgNVBAsMA1JSUjELMAkGA1UEAwwCQ0GCAQAwDQYJKoZIhvcNAQEFBQAD +ggEBAIu/mfiez5XN5tn2jScgShPgHEFJBR0BTJBZF6xCk0jyqNx/g9HMj2ELCuK+ +r/Y7KFW5c5M3AQ+xWW0ZSc4kvzyTcV7yTVIwj2jZ9ddYMN3nupZFgBK1GB4Y05GY +MJJFRkSu6d/Ph5ypzBVw2YMT/nsOo5VwMUGLgS7YVjU+u/HNWz80J3oO17mNZllj +PvORJcnjwlroDnS58KoJ7GDgejv3ESWADvX1OHLE4cRkiQGeLoEU4pxdCxXRqX0U +PbwIkZN9mXVcrmPHq8MWi4eC/V7hnbZETMHuWhUoiNdOEfsAXr3iP4KjyyRdwc7a +d/xgcK06UVQRL/HbEYGiQL056mc= +-----END CERTIFICATE----- diff --git a/test/soap/ssl/client.cert b/test/soap/ssl/client.cert new file mode 100644 index 0000000..ad13c4b --- /dev/null +++ b/test/soap/ssl/client.cert @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDKDCCAhCgAwIBAgIBAjANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGDAJKUDES +MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxCzAJBgNVBAMMAkNBMB4X +DTA0MDEzMTAzMTQ1OFoXDTM1MDEyMzAzMTQ1OFowZTELMAkGA1UEBgwCSlAxEjAQ +BgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMRAwDgYDVQQDDAdleGFtcGxl +MSIwIAYJKoZIhvcNAQkBDBNleGFtcGxlQGV4YW1wbGUub3JnMIGfMA0GCSqGSIb3 +DQEBAQUAA4GNADCBiQKBgQDRWssrK8Gyr+500hpLjCGR3+AHL8/hEJM5zKi/MgLW +jTkvsgOwbYwXOiNtAbR9y4/ucDq7EY+cMUMHES4uFaPTcOaAV0aZRmk8AgslN1tQ +gNS6ew7/Luq3DcVeWkX8PYgR9VG0mD1MPfJ6+IFA5d3vKpdBkBgN4l46jjO0/2Xf +ewIDAQABo4GPMIGMMAwGA1UdEwEB/wQCMAAwMQYJYIZIAYb4QgENBCQWIlJ1Ynkv +T3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFOFvay0H7lr2 +xUx6waYEV2bVDYQhMAsGA1UdDwQEAwIF4DAdBgNVHSUEFjAUBggrBgEFBQcDAgYI +KwYBBQUHAwQwDQYJKoZIhvcNAQEFBQADggEBABd2dYWqbDIWf5sWFvslezxJv8gI +w64KCJBuyJAiDuf+oazr3016kMzAlt97KecLZDusGNagPrq02UX7YMoQFsWJBans +cDtHrkM0al5r6/WGexNMgtYbNTYzt/IwodISGBgZ6dsOuhznwms+IBsTNDAvWeLP +lt2tOqD8kEmjwMgn0GDRuKjs4EoboA3kMULb1p9akDV9ZESU3eOtpS5/G5J5msLI +9WXbYBjcjvkLuJH9VsJhb+R58Vl0ViemvAHhPilSl1SPWVunGhv6FcIkdBEi1k9F +e8BNMmsEjFiANiIRvpdLRbiGBt0KrKTndVfsmoKCvY48oCOvnzxtahFxfs8= +-----END CERTIFICATE----- diff --git a/test/soap/ssl/client.key b/test/soap/ssl/client.key new file mode 100644 index 0000000..37bc62f --- /dev/null +++ b/test/soap/ssl/client.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICWwIBAAKBgQDRWssrK8Gyr+500hpLjCGR3+AHL8/hEJM5zKi/MgLWjTkvsgOw +bYwXOiNtAbR9y4/ucDq7EY+cMUMHES4uFaPTcOaAV0aZRmk8AgslN1tQgNS6ew7/ +Luq3DcVeWkX8PYgR9VG0mD1MPfJ6+IFA5d3vKpdBkBgN4l46jjO0/2XfewIDAQAB +AoGAZcz8llWErtsV3QB9gNb3S/PNADGjqBFjReva8n3jG2k4sZSibpwWTwUaTNtT +ZQgjSRKRvH1hk9XwffNAvXAQZNNkuj/16gO2oO45nyLj4dO365ujLptWnVIWDHOE +uN0GeiZO+VzcCisT0WCq4tvtLeH8svrxzA8cbXIEyOK7NiECQQDwo2zPFyKAZ/Cu +lDJ6zKT+RjfWwW7DgWzirAlTrt4ViMaW+IaDH29TmQpb4V4NuR3Xi+2Xl4oicu6S +36TW9+/FAkEA3rgfOQJuLlWSnw1RTGwvnC816a/W7iYYY7B+0U4cDbfWl7IoXT4y +M8nV/HESooviZLqBwzAYSoj3fFKYBKpGPwJAUO8GN5iWWA2dW3ooiDiv/X1sZmRk +dojfMFWgRW747tEzya8Ivq0h6kH8w+5GjeMG8Gn1nRiwsulo6Ckj7dEx6QJACyui +7UIQ8qP6GZ4aYMHgVW4Mvy7Bkeo5OO7GPYs0Xv/EdJFL8vlGnVBXOjUVoS9w6Gpu +TbLg1QQvnX2rADjmEwJANxZO2GUkaWGsEif8aGW0x5g/IdaMGG27pTWk5zqix7P3 +1UDrdo/JOXhptovhRi06EppIxAxYmbh9vd9VN8Itlw== +-----END RSA PRIVATE KEY----- diff --git a/test/soap/ssl/server.cert b/test/soap/ssl/server.cert new file mode 100644 index 0000000..998ccc5 --- /dev/null +++ b/test/soap/ssl/server.cert @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIC/zCCAeegAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQGDAJKUDES +MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxDjAMBgNVBAMMBVN1YkNB +MB4XDTA0MDEzMTAzMTMxNloXDTMzMDEyMzAzMTMxNlowQzELMAkGA1UEBgwCSlAx +EjAQBgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMRIwEAYDVQQDDAlsb2Nh +bGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANFJTxWqup3nV9dsJAku +p+WaXnPNIzcpAA3qMGZDJTJsfa8Du7ZxTP0XJK5mETttBrn711cJxAuP3KjqnW9S +vtZ9lY2sXJ6Zj62sN5LwG3VVe25dI28yR1EsbHjJ5Zjf9tmggMC6am52dxuHbt5/ +vHo4ngJuKE/U+eeGRivMn6gFAgMBAAGjgYUwgYIwDAYDVR0TAQH/BAIwADAxBglg +hkgBhvhCAQ0EJBYiUnVieS9PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAd +BgNVHQ4EFgQUpZIyygD9JxFYHHOTEuWOLbCKfckwCwYDVR0PBAQDAgWgMBMGA1Ud +JQQMMAoGCCsGAQUFBwMBMA0GCSqGSIb3DQEBBQUAA4IBAQBwAIj5SaBHaA5X31IP +CFCJiep96awfp7RANO0cuUj+ZpGoFn9d6FXY0g+Eg5wAkCNIzZU5NHN9xsdOpnUo +zIBbyTfQEPrge1CMWMvL6uGaoEXytq84VTitF/xBTky4KtTn6+es4/e7jrrzeUXQ +RC46gkHObmDT91RkOEGjHLyld2328jo3DIN/VTHIryDeVHDWjY5dENwpwdkhhm60 +DR9IrNBbXWEe9emtguNXeN0iu1ux0lG1Hc6pWGQxMlRKNvGh0yZB9u5EVe38tOV0 +jQaoNyL7qzcQoXD3Dmbi1p0iRmg/+HngISsz8K7k7MBNVsSclztwgCzTZOBiVtkM +rRlQ +-----END CERTIFICATE----- diff --git a/test/soap/ssl/server.key b/test/soap/ssl/server.key new file mode 100644 index 0000000..9ba2218 --- /dev/null +++ b/test/soap/ssl/server.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDRSU8Vqrqd51fXbCQJLqflml5zzSM3KQAN6jBmQyUybH2vA7u2 +cUz9FySuZhE7bQa5+9dXCcQLj9yo6p1vUr7WfZWNrFyemY+trDeS8Bt1VXtuXSNv +MkdRLGx4yeWY3/bZoIDAumpudncbh27ef7x6OJ4CbihP1PnnhkYrzJ+oBQIDAQAB +AoGBAIf4CstW2ltQO7+XYGoex7Hh8s9lTSW/G2vu5Hbr1LTHy3fzAvdq8MvVR12O +rk9fa+lU9vhzPc0NMB0GIDZ9GcHuhW5hD1Wg9OSCbTOkZDoH3CAFqonjh4Qfwv5W +IPAFn9KHukdqGXkwEMdErsUaPTy9A1V/aROVEaAY+HJgq/eZAkEA/BP1QMV04WEZ +Oynzz7/lLizJGGxp2AOvEVtqMoycA/Qk+zdKP8ufE0wbmCE3Qd6GoynavsHb6aGK +gQobb8zDZwJBANSK6MrXlrZTtEaeZuyOB4mAmRzGzOUVkUyULUjEx2GDT93ujAma +qm/2d3E+wXAkNSeRpjUmlQXy/2oSqnGvYbMCQQDRM+cYyEcGPUVpWpnj0shrF/QU +9vSot/X1G775EMTyaw6+BtbyNxVgOIu2J+rqGbn3c+b85XqTXOPL0A2RLYkFAkAm +syhSDtE9X55aoWsCNZY/vi+i4rvaFoQ/WleogVQAeGVpdo7/DK9t9YWoFBIqth0L +mGSYFu9ZhvZkvQNV8eYrAkBJ+rOIaLDsmbrgkeDruH+B/9yrm4McDtQ/rgnOGYnH +LjLpLLOrgUxqpzLWe++EwSLwK2//dHO+SPsQJ4xsyQJy +-----END RSA PRIVATE KEY----- diff --git a/test/soap/ssl/sslsvr.rb b/test/soap/ssl/sslsvr.rb new file mode 100644 index 0000000..4f67eb9 --- /dev/null +++ b/test/soap/ssl/sslsvr.rb @@ -0,0 +1,57 @@ +require 'webrick/https' +require 'logger' +require 'rbconfig' + +require 'soap/rpc/httpserver' + +class HelloWorldServer < SOAP::RPC::HTTPServer +private + + def on_init + self.level = Logger::Severity::FATAL + @default_namespace = 'urn:ssltst' + add_method(self, 'hello_world', 'from') + end + + def hello_world(from) + "Hello World, from #{ from }" + end +end + + +if $0 == __FILE__ + PORT = 17171 + DIR = File.dirname(File.expand_path(__FILE__)) + + def cert(filename) + OpenSSL::X509::Certificate.new(File.open(File.join(DIR, filename)) { |f| + f.read + }) + end + + def key(filename) + OpenSSL::PKey::RSA.new(File.open(File.join(DIR, filename)) { |f| + f.read + }) + end + + $server = HelloWorldServer.new( + :BindAddress => "0.0.0.0", + :Port => PORT, + :AccessLog => [], + :SSLEnable => true, + :SSLCACertificateFile => File.join(DIR, 'ca.cert'), + :SSLCertificate => cert('server.cert'), + :SSLPrivateKey => key('server.key'), + :SSLVerifyClient => nil, #OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT|OpenSSL::SSL::VERIFY_PEER, + :SSLClientCA => cert('ca.cert'), + :SSLCertName => nil + ) + t = Thread.new { + Thread.current.abort_on_exception = true + $server.start + } + STDOUT.sync = true + puts $$ + t.join +end diff --git a/test/soap/ssl/subca.cert b/test/soap/ssl/subca.cert new file mode 100644 index 0000000..1e47185 --- /dev/null +++ b/test/soap/ssl/subca.cert @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDaDCCAlCgAwIBAgIBATANBgkqhkiG9w0BAQUFADA8MQswCQYDVQQGDAJKUDES +MBAGA1UECgwJSklOLkdSLkpQMQwwCgYDVQQLDANSUlIxCzAJBgNVBAMMAkNBMB4X +DTA0MDEzMDAwNDMyN1oXDTM1MDEyMjAwNDMyN1owPzELMAkGA1UEBgwCSlAxEjAQ +BgNVBAoMCUpJTi5HUi5KUDEMMAoGA1UECwwDUlJSMQ4wDAYDVQQDDAVTdWJDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ0Ou7AyRcRXnB/kVHv/6kwe +ANzgg/DyJfsAUqW90m7Lu1nqyug8gK0RBd77yU0w5HOAMHTVSdpjZK0g2sgx4Mb1 +d/213eL9TTl5MRVEChTvQr8q5DVG/8fxPPE7fMI8eOAzd98/NOAChk+80r4Sx7fC +kGVEE1bKwY1MrUsUNjOY2d6t3M4HHV3HX1V8ShuKfsHxgCmLzdI8U+5CnQedFgkm +3e+8tr8IX5RR1wA1Ifw9VadF7OdI/bGMzog/Q8XCLf+WPFjnK7Gcx6JFtzF6Gi4x +4dp1Xl45JYiVvi9zQ132wu8A1pDHhiNgQviyzbP+UjcB/tsOpzBQF8abYzgEkWEC +AwEAAaNyMHAwDwYDVR0TAQH/BAUwAwEB/zAxBglghkgBhvhCAQ0EJBYiUnVieS9P +cGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUlCjXWLsReYzH +LzsxwVnCXmKoB/owCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQCJ/OyN +rT8Cq2Y+G2yA/L1EMRvvxwFBqxavqaqHl/6rwsIBFlB3zbqGA/0oec6MAVnYynq4 +c4AcHTjx3bQ/S4r2sNTZq0DH4SYbQzIobx/YW8PjQUJt8KQdKMcwwi7arHP7A/Ha +LKu8eIC2nsUBnP4NhkYSGhbmpJK+PFD0FVtD0ZIRlY/wsnaZNjWWcnWF1/FNuQ4H +ySjIblqVQkPuzebv3Ror6ZnVDukn96Mg7kP4u6zgxOeqlJGRe1M949SS9Vudjl8X +SF4aZUUB9pQGhsqQJVqaz2OlhGOp9D0q54xko/rekjAIcuDjl1mdX4F2WRrzpUmZ +uY/bPeOBYiVsOYVe +-----END CERTIFICATE----- diff --git a/test/soap/ssl/test_ssl.rb b/test/soap/ssl/test_ssl.rb new file mode 100644 index 0000000..8da4e5e --- /dev/null +++ b/test/soap/ssl/test_ssl.rb @@ -0,0 +1,235 @@ +require 'test/unit' +begin + require 'httpclient' +rescue LoadError +end +require 'soap/rpc/driver' + +if defined?(HTTPClient) and defined?(OpenSSL) + +module SOAP; module SSL + + +class TestSSL < Test::Unit::TestCase + PORT = 17171 + + DIR = File.dirname(File.expand_path(__FILE__)) + require 'rbconfig' + RUBY = File.join( + Config::CONFIG["bindir"], + Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"] + ) + + def setup + @url = "https://localhost:#{PORT}/hello" + @serverpid = @client = nil + @verify_callback_called = false + setup_server + setup_client + end + + def teardown + teardown_client + teardown_server + end + + def test_options + cfg = @client.streamhandler.client.ssl_config + assert_nil(cfg.client_cert) + assert_nil(cfg.client_key) + assert_nil(cfg.client_ca) + assert_equal(OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT, cfg.verify_mode) + assert_nil(cfg.verify_callback) + assert_nil(cfg.timeout) + assert_equal(OpenSSL::SSL::OP_ALL | OpenSSL::SSL::OP_NO_SSLv2, cfg.options) + assert_equal("ALL:!ADH:!LOW:!EXP:!MD5:+SSLv2:@STRENGTH", cfg.ciphers) + assert_instance_of(OpenSSL::X509::Store, cfg.cert_store) + # dummy call to ensure sslsvr initialization finished. + assert_raise(OpenSSL::SSL::SSLError) do + @client.hello_world("ssl client") + end + end + + def test_verification + cfg = @client.options + cfg["protocol.http.ssl_config.verify_callback"] = method(:verify_callback).to_proc + begin + @verify_callback_called = false + @client.hello_world("ssl client") + assert(false) + rescue OpenSSL::SSL::SSLError => ssle + assert(/certificate verify failed/ =~ ssle.message) + assert(@verify_callback_called) + end + # + cfg["protocol.http.ssl_config.client_cert"] = File.join(DIR, "client.cert") + cfg["protocol.http.ssl_config.client_key"] = File.join(DIR, "client.key") + @verify_callback_called = false + begin + @client.hello_world("ssl client") + assert(false) + rescue OpenSSL::SSL::SSLError => ssle + assert(/certificate verify failed/ =~ ssle.message) + assert(@verify_callback_called) + end + # + cfg["protocol.http.ssl_config.ca_file"] = File.join(DIR, "ca.cert") + @verify_callback_called = false + begin + @client.hello_world("ssl client") + assert(false) + rescue OpenSSL::SSL::SSLError => ssle + assert(/certificate verify failed/ =~ ssle.message) + assert(@verify_callback_called) + end + # + cfg["protocol.http.ssl_config.ca_file"] = File.join(DIR, "subca.cert") + @verify_callback_called = false + assert_equal("Hello World, from ssl client", @client.hello_world("ssl client")) + assert(@verify_callback_called) + # + cfg["protocol.http.ssl_config.verify_depth"] = "1" + @verify_callback_called = false + begin + @client.hello_world("ssl client") + assert(false) + rescue OpenSSL::SSL::SSLError => ssle + assert(/certificate verify failed/ =~ ssle.message) + assert(@verify_callback_called) + end + # + cfg["protocol.http.ssl_config.verify_depth"] = "" + cfg["protocol.http.ssl_config.cert_store"] = OpenSSL::X509::Store.new + cfg["protocol.http.ssl_config.verify_mode"] = OpenSSL::SSL::VERIFY_PEER.to_s + begin + @client.hello_world("ssl client") + assert(false) + rescue OpenSSL::SSL::SSLError => ssle + assert(/certificate verify failed/ =~ ssle.message) + end + # + cfg["protocol.http.ssl_config.verify_mode"] = "" + assert_equal("Hello World, from ssl client", @client.hello_world("ssl client")) + end + + def test_property + testpropertyname = File.join(DIR, 'soapclient.properties') + File.open(testpropertyname, "w") do |f| + f <<<<__EOP__ +protocol.http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_PEER +# depth: 1 causes an error (intentional) +protocol.http.ssl_config.verify_depth = 1 +protocol.http.ssl_config.client_cert = #{File.join(DIR, 'client.cert')} +protocol.http.ssl_config.client_key = #{File.join(DIR, 'client.key')} +protocol.http.ssl_config.ca_file = #{File.join(DIR, 'ca.cert')} +protocol.http.ssl_config.ca_file = #{File.join(DIR, 'subca.cert')} +protocol.http.ssl_config.ciphers = ALL +__EOP__ + end + begin + @client.loadproperty(testpropertyname) + @client.options["protocol.http.ssl_config.verify_callback"] = method(:verify_callback).to_proc + @verify_callback_called = false + # NG with String + begin + @client.hello_world("ssl client") + assert(false) + rescue OpenSSL::SSL::SSLError => ssle + assert(/certificate verify failed/ =~ ssle.message) + assert(@verify_callback_called) + end + # NG with Integer + @client.options["protocol.http.ssl_config.verify_depth"] = 0 + begin + @client.hello_world("ssl client") + assert(false) + rescue OpenSSL::SSL::SSLError => ssle + assert(/certificate verify failed/ =~ ssle.message) + assert(@verify_callback_called) + end + # OK with empty + @client.options["protocol.http.ssl_config.verify_depth"] = "" + @verify_callback_called = false + assert_equal("Hello World, from ssl client", @client.hello_world("ssl client")) + assert(@verify_callback_called) + # OK with nil + @client.options["protocol.http.ssl_config.verify_depth"] = nil + @verify_callback_called = false + assert_equal("Hello World, from ssl client", @client.hello_world("ssl client")) + assert(@verify_callback_called) + # OK with String + @client.options["protocol.http.ssl_config.verify_depth"] = "3" + @verify_callback_called = false + assert_equal("Hello World, from ssl client", @client.hello_world("ssl client")) + assert(@verify_callback_called) + # OK with Integer + @client.options["protocol.http.ssl_config.verify_depth"] = 3 + @verify_callback_called = false + assert_equal("Hello World, from ssl client", @client.hello_world("ssl client")) + assert(@verify_callback_called) + ensure + File.unlink(testpropertyname) + end + end + + def test_ciphers + cfg = @client.options + cfg["protocol.http.ssl_config.client_cert"] = File.join(DIR, 'client.cert') + cfg["protocol.http.ssl_config.client_key"] = File.join(DIR, 'client.key') + cfg["protocol.http.ssl_config.ca_file"] = File.join(DIR, "ca.cert") + cfg["protocol.http.ssl_config.ca_file"] = File.join(DIR, "subca.cert") + #cfg.timeout = 123 + cfg["protocol.http.ssl_config.ciphers"] = "!ALL" + # + begin + @client.hello_world("ssl client") + assert(false) + rescue OpenSSL::SSL::SSLError => ssle + # depends on OpenSSL version. (?:0.9.8|0.9.7) + assert_match(/\A(?:SSL_CTX_set_cipher_list:: no cipher match|no ciphers available)\z/, ssle.message) + end + # + cfg["protocol.http.ssl_config.ciphers"] = "ALL" + assert_equal("Hello World, from ssl client", @client.hello_world("ssl client")) + end + +private + + def q(str) + %Q["#{str}"] + end + + def setup_server + svrcmd = "#{q(RUBY)} " + svrcmd << File.join(DIR, "sslsvr.rb") + svrout = IO.popen(svrcmd) + @serverpid = Integer(svrout.gets.chomp) + end + + def setup_client + @client = SOAP::RPC::Driver.new(@url, 'urn:ssltst') + @client.add_method("hello_world", "from") + end + + def teardown_server + if @serverpid + Process.kill('KILL', @serverpid) + Process.waitpid(@serverpid) + end + end + + def teardown_client + @client.reset_stream if @client + end + + def verify_callback(ok, cert) + @verify_callback_called = true + p ["client", ok, cert] if $DEBUG + ok + end +end + + +end; end + +end diff --git a/test/soap/struct/test_struct.rb b/test/soap/struct/test_struct.rb new file mode 100644 index 0000000..a47f8b5 --- /dev/null +++ b/test/soap/struct/test_struct.rb @@ -0,0 +1,70 @@ +require 'test/unit' +require 'soap/rpc/httpserver' +require 'soap/rpc/driver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module SOAP; module Struct + + +class TestStruct < Test::Unit::TestCase + Namespace = "urn:example.com:simpletype-rpc" + class Server < ::SOAP::RPC::HTTPServer + @@test_struct = ::Struct.new(:one, :two) + + def on_init + add_method(self, 'a_method') + end + + def a_method + @@test_struct.new("string", 1) + end + end + + Port = 17171 + + def setup + setup_server + setup_client + end + + def setup_server + @server = Server.new( + :Port => Port, + :BindAddress => "0.0.0.0", + :AccessLog => [], + :SOAPDefaultNamespace => Namespace + ) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_client + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/", Namespace) + @client.wiredump_dev = STDERR if $DEBUG + @client.add_method('a_method') + end + + def teardown + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def teardown_client + @client.reset_stream + end + + def test_struct + assert_equal("string", @client.a_method.one) + assert_equal(1, @client.a_method.two) + end +end + + +end; end diff --git a/test/soap/styleuse/client.rb b/test/soap/styleuse/client.rb new file mode 100644 index 0000000..57fe569 --- /dev/null +++ b/test/soap/styleuse/client.rb @@ -0,0 +1,20 @@ +require 'soap/rpc/driver' + +server = 'http://localhost:7000/' + +app = SOAP::RPC::Driver.new(server, 'urn:styleuse') +app.add_rpc_method('rpc_serv', 'obj1', 'obj2') +app.add_document_method('doc_serv', 'urn:doc_serv#doc_serv', + [XSD::QName.new('urn:styleuse', 'req')], + [XSD::QName.new('urn:styleuse', 'res')]) +app.add_document_method('doc_serv2', 'urn:doc_serv#doc_serv2', + [XSD::QName.new('urn:styleuse', 'req')], + [XSD::QName.new('urn:styleuse', 'res')]) +app.wiredump_dev = STDOUT + +p app.rpc_serv(true, false) +p app.rpc_serv("foo", "bar") +p app.doc_serv({"a" => "2"}) +p app.doc_serv({"a" => {"b" => "2"}}) +p app.doc_serv2({"a" => "2"}) +p app.doc_serv2({"a" => {"b" => "2"}}) diff --git a/test/soap/styleuse/server.rb b/test/soap/styleuse/server.rb new file mode 100644 index 0000000..6e61c41 --- /dev/null +++ b/test/soap/styleuse/server.rb @@ -0,0 +1,86 @@ +#!/usr/bin/env ruby + +require 'soap/rpc/standaloneServer' + +class Server < SOAP::RPC::StandaloneServer + class RpcServant + def rpc_serv(obj1, obj2) + [obj1, obj2] + end + end + + class DocumentServant + def doc_serv(hash) + hash + end + + def doc_serv2(hash) + { 'newroot' => hash } + end + end + + class GenericServant + + # method name style: requeststyle_requestuse_responsestyle_responseuse + + def rpc_enc_rpc_enc(obj1, obj2) + [obj1, obj2] + end + + alias rpc_enc_rpc_lit rpc_enc_rpc_enc + + def rpc_enc_doc_enc(obj1, obj2) + obj1 + end + + alias rpc_enc_doc_lit rpc_enc_doc_enc + + def doc_enc_rpc_enc(obj) + [obj, obj] + end + + alias doc_enc_rpc_lit doc_enc_rpc_enc + + def doc_enc_doc_enc(obj) + obj + end + + alias doc_enc_doc_lit doc_enc_doc_enc + end + + def initialize(*arg) + super + rpcservant = RpcServant.new + docservant = DocumentServant.new + add_rpc_servant(rpcservant) + add_document_method(docservant, 'urn:doc_serv#doc_serv', 'doc_serv', + [XSD::QName.new('urn:styleuse', 'req')], + [XSD::QName.new('urn:styleuse', 'res')]) + add_document_method(docservant, 'urn:doc_serv#doc_serv2', 'doc_serv2', + [XSD::QName.new('urn:styleuse', 'req')], + [XSD::QName.new('urn:styleuse', 'res')]) + + #servant = Servant.new + # ToDo: too plain: should add bare test case + #qname ||= XSD::QName.new(@default_namespace, name) + #add_operation(qname, nil, servant, "rpc_enc_rpc_enc", param_def, + # opt(:rpc, :rpc, :encoded, :encoded)) + end + + def opt(request_style, request_use, response_style, response_use) + { + :request_style => request_style, + :request_use => request_use, + :response_style => response_style, + :response_use => response_use + } + end +end + +if $0 == __FILE__ + server = Server.new('Server', 'urn:styleuse', '0.0.0.0', 7000) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/test/soap/swa/test_file.rb b/test/soap/swa/test_file.rb new file mode 100644 index 0000000..7f8079c --- /dev/null +++ b/test/soap/swa/test_file.rb @@ -0,0 +1,75 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'soap/rpc/standaloneServer' +require 'soap/attachment' + + +module SOAP +module SWA + + +class TestFile < Test::Unit::TestCase + Port = 17171 + THIS_FILE = File.expand_path(__FILE__) + + class SwAService + def get_file + return { + 'name' => $0, + 'file' => SOAP::Attachment.new(File.open(THIS_FILE)) # closed when GCed. + } + end + + def put_file(name, file) + "File '#{name}' was received ok." + end + end + + def setup + @server = SOAP::RPC::StandaloneServer.new('SwAServer', + 'http://www.acmetron.com/soap', '0.0.0.0', Port) + @server.add_servant(SwAService.new) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + @server.start + } + @endpoint = "http://localhost:#{Port}/" + @client = SOAP::RPC::Driver.new(@endpoint, 'http://www.acmetron.com/soap') + @client.add_method('get_file') + @client.add_method('put_file', 'name', 'file') + @client.wiredump_dev = STDERR if $DEBUG + end + + def teardown + @server.shutdown if @server + if @t + @t.kill + @t.join + end + @client.reset_stream if @client + end + + def test_get_file + assert_equal( + File.open(THIS_FILE) { |f| f.read }, + @client.get_file['file'].content + ) + end + + def test_put_file + assert_equal( + "File 'foo' was received ok.", + @client.put_file('foo', + SOAP::Attachment.new(File.open(THIS_FILE))) + ) + assert_equal( + "File 'bar' was received ok.", + @client.put_file('bar', + SOAP::Attachment.new(File.open(THIS_FILE) { |f| f.read })) + ) + end +end + + +end +end diff --git a/test/soap/test_basetype.rb b/test/soap/test_basetype.rb new file mode 100644 index 0000000..1101b0e --- /dev/null +++ b/test/soap/test_basetype.rb @@ -0,0 +1,1090 @@ +require 'test/unit' +require 'soap/baseData' + + +module SOAP + + +class TestSOAP < Test::Unit::TestCase + NegativeZero = (-1.0 / (1.0 / 0.0)) + + def setup + # Nothing to do. + end + + def teardown + # Nothing to do. + end + + def assert_parsed_result(klass, str) + o = klass.new(str) + assert_equal(str, o.to_s) + end + + def test_SOAPNil + o = SOAP::SOAPNil.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::NilLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + o = SOAP::SOAPNil.new(nil) + assert_equal(true, o.is_nil) + assert_equal(nil, o.data) + assert_equal("", o.to_s) + o = SOAP::SOAPNil.new('var') + assert_equal(false, o.is_nil) + assert_equal('var', o.data) + assert_equal('var', o.to_s) + end + + def test_SOAPString + o = SOAP::SOAPString.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::StringLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + str = "abc" + assert_equal(str, SOAP::SOAPString.new(str).data) + assert_equal(str, SOAP::SOAPString.new(str).to_s) + back = XSD::XSDString.strict_ces_validation + XSD::XSDString.strict_ces_validation = true + begin + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPString.new("\0") + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPString.new("\xC0\xC0").to_s + end + ensure + XSD::XSDString.strict_ces_validation = back + end + end + + def test_SOAPNormalizedString + XSD::Charset.module_eval { @encoding_backup = @internal_encoding; @internal_encoding = "NONE" } + begin + o = SOAP::SOAPNormalizedString.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::NormalizedStringLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + str = "abc" + assert_equal(str, SOAP::SOAPNormalizedString.new(str).data) + assert_equal(str, SOAP::SOAPNormalizedString.new(str).to_s) + back = SOAP::SOAPString.strict_ces_validation + SOAP::SOAPString.strict_ces_validation = true + begin + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPNormalizedString.new("\0") + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPNormalizedString.new("\xC0\xC0").to_s + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPNormalizedString.new("a\tb").to_s + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPNormalizedString.new("a\r").to_s + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPNormalizedString.new("\nb").to_s + end + ensure + SOAP::SOAPString.strict_ces_validation = back + end + ensure + XSD::Charset.module_eval { @internal_encoding = @encoding_backup } + end + end + + def test_SOAPToken + XSD::Charset.module_eval { @encoding_backup = @internal_encoding; @internal_encoding = "NONE" } + begin + o = SOAP::SOAPToken.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::TokenLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + str = "abc" + assert_equal(str, SOAP::SOAPToken.new(str).data) + assert_equal(str, SOAP::SOAPToken.new(str).to_s) + back = XSD::XSDString.strict_ces_validation + XSD::XSDString.strict_ces_validation = true + begin + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPToken.new("\0") + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPToken.new("\xC0\xC0").to_s + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPToken.new("a\tb").to_s + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPToken.new("a\r").to_s + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPToken.new("\nb").to_s + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPToken.new(" a").to_s + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPToken.new("b ").to_s + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPToken.new("a b").to_s + end + assert_equal("a b", SOAP::SOAPToken.new("a b").data) + ensure + XSD::XSDString.strict_ces_validation = back + end + ensure + XSD::Charset.module_eval { @internal_encoding = @encoding_backup } + end + end + + def test_SOAPLanguage + o = SOAP::SOAPLanguage.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::LanguageLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + str = "ja" + assert_equal(str, SOAP::SOAPLanguage.new(str).data) + assert_equal(str, SOAP::SOAPLanguage.new(str).to_s) + str = "ja-jp" + assert_equal(str, SOAP::SOAPLanguage.new(str).data) + assert_equal(str, SOAP::SOAPLanguage.new(str).to_s) + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPLanguage.new("ja-jp-") + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPLanguage.new("-ja-") + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPLanguage.new("ja-") + end + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPLanguage.new("a1-01") + end + assert_equal("aA-01", SOAP::SOAPLanguage.new("aA-01").to_s) + end + + def test_SOAPBoolean + o = SOAP::SOAPBoolean.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::BooleanLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + ["true", true], + ["1", true], + ["false", false], + ["0", false], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPBoolean.new(data).data) + assert_equal(expected.to_s, SOAP::SOAPBoolean.new(data).to_s) + end + + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPBoolean.new("nil").to_s + end + end + + def test_SOAPDecimal + o = SOAP::SOAPDecimal.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::DecimalLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 1000000000, + -9999999999, + 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890, + 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890, + -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789, + ] + targets.each do |dec| + assert_equal(dec.to_s, SOAP::SOAPDecimal.new(dec).data) + end + + targets = [ + "0", + "0.00000001", + "1000000000", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123.45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789", + ] + targets.each do |str| + assert_equal(str, SOAP::SOAPDecimal.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["0.0", "0"], + ["-0.0", "0"], + ["+0.0", "0"], + ["0.", "0"], + [".0", "0"], + [ + "+0.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "0.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + ], + [ + ".0000012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "0.000001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + ], + [ + "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.", + "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" + ], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPDecimal.new(data).to_s) + end + + targets = [ + "0.000000000000a", + "00a.0000000000001", + "+-5", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPDecimal.new(d) + end + end + end + + def test_SOAPFloat + o = SOAP::SOAPFloat.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::FloatLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 3.14159265358979, + 12.34e36, + 1.402e-45, + -1.402e-45, + ] + targets.each do |f| + assert_equal(f, SOAP::SOAPFloat.new(f).data) + end + + targets = [ + "+3.141592654", + "+1.234e+37", + "+1.402e-45", + "-1.402e-45", + ] + targets.each do |f| + assert_equal(f, SOAP::SOAPFloat.new(f).to_s) + end + + targets = [ + [3, "+3"], # should be 3.0? + [-2, "-2"], # ditto + [3.14159265358979, "+3.141592654"], + [12.34e36, "+1.234e+37"], + [1.402e-45, "+1.402e-45"], + [-1.402e-45, "-1.402e-45"], + ["1.402e", "+1.402"], + ["12.34E36", "+1.234e+37"], + ["1.402E-45", "+1.402e-45"], + ["-1.402E-45", "-1.402e-45"], + ["1.402E", "+1.402"], + ] + targets.each do |f, str| + assert_equal(str, SOAP::SOAPFloat.new(f).to_s) + end + + assert_equal("+0", SOAP::SOAPFloat.new(+0.0).to_s) + assert_equal("-0", SOAP::SOAPFloat.new(NegativeZero).to_s) + assert(SOAP::SOAPFloat.new(0.0/0.0).data.nan?) + assert_equal("INF", SOAP::SOAPFloat.new(1.0/0.0).to_s) + assert_equal(1, SOAP::SOAPFloat.new(1.0/0.0).data.infinite?) + assert_equal("-INF", SOAP::SOAPFloat.new(-1.0/0.0).to_s) + assert_equal(-1, SOAP::SOAPFloat.new(-1.0/0.0).data.infinite?) + + targets = [ + "0.000000000000a", + "00a.0000000000001", + "+-5", + "5_0", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPFloat.new(d) + end + end + end + + def test_SOAPDouble + o = SOAP::SOAPDouble.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::DoubleLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 3.14159265358979, + 12.34e36, + 1.402e-45, + -1.402e-45, + ] + targets.each do |f| + assert_equal(f, SOAP::SOAPDouble.new(f).data) + end + + targets = [ + "+3.14159265358979", + "+1.234e+37", + "+1.402e-45", + "-1.402e-45", + ] + targets.each do |f| + assert_equal(f, SOAP::SOAPDouble.new(f).to_s) + end + + targets = [ + [3, "+3"], # should be 3.0? + [-2, "-2"], # ditto. + [3.14159265358979, "+3.14159265358979"], + [12.34e36, "+1.234e+37"], + [1.402e-45, "+1.402e-45"], + [-1.402e-45, "-1.402e-45"], + ["1.402e", "+1.402"], + ["12.34E36", "+1.234e+37"], + ["1.402E-45", "+1.402e-45"], + ["-1.402E-45", "-1.402e-45"], + ["1.402E", "+1.402"], + ] + targets.each do |f, str| + assert_equal(str, SOAP::SOAPDouble.new(f).to_s) + end + + assert_equal("+0", SOAP::SOAPFloat.new(+0.0).to_s) + assert_equal("-0", SOAP::SOAPFloat.new(NegativeZero).to_s) + assert_equal("NaN", SOAP::SOAPDouble.new(0.0/0.0).to_s) + assert(SOAP::SOAPDouble.new(0.0/0.0).data.nan?) + assert_equal("INF", SOAP::SOAPDouble.new(1.0/0.0).to_s) + assert_equal(1, SOAP::SOAPDouble.new(1.0/0.0).data.infinite?) + assert_equal("-INF", SOAP::SOAPDouble.new(-1.0/0.0).to_s) + assert_equal(-1, SOAP::SOAPDouble.new(-1.0/0.0).data.infinite?) + + targets = [ + "0.000000000000a", + "00a.0000000000001", + "+-5", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPDouble.new(d) + end + end + end + + def test_SOAPDuration + o = SOAP::SOAPDuration.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::DurationLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "P1Y2M3DT4H5M6S", + "P1234Y5678M9012DT3456H7890M1234.5678S", + "PT3456H7890M1234.5678S", + "P1234Y5678M9012D", + "-P1234Y5678M9012DT3456H7890M1234.5678S", + "P5678M9012DT3456H7890M1234.5678S", + "-P1234Y9012DT3456H7890M1234.5678S", + "+P1234Y5678MT3456H7890M1234.5678S", + "P1234Y5678M9012DT7890M1234.5678S", + "-P1234Y5678M9012DT3456H1234.5678S", + "+P1234Y5678M9012DT3456H7890M", + "P123400000000000Y", + "-P567800000000000M", + "+P901200000000000D", + "PT345600000000000H", + "-PT789000000000000M", + "+PT123400000000000.000000000005678S", + "P1234YT1234.5678S", + "-P5678MT7890M", + "+P9012DT3456H", + ] + targets.each do |str| + assert_parsed_result(SOAP::SOAPDuration, str) + end + + targets = [ + ["P0Y0M0DT0H0M0S", + "P0D"], + ["-P0DT0S", + "-P0D"], + ["P01234Y5678M9012DT3456H7890M1234.5678S", + "P1234Y5678M9012DT3456H7890M1234.5678S"], + ["P1234Y005678M9012DT3456H7890M1234.5678S", + "P1234Y5678M9012DT3456H7890M1234.5678S"], + ["P1234Y5678M0009012DT3456H7890M1234.5678S", + "P1234Y5678M9012DT3456H7890M1234.5678S"], + ["P1234Y5678M9012DT00003456H7890M1234.5678S", + "P1234Y5678M9012DT3456H7890M1234.5678S"], + ["P1234Y5678M9012DT3456H000007890M1234.5678S", + "P1234Y5678M9012DT3456H7890M1234.5678S"], + ["P1234Y5678M9012DT3456H7890M0000001234.5678S", + "P1234Y5678M9012DT3456H7890M1234.5678S"], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPDuration.new(data).to_s) + end + end + + def test_SOAPDateTime + o = SOAP::SOAPDateTime.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::DateTimeLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "2002-05-18T16:52:20Z", + "0001-01-01T00:00:00Z", + "9999-12-31T23:59:59Z", + "19999-12-31T23:59:59Z", + "2002-12-31T23:59:59.999Z", + "2002-12-31T23:59:59.001Z", + "2002-12-31T23:59:59.99999999999999999999Z", + "2002-12-31T23:59:59.00000000000000000001Z", + "2002-12-31T23:59:59+09:00", + "2002-12-31T23:59:59+00:01", + "2002-12-31T23:59:59-00:01", + "2002-12-31T23:59:59-23:59", + "2002-12-31T23:59:59.00000000000000000001+13:30", + "2002-12-31T23:59:59.51375Z", + "2002-12-31T23:59:59.51345+12:34", + "-2002-05-18T16:52:20Z", + "-4711-12-31T23:59:59Z", + "-4713-01-01T12:00:00Z", + "-19999-12-31T23:59:59Z", + "-2002-12-31T23:59:59+00:01", + "-0001-12-31T23:59:59.00000000000000000001+13:30", + ] + targets.each do |str| + assert_parsed_result(SOAP::SOAPDateTime, str) + end + + targets = [ + ["2002-12-31T23:59:59.00", + "2002-12-31T23:59:59Z"], + ["2002-12-31T23:59:59+00:00", + "2002-12-31T23:59:59Z"], + ["2002-12-31T23:59:59-00:00", + "2002-12-31T23:59:59Z"], + ["-2002-12-31T23:59:59.00", + "-2002-12-31T23:59:59Z"], + ["-2002-12-31T23:59:59+00:00", + "-2002-12-31T23:59:59Z"], + ["-2002-12-31T23:59:59-00:00", + "-2002-12-31T23:59:59Z"], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPDateTime.new(data).to_s) + d = DateTime.parse(data) + d >>= 12 if d.year < 0 # XSDDateTime.year(-1) == DateTime.year(0) + assert_equal(expected, SOAP::SOAPDateTime.new(d).to_s) + end + + targets = [ + "1-05-18T16:52:20Z", + "05-18T16:52:20Z", + "2002-05T16:52:20Z", + "2002-05-18T16:52Z", + "", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError, d.to_s) do + SOAP::SOAPDateTime.new(d) + end + end + end + + def test_SOAPTime + o = SOAP::SOAPTime.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::TimeLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "16:52:20Z", + "00:00:00Z", + "23:59:59Z", + "23:59:59.999Z", + "23:59:59.001Z", + "23:59:59.99999999999999999999Z", + "23:59:59.00000000000000000001Z", + "23:59:59+09:00", + "23:59:59+00:01", + "23:59:59-00:01", + "23:59:59-23:59", + "23:59:59.00000000000000000001+13:30", + "23:59:59.51375Z", + "23:59:59.51375+12:34", + "23:59:59+00:01", + ] + targets.each do |str| + assert_parsed_result(SOAP::SOAPTime, str) + end + + targets = [ + ["23:59:59.00", + "23:59:59Z"], + ["23:59:59+00:00", + "23:59:59Z"], + ["23:59:59-00:00", + "23:59:59Z"], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPTime.new(data).to_s) + end + end + + def test_SOAPDate + o = SOAP::SOAPDate.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::DateLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "2002-05-18Z", + "0001-01-01Z", + "9999-12-31Z", + "19999-12-31Z", + "2002-12-31+09:00", + "2002-12-31+00:01", + "2002-12-31-00:01", + "2002-12-31-23:59", + "2002-12-31+13:30", + "-2002-05-18Z", + "-19999-12-31Z", + "-2002-12-31+00:01", + "-0001-12-31+13:30", + ] + targets.each do |str| + assert_parsed_result(SOAP::SOAPDate, str) + end + + targets = [ + ["2002-12-31", + "2002-12-31Z"], + ["2002-12-31+00:00", + "2002-12-31Z"], + ["2002-12-31-00:00", + "2002-12-31Z"], + ["-2002-12-31", + "-2002-12-31Z"], + ["-2002-12-31+00:00", + "-2002-12-31Z"], + ["-2002-12-31-00:00", + "-2002-12-31Z"], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPDate.new(data).to_s) + d = Date.parse(data) + d >>= 12 if d.year < 0 # XSDDate.year(-1) == Date.year(0) + assert_equal(expected, SOAP::SOAPDate.new(d).to_s) + end + end + + def test_SOAPGYearMonth + o = SOAP::SOAPGYearMonth.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::GYearMonthLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "2002-05Z", + "0001-01Z", + "9999-12Z", + "19999-12Z", + "2002-12+09:00", + "2002-12+00:01", + "2002-12-00:01", + "2002-12-23:59", + "2002-12+13:30", + "-2002-05Z", + "-19999-12Z", + "-2002-12+00:01", + "-0001-12+13:30", + ] + targets.each do |str| + assert_parsed_result(SOAP::SOAPGYearMonth, str) + end + + targets = [ + ["2002-12", + "2002-12Z"], + ["2002-12+00:00", + "2002-12Z"], + ["2002-12-00:00", + "2002-12Z"], + ["-2002-12", + "-2002-12Z"], + ["-2002-12+00:00", + "-2002-12Z"], + ["-2002-12-00:00", + "-2002-12Z"], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPGYearMonth.new(data).to_s) + end + end + + def test_SOAPGYear + o = SOAP::SOAPGYear.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::GYearLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "2002Z", + "0001Z", + "9999Z", + "19999Z", + "2002+09:00", + "2002+00:01", + "2002-00:01", + "2002-23:59", + "2002+13:30", + "-2002Z", + "-19999Z", + "-2002+00:01", + "-0001+13:30", + ] + targets.each do |str| + assert_parsed_result(SOAP::SOAPGYear, str) + end + + targets = [ + ["2002", + "2002Z"], + ["2002+00:00", + "2002Z"], + ["2002-00:00", + "2002Z"], + ["-2002", + "-2002Z"], + ["-2002+00:00", + "-2002Z"], + ["-2002-00:00", + "-2002Z"], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPGYear.new(data).to_s) + end + end + + def test_SOAPGMonthDay + o = SOAP::SOAPGMonthDay.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::GMonthDayLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "--05-18Z", + "--01-01Z", + "--12-31Z", + "--12-31+09:00", + "--12-31+00:01", + "--12-31-00:01", + "--12-31-23:59", + "--12-31+13:30", + ] + targets.each do |str| + assert_parsed_result(SOAP::SOAPGMonthDay, str) + end + + targets = [ + ["--12-31", + "--12-31Z"], + ["--12-31+00:00", + "--12-31Z"], + ["--12-31-00:00", + "--12-31Z"], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPGMonthDay.new(data).to_s) + end + end + + def test_SOAPGDay + o = SOAP::SOAPGDay.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::GDayLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "---18Z", + "---01Z", + "---31Z", + "---31+09:00", + "---31+00:01", + "---31-00:01", + "---31-23:59", + "---31+13:30", + ] + targets.each do |str| + assert_parsed_result(SOAP::SOAPGDay, str) + end + + targets = [ + ["---31", + "---31Z"], + ["---31+00:00", + "---31Z"], + ["---31-00:00", + "---31Z"], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPGDay.new(data).to_s) + end + end + + def test_SOAPGMonth + o = SOAP::SOAPGMonth.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::GMonthLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "--05Z", + "--01Z", + "--12Z", + "--12+09:00", + "--12+00:01", + "--12-00:01", + "--12-23:59", + "--12+13:30", + ] + targets.each do |str| + assert_parsed_result(SOAP::SOAPGMonth, str) + end + + targets = [ + ["--12", + "--12Z"], + ["--12+00:00", + "--12Z"], + ["--12-00:00", + "--12Z"], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPGMonth.new(data).to_s) + end + end + + def test_SOAPHexBinary + o = SOAP::SOAPHexBinary.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::HexBinaryLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "abcdef", + "\xe3\x81\xaa\xe3\x81\xb2", + "\0", + "", + ] + targets.each do |str| + assert_equal(str, SOAP::SOAPHexBinary.new(str).string) + assert_equal(str.unpack("H*")[0].tr('a-f', 'A-F'), + SOAP::SOAPHexBinary.new(str).data) + o = SOAP::SOAPHexBinary.new + o.set_encoded(str.unpack("H*")[0].tr('a-f', 'A-F')) + assert_equal(str, o.string) + o.set_encoded(str.unpack("H*")[0].tr('A-F', 'a-f')) + assert_equal(str, o.string) + end + + targets = [ + "0FG7", + "0fg7", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError, d.to_s) do + o = SOAP::SOAPHexBinary.new + o.set_encoded(d) + p o.string + end + end + end + + def test_SOAPBase64Binary + o = SOAP::SOAPBase64.new + assert_equal(SOAP::EncodingNamespace, o.type.namespace) + assert_equal(SOAP::Base64Literal, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "abcdef", + "\xe3\x81\xaa\xe3\x81\xb2", + "\0", + "", + ] + targets.each do |str| + assert_equal(str, SOAP::SOAPBase64.new(str).string) + assert_equal([str].pack("m").chomp, SOAP::SOAPBase64.new(str).data) + o = SOAP::SOAPBase64.new + o.set_encoded([str].pack("m").chomp) + assert_equal(str, o.string) + end + + targets = [ + "-", + "*", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError, d.to_s) do + o = SOAP::SOAPBase64.new + o.set_encoded(d) + p o.string + end + end + end + + def test_SOAPAnyURI + o = SOAP::SOAPAnyURI.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::AnyURILiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + # Too few tests here I know. Believe uri module. :) + targets = [ + "foo", + "http://foo", + "http://foo/bar/baz", + "http://foo/bar#baz", + "http://foo/bar%20%20?a+b", + "HTTP://FOO/BAR%20%20?A+B", + ] + targets.each do |str| + assert_parsed_result(SOAP::SOAPAnyURI, str) + end + end + + def test_SOAPQName + o = SOAP::SOAPQName.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::QNameLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + # More strict test is needed but current implementation allows all non-':' + # chars like ' ', C0 or C1... + targets = [ + "foo", + "foo:bar", + "a:b", + ] + targets.each do |str| + assert_parsed_result(SOAP::SOAPQName, str) + end + end + + + ### + ## Derived types + # + + def test_SOAPInteger + o = SOAP::SOAPInteger.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::IntegerLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 1000000000, + -9999999999, + 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890, + 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890, + -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789, + ] + targets.each do |int| + assert_equal(int, SOAP::SOAPInteger.new(int).data) + end + + targets = [ + "0", + "1000000000", + "-9999999999", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789", + ] + targets.each do |str| + assert_equal(str, SOAP::SOAPInteger.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["000123", "123"], + ["-000123", "-123"], + [ + "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" + ], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPInteger.new(data).to_s) + end + + targets = [ + "0.0", + "-5.2", + "0.000000000000a", + "+-5", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890." + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPInteger.new(d) + end + end + end + + def test_SOAPLong + o = SOAP::SOAPLong.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::LongLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 123, + -123, + 9223372036854775807, + -9223372036854775808, + ] + targets.each do |lng| + assert_equal(lng, SOAP::SOAPLong.new(lng).data) + end + + targets = [ + "0", + "123", + "-123", + "9223372036854775807", + "-9223372036854775808", + ] + targets.each do |str| + assert_equal(str, SOAP::SOAPLong.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["000123", "123"], + ["-000123", "-123"], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPLong.new(data).to_s) + end + + targets = [ + 9223372036854775808, + -9223372036854775809, + "0.0", + "-5.2", + "0.000000000000a", + "+-5", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPLong.new(d) + end + end + end + + def test_SOAPInt + o = SOAP::SOAPInt.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::IntLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 123, + -123, + 2147483647, + -2147483648, + ] + targets.each do |lng| + assert_equal(lng, SOAP::SOAPInt.new(lng).data) + end + + targets = [ + "0", + "123", + "-123", + "2147483647", + "-2147483648", + ] + targets.each do |str| + assert_equal(str, SOAP::SOAPInt.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["000123", "123"], + ["-000123", "-123"], + ] + targets.each do |data, expected| + assert_equal(expected, SOAP::SOAPInt.new(data).to_s) + end + + targets = [ + 2147483648, + -2147483649, + "0.0", + "-5.2", + "0.000000000000a", + "+-5", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + SOAP::SOAPInt.new(d) + end + end + end +end + + +end diff --git a/test/soap/test_cookie.rb b/test/soap/test_cookie.rb new file mode 100644 index 0000000..eae956b --- /dev/null +++ b/test/soap/test_cookie.rb @@ -0,0 +1,112 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'webrick' +require 'logger' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', 'testutil.rb') + + +module SOAP + + +class TestCookie < Test::Unit::TestCase + Port = 17171 + + class CookieFilter < SOAP::Filter::StreamHandler + attr_accessor :cookie_value + + def initialize + @cookie_value = nil + end + + def on_http_outbound(req) + if @cookie_value + req.header.delete('Cookie') + req.header['Cookie'] = @cookie_value + end + end + + def on_http_inbound(req, res) + # this sample filter only caputures the first cookie. + cookie = res.header['Set-Cookie'][0] + cookie.sub!(/;.*\z/, '') if cookie + @cookie_value = cookie + # do not save cookie value. + end + end + + def setup + @logger = Logger.new(STDERR) + @logger.level = Logger::Severity::ERROR + @url = "http://localhost:#{Port}/" + @server = @client = nil + @server_thread = nil + setup_server + setup_client + end + + def teardown + teardown_client if @client + teardown_server if @server + end + + def setup_server + @server = WEBrick::HTTPServer.new( + :BindAddress => "0.0.0.0", + :Logger => @logger, + :Port => Port, + :AccessLog => [], + :DocumentRoot => File.dirname(File.expand_path(__FILE__)) + ) + @server.mount( + '/', + WEBrick::HTTPServlet::ProcHandler.new(method(:do_server_proc).to_proc) + ) + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_client + @client = SOAP::RPC::Driver.new(@url, '') + @client.add_method("do_server_proc") + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def teardown_client + @client.reset_stream + end + + def do_server_proc(req, res) + cookie = req['Cookie'].to_s + cookie = "var=hello world" if cookie.empty? + res['content-type'] = 'text/xml' + res['Set-Cookie'] = cookie + res.body = <<__EOX__ + + + + + + + + +__EOX__ + end + + def test_normal + @client.wiredump_dev = STDOUT if $DEBUG + filter = CookieFilter.new + @client.streamhandler.filterchain << filter + assert_nil(@client.do_server_proc) + assert_equal('var=hello world', filter.cookie_value) + filter.cookie_value = 'var=empty' + assert_nil(@client.do_server_proc) + assert_equal('var=empty', filter.cookie_value) + end +end + + +end diff --git a/test/soap/test_custom_ns.rb b/test/soap/test_custom_ns.rb new file mode 100644 index 0000000..51cadc6 --- /dev/null +++ b/test/soap/test_custom_ns.rb @@ -0,0 +1,105 @@ +require 'test/unit' +require 'soap/processor' + + +module SOAP + + +class TestCustomNs < Test::Unit::TestCase + NORMAL_XML = <<__XML__.chomp + + + + hi + + + bi + + +__XML__ + + CUSTOM_NS_XML = <<__XML__.chomp + + + + hi + + + bi + + +__XML__ + + XML_WITH_DEFAULT_NS = <<__XML__.chomp + + + + hi + + + bi + + +__XML__ + + def test_custom_ns + # create test env + header = SOAP::SOAPHeader.new() + hi = SOAP::SOAPElement.new(XSD::QName.new("my:foo", "headeritem"), 'hi') + header.add("test", hi) + body = SOAP::SOAPBody.new() + bi = SOAP::SOAPElement.new(XSD::QName.new("my:foo", "bodyitem"), 'bi') + bi.extraattr[XSD::QName.new('my:bar', 'baz')] = 'qux' + body.add("test", bi) + env = SOAP::SOAPEnvelope.new(header, body) + # normal + opt = {} + result = SOAP::Processor.marshal(env, opt) + assert_equal(NORMAL_XML, result) + # Envelope ns customize + env = SOAP::SOAPEnvelope.new(header, body) + ns = XSD::NS.new + ns.assign(SOAP::EnvelopeNamespace, 'ENV') + ns.assign('my:foo', 'myns') + # tag customize + tag = XSD::NS.new + tag.assign('my:bar', 'bar') + opt = { :default_ns => ns, :default_ns_tag => tag } + result = SOAP::Processor.marshal(env, opt) + assert_equal(CUSTOM_NS_XML, result) + end + + def test_default_namespace + # create test env + header = SOAP::SOAPHeader.new() + hi = SOAP::SOAPElement.new(XSD::QName.new("my:foo", "headeritem"), 'hi') + header.add("test", hi) + body = SOAP::SOAPBody.new() + bi = SOAP::SOAPElement.new(XSD::QName.new("my:foo", "bodyitem"), 'bi') + bi.extraattr[XSD::QName.new('my:bar', 'baz')] = 'qux' + bi.extraattr[XSD::QName.new('my:foo', 'quxx')] = 'quxxx' + body.add("test", bi) + env = SOAP::SOAPEnvelope.new(header, body) + # normal + opt = {:use_default_namespace => true} + result = SOAP::Processor.marshal(env, opt) + assert_equal(XML_WITH_DEFAULT_NS, result) + end +end + + +end diff --git a/test/soap/test_custommap.rb b/test/soap/test_custommap.rb new file mode 100644 index 0000000..c17407c --- /dev/null +++ b/test/soap/test_custommap.rb @@ -0,0 +1,110 @@ +require 'test/unit' +require 'soap/marshal' +require 'soap/rpc/standaloneServer' +require 'soap/rpc/driver' + + +module SOAP + + +class TestMap < Test::Unit::TestCase + + class CustomHashFactory < SOAP::Mapping::Factory + def initialize(itemname) + @itemname = itemname + end + + def obj2soap(soap_class, obj, info, map) + soap_obj = SOAP::SOAPStruct.new(SOAP::Mapping::MapQName) + mark_marshalled_obj(obj, soap_obj) + obj.each do |key, value| + elem = SOAP::SOAPStruct.new + elem.add('key', Mapping._obj2soap(key, map)) + elem.add('value', Mapping._obj2soap(value, map)) + soap_obj.add(@itemname, elem) + end + soap_obj + end + + def soap2obj(obj_class, node, info, map) + false + end + end + + Map = SOAP::Mapping::Registry.new + Map.add(Hash, SOAP::SOAPStruct, CustomHashFactory.new('customname')) + + Port = 17171 + + class MapServer < SOAP::RPC::StandaloneServer + def initialize(*arg) + super + add_rpc_method(self, 'echo', 'map') + add_rpc_method(self, 'setmap') + end + + def echo(map) + map + end + + def setmap + self.mapping_registry = Map + nil + end + end + + def setup + @server = MapServer.new(self.class.name, nil, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + @server.start + } + @endpoint = "http://localhost:#{Port}/" + @client = SOAP::RPC::Driver.new(@endpoint) + @client.add_rpc_method('echo', 'map') + @client.add_rpc_method('setmap') + @client.wiredump_dev = STDOUT if $DEBUG + end + + def teardown + @server.shutdown if @server + if @t + @t.kill + @t.join + end + @client.reset_stream if @client + end + + def test_map + h = {'a' => 1, 'b' => 2} + soap = SOAP::Marshal.marshal(h) + puts soap if $DEBUG + obj = SOAP::Marshal.unmarshal(soap) + assert_equal(h, obj) + # + soap = SOAP::Marshal.marshal(h, Map) + puts soap if $DEBUG + obj = SOAP::Marshal.unmarshal(soap, Map) + assert_equal(h, obj) + end + + def test_rpc + h = {'a' => 1, 'b' => 2} + @client.wiredump_dev = str = '' + assert_equal(h, @client.echo(h)) + assert_equal(0, str.scan(/customname/).size) + # + @client.setmap + @client.wiredump_dev = str = '' + assert_equal(h, @client.echo(h)) + assert_equal(4, str.scan(/customname/).size) + # + @client.mapping_registry = Map + @client.wiredump_dev = str = '' + assert_equal(h, @client.echo(h)) + assert_equal(8, str.scan(/customname/).size) + end +end + + +end diff --git a/test/soap/test_empty.rb b/test/soap/test_empty.rb new file mode 100644 index 0000000..fd8c2d0 --- /dev/null +++ b/test/soap/test_empty.rb @@ -0,0 +1,105 @@ +require 'test/unit' +require 'soap/rpc/standaloneServer' +require 'soap/rpc/driver' +require 'soap/header/handler' + + +module SOAP + + +class TestEmpty < Test::Unit::TestCase + Port = 17171 + + class EmptyHeaderHandler < SOAP::Header::Handler + def on_outbound(header) + # dump Header even if no header item given. + header.force_encode = true + # no additional header item + nil + end + end + + class NopServer < SOAP::RPC::StandaloneServer + def initialize(*arg) + super + add_document_method(self, 'urn:empty:nop', 'nop', [], []) + add_document_method(self, 'urn:empty:nop', 'nop_nil', nil, nil) + end + + def nop + [1, 2, 3] # ignored + end + + def nop_nil + [1, 2, 3] # ignored + end + end + + def setup + @server = NopServer.new(self.class.name, nil, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + @server.start + } + @endpoint = "http://localhost:#{Port}/" + @client = SOAP::RPC::Driver.new(@endpoint) + @client.add_document_method('nop', 'urn:empty:nop', [], []) + @client.add_document_method('nop_nil', 'urn:empty:nop', nil, nil) + end + + def teardown + @server.shutdown if @server + if @t + @t.kill + @t.join + end + @client.reset_stream if @client + end + + EMPTY_XML = %q[ + + +] + + EMPTY_HEADER_XML = %q[ + + + +] + + def test_nop + @client.wiredump_dev = str = '' + @client.nop + assert_equal(EMPTY_XML, parse_requestxml(str)) + assert_equal(EMPTY_XML, parse_responsexml(str)) + end + + def test_nop_nil + @client.wiredump_dev = str = '' + @client.nop_nil + assert_equal(EMPTY_XML, parse_requestxml(str)) + assert_equal(EMPTY_XML, parse_responsexml(str)) + end + + def test_empty_header + @client.headerhandler << EmptyHeaderHandler.new(nil) + @client.wiredump_dev = str = '' + @client.nop + assert_equal(EMPTY_HEADER_XML, parse_requestxml(str)) + end + + def parse_requestxml(str) + str.split(/\r?\n\r?\n/)[3] + end + + def parse_responsexml(str) + str.split(/\r?\n\r?\n/)[6] + end +end + + +end diff --git a/test/soap/test_envelopenamespace.rb b/test/soap/test_envelopenamespace.rb new file mode 100644 index 0000000..cd39c1a --- /dev/null +++ b/test/soap/test_envelopenamespace.rb @@ -0,0 +1,85 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'webrick' +require 'logger' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', 'testutil.rb') + + +module SOAP + + +class TestEnvelopeNamespace < Test::Unit::TestCase + Port = 17171 + TemporaryNamespace = 'urn:foo' + + def setup + @logger = Logger.new(STDERR) + @logger.level = Logger::Severity::ERROR + @url = "http://localhost:#{Port}/" + @server = @client = nil + @server_thread = nil + setup_server + setup_client + end + + def teardown + teardown_client if @client + teardown_server if @server + end + + def setup_server + @server = WEBrick::HTTPServer.new( + :BindAddress => "0.0.0.0", + :Logger => @logger, + :Port => Port, + :AccessLog => [], + :DocumentRoot => File.dirname(File.expand_path(__FILE__)) + ) + @server.mount( + '/', + WEBrick::HTTPServlet::ProcHandler.new(method(:do_server_proc).to_proc) + ) + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_client + @client = SOAP::RPC::Driver.new(@url, '') + @client.add_method("do_server_proc") + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def teardown_client + @client.reset_stream + end + + def do_server_proc(req, res) + res['content-type'] = 'text/xml' + res.body = <<__EOX__ + + + + + hello world + + + +__EOX__ + end + + def test_normal + assert_raise(SOAP::ResponseFormatError) do + @client.do_server_proc + end + @client.options["soap.envelope.requestnamespace"] = TemporaryNamespace + @client.options["soap.envelope.responsenamespace"] = TemporaryNamespace + assert_equal('hello world', @client.do_server_proc) + end +end + + +end diff --git a/test/soap/test_extraattr.rb b/test/soap/test_extraattr.rb new file mode 100644 index 0000000..d081290 --- /dev/null +++ b/test/soap/test_extraattr.rb @@ -0,0 +1,54 @@ +require 'test/unit' +require 'soap/processor' + + +module SOAP + + +class TestExtrAttr < Test::Unit::TestCase + + HEADER_XML = %q[ + + + + + + + +] + + def test_extraattr + header = SOAP::SOAPHeader.new() + header.extraattr["Id"] = "extraattr" + hi = SOAP::SOAPElement.new(XSD::QName.new("my:foo", "headeritem")) + hi.extraattr["Id"] = "extraattr" + header.add("test", hi) + body = SOAP::SOAPBody.new() + body.extraattr["Id"] = "extraattr<>" + bi = SOAP::SOAPElement.new(XSD::QName.new("my:foo", "bodyitem")) + bi.extraattr["Id"] = "extraattr" + body.add("test", bi) + env = SOAP::SOAPEnvelope.new(header, body) + env.extraattr["Id"] = "extraattr" + g = SOAP::Generator.new() + xml = g.generate(env) + assert_equal(HEADER_XML, xml) + # + parser = SOAP::Parser.new + env = parser.parse(xml) + header = env.header + body = env.body + assert_equal("extraattr", env.extraattr[XSD::QName.new(nil, "Id")]) + assert_equal("extraattr", header.extraattr[XSD::QName.new(nil, "Id")]) + assert_equal("extraattr<>", body.extraattr[XSD::QName.new(nil, "Id")]) + assert_equal("extraattr", header["headeritem"].element.extraattr[XSD::QName.new(nil, "Id")]) + end +end + + +end diff --git a/test/soap/test_generator.rb b/test/soap/test_generator.rb new file mode 100644 index 0000000..975b2dd --- /dev/null +++ b/test/soap/test_generator.rb @@ -0,0 +1,27 @@ +require 'test/unit' +require 'soap/processor' + + +module SOAP + + +class TestGenerator < Test::Unit::TestCase + # based on #417, reported by Kou. + def test_encode + str = "\343\201\217<" + g = SOAP::Generator.new + g.generate(SOAPElement.new('foo')) + assert_equal("<", g.encode_string(str)[-4, 4]) + # + begin + kc_backup = $KCODE.dup + $KCODE = 'EUC-JP' + assert_equal("<", g.encode_string(str)[-4, 4]) + ensure + $KCODE = kc_backup + end + end +end + + +end diff --git a/test/soap/test_httpconfigloader.rb b/test/soap/test_httpconfigloader.rb new file mode 100644 index 0000000..d3ca8bd --- /dev/null +++ b/test/soap/test_httpconfigloader.rb @@ -0,0 +1,71 @@ +require 'test/unit' +require 'soap/httpconfigloader' +require 'soap/rpc/driver' + +if defined?(HTTPClient) + +module SOAP + + +class TestHTTPConfigLoader < Test::Unit::TestCase + DIR = File.dirname(File.expand_path(__FILE__)) + + def setup + @client = SOAP::RPC::Driver.new(nil, nil) + end + + class Request + class Header + attr_reader :request_uri + def initialize(request_uri) + @request_uri = request_uri + end + end + + attr_reader :header + def initialize(request_uri) + @header = Header.new(request_uri) + end + end + + def test_property + testpropertyname = File.join(DIR, 'soapclient.properties') + File.open(testpropertyname, "w") do |f| + f <<<<__EOP__ +protocol.http.proxy = http://myproxy:8080 +protocol.http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_PEER +# depth: 1 causes an error (intentional) +protocol.http.ssl_config.verify_depth = 1 +protocol.http.ssl_config.ciphers = ALL +protocol.http.basic_auth.1.url = http://www.example.com/foo1/ +protocol.http.basic_auth.1.userid = user1 +protocol.http.basic_auth.1.password = password1 +protocol.http.basic_auth.2.url = http://www.example.com/foo2/ +protocol.http.basic_auth.2.userid = user2 +protocol.http.basic_auth.2.password = password2 +__EOP__ + end + begin + @client.loadproperty(testpropertyname) + assert_equal('ALL', @client.options['protocol.http.ssl_config.ciphers']) + @client.options['protocol.http.basic_auth'] << + ['http://www.example.com/foo3/', 'user3', 'password3'] + h = @client.streamhandler.client + basic_auth = h.www_auth.basic_auth + cred1 = ["user1:password1"].pack('m').tr("\n", '') + cred2 = ["user2:password2"].pack('m').tr("\n", '') + cred3 = ["user3:password3"].pack('m').tr("\n", '') + basic_auth.challenge(URI.parse("http://www.example.com/"), nil) + assert_equal(cred1, basic_auth.get(Request.new(URI.parse("http://www.example.com/foo1/baz")))) + assert_equal(cred2, basic_auth.get(Request.new(URI.parse("http://www.example.com/foo2/")))) + assert_equal(cred3, basic_auth.get(Request.new(URI.parse("http://www.example.com/foo3/baz/qux")))) + ensure + File.unlink(testpropertyname) + end + end +end + + +end + +end diff --git a/test/soap/test_mapping.rb b/test/soap/test_mapping.rb new file mode 100644 index 0000000..e41be7a --- /dev/null +++ b/test/soap/test_mapping.rb @@ -0,0 +1,131 @@ +require 'test/unit' +require 'soap/mapping' +require 'soap/marshal' + + +module SOAP + + +class TestMapping < Test::Unit::TestCase + + class MappablePerson + attr_reader :name + attr_reader :age + + def initialize(name, age) + @name, @age = name, age + end + + def self.soap_marshallable + true + end + end + + class UnmappablePerson + attr_reader :name + attr_reader :age + + def initialize(name, age) + @name, @age = name, age + end + + def self.soap_marshallable + false + end + end + + def test_mappable + xml = <<__XML__ + + + + + nahi + 37 + + + +__XML__ + obj = SOAP::Marshal.load(xml) + assert_equal(SOAP::TestMapping::MappablePerson, obj.class) + # + xml = <<__XML__ + + + + + nahi + 37 + + + +__XML__ + obj = SOAP::Marshal.load(xml) + assert_equal(SOAP::Mapping::Object, obj.class) + end + + def test_nestedexception + ele = Thread.new {} + obj = [ele] + begin + SOAP::Marshal.dump(obj) + rescue ::SOAP::Mapping::MappingError => e + assert(e.backtrace.find { |line| /\[NESTED\]/ =~ line }) + end + end + + def test_date + targets = [ + ["2002-12-31", + "2002-12-31Z"], + ["2002-12-31+00:00", + "2002-12-31Z"], + ["2002-12-31-00:00", + "2002-12-31Z"], + ["-2002-12-31", + "-2002-12-31Z"], + ["-2002-12-31+00:00", + "-2002-12-31Z"], + ["-2002-12-31-00:00", + "-2002-12-31Z"], + ] + targets.each do |str, expectec| + d = Date.parse(str) + assert_equal(d.class, convert(d).class) + assert_equal(d, convert(d)) + end + end + + def test_datetime + targets = [ + ["2002-12-31T23:59:59.00", + "2002-12-31T23:59:59Z"], + ["2002-12-31T23:59:59+00:00", + "2002-12-31T23:59:59Z"], + ["2002-12-31T23:59:59-00:00", + "2002-12-31T23:59:59Z"], + ["-2002-12-31T23:59:59.00", + "-2002-12-31T23:59:59Z"], + ["-2002-12-31T23:59:59+00:00", + "-2002-12-31T23:59:59Z"], + ["-2002-12-31T23:59:59-00:00", + "-2002-12-31T23:59:59Z"], + ] + targets.each do |str, expectec| + d = DateTime.parse(str) + assert_equal(d.class, convert(d).class) + assert_equal(d, convert(d)) + end + end + + def convert(obj) + SOAP::Mapping.soap2obj(SOAP::Mapping.obj2soap(obj)) + end +end + + +end diff --git a/test/soap/test_nestedexception.rb b/test/soap/test_nestedexception.rb new file mode 100644 index 0000000..2bd6541 --- /dev/null +++ b/test/soap/test_nestedexception.rb @@ -0,0 +1,56 @@ +require 'test/unit' +require 'soap/soap' + + +module SOAP + + +class TestNestedException < Test::Unit::TestCase + class MyError < SOAP::Error; end + + def foo + begin + bar + rescue + raise MyError.new("foo", $!) + end + end + + def bar + begin + baz + rescue + raise MyError.new("bar", $!) + end + end + + def baz + raise MyError.new("baz", $!) + end + + def test_nestedexception + begin + foo + rescue MyError => e + trace = e.backtrace.find_all { |line| /test\/unit/ !~ line && /\d\z/ !~ line } + trace = trace.map { |line| line.sub(/\A[^:]*/, '') } + assert_equal(TOBE, trace) + end + end + + TOBE = [ + ":15:in `foo'", + ":33:in `test_nestedexception'", + ":23:in `bar': bar (SOAP::TestNestedException::MyError) [NESTED]", + ":13:in `foo'", + ":33:in `test_nestedexception'", + ":28:in `baz': baz (SOAP::TestNestedException::MyError) [NESTED]", + ":21:in `bar'", + ":13:in `foo'", + ":33:in `test_nestedexception'", + ] + +end + + +end diff --git a/test/soap/test_nil.rb b/test/soap/test_nil.rb new file mode 100644 index 0000000..689c57a --- /dev/null +++ b/test/soap/test_nil.rb @@ -0,0 +1,57 @@ +require 'test/unit' +require 'soap/rpc/standaloneServer' +require 'soap/rpc/driver' +require 'soap/header/handler' + + +module SOAP + + +class TestNil < Test::Unit::TestCase + Port = 17171 + + class NilServer < SOAP::RPC::StandaloneServer + def initialize(*arg) + super + add_method(self, 'nop') + end + + def nop + 1 + end + end + + def setup + @server = NilServer.new(self.class.name, nil, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + @server.start + } + @endpoint = "http://localhost:#{Port}/" + @client = SOAP::RPC::Driver.new(@endpoint) + @client.add_rpc_method('nop') + end + + def teardown + @server.shutdown if @server + if @t + @t.kill + @t.join + end + @client.reset_stream if @client + end + + require 'rexml/document' + # emulates SOAP::Lite's nil request + def test_soaplite_nil + body = SOAP::SOAPBody.new(REXML::Document.new(<<-__XML__)) + + __XML__ + @client.wiredump_dev = STDOUT if $DEBUG + header, body = @client.invoke(nil, body) + assert_equal(1, body.root_node["return"].data) + end +end + + +end diff --git a/test/soap/test_no_indent.rb b/test/soap/test_no_indent.rb new file mode 100644 index 0000000..43d617d --- /dev/null +++ b/test/soap/test_no_indent.rb @@ -0,0 +1,88 @@ +require 'test/unit' +require 'soap/rpc/standaloneServer' +require 'soap/rpc/driver' + +if defined?(HTTPClient) + +module SOAP + + +class TestNoIndent < Test::Unit::TestCase + Port = 17171 + + class NopServer < SOAP::RPC::StandaloneServer + def initialize(*arg) + super + add_rpc_method(self, 'nop') + end + + def nop + SOAP::RPC::SOAPVoid.new + end + end + + def setup + @server = NopServer.new(self.class.name, nil, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + @server.start + } + @endpoint = "http://localhost:#{Port}/" + @client = SOAP::RPC::Driver.new(@endpoint) + @client.add_rpc_method('nop') + end + + def teardown + @server.shutdown if @server + if @t + @t.kill + @t.join + end + @client.reset_stream if @client + end + + INDENT_XML = +%q[ + + + + + +] + + NO_INDENT_XML = +%q[ + + + + + +] + + def test_indent + @client.wiredump_dev = str = '' + @client.options["soap.envelope.no_indent"] = false + @client.nop + assert_equal(INDENT_XML, parse_requestxml(str)) + end + + def test_no_indent + @client.wiredump_dev = str = '' + @client.options["soap.envelope.no_indent"] = true + @client.nop + assert_equal(NO_INDENT_XML, parse_requestxml(str)) + end + + def parse_requestxml(str) + str.split(/\r?\n\r?\n/)[3] + end +end + + +end + +end diff --git a/test/soap/test_property.rb b/test/soap/test_property.rb new file mode 100644 index 0000000..dd782de --- /dev/null +++ b/test/soap/test_property.rb @@ -0,0 +1,428 @@ +# coding: utf-8 + +require 'test/unit' +require 'soap/property' + +module SOAP + + +class TestProperty < Test::Unit::TestCase + FrozenError = (RUBY_VERSION >= "1.9.0") ? RuntimeError : TypeError + + def setup + @prop = ::SOAP::Property.new + end + + def teardown + # Nothing to do. + end + + def test_s_load + propstr = <<__EOP__ + +# comment1 + +# comment2\r +# comment2 + +\r +a.b.0 = 1 +a.b.1 = 2 +a.b.2 = 3 +a.b.3 = 日本語 +a.b.表 = 1表2 +client.protocol.http.proxy=http://myproxy:8080 \r +client.protocol.http.no_proxy: intranet.example.com,local.example.com\r +client.protocol.http.protocol_version = 1.0 +foo\\:bar\\=baz = qux +foo\\\\.bar.baz=\tq\\\\ux\ttab + a\\ b = 1 +[ppp.qqq.rrr] +sss = 3 +ttt.uuu = 4 + +[ sss.ttt.uuu ] +vvv.www = 5 +[ ] +xxx.yyy.zzz = 6 +__EOP__ + prop = Property.load(propstr) + assert_equal("1表2", prop["a.b.表"]) + assert_equal(["1", "1表2", "2", "3", "日本語"], prop["a.b"].values.sort) + assert_equal("intranet.example.com,local.example.com", + prop["client.protocol.http.no_proxy"]) + assert_equal("http://myproxy:8080", prop["client.protocol.http.proxy"]) + assert_equal("1.0", prop["client.protocol.http.protocol_version"]) + assert_equal("q\\ux\ttab", prop['foo\.bar.baz']) + assert_equal("1", prop['a b']) + assert_equal("3", prop['ppp.qqq.rrr.sss']) + assert_equal("4", prop['ppp.qqq.rrr.ttt.uuu']) + assert_equal("5", prop['sss.ttt.uuu.vvv.www']) + assert_equal("6", prop['xxx.yyy.zzz']) + end + + def test_load + prop = Property.new + hooked = false + prop.add_hook("foo.bar.baz") do |name, value| + assert_equal(["foo", "bar", "baz"], name) + assert_equal("123", value) + hooked = true + end + prop.lock + prop["foo.bar"].lock + prop.load("foo.bar.baz = 123") + assert(hooked) + assert_raises(FrozenError) do + prop.load("foo.bar.qux = 123") + end + prop.load("foo.baz = 456") + assert_equal("456", prop["foo.baz"]) + end + + def test_initialize + prop = ::SOAP::Property.new + # store is empty + assert_nil(prop["a"]) + # does hook work? + assert_equal(1, prop["a"] = 1) + end + + def test_aref + # name_to_a + assert_nil(@prop[:foo]) + assert_nil(@prop["foo"]) + assert_nil(@prop[[:foo]]) + assert_nil(@prop[["foo"]]) + assert_raises(ArgumentError) do + @prop[1] + end + @prop[:foo] = :foo + assert_equal(:foo, @prop[:foo]) + assert_equal(:foo, @prop["foo"]) + assert_equal(:foo, @prop[[:foo]]) + assert_equal(:foo, @prop[["foo"]]) + end + + def test_referent + # referent(1) + assert_nil(@prop["foo.foo"]) + assert_nil(@prop[["foo", "foo"]]) + assert_nil(@prop[["foo", :foo]]) + @prop["foo.foo"] = :foo + assert_equal(:foo, @prop["foo.foo"]) + assert_equal(:foo, @prop[["foo", "foo"]]) + assert_equal(:foo, @prop[[:foo, "foo"]]) + # referent(2) + @prop["bar.bar.bar"] = :bar + assert_equal(:bar, @prop["bar.bar.bar"]) + assert_equal(:bar, @prop[["bar", "bar", "bar"]]) + assert_equal(:bar, @prop[[:bar, "bar", :bar]]) + end + + def test_to_key_and_deref + @prop["foo.foo"] = :foo + assert_equal(:foo, @prop["fOo.FoO"]) + assert_equal(:foo, @prop[[:fOO, :FOO]]) + assert_equal(:foo, @prop[["FoO", :Foo]]) + # deref_key negative test + assert_raises(ArgumentError) do + @prop["baz"] = 1 + @prop["baz.qux"] = 2 + end + end + + def test_hook_name + tag = Object.new + tested = false + @prop.add_hook("foo.bar") do |key, value| + assert_raise(FrozenError) do + key << "baz" + end + tested = true + end + @prop["foo.bar"] = tag + assert(tested) + end + + def test_value_hook + tag = Object.new + tested = false + @prop.add_hook("FOO.BAR.BAZ") do |key, value| + assert_equal(["Foo", "baR", "baZ"], key) + assert_equal(tag, value) + tested = true + end + @prop["Foo.baR.baZ"] = tag + assert_equal(tag, @prop["foo.bar.baz"]) + assert(tested) + @prop["foo.bar"] = 1 # unhook the above block + assert_equal(1, @prop["foo.bar"]) + end + + def test_key_hook_no_cascade + tag = Object.new + tested = 0 + @prop.add_hook do |key, value| + assert(false) + end + @prop.add_hook(false) do |key, value| + assert(false) + end + @prop.add_hook("foo") do |key, value| + assert(false) + end + @prop.add_hook("foo.bar", false) do |key, value| + assert(false) + end + @prop.add_hook("foo.bar.baz") do |key, value| + assert(false) + end + @prop.add_hook("foo.bar.baz.qux", false) do |key, value| + assert_equal(["foo", "bar", "baz", "qux"], key) + assert_equal(tag, value) + tested += 1 + end + @prop["foo.bar.baz.qux"] = tag + assert_equal(tag, @prop["foo.bar.baz.qux"]) + assert_equal(1, tested) + end + + def test_key_hook_cascade + tag = Object.new + tested = 0 + @prop.add_hook(true) do |key, value| + assert_equal(["foo", "bar", "baz", "qux"], key) + assert_equal(tag, value) + tested += 1 + end + @prop.add_hook("foo", true) do |key, value| + assert_equal(["foo", "bar", "baz", "qux"], key) + assert_equal(tag, value) + tested += 1 + end + @prop.add_hook("foo.bar", true) do |key, value| + assert_equal(["foo", "bar", "baz", "qux"], key) + assert_equal(tag, value) + tested += 1 + end + @prop.add_hook("foo.bar.baz", true) do |key, value| + assert_equal(["foo", "bar", "baz", "qux"], key) + assert_equal(tag, value) + tested += 1 + end + @prop.add_hook("foo.bar.baz.qux", true) do |key, value| + assert_equal(["foo", "bar", "baz", "qux"], key) + assert_equal(tag, value) + tested += 1 + end + @prop["foo.bar.baz.qux"] = tag + assert_equal(tag, @prop["foo.bar.baz.qux"]) + assert_equal(5, tested) + end + + def test_keys + assert(@prop.keys.empty?) + @prop["foo"] = 1 + @prop["bar"] + @prop["BAz"] = 2 + assert_equal(2, @prop.keys.size) + assert(@prop.keys.member?("foo")) + assert(@prop.keys.member?("baz")) + # + assert_nil(@prop["a"]) + @prop["a.a"] = 1 + assert_instance_of(::SOAP::Property, @prop["a"]) + @prop["a.b"] = 1 + @prop["a.c"] = 1 + assert_equal(3, @prop["a"].keys.size) + assert(@prop["a"].keys.member?("a")) + assert(@prop["a"].keys.member?("b")) + assert(@prop["a"].keys.member?("c")) + end + + def test_lshift + assert(@prop.empty?) + @prop << 1 + assert_equal([1], @prop.values) + assert_equal(1, @prop["0"]) + @prop << 1 + assert_equal([1, 1], @prop.values) + assert_equal(1, @prop["1"]) + @prop << 1 + assert_equal([1, 1, 1], @prop.values) + assert_equal(1, @prop["2"]) + # + @prop["abc.def"] = o = SOAP::Property.new + tested = 0 + o.add_hook do |k, v| + tested += 1 + end + @prop["abc.def"] << 1 + @prop["abc.def"] << 2 + @prop["abc.def"] << 3 + @prop["abc.def"] << 4 + assert_equal(4, tested) + end + + def test_lock_each + @prop["a.b.c.d.e"] = 1 + @prop["a.b.d"] = branch = ::SOAP::Property.new + @prop["a.b.d.e.f"] = 2 + @prop.lock + assert(@prop.locked?) + assert_instance_of(::SOAP::Property, @prop["a"]) + assert_raises(FrozenError) do + @prop["b"] + end + # + @prop["a"].lock + assert_raises(FrozenError) do + @prop["a"] + end + assert_instance_of(::SOAP::Property, @prop["a.b"]) + # + @prop["a.b"].lock + assert_raises(FrozenError) do + @prop["a.b"] + end + assert_raises(FrozenError) do + @prop["a"] + end + # + @prop["a.b.c.d"].lock + assert_instance_of(::SOAP::Property, @prop["a.b.c"]) + assert_raises(FrozenError) do + @prop["a.b.c.d"] + end + assert_instance_of(::SOAP::Property, @prop["a.b.d"]) + # + branch["e"].lock + assert_instance_of(::SOAP::Property, @prop["a.b.d"]) + assert_raises(FrozenError) do + @prop["a.b.d.e"] + end + assert_raises(FrozenError) do + branch["e"] + end + end + + def test_lock_cascade + @prop["a.a"] = nil + @prop["a.b.c"] = 1 + @prop["b"] = false + @prop.lock(true) + assert(@prop.locked?) + assert_equal(nil, @prop["a.a"]) + assert_equal(1, @prop["a.b.c"]) + assert_equal(false, @prop["b"]) + assert_raises(FrozenError) do + @prop["c"] + end + assert_raises(FrozenError) do + @prop["c"] = 2 + end + assert_raises(FrozenError) do + @prop["a.b.R"] + end + assert_raises(FrozenError) do + @prop.add_hook do + assert(false) + end + end + assert_raises(FrozenError) do + @prop.add_hook("c") do + assert(false) + end + end + assert_raises(FrozenError) do + @prop.add_hook("a.c") do + assert(false) + end + end + assert_nil(@prop["a.a"]) + @prop["a.a"] = 2 + assert_equal(2, @prop["a.a"]) + # + @prop.unlock(true) + assert_nil(@prop["c"]) + @prop["c"] = 2 + assert_equal(2, @prop["c"]) + @prop["a.d.a.a"] = :foo + assert_equal(:foo, @prop["a.d.a.a"]) + tested = false + @prop.add_hook("a.c") do |name, value| + assert(true) + tested = true + end + @prop["a.c"] = 3 + assert(tested) + end + + def test_hook_then_lock + tested = false + @prop.add_hook("a.b.c") do |name, value| + assert_equal(["a", "b", "c"], name) + tested = true + end + @prop["a.b"].lock + assert(!tested) + @prop["a.b.c"] = 5 + assert(tested) + assert_equal(5, @prop["a.b.c"]) + assert_raises(FrozenError) do + @prop["a.b.d"] = 5 + end + end + + def test_lock_unlock_return + assert_equal(@prop, @prop.lock) + assert_equal(@prop, @prop.unlock) + end + + def test_lock_split + @prop["a.b.c"] = 1 + assert_instance_of(::SOAP::Property, @prop["a.b"]) + @prop["a.b.d"] = branch = ::SOAP::Property.new + @prop["a.b.d.e"] = 2 + assert_equal(branch, @prop["a.b.d"]) + assert_equal(branch, @prop[:a][:b][:d]) + @prop.lock(true) + # split error 1 + assert_raises(FrozenError) do + @prop["a.b"] + end + # split error 2 + assert_raises(FrozenError) do + @prop["a"] + end + @prop["a.b.c"] = 2 + assert_equal(2, @prop["a.b.c"]) + # replace error + assert_raises(FrozenError) do + @prop["a.b.c"] = ::SOAP::Property.new + end + # override error + assert_raises(FrozenError) do + @prop["a.b"] = 1 + end + # + assert_raises(FrozenError) do + @prop["a.b.d"] << 1 + end + assert_raises(FrozenError) do + branch << 1 + end + branch.unlock(true) + branch << 1 + branch << 2 + branch << 3 + assert_equal(2, @prop["a.b.d.e"]) + assert_equal(1, @prop["a.b.d.1"]) + assert_equal(2, @prop["a.b.d.2"]) + assert_equal(3, @prop["a.b.d.3"]) + end +end + + +end diff --git a/test/soap/test_response_as_xml.rb b/test/soap/test_response_as_xml.rb new file mode 100644 index 0000000..792e1db --- /dev/null +++ b/test/soap/test_response_as_xml.rb @@ -0,0 +1,117 @@ +require 'test/unit' +require 'soap/rpc/httpserver' +require 'soap/rpc/driver' +require 'rexml/document' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', 'testutil.rb') + + +module SOAP + + +class TestResponseAsXml < Test::Unit::TestCase + Namespace = "urn:example.com:hello" + class Server < ::SOAP::RPC::HTTPServer + def on_init + add_method(self, 'hello', 'name') + end + + def hello(name) + "hello #{name}" + end + end + + Port = 17171 + + def setup + setup_server + setup_client + end + + def setup_server + @server = Server.new( + :Port => Port, + :BindAddress => "0.0.0.0", + :AccessLog => [], + :SOAPDefaultNamespace => Namespace + ) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_client + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/", Namespace) + @client.wiredump_dev = STDERR if $DEBUG + @client.add_method('hello', 'name') + @client.add_document_method('hellodoc', Namespace, XSD::QName.new(Namespace, 'helloRequest'), XSD::QName.new(Namespace, 'helloResponse')) + end + + def teardown + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def teardown_client + @client.reset_stream + end + + RESPONSE_AS_XML=<<__XML__.chomp + + + + + hello world + + + +__XML__ + + def test_hello + assert_equal("hello world", @client.hello("world")) + @client.return_response_as_xml = true + xml = @client.hello("world") + assert_equal(RESPONSE_AS_XML, xml, [RESPONSE_AS_XML, xml].join("\n\n")) + doc = REXML::Document.new(@client.hello("world")) + assert_equal("hello world", + REXML::XPath.match(doc, "//*[name()='return']")[0].text) + end + + RESPONSE_CDATA = <<__XML__.chomp + + + + + some html]]> + + + + +__XML__ + def test_cdata + @client.return_response_as_xml = false + @client.test_loopback_response << RESPONSE_CDATA + ret = @client.hellodoc(nil) + assert_equal("\n some html\n ", ret.htmlContent) + # + @client.return_response_as_xml = true + @client.test_loopback_response << RESPONSE_CDATA + xml = @client.hello(nil) + assert_equal(RESPONSE_CDATA, xml) + require 'rexml/document' + doc = REXML::Document.new(xml) + assert_equal("some html", + REXML::XPath.match(doc, "//*[name()='gno:htmlContent']")[0][1].value) + # + end +end + + +end diff --git a/test/soap/test_soapelement.rb b/test/soap/test_soapelement.rb new file mode 100644 index 0000000..983118f --- /dev/null +++ b/test/soap/test_soapelement.rb @@ -0,0 +1,138 @@ +require 'test/unit' +require 'soap/baseData' +require 'soap/mapping' + + +module SOAP + + +class TestSOAPElement < Test::Unit::TestCase + include SOAP + + def setup + # Nothing to do. + end + + def teardown + # Nothing to do. + end + + def d(elename = nil, text = nil) + elename ||= n(nil, nil) + if text + SOAPElement.new(elename, text) + else + SOAPElement.new(elename) # do not merge. + end + end + + def n(namespace, name) + XSD::QName.new(namespace, name) + end + + def test_initialize + elename = n(nil, nil) + obj = d(elename) + assert_equal(elename, obj.elename) + assert_equal(LiteralNamespace, obj.encodingstyle) + assert_equal({}, obj.extraattr) + assert_equal([], obj.precedents) + assert_equal(nil, obj.qualified) + assert_equal(nil, obj.text) + assert(obj.members.empty?) + + obj = d("foo", "text") + assert_equal(n(nil, "foo"), obj.elename) + assert_equal("text", obj.text) + end + + def test_add + obj = d() + child = d("abc") + obj.add(child) + assert(obj.key?("abc")) + assert_same(child, obj["abc"]) + assert_same(child, obj["abc"]) + child = d("foo") + obj.add(child) + assert_equal(child, obj["foo"]) + child = d("_?a?b_") + obj.add(child) + assert_equal(child, obj["_?a?b_"]) + end + + def test_member + obj = d() + c1 = d("c1") + obj.add(c1) + c2 = d("c2") + obj.add(c2) + assert(obj.key?("c1")) + assert(obj.key?("c2")) + assert_equal(c1, obj["c1"]) + assert_equal(c2, obj["c2"]) + c22 = d("c22") + obj["c2"] = c22 + assert(obj.key?("c2")) + assert_equal(c22, obj["c2"]) + assert_equal(["c1", "c2"], obj.members.sort) + # + k_expect = ["c1", "c2"] + v_expect = [c1, c22] + obj.each do |k, v| + assert(k_expect.include?(k)) + assert(v_expect.include?(v)) + k_expect.delete(k) + v_expect.delete(v) + end + assert(k_expect.empty?) + assert(v_expect.empty?) + end + + def test_to_obj + obj = d("root") + ct1 = d("ct1", "t1") + obj.add(ct1) + c2 = d("c2") + ct2 = d("ct2", "t2") + c2.add(ct2) + obj.add(c2) + assert_equal({ "ct1" => "t1", "c2" => { "ct2" => "t2" }}, obj.to_obj) + # + assert_equal(nil, d().to_obj) + assert_equal("abc", d(nil, "abc").to_obj) + assert_equal(nil, d("abc", nil).to_obj) + end + + def test_from_obj + source = { "ct1" => "t1", "c2" => { "ct2" => "t2" }} + assert_equal(source, SOAPElement.from_obj(source).to_obj) + source = { "1" => nil } + assert_equal(source, SOAPElement.from_obj(source).to_obj) + source = {} + assert_equal(nil, SOAPElement.from_obj(source).to_obj) # not {} + source = nil + assert_equal(nil, SOAPElement.from_obj(source).to_obj) + end + + def test_from_obj_xmlattr + source = { "xmlattr_c1" => "t1", + "ymlattr_c2" => { + XSD::QName.new("urn:foo", "xmlattr_c2") => "t2", + XSD::QName.new("urn:foo", "ymlattr_c3") => "t3" }} + obj = SOAPElement.from_obj(source) + assert_equal("t1", obj.extraattr[XSD::QName.new(nil, "c1")]) + assert_equal("t2", obj["ymlattr_c2"].extraattr[XSD::QName.new("urn:foo", "c2")]) + assert_equal("t3", obj["ymlattr_c2"]["ymlattr_c3"].text) + # + source = { "xmlattr_xmlattr_c1" => "t1", + "xmlele_xmlattr_c2" => { + XSD::QName.new("urn:foo", "xmlele_xmlele_c3") => "t3" }} + obj = SOAPElement.from_obj(source) + assert_equal("t1", obj.extraattr[XSD::QName.new(nil, "xmlattr_c1")]) + assert_equal("t3", obj["xmlattr_c2"]["xmlele_c3"].text) + end +end + + +end diff --git a/test/soap/test_streamhandler.rb b/test/soap/test_streamhandler.rb new file mode 100644 index 0000000..72f15a9 --- /dev/null +++ b/test/soap/test_streamhandler.rb @@ -0,0 +1,270 @@ +require 'test/unit' +require 'soap/rpc/driver' +require 'webrick' +require 'webrick/httpproxy' +require 'logger' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', 'testutil.rb') + + +module SOAP + + +class TestStreamHandler < Test::Unit::TestCase + Port = 17171 + ProxyPort = 17172 + + def setup + @logger = Logger.new(STDERR) + @logger.level = Logger::Severity::FATAL + @url = "http://localhost:#{Port}/" + @proxyurl = "http://localhost:#{ProxyPort}/" + @server = @proxyserver = @client = nil + @server_thread = @proxyserver_thread = nil + setup_server + setup_client + end + + def teardown + teardown_client if @client + teardown_proxyserver if @proxyserver + teardown_server if @server + end + + def setup_server + @server = WEBrick::HTTPServer.new( + :BindAddress => "0.0.0.0", + :Logger => @logger, + :Port => Port, + :AccessLog => [], + :DocumentRoot => File.dirname(File.expand_path(__FILE__)) + ) + @server.mount( + '/', + WEBrick::HTTPServlet::ProcHandler.new(method(:do_server_proc).to_proc) + ) + htpasswd = File.join(File.dirname(__FILE__), 'htpasswd') + htpasswd_userdb = WEBrick::HTTPAuth::Htpasswd.new(htpasswd) + @basic_auth = WEBrick::HTTPAuth::BasicAuth.new( + :Logger => @logger, + :Realm => 'auth', + :UserDB => htpasswd_userdb + ) + @server.mount( + '/basic_auth', + WEBrick::HTTPServlet::ProcHandler.new(method(:do_server_proc_basic_auth).to_proc) + ) + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_proxyserver + @proxyserver = WEBrick::HTTPProxyServer.new( + :BindAddress => "0.0.0.0", + :Logger => @logger, + :Port => ProxyPort, + :AccessLog => [] + ) + @proxyserver_thread = TestUtil.start_server_thread(@proxyserver) + end + + def setup_client + @client = SOAP::RPC::Driver.new(@url, '') + @client.add_method("do_server_proc") + @client.add_method("do_server_proc_basic_auth") + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def teardown_proxyserver + @proxyserver.shutdown + @proxyserver_thread.kill + @proxyserver_thread.join + end + + def teardown_client + @client.reset_stream + end + + def do_server_proc(req, res) + res['content-type'] = 'text/xml' + res.body = <<__EOX__ + + + + + + + + +__EOX__ + end + + def do_server_proc_basic_auth(req, res) + @basic_auth.authenticate(req, res) + do_server_proc(req, res) + end + + def parse_req_header(str) + parse_req_header_http_access2(str) + end + + def parse_req_header_http_access2(str) + headerp = false + headers = {} + req = nil + str.split(/(?:\r?\n)/).each do |line| + if headerp and /^$/ =~line + headerp = false + break + end + if headerp + k, v = line.scan(/^([^:]+):\s*(.*)$/)[0] + headers[k.downcase] = v + end + if /^POST/ =~ line + req = line + headerp = true + end + end + return req, headers + end + + def test_normal + str = "" + @client.wiredump_dev = str + assert_nil(@client.do_server_proc) + r, h = parse_req_header(str) + assert_match(%r"POST / HTTP/1.", r) + assert(/^text\/xml;/ =~ h["content-type"]) + end + + def test_uri + # initialize client with URI object + @client = SOAP::RPC::Driver.new(URI.parse(@url), '') + @client.add_method("do_server_proc") + # same as test_normal + str = "" + @client.wiredump_dev = str + assert_nil(@client.do_server_proc) + r, h = parse_req_header(str) + assert_match(%r"POST / HTTP/1.", r) + assert(/^text\/xml;/ =~ h["content-type"]) + end + + def test_basic_auth + unless Object.const_defined?('HTTPClient') + # soap4r + net/http + basic_auth is not supported. + # use httpclient instead. + assert(true) + return + end + @client.endpoint_url = @url + 'basic_auth' + str = "" + @client.wiredump_dev = str + @client.options['protocol.http.basic_auth']['0'] = [@url, "admin", "admin"] + assert_nil(@client.do_server_proc_basic_auth) + @client.options["protocol.http.basic_auth"] << [@url, "admin", "admin"] + assert_nil(@client.do_server_proc_basic_auth) + end + + def test_proxy + if Object.const_defined?('HTTPClient') + backup = HTTPClient::NO_PROXY_HOSTS.dup + HTTPClient::NO_PROXY_HOSTS.clear + else + backup = SOAP::NetHttpClient::NO_PROXY_HOSTS.dup + SOAP::NetHttpClient::NO_PROXY_HOSTS.clear + end + setup_proxyserver + str = "" + @client.wiredump_dev = str + @client.options["protocol.http.proxy"] = @proxyurl + assert_nil(@client.do_server_proc) + r, h = parse_req_header(str) + assert_match(%r"POST http://localhost:17171/ HTTP/1.", r) + # illegal proxy uri + assert_raise(ArgumentError) do + @client.options["protocol.http.proxy"] = 'ftp://foo:8080' + end + ensure + if Object.const_defined?('HTTPClient') + HTTPClient::NO_PROXY_HOSTS.replace(backup) + else + SOAP::NetHttpClient::NO_PROXY_HOSTS.replace(backup) + end + end + + def test_charset + str = "" + @client.wiredump_dev = str + @client.options["protocol.http.charset"] = "iso-8859-8" + assert_nil(@client.do_server_proc) + r, h = parse_req_header(str) + assert_equal("text/xml; charset=iso-8859-8", h["content-type"]) + # + str.replace("") + @client.options["protocol.http.charset"] = "iso-8859-3" + assert_nil(@client.do_server_proc) + r, h = parse_req_header(str) + assert_equal("text/xml; charset=iso-8859-3", h["content-type"]) + end + + def test_custom_streamhandler + @client.options["protocol.streamhandler"] = MyStreamHandler + assert_equal("hello", @client.do_server_proc) + @client.options["protocol.streamhandler"] = ::SOAP::HTTPStreamHandler + assert_nil(@client.do_server_proc) + @client.options["protocol.streamhandler"] = MyStreamHandler + assert_equal("hello", @client.do_server_proc) + @client.options["protocol.streamhandler"] = ::SOAP::HTTPStreamHandler + assert_nil(@client.do_server_proc) + end + + class MyStreamHandler < SOAP::StreamHandler + def self.create(options) + new + end + + def send(endpoint_url, conn_data, soapaction = nil, charset = nil) + conn_data.receive_string = %q[ + + + + hello + + +] + conn_data + end + + def reset(endpoint_url = nil) + # nothing to do + end + end + + # not used + class ExternalProcessStreamHandler < SOAP::StreamHandler + def self.create(options) + new + end + + def send(endpoint_url, conn_data, soapaction = nil, charset = nil) + cmd = "cat" # !! + IO.popen(cmd, "w+") do |io| + io.write(conn_data.send_string) + io.close_write + conn_data.receive_string = io.read + end + conn_data + end + + def reset(endpoint_url = nil) + end + end +end + + +end diff --git a/test/soap/test_styleuse.rb b/test/soap/test_styleuse.rb new file mode 100644 index 0000000..30da62b --- /dev/null +++ b/test/soap/test_styleuse.rb @@ -0,0 +1,326 @@ +require 'test/unit' +require 'soap/rpc/httpserver' +require 'soap/rpc/driver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', 'testutil.rb') + + +module SOAP + + +class TestStyleUse < Test::Unit::TestCase + # rpc driver: obj in(Hash allowed for literal), obj out + # + # style: not visible from user + # rpc: wrapped element + # document: unwrappted element + # + # use: + # encoding: a graph (SOAP Data Model) + # literal: not a graph (SOAPElement) + # + # rpc stub: obj in, obj out(Hash is allowed for literal) + # + # style: not visible from user + # rpc: wrapped element + # document: unwrappted element + # + # use: + # encoding: a graph (SOAP Data Model) + # literal: not a graph (SOAPElement) + # + # document driver: SOAPElement in, SOAPElement out? [not implemented] + # + # style: ditto + # use: ditto + # + # + # document stub: SOAPElement in, SOAPElement out? [not implemented] + # + # style: ditto + # use: ditto + # + class GenericServant + # method name style: requeststyle_requestuse_responsestyle_responseuse + + # 2 params -> array + def rpc_enc_rpc_enc(obj1, obj2) + [obj1, [obj1, obj2]] + end + + # 2 objs -> array + def rpc_lit_rpc_enc(obj1, obj2) + [obj2, obj1] + end + + # 2 params -> 2 params + def rpc_enc_rpc_lit(obj1, obj2) + klass = [obj1.class.name, obj2.class.name] + [obj2, obj1] + end + + # 2 objs -> 2 objs + def rpc_lit_rpc_lit(obj1, obj2) + [obj1, obj2] + end + + # 2 params -> array + def doc_enc_doc_enc(obj1, obj2) + [obj1, [obj1, obj2]] + end + + # 2 objs -> array + def doc_lit_doc_enc(obj1, obj2) + [obj2, obj1] + end + + # 2 params -> 2 hashes + def doc_enc_doc_lit(obj1, obj2) + klass = [obj1.class.name, obj2.class.name] + return {'obj1' => {'klass' => klass}, 'misc' => 'hash does not have an order'}, + {'obj2' => {'klass' => klass}} + end + + # 2 objs -> 2 objs + def doc_lit_doc_lit(obj1, obj2) + return obj1, obj2 + end + end + + Namespace = "urn:styleuse" + + module Op + def self.opt(request_style, request_use, response_style, response_use) + { + :request_style => request_style, + :request_use => request_use, + :response_style => response_style, + :response_use => response_use + } + end + + Op_rpc_enc_rpc_enc = [ + XSD::QName.new(Namespace, 'rpc_enc_rpc_enc'), + nil, + 'rpc_enc_rpc_enc', [ + [:in, 'obj1', nil], + [:in, 'obj2', nil], + [:retval, 'return', nil]], + opt(:rpc, :encoded, :rpc, :encoded) + ] + + Op_rpc_lit_rpc_enc = [ + XSD::QName.new(Namespace, 'rpc_lit_rpc_enc'), + nil, + 'rpc_lit_rpc_enc', [ + [:in, 'obj1', nil], + [:in, 'obj2', nil], + [:retval, 'return', nil]], + opt(:rpc, :literal, :rpc, :encoded) + ] + + Op_rpc_enc_rpc_lit = [ + XSD::QName.new(Namespace, 'rpc_enc_rpc_lit'), + nil, + 'rpc_enc_rpc_lit', [ + [:in, 'obj1', nil], + [:in, 'obj2', nil], + [:retval, 'ret1', nil], + [:out, 'ret2', nil]], + opt(:rpc, :encoded, :rpc, :literal) + ] + + Op_rpc_lit_rpc_lit = [ + XSD::QName.new(Namespace, 'rpc_lit_rpc_lit'), + nil, + 'rpc_lit_rpc_lit', [ + [:in, 'obj1', nil], + [:in, 'obj2', nil], + [:retval, 'ret1', nil], + [:out, 'ret2', nil]], + opt(:rpc, :literal, :rpc, :literal) + ] + + Op_doc_enc_doc_enc = [ + Namespace + 'doc_enc_doc_enc', + 'doc_enc_doc_enc', [ + [:in, 'obj1', [nil, Namespace, 'obj1']], + [:in, 'obj2', [nil, Namespace, 'obj2']], + [:out, 'ret1', [nil, Namespace, 'ret1']], + [:out, 'ret2', [nil, Namespace, 'ret2']]], + opt(:document, :encoded, :document, :encoded) + ] + + Op_doc_lit_doc_enc = [ + Namespace + 'doc_lit_doc_enc', + 'doc_lit_doc_enc', [ + [:in, 'obj1', [nil, Namespace, 'obj1']], + [:in, 'obj2', [nil, Namespace, 'obj2']], + [:out, 'ret1', [nil, Namespace, 'ret1']], + [:out, 'ret2', [nil, Namespace, 'ret2']]], + opt(:document, :literal, :document, :encoded) + ] + + Op_doc_enc_doc_lit = [ + Namespace + 'doc_enc_doc_lit', + 'doc_enc_doc_lit', [ + [:in, 'obj1', [nil, Namespace, 'obj1']], + [:in, 'obj2', [nil, Namespace, 'obj2']], + [:out, 'ret1', [nil, Namespace, 'ret1']], + [:out, 'ret2', [nil, Namespace, 'ret2']]], + opt(:document, :encoded, :document, :literal) + ] + + Op_doc_lit_doc_lit = [ + Namespace + 'doc_lit_doc_lit', + 'doc_lit_doc_lit', [ + [:in, 'obj1', [nil, Namespace, 'obj1']], + [:in, 'obj2', [nil, Namespace, 'obj2']], + [:out, 'ret1', [nil, Namespace, 'ret1']], + [:out, 'ret2', [nil, Namespace, 'ret2']]], + opt(:document, :literal, :document, :literal) + ] + end + + include Op + + class Server < ::SOAP::RPC::HTTPServer + include Op + + def on_init + @servant = GenericServant.new + add_rpc_operation(@servant, *Op_rpc_enc_rpc_enc) + add_rpc_operation(@servant, *Op_rpc_lit_rpc_enc) + add_rpc_operation(@servant, *Op_rpc_enc_rpc_lit) + add_rpc_operation(@servant, *Op_rpc_lit_rpc_lit) + add_document_operation(@servant, *Op_doc_enc_doc_enc) + add_document_operation(@servant, *Op_doc_lit_doc_enc) + add_document_operation(@servant, *Op_doc_enc_doc_lit) + add_document_operation(@servant, *Op_doc_lit_doc_lit) + end + end + + Port = 17171 + + def setup + setup_server + setup_client + end + + def setup_server + @server = Server.new( + :BindAddress => "0.0.0.0", + :Port => Port, + :AccessLog => [], + :SOAPDefaultNamespace => Namespace + ) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_client + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/", Namespace) + @client.wiredump_dev = STDERR if $DEBUG + @client.add_rpc_operation(*Op_rpc_enc_rpc_enc) + @client.add_rpc_operation(*Op_rpc_lit_rpc_enc) + @client.add_rpc_operation(*Op_rpc_enc_rpc_lit) + @client.add_rpc_operation(*Op_rpc_lit_rpc_lit) + @client.add_document_operation(*Op_doc_enc_doc_enc) + @client.add_document_operation(*Op_doc_lit_doc_enc) + @client.add_document_operation(*Op_doc_enc_doc_lit) + @client.add_document_operation(*Op_doc_lit_doc_lit) + end + + def teardown + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def teardown_client + @client.reset_stream + end + + def test_rpc_enc_rpc_enc + o = "hello" + obj1 = o + obj2 = [1] + ret = @client.rpc_enc_rpc_enc(obj1, obj2) + # server returns [obj1, [obj1, obj2]] + assert_equal([obj1, [obj1, obj2]], ret) + assert_same(ret[0], ret[1][0]) + end + + S1 = ::Struct.new(:a) + S2 = ::Struct.new(:c) + def test_rpc_lit_rpc_enc + ret1, ret2 = @client.rpc_lit_rpc_enc(S1.new('b'), S2.new('d')) + assert_equal('d', ret1.c) + assert_equal('b', ret2.a) + # Hash is allowed for literal + ret1, ret2 = @client.rpc_lit_rpc_enc({'a' => 'b'}, {'c' => 'd'}) + assert_equal('d', ret1.c) + assert_equal('b', ret2.a) + # simple value + assert_equal( + ['1', 'a'], + @client.rpc_lit_rpc_enc('a', 1) + ) + end + + def test_rpc_enc_rpc_lit + assert_equal( + ['1', 'a'], + @client.rpc_enc_rpc_lit('a', '1') + ) + end + + def test_rpc_lit_rpc_lit + ret1, ret2 = @client.rpc_lit_rpc_lit({'a' => 'b'}, {'c' => 'd'}) + assert_equal('b', ret1["a"]) + assert_equal('d', ret2["c"]) + end + + def test_doc_enc_doc_enc + o = "hello" + obj1 = o + obj2 = [1] + ret = @client.rpc_enc_rpc_enc(obj1, obj2) + # server returns [obj1, [obj1, obj2]] + assert_equal([obj1, [obj1, obj2]], ret) + assert_same(ret[0], ret[1][0]) + end + + def test_doc_lit_doc_enc + ret1, ret2 = @client.doc_lit_doc_enc({'a' => 'b'}, {'c' => 'd'}) + assert_equal('d', ret1.c) + assert_equal('b', ret2.a) + assert_equal( + ['a', '1'], + @client.doc_lit_doc_enc(1, 'a') + ) + end + + def test_doc_enc_doc_lit + ret1, ret2 = @client.doc_enc_doc_lit('a', 1) + # literal Array + assert_equal(['String', 'Fixnum'], ret1['obj1']['klass']) + # same value + assert_equal(ret1['obj1']['klass'], ret2['obj2']['klass']) + # not the same object (not encoded) + assert_not_same(ret1['obj1']['klass'], ret2['obj2']['klass']) + end + + def test_doc_lit_doc_lit + ret1, ret2 = @client.doc_lit_doc_lit({'a' => 'b'}, {'c' => 'd'}) + assert_equal('b', ret1["a"]) + assert_equal('d', ret2["c"]) + end +end + + +end diff --git a/test/soap/wsdlDriver/README.txt b/test/soap/wsdlDriver/README.txt new file mode 100644 index 0000000..b4d45a0 --- /dev/null +++ b/test/soap/wsdlDriver/README.txt @@ -0,0 +1,2 @@ +echo_version.rb is generated by wsdl2ruby.rb; +% wsdl2ruby.rb --wsdl simpletype.wsdl --classdef --force diff --git a/test/soap/wsdlDriver/calc.wsdl b/test/soap/wsdlDriver/calc.wsdl new file mode 100644 index 0000000..694a01e --- /dev/null +++ b/test/soap/wsdlDriver/calc.wsdl @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + calculator service + + + + + diff --git a/test/soap/wsdlDriver/document.wsdl b/test/soap/wsdlDriver/document.wsdl new file mode 100644 index 0000000..5e9e74b --- /dev/null +++ b/test/soap/wsdlDriver/document.wsdl @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/soap/wsdlDriver/echo_version.rb b/test/soap/wsdlDriver/echo_version.rb new file mode 100644 index 0000000..a96179c --- /dev/null +++ b/test/soap/wsdlDriver/echo_version.rb @@ -0,0 +1,29 @@ +require 'xsd/qname' + +# {urn:example.com:simpletype-rpc-type}version_struct +class Version_struct + @@schema_type = "version_struct" + @@schema_ns = "urn:example.com:simpletype-rpc-type" + @@schema_element = [ + ["myversion", ["SOAP::SOAPString", XSD::QName.new(nil, "myversion")]], + ["msg", ["SOAP::SOAPString", XSD::QName.new(nil, "msg")]] + ] + + attr_accessor :myversion + attr_accessor :msg + + def initialize(myversion = nil, msg = nil) + @myversion = myversion + @msg = msg + end +end + +# {urn:example.com:simpletype-rpc-type}myversions +class Myversions < ::String + @@schema_type = "myversions" + @@schema_ns = "urn:example.com:simpletype-rpc-type" + + C_16 = Myversions.new("1.6") + C_18 = Myversions.new("1.8") + C_19 = Myversions.new("1.9") +end diff --git a/test/soap/wsdlDriver/simpletype.wsdl b/test/soap/wsdlDriver/simpletype.wsdl new file mode 100644 index 0000000..6781dda --- /dev/null +++ b/test/soap/wsdlDriver/simpletype.wsdl @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/soap/wsdlDriver/test_calc.rb b/test/soap/wsdlDriver/test_calc.rb new file mode 100644 index 0000000..005b21d --- /dev/null +++ b/test/soap/wsdlDriver/test_calc.rb @@ -0,0 +1,71 @@ +require 'test/unit' +require 'soap/rpc/httpserver' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module SOAP + + +class TestCalc < Test::Unit::TestCase + class Server < ::SOAP::RPC::HTTPServer + def on_init + add_method(self, 'add', 'x', 'y') + end + + def add(x, y) + x.to_f + y.to_f + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + Port = 17171 + + def setup + setup_server + setup_client + end + + def setup_server + @server = Server.new( + :BindAddress => "0.0.0.0", + :Port => Port, + :AccessLog => [], + :SOAPDefaultNamespace => 'http://www.fred.com' + ) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_client + @wsdl = File.join(DIR, 'calc.wsdl') + end + + def teardown + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def teardown_client + @client.reset_stream if @client + end + + def test_rpc_driver + @client = ::SOAP::WSDLDriverFactory.new(@wsdl).create_rpc_driver + @client.wiredump_dev = STDOUT if $DEBUG + @client.endpoint_url = "http://localhost:#{Port}/" + @client.generate_explicit_type = true + assert_equal(0.3, @client.add(0.1, 0.2)) + @client.generate_explicit_type = false + assert_equal(0.3, @client.add(0.1, 0.2)) + end +end + + +end diff --git a/test/soap/wsdlDriver/test_document.rb b/test/soap/wsdlDriver/test_document.rb new file mode 100644 index 0000000..4926eef --- /dev/null +++ b/test/soap/wsdlDriver/test_document.rb @@ -0,0 +1,71 @@ +require 'test/unit' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module SOAP + + +class TestDocument < Test::Unit::TestCase + Namespace = 'urn:example.com:document' + + class Server < ::SOAP::RPC::StandaloneServer + def on_init + add_document_method(self, 'urn:example.com:document#submit', 'submit', XSD::QName.new(Namespace, 'ruby'), XSD::QName.new(Namespace, 'ruby')) + end + + def submit(ruby) + ruby + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_server + setup_client + end + + def setup_server + @server = Server.new('Test', Namespace, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_client + wsdl = File.join(DIR, 'document.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + end + + def teardown + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def teardown_client + @client.reset_stream + end + + def test_document + msg = {'myversion' => "1.9", 'date' => "2004-01-01T00:00:00Z"} + reply_msg = @client.submit(msg) + assert_equal('1.9', reply_msg.myversion) + assert_equal('1.9', reply_msg['myversion']) + assert_equal('2004-01-01T00:00:00Z', reply_msg.date) + assert_equal('2004-01-01T00:00:00Z', reply_msg['date']) + end +end + + +end diff --git a/test/soap/wsdlDriver/test_simpletype.rb b/test/soap/wsdlDriver/test_simpletype.rb new file mode 100644 index 0000000..9f1880e --- /dev/null +++ b/test/soap/wsdlDriver/test_simpletype.rb @@ -0,0 +1,80 @@ +require 'test/unit' +require 'soap/rpc/httpserver' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module SOAP + + +class TestSimpleType < Test::Unit::TestCase + class Server < ::SOAP::RPC::HTTPServer + def on_init + add_method(self, 'echo_version', 'version') + end + + def echo_version(version) + # "2.0" is out of range. + Version_struct.new(version || "2.0", 'checked') + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + require File.join(DIR, 'echo_version') + + Port = 17171 + + def setup + setup_server + setup_client + end + + def setup_server + @server = Server.new( + :BindAddress => "0.0.0.0", + :Port => Port, + :AccessLog => [], + :SOAPDefaultNamespace => "urn:example.com:simpletype-rpc" + ) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_client + wsdl = File.join(DIR, 'simpletype.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.wiredump_dev = STDOUT if $DEBUG + @client.endpoint_url = "http://localhost:#{Port}/" + @client.generate_explicit_type = false + end + + def teardown + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def teardown_client + @client.reset_stream + end + + def test_ping + result = @client.echo_version("1.9") + assert_equal("1.9", result.myversion) + assert_equal("checked", result.msg) + assert_raise(XSD::ValueSpaceError) do + @client.echo_version("2.0") + end + assert_raise(XSD::ValueSpaceError) do + @client.echo_version(nil) # nil => "2.0" => out of range + end + end +end + + +end diff --git a/test/testutil.rb b/test/testutil.rb new file mode 100644 index 0000000..8bab07e --- /dev/null +++ b/test/testutil.rb @@ -0,0 +1,54 @@ +module TestUtil + # MT-unsafe + def self.require(dir, *features) + begin + # avoid 'already initialized constant FizzBuzz' warning + silent do + Dir.chdir(dir) do + features.each do |feature| + Kernel.require feature + end + end + end + ensure + features.each do |feature| + $".delete(feature) + end + end + end + + # MT-unsafe + def self.silent + if $DEBUG + yield + else + back = $VERBOSE + $VERBOSE = nil + begin + yield + ensure + $VERBOSE = back + end + end + end + + def self.filecompare(expectedfile, actualfile) + expected = loadfile(expectedfile) + actual = loadfile(actualfile) + if expected != actual + raise "#{File.basename(actualfile)} is different from #{File.basename(expectedfile)}" + end + end + + def self.loadfile(file) + File.open(file) { |f| f.read } + end + + def self.start_server_thread(server) + t = Thread.new { + Thread.current.abort_on_exception = true + server.start + } + t + end +end diff --git a/test/wsdl/abstract/abstract.wsdl b/test/wsdl/abstract/abstract.wsdl new file mode 100644 index 0000000..4d3a29a --- /dev/null +++ b/test/wsdl/abstract/abstract.wsdl @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/abstract/test_abstract.rb b/test/wsdl/abstract/test_abstract.rb new file mode 100644 index 0000000..c80691b --- /dev/null +++ b/test/wsdl/abstract/test_abstract.rb @@ -0,0 +1,159 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module Abstract + + +class TestAbstract < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + def on_init + add_rpc_method(self, 'echo', 'name', 'author') + add_rpc_method(self, 'echoDerived', 'parameter') + add_document_operation( + self, + "", + "echoLiteral", + [ [:in, "author", ["::SOAP::SOAPElement", "urn:www.example.org:abstract", "Author"]], + [:out, "return", ["::SOAP::SOAPElement", "urn:www.example.org:abstract", "Book"]] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal, + :faults => {} } + ) + self.mapping_registry = AbstractMappingRegistry::EncodedRegistry + self.literal_mapping_registry = AbstractMappingRegistry::LiteralRegistry + end + + def echo(name, author) + Book.new(name, author) + end + + def echoLiteral(author) + author + end + + def echoDerived(parameter) + parameter + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_classdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('abstract.rb')) + File.unlink(pathname('abstractMappingRegistry.rb')) + File.unlink(pathname('abstractDriver.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', "urn:www.example.org:abstract", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("abstract.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'abstractDriver.rb', 'abstract.rb', 'abstractMappingRegistry.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_wsdl + wsdl = File.join(DIR, 'abstract.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.mapping_registry = AbstractMappingRegistry::EncodedRegistry + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDERR if $DEBUG + + author = UserAuthor.new("first", "last", "uid") + ret = @client.echo("book1", author) + assert_equal("book1", ret.name) + assert_equal(author.firstname, ret.author.firstname) + assert_equal(author.lastname, ret.author.lastname) + assert_equal(author.userid, ret.author.userid) + + author = NonUserAuthor.new("first", "last", "nonuserid") + ret = @client.echo("book2", author) + assert_equal("book2", ret.name) + assert_equal(author.firstname, ret.author.firstname) + assert_equal(author.lastname, ret.author.lastname) + assert_equal(author.nonuserid, ret.author.nonuserid) + end + + def test_stub + @client = AbstractService.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDERR if $DEBUG + + author = UserAuthor.new("first", "last", "uid") + ret = @client.echo("book1", author) + assert_equal("book1", ret.name) + assert_equal(author.firstname, ret.author.firstname) + assert_equal(author.lastname, ret.author.lastname) + assert_equal(author.userid, ret.author.userid) + # + author = NonUserAuthor.new("first", "last", "nonuserid") + ret = @client.echo("book2", author) + assert_equal("book2", ret.name) + assert_equal(author.firstname, ret.author.firstname) + assert_equal(author.lastname, ret.author.lastname) + assert_equal(author.nonuserid, ret.author.nonuserid) + end + + def test_literal_stub + @client = AbstractService.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDERR if $DEBUG + author = NonUserAuthor.new("first", "last", "nonuserid") + ret = @client.echoLiteral(author) + assert_equal(author.firstname, ret.firstname) + assert_equal(author.lastname, ret.lastname) + assert_equal(author.nonuserid, ret.nonuserid) + assert_equal(NonUserAuthor, ret.class) + end + + def test_stub_derived + @client = AbstractService.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDERR if $DEBUG + + parameter = DerivedClass1.new(123, "someVar1") + ret = @client.echoDerived(parameter) + assert_equal(123, ret.id) + assert_equal(["someVar1"], ret.someVar1) + assert_equal(DerivedClass1, ret.class) + end +end + + +end; end diff --git a/test/wsdl/anonymous/expectedClassDef.rb b/test/wsdl/anonymous/expectedClassDef.rb new file mode 100644 index 0000000..fec47b7 --- /dev/null +++ b/test/wsdl/anonymous/expectedClassDef.rb @@ -0,0 +1,128 @@ +require 'xsd/qname' + +module WSDL; module Anonymous + + +# {urn:lp}Header +# header3 - SOAP::SOAPString +class Header + attr_accessor :header3 + + def initialize(header3 = nil) + @header3 = header3 + end +end + +# {urn:lp}ExtraInfo +class ExtraInfo < ::Array + + # {}Entry + # key - SOAP::SOAPString + # value - SOAP::SOAPString + class Entry + attr_accessor :key + attr_accessor :value + + def initialize(key = nil, value = nil) + @key = key + @value = value + end + end +end + +# {urn:lp}loginResponse +# loginResult - WSDL::Anonymous::LoginResponse::LoginResult +class LoginResponse + + # inner class for member: loginResult + # {}loginResult + # sessionID - SOAP::SOAPString + class LoginResult + attr_accessor :sessionID + + def initialize(sessionID = nil) + @sessionID = sessionID + end + end + + attr_accessor :loginResult + + def initialize(loginResult = nil) + @loginResult = loginResult + end +end + +# {urn:lp}Pack +# header - WSDL::Anonymous::Pack::Header +class Pack + + # inner class for member: Header + # {}Header + # header1 - SOAP::SOAPString + class Header + attr_accessor :header1 + + def initialize(header1 = nil) + @header1 = header1 + end + end + + attr_accessor :header + + def initialize(header = nil) + @header = header + end +end + +# {urn:lp}Envelope +# header - WSDL::Anonymous::Envelope::Header +class Envelope + + # inner class for member: Header + # {}Header + # header2 - SOAP::SOAPString + class Header + attr_accessor :header2 + + def initialize(header2 = nil) + @header2 = header2 + end + end + + attr_accessor :header + + def initialize(header = nil) + @header = header + end +end + +# {urn:lp}login +# loginRequest - WSDL::Anonymous::Login::LoginRequest +class Login + + # inner class for member: loginRequest + # {}loginRequest + # username - SOAP::SOAPString + # password - SOAP::SOAPString + # timezone - SOAP::SOAPString + class LoginRequest + attr_accessor :username + attr_accessor :password + attr_accessor :timezone + + def initialize(username = nil, password = nil, timezone = nil) + @username = username + @password = password + @timezone = timezone + end + end + + attr_accessor :loginRequest + + def initialize(loginRequest = nil) + @loginRequest = loginRequest + end +end + + +end; end diff --git a/test/wsdl/anonymous/expectedDriver.rb b/test/wsdl/anonymous/expectedDriver.rb new file mode 100644 index 0000000..9aa4b36 --- /dev/null +++ b/test/wsdl/anonymous/expectedDriver.rb @@ -0,0 +1,59 @@ +require 'lp.rb' +require 'lpMappingRegistry.rb' +require 'soap/rpc/driver' + +module WSDL::Anonymous + +class Lp_porttype < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://localhost:17171/" + + Methods = [ + [ "urn:lp:login", + "login", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:lp", "login"]], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:lp", "loginResponse"]] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal, + :faults => {} } + ], + [ "urn:lp:echo", + "echo", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:lp", "Pack"]], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:lp", "Envelope"]] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal, + :faults => {} } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = LpMappingRegistry::EncodedRegistry + self.literal_mapping_registry = LpMappingRegistry::LiteralRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end + + +end diff --git a/test/wsdl/anonymous/expectedMappingRegistry.rb b/test/wsdl/anonymous/expectedMappingRegistry.rb new file mode 100644 index 0000000..371fbdf --- /dev/null +++ b/test/wsdl/anonymous/expectedMappingRegistry.rb @@ -0,0 +1,176 @@ +require 'lp.rb' +require 'soap/mapping' + +module WSDL; module Anonymous + +module LpMappingRegistry + EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new + LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new + NsLp = "urn:lp" + + EncodedRegistry.register( + :class => WSDL::Anonymous::Header, + :schema_type => XSD::QName.new(NsLp, "Header"), + :schema_element => [ + ["header3", ["SOAP::SOAPString", XSD::QName.new(nil, "Header3")]] + ] + ) + + EncodedRegistry.register( + :class => WSDL::Anonymous::ExtraInfo, + :schema_type => XSD::QName.new(NsLp, "ExtraInfo"), + :schema_element => [ + ["entry", ["WSDL::Anonymous::ExtraInfo::Entry[]", XSD::QName.new(nil, "Entry")], [1, nil]] + ] + ) + + EncodedRegistry.register( + :class => WSDL::Anonymous::ExtraInfo::Entry, + :schema_name => XSD::QName.new(nil, "Entry"), + :is_anonymous => true, + :schema_qualified => false, + :schema_element => [ + ["key", ["SOAP::SOAPString", XSD::QName.new(nil, "Key")]], + ["value", ["SOAP::SOAPString", XSD::QName.new(nil, "Value")]] + ] + ) + + EncodedRegistry.register( + :class => WSDL::Anonymous::LoginResponse, + :schema_type => XSD::QName.new(NsLp, "loginResponse"), + :schema_element => [ + ["loginResult", ["WSDL::Anonymous::LoginResponse::LoginResult", XSD::QName.new(nil, "loginResult")]] + ] + ) + + EncodedRegistry.register( + :class => WSDL::Anonymous::LoginResponse::LoginResult, + :schema_name => XSD::QName.new(nil, "loginResult"), + :is_anonymous => true, + :schema_qualified => false, + :schema_element => [ + ["sessionID", "SOAP::SOAPString"] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Anonymous::Header, + :schema_type => XSD::QName.new(NsLp, "Header"), + :schema_element => [ + ["header3", ["SOAP::SOAPString", XSD::QName.new(nil, "Header3")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Anonymous::ExtraInfo, + :schema_type => XSD::QName.new(NsLp, "ExtraInfo"), + :schema_element => [ + ["entry", ["WSDL::Anonymous::ExtraInfo::Entry[]", XSD::QName.new(nil, "Entry")], [1, nil]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Anonymous::ExtraInfo::Entry, + :schema_name => XSD::QName.new(nil, "Entry"), + :is_anonymous => true, + :schema_qualified => false, + :schema_element => [ + ["key", ["SOAP::SOAPString", XSD::QName.new(nil, "Key")]], + ["value", ["SOAP::SOAPString", XSD::QName.new(nil, "Value")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Anonymous::LoginResponse, + :schema_type => XSD::QName.new(NsLp, "loginResponse"), + :schema_element => [ + ["loginResult", ["WSDL::Anonymous::LoginResponse::LoginResult", XSD::QName.new(nil, "loginResult")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Anonymous::LoginResponse::LoginResult, + :schema_name => XSD::QName.new(nil, "loginResult"), + :is_anonymous => true, + :schema_qualified => false, + :schema_element => [ + ["sessionID", "SOAP::SOAPString"] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Anonymous::Pack, + :schema_name => XSD::QName.new(NsLp, "Pack"), + :schema_element => [ + ["header", ["WSDL::Anonymous::Pack::Header", XSD::QName.new(nil, "Header")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Anonymous::Pack::Header, + :schema_name => XSD::QName.new(nil, "Header"), + :is_anonymous => true, + :schema_qualified => false, + :schema_element => [ + ["header1", ["SOAP::SOAPString", XSD::QName.new(nil, "Header1")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Anonymous::Envelope, + :schema_name => XSD::QName.new(NsLp, "Envelope"), + :schema_element => [ + ["header", ["WSDL::Anonymous::Envelope::Header", XSD::QName.new(nil, "Header")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Anonymous::Envelope::Header, + :schema_name => XSD::QName.new(nil, "Header"), + :is_anonymous => true, + :schema_qualified => false, + :schema_element => [ + ["header2", ["SOAP::SOAPString", XSD::QName.new(nil, "Header2")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Anonymous::Login, + :schema_name => XSD::QName.new(NsLp, "login"), + :schema_element => [ + ["loginRequest", ["WSDL::Anonymous::Login::LoginRequest", XSD::QName.new(nil, "loginRequest")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Anonymous::Login::LoginRequest, + :schema_name => XSD::QName.new(nil, "loginRequest"), + :is_anonymous => true, + :schema_qualified => false, + :schema_element => [ + ["username", "SOAP::SOAPString"], + ["password", "SOAP::SOAPString"], + ["timezone", "SOAP::SOAPString", [0, 1]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Anonymous::LoginResponse, + :schema_name => XSD::QName.new(NsLp, "loginResponse"), + :schema_element => [ + ["loginResult", ["WSDL::Anonymous::LoginResponse::LoginResult", XSD::QName.new(nil, "loginResult")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Anonymous::LoginResponse::LoginResult, + :schema_name => XSD::QName.new(nil, "loginResult"), + :is_anonymous => true, + :schema_qualified => false, + :schema_element => [ + ["sessionID", "SOAP::SOAPString"] + ] + ) +end + +end; end diff --git a/test/wsdl/anonymous/lp.wsdl b/test/wsdl/anonymous/lp.wsdl new file mode 100644 index 0000000..896866d --- /dev/null +++ b/test/wsdl/anonymous/lp.wsdl @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Service specific information. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/anonymous/test_anonymous.rb b/test/wsdl/anonymous/test_anonymous.rb new file mode 100644 index 0000000..dc40300 --- /dev/null +++ b/test/wsdl/anonymous/test_anonymous.rb @@ -0,0 +1,130 @@ +require 'test/unit' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +if defined?(HTTPClient) + +module WSDL; module Anonymous + + +class TestAnonymous < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = 'urn:lp' + + def on_init + add_document_method( + self, + Namespace + ':login', + 'login', + XSD::QName.new(Namespace, 'login'), + XSD::QName.new(Namespace, 'loginResponse') + ) + add_document_method( + self, + Namespace + ':echo', + 'echo', + XSD::QName.new(Namespace, 'Pack'), + XSD::QName.new(Namespace, 'Envelope') + ) + self.literal_mapping_registry = LpMappingRegistry::LiteralRegistry + end + + def login(arg) + req = arg.loginRequest + sess = [req.username, req.password, req.timezone].join + LoginResponse.new(LoginResponse::LoginResult.new(sess)) + end + + def echo(pack) + raise unless pack.class == Pack + raise unless pack.header.class == Pack::Header + Envelope.new(Envelope::Header.new(pack.header.header1)) + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + Port = 17171 + + def setup + setup_clientdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('lp.rb')) + File.unlink(pathname('lpMappingRegistry.rb')) + File.unlink(pathname('lpDriver.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', "urn:lp", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_clientdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("lp.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'lpDriver.rb', 'lpMappingRegistry.rb', 'lp.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def compare(expected, actual) + TestUtil.filecompare(pathname(expected), pathname(actual)) + end + + def test_stubgeneration + compare("expectedClassDef.rb", "lp.rb") + compare("expectedMappingRegistry.rb", "lpMappingRegistry.rb") + compare("expectedDriver.rb", "lpDriver.rb") + end + + def test_stub + @client = Lp_porttype.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDERR if $DEBUG + request = Login.new(Login::LoginRequest.new("username", "password", "tz")) + response = @client.login(request) + assert_equal(LoginResponse::LoginResult, response.loginResult.class) + assert_equal("usernamepasswordtz", response.loginResult.sessionID) + end + + def test_anonymous_mapping + @client = Lp_porttype.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDERR if $DEBUG + request = Pack.new(Pack::Header.new("pack_header")) + response = @client.echo(request) + assert_equal(Envelope, response.class) + assert_equal(Envelope::Header, response.header.class) + assert_equal("pack_header", response.header.header2) + end +end + + +end; end + +end diff --git a/test/wsdl/any/any.wsdl b/test/wsdl/any/any.wsdl new file mode 100644 index 0000000..6e09f88 --- /dev/null +++ b/test/wsdl/any/any.wsdl @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/any/expectedDriver.rb b/test/wsdl/any/expectedDriver.rb new file mode 100644 index 0000000..6737b44 --- /dev/null +++ b/test/wsdl/any/expectedDriver.rb @@ -0,0 +1,68 @@ +require 'echo.rb' +require 'echoMappingRegistry.rb' +require 'soap/rpc/driver' + +module WSDL::Any + +class Echo_port_type < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://localhost:10080" + NsEcho = "urn:example.com:echo" + + Methods = [ + [ "urn:example.com:echo", + "echo", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:example.com:echo-type", "foo.bar"]], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:example.com:echo-type", "foo.bar"]] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal, + :faults => {} } + ], + [ XSD::QName.new(NsEcho, "echoAny"), + "urn:example.com:echoAny", + "echoAny", + [ [:retval, "echoany_return", [nil]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ "urn:example.com:echo", + "setOutputAndComplete", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:example.com:echo-type", "setOutputAndCompleteRequest"]], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:example.com:echo-type", "setOutputAndCompleteRequest"]] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal, + :faults => {} } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = EchoMappingRegistry::EncodedRegistry + self.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end + + +end diff --git a/test/wsdl/any/expectedEcho.rb b/test/wsdl/any/expectedEcho.rb new file mode 100644 index 0000000..bc406e7 --- /dev/null +++ b/test/wsdl/any/expectedEcho.rb @@ -0,0 +1,57 @@ +require 'xsd/qname' + +module WSDL; module Any + + +# {urn:example.com:echo-type}foo.bar +# before - SOAP::SOAPString +# after - SOAP::SOAPString +class FooBar + attr_accessor :before + attr_reader :__xmlele_any + attr_accessor :after + + def set_any(elements) + @__xmlele_any = elements + end + + def initialize(before = nil, after = nil) + @before = before + @__xmlele_any = nil + @after = after + end +end + +# {urn:example.com:echo-type}setOutputAndCompleteRequest +# taskId - SOAP::SOAPString +# data - WSDL::Any::SetOutputAndCompleteRequest::C_Data +# participantToken - SOAP::SOAPString +class SetOutputAndCompleteRequest + + # inner class for member: data + # {}data + class C_Data + attr_reader :__xmlele_any + + def set_any(elements) + @__xmlele_any = elements + end + + def initialize + @__xmlele_any = nil + end + end + + attr_accessor :taskId + attr_accessor :data + attr_accessor :participantToken + + def initialize(taskId = nil, data = nil, participantToken = nil) + @taskId = taskId + @data = data + @participantToken = participantToken + end +end + + +end; end diff --git a/test/wsdl/any/expectedMappingRegistry.rb b/test/wsdl/any/expectedMappingRegistry.rb new file mode 100644 index 0000000..870ae8f --- /dev/null +++ b/test/wsdl/any/expectedMappingRegistry.rb @@ -0,0 +1,63 @@ +require 'echo.rb' +require 'soap/mapping' + +module WSDL; module Any + +module EchoMappingRegistry + EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new + LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new + NsEchoType = "urn:example.com:echo-type" + NsXMLSchema = "http://www.w3.org/2001/XMLSchema" + + EncodedRegistry.register( + :class => WSDL::Any::FooBar, + :schema_type => XSD::QName.new(NsEchoType, "foo.bar"), + :schema_element => [ + ["before", ["SOAP::SOAPString", XSD::QName.new(nil, "before")]], + ["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]], + ["after", ["SOAP::SOAPString", XSD::QName.new(nil, "after")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Any::FooBar, + :schema_type => XSD::QName.new(NsEchoType, "foo.bar"), + :schema_element => [ + ["before", ["SOAP::SOAPString", XSD::QName.new(nil, "before")]], + ["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]], + ["after", ["SOAP::SOAPString", XSD::QName.new(nil, "after")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Any::FooBar, + :schema_name => XSD::QName.new(NsEchoType, "foo.bar"), + :schema_element => [ + ["before", ["SOAP::SOAPString", XSD::QName.new(nil, "before")]], + ["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]], + ["after", ["SOAP::SOAPString", XSD::QName.new(nil, "after")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Any::SetOutputAndCompleteRequest, + :schema_name => XSD::QName.new(NsEchoType, "setOutputAndCompleteRequest"), + :schema_element => [ + ["taskId", ["SOAP::SOAPString", XSD::QName.new(nil, "taskId")]], + ["data", ["WSDL::Any::SetOutputAndCompleteRequest::C_Data", XSD::QName.new(nil, "data")]], + ["participantToken", ["SOAP::SOAPString", XSD::QName.new(nil, "participantToken")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::Any::SetOutputAndCompleteRequest::C_Data, + :schema_name => XSD::QName.new(nil, "data"), + :is_anonymous => true, + :schema_qualified => false, + :schema_element => [ + ["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]] + ] + ) +end + +end; end diff --git a/test/wsdl/any/expectedService.rb b/test/wsdl/any/expectedService.rb new file mode 100644 index 0000000..cde28c2 --- /dev/null +++ b/test/wsdl/any/expectedService.rb @@ -0,0 +1,69 @@ +#!/usr/bin/env ruby +require 'echoServant.rb' +require 'echoMappingRegistry.rb' +require 'soap/rpc/standaloneServer' + +module WSDL; module Any + +class Echo_port_type + NsEcho = "urn:example.com:echo" + + Methods = [ + [ "urn:example.com:echo", + "echo", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:example.com:echo-type", "foo.bar"]], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:example.com:echo-type", "foo.bar"]] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal, + :faults => {} } + ], + [ XSD::QName.new(NsEcho, "echoAny"), + "urn:example.com:echoAny", + "echoAny", + [ [:retval, "echoany_return", [nil]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ "urn:example.com:echo", + "setOutputAndComplete", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:example.com:echo-type", "setOutputAndCompleteRequest"]], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:example.com:echo-type", "setOutputAndCompleteRequest"]] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal, + :faults => {} } + ] + ] +end + +end; end + +module WSDL; module Any + +class Echo_port_typeApp < ::SOAP::RPC::StandaloneServer + def initialize(*arg) + super(*arg) + servant = WSDL::Any::Echo_port_type.new + WSDL::Any::Echo_port_type::Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + @router.add_document_operation(servant, *definitions) + else + @router.add_rpc_operation(servant, *definitions) + end + end + self.mapping_registry = EchoMappingRegistry::EncodedRegistry + self.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry + end +end + +end; end + +if $0 == __FILE__ + # Change listen port. + server = WSDL::Any::Echo_port_typeApp.new('app', nil, '0.0.0.0', 10080) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/test/wsdl/any/test_any.rb b/test/wsdl/any/test_any.rb new file mode 100644 index 0000000..c28511c --- /dev/null +++ b/test/wsdl/any/test_any.rb @@ -0,0 +1,193 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module Any + + +class TestAny < Test::Unit::TestCase + Namespace = 'urn:example.com:echo' + TypeNamespace = 'urn:example.com:echo-type' + + class Server < ::SOAP::RPC::StandaloneServer + def on_init + # use WSDL to serialize/deserialize + wsdlfile = File.join(DIR, 'any.wsdl') + wsdl = WSDL::Importer.import(wsdlfile) + port = wsdl.services[0].ports[0] + wsdl_elements = wsdl.collect_elements + wsdl_types = wsdl.collect_complextypes + wsdl.collect_simpletypes + rpc_decode_typemap = wsdl_types + + wsdl.soap_rpc_complextypes(port.find_binding) + @router.mapping_registry = + ::SOAP::Mapping::WSDLEncodedRegistry.new(rpc_decode_typemap) + @router.literal_mapping_registry = + ::SOAP::Mapping::WSDLLiteralRegistry.new(wsdl_types, wsdl_elements) + # add method + add_document_method( + self, + Namespace + ':echo', + 'echo', + XSD::QName.new(TypeNamespace, 'foo.bar'), + XSD::QName.new(TypeNamespace, 'foo.bar') + ) + add_rpc_operation(self, + XSD::QName.new("urn:example.com:echo", "echoAny"), + "urn:example.com:echoAny", + "echoAny", + [ [:retval, "echoany_return", [XSD::QName.new("http://www.w3.org/2001/XMLSchema", "anyType")]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ) + end + + def echo(arg) + res = FooBar.new(arg.before, arg.after) + res.set_any([ + ::SOAP::SOAPElement.new("foo", "bar"), + ::SOAP::SOAPElement.new("baz", "qux") + ]) + res + # TODO: arg + end + + AnyStruct = Struct.new(:a, :b) + def echoAny + AnyStruct.new(1, Time.mktime(2007, 1, 1)) + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_server + setup_classdef + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('echo.rb')) if File.exist?(pathname('echo.rb')) + File.unlink(pathname('echoMappingRegistry.rb')) if File.exist?(pathname('echoMappingRegistry.rb')) + File.unlink(pathname('echoDriver.rb')) if File.exist?(pathname('echoDriver.rb')) + File.unlink(pathname('echoServant.rb')) if File.exist?(pathname('echoServant.rb')) + File.unlink(pathname('echo_service.rb')) if File.exist?(pathname('echo_service.rb')) + File.unlink(pathname('echo_serviceClient.rb')) if File.exist?(pathname('echo_serviceClient.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', Namespace, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("any.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'echoDriver.rb', 'echoMappingRegistry.rb', 'echo.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_any + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("any.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['client_skelton'] = nil + gen.opt['servant_skelton'] = nil + gen.opt['standalone_server_stub'] = nil + gen.opt['force'] = true + TestUtil.silent do + gen.run + end + compare("expectedEcho.rb", "echo.rb") + compare("expectedMappingRegistry.rb", "echoMappingRegistry.rb") + compare("expectedDriver.rb", "echoDriver.rb") + compare("expectedService.rb", "echo_service.rb") + end + + def compare(expected, actual) + TestUtil.filecompare(pathname(expected), pathname(actual)) + end + + def test_anyreturl_wsdl + wsdl = File.join(DIR, 'any.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + res = @client.echoAny + assert_equal(1, res.a) + assert_equal(2007, res.b.year) + end + + def test_wsdl + wsdl = File.join(DIR, 'any.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + arg = FooBar.new("before", "after") + arg.set_any( + [ + ::SOAP::SOAPElement.new("foo", "bar"), + ::SOAP::SOAPElement.new("baz", "qux") + ] + ) + res = @client.echo(arg) + assert_equal(arg.before, res.before) + assert_equal("bar", res.foo) + assert_equal("qux", res.baz) + assert_equal(arg.after, res.after) + end + + def test_naive + @client = Echo_port_type.new + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + arg = FooBar.new("before", "after") + arg.set_any( + [ + ::SOAP::SOAPElement.new("foo", "bar"), + ::SOAP::SOAPElement.new("baz", "qux") + ] + ) + res = @client.echo(arg) + assert_equal(arg.before, res.before) + assert_equal("bar", res.foo) + assert_equal("qux", res.baz) + assert_equal(arg.after, res.after) + end +end + + +end; end diff --git a/test/wsdl/axisArray/axisArray.wsdl b/test/wsdl/axisArray/axisArray.wsdl new file mode 100644 index 0000000..1ad06f3 --- /dev/null +++ b/test/wsdl/axisArray/axisArray.wsdl @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/axisArray/test_axisarray.rb b/test/wsdl/axisArray/test_axisarray.rb new file mode 100644 index 0000000..152f18b --- /dev/null +++ b/test/wsdl/axisArray/test_axisarray.rb @@ -0,0 +1,124 @@ +require 'test/unit' +require 'soap/processor' +require 'soap/mapping' +require 'soap/rpc/element' +require 'wsdl/importer' +require 'wsdl/soap/wsdl2ruby' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL +module AxisArray + + +class TestAxisArray < Test::Unit::TestCase + DIR = File.dirname(File.expand_path(__FILE__)) + + def setup + @xml =<<__EOX__ + + + + + + + + + + + + + name3 + + + name1 + + + name2 + + + +__EOX__ + setup_classdef + end + + def teardown + unless $DEBUG + File.unlink(pathname('itemList.rb')) + File.unlink(pathname('itemListMappingRegistry.rb')) + File.unlink(pathname('itemListDriver.rb')) + end + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("axisArray.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'itemListDriver.rb', 'itemList.rb', 'itemListMappingRegistry.rb') + end + + def test_by_stub + driver = ItemListPortType.new + driver.test_loopback_response << @xml + ary = driver.listItem + assert_equal(3, ary.size) + assert_equal("name1", ary[0].name) + assert_equal("name2", ary[1].name) + assert_equal("name3", ary[2].name) + end + + def test_by_wsdl + wsdlfile = File.join(File.dirname(File.expand_path(__FILE__)), 'axisArray.wsdl') + wsdl = WSDL::Importer.import(wsdlfile) + service = wsdl.services[0] + port = service.ports[0] + wsdl_types = wsdl.collect_complextypes + rpc_decode_typemap = wsdl_types + wsdl.soap_rpc_complextypes(port.find_binding) + opt = {} + opt[:default_encodingstyle] = ::SOAP::EncodingNamespace + opt[:decode_typemap] = rpc_decode_typemap + header, body = ::SOAP::Processor.unmarshal(@xml, opt) + ary = ::SOAP::Mapping.soap2obj(body.response) + assert_equal(3, ary.size) + assert_equal("name1", ary[0].name) + assert_equal("name2", ary[1].name) + assert_equal("name3", ary[2].name) + end + +XML_LONG = <<__XML__ + + + + + + + + + + 105759347 + + +__XML__ + + def test_multiref_long + driver = ItemListPortType.new + driver.test_loopback_response << XML_LONG + ret = driver.getMeetingInfo + assert_equal(105759347, ret.meetingId) + end + + def pathname(filename) + File.join(DIR, filename) + end +end + + +end +end diff --git a/test/wsdl/choice/choice.wsdl b/test/wsdl/choice/choice.wsdl new file mode 100644 index 0000000..924bcd1 --- /dev/null +++ b/test/wsdl/choice/choice.wsdl @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/choice/test_choice.rb b/test/wsdl/choice/test_choice.rb new file mode 100644 index 0000000..ba9c793 --- /dev/null +++ b/test/wsdl/choice/test_choice.rb @@ -0,0 +1,310 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module Choice + + +class TestChoice < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = 'urn:choice' + + def on_init + add_document_method( + self, + Namespace + ':echo', + 'echo', + XSD::QName.new(Namespace, 'echoele'), + XSD::QName.new(Namespace, 'echo_response') + ) + add_document_method( + self, + Namespace + ':echo_complex', + 'echo_complex', + XSD::QName.new(Namespace, 'echoele_complex'), + XSD::QName.new(Namespace, 'echo_complex_response') + ) + add_document_method( + self, + Namespace + ':echo_complex_emptyArrayAtFirst', + 'echo_complex_emptyArrayAtFirst', + XSD::QName.new(Namespace, 'echoele_complex_emptyArrayAtFirst'), + XSD::QName.new(Namespace, 'echoele_complex_emptyArrayAtFirst') + ) + @router.literal_mapping_registry = ChoiceMappingRegistry::LiteralRegistry + end + + def echo(arg) + arg + end + + def echo_complex(arg) + Echo_complex_response.new(arg.data) + end + + def echo_complex_emptyArrayAtFirst(arg) + arg + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_classdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('choice.rb')) + File.unlink(pathname('choiceMappingRegistry.rb')) + File.unlink(pathname('choiceDriver.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', Server::Namespace, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("choice.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'choiceDriver.rb', 'choiceMappingRegistry.rb', 'choice.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_wsdl + wsdl = File.join(DIR, 'choice.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + @client.literal_mapping_registry = ChoiceMappingRegistry::LiteralRegistry + + ret = @client.echo(Echoele.new(TerminalID.new("imei", nil))) + assert_equal("imei", ret.terminalID.imei) + assert_nil(ret.terminalID.devId) + ret = @client.echo(Echoele.new(TerminalID.new(nil, 'devId'))) + assert_equal("devId", ret.terminalID.devId) + assert_nil(ret.terminalID.imei) + end + + include ::SOAP + def test_naive + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/") + @client.add_document_method('echo', 'urn:choice:echo', + XSD::QName.new('urn:choice', 'echoele'), + XSD::QName.new('urn:choice', 'echo_response')) + @client.wiredump_dev = STDOUT if $DEBUG + @client.literal_mapping_registry = ChoiceMappingRegistry::LiteralRegistry + + echo = SOAPElement.new('echoele') + echo.add(terminalID = SOAPElement.new('terminalID')) + terminalID.add(SOAPElement.new('imei', 'imei')) + ret = @client.echo(echo) + assert_equal("imei", ret.terminalID.imei) + assert_nil(ret.terminalID.devId) + + echo = SOAPElement.new('echoele') + echo.add(terminalID = SOAPElement.new('terminalID')) + terminalID.add(SOAPElement.new('devId', 'devId')) + ret = @client.echo(echo) + assert_equal("devId", ret.terminalID.devId) + assert_nil(ret.terminalID.imei) + end + + def test_wsdl_with_map_complex + wsdl = File.join(DIR, 'choice.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + do_test_with_map_complex(@client) + end + + def test_wsdl_with_stub_complex + wsdl = File.join(DIR, 'choice.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + @client.literal_mapping_registry = ChoiceMappingRegistry::LiteralRegistry + do_test_with_stub_complex(@client) + end + + def test_naive_with_map_complex + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/") + @client.add_document_method('echo_complex', 'urn:choice:echo_complex', + XSD::QName.new('urn:choice', 'echoele_complex'), + XSD::QName.new('urn:choice', 'echo_complex_response')) + @client.wiredump_dev = STDOUT if $DEBUG + do_test_with_map_complex(@client) + end + + def test_naive_with_stub_complex + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/") + @client.add_document_method('echo_complex', 'urn:choice:echo_complex', + XSD::QName.new('urn:choice', 'echoele_complex'), + XSD::QName.new('urn:choice', 'echo_complex_response')) + @client.wiredump_dev = STDOUT if $DEBUG + @client.literal_mapping_registry = ChoiceMappingRegistry::LiteralRegistry + do_test_with_stub_complex(@client) + end + + def do_test_with_map_complex(client) + req = { + :data => { + :A => "A", + :B1 => "B1", + :C1 => "C1", + :C2 => "C2" + } + } + ret = client.echo_complex(req) + assert_equal("A", ret.data["A"]) + assert_equal("B1", ret.data["B1"]) + assert_equal(nil, ret.data["B2a"]) + assert_equal(nil, ret.data["B2b"]) + assert_equal(nil, ret.data["B3a"]) + assert_equal(nil, ret.data["B3b"]) + assert_equal("C1", ret.data["C1"]) + assert_equal("C2", ret.data["C2"]) + # + req = { + :data => { + :A => "A", + :B2a => "B2a", + :B2b => "B2b", + :C1 => "C1", + :C2 => "C2" + } + } + ret = client.echo_complex(req) + assert_equal("A", ret.data["A"]) + assert_equal(nil, ret.data["B1"]) + assert_equal("B2a", ret.data["B2a"]) + assert_equal("B2b", ret.data["B2b"]) + assert_equal(nil, ret.data["B3a"]) + assert_equal(nil, ret.data["B3b"]) + assert_equal("C1", ret.data["C1"]) + assert_equal("C2", ret.data["C2"]) + # + req = { + :data => { + :A => "A", + :B3a => "B3a", + :C1 => "C1", + :C2 => "C2" + } + } + ret = client.echo_complex(req) + assert_equal("A", ret.data["A"]) + assert_equal(nil, ret.data["B1"]) + assert_equal(nil, ret.data["B2a"]) + assert_equal(nil, ret.data["B2b"]) + assert_equal("B3a", ret.data["B3a"]) + assert_equal(nil, ret.data["B3b"]) + assert_equal("C1", ret.data["C1"]) + assert_equal("C2", ret.data["C2"]) + # + req = { + :data => { + :A => "A", + :B3b => "B3b", + :C1 => "C1", + :C2 => "C2" + } + } + ret = client.echo_complex(req) + assert_equal("A", ret.data["A"]) + assert_equal(nil, ret.data["B1"]) + assert_equal(nil, ret.data["B2a"]) + assert_equal(nil, ret.data["B2b"]) + assert_equal(nil, ret.data["B3a"]) + assert_equal("B3b", ret.data["B3b"]) + assert_equal("C1", ret.data["C1"]) + assert_equal("C2", ret.data["C2"]) + end + + def do_test_with_stub_complex(client) + ret = client.echo_complex(Echoele_complex.new(Andor.new("A", "B1", nil, nil, nil, nil, "C1", "C2"))) + assert_equal("A", ret.data.a) + assert_equal("B1", ret.data.b1) + assert_equal(nil, ret.data.b2a) + assert_equal(nil, ret.data.b2b) + assert_equal(nil, ret.data.b3a) + assert_equal(nil, ret.data.b3b) + assert_equal("C1", ret.data.c1) + assert_equal("C2", ret.data.c2) + # + ret = client.echo_complex(Echoele_complex.new(Andor.new("A", nil, "B2a", "B2b", nil, nil, "C1", "C2"))) + assert_equal("A", ret.data.a) + assert_equal(nil, ret.data.b1) + assert_equal("B2a", ret.data.b2a) + assert_equal("B2b", ret.data.b2b) + assert_equal(nil, ret.data.b3a) + assert_equal(nil, ret.data.b3b) + assert_equal("C1", ret.data.c1) + assert_equal("C2", ret.data.c2) + # + ret = client.echo_complex(Echoele_complex.new(Andor.new("A", nil, nil, nil, "B3a", nil, "C1", "C2"))) + assert_equal("A", ret.data.a) + assert_equal(nil, ret.data.b1) + assert_equal(nil, ret.data.b2a) + assert_equal(nil, ret.data.b2b) + assert_equal("B3a", ret.data.b3a) + assert_equal(nil, ret.data.b3b) + assert_equal("C1", ret.data.c1) + assert_equal("C2", ret.data.c2) + # + ret = client.echo_complex(Echoele_complex.new(Andor.new("A", nil, nil, nil, nil, "B3b", "C1", "C2"))) + assert_equal("A", ret.data.a) + assert_equal(nil, ret.data.b1) + assert_equal(nil, ret.data.b2a) + assert_equal(nil, ret.data.b2b) + assert_equal(nil, ret.data.b3a) + assert_equal("B3b", ret.data.b3b) + assert_equal("C1", ret.data.c1) + assert_equal("C2", ret.data.c2) + end + + def test_stub_emptyArrayAtFirst + @client = Choice_porttype.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDOUT if $DEBUG + # + arg = EmptyArrayAtFirst.new + arg.b1 = "b1" + ret = @client.echo_complex_emptyArrayAtFirst(Echoele_complex_emptyArrayAtFirst.new(arg)) + assert_nil(ret.data.a) + assert_equal("b1", ret.data.b1) + assert_nil(ret.data.b2) + end +end + + +end; end diff --git a/test/wsdl/complexcontent/complexContent.wsdl b/test/wsdl/complexcontent/complexContent.wsdl new file mode 100644 index 0000000..9ba21d6 --- /dev/null +++ b/test/wsdl/complexcontent/complexContent.wsdl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/complexcontent/test_echo.rb b/test/wsdl/complexcontent/test_echo.rb new file mode 100644 index 0000000..8befa2e --- /dev/null +++ b/test/wsdl/complexcontent/test_echo.rb @@ -0,0 +1,90 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module ComplexContent + + +class TestEcho < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = 'urn:complexContent' + + def on_init + add_document_method( + self, + nil, + 'echo', + XSD::QName.new(Namespace, 'echo'), + XSD::QName.new(Namespace, 'echo') + ) + end + + def echo(arg) + arg + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + Port = 17171 + + def setup + setup_server + setup_classdef + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('complexContent.rb')) + File.unlink(pathname('complexContentMappingRegistry.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', Server::Namespace, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("complexContent.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'complexContentMappingRegistry.rb', 'complexContent.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_wsdl + wsdl = File.join(DIR, 'complexContent.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.literal_mapping_registry = ComplexContentMappingRegistry::LiteralRegistry + @client.wiredump_dev = STDOUT if $DEBUG + d = Derived.new + d.name = "NaHi" + assert_instance_of(Echo, @client.echo(Echo.new(d))) + end +end + + +end; end diff --git a/test/wsdl/datetime/DatetimeService.rb b/test/wsdl/datetime/DatetimeService.rb new file mode 100644 index 0000000..a75c971 --- /dev/null +++ b/test/wsdl/datetime/DatetimeService.rb @@ -0,0 +1,44 @@ +#!/usr/bin/env ruby +require 'datetimeServant.rb' + +require 'soap/rpc/standaloneServer' +require 'soap/mapping/registry' + +class DatetimePortType + MappingRegistry = ::SOAP::Mapping::Registry.new + + Methods = [ + ["now", "now", + [ + [:in, "now", [::SOAP::SOAPDateTime]], + [:retval, "now", [::SOAP::SOAPDateTime]] + ], + "", "urn:jp.gr.jin.rrr.example.datetime", :rpc + ] + ] +end + +class DatetimePortTypeApp < ::SOAP::RPC::StandaloneServer + def initialize(*arg) + super(*arg) + servant = DatetimePortType.new + DatetimePortType::Methods.each do |name_as, name, param_def, soapaction, namespace, style| + if style == :document + @router.add_document_operation(servant, soapaction, name, param_def) + else + qname = XSD::QName.new(namespace, name_as) + @router.add_rpc_operation(servant, qname, soapaction, name, param_def) + end + end + self.mapping_registry = DatetimePortType::MappingRegistry + end +end + +if $0 == __FILE__ + # Change listen port. + server = DatetimePortTypeApp.new('app', nil, '0.0.0.0', 10080) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/test/wsdl/datetime/datetime.rb b/test/wsdl/datetime/datetime.rb new file mode 100644 index 0000000..e69de29 diff --git a/test/wsdl/datetime/datetime.wsdl b/test/wsdl/datetime/datetime.wsdl new file mode 100644 index 0000000..4998dc4 --- /dev/null +++ b/test/wsdl/datetime/datetime.wsdl @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/datetime/datetimeServant.rb b/test/wsdl/datetime/datetimeServant.rb new file mode 100644 index 0000000..175588a --- /dev/null +++ b/test/wsdl/datetime/datetimeServant.rb @@ -0,0 +1,22 @@ +require 'datetime.rb' + +class DatetimePortType + # SYNOPSIS + # now(now) + # + # ARGS + # now - {http://www.w3.org/2001/XMLSchema}dateTime + # + # RETURNS + # now - {http://www.w3.org/2001/XMLSchema}dateTime + # + # RAISES + # (undefined) + # + def now(now) + #raise NotImplementedError.new + return nil if now.nil? + now + 1 + end +end + diff --git a/test/wsdl/datetime/test_datetime.rb b/test/wsdl/datetime/test_datetime.rb new file mode 100644 index 0000000..0138173 --- /dev/null +++ b/test/wsdl/datetime/test_datetime.rb @@ -0,0 +1,86 @@ +require 'test/unit' +require 'soap/wsdlDriver' +require 'DatetimeService.rb' + + +module WSDL +module Datetime + + +class TestDatetime < Test::Unit::TestCase + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_server + setup_client + end + + def setup_server + @server = DatetimePortTypeApp.new('Datetime server', nil, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + Thread.current.abort_on_exception = true + @server.start + } + end + + def setup_client + wsdl = File.join(DIR, 'datetime.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.generate_explicit_type = true + @client.wiredump_dev = STDOUT if $DEBUG + end + + def teardown + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @t.kill + @t.join + end + + def teardown_client + @client.reset_stream + end + + def test_datetime + d = DateTime.now + d1 = d + 1 + d2 = @client.now(d) + assert_equal(d1.year, d2.year) + assert_equal(d1.month, d2.month) + assert_equal(d1.day, d2.day) + assert_equal(d1.hour, d2.hour) + assert_equal(d1.min, d2.min) + assert_equal(d1.sec, d2.sec) + assert_equal(d1.sec, d2.sec) + end + + def test_time + d = DateTime.now + t = Time.gm(d.year, d.month, d.day, d.hour, d.min, d.sec) + d1 = d + 1 + d2 = @client.now(t) + assert_equal(d1.year, d2.year) + assert_equal(d1.month, d2.month) + assert_equal(d1.day, d2.day) + assert_equal(d1.hour, d2.hour) + assert_equal(d1.min, d2.min) + assert_equal(d1.sec, d2.sec) + assert_equal(d1.sec, d2.sec) + end + + def test_nil + assert_nil(@client.now(nil)) + end +end + + +end +end diff --git a/test/wsdl/document/array/double.wsdl b/test/wsdl/document/array/double.wsdl new file mode 100644 index 0000000..ca72fa7 --- /dev/null +++ b/test/wsdl/document/array/double.wsdl @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/document/array/test_array.rb b/test/wsdl/document/array/test_array.rb new file mode 100644 index 0000000..26aff39 --- /dev/null +++ b/test/wsdl/document/array/test_array.rb @@ -0,0 +1,201 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', '..', 'testutil.rb') + + +module WSDL; module Document + + +class TestArray < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = 'http://tempuri.org/' + + def on_init + add_document_method( + self, + Namespace + 'echo', + 'echo', + XSD::QName.new(Namespace, 'echo'), + XSD::QName.new(Namespace, 'echoResponse') + ) + add_document_method( + self, + Namespace + 'echo2', + 'echo2', + XSD::QName.new(Namespace, 'echo2'), + XSD::QName.new(Namespace, 'echo2Response') + ) + add_document_method( + self, + Namespace + 'echo3', + 'echo3', + XSD::QName.new(Namespace, 'ArrayOfRecord'), + XSD::QName.new(Namespace, 'ArrayOfRecord') + ) + self.literal_mapping_registry = DoubleMappingRegistry::LiteralRegistry + end + + def echo(arg) + arg + end + + def echo2(arg) + arg + end + + def echo3(arg) + arg + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_classdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('double.rb')) + File.unlink(pathname('doubleMappingRegistry.rb')) + File.unlink(pathname('doubleDriver.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', Server::Namespace, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("double.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'doubleDriver.rb', 'doubleMappingRegistry.rb', 'double.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_stub + @client = PricerSoap.new + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + arg = ArrayOfComplex[c1 = Complex.new, c2 = Complex.new, c3 = Complex.new] + c1.string = "str_c1" + c1.double = 1.1 + c2.string = "str_c2" + c2.double = 2.2 + c3.string = "str_c3" + c3.double = 3.3 + ret = @client.echo2(Echo2.new(arg)) + assert_equal(ArrayOfComplex, ret.arg.class) + assert_equal(Complex, ret.arg[0].class) + assert_equal(arg[0].string, ret.arg[0].string) + assert_equal(arg[1].string, ret.arg[1].string) + assert_equal(arg[2].string, ret.arg[2].string) + end + + def test_wsdl_stubclassdef + wsdl = File.join(DIR, 'double.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.literal_mapping_registry = DoubleMappingRegistry::LiteralRegistry + @client.wiredump_dev = STDOUT if $DEBUG + arg = ArrayOfDouble[0.1, 0.2, 0.3] + assert_equal(arg, @client.echo(Echo.new(arg)).ary) + end + + def test_wsdl + wsdl = File.join(DIR, 'double.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.literal_mapping_registry = DoubleMappingRegistry::LiteralRegistry + @client.wiredump_dev = STDOUT if $DEBUG + double = [0.1, 0.2, 0.3] + assert_equal(double, @client.echo(:ary => double).ary) + end + + def test_stub + @client = ::WSDL::Document::PricerSoap.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDOUT if $DEBUG + double = [0.1, 0.2, 0.3] + assert_equal(double, @client.echo(:ary => double).ary) + end + + def test_stub_nil + @client = ::WSDL::Document::PricerSoap.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDOUT if $DEBUG + assert_equal(nil, @client.echo(Echo.new).ary) + end + + def test_attribute_array + @client = ::WSDL::Document::PricerSoap.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDOUT if $DEBUG + # + r1 = ReportRecord.new + r1.xmlattr_a = "r1_xmlattr_a" + r1.xmlattr_b = "r1_xmlattr_b" + r1.xmlattr_c = "r1_xmlattr_c" + r2 = ReportRecord.new + r2.xmlattr_a = "r2_xmlattr_a" + r2.xmlattr_b = "r2_xmlattr_b" + r2.xmlattr_c = "r2_xmlattr_c" + arg = ArrayOfRecord[r1, r2] + ret = @client.echo3(arg) + assert_equal(arg.class , ret.class) + assert_equal(arg.size , ret.size) + assert_equal(2, ret.size) + assert_equal(arg[0].class, ret[0].class) + assert_equal(arg[0].xmlattr_a, ret[0].xmlattr_a) + assert_equal(arg[0].xmlattr_b, ret[0].xmlattr_b) + assert_equal(arg[0].xmlattr_c, ret[0].xmlattr_c) + assert_equal(arg[1].class, ret[1].class) + assert_equal(arg[1].xmlattr_a, ret[1].xmlattr_a) + assert_equal(arg[1].xmlattr_b, ret[1].xmlattr_b) + assert_equal(arg[1].xmlattr_c, ret[1].xmlattr_c) + # + arg = ArrayOfRecord[r1] + ret = @client.echo3(arg) + assert_equal(arg.class , ret.class) + assert_equal(arg.size , ret.size) + assert_equal(1, ret.size) + assert_equal(arg[0].class, ret[0].class) + assert_equal(arg[0].xmlattr_a, ret[0].xmlattr_a) + assert_equal(arg[0].xmlattr_b, ret[0].xmlattr_b) + assert_equal(arg[0].xmlattr_c, ret[0].xmlattr_c) + # + arg = ArrayOfRecord[] + ret = @client.echo3(arg) + assert_equal(arg.class , ret.class) + assert_equal(arg.size , ret.size) + assert_equal(0, ret.size) + end +end + + +end; end diff --git a/test/wsdl/document/document.wsdl b/test/wsdl/document/document.wsdl new file mode 100644 index 0000000..9b7baf6 --- /dev/null +++ b/test/wsdl/document/document.wsdl @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/document/number.wsdl b/test/wsdl/document/number.wsdl new file mode 100644 index 0000000..c464276 --- /dev/null +++ b/test/wsdl/document/number.wsdl @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/document/ping_nosoapaction.wsdl b/test/wsdl/document/ping_nosoapaction.wsdl new file mode 100644 index 0000000..23d4684 --- /dev/null +++ b/test/wsdl/document/ping_nosoapaction.wsdl @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/document/test_nosoapaction.rb b/test/wsdl/document/test_nosoapaction.rb new file mode 100644 index 0000000..298e6b1 --- /dev/null +++ b/test/wsdl/document/test_nosoapaction.rb @@ -0,0 +1,102 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require 'soap/rpc/driver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module Document + + +class TestNoSOAPAction < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = 'http://xmlsoap.org/Ping' + + def on_init + add_document_method( + self, + Namespace + '/ping', + 'ping_with_soapaction', + XSD::QName.new(Namespace, 'Ping'), + XSD::QName.new(Namespace, 'PingResponse') + ) + + add_document_method( + self, + nil, + 'ping', + XSD::QName.new(Namespace, 'Ping'), + XSD::QName.new(Namespace, 'PingResponse') + ) + + # When no SOAPAction given, latter method(ping) is called. + end + + def ping(arg) + arg.text = 'ping' + arg + end + + def ping_with_soapaction(arg) + arg.text = 'ping_with_soapaction' + arg + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_server + @client = nil + end + + def teardown + teardown_server if @server + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', Server::Namespace, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def test_with_soapaction + wsdl = File.join(DIR, 'ping_nosoapaction.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + rv = @client.ping(:scenario => 'scenario', :origin => 'origin', + :text => 'text') + assert_equal('scenario', rv.scenario) + assert_equal('origin', rv.origin) + assert_equal('ping', rv.text) + end + + def test_without_soapaction + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/", + Server::Namespace) + @client.add_document_method('ping', Server::Namespace + '/ping', + XSD::QName.new(Server::Namespace, 'Ping'), + XSD::QName.new(Server::Namespace, 'PingResponse')) + @client.wiredump_dev = STDOUT if $DEBUG + rv = @client.ping(:scenario => 'scenario', :origin => 'origin', + :text => 'text') + assert_equal('scenario', rv.scenario) + assert_equal('origin', rv.origin) + assert_equal('ping_with_soapaction', rv.text) + end +end + + +end; end diff --git a/test/wsdl/document/test_number.rb b/test/wsdl/document/test_number.rb new file mode 100644 index 0000000..6424d35 --- /dev/null +++ b/test/wsdl/document/test_number.rb @@ -0,0 +1,92 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module Document + + +class TestNumber < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = 'urn:foo' + + def on_init + add_document_method( + self, + Namespace + ':get_foo', + 'get_foo', + XSD::QName.new(Namespace, 'get_foo'), + XSD::QName.new(Namespace, 'get_foo_response') + ) + end + + def get_foo(arg) + arg.number + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + Port = 17171 + + def setup + setup_server + setup_classdef + @client = nil + end + + def teardown + teardown_server if @server + File.unlink(pathname('foo.rb')) + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', "urn:rpc", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("number.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'foo.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_wsdl + wsdl = File.join(DIR, 'number.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + + # with the Struct defined in foo.rb, which is generated from WSDL + assert_equal("12345", @client.get_foo(Get_foo.new("12345"))) + + # with Hash + assert_equal("12345", @client.get_foo({:number => "12345"})) + + # with Original struct + get_foo_struct = Struct.new(:number) + assert_equal("12345", @client.get_foo(get_foo_struct.new("12345"))) + end +end + + +end; end diff --git a/test/wsdl/document/test_rpc.rb b/test/wsdl/document/test_rpc.rb new file mode 100644 index 0000000..9a7af32 --- /dev/null +++ b/test/wsdl/document/test_rpc.rb @@ -0,0 +1,355 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module Document + + +class TestRPC < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = 'urn:docrpc' + + def on_init + add_document_method( + self, + Namespace + ':echo', + 'echo', + XSD::QName.new(Namespace, 'echo'), + XSD::QName.new(Namespace, 'echo_response') + ) + add_document_method( + self, + Namespace + ':return_nil', + 'return_nil', + nil, + XSD::QName.new(Namespace, 'echo_response') + ) + add_document_method( + self, + Namespace + ':return_empty', + 'return_empty', + nil, + XSD::QName.new(Namespace, 'echo_response') + ) + self.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry + end + + def echo(arg) + if arg.is_a?(Echoele) + # swap args + tmp = arg.struct1 + arg.struct1 = arg.struct_2 + arg.struct_2 = tmp + arg + else + # swap args + tmp = arg["struct1"] + arg["struct1"] = arg["struct-2"] + arg["struct-2"] = tmp + arg + end + end + + def return_nil + e = Echoele.new + e.struct1 = Echo_struct.new(nil, nil) + e.struct_2 = Echo_struct.new(nil, nil) + e.long = nil + e + end + + def return_empty + e = Echoele.new + e.struct1 = Echo_struct.new("", nil) + e.struct_2 = Echo_struct.new("", nil) + e.long = 0 + e + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_classdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + File.unlink(pathname('echo.rb')) unless $DEBUG + File.unlink(pathname('echoMappingRegistry.rb')) unless $DEBUG + File.unlink(pathname('echoDriver.rb')) unless $DEBUG + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', "urn:rpc", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("document.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'echoDriver.rb', 'echoMappingRegistry.rb', 'echo.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_wsdl + wsdl = File.join(DIR, 'document.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + @client.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry + do_test_with_stub(@client) + end + + def test_driver_stub + @client = ::WSDL::Document::Docrpc_porttype.new + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + do_test_with_stub(@client) + end + + def test_nil_attribute + @client = ::WSDL::Document::Docrpc_porttype.new + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + struct1 = Echo_struct.new("mystring1", now1 = Time.now) + struct1.xmlattr_m_attr = nil + struct2 = Echo_struct.new("mystr<>ing2", now2 = Time.now) + struct2.xmlattr_m_attr = '' + echo = Echoele.new(struct1, struct2, 105759347) + echo.xmlattr_attr_string = '' + echo.xmlattr_attr_int = nil + ret = @client.echo(echo) + # struct1 and struct2 are swapped + assert_equal('', ret.struct1.xmlattr_m_attr) + assert_equal(nil, ret.struct_2.xmlattr_m_attr) + assert_equal('', ret.xmlattr_attr_string) + assert_equal(nil, ret.xmlattr_attr_int) + assert_equal(105759347, ret.long) + end + + def do_test_with_stub(client) + struct1 = Echo_struct.new("mystring1", now1 = Time.now) + struct1.xmlattr_m_attr = 'myattr1' + struct2 = Echo_struct.new("mystr<>ing2", now2 = Time.now) + struct2.xmlattr_m_attr = 'myattr2' + echo = Echoele.new(struct1, struct2, 105759347) + echo.xmlattr_attr_string = 'attr_str<>ing' + echo.xmlattr_attr_int = 5 + ret = client.echo(echo) + + # struct#m_datetime in a response is a DateTime even though + # struct#m_datetime in a request is a Time. + timeformat = "%Y-%m-%dT%H:%M:%S" + assert_equal("mystr<>ing2", ret.struct1.m_string) + assert_equal(now2.strftime(timeformat), + date2time(ret.struct1.m_datetime).strftime(timeformat)) + assert_equal("mystring1", ret.struct_2.m_string) + assert_equal(now1.strftime(timeformat), + date2time(ret.struct_2.m_datetime).strftime(timeformat)) + assert_equal("attr_str<>ing", ret.xmlattr_attr_string) + assert_equal(5, ret.xmlattr_attr_int) + assert_equal(105759347, ret.long) + end + + def test_wsdl_with_map + wsdl = File.join(DIR, 'document.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + + struct1 = { + :m_string => "mystring1", + :m_datetime => (now1 = Time.now), + :xmlattr_m_attr => "myattr1" + } + struct2 = { + "m_string" => "mystr<>ing2", + "m_datetime" => now2 = (Time.now), + "xmlattr_m_attr" => "myattr2" + } + echo = { + :struct1 => struct1, + "struct-2" => struct2, + :xmlattr_attr_string => 'attr_str<>ing', + "xmlattr_attr-int" => 5 + } + ret = @client.echo(echo) + # + now1str = XSD::XSDDateTime.new(now1).to_s + now2str = XSD::XSDDateTime.new(now2).to_s + assert_equal("mystr<>ing2", ret.struct1.m_string) + assert_equal(now2str, ret.struct1.m_datetime) + assert_equal("mystring1", ret.struct_2.m_string) + assert_equal(now1str, ret.struct_2.m_datetime) + assert_equal("attr_str<>ing", ret.xmlattr_attr_string) + assert_equal("5", ret.xmlattr_attr_int) + end + + def date2time(date) + if date.respond_to?(:to_time) + date.to_time + else + d = date.new_offset(0) + d.instance_eval { + Time.utc(year, mon, mday, hour, min, sec, + (sec_fraction * 86400000000).to_i) + }.getlocal + end + end + + include ::SOAP + def test_naive + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/") + @client.add_document_method('echo', 'urn:docrpc:echo', + XSD::QName.new('urn:docrpc', 'echoele'), + XSD::QName.new('urn:docrpc', 'echo_response')) + @client.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry + @client.wiredump_dev = STDOUT if $DEBUG + + echo = SOAPElement.new('foo') + echo.extraattr['attr_string'] = 'attr_str<>ing' + echo.extraattr['attr-int'] = 5 + echo.add(struct1 = SOAPElement.new('struct1')) + struct1.add(SOAPElement.new('m_string', 'mystring1')) + struct1.add(SOAPElement.new('m_datetime', '2005-03-17T19:47:31+01:00')) + struct1.extraattr['m_attr'] = 'myattr1' + echo.add(struct2 = SOAPElement.new('struct-2')) + struct2.add(SOAPElement.new('m_string', 'mystring2')) + struct2.add(SOAPElement.new('m_datetime', '2005-03-17T19:47:32+02:00')) + struct2.extraattr['m_attr'] = 'myattr2' + ret = @client.echo(echo) + timeformat = "%Y-%m-%dT%H:%M:%S" + assert_equal('mystring2', ret.struct1.m_string) + assert_equal('2005-03-17T19:47:32', + ret.struct1.m_datetime.strftime(timeformat)) + assert_equal("mystring1", ret.struct_2.m_string) + assert_equal('2005-03-17T19:47:31', + ret.struct_2.m_datetime.strftime(timeformat)) + assert_equal('attr_str<>ing', ret.xmlattr_attr_string) + assert_equal(5, ret.xmlattr_attr_int) + + echo = {'struct1' => {'m_string' => 'mystring1', 'm_datetime' => '2005-03-17T19:47:31+01:00'}, + 'struct_2' => {'m_string' => 'mystring2', 'm_datetime' => '2005-03-17T19:47:32+02:00'}} + ret = @client.echo(echo) + timeformat = "%Y-%m-%dT%H:%M:%S" + assert_equal('mystring2', ret.struct1.m_string) + assert_equal('2005-03-17T19:47:32', + ret.struct1.m_datetime.strftime(timeformat)) + assert_equal("mystring1", ret.struct_2.m_string) + assert_equal('2005-03-17T19:47:31', + ret.struct_2.m_datetime.strftime(timeformat)) + end + + def test_to_xml + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/") + @client.add_document_method('echo', 'urn:docrpc:echo', + XSD::QName.new('urn:docrpc', 'echoele'), + XSD::QName.new('urn:docrpc', 'echo_response')) + @client.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry + @client.wiredump_dev = STDOUT if $DEBUG + + require 'rexml/document' + echo = REXML::Document.new(<<__XML__.chomp) + + + mystring1 + 2005-03-17T19:47:31+01:00 + + + mystring2 + 2005-03-17T19:47:32+02:00 + + +__XML__ + ret = @client.echo(echo) + timeformat = "%Y-%m-%dT%H:%M:%S" + assert_equal('mystring2', ret.struct1.m_string) + assert_equal('2005-03-17T19:47:32', + ret.struct1.m_datetime.strftime(timeformat)) + assert_equal("mystring1", ret.struct_2.m_string) + assert_equal('2005-03-17T19:47:31', + ret.struct_2.m_datetime.strftime(timeformat)) + assert_equal('attr_string', ret.xmlattr_attr_string) + assert_equal(5, ret.xmlattr_attr_int) + # + echoele = REXML::Document.new(<<__XML__.chomp) + + + 2005-03-17T19:47:32+02:00 + mystring2 + + + 2005-03-17T19:47:31+01:00 + mystring1 + + +__XML__ + ret = @client.echo(echoele) + timeformat = "%Y-%m-%dT%H:%M:%S" + assert_equal('mystring2', ret.struct1.m_string) + assert_equal('2005-03-17T19:47:32', + ret.struct1.m_datetime.strftime(timeformat)) + assert_equal("mystring1", ret.struct_2.m_string) + assert_equal('2005-03-17T19:47:31', + ret.struct_2.m_datetime.strftime(timeformat)) + end + + def test_nil + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/") + @client.add_document_method('return_nil', 'urn:docrpc:return_nil', + nil, + XSD::QName.new('urn:docrpc', 'return_nil')) + @client.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry + @client.wiredump_dev = STDOUT if $DEBUG + + ret = @client.return_nil + assert_nil(ret.struct1.m_string) + assert_nil(ret.struct_2.m_string) + assert_nil(ret.long) + end + + def test_empty + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/") + @client.add_document_method('return_empty', 'urn:docrpc:return_empty', + nil, + XSD::QName.new('urn:docrpc', 'return_empty')) + @client.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry + @client.wiredump_dev = STDOUT if $DEBUG + + ret = @client.return_empty + assert_equal("", ret.struct1.m_string) + assert_equal("", ret.struct_2.m_string) + assert_equal(0, ret.long) + end +end + + +end; end diff --git a/test/wsdl/emptycomplextype.wsdl b/test/wsdl/emptycomplextype.wsdl new file mode 100644 index 0000000..4f8dc48 --- /dev/null +++ b/test/wsdl/emptycomplextype.wsdl @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/fault/fault.wsdl b/test/wsdl/fault/fault.wsdl new file mode 100644 index 0000000..b31d3bc --- /dev/null +++ b/test/wsdl/fault/fault.wsdl @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/fault/multifault.wsdl b/test/wsdl/fault/multifault.wsdl new file mode 100644 index 0000000..1b77e20 --- /dev/null +++ b/test/wsdl/fault/multifault.wsdl @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/fault/test_fault.rb b/test/wsdl/fault/test_fault.rb new file mode 100644 index 0000000..bed6c0e --- /dev/null +++ b/test/wsdl/fault/test_fault.rb @@ -0,0 +1,119 @@ +require 'test/unit' +require 'wsdl/soap/wsdl2ruby' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module Fault + + +class TestFault < Test::Unit::TestCase + DIR = File.dirname(File.expand_path(__FILE__)) + Port = 17171 + + def setup + setup_classdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('Add.rb')) + File.unlink(pathname('AddMappingRegistry.rb')) + File.unlink(pathname('AddServant.rb')) + File.unlink(pathname('AddService.rb')) + end + @client.reset_stream if @client + end + + def setup_server + AddPortType.class_eval do + define_method(:add) do |request| + @sum ||= 0 + if (request.value > 100) + fault = AddFault.new("Value #{request.value} is too large", "Critical") + raise fault + end + @sum += request.value + return AddResponse.new(@sum) + end + end + @server = AddPortTypeApp.new('app', nil, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("fault.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['servant_skelton'] = nil + gen.opt['standalone_server_stub'] = nil + gen.opt['force'] = true + TestUtil.silent do + gen.run + end + TestUtil.require(DIR, 'Add.rb', 'AddMappingRegistry.rb', 'AddServant.rb', 'AddService.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_driver + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/") + @client.mapping_registry = AddMappingRegistry::EncodedRegistry + @client.literal_mapping_registry = AddMappingRegistry::LiteralRegistry + @client.add_document_operation( + "Add", + "add", + [ [:in, "request", ["::SOAP::SOAPElement", "http://fault.test/Faulttest", "Add"]], + [:out, "response", ["::SOAP::SOAPElement", "http://fault.test/Faulttest", "AddResponse"]] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal, + :faults => {"AddFault"=>{:namespace=>nil, :name=>"AddFault", :use=>"literal", :encodingstyle=>"document", :ns=>"http://fault.test/Faulttest"}} } + ) + @client.wiredump_dev = STDOUT if $DEBUG + do_test(@client) + end + + def test_wsdl + wsdl = File.join(DIR, 'fault.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.mapping_registry = AddMappingRegistry::EncodedRegistry + @client.literal_mapping_registry = AddMappingRegistry::LiteralRegistry + @client.wiredump_dev = STDOUT if $DEBUG + do_test(@client) + end + + def do_test(client) + assert_equal(100, client.add(Add.new(100)).sum) + assert_equal(100, client.add(Add.new(0)).sum) + assert_equal(150, client.add(Add.new(50)).sum) + begin + client.add(Add.new(101)) + assert(false) + rescue Exception => e + assert_equal(::SOAP::FaultError, e.class) + assert_equal("WSDL::Fault::AddFault", e.faultstring.data) + assert_equal("Value 101 is too large", e.detail.addFault.reason) + assert_equal("Critical", e.detail.addFault.severity) + end + end +end + + +end; end diff --git a/test/wsdl/fault/test_multifault.rb b/test/wsdl/fault/test_multifault.rb new file mode 100644 index 0000000..9873ad3 --- /dev/null +++ b/test/wsdl/fault/test_multifault.rb @@ -0,0 +1,134 @@ +require 'test/unit' +require 'wsdl/soap/wsdl2ruby' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module Fault + + +class TestMultiFault < Test::Unit::TestCase + DIR = File.dirname(File.expand_path(__FILE__)) + Port = 17171 + + def setup + setup_classdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('Add.rb')) + File.unlink(pathname('AddMappingRegistry.rb')) + File.unlink(pathname('AddServant.rb')) + File.unlink(pathname('AddService.rb')) + end + @client.reset_stream if @client + end + + def setup_server + AddPortType.class_eval do + define_method(:add) do |request| + @sum ||= 0 + if (request.value > 100) + fault = AddFault.new("Value #{request.value} is too large", "Critical") + raise fault + end + + if (request.value < 0) + fault = NegativeValueFault.new("Value #{request.value} is negative", "Fatal") + raise fault + end + + @sum += request.value + return AddResponse.new(@sum) + end + end + @server = AddPortTypeApp.new('app', nil, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("multifault.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['servant_skelton'] = nil + gen.opt['standalone_server_stub'] = nil + gen.opt['force'] = true + TestUtil.silent do + gen.run + end + TestUtil.require(DIR, 'Add.rb', 'AddMappingRegistry.rb', 'AddServant.rb', 'AddService.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_driver + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/") + @client.mapping_registry = AddMappingRegistry::EncodedRegistry + @client.literal_mapping_registry = AddMappingRegistry::LiteralRegistry + @client.add_document_operation( + "Add", + "add", + [ [:in, "request", ["::SOAP::SOAPElement", "http://fault.test/Faulttest", "Add"]], + [:out, "response", ["::SOAP::SOAPElement", "http://fault.test/Faulttest", "AddResponse"]] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal, + :faults => {"AddFault"=>{:namespace=>nil, :name=>"AddFault", :use=>"literal", :encodingstyle=>"document", :ns=>"http://fault.test/Faulttest"}} } + ) + @client.wiredump_dev = STDOUT if $DEBUG + do_test(@client) + end + + def test_wsdl + wsdl = File.join(DIR, 'multifault.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.mapping_registry = AddMappingRegistry::EncodedRegistry + @client.literal_mapping_registry = AddMappingRegistry::LiteralRegistry + @client.wiredump_dev = STDOUT if $DEBUG + do_test(@client) + end + + def do_test(client) + assert_equal(100, client.add(Add.new(100)).sum) + assert_equal(100, client.add(Add.new(0)).sum) + assert_equal(150, client.add(Add.new(50)).sum) + begin + client.add(Add.new(101)) + assert(false) + rescue Exception => e + assert_equal(::SOAP::FaultError, e.class) + assert_equal("WSDL::Fault::AddFault", e.faultstring.data) + assert_equal("Value 101 is too large", e.detail.addFault.reason) + assert_equal("Critical", e.detail.addFault.severity) + end + begin + client.add(Add.new(-50)) + assert(false) + rescue Exception => e + assert_equal(::SOAP::FaultError, e.class) + assert_equal("WSDL::Fault::NegativeValueFault", e.faultstring.data) + assert_equal("Value -50 is negative", e.detail.negativeValueFault.reason) + assert_equal("Fatal", e.detail.negativeValueFault.severity) + end + end +end + + +end; end diff --git a/test/wsdl/group/expectedClassdef.rb b/test/wsdl/group/expectedClassdef.rb new file mode 100644 index 0000000..6919294 --- /dev/null +++ b/test/wsdl/group/expectedClassdef.rb @@ -0,0 +1,58 @@ +require 'xsd/qname' + +module WSDL; module Group + + +# {urn:grouptype}groupele_type +# comment - SOAP::SOAPString +# element - SOAP::SOAPString +# eletype - SOAP::SOAPString +# var - SOAP::SOAPString +# xmlattr_attr_min - SOAP::SOAPDecimal +# xmlattr_attr_max - SOAP::SOAPDecimal +class Groupele_type + AttrAttr_max = XSD::QName.new(nil, "attr_max") + AttrAttr_min = XSD::QName.new(nil, "attr_min") + + attr_accessor :comment + attr_reader :__xmlele_any + attr_accessor :element + attr_accessor :eletype + attr_accessor :var + + def set_any(elements) + @__xmlele_any = elements + end + + def __xmlattr + @__xmlattr ||= {} + end + + def xmlattr_attr_min + __xmlattr[AttrAttr_min] + end + + def xmlattr_attr_min=(value) + __xmlattr[AttrAttr_min] = value + end + + def xmlattr_attr_max + __xmlattr[AttrAttr_max] + end + + def xmlattr_attr_max=(value) + __xmlattr[AttrAttr_max] = value + end + + def initialize(comment = nil, element = nil, eletype = nil, var = nil) + @comment = comment + @__xmlele_any = nil + @element = element + @eletype = eletype + @var = var + @__xmlattr = {} + end +end + + +end; end diff --git a/test/wsdl/group/expectedDriver.rb b/test/wsdl/group/expectedDriver.rb new file mode 100644 index 0000000..d8dee8c --- /dev/null +++ b/test/wsdl/group/expectedDriver.rb @@ -0,0 +1,51 @@ +require 'echo.rb' +require 'echoMappingRegistry.rb' +require 'soap/rpc/driver' + +module WSDL::Group + +class Group_porttype < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://localhost:17171/" + + Methods = [ + [ "urn:group:echo", + "echo", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:grouptype", "groupele"]], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:grouptype", "groupele"]] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal, + :faults => {} } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = EchoMappingRegistry::EncodedRegistry + self.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end + + +end diff --git a/test/wsdl/group/expectedMappingRegistry.rb b/test/wsdl/group/expectedMappingRegistry.rb new file mode 100644 index 0000000..1c9d8ff --- /dev/null +++ b/test/wsdl/group/expectedMappingRegistry.rb @@ -0,0 +1,67 @@ +require 'echo.rb' +require 'soap/mapping' + +module WSDL; module Group + +module EchoMappingRegistry + EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new + LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new + NsGrouptype = "urn:grouptype" + NsXMLSchema = "http://www.w3.org/2001/XMLSchema" + + EncodedRegistry.register( + :class => WSDL::Group::Groupele_type, + :schema_type => XSD::QName.new(NsGrouptype, "groupele_type"), + :schema_element => [ + ["comment", "SOAP::SOAPString", [0, 1]], + ["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]], + [ :choice, + ["element", ["SOAP::SOAPString", XSD::QName.new(nil, "element")]], + ["eletype", ["SOAP::SOAPString", XSD::QName.new(nil, "eletype")]] + ], + ["var", ["SOAP::SOAPString", XSD::QName.new(nil, "var")]] + ], + :schema_attribute => { + XSD::QName.new(nil, "attr_min") => "SOAP::SOAPDecimal", + XSD::QName.new(nil, "attr_max") => "SOAP::SOAPDecimal" + } + ) + + LiteralRegistry.register( + :class => WSDL::Group::Groupele_type, + :schema_type => XSD::QName.new(NsGrouptype, "groupele_type"), + :schema_element => [ + ["comment", "SOAP::SOAPString", [0, 1]], + ["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]], + [ :choice, + ["element", ["SOAP::SOAPString", XSD::QName.new(nil, "element")]], + ["eletype", ["SOAP::SOAPString", XSD::QName.new(nil, "eletype")]] + ], + ["var", ["SOAP::SOAPString", XSD::QName.new(nil, "var")]] + ], + :schema_attribute => { + XSD::QName.new(nil, "attr_min") => "SOAP::SOAPDecimal", + XSD::QName.new(nil, "attr_max") => "SOAP::SOAPDecimal" + } + ) + + LiteralRegistry.register( + :class => WSDL::Group::Groupele_type, + :schema_name => XSD::QName.new(NsGrouptype, "groupele"), + :schema_element => [ + ["comment", "SOAP::SOAPString", [0, 1]], + ["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]], + [ :choice, + ["element", ["SOAP::SOAPString", XSD::QName.new(nil, "element")]], + ["eletype", ["SOAP::SOAPString", XSD::QName.new(nil, "eletype")]] + ], + ["var", ["SOAP::SOAPString", XSD::QName.new(nil, "var")]] + ], + :schema_attribute => { + XSD::QName.new(nil, "attr_min") => "SOAP::SOAPDecimal", + XSD::QName.new(nil, "attr_max") => "SOAP::SOAPDecimal" + } + ) +end + +end; end diff --git a/test/wsdl/group/group.wsdl b/test/wsdl/group/group.wsdl new file mode 100644 index 0000000..4012ea6 --- /dev/null +++ b/test/wsdl/group/group.wsdl @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/group/test_rpc.rb b/test/wsdl/group/test_rpc.rb new file mode 100644 index 0000000..a7b31cc --- /dev/null +++ b/test/wsdl/group/test_rpc.rb @@ -0,0 +1,145 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module Group + + +class TestGroup < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = 'urn:group' + TypeNamespace = 'urn:grouptype' + + def on_init + add_document_method( + self, + Namespace + ':echo', + 'echo', + XSD::QName.new(TypeNamespace, 'groupele'), + XSD::QName.new(TypeNamespace, 'groupele') + ) + self.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry + end + + def echo(arg) + # arg + # need to convert for 'any' + ret = Groupele_type.new(arg.comment, arg.element, arg.eletype, arg.var) + ret.xmlattr_attr_max = arg.xmlattr_attr_max + ret.xmlattr_attr_min = arg.xmlattr_attr_min + ret.set_any([::SOAP::SOAPElement.new("foo", arg.foo)]) + ret + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_classdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + File.unlink(pathname('echo.rb')) unless $DEBUG + File.unlink(pathname('echoMappingRegistry.rb')) unless $DEBUG + File.unlink(pathname('echoDriver.rb')) unless $DEBUG + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', "urn:group", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("group.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'echoDriver.rb', 'echoMappingRegistry.rb', 'echo.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def compare(expected, actual) + TestUtil.filecompare(pathname(expected), pathname(actual)) + end + + def test_generate + compare("expectedClassdef.rb", "echo.rb") + compare("expectedMappingRegistry.rb", "echoMappingRegistry.rb") + compare("expectedDriver.rb", "echoDriver.rb") + end + + def test_wsdl + wsdl = File.join(DIR, 'group.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + @client.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry + # + do_test_arg + end + + def test_naive + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/") + @client.add_document_method('echo', 'urn:group:echo', + XSD::QName.new('urn:grouptype', 'groupele'), + XSD::QName.new('urn:grouptype', 'groupele')) + @client.literal_mapping_registry = EchoMappingRegistry::LiteralRegistry + @client.wiredump_dev = STDOUT if $DEBUG + # + do_test_arg + end + + def test_stub + @client = Group_porttype.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDOUT if $DEBUG + # + do_test_arg + end + + def do_test_arg + arg = Groupele_type.new + arg.comment = "comment" + arg.set_any( + [::SOAP::SOAPElement.new("foo", "bar")] + ) + arg.eletype = "eletype" + arg.var = "var" + arg.xmlattr_attr_min = -3 + arg.xmlattr_attr_max = 3 + ret = @client.echo(arg) + assert_equal(arg.comment, ret.comment) + assert_equal(arg.eletype, ret.eletype) + assert_nil(ret.element) + assert_equal(arg.var, ret.var) + assert_equal("bar", ret.foo) + end +end + + +end; end diff --git a/test/wsdl/list/list.wsdl b/test/wsdl/list/list.wsdl new file mode 100644 index 0000000..e54dcef --- /dev/null +++ b/test/wsdl/list/list.wsdl @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/list/test_list.rb b/test/wsdl/list/test_list.rb new file mode 100644 index 0000000..6107332 --- /dev/null +++ b/test/wsdl/list/test_list.rb @@ -0,0 +1,124 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module List + + +class TestList < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = 'urn:list' + + def on_init + add_document_method( + self, + Namespace + ':echo', + 'echo', + XSD::QName.new(Namespace, 'echoele'), + XSD::QName.new(Namespace, 'echo_response') + ) + end + + def echo(arg) + arg + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_server + setup_classdef + @client = nil + end + + def teardown + teardown_server if @server + File.unlink(pathname('list.rb')) unless $DEBUG + File.unlink(pathname('listMappingRegistry.rb')) unless $DEBUG + File.unlink(pathname('listDriver.rb')) unless $DEBUG + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', Server::Namespace, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("list.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'listDriver.rb', 'listMappingRegistry.rb', 'list.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_wsdl + wsdl = File.join(DIR, 'list.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + e1 = Langlistinline.new([Langlistinline::Inlineruby, + Langlistinline::Inlineperl]) + e2 = Langlist.new([Language::Python, Language::Smalltalk]) + ret = @client.echo(Echoele.new(e1, e2)) + # in the future... + # assert_equal(e1, ret.e1) + # assert_equal(e2, ret.e2) + assert_equal(e1.join(" "), ret.e1) + assert_equal(e2.join(" "), ret.e2) + end + + def test_naive + @client = List_porttype.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDOUT if $DEBUG + e1 = Langlistinline.new([Langlistinline::Inlineruby, + Langlistinline::Inlineperl]) + e2 = Langlist.new([Language::Python, Language::Smalltalk]) + ret = @client.echo(Echoele.new(e1, e2)) + # in the future... + # assert_equal(e1, ret.e1) + # assert_equal(e2, ret.e2) + assert_equal(e1.join(" "), ret.e1) + assert_equal(e2.join(" "), ret.e2) + end + + def test_string_as_a_value + @client = List_porttype.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDOUT if $DEBUG + e1 = ['inlineruby', 'inlineperl'] + e2 = 'python smalltalk' + ret = @client.echo(Echoele.new(e1, e2)) + # in the future... + # assert_equal(e1, ret.e1) + # assert_equal(e2, ret.e2) + assert_equal(e1.join(" "), ret.e1) + assert_equal(e2, ret.e2) + end +end + + +end; end diff --git a/test/wsdl/map/map.wsdl b/test/wsdl/map/map.wsdl new file mode 100644 index 0000000..e418a4c --- /dev/null +++ b/test/wsdl/map/map.wsdl @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/map/map.xml b/test/wsdl/map/map.xml new file mode 100644 index 0000000..7106735 --- /dev/null +++ b/test/wsdl/map/map.xml @@ -0,0 +1,43 @@ + + + + + + + a + + + a1 + + a1 + + + + a2 + + a2 + + + + + + b + + + b1 + + b1 + + + + b2 + + b2 + + + + + + + + diff --git a/test/wsdl/map/test_map.rb b/test/wsdl/map/test_map.rb new file mode 100644 index 0000000..bf38387 --- /dev/null +++ b/test/wsdl/map/test_map.rb @@ -0,0 +1,99 @@ +require 'test/unit' +require 'soap/rpc/httpserver' +require 'soap/wsdlDriver' + + +module WSDL + + +class TestMap < Test::Unit::TestCase + Port = 17171 + DIR = File.dirname(File.expand_path(__FILE__)) + + class Server < ::SOAP::RPC::HTTPServer + def on_init + add_method(self, 'map') + add_method(self, 'map2', 'arg') + end + + def map + {1 => "a", 2 => "b"} + end + + def map2(arg) + arg + end + end + + def setup + setup_server + setup_client + end + + def setup_server + @server = Server.new( + :BindAddress => "0.0.0.0", + :Port => Port, + :AccessLog => [], + :SOAPDefaultNamespace => "urn:map" + ) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + Thread.current.abort_on_exception = true + @server.start + } + end + + def setup_client + wsdl = File.join(DIR, 'map.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.generate_explicit_type = true + @client.wiredump_dev = STDOUT if $DEBUG + end + + def teardown + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @t.kill + @t.join + end + + def teardown_client + @client.reset_stream + end + + def test_by_wsdl + dir = File.dirname(File.expand_path(__FILE__)) + wsdlfile = File.join(dir, 'map.wsdl') + xml = File.open(File.join(dir, 'map.xml')) { |f| f.read } + wsdl = WSDL::Importer.import(wsdlfile) + service = wsdl.services[0] + port = service.ports[0] + wsdl_types = wsdl.collect_complextypes + rpc_decode_typemap = wsdl_types + wsdl.soap_rpc_complextypes(port.find_binding) + opt = {} + opt[:default_encodingstyle] = ::SOAP::EncodingNamespace + opt[:decode_typemap] = rpc_decode_typemap + header, body = ::SOAP::Processor.unmarshal(xml, opt) + map = ::SOAP::Mapping.soap2obj(body.response) + assert_equal(["a1"], map["a"]["a1"]) + assert_equal(["a2"], map["a"]["a2"]) + assert_equal(["b1"], map["b"]["b1"]) + assert_equal(["b2"], map["b"]["b2"]) + end + + def test_wsdldriver + assert_equal({1 => "a", 2 => "b"}, @client.map) + assert_equal({1 => 2}, @client.map2({1 => 2})) + assert_equal({1 => {2 => 3}}, @client.map2({1 => {2 => 3}})) + assert_equal({["a", 2] => {2 => 3}}, @client.map2({["a", 2] => {2 => 3}})) + end +end + + +end diff --git a/test/wsdl/marshal/Person.rb b/test/wsdl/marshal/Person.rb new file mode 100644 index 0000000..1cf8fcb --- /dev/null +++ b/test/wsdl/marshal/Person.rb @@ -0,0 +1 @@ +require 'xsd/qname' diff --git a/test/wsdl/marshal/person.wsdl b/test/wsdl/marshal/person.wsdl new file mode 100644 index 0000000..6ea8a04 --- /dev/null +++ b/test/wsdl/marshal/person.wsdl @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + diff --git a/test/wsdl/marshal/person_org.rb b/test/wsdl/marshal/person_org.rb new file mode 100644 index 0000000..0c80ebe --- /dev/null +++ b/test/wsdl/marshal/person_org.rb @@ -0,0 +1,23 @@ +require 'xsd/qname' + +# {http://www.jin.gr.jp/~nahi/xmlns/sample/Person}Person +# familyname - SOAP::SOAPString +# givenname - SOAP::SOAPString +# var1 - SOAP::SOAPInt +# var2 - SOAP::SOAPDouble +# var3 - SOAP::SOAPString +class Person + attr_accessor :familyname + attr_accessor :givenname + attr_accessor :var1 + attr_accessor :var2 + attr_accessor :var3 + + def initialize(familyname = nil, givenname = nil, var1 = nil, var2 = nil, var3 = nil) + @familyname = familyname + @givenname = givenname + @var1 = var1 + @var2 = var2 + @var3 = var3 + end +end diff --git a/test/wsdl/marshal/test_wsdlmarshal.rb b/test/wsdl/marshal/test_wsdlmarshal.rb new file mode 100644 index 0000000..e9d20ec --- /dev/null +++ b/test/wsdl/marshal/test_wsdlmarshal.rb @@ -0,0 +1,76 @@ +require 'test/unit' +require 'wsdl/parser' +require 'soap/mapping/wsdlencodedregistry' +require 'soap/marshal' +require 'wsdl/soap/wsdl2ruby' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +class WSDLMarshaller + def initialize(wsdlfile) + wsdl = WSDL::Parser.new.parse(File.open(wsdlfile) { |f| f.read }) + types = wsdl.collect_complextypes + @opt = { + :decode_typemap => types, + :generate_explicit_type => false, + :pretty => true + } + @mapping_registry = ::SOAP::Mapping::WSDLEncodedRegistry.new(types) + end + + def dump(obj, io = nil) + ele = ::SOAP::Mapping.obj2soap(obj, @mapping_registry) + ele.elename = XSD::QName.new(nil, ele.type.name.to_s) + ::SOAP::Processor.marshal(::SOAP::SOAPEnvelope.new(nil, ::SOAP::SOAPBody.new(ele)), @opt, io) + end + + def load(io) + header, body = ::SOAP::Processor.unmarshal(io, @opt) + ::SOAP::Mapping.soap2obj(body.root_node, @mapping_registry) + end +end + + +require File.join(File.dirname(__FILE__), 'person_org') + +class Person + def ==(rhs) + @familyname == rhs.familyname and @givenname == rhs.givenname and + @var1 == rhs.var1 and @var2 == rhs.var2 and @var3 == rhs.var3 + end +end + + +class TestWSDLMarshal < Test::Unit::TestCase + DIR = File.dirname(File.expand_path(__FILE__)) + + def test_marshal + marshaller = WSDLMarshaller.new(pathname('person.wsdl')) + obj = Person.new("NAKAMURA", "Hiroshi", 1, 1.0, "1") + str = marshaller.dump(obj) + puts str if $DEBUG + obj2 = marshaller.load(str) + assert_equal(obj, obj2) + assert_equal(str, marshaller.dump(obj2)) + end + + def test_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("person.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['force'] = true + gen.run + compare("person_org.rb", "Person.rb") + File.unlink(pathname('Person.rb')) unless $DEBUG + end + + def compare(expected, actual) + TestUtil.filecompare(pathname(expected), pathname(actual)) + end + + def pathname(filename) + File.join(DIR, filename) + end +end diff --git a/test/wsdl/multiplefault.wsdl b/test/wsdl/multiplefault.wsdl new file mode 100644 index 0000000..a212ef4 --- /dev/null +++ b/test/wsdl/multiplefault.wsdl @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/oneway/oneway.wsdl b/test/wsdl/oneway/oneway.wsdl new file mode 100644 index 0000000..da7004d --- /dev/null +++ b/test/wsdl/oneway/oneway.wsdl @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/oneway/test_oneway.rb b/test/wsdl/oneway/test_oneway.rb new file mode 100644 index 0000000..c5a4c84 --- /dev/null +++ b/test/wsdl/oneway/test_oneway.rb @@ -0,0 +1,108 @@ +require 'test/unit' +require 'soap/rpc/standaloneServer' +require 'wsdl/soap/wsdl2ruby' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL +module Oneway + + +class TestOneway < Test::Unit::TestCase + NS = 'http://www.example.com/oneway' + class Server < ::SOAP::RPC::StandaloneServer + Methods = [ + [ "initiate", + "initiate", + [ [:in, "payload", ["::SOAP::SOAPElement", "http://www.example.com/oneway", "onewayProcessRequest"]] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => nil, + :faults => {} } + ] + ] + + def on_init + Methods.each do |definition| + add_document_operation(self, *definition) + end + self.mapping_registry = OnewayMappingRegistry::EncodedRegistry + self.literal_mapping_registry = OnewayMappingRegistry::LiteralRegistry + end + + def initiate(payload) + raise unless payload.msg + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_classdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('oneway.rb')) + File.unlink(pathname('onewayMappingRegistry.rb')) + File.unlink(pathname('onewayDriver.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', "http://www.example.com/oneway", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("oneway.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.opt['module_path'] = 'WSDL::Oneway' + gen.run + TestUtil.require(DIR, 'oneway.rb', 'onewayDriver.rb', 'onewayMappingRegistry.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_stub + @client = OnewayPort.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDERR if $DEBUG + # not raised + @client.initiate(OnewayProcessRequest.new("msg")) + @client.initiate(OnewayProcessRequest.new(nil)) + end + + def test_wsdl + @client = ::SOAP::WSDLDriverFactory.new(pathname('oneway.wsdl')).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDERR if $DEBUG + # not raised + @client.initiate(OnewayProcessRequest.new("msg")) + @client.initiate(OnewayProcessRequest.new(nil)) + end +end + + +end +end diff --git a/test/wsdl/overload/expectedClient.rb b/test/wsdl/overload/expectedClient.rb new file mode 100644 index 0000000..49e7725 --- /dev/null +++ b/test/wsdl/overload/expectedClient.rb @@ -0,0 +1,37 @@ +#!/usr/bin/env ruby +require 'defaultDriver.rb' + +endpoint_url = ARGV.shift +obj = OverloadServicePortType.new(endpoint_url) + +# run ruby with -d to see SOAP wiredumps. +obj.wiredump_dev = STDERR if $DEBUG + +# SYNOPSIS +# methodAlpha(in0, in1, in2) +# +# ARGS +# in0 C_String - {http://www.w3.org/2001/XMLSchema}string +# in1 C_String - {http://www.w3.org/2001/XMLSchema}string +# in2 C_String - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# methodAlphaReturn Long - {http://www.w3.org/2001/XMLSchema}long +# +in0 = in1 = in2 = nil +puts obj.methodAlpha(in0, in1, in2) + +# SYNOPSIS +# methodAlpha_2(in0, in1) +# +# ARGS +# in0 C_String - {http://www.w3.org/2001/XMLSchema}string +# in1 C_String - {http://www.w3.org/2001/XMLSchema}string +# +# RETURNS +# methodAlphaReturn Long - {http://www.w3.org/2001/XMLSchema}long +# +in0 = in1 = nil +puts obj.methodAlpha_2(in0, in1) + + diff --git a/test/wsdl/overload/expectedDriver.rb b/test/wsdl/overload/expectedDriver.rb new file mode 100644 index 0000000..60f3d07 --- /dev/null +++ b/test/wsdl/overload/expectedDriver.rb @@ -0,0 +1,61 @@ +require 'default.rb' +require 'defaultMappingRegistry.rb' +require 'soap/rpc/driver' + +class OverloadServicePortType < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://localhost/" + NsOverload = "urn:overload" + + Methods = [ + [ XSD::QName.new(NsOverload, "methodAlpha"), + "methodAlpha1", + "methodAlpha", + [ [:in, "in0", ["::SOAP::SOAPString"]], + [:in, "in1", ["::SOAP::SOAPString"]], + [:in, "in2", ["::SOAP::SOAPString"]], + [:retval, "methodAlphaReturn", ["::SOAP::SOAPLong"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new(NsOverload, "methodAlpha"), + "methodAlpha2", + "methodAlpha_2", + [ [:in, "in0", ["::SOAP::SOAPString"]], + [:in, "in1", ["::SOAP::SOAPString"]], + [:retval, "methodAlphaReturn", ["::SOAP::SOAPLong"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = DefaultMappingRegistry::EncodedRegistry + self.literal_mapping_registry = DefaultMappingRegistry::LiteralRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end + diff --git a/test/wsdl/overload/expectedServant.rb b/test/wsdl/overload/expectedServant.rb new file mode 100644 index 0000000..1ba2ba5 --- /dev/null +++ b/test/wsdl/overload/expectedServant.rb @@ -0,0 +1,35 @@ +require 'default.rb' + +class OverloadServicePortType + # SYNOPSIS + # methodAlpha(in0, in1, in2) + # + # ARGS + # in0 C_String - {http://www.w3.org/2001/XMLSchema}string + # in1 C_String - {http://www.w3.org/2001/XMLSchema}string + # in2 C_String - {http://www.w3.org/2001/XMLSchema}string + # + # RETURNS + # methodAlphaReturn Long - {http://www.w3.org/2001/XMLSchema}long + # + def methodAlpha(in0, in1, in2) + p [in0, in1, in2] + raise NotImplementedError.new + end + + # SYNOPSIS + # methodAlpha_2(in0, in1) + # + # ARGS + # in0 C_String - {http://www.w3.org/2001/XMLSchema}string + # in1 C_String - {http://www.w3.org/2001/XMLSchema}string + # + # RETURNS + # methodAlphaReturn Long - {http://www.w3.org/2001/XMLSchema}long + # + def methodAlpha_2(in0, in1) + p [in0, in1] + raise NotImplementedError.new + end +end + diff --git a/test/wsdl/overload/overload.wsdl b/test/wsdl/overload/overload.wsdl new file mode 100644 index 0000000..8e310df --- /dev/null +++ b/test/wsdl/overload/overload.wsdl @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/overload/test_overload.rb b/test/wsdl/overload/test_overload.rb new file mode 100644 index 0000000..1843ddc --- /dev/null +++ b/test/wsdl/overload/test_overload.rb @@ -0,0 +1,131 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module Overload + + +class TestOverload < Test::Unit::TestCase + TNS = "urn:overload" + + Methods = [ + [ + XSD::QName.new(TNS, 'methodAlpha'), "methodAlpha1", "method_alpha_1", + [ [:in, "in0", ["::SOAP::SOAPString"]], + [:in, "in1", ["::SOAP::SOAPString"]], + [:in, "in2", ["::SOAP::SOAPString"]], + [:retval, "methodAlphaReturn", ["::SOAP::SOAPLong"]] ] + ], + [ + XSD::QName.new(TNS, 'methodAlpha'), "methodAlpha2", "method_alpha_2", + [ [:in, "in0", ["::SOAP::SOAPString"]], + [:in, "in1", ["::SOAP::SOAPString"]], + [:retval, "methodAlphaReturn", ["::SOAP::SOAPLong"]] ] + ] + ] + + class Server < ::SOAP::RPC::StandaloneServer + def on_init + TestOverload::Methods.each do |definition| + add_rpc_operation(self, *definition) + end + end + + def method_alpha_1(in0, in1, in2) + 3 + end + + def method_alpha_2(in0, in1) + 2 + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_server + setup_classdef + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('default.rb')) + File.unlink(pathname('defaultMappingRegistry.rb')) + File.unlink(pathname('defaultDriver.rb')) + File.unlink(pathname('defaultServant.rb')) + File.unlink(pathname('OverloadServiceClient.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', "urn:rpc", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("overload.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['servant_skelton'] = nil + gen.opt['client_skelton'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'default.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_compare + compare("expectedDriver.rb", "defaultDriver.rb") + compare("expectedServant.rb", "defaultServant.rb") + compare("expectedClient.rb", "OverloadServiceClient.rb") + end + + def test_wsdl + wsdl = File.join(DIR, 'overload.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + assert_equal(3, @client.call("methodAlpha1", "1", "2", "3")) + assert_equal(2, @client.call("methodAlpha2", "1", "2")) + end + + def test_native + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/") + Methods.each do |definition| + @client.add_rpc_operation(*definition) + end + @client.wiredump_dev = STDOUT if $DEBUG + assert_equal(3, @client.call("methodAlpha1", "1", "2", "3")) + assert_equal(2, @client.call("methodAlpha2", "1", "2")) + end + + def compare(expected, actual) + TestUtil.filecompare(pathname(expected), pathname(actual)) + end +end + + +end; end diff --git a/test/wsdl/qualified/lp.wsdl b/test/wsdl/qualified/lp.wsdl new file mode 100644 index 0000000..b107b7b --- /dev/null +++ b/test/wsdl/qualified/lp.wsdl @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/qualified/lp.xsd b/test/wsdl/qualified/lp.xsd new file mode 100644 index 0000000..48e4709 --- /dev/null +++ b/test/wsdl/qualified/lp.xsd @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/qualified/np.wsdl b/test/wsdl/qualified/np.wsdl new file mode 100644 index 0000000..d3407dc --- /dev/null +++ b/test/wsdl/qualified/np.wsdl @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/qualified/test_qualified.rb b/test/wsdl/qualified/test_qualified.rb new file mode 100644 index 0000000..2c66531 --- /dev/null +++ b/test/wsdl/qualified/test_qualified.rb @@ -0,0 +1,137 @@ +require 'test/unit' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +if defined?(HTTPClient) + +module WSDL + + +class TestQualified < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = 'http://www50.brinkster.com/vbfacileinpt/np' + + def on_init + add_document_method( + self, + Namespace + '/GetPrimeNumbers', + 'GetPrimeNumbers', + XSD::QName.new(Namespace, 'GetPrimeNumbers'), + XSD::QName.new(Namespace, 'GetPrimeNumbersResponse') + ) + end + + def GetPrimeNumbers(arg) + nil + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + Port = 17171 + + def setup + setup_server + setup_clientdef + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('default.rb')) + File.unlink(pathname('defaultMappingRegistry.rb')) + File.unlink(pathname('defaultDriver.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', "urn:lp", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_clientdef + backupdir = Dir.pwd + begin + Dir.chdir(DIR) + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("np.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.run + require 'default.rb' + ensure + $".delete('default.rb') + Dir.chdir(backupdir) + end + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + LOGIN_REQUEST_QUALIFIED = +%q[ + + + + 2 + 10 + + +] + + def test_wsdl + wsdl = File.join(DIR, 'np.wsdl') + @client = nil + backupdir = Dir.pwd + begin + Dir.chdir(DIR) + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + ensure + Dir.chdir(backupdir) + end + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = str = '' + @client.GetPrimeNumbers(:Min => 2, :Max => 10) + assert_equal(LOGIN_REQUEST_QUALIFIED, parse_requestxml(str), + [LOGIN_REQUEST_QUALIFIED, parse_requestxml(str)].join("\n\n")) + end + + include ::SOAP + def test_naive + TestUtil.require(DIR, 'defaultDriver.rb', 'defaultMappingRegistry.rb', 'default.rb') + @client = PnumSoap.new("http://localhost:#{Port}/") + + @client.wiredump_dev = str = '' + @client.getPrimeNumbers(GetPrimeNumbers.new(2, 10)) + assert_equal(LOGIN_REQUEST_QUALIFIED, parse_requestxml(str), + [LOGIN_REQUEST_QUALIFIED, parse_requestxml(str)].join("\n\n")) + end + + def parse_requestxml(str) + str.split(/\r?\n\r?\n/)[3] + end +end + + +end + +end diff --git a/test/wsdl/qualified/test_unqualified.rb b/test/wsdl/qualified/test_unqualified.rb new file mode 100644 index 0000000..cb86fd3 --- /dev/null +++ b/test/wsdl/qualified/test_unqualified.rb @@ -0,0 +1,138 @@ +require 'test/unit' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +if defined?(HTTPClient) + +module WSDL + + +class TestUnqualified < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = 'urn:lp' + + def on_init + add_document_method( + self, + Namespace + ':login', + 'login', + XSD::QName.new(Namespace, 'login'), + XSD::QName.new(Namespace, 'loginResponse') + ) + end + + def login(arg) + nil + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + Port = 17171 + + def setup + setup_server + setup_clientdef + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('lp.rb')) + File.unlink(pathname('lpMappingRegistry.rb')) + File.unlink(pathname('lpDriver.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', "urn:lp", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_clientdef + backupdir = Dir.pwd + begin + Dir.chdir(DIR) + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("lp.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.run + require 'lp.rb' + ensure + $".delete('lp.rb') + Dir.chdir(backupdir) + end + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + LOGIN_REQUEST_QUALIFIED_UNTYPED = +%q[ + + + + NaHi + passwd + JST + + +] + + def test_wsdl + wsdl = File.join(DIR, 'lp.wsdl') + @client = nil + backupdir = Dir.pwd + begin + Dir.chdir(DIR) + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + ensure + Dir.chdir(backupdir) + end + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = str = '' + @client.login(:timezone => 'JST', :password => 'passwd', + :username => 'NaHi') + # untyped because of passing a Hash + assert_equal(LOGIN_REQUEST_QUALIFIED_UNTYPED, parse_requestxml(str)) + end + + include ::SOAP + def test_naive + TestUtil.require(DIR, 'lpDriver.rb', 'lpMappingRegistry.rb', 'lp.rb') + @client = Lp_porttype.new("http://localhost:#{Port}/") + + @client.wiredump_dev = str = '' + @client.login(Login.new('NaHi', 'passwd', 'JST')) + assert_equal(LOGIN_REQUEST_QUALIFIED_UNTYPED, parse_requestxml(str)) + end + + def parse_requestxml(str) + str.split(/\r?\n\r?\n/)[3] + end +end + + +end + +end diff --git a/test/wsdl/raa/RAAService.rb b/test/wsdl/raa/RAAService.rb new file mode 100644 index 0000000..7a3b4a9 --- /dev/null +++ b/test/wsdl/raa/RAAService.rb @@ -0,0 +1,125 @@ +#!/usr/bin/env ruby +require 'soap/rpc/standaloneServer' + +module WSDL; module RAA + +class RAABaseServicePortTypeServer + def getAllListings + ["ruby", "soap4r"] + end + + def getProductTree + raise NotImplementedError.new + end + + def getInfoFromCategory(category) + raise NotImplementedError.new + end + + def getModifiedInfoSince(timeInstant) + raise NotImplementedError.new + end + + def getInfoFromName(productName) + Info.new( + Category.new("major", "minor"), + Product.new(123, productName, "short description", "version", "status", + URI.parse("http://example.com/homepage"), + URI.parse("http://example.com/download"), + "license", "description"), + Owner.new(456, URI.parse("mailto:email@example.com"), "name"), + Time.now, + Time.now) + end + + def getInfoFromOwnerId(ownerId) + raise NotImplementedError.new + end + + Methods = [ + [ XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "getAllListings"), + "", + "getAllListings", + [ [:retval, "return", ["WSDL::RAA::C_String[]", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "StringArray"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "getProductTree"), + "", + "getProductTree", + [ [:retval, "return", ["Hash", "http://xml.apache.org/xml-soap", "Map"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "getInfoFromCategory"), + "", + "getInfoFromCategory", + [ [:in, "category", ["WSDL::RAA::Category", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category"]], + [:retval, "return", ["WSDL::RAA::Info[]", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "InfoArray"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "getModifiedInfoSince"), + "", + "getModifiedInfoSince", + [ [:in, "timeInstant", ["::SOAP::SOAPDateTime"]], + [:retval, "return", ["WSDL::RAA::Info[]", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "InfoArray"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "getInfoFromName"), + "", + "getInfoFromName", + [ [:in, "productName", ["::SOAP::SOAPString"]], + [:retval, "return", ["WSDL::RAA::Info", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new("http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "getInfoFromOwnerId"), + "", + "getInfoFromOwnerId", + [ [:in, "ownerId", ["::SOAP::SOAPInt"]], + [:retval, "return", ["WSDL::RAA::Info[]", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "InfoArray"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ] + ] +end + +end; end + +module WSDL; module RAA + +class RAABaseServicePortTypeApp < ::SOAP::RPC::StandaloneServer + def initialize(*arg) + super(*arg) + servant = WSDL::RAA::RAABaseServicePortTypeServer.new + WSDL::RAA::RAABaseServicePortType::Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + @router.add_document_operation(servant, *definitions) + else + @router.add_rpc_operation(servant, *definitions) + end + end + self.mapping_registry = RAAMappingRegistry::EncodedRegistry + self.literal_mapping_registry = RAAMappingRegistry::LiteralRegistry + end +end + +end; end + +if $0 == __FILE__ + # Change listen port. + server = WSDL::RAA::RAABaseServicePortTypeApp.new('app', nil, '0.0.0.0', 10080) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/test/wsdl/raa/README.txt b/test/wsdl/raa/README.txt new file mode 100644 index 0000000..efbaf9d --- /dev/null +++ b/test/wsdl/raa/README.txt @@ -0,0 +1,8 @@ +RAAServant.rb: based on the file which is generated with the following command; + bin/wsdl2ruby.rb --wsdl raa.wsdl --servant_skelton --force + +RAAService.rb: generated with the following command; + bin/wsdl2ruby.rb --wsdl raa.wsdl --standalone_server_stub --force + +RAA.rb: generated with the following command; + bin/wsdl2ruby.rb --wsdl raa.wsdl --classdef --force diff --git a/test/wsdl/raa/expectedClassDef.rb b/test/wsdl/raa/expectedClassDef.rb new file mode 100644 index 0000000..cefcd3f --- /dev/null +++ b/test/wsdl/raa/expectedClassDef.rb @@ -0,0 +1,100 @@ +require 'xsd/qname' + +module WSDL; module RAA + + +# {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}Category +# major - SOAP::SOAPString +# minor - SOAP::SOAPString +class Category + attr_accessor :major + attr_accessor :minor + + def initialize(major = nil, minor = nil) + @major = major + @minor = minor + end +end + +# {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}Product +# id - SOAP::SOAPInt +# name - SOAP::SOAPString +# short_description - SOAP::SOAPString +# version - SOAP::SOAPString +# status - SOAP::SOAPString +# homepage - SOAP::SOAPAnyURI +# download - SOAP::SOAPAnyURI +# license - SOAP::SOAPString +# description - SOAP::SOAPString +class Product + attr_accessor :id + attr_accessor :name + attr_accessor :short_description + attr_accessor :version + attr_accessor :status + attr_accessor :homepage + attr_accessor :download + attr_accessor :license + attr_accessor :description + + def initialize(id = nil, name = nil, short_description = nil, version = nil, status = nil, homepage = nil, download = nil, license = nil, description = nil) + @id = id + @name = name + @short_description = short_description + @version = version + @status = status + @homepage = homepage + @download = download + @license = license + @description = description + end +end + +# {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}Owner +# id - SOAP::SOAPInt +# email - SOAP::SOAPAnyURI +# name - SOAP::SOAPString +class Owner + attr_accessor :id + attr_accessor :email + attr_accessor :name + + def initialize(id = nil, email = nil, name = nil) + @id = id + @email = email + @name = name + end +end + +# {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}Info +# category - WSDL::RAA::Category +# product - WSDL::RAA::Product +# owner - WSDL::RAA::Owner +# created - SOAP::SOAPDateTime +# updated - SOAP::SOAPDateTime +class Info + attr_accessor :category + attr_accessor :product + attr_accessor :owner + attr_accessor :created + attr_accessor :updated + + def initialize(category = nil, product = nil, owner = nil, created = nil, updated = nil) + @category = category + @product = product + @owner = owner + @created = created + @updated = updated + end +end + +# {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}InfoArray +class InfoArray < ::Array +end + +# {http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/}StringArray +class StringArray < ::Array +end + + +end; end diff --git a/test/wsdl/raa/expectedDriver.rb b/test/wsdl/raa/expectedDriver.rb new file mode 100644 index 0000000..bfd18a0 --- /dev/null +++ b/test/wsdl/raa/expectedDriver.rb @@ -0,0 +1,96 @@ +require 'RAA.rb' +require 'RAAMappingRegistry.rb' +require 'soap/rpc/driver' + +module WSDL::RAA + +class RAABaseServicePortType < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://raa.ruby-lang.org/soap/1.0.2/" + NsC_002 = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/" + + Methods = [ + [ XSD::QName.new(NsC_002, "getAllListings"), + "", + "getAllListings", + [ [:retval, "return", ["WSDL::RAA::StringArray", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "StringArray"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new(NsC_002, "getProductTree"), + "", + "getProductTree", + [ [:retval, "return", ["Hash", "http://xml.apache.org/xml-soap", "Map"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new(NsC_002, "getInfoFromCategory"), + "", + "getInfoFromCategory", + [ [:in, "category", ["WSDL::RAA::Category", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Category"]], + [:retval, "return", ["WSDL::RAA::InfoArray", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "InfoArray"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new(NsC_002, "getModifiedInfoSince"), + "", + "getModifiedInfoSince", + [ [:in, "timeInstant", ["::SOAP::SOAPDateTime"]], + [:retval, "return", ["WSDL::RAA::InfoArray", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "InfoArray"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new(NsC_002, "getInfoFromName"), + "", + "getInfoFromName", + [ [:in, "productName", ["::SOAP::SOAPString"]], + [:retval, "return", ["WSDL::RAA::Info", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "Info"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new(NsC_002, "getInfoFromOwnerId"), + "", + "getInfoFromOwnerId", + [ [:in, "ownerId", ["::SOAP::SOAPInt"]], + [:retval, "return", ["WSDL::RAA::InfoArray", "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/", "InfoArray"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = RAAMappingRegistry::EncodedRegistry + self.literal_mapping_registry = RAAMappingRegistry::LiteralRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end + + +end diff --git a/test/wsdl/raa/expectedMappingRegistry.rb b/test/wsdl/raa/expectedMappingRegistry.rb new file mode 100644 index 0000000..a48a51d --- /dev/null +++ b/test/wsdl/raa/expectedMappingRegistry.rb @@ -0,0 +1,121 @@ +require 'RAA.rb' +require 'soap/mapping' + +module WSDL; module RAA + +module RAAMappingRegistry + EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new + LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new + NsC_002 = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.2/" + + EncodedRegistry.register( + :class => WSDL::RAA::Category, + :schema_type => XSD::QName.new(NsC_002, "Category"), + :schema_element => [ + ["major", ["SOAP::SOAPString", XSD::QName.new(nil, "major")]], + ["minor", ["SOAP::SOAPString", XSD::QName.new(nil, "minor")]] + ] + ) + + EncodedRegistry.register( + :class => WSDL::RAA::Product, + :schema_type => XSD::QName.new(NsC_002, "Product"), + :schema_element => [ + ["id", ["SOAP::SOAPInt", XSD::QName.new(nil, "id")]], + ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]], + ["short_description", ["SOAP::SOAPString", XSD::QName.new(nil, "short_description")]], + ["version", ["SOAP::SOAPString", XSD::QName.new(nil, "version")]], + ["status", ["SOAP::SOAPString", XSD::QName.new(nil, "status")]], + ["homepage", ["SOAP::SOAPAnyURI", XSD::QName.new(nil, "homepage")]], + ["download", ["SOAP::SOAPAnyURI", XSD::QName.new(nil, "download")]], + ["license", ["SOAP::SOAPString", XSD::QName.new(nil, "license")]], + ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]] + ] + ) + + EncodedRegistry.register( + :class => WSDL::RAA::Owner, + :schema_type => XSD::QName.new(NsC_002, "Owner"), + :schema_element => [ + ["id", ["SOAP::SOAPInt", XSD::QName.new(nil, "id")]], + ["email", ["SOAP::SOAPAnyURI", XSD::QName.new(nil, "email")]], + ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]] + ] + ) + + EncodedRegistry.register( + :class => WSDL::RAA::Info, + :schema_type => XSD::QName.new(NsC_002, "Info"), + :schema_element => [ + ["category", ["WSDL::RAA::Category", XSD::QName.new(nil, "category")]], + ["product", ["WSDL::RAA::Product", XSD::QName.new(nil, "product")]], + ["owner", ["WSDL::RAA::Owner", XSD::QName.new(nil, "owner")]], + ["created", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "created")]], + ["updated", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "updated")]] + ] + ) + + EncodedRegistry.set( + WSDL::RAA::InfoArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new(NsC_002, "Info") } + ) + + EncodedRegistry.set( + WSDL::RAA::StringArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::EncodedRegistry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") } + ) + + LiteralRegistry.register( + :class => WSDL::RAA::Category, + :schema_type => XSD::QName.new(NsC_002, "Category"), + :schema_element => [ + ["major", ["SOAP::SOAPString", XSD::QName.new(nil, "major")]], + ["minor", ["SOAP::SOAPString", XSD::QName.new(nil, "minor")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::RAA::Product, + :schema_type => XSD::QName.new(NsC_002, "Product"), + :schema_element => [ + ["id", ["SOAP::SOAPInt", XSD::QName.new(nil, "id")]], + ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]], + ["short_description", ["SOAP::SOAPString", XSD::QName.new(nil, "short_description")]], + ["version", ["SOAP::SOAPString", XSD::QName.new(nil, "version")]], + ["status", ["SOAP::SOAPString", XSD::QName.new(nil, "status")]], + ["homepage", ["SOAP::SOAPAnyURI", XSD::QName.new(nil, "homepage")]], + ["download", ["SOAP::SOAPAnyURI", XSD::QName.new(nil, "download")]], + ["license", ["SOAP::SOAPString", XSD::QName.new(nil, "license")]], + ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::RAA::Owner, + :schema_type => XSD::QName.new(NsC_002, "Owner"), + :schema_element => [ + ["id", ["SOAP::SOAPInt", XSD::QName.new(nil, "id")]], + ["email", ["SOAP::SOAPAnyURI", XSD::QName.new(nil, "email")]], + ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]] + ] + ) + + LiteralRegistry.register( + :class => WSDL::RAA::Info, + :schema_type => XSD::QName.new(NsC_002, "Info"), + :schema_element => [ + ["category", ["WSDL::RAA::Category", XSD::QName.new(nil, "category")]], + ["product", ["WSDL::RAA::Product", XSD::QName.new(nil, "product")]], + ["owner", ["WSDL::RAA::Owner", XSD::QName.new(nil, "owner")]], + ["created", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "created")]], + ["updated", ["SOAP::SOAPDateTime", XSD::QName.new(nil, "updated")]] + ] + ) + +end + +end; end diff --git a/test/wsdl/raa/raa.wsdl b/test/wsdl/raa/raa.wsdl new file mode 100644 index 0000000..2835610 --- /dev/null +++ b/test/wsdl/raa/raa.wsdl @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/raa/test_raa.rb b/test/wsdl/raa/test_raa.rb new file mode 100644 index 0000000..dd809f0 --- /dev/null +++ b/test/wsdl/raa/test_raa.rb @@ -0,0 +1,126 @@ +require 'test/unit' +require 'soap/wsdlDriver' +require 'wsdl/soap/wsdl2ruby' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL +module RAA + + +class TestRAA < Test::Unit::TestCase + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_stub + setup_server + setup_client + end + + def setup_stub + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("raa.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'RAADriver.rb', 'RAAMappingRegistry.rb', 'RAA.rb') + end + + def setup_server + require pathname('RAAService.rb') + @server = RAABaseServicePortTypeApp.new('RAA server', nil, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + Thread.current.abort_on_exception = true + @server.start + } + end + + def setup_client + wsdl = File.join(DIR, 'raa.wsdl') + @raa = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @raa.endpoint_url = "http://localhost:#{Port}/" + @raa.wiredump_dev = STDOUT if $DEBUG + @raa.mapping_registry = RAAMappingRegistry::EncodedRegistry + @raa.literal_mapping_registry = RAAMappingRegistry::LiteralRegistry + end + + def teardown + teardown_server if @server + teardown_client if @client + unless $DEBUG + File.unlink(pathname('RAA.rb')) + File.unlink(pathname('RAAMappingRegistry.rb')) + File.unlink(pathname('RAADriver.rb')) + end + end + + def teardown_server + @server.shutdown + @t.kill + @t.join + end + + def teardown_client + @raa.reset_stream + end + + def test_stubgeneration + compare("expectedClassDef.rb", "RAA.rb") + compare("expectedMappingRegistry.rb", "RAAMappingRegistry.rb") + compare("expectedDriver.rb", "RAADriver.rb") + end + + def test_raa + do_test_raa(@raa) + end + + def test_stub + client = RAABaseServicePortType.new("http://localhost:#{Port}/") + do_test_raa(client) + end + + def do_test_raa(client) + assert_equal(["ruby", "soap4r"], client.getAllListings) + info = client.getInfoFromName("SOAP4R") + assert_equal(Info, info.class) + assert_equal(Category, info.category.class) + assert_equal(Product, info.product.class) + assert_equal(Owner, info.owner.class) + assert_equal("major", info.category.major) + assert_equal("minor", info.category.minor) + assert_equal(123, info.product.id) + assert_equal("SOAP4R", info.product.name) + assert_equal("short description", info.product.short_description) + assert_equal("version", info.product.version) + assert_equal("status", info.product.status) + assert_equal("http://example.com/homepage", info.product.homepage.to_s) + assert_equal("http://example.com/download", info.product.download.to_s) + assert_equal("license", info.product.license) + assert_equal("description", info.product.description) + assert_equal(456, info.owner.id) + assert_equal("mailto:email@example.com", info.owner.email.to_s) + assert_equal("name", info.owner.name) + assert(!info.created.nil?) + assert(!info.updated.nil?) + end + + def compare(expected, actual) + TestUtil.filecompare(pathname(expected), pathname(actual)) + end + + def pathname(filename) + File.join(DIR, filename) + end +end + + +end +end diff --git a/test/wsdl/ref/expectedDriver.rb b/test/wsdl/ref/expectedDriver.rb new file mode 100644 index 0000000..5450570 --- /dev/null +++ b/test/wsdl/ref/expectedDriver.rb @@ -0,0 +1,51 @@ +require 'product.rb' +require 'productMappingRegistry.rb' +require 'soap/rpc/driver' + +module WSDL::Ref + +class Ref_porttype < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://localhost:17171/" + + Methods = [ + [ "urn:ref:echo", + "echo", + [ [:in, "parameters", ["::SOAP::SOAPElement", "urn:ref", "Product-Bag"]], + [:out, "parameters", ["::SOAP::SOAPElement", "urn:ref", "Creator"]] ], + { :request_style => :document, :request_use => :literal, + :response_style => :document, :response_use => :literal, + :faults => {} } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = ProductMappingRegistry::EncodedRegistry + self.literal_mapping_registry = ProductMappingRegistry::LiteralRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end + + +end diff --git a/test/wsdl/ref/expectedProduct.rb b/test/wsdl/ref/expectedProduct.rb new file mode 100644 index 0000000..206bc3a --- /dev/null +++ b/test/wsdl/ref/expectedProduct.rb @@ -0,0 +1,243 @@ +require 'xsd/qname' + +module WSDL; module Ref + + +# {urn:ref}Product +# name - SOAP::SOAPString +# rating - SOAP::SOAPString +class Product + attr_accessor :name + attr_accessor :rating + + def initialize(name = nil, rating = nil) + @name = name + @rating = rating + end +end + +# {urn:ref}Comment +# xmlattr_msgid - SOAP::SOAPString +class Comment < ::String + AttrMsgid = XSD::QName.new(nil, "msgid") + + def __xmlattr + @__xmlattr ||= {} + end + + def xmlattr_msgid + __xmlattr[AttrMsgid] + end + + def xmlattr_msgid=(value) + __xmlattr[AttrMsgid] = value + end + + def initialize(*arg) + super + @__xmlattr = {} + end +end + +# {urn:ref}_point +# xmlattr_unit - SOAP::SOAPString +class C__point < ::String + AttrUnit = XSD::QName.new(nil, "unit") + + def __xmlattr + @__xmlattr ||= {} + end + + def xmlattr_unit + __xmlattr[AttrUnit] + end + + def xmlattr_unit=(value) + __xmlattr[AttrUnit] = value + end + + def initialize(*arg) + super + @__xmlattr = {} + end +end + +# {urn:ref}Document +# xmlattr_ID - SOAP::SOAPString +class Document < ::String + AttrID = XSD::QName.new(nil, "ID") + + def __xmlattr + @__xmlattr ||= {} + end + + def xmlattr_ID + __xmlattr[AttrID] + end + + def xmlattr_ID=(value) + __xmlattr[AttrID] = value + end + + def initialize(*arg) + super + @__xmlattr = {} + end +end + +# {urn:ref}DerivedChoice_BaseSimpleContent +# varStringExt - SOAP::SOAPString +# varFloatExt - SOAP::SOAPFloat +# xmlattr_ID - SOAP::SOAPString +# xmlattr_attrStringExt - SOAP::SOAPString +class DerivedChoice_BaseSimpleContent < Document + AttrAttrStringExt = XSD::QName.new(nil, "attrStringExt") + AttrID = XSD::QName.new(nil, "ID") + + attr_accessor :varStringExt + attr_accessor :varFloatExt + + def __xmlattr + @__xmlattr ||= {} + end + + def xmlattr_ID + __xmlattr[AttrID] + end + + def xmlattr_ID=(value) + __xmlattr[AttrID] = value + end + + def xmlattr_attrStringExt + __xmlattr[AttrAttrStringExt] + end + + def xmlattr_attrStringExt=(value) + __xmlattr[AttrAttrStringExt] = value + end + + def initialize(varStringExt = nil, varFloatExt = nil) + @varStringExt = varStringExt + @varFloatExt = varFloatExt + @__xmlattr = {} + end +end + +# {urn:ref}Rating +class Rating < ::String + C_0 = new("0") + C_1 = new("+1") + C_1_2 = new("-1") +end + +# {urn:ref}Product-Bag +# bag - WSDL::Ref::Product +# rating - SOAP::SOAPString +# comment_1 - WSDL::Ref::ProductBag::Comment_1 +# comment_2 - WSDL::Ref::Comment +# m___point - WSDL::Ref::C__point +# xmlattr_version - SOAP::SOAPString +# xmlattr_yesno - SOAP::SOAPString +class ProductBag + AttrVersion = XSD::QName.new("urn:ref", "version") + AttrYesno = XSD::QName.new("urn:ref", "yesno") + + # inner class for member: Comment_1 + # {}Comment_1 + # xmlattr_msgid - SOAP::SOAPString + class Comment_1 < ::String + AttrMsgid = XSD::QName.new(nil, "msgid") + + def __xmlattr + @__xmlattr ||= {} + end + + def xmlattr_msgid + __xmlattr[AttrMsgid] + end + + def xmlattr_msgid=(value) + __xmlattr[AttrMsgid] = value + end + + def initialize(*arg) + super + @__xmlattr = {} + end + end + + attr_accessor :bag + attr_accessor :rating + attr_accessor :comment_1 + attr_accessor :comment_2 + + def m___point + @v___point + end + + def m___point=(value) + @v___point = value + end + + def __xmlattr + @__xmlattr ||= {} + end + + def xmlattr_version + __xmlattr[AttrVersion] + end + + def xmlattr_version=(value) + __xmlattr[AttrVersion] = value + end + + def xmlattr_yesno + __xmlattr[AttrYesno] + end + + def xmlattr_yesno=(value) + __xmlattr[AttrYesno] = value + end + + def initialize(bag = [], rating = [], comment_1 = [], comment_2 = [], v___point = nil) + @bag = bag + @rating = rating + @comment_1 = comment_1 + @comment_2 = comment_2 + @v___point = v___point + @__xmlattr = {} + end +end + +# {urn:ref}Creator +# xmlattr_Role - SOAP::SOAPString +class Creator < ::String + AttrRole = XSD::QName.new(nil, "Role") + + def __xmlattr + @__xmlattr ||= {} + end + + def xmlattr_Role + __xmlattr[AttrRole] + end + + def xmlattr_Role=(value) + __xmlattr[AttrRole] = value + end + + def initialize(*arg) + super + @__xmlattr = {} + end +end + +# {urn:ref}yesno +class Yesno < ::String + N = new("N") + Y = new("Y") +end + + +end; end diff --git a/test/wsdl/ref/product.wsdl b/test/wsdl/ref/product.wsdl new file mode 100644 index 0000000..b551849 --- /dev/null +++ b/test/wsdl/ref/product.wsdl @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/ref/test_ref.rb b/test/wsdl/ref/test_ref.rb new file mode 100644 index 0000000..e3ad238 --- /dev/null +++ b/test/wsdl/ref/test_ref.rb @@ -0,0 +1,268 @@ +require 'test/unit' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require 'wsdl/soap/wsdl2ruby' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL +module Ref + + +class TestRef < Test::Unit::TestCase + Namespace = 'urn:ref' + + class Server < ::SOAP::RPC::StandaloneServer + Namespace = TestRef::Namespace + + def on_init + add_document_method( + self, + Namespace + ':echo', + 'echo', + XSD::QName.new(Namespace, 'Product-Bag'), + XSD::QName.new(Namespace, 'Creator') + ) + self.literal_mapping_registry = ProductMappingRegistry::LiteralRegistry + end + + def echo(arg) + content = [ + arg.bag[0].name, + arg.bag[0].rating, + arg.bag[1].name, + arg.bag[1].rating, + arg.xmlattr_version, + arg.xmlattr_yesno, + arg.rating[0], + arg.rating[1], + arg.rating[2], + arg.comment_1[0], + arg.comment_1[0].xmlattr_msgid, + arg.comment_1[1], + arg.comment_1[1].xmlattr_msgid, + arg.comment_2[0], + arg.comment_2[0].xmlattr_msgid, + arg.comment_2[1], + arg.comment_2[1].xmlattr_msgid + ] + rv = Creator.new(content.join(" ")) + rv.xmlattr_Role = "role" + rv + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_classdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('product.rb')) + File.unlink(pathname('productMappingRegistry.rb')) + File.unlink(pathname('productDriver.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', Namespace, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("product.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'product.rb', 'productMappingRegistry.rb', 'productDriver.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def compare(expected, actual) + TestUtil.filecompare(pathname(expected), pathname(actual)) + end + + def test_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("product.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['classdef'] = nil + gen.opt['force'] = true + TestUtil.silent do + gen.run + end + compare("expectedProduct.rb", "product.rb") + compare("expectedDriver.rb", "productDriver.rb") + end + + def test_wsdl + wsdl = File.join(DIR, 'product.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + p1 = e("bag") + p1.add(e("name", "foo")) + p1.add(e(q(Namespace, "Rating"), "0")) + p2 = e("bag") + p2.add(e("name", "bar")) + p2.add(e(q(Namespace, "Rating"), "+1")) + version = "version" + yesno = "N" + r1 = e(q(Namespace, "Rating"), "0") + r2 = e(q(Namespace, "Rating"), "+1") + r3 = e(q(Namespace, "Rating"), "-1") + c11 = e("Comment_1", "comment11") + c11.extraattr["msgid"] = "msgid11" + c12 = e("Comment_1", "comment12") + c12.extraattr["msgid"] = "msgid12" + c21 = e("comment-2", "comment21") + c21.extraattr["msgid"] = "msgid21" + c22 = e("comment-2", "comment22") + c22.extraattr["msgid"] = "msgid22" + bag = e(q(Namespace, "Product-Bag")) + bag.add(p1) + bag.add(p2) + bag.add(r1) + bag.add(r2) + bag.add(r3) + bag.add(c11) + bag.add(c12) + bag.add(c21) + bag.add(c22) + bag.extraattr[q(Namespace, "version")] = version + bag.extraattr[q(Namespace, "yesno")] = yesno + ret = @client.echo(bag) + assert_equal( + [ + p1["name"].text, p1["Rating"].text, + p2["name"].text, p2["Rating"].text, + version, yesno, + r1.text, r2.text, r3.text, + c11.text, c11.extraattr["msgid"], + c12.text, c12.extraattr["msgid"], + c21.text, c21.extraattr["msgid"], + c22.text, c22.extraattr["msgid"] + ].join(" "), + ret + ) + assert_equal("role", ret.xmlattr_Role) + end + + def test_wsdl_with_classdef + wsdl = File.join(DIR, 'product.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.literal_mapping_registry = ProductMappingRegistry::LiteralRegistry + @client.wiredump_dev = STDOUT if $DEBUG + p1 = Product.new("foo", Rating::C_0) + p2 = Product.new("bar", Rating::C_1) + version = "version" + yesno = Yesno::Y + r1 = Rating::C_0 + r2 = Rating::C_1 + r3 = Rating::C_1_2 + c11 = ::SOAP::SOAPElement.new("Comment_1", "comment11") + c11.extraattr["msgid"] = "msgid11" + c12 = ::SOAP::SOAPElement.new("Comment_1", "comment12") + c12.extraattr["msgid"] = "msgid12" + c21 = Comment.new("comment21") + c21.xmlattr_msgid = "msgid21" + c22 = Comment.new("comment22") + c22.xmlattr_msgid = "msgid22" + bag = ProductBag.new([p1, p2], [r1, r2, r3], [c11, c12], [c21, c22]) + bag.xmlattr_version = version + bag.xmlattr_yesno = yesno + ret = @client.echo(bag) + assert_equal( + [ + p1.name, p1.rating, + p2.name, p2.rating, + version, yesno, + r1, r2, r3, + c11.text, c11.extraattr["msgid"], + c12.text, c12.extraattr["msgid"], + c21, c21.xmlattr_msgid, + c22, c22.xmlattr_msgid + ].join(" "), + ret + ) + assert_equal("role", ret.xmlattr_Role) + end + + def test_naive + @client = Ref_porttype.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDOUT if $DEBUG + p1 = Product.new("foo", Rating::C_0) + p2 = Product.new("bar", Rating::C_1) + version = "version" + yesno = Yesno::Y + r1 = Rating::C_0 + r2 = Rating::C_1 + r3 = Rating::C_1_2 + c11 = ::SOAP::SOAPElement.new("Comment_1", "comment11") + c11.extraattr["msgid"] = "msgid11" + c12 = ::SOAP::SOAPElement.new("Comment_1", "comment12") + c12.extraattr["msgid"] = "msgid12" + c21 = Comment.new("comment21") + c21.xmlattr_msgid = "msgid21" + c22 = Comment.new("comment22") + c22.xmlattr_msgid = "msgid22" + pts = C__point.new("123") + bag = ProductBag.new([p1, p2], [r1, r2, r3], [c11, c12], [c21, c22], pts) + bag.xmlattr_version = version + bag.xmlattr_yesno = yesno + ret = @client.echo(bag) + assert_equal( + [ + p1.name, p1.rating, + p2.name, p2.rating, + version, yesno, + r1, r2, r3, + c11.text, c11.extraattr["msgid"], + c12.text, c12.extraattr["msgid"], + c21, c21.xmlattr_msgid, + c22, c22.xmlattr_msgid + ].join(" "), + ret + ) + assert_equal("role", ret.xmlattr_Role) + end + + def e(name, text = nil) + ::SOAP::SOAPElement.new(name, text) + end + + def q(ns, name) + XSD::QName.new(ns, name) + end +end + + +end +end diff --git a/test/wsdl/rpc/rpc.wsdl b/test/wsdl/rpc/rpc.wsdl new file mode 100644 index 0000000..3e0c6ef --- /dev/null +++ b/test/wsdl/rpc/rpc.wsdl @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/rpc/test-rpc-lit.wsdl b/test/wsdl/rpc/test-rpc-lit.wsdl new file mode 100644 index 0000000..1196c4b --- /dev/null +++ b/test/wsdl/rpc/test-rpc-lit.wsdl @@ -0,0 +1,371 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/rpc/test_rpc.rb b/test/wsdl/rpc/test_rpc.rb new file mode 100644 index 0000000..2c3da1d --- /dev/null +++ b/test/wsdl/rpc/test_rpc.rb @@ -0,0 +1,176 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module RPC + + +class TestRPC < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + def on_init + add_rpc_method(self, 'echo', 'arg1', 'arg2') + add_rpc_method(self, 'echo_basetype', 'arg1', 'arg2') + add_rpc_method(self, 'echo_err', 'arg1', 'arg2') + self.mapping_registry = Prefix::EchoMappingRegistry::EncodedRegistry + end + + DummyPerson = Struct.new("family-name".intern, :Given_name) + def echo(arg1, arg2) + if arg1.given_name == 'typed' + self.generate_explicit_type = true + else + self.generate_explicit_type = false + end + ret = nil + case arg1.family_name + when 'normal' + arg1.family_name = arg2.family_name + arg1.given_name = arg2.given_name + arg1.age = arg2.age + ret = arg1 + when 'dummy' + ret = DummyPerson.new("family-name", "given_name") + when 'nil' + ret = Prefix::Person.new(nil, nil) + else + raise + end + ret + end + + def echo_basetype(arg1, arg2) + return nil if arg1.nil? and arg2.nil? + raise unless arg1.is_a?(Date) + arg1 + end + + ErrPerson = Struct.new(:Given_name, :no_such_element) + def echo_err(arg1, arg2) + self.generate_explicit_type = false + ErrPerson.new(58, Time.now) + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_classdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('echo.rb')) + File.unlink(pathname('echoMappingRegistry.rb')) + File.unlink(pathname('echoDriver.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', "urn:rpc", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + if ::Object.constants.include?("Echo") + ::Object.instance_eval { remove_const("Echo") } + end + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("rpc.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.opt['module_path'] = 'Prefix' + gen.run + TestUtil.require(DIR, 'echo.rb', 'echoMappingRegistry.rb', 'echoDriver.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_wsdl + wsdl = File.join(DIR, 'rpc.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDERR if $DEBUG + + ret = @client.echo(Prefix::Person.new("normal", "typed", 12, Prefix::Gender::F), Prefix::Person.new("Hi", "Na", 21, Prefix::Gender::M)) + assert_equal("Hi", ret.family_name) + assert_equal("Na", ret.given_name) + assert_equal(21, ret.age) + + ret = @client.echo(Prefix::Person.new("normal", "untyped", 12, Prefix::Gender::F), Prefix::Person.new("Hi", "Na", 21, Prefix::Gender::M)) + assert_equal("Hi", ret.family_name) + assert_equal("Na", ret.given_name) + # XXX WSDLEncodedRegistry should decode untyped element using Schema + assert_equal("21", ret.age) + + ret = @client.echo(Prefix::Person.new("dummy", "typed", 12, Prefix::Gender::F), Prefix::Person.new("Hi", "Na", 21, Prefix::Gender::M)) + assert_equal("family-name", ret.family_name) + assert_equal("given_name", ret.given_name) + + ret = @client.echo_err(Prefix::Person.new("Na", "Hi", nil, Prefix::Gender::F), Prefix::Person.new("Hi", "Na", nil, Prefix::Gender::M)) + assert_equal("58", ret.given_name) + end + + def test_stub + @client = Prefix::Echo_port_type.new("http://localhost:#{Port}/") + @client.mapping_registry = Prefix::EchoMappingRegistry::EncodedRegistry + @client.wiredump_dev = STDERR if $DEBUG + + ret = @client.echo(Prefix::Person.new("normal", "typed", 12, Prefix::Gender::F), Prefix::Person.new("Hi", "Na", 21, Prefix::Gender::M)) + assert_equal(Prefix::Person, ret.class) + assert_equal("Hi", ret.family_name) + assert_equal("Na", ret.given_name) + assert_equal(21, ret.age) + + ret = @client.echo(Prefix::Person.new("normal", "untyped", 12, Prefix::Gender::F), Prefix::Person.new("Hi", "Na", 21, Prefix::Gender::M)) + assert_equal(Prefix::Person, ret.class) + assert_equal("Hi", ret.family_name) + assert_equal("Na", ret.given_name) + assert_equal(21, ret.age) + end + + def test_stub_nil + @client = Prefix::Echo_port_type.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDOUT if $DEBUG + + ret = @client.echo(Prefix::Person.new("nil", "", 12, Prefix::Gender::F), Prefix::Person.new("Hi", "Na", 21, Prefix::Gender::M)) + assert_nil(ret.family_name) + assert_nil(ret.given_name) + assert_nil(ret.age) + # + assert_nil(@client.echo_basetype(nil, nil)) + end + + def test_basetype_stub + @client = Prefix::Echo_port_type.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDERR if $DEBUG + + ret = @client.echo_basetype(Time.now, 12345) + assert_equal(Date, ret.class) + end +end + + +end; end diff --git a/test/wsdl/rpc/test_rpc_lit.rb b/test/wsdl/rpc/test_rpc_lit.rb new file mode 100644 index 0000000..862a9b9 --- /dev/null +++ b/test/wsdl/rpc/test_rpc_lit.rb @@ -0,0 +1,470 @@ +require 'test/unit' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +if defined?(HTTPClient) and defined?(OpenSSL) + +module WSDL; module RPC + + +class TestRPCLIT < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = "http://soapbuilders.org/rpc-lit-test" + + def on_init + self.generate_explicit_type = false + self.literal_mapping_registry = RPCLiteralTestDefinitionsMappingRegistry::LiteralRegistry + add_rpc_operation(self, + XSD::QName.new(Namespace, 'echoStringArray'), + nil, + 'echoStringArray', [ + [:in, 'inputStringArray', nil], + [:retval, 'return', nil] + ], + { + :request_style => :rpc, + :request_use => :literal, + :response_style => :rpc, + :response_use => :literal + } + ) + add_rpc_operation(self, + XSD::QName.new(Namespace, 'echoStringArrayInline'), + nil, + 'echoStringArrayInline', [ + [:in, 'inputStringArray', nil], + [:retval, 'return', nil] + ], + { + :request_style => :rpc, + :request_use => :literal, + :response_style => :rpc, + :response_use => :literal + } + ) + add_rpc_operation(self, + XSD::QName.new(Namespace, 'echoNestedStruct'), + nil, + 'echoNestedStruct', [ + [:in, 'inputNestedStruct', nil], + [:retval, 'return', nil] + ], + { + :request_style => :rpc, + :request_use => :literal, + :response_style => :rpc, + :response_use => :literal + } + ) + add_rpc_operation(self, + XSD::QName.new(Namespace, 'echoStructArray'), + nil, + 'echoStructArray', [ + [:in, 'inputStructArray', nil], + [:retval, 'return', nil] + ], + { + :request_style => :rpc, + :request_use => :literal, + :response_style => :rpc, + :response_use => :literal + } + ) + end + + def echoStringArray(strings) + # strings.stringItem => Array + ArrayOfstring[*strings.stringItem] + end + + def echoStringArrayInline(strings) + ArrayOfstringInline[*strings.stringItem] + end + + def echoNestedStruct(struct) + struct + end + + def echoStructArray(ary) + ary + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_classdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('RPC-Literal-TestDefinitions.rb')) + File.unlink(pathname('RPC-Literal-TestDefinitionsMappingRegistry.rb')) + File.unlink(pathname('RPC-Literal-TestDefinitionsDriver.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', Server::Namespace, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("test-rpc-lit.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'RPC-Literal-TestDefinitions.rb', 'RPC-Literal-TestDefinitionsMappingRegistry.rb', 'RPC-Literal-TestDefinitionsDriver.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_wsdl_echoStringArray + wsdl = pathname('test-rpc-lit.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + # response contains only 1 part. + result = @client.echoStringArray(ArrayOfstring["a", "b", "c"])[0] + assert_equal(["a", "b", "c"], result.stringItem) + end + + ECHO_STRING_ARRAY_REQUEST = +%q[ + + + + + a + b + c + + + +] + + ECHO_STRING_ARRAY_RESPONSE = +%q[ + + + + + a + b + c + + + +] + + def test_stub_echoStringArray + drv = SoapTestPortTypeRpcLit.new("http://localhost:#{Port}/") + drv.wiredump_dev = str = '' + drv.generate_explicit_type = false + # response contains only 1 part. + result = drv.echoStringArray(ArrayOfstring["a", "b", "c"])[0] + assert_equal(ECHO_STRING_ARRAY_REQUEST, parse_requestxml(str), + [ECHO_STRING_ARRAY_REQUEST, parse_requestxml(str)].join("\n\n")) + assert_equal(ECHO_STRING_ARRAY_RESPONSE, parse_responsexml(str), + [ECHO_STRING_ARRAY_RESPONSE, parse_responsexml(str)].join("\n\n")) + assert_equal(ArrayOfstring["a", "b", "c"], result) + end + + ECHO_STRING_ARRAY_INLINE_REQUEST = +%q[ + + + + + a + b + c + + + +] + + ECHO_STRING_ARRAY_INLINE_RESPONSE = +%q[ + + + + + a + b + c + + + +] + + def test_stub_echoStringArrayInline + drv = SoapTestPortTypeRpcLit.new("http://localhost:#{Port}/") + drv.wiredump_dev = str = '' + drv.generate_explicit_type = false + # response contains only 1 part. + result = drv.echoStringArrayInline(ArrayOfstringInline["a", "b", "c"])[0] + assert_equal(ArrayOfstring["a", "b", "c"], result) + assert_equal(ECHO_STRING_ARRAY_INLINE_REQUEST, parse_requestxml(str), + [ECHO_STRING_ARRAY_INLINE_REQUEST, parse_requestxml(str)].join("\n\n")) + assert_equal(ECHO_STRING_ARRAY_INLINE_RESPONSE, parse_responsexml(str)) + end + + ECHO_NESTED_STRUCT_REQUEST = +%q[ + + + + + str + 1 + +1 + + str + 1 + +1 + + + + +] + + ECHO_NESTED_STRUCT_RESPONSE = +%q[ + + + + + str + 1 + +1 + + str + 1 + +1 + + + + +] + + def test_wsdl_echoNestedStruct + wsdl = pathname('test-rpc-lit.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = str = '' + @client.generate_explicit_type = false + # response contains only 1 part. + result = @client.echoNestedStruct(SOAPStructStruct.new("str", 1, 1.0, SOAPStruct.new("str", 1, 1.0)))[0] + assert_equal('str', result.varString) + assert_equal('1', result.varInt) + assert_equal('+1', result.varFloat) + assert_equal('str', result.structItem.varString) + assert_equal('1', result.structItem.varInt) + assert_equal('+1', result.structItem.varFloat) + assert_equal(ECHO_NESTED_STRUCT_REQUEST, parse_requestxml(str), + [ECHO_NESTED_STRUCT_REQUEST, parse_requestxml(str)].join("\n\n")) + assert_equal(ECHO_NESTED_STRUCT_RESPONSE, parse_responsexml(str)) + end + + ECHO_NESTED_STRUCT_REQUEST_NIL = +%q[ + + + + + str + +1 + + str + + +1 + + + + +] + + ECHO_NESTED_STRUCT_RESPONSE_NIL = +%q[ + + + + + str + +1 + + str + +1 + + + + +] + def test_wsdl_echoNestedStruct_nil + wsdl = pathname('test-rpc-lit.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = str = '' + @client.generate_explicit_type = false + result = @client.echoNestedStruct(SOAPStructStruct.new("str", nil, 1.0, SOAPStruct.new("str", ::SOAP::SOAPNil.new, 1.0)))[0] + assert(!result.respond_to?(:varInt)) + assert(result.respond_to?(:varString)) + assert_equal(ECHO_NESTED_STRUCT_REQUEST_NIL, parse_requestxml(str), + [ECHO_NESTED_STRUCT_REQUEST_NIL, parse_requestxml(str)].join("\n\n")) + assert_equal(ECHO_NESTED_STRUCT_RESPONSE_NIL, parse_responsexml(str)) + end + + def test_stub_echoNestedStruct + drv = SoapTestPortTypeRpcLit.new("http://localhost:#{Port}/") + drv.wiredump_dev = str = '' + drv.generate_explicit_type = false + # response contains only 1 part. + result = drv.echoNestedStruct(SOAPStructStruct.new("str", 1, 1.0, SOAPStruct.new("str", 1, 1.0)))[0] + assert_equal('str', result.varString) + assert_equal(1, result.varInt) + assert_equal(1.0, result.varFloat) + assert_equal('str', result.structItem.varString) + assert_equal(1, result.structItem.varInt) + assert_equal(1.0, result.structItem.varFloat) + assert_equal(ECHO_NESTED_STRUCT_REQUEST, parse_requestxml(str)) + assert_equal(ECHO_NESTED_STRUCT_RESPONSE, parse_responsexml(str)) + end + + def test_stub_echoNestedStruct_nil + drv = SoapTestPortTypeRpcLit.new("http://localhost:#{Port}/") + drv.wiredump_dev = str = '' + drv.generate_explicit_type = false + # response contains only 1 part. + result = drv.echoNestedStruct(SOAPStructStruct.new("str", nil, 1.0, SOAPStruct.new("str", ::SOAP::SOAPNil.new, 1.0)))[0] + assert(result.respond_to?(:varInt)) + assert(result.respond_to?(:varString)) + assert_equal(ECHO_NESTED_STRUCT_REQUEST_NIL, parse_requestxml(str), + [ECHO_NESTED_STRUCT_REQUEST_NIL, parse_requestxml(str)].join("\n\n")) + assert_equal(ECHO_NESTED_STRUCT_RESPONSE_NIL, parse_responsexml(str)) + end + + ECHO_STRUCT_ARRAY_REQUEST = +%q[ + + + + + + str + 2 + +2.1 + + + str + 2 + +2.1 + + + + +] + + ECHO_STRUCT_ARRAY_RESPONSE = +%q[ + + + + + + str + 2 + +2.1 + + + str + 2 + +2.1 + + + + +] + + def test_wsdl_echoStructArray + wsdl = pathname('test-rpc-lit.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = str = '' + @client.generate_explicit_type = false + # response contains only 1 part. + e = SOAPStruct.new("str", 2, 2.1) + result = @client.echoStructArray(ArrayOfSOAPStruct[e, e]) + assert_equal(ECHO_STRUCT_ARRAY_REQUEST, parse_requestxml(str), + [ECHO_STRUCT_ARRAY_REQUEST, parse_requestxml(str)].join("\n\n")) + assert_equal(ECHO_STRUCT_ARRAY_RESPONSE, parse_responsexml(str)) + end + + def test_stub_echoStructArray + drv = SoapTestPortTypeRpcLit.new("http://localhost:#{Port}/") + drv.wiredump_dev = str = '' + drv.generate_explicit_type = false + # response contains only 1 part. + e = SOAPStruct.new("str", 2, 2.1) + result = drv.echoStructArray(ArrayOfSOAPStruct[e, e]) + assert_equal(ECHO_STRUCT_ARRAY_REQUEST, parse_requestxml(str)) + assert_equal(ECHO_STRUCT_ARRAY_RESPONSE, parse_responsexml(str)) + end + + def parse_requestxml(str) + str.split(/\r?\n\r?\n/)[3] + end + + def parse_responsexml(str) + str.split(/\r?\n\r?\n/)[6] + end +end + + +end; end + +end diff --git a/test/wsdl/simplecontent/simplecontent.wsdl b/test/wsdl/simplecontent/simplecontent.wsdl new file mode 100644 index 0000000..79e1f4d --- /dev/null +++ b/test/wsdl/simplecontent/simplecontent.wsdl @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/simplecontent/test_simplecontent.rb b/test/wsdl/simplecontent/test_simplecontent.rb new file mode 100644 index 0000000..1c4a997 --- /dev/null +++ b/test/wsdl/simplecontent/test_simplecontent.rb @@ -0,0 +1,102 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module SimpleContent + + +class TestSimpleContent < Test::Unit::TestCase + NS = 'urn:www.example.org:simpleContent' + class Server < ::SOAP::RPC::StandaloneServer + def on_init + SimpleContentService::Methods.each do |definition| + add_document_operation(self, *definition) + end + self.literal_mapping_registry = + SimpleContentMappingRegistry::LiteralRegistry + end + + def echo(address) + address + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_classdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('simpleContent.rb')) + File.unlink(pathname('simpleContentMappingRegistry.rb')) + File.unlink(pathname('simpleContentDriver.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', "urn:www.example.org:simpleContent", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("simplecontent.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.opt['module_path'] = 'WSDL::SimpleContent' + gen.run + TestUtil.require(DIR, 'simpleContent.rb', 'simpleContentMappingRegistry.rb', 'simpleContentDriver.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_stub + @client = SimpleContentService.new("http://localhost:#{Port}/") + @client.wiredump_dev = STDERR if $DEBUG + + list = PhoneList.new + list.xmlattr_default = "default" + phone1 = PhoneNumber.new("12<>345") + phone1.xmlattr_type = PhoneNumberType::Fax + phone2 = PhoneNumber.new("234<>56") + phone2.xmlattr_type = PhoneNumberType::Home + list.phone << phone1 << phone2 + address = Address.new(list, "addr") + ret = @client.echo(address) + + assert_equal(address.blah, ret.blah) + assert_equal(2, ret.list.phone.size) + assert_equal("12<>345", ret.list.phone[0]) + assert_equal(PhoneNumberType::Fax, ret.list.phone[0].xmlattr_type) + assert_equal("234<>56", ret.list.phone[1]) + assert_equal(PhoneNumberType::Home, ret.list.phone[1].xmlattr_type) + end +end + + +end; end diff --git a/test/wsdl/simpletype/rpc/echo_version.rb b/test/wsdl/simpletype/rpc/echo_version.rb new file mode 100644 index 0000000..1cf8fcb --- /dev/null +++ b/test/wsdl/simpletype/rpc/echo_version.rb @@ -0,0 +1 @@ +require 'xsd/qname' diff --git a/test/wsdl/simpletype/rpc/echo_versionDriver.rb b/test/wsdl/simpletype/rpc/echo_versionDriver.rb new file mode 100644 index 0000000..737ccae --- /dev/null +++ b/test/wsdl/simpletype/rpc/echo_versionDriver.rb @@ -0,0 +1,10 @@ +require 'echo_version.rb' +require 'echo_versionMappingRegistry.rb' +require 'soap/rpc/driver' + +classEcho_version_port_type<::SOAP::RPC::Driver DefaultEndpointUrl="http://localhost:10080"NsSimpletypeRpc="urn:example.com:simpletype-rpc" + Methods=[[XSD::QName.new(NsSimpletypeRpc,"echo_version"),"urn:example.com:simpletype-rpc","echo_version",[[:in,"version",[nil,"urn:example.com:simpletype-rpc-type","version"]],[:retval,"version_struct",["Version_struct","urn:example.com:simpletype-rpc-type","version_struct"]]],{:request_style=>:rpc,:request_use=>:encoded,:response_style=>:rpc,:response_use=>:encoded,:faults=>{}}],[XSD::QName.new(NsSimpletypeRpc,"echo_version_r"),"urn:example.com:simpletype-rpc","echo_version_r",[[:in,"version_struct",["Version_struct","urn:example.com:simpletype-rpc-type","version_struct"]],[:retval,"version",[nil,"urn:example.com:simpletype-rpc-type","version"]]],{:request_style=>:rpc,:request_use=>:encoded,:response_style=>:rpc,:response_use=>:encoded,:faults=>{}}]] + definitialize(endpoint_url=nil)endpoint_url||=DefaultEndpointUrlsuper(endpoint_url,nil)self.mapping_registry=Echo_versionMappingRegistry::EncodedRegistryself.literal_mapping_registry=Echo_versionMappingRegistry::LiteralRegistryinit_methodsend +private + + definit_methodsMethods.eachdo|definitions|opt=definitions.lastifopt[:request_style]==:documentadd_document_operation(*definitions)elseadd_rpc_operation(*definitions)qname=definitions[0]name=definitions[2]ifqname.name!=nameandqname.name.capitalize==name.capitalize::SOAP::Mapping.define_singleton_method(self,qname.name)do|*arg|__send__(name,*arg)endendendendendend diff --git a/test/wsdl/simpletype/rpc/echo_versionMappingRegistry.rb b/test/wsdl/simpletype/rpc/echo_versionMappingRegistry.rb new file mode 100644 index 0000000..d9930e7 --- /dev/null +++ b/test/wsdl/simpletype/rpc/echo_versionMappingRegistry.rb @@ -0,0 +1,4 @@ +require 'echo_version.rb' +require'soap/mapping' +moduleEcho_versionMappingRegistry EncodedRegistry=::SOAP::Mapping::EncodedRegistry.newLiteralRegistry=::SOAP::Mapping::LiteralRegistry.new + end \ No newline at end of file diff --git a/test/wsdl/simpletype/rpc/echo_versionServant.rb b/test/wsdl/simpletype/rpc/echo_versionServant.rb new file mode 100644 index 0000000..d65a677 --- /dev/null +++ b/test/wsdl/simpletype/rpc/echo_versionServant.rb @@ -0,0 +1,3 @@ +require 'echo_version.rb' + +classEcho_version_port_typeend diff --git a/test/wsdl/simpletype/rpc/echo_version_service.rb b/test/wsdl/simpletype/rpc/echo_version_service.rb new file mode 100644 index 0000000..bb0b744 --- /dev/null +++ b/test/wsdl/simpletype/rpc/echo_version_service.rb @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +require 'echo_versionServant.rb' +require 'echo_versionMappingRegistry.rb' diff --git a/test/wsdl/simpletype/rpc/echo_version_serviceClient.rb b/test/wsdl/simpletype/rpc/echo_version_serviceClient.rb new file mode 100644 index 0000000..55eb58c --- /dev/null +++ b/test/wsdl/simpletype/rpc/echo_version_serviceClient.rb @@ -0,0 +1,34 @@ +#!/usr/bin/env ruby +require 'echo_versionDriver.rb' + +endpoint_url = ARGV.shift +obj = Echo_version_port_type.new(endpoint_url) + +# run ruby with -d to see SOAP wiredumps. +obj.wiredump_dev = STDERR if $DEBUG + +# SYNOPSIS +# echo_version(version) +# +# ARGS +# version Version - {urn:example.com:simpletype-rpc-type}version +# +# RETURNS +# version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct +# +version = nil +puts obj.echo_version(version) + +# SYNOPSIS +# echo_version_r(version_struct) +# +# ARGS +# version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct +# +# RETURNS +# version Version - {urn:example.com:simpletype-rpc-type}version +# +version_struct = nil +puts obj.echo_version_r(version_struct) + + diff --git a/test/wsdl/simpletype/rpc/expectedClient.rb b/test/wsdl/simpletype/rpc/expectedClient.rb new file mode 100644 index 0000000..55eb58c --- /dev/null +++ b/test/wsdl/simpletype/rpc/expectedClient.rb @@ -0,0 +1,34 @@ +#!/usr/bin/env ruby +require 'echo_versionDriver.rb' + +endpoint_url = ARGV.shift +obj = Echo_version_port_type.new(endpoint_url) + +# run ruby with -d to see SOAP wiredumps. +obj.wiredump_dev = STDERR if $DEBUG + +# SYNOPSIS +# echo_version(version) +# +# ARGS +# version Version - {urn:example.com:simpletype-rpc-type}version +# +# RETURNS +# version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct +# +version = nil +puts obj.echo_version(version) + +# SYNOPSIS +# echo_version_r(version_struct) +# +# ARGS +# version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct +# +# RETURNS +# version Version - {urn:example.com:simpletype-rpc-type}version +# +version_struct = nil +puts obj.echo_version_r(version_struct) + + diff --git a/test/wsdl/simpletype/rpc/expectedDriver.rb b/test/wsdl/simpletype/rpc/expectedDriver.rb new file mode 100644 index 0000000..2f327f1 --- /dev/null +++ b/test/wsdl/simpletype/rpc/expectedDriver.rb @@ -0,0 +1,58 @@ +require 'echo_version.rb' +require 'echo_versionMappingRegistry.rb' +require 'soap/rpc/driver' + +class Echo_version_port_type < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://localhost:10080" + NsSimpletypeRpc = "urn:example.com:simpletype-rpc" + + Methods = [ + [ XSD::QName.new(NsSimpletypeRpc, "echo_version"), + "urn:example.com:simpletype-rpc", + "echo_version", + [ [:in, "version", [nil, "urn:example.com:simpletype-rpc-type", "version"]], + [:retval, "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new(NsSimpletypeRpc, "echo_version_r"), + "urn:example.com:simpletype-rpc", + "echo_version_r", + [ [:in, "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]], + [:retval, "version", [nil, "urn:example.com:simpletype-rpc-type", "version"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = Echo_versionMappingRegistry::EncodedRegistry + self.literal_mapping_registry = Echo_versionMappingRegistry::LiteralRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end + diff --git a/test/wsdl/simpletype/rpc/expectedEchoVersion.rb b/test/wsdl/simpletype/rpc/expectedEchoVersion.rb new file mode 100644 index 0000000..9b79a68 --- /dev/null +++ b/test/wsdl/simpletype/rpc/expectedEchoVersion.rb @@ -0,0 +1,36 @@ +require 'xsd/qname' + +# {urn:example.com:simpletype-rpc-type}version_struct +# version - Version +# msg - SOAP::SOAPString +class Version_struct + attr_accessor :version + attr_accessor :msg + + def initialize(version = nil, msg = nil) + @version = version + @msg = msg + end +end + +# {urn:example.com:simpletype-rpc-type}version +class Version < ::String + C_16 = new("1.6") + C_18 = new("1.8") + C_19 = new("1.9") +end + +# {urn:example.com:simpletype-rpc-type}stateType +class StateType < ::String + StateType = new("stateType") +end + +# {urn:example.com:simpletype-rpc-type}zipIntType +class ZipIntType < ::String + C_123 = new("123") +end + +# {urn:example.com:simpletype-rpc-type}zipUnion +# any of tns:stateType tns:zipIntType +class ZipUnion < ::String +end diff --git a/test/wsdl/simpletype/rpc/expectedMappingRegistry.rb b/test/wsdl/simpletype/rpc/expectedMappingRegistry.rb new file mode 100644 index 0000000..8e4abb6 --- /dev/null +++ b/test/wsdl/simpletype/rpc/expectedMappingRegistry.rb @@ -0,0 +1,57 @@ +require 'echo_version.rb' +require 'soap/mapping' + +module Echo_versionMappingRegistry + EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new + LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new + NsSimpletypeRpcType = "urn:example.com:simpletype-rpc-type" + + EncodedRegistry.register( + :class => Version_struct, + :schema_type => XSD::QName.new(NsSimpletypeRpcType, "version_struct"), + :schema_element => [ + ["version", ["Version", XSD::QName.new(nil, "version")]], + ["msg", ["SOAP::SOAPString", XSD::QName.new(nil, "msg")]] + ] + ) + + EncodedRegistry.register( + :class => Version, + :schema_type => XSD::QName.new(NsSimpletypeRpcType, "version") + ) + + EncodedRegistry.register( + :class => StateType, + :schema_type => XSD::QName.new(NsSimpletypeRpcType, "stateType") + ) + + EncodedRegistry.register( + :class => ZipIntType, + :schema_type => XSD::QName.new(NsSimpletypeRpcType, "zipIntType") + ) + + LiteralRegistry.register( + :class => Version_struct, + :schema_type => XSD::QName.new(NsSimpletypeRpcType, "version_struct"), + :schema_element => [ + ["version", ["Version", XSD::QName.new(nil, "version")]], + ["msg", ["SOAP::SOAPString", XSD::QName.new(nil, "msg")]] + ] + ) + + LiteralRegistry.register( + :class => Version, + :schema_type => XSD::QName.new(NsSimpletypeRpcType, "version") + ) + + LiteralRegistry.register( + :class => StateType, + :schema_type => XSD::QName.new(NsSimpletypeRpcType, "stateType") + ) + + LiteralRegistry.register( + :class => ZipIntType, + :schema_type => XSD::QName.new(NsSimpletypeRpcType, "zipIntType") + ) + +end diff --git a/test/wsdl/simpletype/rpc/expectedServant.rb b/test/wsdl/simpletype/rpc/expectedServant.rb new file mode 100644 index 0000000..81cf502 --- /dev/null +++ b/test/wsdl/simpletype/rpc/expectedServant.rb @@ -0,0 +1,32 @@ +require 'echo_version.rb' + +class Echo_version_port_type + # SYNOPSIS + # echo_version(version) + # + # ARGS + # version Version - {urn:example.com:simpletype-rpc-type}version + # + # RETURNS + # version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct + # + def echo_version(version) + p [version] + raise NotImplementedError.new + end + + # SYNOPSIS + # echo_version_r(version_struct) + # + # ARGS + # version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct + # + # RETURNS + # version Version - {urn:example.com:simpletype-rpc-type}version + # + def echo_version_r(version_struct) + p [version_struct] + raise NotImplementedError.new + end +end + diff --git a/test/wsdl/simpletype/rpc/expectedService.rb b/test/wsdl/simpletype/rpc/expectedService.rb new file mode 100644 index 0000000..febdd1a --- /dev/null +++ b/test/wsdl/simpletype/rpc/expectedService.rb @@ -0,0 +1,55 @@ +#!/usr/bin/env ruby +require 'echo_versionServant.rb' +require 'echo_versionMappingRegistry.rb' +require 'soap/rpc/standaloneServer' + +class Echo_version_port_type + NsSimpletypeRpc = "urn:example.com:simpletype-rpc" + + Methods = [ + [ XSD::QName.new(NsSimpletypeRpc, "echo_version"), + "urn:example.com:simpletype-rpc", + "echo_version", + [ [:in, "version", [nil, "urn:example.com:simpletype-rpc-type", "version"]], + [:retval, "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new(NsSimpletypeRpc, "echo_version_r"), + "urn:example.com:simpletype-rpc", + "echo_version_r", + [ [:in, "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]], + [:retval, "version", [nil, "urn:example.com:simpletype-rpc-type", "version"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ] + ] +end + +class Echo_version_port_typeApp < ::SOAP::RPC::StandaloneServer + def initialize(*arg) + super(*arg) + servant = Echo_version_port_type.new + Echo_version_port_type::Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + @router.add_document_operation(servant, *definitions) + else + @router.add_rpc_operation(servant, *definitions) + end + end + self.mapping_registry = Echo_versionMappingRegistry::EncodedRegistry + self.literal_mapping_registry = Echo_versionMappingRegistry::LiteralRegistry + end +end + +if $0 == __FILE__ + # Change listen port. + server = Echo_version_port_typeApp.new('app', nil, '0.0.0.0', 10080) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/test/wsdl/simpletype/rpc/rpc.wsdl b/test/wsdl/simpletype/rpc/rpc.wsdl new file mode 100644 index 0000000..5952341 --- /dev/null +++ b/test/wsdl/simpletype/rpc/rpc.wsdl @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/simpletype/rpc/test_rpc.rb b/test/wsdl/simpletype/rpc/test_rpc.rb new file mode 100644 index 0000000..d913642 --- /dev/null +++ b/test/wsdl/simpletype/rpc/test_rpc.rb @@ -0,0 +1,52 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', '..', 'testutil.rb') + + +module WSDL; module SimpleType + + +class TestRPC < Test::Unit::TestCase + DIR = File.dirname(File.expand_path(__FILE__)) + def pathname(filename) + File.join(DIR, filename) + end + + def test_rpc + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("rpc.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['client_skelton'] = nil + gen.opt['servant_skelton'] = nil + gen.opt['standalone_server_stub'] = nil + gen.opt['force'] = true + TestUtil.silent do + gen.run + end + compare("expectedEchoVersion.rb", "echo_version.rb") + compare("expectedMappingRegistry.rb", "echo_versionMappingRegistry.rb") + compare("expectedDriver.rb", "echo_versionDriver.rb") + compare("expectedService.rb", "echo_version_service.rb") + compare("expectedClient.rb", "echo_version_serviceClient.rb") + compare("expectedServant.rb", "echo_versionServant.rb") + + File.unlink(pathname("echo_version.rb")) + File.unlink(pathname("echo_versionMappingRegistry.rb")) + File.unlink(pathname("echo_versionDriver.rb")) + File.unlink(pathname("echo_version_service.rb")) + File.unlink(pathname("echo_version_serviceClient.rb")) + File.unlink(pathname("echo_versionServant.rb")) + end + + def compare(expected, actual) + TestUtil.filecompare(pathname(expected), pathname(actual)) + end +end + + +end; end diff --git a/test/wsdl/simpletype/simpletype.wsdl b/test/wsdl/simpletype/simpletype.wsdl new file mode 100644 index 0000000..c497ca1 --- /dev/null +++ b/test/wsdl/simpletype/simpletype.wsdl @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/simpletype/test_simpletype.rb b/test/wsdl/simpletype/test_simpletype.rb new file mode 100644 index 0000000..760ab62 --- /dev/null +++ b/test/wsdl/simpletype/test_simpletype.rb @@ -0,0 +1,92 @@ +require 'test/unit' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL +module SimpleType + + +class TestSimpleType < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + def on_init + add_document_method(self, 'urn:example.com:simpletype:ping', 'ping', + XSD::QName.new('urn:example.com:simpletype', 'ruby'), + XSD::QName.new('http://www.w3.org/2001/XMLSchema', 'string')) + add_document_method(self, 'urn:example.com:simpletype:ping_id', 'ping_id', + XSD::QName.new('urn:example.com:simpletype', 'myid'), + XSD::QName.new('urn:example.com:simpletype', 'myid')) + end + + def ping(ruby) + version = ruby["myversion"] + date = ruby["date"] + "#{version} (#{date})" + end + + def ping_id(id) + id + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_server + setup_client + end + + def setup_server + @server = Server.new('Test', "urn:example.com:simpletype", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_client + wsdl = File.join(DIR, 'simpletype.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.generate_explicit_type = false + @client.wiredump_dev = STDOUT if $DEBUG + end + + def teardown + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def teardown_client + @client.reset_stream + end + + def test_ping + ret = @client.ping({:myversion => "1.9", :date => "2004-01-01T00:00:00Z"}) + assert_equal("1.9 (2004-01-01T00:00:00Z)", ret) + end + + def test_ping_id + ret = @client.ping_id("012345678901234567") + assert_equal("012345678901234567", ret) + # length + assert_raise(XSD::ValueSpaceError) do + @client.ping_id("0123456789012345678") + end + # pattern + assert_raise(XSD::ValueSpaceError) do + @client.ping_id("01234567890123456;") + end + end +end + + +end +end diff --git a/test/wsdl/soap/soapbodyparts.wsdl b/test/wsdl/soap/soapbodyparts.wsdl new file mode 100644 index 0000000..0e6da0e --- /dev/null +++ b/test/wsdl/soap/soapbodyparts.wsdl @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/soap/test_soapbodyparts.rb b/test/wsdl/soap/test_soapbodyparts.rb new file mode 100644 index 0000000..73264d9 --- /dev/null +++ b/test/wsdl/soap/test_soapbodyparts.rb @@ -0,0 +1,79 @@ +require 'test/unit' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' + + +module WSDL +module SOAP + + +class TestSOAPBodyParts < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + def on_init + add_method(self, 'foo', 'p1', 'p2', 'p3') + add_method(self, 'bar', 'p1', 'p2', 'p3') + add_method(self, 'baz', 'p1', 'p2', 'p3') + end + + def foo(p1, p2, p3) + [p1, p2, p3] + end + + alias bar foo + + def baz(p1, p2, p3) + [p3, p2, p1] + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_server + setup_client + end + + def setup_server + @server = Server.new('Test', "urn:www.example.com:soapbodyparts:v1", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @t = Thread.new { + Thread.current.abort_on_exception = true + @server.start + } + end + + def setup_client + wsdl = File.join(DIR, 'soapbodyparts.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDERR if $DEBUG + end + + def teardown + teardown_server if @server + teardown_client if @client + end + + def teardown_server + @server.shutdown + @t.kill + @t.join + end + + def teardown_client + @client.reset_stream + end + + def test_soapbodyparts + assert_equal(["1", "2", "3"], @client.foo("1", "2", "3")) + assert_equal(["3", "2", "1"], @client.foo("3", "2", "1")) + assert_equal(["1", "2", "3"], @client.bar("1", "2", "3")) + assert_equal(["3", "2", "1"], @client.baz("1", "2", "3")) + end +end + + +end +end diff --git a/test/wsdl/soap/wsdl2ruby/echo_version.rb b/test/wsdl/soap/wsdl2ruby/echo_version.rb new file mode 100644 index 0000000..1cf8fcb --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/echo_version.rb @@ -0,0 +1 @@ +require 'xsd/qname' diff --git a/test/wsdl/soap/wsdl2ruby/echo_versionDriver.rb b/test/wsdl/soap/wsdl2ruby/echo_versionDriver.rb new file mode 100644 index 0000000..737ccae --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/echo_versionDriver.rb @@ -0,0 +1,10 @@ +require 'echo_version.rb' +require 'echo_versionMappingRegistry.rb' +require 'soap/rpc/driver' + +classEcho_version_port_type<::SOAP::RPC::Driver DefaultEndpointUrl="http://localhost:10080"NsSimpletypeRpc="urn:example.com:simpletype-rpc" + Methods=[[XSD::QName.new(NsSimpletypeRpc,"echo_version"),"urn:example.com:simpletype-rpc","echo_version",[[:in,"version",[nil,"urn:example.com:simpletype-rpc-type","version"]],[:retval,"version_struct",["Version_struct","urn:example.com:simpletype-rpc-type","version_struct"]]],{:request_style=>:rpc,:request_use=>:encoded,:response_style=>:rpc,:response_use=>:encoded,:faults=>{}}],[XSD::QName.new(NsSimpletypeRpc,"echo_version_r"),"urn:example.com:simpletype-rpc","echo_version_r",[[:in,"version_struct",["Version_struct","urn:example.com:simpletype-rpc-type","version_struct"]],[:retval,"version",[nil,"urn:example.com:simpletype-rpc-type","version"]]],{:request_style=>:rpc,:request_use=>:encoded,:response_style=>:rpc,:response_use=>:encoded,:faults=>{}}]] + definitialize(endpoint_url=nil)endpoint_url||=DefaultEndpointUrlsuper(endpoint_url,nil)self.mapping_registry=Echo_versionMappingRegistry::EncodedRegistryself.literal_mapping_registry=Echo_versionMappingRegistry::LiteralRegistryinit_methodsend +private + + definit_methodsMethods.eachdo|definitions|opt=definitions.lastifopt[:request_style]==:documentadd_document_operation(*definitions)elseadd_rpc_operation(*definitions)qname=definitions[0]name=definitions[2]ifqname.name!=nameandqname.name.capitalize==name.capitalize::SOAP::Mapping.define_singleton_method(self,qname.name)do|*arg|__send__(name,*arg)endendendendendend diff --git a/test/wsdl/soap/wsdl2ruby/echo_versionMappingRegistry.rb b/test/wsdl/soap/wsdl2ruby/echo_versionMappingRegistry.rb new file mode 100644 index 0000000..d9930e7 --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/echo_versionMappingRegistry.rb @@ -0,0 +1,4 @@ +require 'echo_version.rb' +require'soap/mapping' +moduleEcho_versionMappingRegistry EncodedRegistry=::SOAP::Mapping::EncodedRegistry.newLiteralRegistry=::SOAP::Mapping::LiteralRegistry.new + end \ No newline at end of file diff --git a/test/wsdl/soap/wsdl2ruby/echo_versionServant.rb b/test/wsdl/soap/wsdl2ruby/echo_versionServant.rb new file mode 100644 index 0000000..d65a677 --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/echo_versionServant.rb @@ -0,0 +1,3 @@ +require 'echo_version.rb' + +classEcho_version_port_typeend diff --git a/test/wsdl/soap/wsdl2ruby/echo_version_service.cgi b/test/wsdl/soap/wsdl2ruby/echo_version_service.cgi new file mode 100644 index 0000000..bb0b744 --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/echo_version_service.cgi @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +require 'echo_versionServant.rb' +require 'echo_versionMappingRegistry.rb' diff --git a/test/wsdl/soap/wsdl2ruby/echo_version_service.rb b/test/wsdl/soap/wsdl2ruby/echo_version_service.rb new file mode 100644 index 0000000..7d0731f --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/echo_version_service.rb @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +require 'echo_versionServant.rb' +require 'echo_versionMappingRegistry.rb' +require'soap/rpc/standaloneServer' +classEcho_version_port_type NsSimpletypeRpc="urn:example.com:simpletype-rpc" + Methods=[[XSD::QName.new(NsSimpletypeRpc,"echo_version"),"urn:example.com:simpletype-rpc","echo_version",[[:in,"version",[nil,"urn:example.com:simpletype-rpc-type","version"]],[:retval,"version_struct",["Version_struct","urn:example.com:simpletype-rpc-type","version_struct"]]],{:request_style=>:rpc,:request_use=>:encoded,:response_style=>:rpc,:response_use=>:encoded,:faults=>{}}],[XSD::QName.new(NsSimpletypeRpc,"echo_version_r"),"urn:example.com:simpletype-rpc","echo_version_r",[[:in,"version_struct",["Version_struct","urn:example.com:simpletype-rpc-type","version_struct"]],[:retval,"version",[nil,"urn:example.com:simpletype-rpc-type","version"]]],{:request_style=>:rpc,:request_use=>:encoded,:response_style=>:rpc,:response_use=>:encoded,:faults=>{}}]]end +classEcho_version_port_typeApp<::SOAP::RPC::StandaloneServer definitialize(*arg)super(*arg)servant=Echo_version_port_type.newEcho_version_port_type::Methods.eachdo|definitions|opt=definitions.lastifopt[:request_style]==:document@router.add_document_operation(servant,*definitions)else@router.add_rpc_operation(servant,*definitions)endendself.mapping_registry=Echo_versionMappingRegistry::EncodedRegistryself.literal_mapping_registry=Echo_versionMappingRegistry::LiteralRegistryendendif$0==__FILE__#Changelistenport.server=Echo_version_port_typeApp.new('app',nil,'0.0.0.0',10080)trap(:INT)doserver.shutdownendserver.startend \ No newline at end of file diff --git a/test/wsdl/soap/wsdl2ruby/echo_version_serviceClient.rb b/test/wsdl/soap/wsdl2ruby/echo_version_serviceClient.rb new file mode 100644 index 0000000..55eb58c --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/echo_version_serviceClient.rb @@ -0,0 +1,34 @@ +#!/usr/bin/env ruby +require 'echo_versionDriver.rb' + +endpoint_url = ARGV.shift +obj = Echo_version_port_type.new(endpoint_url) + +# run ruby with -d to see SOAP wiredumps. +obj.wiredump_dev = STDERR if $DEBUG + +# SYNOPSIS +# echo_version(version) +# +# ARGS +# version Version - {urn:example.com:simpletype-rpc-type}version +# +# RETURNS +# version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct +# +version = nil +puts obj.echo_version(version) + +# SYNOPSIS +# echo_version_r(version_struct) +# +# ARGS +# version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct +# +# RETURNS +# version Version - {urn:example.com:simpletype-rpc-type}version +# +version_struct = nil +puts obj.echo_version_r(version_struct) + + diff --git a/test/wsdl/soap/wsdl2ruby/expectedClassdef.rb b/test/wsdl/soap/wsdl2ruby/expectedClassdef.rb new file mode 100644 index 0000000..2008b86 --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/expectedClassdef.rb @@ -0,0 +1,21 @@ +require 'xsd/qname' + +# {urn:example.com:simpletype-rpc-type}version_struct +# version - Version +# msg - SOAP::SOAPString +class Version_struct + attr_accessor :version + attr_accessor :msg + + def initialize(version = nil, msg = nil) + @version = version + @msg = msg + end +end + +# {urn:example.com:simpletype-rpc-type}version +class Version < ::String + C_16 = new("1.6") + C_18 = new("1.8") + C_19 = new("1.9") +end diff --git a/test/wsdl/soap/wsdl2ruby/expectedClient.rb b/test/wsdl/soap/wsdl2ruby/expectedClient.rb new file mode 100644 index 0000000..55eb58c --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/expectedClient.rb @@ -0,0 +1,34 @@ +#!/usr/bin/env ruby +require 'echo_versionDriver.rb' + +endpoint_url = ARGV.shift +obj = Echo_version_port_type.new(endpoint_url) + +# run ruby with -d to see SOAP wiredumps. +obj.wiredump_dev = STDERR if $DEBUG + +# SYNOPSIS +# echo_version(version) +# +# ARGS +# version Version - {urn:example.com:simpletype-rpc-type}version +# +# RETURNS +# version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct +# +version = nil +puts obj.echo_version(version) + +# SYNOPSIS +# echo_version_r(version_struct) +# +# ARGS +# version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct +# +# RETURNS +# version Version - {urn:example.com:simpletype-rpc-type}version +# +version_struct = nil +puts obj.echo_version_r(version_struct) + + diff --git a/test/wsdl/soap/wsdl2ruby/expectedDriver.rb b/test/wsdl/soap/wsdl2ruby/expectedDriver.rb new file mode 100644 index 0000000..2f327f1 --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/expectedDriver.rb @@ -0,0 +1,58 @@ +require 'echo_version.rb' +require 'echo_versionMappingRegistry.rb' +require 'soap/rpc/driver' + +class Echo_version_port_type < ::SOAP::RPC::Driver + DefaultEndpointUrl = "http://localhost:10080" + NsSimpletypeRpc = "urn:example.com:simpletype-rpc" + + Methods = [ + [ XSD::QName.new(NsSimpletypeRpc, "echo_version"), + "urn:example.com:simpletype-rpc", + "echo_version", + [ [:in, "version", [nil, "urn:example.com:simpletype-rpc-type", "version"]], + [:retval, "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new(NsSimpletypeRpc, "echo_version_r"), + "urn:example.com:simpletype-rpc", + "echo_version_r", + [ [:in, "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]], + [:retval, "version", [nil, "urn:example.com:simpletype-rpc-type", "version"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ] + ] + + def initialize(endpoint_url = nil) + endpoint_url ||= DefaultEndpointUrl + super(endpoint_url, nil) + self.mapping_registry = Echo_versionMappingRegistry::EncodedRegistry + self.literal_mapping_registry = Echo_versionMappingRegistry::LiteralRegistry + init_methods + end + +private + + def init_methods + Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + add_document_operation(*definitions) + else + add_rpc_operation(*definitions) + qname = definitions[0] + name = definitions[2] + if qname.name != name and qname.name.capitalize == name.capitalize + ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| + __send__(name, *arg) + end + end + end + end + end +end + diff --git a/test/wsdl/soap/wsdl2ruby/expectedMappingRegistry.rb b/test/wsdl/soap/wsdl2ruby/expectedMappingRegistry.rb new file mode 100644 index 0000000..530800c --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/expectedMappingRegistry.rb @@ -0,0 +1,36 @@ +require 'echo_version.rb' +require 'soap/mapping' + +module Echo_versionMappingRegistry + EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new + LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new + NsSimpletypeRpcType = "urn:example.com:simpletype-rpc-type" + + EncodedRegistry.register( + :class => Version_struct, + :schema_type => XSD::QName.new(NsSimpletypeRpcType, "version_struct"), + :schema_element => [ + ["version", ["Version", XSD::QName.new(nil, "version")]], + ["msg", ["SOAP::SOAPString", XSD::QName.new(nil, "msg")]] + ] + ) + + EncodedRegistry.register( + :class => Version, + :schema_type => XSD::QName.new(NsSimpletypeRpcType, "version") + ) + + LiteralRegistry.register( + :class => Version_struct, + :schema_type => XSD::QName.new(NsSimpletypeRpcType, "version_struct"), + :schema_element => [ + ["version", ["Version", XSD::QName.new(nil, "version")]], + ["msg", ["SOAP::SOAPString", XSD::QName.new(nil, "msg")]] + ] + ) + + LiteralRegistry.register( + :class => Version, + :schema_type => XSD::QName.new(NsSimpletypeRpcType, "version") + ) +end diff --git a/test/wsdl/soap/wsdl2ruby/expectedServant.rb b/test/wsdl/soap/wsdl2ruby/expectedServant.rb new file mode 100644 index 0000000..81cf502 --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/expectedServant.rb @@ -0,0 +1,32 @@ +require 'echo_version.rb' + +class Echo_version_port_type + # SYNOPSIS + # echo_version(version) + # + # ARGS + # version Version - {urn:example.com:simpletype-rpc-type}version + # + # RETURNS + # version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct + # + def echo_version(version) + p [version] + raise NotImplementedError.new + end + + # SYNOPSIS + # echo_version_r(version_struct) + # + # ARGS + # version_struct Version_struct - {urn:example.com:simpletype-rpc-type}version_struct + # + # RETURNS + # version Version - {urn:example.com:simpletype-rpc-type}version + # + def echo_version_r(version_struct) + p [version_struct] + raise NotImplementedError.new + end +end + diff --git a/test/wsdl/soap/wsdl2ruby/expectedService.cgi b/test/wsdl/soap/wsdl2ruby/expectedService.cgi new file mode 100755 index 0000000..043247f --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/expectedService.cgi @@ -0,0 +1,48 @@ +#!/usr/bin/env ruby +require 'echo_versionServant.rb' +require 'echo_versionMappingRegistry.rb' +require 'soap/rpc/cgistub' + +class Echo_version_port_type + NsSimpletypeRpc = "urn:example.com:simpletype-rpc" + + Methods = [ + [ XSD::QName.new(NsSimpletypeRpc, "echo_version"), + "urn:example.com:simpletype-rpc", + "echo_version", + [ [:in, "version", [nil, "urn:example.com:simpletype-rpc-type", "version"]], + [:retval, "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new(NsSimpletypeRpc, "echo_version_r"), + "urn:example.com:simpletype-rpc", + "echo_version_r", + [ [:in, "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]], + [:retval, "version", [nil, "urn:example.com:simpletype-rpc-type", "version"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ] + ] +end + +class Echo_version_port_typeApp < ::SOAP::RPC::CGIStub + def initialize(*arg) + super(*arg) + servant = Echo_version_port_type.new + Echo_version_port_type::Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + @router.add_document_operation(servant, *definitions) + else + @router.add_rpc_operation(servant, *definitions) + end + end + self.mapping_registry = Echo_versionMappingRegistry::EncodedRegistry + self.literal_mapping_registry = Echo_versionMappingRegistry::LiteralRegistry + self.level = Logger::Severity::ERROR + end +end +Echo_version_port_typeApp.new('app', nil).start diff --git a/test/wsdl/soap/wsdl2ruby/expectedService.rb b/test/wsdl/soap/wsdl2ruby/expectedService.rb new file mode 100644 index 0000000..febdd1a --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/expectedService.rb @@ -0,0 +1,55 @@ +#!/usr/bin/env ruby +require 'echo_versionServant.rb' +require 'echo_versionMappingRegistry.rb' +require 'soap/rpc/standaloneServer' + +class Echo_version_port_type + NsSimpletypeRpc = "urn:example.com:simpletype-rpc" + + Methods = [ + [ XSD::QName.new(NsSimpletypeRpc, "echo_version"), + "urn:example.com:simpletype-rpc", + "echo_version", + [ [:in, "version", [nil, "urn:example.com:simpletype-rpc-type", "version"]], + [:retval, "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ], + [ XSD::QName.new(NsSimpletypeRpc, "echo_version_r"), + "urn:example.com:simpletype-rpc", + "echo_version_r", + [ [:in, "version_struct", ["Version_struct", "urn:example.com:simpletype-rpc-type", "version_struct"]], + [:retval, "version", [nil, "urn:example.com:simpletype-rpc-type", "version"]] ], + { :request_style => :rpc, :request_use => :encoded, + :response_style => :rpc, :response_use => :encoded, + :faults => {} } + ] + ] +end + +class Echo_version_port_typeApp < ::SOAP::RPC::StandaloneServer + def initialize(*arg) + super(*arg) + servant = Echo_version_port_type.new + Echo_version_port_type::Methods.each do |definitions| + opt = definitions.last + if opt[:request_style] == :document + @router.add_document_operation(servant, *definitions) + else + @router.add_rpc_operation(servant, *definitions) + end + end + self.mapping_registry = Echo_versionMappingRegistry::EncodedRegistry + self.literal_mapping_registry = Echo_versionMappingRegistry::LiteralRegistry + end +end + +if $0 == __FILE__ + # Change listen port. + server = Echo_version_port_typeApp.new('app', nil, '0.0.0.0', 10080) + trap(:INT) do + server.shutdown + end + server.start +end diff --git a/test/wsdl/soap/wsdl2ruby/rpc.wsdl b/test/wsdl/soap/wsdl2ruby/rpc.wsdl new file mode 100644 index 0000000..91f71a8 --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/rpc.wsdl @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/soap/wsdl2ruby/section/expectedClassdef.rb b/test/wsdl/soap/wsdl2ruby/section/expectedClassdef.rb new file mode 100644 index 0000000..4fb193d --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/section/expectedClassdef.rb @@ -0,0 +1,37 @@ +require 'xsd/qname' + +# {urn:mysample}question +# something - SOAP::SOAPString +class Question + attr_accessor :something + + def initialize(something = nil) + @something = something + end +end + +# {urn:mysample}section +# sectionID - SOAP::SOAPInt +# name - SOAP::SOAPString +# description - SOAP::SOAPString +# index - SOAP::SOAPInt +# firstQuestion - Question +class Section + attr_accessor :sectionID + attr_accessor :name + attr_accessor :description + attr_accessor :index + attr_accessor :firstQuestion + + def initialize(sectionID = nil, name = nil, description = nil, index = nil, firstQuestion = nil) + @sectionID = sectionID + @name = name + @description = description + @index = index + @firstQuestion = firstQuestion + end +end + +# {urn:mysample}sectionArray +class SectionArray < ::Array +end diff --git a/test/wsdl/soap/wsdl2ruby/section/section.xsd b/test/wsdl/soap/wsdl2ruby/section/section.xsd new file mode 100644 index 0000000..aee6557 --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/section/section.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/soap/wsdl2ruby/section/test_section.rb b/test/wsdl/soap/wsdl2ruby/section/test_section.rb new file mode 100644 index 0000000..2c04c85 --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/section/test_section.rb @@ -0,0 +1,53 @@ +require 'test/unit' +require 'soap/marshal' +require 'rbconfig' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', '..', '..', 'testutil.rb') + + +module WSDL; module SOAP + + +class TestSection < Test::Unit::TestCase + DIR = File.dirname(File.expand_path(__FILE__)) + RUBY = Config::CONFIG['RUBY_INSTALL_NAME'] + + def setup + system("cd #{DIR} && #{RUBY} #{pathname("../../../../../bin/xsd2ruby.rb")} --xsd #{pathname("section.xsd")} --classdef --force --quiet") + end + + def teardown + File.unlink(pathname("mysample.rb")) unless $DEBUG + end + + def test_classdef + compare("expectedClassdef.rb", "mysample.rb") + end + + def test_marshal + # avoid name crash ( => an Item when a class Item is defined) + if ::Object.constants.include?("Item") + ::Object.instance_eval { remove_const("Item") } + end + TestUtil.require(DIR, 'mysample.rb') + s1 = Section.new(1, "section1", "section 1", 1001, Question.new("q1")) + s2 = Section.new(2, "section2", "section 2", 1002, Question.new("q2")) + org = SectionArray[s1, s2] + obj = ::SOAP::Marshal.unmarshal(::SOAP::Marshal.marshal(org)) + assert_equal(SectionArray, obj.class) + assert_equal(Section, obj[0].class) + assert_equal(Question, obj[0].firstQuestion.class) + end + +private + + def pathname(filename) + File.join(DIR, filename) + end + + def compare(expected, actual) + TestUtil.filecompare(pathname(expected), pathname(actual)) + end +end + + +end; end diff --git a/test/wsdl/soap/wsdl2ruby/soapenc/soapenc.wsdl b/test/wsdl/soap/wsdl2ruby/soapenc/soapenc.wsdl new file mode 100644 index 0000000..63ffb76 --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/soapenc/soapenc.wsdl @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb b/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb new file mode 100644 index 0000000..4cfd137 --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb @@ -0,0 +1,83 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', '..', '..', 'testutil.rb') + + +module WSDL; module SOAP; module T_WSDL2Ruby + + +class TestSOAPENC < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + def on_init + add_rpc_method(self, 'echo_version', 'version') + end + + def echo_version(version) + Version_struct.new(version, "hello") + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_classdef + setup_server + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('echo.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', "urn:example.com:soapenc", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + if ::Object.constants.include?("Version_struct") + ::Object.instance_eval { remove_const("Version_struct") } + end + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("soapenc.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'echo.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_wsdl + wsdl = File.join(DIR, 'soapenc.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + ret = @client.echo_version(T_version::C_19) + assert_equal(T_version::C_19, ret.version) + assert_equal("hello", ret.msg) + end +end + + +end; end; end diff --git a/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb b/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb new file mode 100644 index 0000000..23252de --- /dev/null +++ b/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb @@ -0,0 +1,102 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', '..', 'testutil.rb') + + +module WSDL; module SOAP + + +class TestWSDL2Ruby < Test::Unit::TestCase + DIR = File.dirname(File.expand_path(__FILE__)) + + def setup + Dir.chdir(DIR) do + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("rpc.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['client_skelton'] = nil + gen.opt['servant_skelton'] = nil + gen.opt['cgi_stub'] = nil + gen.opt['standalone_server_stub'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['force'] = true + TestUtil.silent do + gen.run + end + end + end + + def teardown + # leave generated file for debug. + end + + def test_rpc + compare("expectedServant.rb", "echo_versionServant.rb") + compare("expectedClassdef.rb", "echo_version.rb") + compare("expectedService.rb", "echo_version_service.rb") + compare("expectedService.cgi", "echo_version_service.cgi") + compare("expectedMappingRegistry.rb", "echo_versionMappingRegistry.rb") + compare("expectedDriver.rb", "echo_versionDriver.rb") + compare("expectedClient.rb", "echo_version_serviceClient.rb") + + File.unlink(pathname("echo_versionServant.rb")) + File.unlink(pathname("echo_version.rb")) + File.unlink(pathname("echo_version_service.rb")) + File.unlink(pathname("echo_version_service.cgi")) + File.unlink(pathname("echo_versionMappingRegistry.rb")) + File.unlink(pathname("echo_versionDriver.rb")) + File.unlink(pathname("echo_version_serviceClient.rb")) + end + + EXPECTED_CLASSDEF = <<__RB__ +require 'xsd/qname' + +module TEST + + +# {urn:example.com:simpletype-rpc-type}version_struct +# version - TEST::Version +# msg - SOAP::SOAPString +class Version_struct + attr_accessor :version + attr_accessor :msg + + def initialize(version = nil, msg = nil) + @version = version + @msg = msg + end +end + + +end +__RB__ + + def test_classdefcreator + wsdl = WSDL::Importer.import(pathname("rpc.wsdl")) + name_creator = WSDL::SOAP::ClassNameCreator.new + creator = WSDL::SOAP::ClassDefCreator.new(wsdl, name_creator, 'TEST') + classdef = creator.dump(XSD::QName.new('urn:example.com:simpletype-rpc-type', 'version_struct')) + assert_equal(EXPECTED_CLASSDEF, classdef) + end + +private + + def pathname(filename) + File.join(DIR, filename) + end + + def compare(expected, actual) + TestUtil.filecompare(pathname(expected), pathname(actual)) + end + + def loadfile(file) + File.open(pathname(file)) { |f| f.read } + end +end + + +end; end diff --git a/test/wsdl/soaptype/soaptype.wsdl b/test/wsdl/soaptype/soaptype.wsdl new file mode 100644 index 0000000..f07ae11 --- /dev/null +++ b/test/wsdl/soaptype/soaptype.wsdl @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/wsdl/soaptype/test_soaptype.rb b/test/wsdl/soaptype/test_soaptype.rb new file mode 100644 index 0000000..6b0db85 --- /dev/null +++ b/test/wsdl/soaptype/test_soaptype.rb @@ -0,0 +1,178 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module WSDL; module RPC + + +class TestSOAPTYPE < Test::Unit::TestCase + include ::SOAP + + class Server < ::SOAP::RPC::StandaloneServer + include ::SOAP + + def on_init + #self.generate_explicit_type = false + add_rpc_method(self, 'echo_soaptype', 'arg') + end + + def echo_soaptype(arg) + res = Wrapper.new + res.short = SOAPShort.new(arg.short) + res.long = SOAPLong.new(arg.long) + res.double = SOAPFloat.new(arg.double) + res + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_server + setup_classdef + @client = nil + end + + def teardown + teardown_server if @server + unless $DEBUG + File.unlink(pathname('echo.rb')) + File.unlink(pathname('echoMappingRegistry.rb')) + File.unlink(pathname('echoDriver.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', "urn:soaptype", '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = TestUtil.start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("soaptype.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '') + gen.run + TestUtil.require(DIR, 'echo.rb', 'echoMappingRegistry.rb', 'echoDriver.rb') + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def pathname(filename) + File.join(DIR, filename) + end + +SOAPTYPE_WSDL_XML = %q[ + + + + + 123 + 456 + +789 + + + +] + +SOAPTYPE_NATIVE_XML = %q[ + + + + + 123 + 456 + +789 + + + +] + + def test_wsdl + wsdl = File.join(DIR, 'soaptype.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = str = '' + + arg = Wrapper.new + arg.short = 123 + arg.long = 456 + arg.double = 789 + res = @client.echo_soaptype(arg) + + assert_equal(123, res.short) + assert_equal(456, res.long) + assert_equal(789.0, res.double) + + assert_equal(SOAPTYPE_WSDL_XML, parse_requestxml(str)) + end + + def test_stub + @client = WSDL::RPC::Echo_port_type.new("http://localhost:#{Port}/") + @client.wiredump_dev = str = '' + + arg = WSDL::RPC::Wrapper.new + arg.short = 123 + arg.long = 456 + arg.double = 789 + res = @client.echo_soaptype(arg) + + assert_equal(123, res.short) + assert_equal(456, res.long) + assert_equal(789.0, res.double) + + assert_equal(SOAPTYPE_WSDL_XML, parse_requestxml(str)) + end + + def test_native + @client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/", 'urn:soaptype') + @client.endpoint_url = "http://localhost:#{Port}/" + @client.add_method('echo_soaptype', 'arg') + @client.wiredump_dev = str = '' + @client.mapping_registry = WSDL::RPC::EchoMappingRegistry::EncodedRegistry + @client.literal_mapping_registry = WSDL::RPC::EchoMappingRegistry::LiteralRegistry + + arg = ::Struct.new(:short, :long, :double).new + arg.short = SOAPShort.new(123) + arg.long = SOAPLong.new(456) + arg.double = SOAPDouble.new(789) + res = @client.echo_soaptype(arg) + + assert_equal(123, res.short) + assert_equal(456, res.long) + assert_equal(789.0, res.double) + + assert_equal(SOAPTYPE_NATIVE_XML, parse_requestxml(str)) + end + + def parse_requestxml(str) + str.split(/\r?\n\r?\n/)[3] + end +end + + +end; end diff --git a/test/wsdl/test_emptycomplextype.rb b/test/wsdl/test_emptycomplextype.rb new file mode 100644 index 0000000..71d1b86 --- /dev/null +++ b/test/wsdl/test_emptycomplextype.rb @@ -0,0 +1,21 @@ +require 'test/unit' +require 'wsdl/parser' + + +module WSDL + + +class TestWSDL < Test::Unit::TestCase + def setup + @file = File.join(File.dirname(File.expand_path(__FILE__)), 'emptycomplextype.wsdl') + end + + def test_wsdl + @wsdl = WSDL::Parser.new.parse(File.open(@file) { |f| f.read }) + assert(/\{urn:jp.gr.jin.rrr.example.emptycomplextype\}emptycomplextype/ =~ @wsdl.inspect) + end +end + + + +end diff --git a/test/wsdl/test_fault.rb b/test/wsdl/test_fault.rb new file mode 100644 index 0000000..ba58430 --- /dev/null +++ b/test/wsdl/test_fault.rb @@ -0,0 +1,50 @@ +require 'test/unit' +require 'soap/processor' +require 'soap/mapping' +require 'soap/rpc/element' +require 'wsdl/parser' + + +module WSDL + + +class TestFault < Test::Unit::TestCase + def setup + @xml =<<__EOX__ + + + + + Server + faultstring + faultactor + + type + + + + 5 + + +__EOX__ + end + + def test_by_wsdl + rpc_decode_typemap = WSDL::Definitions.soap_rpc_complextypes + opt = {} + opt[:default_encodingstyle] = ::SOAP::EncodingNamespace + header, body = ::SOAP::Processor.unmarshal(@xml, opt) + fault = ::SOAP::Mapping.soap2obj(body.response) + assert_equal("Server", fault.faultcode) + assert_equal("faultstring", fault.faultstring) + assert_equal("faultactor", fault.faultactor) + assert_equal(5, fault.detail.cause) + end +end + + +end diff --git a/test/wsdl/test_multiplefault.rb b/test/wsdl/test_multiplefault.rb new file mode 100644 index 0000000..9438197 --- /dev/null +++ b/test/wsdl/test_multiplefault.rb @@ -0,0 +1,41 @@ +require 'test/unit' +require 'wsdl/parser' +require 'wsdl/soap/classDefCreator' +require 'wsdl/soap/classNameCreator' + + +module WSDL + + +class TestMultipleFault < Test::Unit::TestCase + def self.setup(filename) + @@filename = filename + end + + def test_multiplefault + @wsdl = WSDL::Parser.new.parse(File.open(@@filename) { |f| f.read }) + name_creator = WSDL::SOAP::ClassNameCreator.new + classdefstr = WSDL::SOAP::ClassDefCreator.new(@wsdl, name_creator).dump + yield_eval_binding(classdefstr) do |b| + assert_equal( + WSDL::TestMultipleFault::AuthenticationError, + eval("AuthenticationError", b) + ) + assert_equal( + WSDL::TestMultipleFault::AuthorizationError, + eval("AuthorizationError", b) + ) + end + end + + def yield_eval_binding(evaled) + b = binding + eval(evaled, b) + yield(b) + end +end + +TestMultipleFault.setup(File.join(File.dirname(__FILE__), 'multiplefault.wsdl')) + + +end diff --git a/test/xsd/codegen/test_classdef.rb b/test/xsd/codegen/test_classdef.rb new file mode 100644 index 0000000..7ca34e3 --- /dev/null +++ b/test/xsd/codegen/test_classdef.rb @@ -0,0 +1,244 @@ +require 'test/unit' +require 'xsd/codegen/classdef' + + +module XSD; module CodeGen + + +class TestClassDefCreator < Test::Unit::TestCase + include XSD::CodeGen + include GenSupport + + def test_classdef_simple + c = ClassDef.new("Foo") + assert_equal(format(<<-EOD), c.dump) + class Foo + end + EOD + end + + def test_classdef_complex + c = ClassDef.new("Foo::Bar::Baz", String) + assert_equal(format(<<-EOD), c.dump) + module Foo; module Bar + + class Baz < String + end + + end; end + EOD + end + + def test_require + c = ClassDef.new("Foo") + c.def_require("foo/bar") + assert_equal(format(<<-EOD), c.dump) + require 'foo/bar' + + class Foo + end + EOD + end + + def test_comment + c = ClassDef.new("Foo") + c.def_require("foo/bar") + c.comment = <<-EOD + foo + EOD + assert_equal(format(<<-EOD), c.dump) + require 'foo/bar' + + # foo + class Foo + end + EOD + c.comment = <<-EOD + foo + + bar + baz + + EOD + assert_equal(format(<<-EOD), c.dump) + require 'foo/bar' + + # foo + # + # bar + # baz + # + class Foo + end + EOD + end + + def test_emptymethod + c = ClassDef.new("Foo") + c.def_method('foo') do + end + c.def_method('bar') do + '' + end + assert_equal(format(<<-EOD), c.dump) + class Foo + def foo + end + + def bar + end + end + EOD + end + + def test_innermodule + c = ClassDef.new("Foo") + c.def_const("BAR", 1) + c.def_method('baz') { "Qux.new.quxx" } + c2 = ClassDef.new("Qux") + c2.def_method('quxx') { "Quxx::QUXXX" } + m3 = ModuleDef.new("Quxx") + m3.def_const("QUXXX", 2) + c.innermodule << c2 << m3 + assert_equal(format(<<-EOD), c.dump) + class Foo + BAR = 1 + + class Qux + def quxx + Quxx::QUXXX + end + end + + module Quxx + QUXXX = 2 + end + + def baz + Qux.new.quxx + end + end + EOD + end + + def test_full + c = ClassDef.new("Foo::Bar::HobbitName", String) + c.def_require("foo/bar") + c.comment = <<-EOD + foo + bar + baz + EOD + c.def_const("FOO", 1) + c.def_classvar("@@foo", "var".dump) + c.def_classvar("baz", "1".dump) + c.def_attr("Foo", true, "foo") + c.def_attr("bar") + c.def_attr("baz", true) + c.def_attr("Foo2", true, "foo2") + c.def_attr("foo3", false, "foo3") + c.def_method("foo") do + <<-EOD + foo.bar = 1 +\tbaz.each do |ele| +\t ele + end + EOD + end + c.def_method("baz", "qux") do + <<-EOD + [1, 2, 3].each do |i| + p i + end + EOD + end + + m = MethodDef.new("qux", "quxx", "quxxx") do + <<-EOD + p quxx + quxxx + EOD + end + m.comment = "hello world\n123" + c.add_method(m) + c.def_code <<-EOD + Foo.new + Bar.z + EOD + c.def_code <<-EOD + Foo.new + Bar.z + EOD + c.def_privatemethod("foo", "baz", "*arg", "&block") + + assert_equal(format(<<-EOD), c.dump) + require 'foo/bar' + + module Foo; module Bar + + # foo + # bar + # baz + class HobbitName < String + @@foo = "var" + @@baz = "1" + + FOO = 1 + + Foo.new + Bar.z + + Foo.new + Bar.z + + attr_accessor :bar + attr_accessor :baz + attr_reader :foo3 + + def Foo + @foo + end + + def Foo=(value) + @foo = value + end + + def Foo2 + @foo2 + end + + def Foo2=(value) + @foo2 = value + end + + def foo + foo.bar = 1 + baz.each do |ele| + ele + end + end + + def baz(qux) + [1, 2, 3].each do |i| + p i + end + end + + # hello world + # 123 + def qux(quxx, quxxx) + p quxx + quxxx + end + + private + + def foo(baz, *arg, &block) + end + end + + end; end + EOD + end +end + + +end; end diff --git a/test/xsd/noencoding.xml b/test/xsd/noencoding.xml new file mode 100644 index 0000000..614ffa3 --- /dev/null +++ b/test/xsd/noencoding.xml @@ -0,0 +1,4 @@ + + + + diff --git a/test/xsd/test_noencoding.rb b/test/xsd/test_noencoding.rb new file mode 100644 index 0000000..48119ec --- /dev/null +++ b/test/xsd/test_noencoding.rb @@ -0,0 +1,32 @@ +require 'test/unit' +require 'wsdl/xmlSchema/parser' + + +module XSD + + +class TestEmptyCharset < Test::Unit::TestCase + def setup + @file = File.join(File.dirname(File.expand_path(__FILE__)), 'noencoding.xml') + end + + def test_wsdl + begin + xml = WSDL::XMLSchema::Parser.new.parse(File.open(@file) { |f| f.read }) + rescue RuntimeError + if XSD::XMLParser.const_defined?("REXMLParser") + STDERR.puts("rexml cannot handle euc-jp without iconv/uconv.") + return + end + raise + rescue Errno::EINVAL + # unsupported encoding + return + end + assert_equal(WSDL::XMLSchema::Schema, xml.class) + assert_equal(0, xml.collect_elements.size) + end +end + + +end diff --git a/test/xsd/test_ns.rb b/test/xsd/test_ns.rb new file mode 100644 index 0000000..37d4300 --- /dev/null +++ b/test/xsd/test_ns.rb @@ -0,0 +1,41 @@ +require 'test/unit' +require 'soap/marshal' + + +module XSD + + +class TestNS < Test::Unit::TestCase + def test_xmllang + @file = File.join(File.dirname(File.expand_path(__FILE__)), 'xmllang.xml') + obj = SOAP::Marshal.load(File.open(@file) { |f| f.read }) + assert_equal("12345", obj.partyDataLine.gln) + lang = obj.partyDataLine.__xmlattr[ + XSD::QName.new(XSD::NS::Namespace, "lang")] + assert_equal("EN", lang) + end + + def test_no_default_namespace + env = SOAP::Processor.unmarshal(NO_DEFAULT_NAMESPACE) + array = env.body.root_node["array"] + item = array["item"] + assert_equal("urn:ns", array.elename.namespace) + assert_equal(nil, item.elename.namespace) + end + +NO_DEFAULT_NAMESPACE = <<__XML__ + + + + + + + + + + +__XML__ +end + + +end diff --git a/test/xsd/test_xmlschemaparser.rb b/test/xsd/test_xmlschemaparser.rb new file mode 100644 index 0000000..10dff43 --- /dev/null +++ b/test/xsd/test_xmlschemaparser.rb @@ -0,0 +1,22 @@ +require 'test/unit' +require 'wsdl/xmlSchema/parser' + + +module XSD + + +class TestXMLSchemaParser < Test::Unit::TestCase + def setup + @file = File.join(File.dirname(File.expand_path(__FILE__)), 'xmlschema.xml') + end + + def test_wsdl + @wsdl = WSDL::XMLSchema::Parser.new.parse(File.open(@file) { |f| f.read }) + assert_equal(WSDL::XMLSchema::Schema, @wsdl.class) + assert_equal(1, @wsdl.collect_elements.size) + end +end + + + +end diff --git a/test/xsd/test_xsd.rb b/test/xsd/test_xsd.rb new file mode 100644 index 0000000..c021ad0 --- /dev/null +++ b/test/xsd/test_xsd.rb @@ -0,0 +1,1638 @@ +require 'test/unit' +require 'xsd/datatypes' + + +module XSD + + +class TestXSD < Test::Unit::TestCase + NegativeZero = (-1.0 / (1.0 / 0.0)) + + def setup + end + + def teardown + end + + def assert_parsed_result(klass, str) + o = klass.new(str) + assert_equal(str, o.to_s) + end + + def test_NSDBase + o = XSD::NSDBase.new + assert_equal(nil, o.type) + end + + def test_XSDBase + o = XSD::XSDAnySimpleType.new + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + assert_equal('', o.to_s) + end + + def test_XSDNil + o = XSD::XSDNil.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::NilLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + o = XSD::XSDNil.new(nil) + assert_equal(true, o.is_nil) + assert_equal(nil, o.data) + assert_equal("", o.to_s) + o = XSD::XSDNil.new('var') + assert_equal(false, o.is_nil) + assert_equal('var', o.data) + assert_equal('var', o.to_s) + end + + def test_XSDString_UTF8 + o = XSD::XSDString.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::StringLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + str = "abc" + assert_equal(str, XSD::XSDString.new(str).data) + assert_equal(str, XSD::XSDString.new(str).to_s) + back = XSD::XSDString.strict_ces_validation + XSD::XSDString.strict_ces_validation = true + begin + assert_raises(XSD::ValueSpaceError) do + XSD::XSDString.new("\0") + end + assert_raises(XSD::ValueSpaceError) do + p XSD::XSDString.new("\xC0\xC0").to_s + end + ensure + XSD::XSDString.strict_ces_validation = back + end + end + + def test_XSDString_NONE + XSD::Charset.module_eval { @encoding_backup = @internal_encoding; @internal_encoding = "NONE" } + begin + o = XSD::XSDString.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::StringLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + str = "abc" + assert_equal(str, XSD::XSDString.new(str).data) + assert_equal(str, XSD::XSDString.new(str).to_s) + back = XSD::XSDString.strict_ces_validation + XSD::XSDString.strict_ces_validation = true + begin + assert_raises(XSD::ValueSpaceError) do + XSD::XSDString.new("\0") + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDString.new("\xC0\xC0").to_s + end + ensure + XSD::XSDString.strict_ces_validation = back + end + ensure + XSD::Charset.module_eval { @internal_encoding = @encoding_backup } + end + end + + def test_XSDNormalizedString + XSD::Charset.module_eval { @encoding_backup = @internal_encoding; @internal_encoding = "NONE" } + begin + o = XSD::XSDNormalizedString.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::NormalizedStringLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + str = "abc" + assert_equal(str, XSD::XSDNormalizedString.new(str).data) + assert_equal(str, XSD::XSDNormalizedString.new(str).to_s) + back = XSD::XSDString.strict_ces_validation + XSD::XSDString.strict_ces_validation = true + begin + assert_raises(XSD::ValueSpaceError) do + XSD::XSDNormalizedString.new("\0") + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDNormalizedString.new("\xC0\xC0").to_s + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDNormalizedString.new("a\tb").to_s + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDNormalizedString.new("a\r").to_s + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDNormalizedString.new("\nb").to_s + end + ensure + XSD::XSDString.strict_ces_validation = back + end + ensure + XSD::Charset.module_eval { @internal_encoding = @encoding_backup } + end + end + + def test_XSDToken + XSD::Charset.module_eval { @encoding_backup = @internal_encoding; @internal_encoding = "NONE" } + begin + o = XSD::XSDToken.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::TokenLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + str = "abc" + assert_equal(str, XSD::XSDToken.new(str).data) + assert_equal(str, XSD::XSDToken.new(str).to_s) + back = XSD::XSDString.strict_ces_validation + XSD::XSDString.strict_ces_validation = true + begin + assert_raises(XSD::ValueSpaceError) do + XSD::XSDToken.new("\0") + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDToken.new("\xC0\xC0").to_s + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDToken.new("a\tb").to_s + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDToken.new("a\r").to_s + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDToken.new("\nb").to_s + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDToken.new(" a").to_s + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDToken.new("b ").to_s + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDToken.new("a b").to_s + end + assert_equal("a b", XSD::XSDToken.new("a b").data) + ensure + XSD::XSDString.strict_ces_validation = back + end + ensure + XSD::Charset.module_eval { @internal_encoding = @encoding_backup } + end + end + + def test_XSDLanguage + o = XSD::XSDLanguage.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::LanguageLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + str = "ja" + assert_equal(str, XSD::XSDLanguage.new(str).data) + assert_equal(str, XSD::XSDLanguage.new(str).to_s) + str = "ja-jp" + assert_equal(str, XSD::XSDLanguage.new(str).data) + assert_equal(str, XSD::XSDLanguage.new(str).to_s) + assert_raises(XSD::ValueSpaceError) do + XSD::XSDLanguage.new("ja-jp-") + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDLanguage.new("-ja-") + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDLanguage.new("ja-") + end + assert_raises(XSD::ValueSpaceError) do + XSD::XSDLanguage.new("a1-01") + end + assert_equal("aA-01", XSD::XSDLanguage.new("aA-01").to_s) + end + + def test_XSDBoolean + o = XSD::XSDBoolean.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::BooleanLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + ["true", true], + ["1", true], + ["false", false], + ["0", false], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDBoolean.new(data).data) + assert_equal(expected.to_s, XSD::XSDBoolean.new(data).to_s) + end + + assert_raises(XSD::ValueSpaceError) do + XSD::XSDBoolean.new("nil").to_s + end + end + + def test_XSDDecimal + o = XSD::XSDDecimal.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::DecimalLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 1000000000, + -9999999999, + 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890, + 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890, + -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789, + ] + targets.each do |dec| + assert_equal(dec.to_s, XSD::XSDDecimal.new(dec).data) + end + + targets = [ + "0", + "0.00000001", + "1000000000", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123.45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789", + ] + targets.each do |str| + assert_equal(str, XSD::XSDDecimal.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["0.0", "0"], + ["-0.0", "0"], + ["+0.0", "0"], + ["0.", "0"], + [".0", "0"], + [ + "+0.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "0.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + ], + [ + ".0000012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "0.000001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + ], + [ + "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.", + "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" + ], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDDecimal.new(data).to_s) + end + + targets = [ + "0.000000000000a", + "00a.0000000000001", + "+-5", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDDecimal.new(d) + end + end + end + + def test_XSDFloat + o = XSD::XSDFloat.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::FloatLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 3.14159265358979, + 12.34e36, + 1.402e-45, + -1.402e-45, + ] + targets.each do |f| + assert_equal(f, XSD::XSDFloat.new(f).data) + end + + targets = [ + "+3.141592654", + "+1.234e+37", + "+1.402e-45", + "-1.402e-45", + ] + targets.each do |f| + assert_equal(f, XSD::XSDFloat.new(f).to_s) + end + + targets = [ + [3, "+3"], # should be 3.0? + [-2, "-2"], # ditto + [3.14159265358979, "+3.141592654"], + [12.34e36, "+1.234e+37"], + [1.402e-45, "+1.402e-45"], + [-1.402e-45, "-1.402e-45"], + ["1.402e", "+1.402"], + ["12.34E36", "+1.234e+37"], + ["1.402E-45", "+1.402e-45"], + ["-1.402E-45", "-1.402e-45"], + ["1.402E", "+1.402"], + ] + targets.each do |f, str| + assert_equal(str, XSD::XSDFloat.new(f).to_s) + end + + assert_equal("+0", XSD::XSDFloat.new(+0.0).to_s) + assert_equal("-0", XSD::XSDFloat.new(NegativeZero).to_s) + assert(XSD::XSDFloat.new(0.0/0.0).data.nan?) + assert_equal("INF", XSD::XSDFloat.new(1.0/0.0).to_s) + assert_equal(1, XSD::XSDFloat.new(1.0/0.0).data.infinite?) + assert_equal("-INF", XSD::XSDFloat.new(-1.0/0.0).to_s) + assert_equal(-1, XSD::XSDFloat.new(-1.0/0.0).data.infinite?) + + targets = [ + "0.000000000000a", + "00a.0000000000001", + "+-5", + "5_0", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDFloat.new(d) + end + end + end + + def test_XSDDouble + o = XSD::XSDDouble.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::DoubleLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 3.14159265358979, + 12.34e36, + 1.402e-45, + -1.402e-45, + ] + targets.each do |f| + assert_equal(f, XSD::XSDDouble.new(f).data) + end + + targets = [ + "+3.14159265358979", + "+1.234e+37", + "+1.402e-45", + "-1.402e-45", + ] + targets.each do |f| + assert_equal(f, XSD::XSDDouble.new(f).to_s) + end + + targets = [ + [3, "+3"], # should be 3.0? + [-2, "-2"], # ditto. + [3.14159265358979, "+3.14159265358979"], + [12.34e36, "+1.234e+37"], + [1.402e-45, "+1.402e-45"], + [-1.402e-45, "-1.402e-45"], + ["1.402e", "+1.402"], + ["12.34E36", "+1.234e+37"], + ["1.402E-45", "+1.402e-45"], + ["-1.402E-45", "-1.402e-45"], + ["1.402E", "+1.402"], + ] + targets.each do |f, str| + assert_equal(str, XSD::XSDDouble.new(f).to_s) + end + + assert_equal("+0", XSD::XSDFloat.new(+0.0).to_s) + assert_equal("-0", XSD::XSDFloat.new(NegativeZero).to_s) + assert_equal("NaN", XSD::XSDDouble.new(0.0/0.0).to_s) + assert(XSD::XSDDouble.new(0.0/0.0).data.nan?) + assert_equal("INF", XSD::XSDDouble.new(1.0/0.0).to_s) + assert_equal(1, XSD::XSDDouble.new(1.0/0.0).data.infinite?) + assert_equal("-INF", XSD::XSDDouble.new(-1.0/0.0).to_s) + assert_equal(-1, XSD::XSDDouble.new(-1.0/0.0).data.infinite?) + + targets = [ + "0.000000000000a", + "00a.0000000000001", + "+-5", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDDouble.new(d) + end + end + end + + def test_XSDDuration + o = XSD::XSDDuration.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::DurationLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "P1Y2M3DT4H5M6S", + "P1234Y5678M9012DT3456H7890M1234.5678S", + "PT3456H7890M1234.5678S", + "P1234Y5678M9012D", + "-P1234Y5678M9012DT3456H7890M1234.5678S", + "P5678M9012DT3456H7890M1234.5678S", + "-P1234Y9012DT3456H7890M1234.5678S", + "+P1234Y5678MT3456H7890M1234.5678S", + "P1234Y5678M9012DT7890M1234.5678S", + "-P1234Y5678M9012DT3456H1234.5678S", + "+P1234Y5678M9012DT3456H7890M", + "P123400000000000Y", + "-P567800000000000M", + "+P901200000000000D", + "PT345600000000000H", + "-PT789000000000000M", + "+PT123400000000000.000000000005678S", + "P1234YT1234.5678S", + "-P5678MT7890M", + "+P9012DT3456H", + "PT5S", + ] + targets.each do |str| + assert_parsed_result(XSD::XSDDuration, str) + end + + targets = [ + ["P0Y0M0DT0H0M0S", + "P0D"], + ["-P0DT0S", + "-P0D"], + ["P01234Y5678M9012DT3456H7890M1234.5678S", + "P1234Y5678M9012DT3456H7890M1234.5678S"], + ["P1234Y005678M9012DT3456H7890M1234.5678S", + "P1234Y5678M9012DT3456H7890M1234.5678S"], + ["P1234Y5678M0009012DT3456H7890M1234.5678S", + "P1234Y5678M9012DT3456H7890M1234.5678S"], + ["P1234Y5678M9012DT00003456H7890M1234.5678S", + "P1234Y5678M9012DT3456H7890M1234.5678S"], + ["P1234Y5678M9012DT3456H000007890M1234.5678S", + "P1234Y5678M9012DT3456H7890M1234.5678S"], + ["P1234Y5678M9012DT3456H7890M0000001234.5678S", + "P1234Y5678M9012DT3456H7890M1234.5678S"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDDuration.new(data).to_s) + end + end + + def test_XSDDateTime + o = XSD::XSDDateTime.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::DateTimeLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "2002-05-18T16:52:20Z", + "0001-01-01T00:00:00Z", + "9999-12-31T23:59:59Z", + "19999-12-31T23:59:59Z", + "2002-12-31T23:59:59.999Z", + "2002-12-31T23:59:59.001Z", + "2002-12-31T23:59:59.99999999999999999999Z", + "2002-12-31T23:59:59.00000000000000000001Z", + "2002-12-31T23:59:59+09:00", + "2002-12-31T23:59:59+00:01", + "2002-12-31T23:59:59-00:01", + "2002-12-31T23:59:59-23:59", + "2002-12-31T23:59:59.00000000000000000001+13:30", + "2002-12-31T23:59:59.5137Z", + "2002-12-31T23:59:59.51375Z", # 411/800 + "2002-12-31T23:59:59.51375+12:34", + "-2002-05-18T16:52:20Z", + "-4713-01-01T12:00:00Z", + "-2002-12-31T23:59:59+00:01", + "-0001-12-31T23:59:59.00000000000000000001+13:30", + ] + targets.each do |str| + assert_parsed_result(XSD::XSDDateTime, str) + end + + targets = [ + ["2002-12-31T23:59:59.00", + "2002-12-31T23:59:59Z"], + ["2002-12-31T23:59:59+00:00", + "2002-12-31T23:59:59Z"], + ["2002-12-31T23:59:59-00:00", + "2002-12-31T23:59:59Z"], + ["-2002-12-31T23:59:59.00", + "-2002-12-31T23:59:59Z"], + ["-2002-12-31T23:59:59+00:00", + "-2002-12-31T23:59:59Z"], + ["-2002-12-31T23:59:59-00:00", + "-2002-12-31T23:59:59Z"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDDateTime.new(data).to_s) + d = DateTime.parse(data) + d >>= 12 if d.year < 0 # XSDDateTime.year(-1) == DateTime.year(0) + assert_equal(expected, XSD::XSDDateTime.new(d).to_s) + end + + targets = [ + "0000-05-18T16:52:20Z", + "05-18T16:52:20Z", + "2002-05T16:52:20Z", + "2002-05-18T16:52Z", + "", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError, d.to_s) do + XSD::XSDDateTime.new(d) + end + end + end + + def test_XSDTime + o = XSD::XSDTime.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::TimeLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "16:52:20Z", + "00:00:00Z", + "23:59:59Z", + "23:59:59.999Z", + "23:59:59.001Z", + "23:59:59.99999999999999999999Z", + "23:59:59.00000000000000000001Z", + "23:59:59+09:00", + "23:59:59+00:01", + "23:59:59-00:01", + "23:59:59-23:59", + "23:59:59.00000000000000000001+13:30", + "23:59:59.51345Z", + "23:59:59.51345+12:34", + "23:59:59+00:01", + ] + targets.each do |str| + assert_parsed_result(XSD::XSDTime, str) + end + + targets = [ + ["23:59:59.00", + "23:59:59Z"], + ["23:59:59+00:00", + "23:59:59Z"], + ["23:59:59-00:00", + "23:59:59Z"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDTime.new(data).to_s) + end + end + + def test_XSDDate + o = XSD::XSDDate.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::DateLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "2002-05-18Z", + "0001-01-01Z", + "9999-12-31Z", + "19999-12-31Z", + "2002-12-31+09:00", + "2002-12-31+00:01", + "2002-12-31-00:01", + "2002-12-31-23:59", + "2002-12-31+13:30", + "-2002-05-18Z", + "-19999-12-31Z", + "-2002-12-31+00:01", + "-0001-12-31+13:30", + ] + targets.each do |str| + assert_parsed_result(XSD::XSDDate, str) + end + + targets = [ + ["2002-12-31", + "2002-12-31Z"], + ["2002-12-31+00:00", + "2002-12-31Z"], + ["2002-12-31-00:00", + "2002-12-31Z"], + ["-2002-12-31", + "-2002-12-31Z"], + ["-2002-12-31+00:00", + "-2002-12-31Z"], + ["-2002-12-31-00:00", + "-2002-12-31Z"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDDate.new(data).to_s) + d = Date.parse(data) + d >>= 12 if d.year < 0 # XSDDate.year(-1) == Date.year(0) + assert_equal(expected, XSD::XSDDate.new(d).to_s) + end + end +end + +class TestXSD2 < Test::Unit::TestCase + def setup + # Nothing to do. + end + + def teardown + # Nothing to do. + end + + def assert_parsed_result(klass, str) + o = klass.new(str) + assert_equal(str, o.to_s) + end + + def test_XSDGYearMonth + o = XSD::XSDGYearMonth.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::GYearMonthLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "2002-05Z", + "0001-01Z", + "9999-12Z", + "19999-12Z", + "2002-12+09:00", + "2002-12+00:01", + "2002-12-00:01", + "2002-12-23:59", + "2002-12+13:30", + "-2002-05Z", + "-19999-12Z", + "-2002-12+00:01", + "-0001-12+13:30", + ] + targets.each do |str| + assert_parsed_result(XSD::XSDGYearMonth, str) + end + + targets = [ + ["2002-12", + "2002-12Z"], + ["2002-12+00:00", + "2002-12Z"], + ["2002-12-00:00", + "2002-12Z"], + ["-2002-12", + "-2002-12Z"], + ["-2002-12+00:00", + "-2002-12Z"], + ["-2002-12-00:00", + "-2002-12Z"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDGYearMonth.new(data).to_s) + end + end + + def test_XSDGYear + o = XSD::XSDGYear.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::GYearLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "2002Z", + "0001Z", + "9999Z", + "19999Z", + "2002+09:00", + "2002+00:01", + "2002-00:01", + "2002-23:59", + "2002+13:30", + "-2002Z", + "-19999Z", + "-2002+00:01", + "-0001+13:30", + ] + targets.each do |str| + assert_parsed_result(XSD::XSDGYear, str) + end + + targets = [ + ["2002", + "2002Z"], + ["2002+00:00", + "2002Z"], + ["2002-00:00", + "2002Z"], + ["-2002", + "-2002Z"], + ["-2002+00:00", + "-2002Z"], + ["-2002-00:00", + "-2002Z"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDGYear.new(data).to_s) + end + end + + def test_XSDGMonthDay + o = XSD::XSDGMonthDay.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::GMonthDayLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "--05-18Z", + "--01-01Z", + "--12-31Z", + "--12-31+09:00", + "--12-31+00:01", + "--12-31-00:01", + "--12-31-23:59", + "--12-31+13:30", + ] + targets.each do |str| + assert_parsed_result(XSD::XSDGMonthDay, str) + end + + targets = [ + ["--12-31", + "--12-31Z"], + ["--12-31+00:00", + "--12-31Z"], + ["--12-31-00:00", + "--12-31Z"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDGMonthDay.new(data).to_s) + end + end + + def test_XSDGDay + o = XSD::XSDGDay.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::GDayLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "---18Z", + "---01Z", + "---31Z", + "---31+09:00", + "---31+00:01", + "---31-00:01", + "---31-23:59", + "---31+13:30", + ] + targets.each do |str| + assert_parsed_result(XSD::XSDGDay, str) + end + + targets = [ + ["---31", + "---31Z"], + ["---31+00:00", + "---31Z"], + ["---31-00:00", + "---31Z"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDGDay.new(data).to_s) + end + end + + def test_XSDGMonth + o = XSD::XSDGMonth.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::GMonthLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "--05Z", + "--01Z", + "--12Z", + "--12+09:00", + "--12+00:01", + "--12-00:01", + "--12-23:59", + "--12+13:30", + ] + targets.each do |str| + assert_parsed_result(XSD::XSDGMonth, str) + end + + targets = [ + ["--12", + "--12Z"], + ["--12+00:00", + "--12Z"], + ["--12-00:00", + "--12Z"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDGMonth.new(data).to_s) + end + end + + def test_XSDHexBinary + o = XSD::XSDHexBinary.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::HexBinaryLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "abcdef", + "\xe3\x81\xaa\xe3\x81\xb2", + %Q(\0), + "", + ] + targets.each do |str| + assert_equal(str, XSD::XSDHexBinary.new(str).string) + assert_equal(str.unpack("H*")[0 ].tr('a-f', 'A-F'), + XSD::XSDHexBinary.new(str).data) + o = XSD::XSDHexBinary.new + o.set_encoded(str.unpack("H*")[0 ].tr('a-f', 'A-F')) + assert_equal(str, o.string) + o.set_encoded(str.unpack("H*")[0 ].tr('A-F', 'a-f')) + assert_equal(str, o.string) + end + + targets = [ + "0FG7", + "0fg7", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError, d.to_s) do + o = XSD::XSDHexBinary.new + o.set_encoded(d) + p o.string + end + end + end + + def test_XSDBase64Binary + o = XSD::XSDBase64Binary.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::Base64BinaryLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + "abcdef", + "\xe3\x81\xaa\xe3\x81\xb2", + %Q(\0), + "", + ] + targets.each do |str| + assert_equal(str, XSD::XSDBase64Binary.new(str).string) + assert_equal([str ].pack("m").chomp, XSD::XSDBase64Binary.new(str).data) + o = XSD::XSDBase64Binary.new + o.set_encoded([str ].pack("m").chomp) + assert_equal(str, o.string) + end + + targets = [ + "-", + "*", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError, d.to_s) do + o = XSD::XSDBase64Binary.new + o.set_encoded(d) + p o.string + end + end + end + + def test_XSDAnyURI + o = XSD::XSDAnyURI.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::AnyURILiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + # Too few tests here I know. Believe uri module. :) + targets = [ + "foo", + "http://foo", + "http://foo/bar/baz", + "http://foo/bar#baz", + "http://foo/bar%20%20?a+b", + "HTTP://FOO/BAR%20%20?A+B", + ] + targets.each do |str| + assert_parsed_result(XSD::XSDAnyURI, str) + end + end + + def test_XSDQName + o = XSD::XSDQName.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::QNameLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + # More strict test is needed but current implementation allows all non-':' + # chars like ' ', C0 or C1... + targets = [ + "foo", + "foo:bar", + "a:b", + ] + targets.each do |str| + assert_parsed_result(XSD::XSDQName, str) + end + end + + + ### + ## Derived types + # + + def test_XSDInteger + o = XSD::XSDInteger.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::IntegerLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 1000000000, + -9999999999, + 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890, + 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890, + -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789, + ] + targets.each do |int| + assert_equal(int, XSD::XSDInteger.new(int).data) + end + + targets = [ + "0", + "1000000000", + "-9999999999", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789", + ] + targets.each do |str| + assert_equal(str, XSD::XSDInteger.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["000123", "123"], + ["-000123", "-123"], + [ + "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" + ], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDInteger.new(data).to_s) + end + + targets = [ + "0.0", + "-5.2", + "0.000000000000a", + "+-5", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890." + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDInteger.new(d) + end + end + end + + def test_XSDNonPositiveInteger + o = XSD::XSDNonPositiveInteger.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::NonPositiveIntegerLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + -9999999999, + -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789, + ] + targets.each do |int| + assert_equal(int, XSD::XSDNonPositiveInteger.new(int).data) + end + + targets = [ + "0", + "-9999999999", + "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789", + ] + targets.each do |str| + assert_equal(str, XSD::XSDNonPositiveInteger.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["-000123", "-123"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDNonPositiveInteger.new(data).to_s) + end + + targets = [ + "0.0", + "-5.2", + "0.000000000000a", + "+-5", + "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890." + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDNonPositiveInteger.new(d) + end + end + end + + def test_XSDNegativeInteger + o = XSD::XSDNegativeInteger.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::NegativeIntegerLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + -1, + -9999999999, + -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789, + ] + targets.each do |int| + assert_equal(int, XSD::XSDNegativeInteger.new(int).data) + end + + targets = [ + "-1", + "-9999999999", + "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789", + ] + targets.each do |str| + assert_equal(str, XSD::XSDNegativeInteger.new(str).to_s) + end + + targets = [ + ["-000123", "-123"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDNegativeInteger.new(data).to_s) + end + + targets = [ + "-0.0", + "-5.2", + "-0.000000000000a", + "+-5", + "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890." + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDNegativeInteger.new(d) + end + end + end + + def test_XSDLong + o = XSD::XSDLong.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::LongLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 123, + -123, + 9223372036854775807, + -9223372036854775808, + ] + targets.each do |lng| + assert_equal(lng, XSD::XSDLong.new(lng).data) + end + + targets = [ + "0", + "123", + "-123", + "9223372036854775807", + "-9223372036854775808", + ] + targets.each do |str| + assert_equal(str, XSD::XSDLong.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["000123", "123"], + ["-000123", "-123"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDLong.new(data).to_s) + end + + targets = [ + 9223372036854775808, + -9223372036854775809, + "0.0", + "-5.2", + "0.000000000000a", + "+-5", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDLong.new(d) + end + end + end + + def test_XSDInt + o = XSD::XSDInt.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::IntLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 123, + -123, + 2147483647, + -2147483648, + ] + targets.each do |lng| + assert_equal(lng, XSD::XSDInt.new(lng).data) + end + + targets = [ + "0", + "123", + "-123", + "2147483647", + "-2147483648", + ] + targets.each do |str| + assert_equal(str, XSD::XSDInt.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["000123", "123"], + ["-000123", "-123"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDInt.new(data).to_s) + end + + targets = [ + 2147483648, + -2147483649, + "0.0", + "-5.2", + "0.000000000000a", + "+-5", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDInt.new(d) + end + end + end + + def test_XSDShort + o = XSD::XSDShort.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::ShortLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 123, + -123, + 32767, + -32768, + ] + targets.each do |lng| + assert_equal(lng, XSD::XSDShort.new(lng).data) + end + + targets = [ + "0", + "123", + "-123", + "32767", + "-32768", + ] + targets.each do |str| + assert_equal(str, XSD::XSDShort.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["000123", "123"], + ["-000123", "-123"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDShort.new(data).to_s) + end + + targets = [ + 32768, + -32769, + "0.0", + "-5.2", + "0.000000000000a", + "+-5", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDShort.new(d) + end + end + end + + def test_XSDByte + o = XSD::XSDByte.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::ByteLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 123, + -123, + 127, + -128, + ] + targets.each do |lng| + assert_equal(lng, XSD::XSDByte.new(lng).data) + end + + targets = [ + "0", + "123", + "-123", + "127", + "-128", + ] + targets.each do |str| + assert_equal(str, XSD::XSDByte.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["000123", "123"], + ["-000123", "-123"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDByte.new(data).to_s) + end + + targets = [ + 128, + -129, + "0.0", + "-5.2", + "0.000000000000a", + "+-5", + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDByte.new(d) + end + end + end + + def test_XSDNonNegativeInteger + o = XSD::XSDNonNegativeInteger.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::NonNegativeIntegerLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 1000000000, + 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890, + ] + targets.each do |int| + assert_equal(int, XSD::XSDNonNegativeInteger.new(int).data) + end + + targets = [ + "0", + "1000000000", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + ] + targets.each do |str| + assert_equal(str, XSD::XSDNonNegativeInteger.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["000123", "123"], + [ + "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" + ], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDNonNegativeInteger.new(data).to_s) + end + + targets = [ + "0.0", + "0.000000000000a", + "+-5", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890." + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDNonNegativeInteger.new(d) + end + end + end + + def test_XSDUnsignedLong + o = XSD::XSDUnsignedLong.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::UnsignedLongLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 1000000000, + 18446744073709551615, + ] + targets.each do |int| + assert_equal(int, XSD::XSDUnsignedLong.new(int).data) + end + + targets = [ + "0", + "1000000000", + "18446744073709551615", + ] + targets.each do |str| + assert_equal(str, XSD::XSDUnsignedLong.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["000123", "123"], + ["+18446744073709551615", "18446744073709551615"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDUnsignedLong.new(data).to_s) + end + + targets = [ + "0.0", + "0.000000000000a", + "+-5", + "18446744073709551615." + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDUnsignedLong.new(d) + end + end + end + + def test_XSDUnsignedInt + o = XSD::XSDUnsignedInt.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::UnsignedIntLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 1000000000, + 4294967295, + ] + targets.each do |int| + assert_equal(int, XSD::XSDUnsignedInt.new(int).data) + end + + targets = [ + "0", + "1000000000", + "4294967295", + ] + targets.each do |str| + assert_equal(str, XSD::XSDUnsignedInt.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["000123", "123"], + ["+4294967295", "4294967295"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDUnsignedInt.new(data).to_s) + end + + targets = [ + "0.0", + "0.000000000000a", + "+-5", + "4294967295." + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDUnsignedInt.new(d) + end + end + end + + def test_XSDUnsignedShort + o = XSD::XSDUnsignedShort.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::UnsignedShortLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 10000, + 65535, + ] + targets.each do |int| + assert_equal(int, XSD::XSDUnsignedShort.new(int).data) + end + + targets = [ + "0", + "1000", + "65535", + ] + targets.each do |str| + assert_equal(str, XSD::XSDUnsignedShort.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["000123", "123"], + ["+65535", "65535"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDUnsignedShort.new(data).to_s) + end + + targets = [ + "0.0", + "0.000000000000a", + "+-5", + "65535." + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDUnsignedShort.new(d) + end + end + end + + def test_XSDUnsignedByte + o = XSD::XSDUnsignedByte.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::UnsignedByteLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 0, + 10, + 255, + ] + targets.each do |int| + assert_equal(int, XSD::XSDUnsignedByte.new(int).data) + end + + targets = [ + "0", + "10", + "255", + ] + targets.each do |str| + assert_equal(str, XSD::XSDUnsignedByte.new(str).to_s) + end + + targets = [ + ["-0", "0"], + ["+0", "0"], + ["000123", "123"], + ["+255", "255"], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDUnsignedByte.new(data).to_s) + end + + targets = [ + "0.0", + "0.000000000000a", + "+-5", + "255." + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDUnsignedByte.new(d) + end + end + end + + def test_XSDPositiveInteger + o = XSD::XSDPositiveInteger.new + assert_equal(XSD::Namespace, o.type.namespace) + assert_equal(XSD::PositiveIntegerLiteral, o.type.name) + assert_equal(nil, o.data) + assert_equal(true, o.is_nil) + + targets = [ + 1, + 1000000000, + 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890, + ] + targets.each do |int| + assert_equal(int, XSD::XSDPositiveInteger.new(int).data) + end + + targets = [ + "1", + "1000000000", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + ] + targets.each do |str| + assert_equal(str, XSD::XSDPositiveInteger.new(str).to_s) + end + + targets = [ + ["+1", "1"], + ["000123", "123"], + [ + "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" + ], + ] + targets.each do |data, expected| + assert_equal(expected, XSD::XSDPositiveInteger.new(data).to_s) + end + + targets = [ + "1.0", + "1.000000000000a", + "+-5", + "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890." + ] + targets.each do |d| + assert_raises(XSD::ValueSpaceError) do + XSD::XSDPositiveInteger.new(d) + end + end + end +end + + +end diff --git a/test/xsd/xmllang.xml b/test/xsd/xmllang.xml new file mode 100644 index 0000000..60b5877 --- /dev/null +++ b/test/xsd/xmllang.xml @@ -0,0 +1,43 @@ + + + + + 12345 + 1 + 0 + + + + + + 12345 + 234 + foobar LLC + baz + 9876 + Moscow + RU + + + 12; 34 56 78 + foo@example.com + 123 456 + + + bar@example.com + + + www.example.com + + + 12 34; 56 78 + + + 789 012 + + + + + diff --git a/test/xsd/xmlschema.xml b/test/xsd/xmlschema.xml new file mode 100644 index 0000000..018bd0c --- /dev/null +++ b/test/xsd/xmlschema.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/test/xsd/xsd2ruby/expected_mysample.rb b/test/xsd/xsd2ruby/expected_mysample.rb new file mode 100644 index 0000000..70452ac --- /dev/null +++ b/test/xsd/xsd2ruby/expected_mysample.rb @@ -0,0 +1,65 @@ +require 'xsd/qname' + +module XSD; module XSD2Ruby + + +# {urn:mysample}question +# something - SOAP::SOAPString +class Question + attr_accessor :something + + def initialize(something = nil) + @something = something + end +end + +# {urn:mysample}section +# sectionID - SOAP::SOAPInt +# name - SOAP::SOAPString +# description - SOAP::SOAPString +# index - SOAP::SOAPInt +# firstQuestion - XSD::XSD2Ruby::Question +class Section + attr_accessor :sectionID + attr_accessor :name + attr_accessor :description + attr_accessor :index + attr_accessor :firstQuestion + + def initialize(sectionID = nil, name = nil, description = nil, index = nil, firstQuestion = nil) + @sectionID = sectionID + @name = name + @description = description + @index = index + @firstQuestion = firstQuestion + end +end + +# {urn:mysample}sectionArray +class SectionArray < ::Array +end + +# {urn:mysample}sectionElement +# sectionID - SOAP::SOAPInt +# name - SOAP::SOAPString +# description - SOAP::SOAPString +# index - SOAP::SOAPInt +# firstQuestion - XSD::XSD2Ruby::Question +class SectionElement + attr_accessor :sectionID + attr_accessor :name + attr_accessor :description + attr_accessor :index + attr_accessor :firstQuestion + + def initialize(sectionID = nil, name = nil, description = nil, index = nil, firstQuestion = nil) + @sectionID = sectionID + @name = name + @description = description + @index = index + @firstQuestion = firstQuestion + end +end + + +end; end diff --git a/test/xsd/xsd2ruby/expected_mysample_mapper.rb b/test/xsd/xsd2ruby/expected_mysample_mapper.rb new file mode 100644 index 0000000..2b640c5 --- /dev/null +++ b/test/xsd/xsd2ruby/expected_mysample_mapper.rb @@ -0,0 +1,11 @@ +require 'mysample_mapping_registry.rb' + +module XSD; module XSD2Ruby + +class MysampleMapper < XSD::Mapping::Mapper + def initialize + super(MysampleMappingRegistry::Registry) + end +end + +end; end diff --git a/test/xsd/xsd2ruby/expected_mysample_mapping_registry.rb b/test/xsd/xsd2ruby/expected_mysample_mapping_registry.rb new file mode 100644 index 0000000..1c7a4ed --- /dev/null +++ b/test/xsd/xsd2ruby/expected_mysample_mapping_registry.rb @@ -0,0 +1,51 @@ +require 'xsd/mapping' +require 'mysample.rb' + +module XSD; module XSD2Ruby + +module MysampleMappingRegistry + NsMysample = "urn:mysample" + Registry = ::SOAP::Mapping::LiteralRegistry.new + + Registry.register( + :class => XSD::XSD2Ruby::Question, + :schema_type => XSD::QName.new(NsMysample, "question"), + :schema_element => [ + ["something", ["SOAP::SOAPString", XSD::QName.new(nil, "something")]] + ] + ) + + Registry.register( + :class => XSD::XSD2Ruby::Section, + :schema_type => XSD::QName.new(NsMysample, "section"), + :schema_element => [ + ["sectionID", ["SOAP::SOAPInt", XSD::QName.new(nil, "sectionID")]], + ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]], + ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]], + ["index", ["SOAP::SOAPInt", XSD::QName.new(nil, "index")]], + ["firstQuestion", ["XSD::XSD2Ruby::Question", XSD::QName.new(nil, "firstQuestion")]] + ] + ) + + Registry.register( + :class => XSD::XSD2Ruby::SectionArray, + :schema_type => XSD::QName.new(NsMysample, "sectionArray"), + :schema_element => [ + ["element", ["XSD::XSD2Ruby::Section[]", XSD::QName.new(nil, "element")], [1, nil]] + ] + ) + + Registry.register( + :class => XSD::XSD2Ruby::SectionElement, + :schema_name => XSD::QName.new(NsMysample, "sectionElement"), + :schema_element => [ + ["sectionID", ["SOAP::SOAPInt", XSD::QName.new(nil, "sectionID")]], + ["name", ["SOAP::SOAPString", XSD::QName.new(nil, "name")]], + ["description", ["SOAP::SOAPString", XSD::QName.new(nil, "description")]], + ["index", ["SOAP::SOAPInt", XSD::QName.new(nil, "index")]], + ["firstQuestion", ["XSD::XSD2Ruby::Question", XSD::QName.new(nil, "firstQuestion")]] + ] + ) +end + +end; end diff --git a/test/xsd/xsd2ruby/section.xsd b/test/xsd/xsd2ruby/section.xsd new file mode 100644 index 0000000..161f2d2 --- /dev/null +++ b/test/xsd/xsd2ruby/section.xsd @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/xsd/xsd2ruby/test_xsd2ruby.rb b/test/xsd/xsd2ruby/test_xsd2ruby.rb new file mode 100644 index 0000000..d1d1036 --- /dev/null +++ b/test/xsd/xsd2ruby/test_xsd2ruby.rb @@ -0,0 +1,90 @@ +require 'test/unit' +require 'wsdl/xmlSchema/xsd2ruby' +require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb') + + +module XSD; module XSD2Ruby + + +class TestXSD2Ruby < Test::Unit::TestCase + DIR = File.dirname(File.expand_path(__FILE__)) + + def setup + Dir.chdir(DIR) do + gen = WSDL::XMLSchema::XSD2Ruby.new + gen.location = pathname("section.xsd") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['module_path'] = "XSD::XSD2Ruby" + gen.opt['classdef'] = nil + gen.opt['mapping_registry'] = nil + gen.opt['mapper'] = nil + gen.opt['force'] = true + gen.run + TestUtil.require(DIR, 'mysample.rb', 'mysample_mapping_registry.rb', 'mysample_mapper.rb') + end + end + + def teardown + unless $DEBUG + File.unlink(pathname("mysample.rb")) + File.unlink(pathname("mysample_mapping_registry.rb")) + File.unlink(pathname("mysample_mapper.rb")) + end + # leave generated file for debug. + end + + def test_generate + compare("expected_mysample.rb", "mysample.rb") + compare("expected_mysample_mapping_registry.rb", "mysample_mapping_registry.rb") + compare("expected_mysample_mapper.rb", "mysample_mapper.rb") + end + + def test_mapper + mapper = XSD::XSD2Ruby::MysampleMapper.new + # complexType + arg = XSD::XSD2Ruby::Section.new(10001, 'name', 'description', 1, Question.new("hello world")) + obj = mapper.xml2obj(mapper.obj2xml(arg)) + assert_section_equal(arg, obj) + # element + arg = XSD::XSD2Ruby::SectionElement.new(10001, 'name', 'description', 1, Question.new("hello world")) + obj = mapper.xml2obj(mapper.obj2xml(arg)) + assert_section_equal(arg, obj) + # array + ele = XSD::XSD2Ruby::Section.new(10001, 'name', 'description', 1, Question.new("hello world")) + arg = XSD::XSD2Ruby::SectionArray[ele, ele, ele] + obj = mapper.xml2obj(mapper.obj2xml(arg)) + assert_equal(arg.class, obj.class) + assert_equal(arg.size, obj.size) + 0.upto(arg.size - 1) do |idx| + assert_section_equal(arg[idx], obj[idx]) + end + end + +private + + def assert_section_equal(arg, obj) + assert_equal(arg.class, obj.class) + assert_equal(arg.sectionID, obj.sectionID) + assert_equal(arg.name, obj.name) + assert_equal(arg.description, obj.description) + assert_equal(arg.index, obj.index) + assert_equal(arg.firstQuestion.class, obj.firstQuestion.class) + assert_equal(arg.firstQuestion.something, obj.firstQuestion.something) + end + + def pathname(filename) + File.join(DIR, filename) + end + + def compare(expected, actual) + TestUtil.filecompare(pathname(expected), pathname(actual)) + end + + def loadfile(file) + File.open(pathname(file)) { |f| f.read } + end +end + + +end; end