Anonymous avatar Anonymous committed 004c564

Release

Comments (0)

Files changed (18)

     suds - https://fedorahosted.org/suds/
     soaplib - https://github.com/soaplib/soaplib
 With many thanks to the contributors of those libraries.
+
+To install do the usual:
+
+    python setup.py install
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = .build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html      to make standalone HTML files"
+	@echo "  dirhtml   to make HTML files named index.html in directories"
+	@echo "  pickle    to make pickle files"
+	@echo "  json      to make JSON files"
+	@echo "  htmlhelp  to make HTML files and a HTML help project"
+	@echo "  qthelp    to make HTML files and a qthelp project"
+	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  changes   to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck to check all external links for integrity"
+	@echo "  doctest   to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/w7db.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/w7db.qhc"
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
+	      "run these through (pdf)latex."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
+.. include:: links.rst
+
+.. _api:
+
+API index
+=========
+
+.. _client:
+
+Client
+^^^^^^
+
+.. automodule:: osa.client
+   :show-inheritance:
+   :members:
+
+.. _wsdl:
+
+WSDL parser
+^^^^^^^^^^^
+
+.. automodule:: osa.wsdl
+   :show-inheritance:
+   :members:
+
+
+.. _methods:
+
+Methods wrapper
+^^^^^^^^^^^^^^^
+
+.. automodule:: osa.methods
+   :show-inheritance:
+   :members:
+
+.. _types
+
+XML types
+^^^^^^^^^
+.. autoclass:: osa.xmltypes.XMLType
+   :show-inheritance:
+   :members:
+
+.. autoclass:: osa.xmltypes.XMLString
+   :show-inheritance:
+   :members:
+
+.. autoclass:: osa.xmltypes.XMLInteger
+   :show-inheritance:
+   :members:
+
+.. autoclass:: osa.xmltypes.XMLDouble
+   :show-inheritance:
+   :members:
+
+.. autoclass:: osa.xmltypes.XMLBoolean
+   :show-inheritance:
+   :members:
+
+.. autoclass:: osa.xmltypes.XMLAny
+   :show-inheritance:
+   :members:
+
+.. autoclass:: osa.xmltypes.XMLDecimal
+   :show-inheritance:
+   :members:
+
+.. autoclass:: osa.xmltypes.XMLDate
+   :show-inheritance:
+   :members:
+
+.. autoclass:: osa.xmltypes.XMLDateTime
+   :show-inheritance:
+   :members:
+
+.. py:class:: osa.xmltypes.ComplexTypeMeta
+
+    Metaclass to create complex types on the fly.
+
+    .. py:method:: __new__(name, bases, attributes)
+
+        Method to create new types.
+
+        _children attribute must be present in attributes. It describes
+        the arguments to be present in the new type. The he
+        _children argument must be a list of the form:
+        [{'name':'arg1', 'min':1, 'max':1, 'type':ClassType}, ...]
+
+        Parameters
+        ----------
+        cls : this class
+        name : str
+            Name of the new type.
+        bases : tuple
+            List of bases classes.
+        attributes : dict
+            Attributes of the new type.
+
+.. _soap stuff:
+
+SOAP constants
+^^^^^^^^^^^^^^
+
+.. automodule:: osa.soap
+   :show-inheritance:
+   :members:
+# -*- coding: utf-8 -*-
+#
+# osa documentation build configuration file
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+for x in sys.path:
+    if x.find("osa") != -1:
+        sys.path.remove(x)
+sys.path.append("../")
+sys.path.append("../tests")
+sys.path.append("../tests/serializers")
+
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.append(os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',\
+              'sphinx.ext.pngmath', 'numpydoc', 'sphinx.ext.intersphinx']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['.templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'osa'
+copyright = u'2011, Sergey Bozhenkov'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.1'
+# The full version, including alpha/beta/rc tags.
+release = '0.1'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directory, that shouldn't be searched
+# for source files.
+exclude_trees = ['.build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+default_role = 'py:obj'
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  Major themes that come with
+# Sphinx are currently 'default' and 'sphinxdoc'.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['.static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'osadoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+latex_font_size = '12pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('index', 'osa.tex', u'osa Documentation',
+   u'Sergey Bozhenkov', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+latex_preamble = """
+    \DeclareMathSizes{12}{20}{14}{10}
+"""
+#pngmath_latex_preamble = """
+#    \DeclareMathSizes{12}{20}{14}{10}
+#"""
+##pngmath_dvipng_args = "-D 100"
+pngmath_dvipng_args = ["-D", "200"]
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True
+.. include:: links.rst
+.. osa documentation master file
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+Welcome to osa's documentation!
+===================================
+
+*osa* is a fast/slim library to consume `WSDL 1.1`_/`SOAP 1.1`_ services.
+It is created with the following three requirements in mind: fast calls,
+small memory footprint and convenience of use. I was not able to find a library
+that meets all my requirements, especially for large messages (millions of
+elements). Therefore I created this library by combining ideas found in
+`suds`_ (nice printing), `soaplib`_ (serialization/deserialization) and
+`Scio`_ (`WSDL 1.1`_ parsing).
+
+At the moment the library is limited to wrapped document/literal `SOAP 1.1`_
+convention. To include other call conventions one has to extend the
+:py:func:`to_xml` and :py:func:`from_xml` methods of the :py:class:`Message`
+:ref:`class <methods>`. The structure of the library is briefly explained
+:ref:`here <Structure>`. The *XML* processing is performed with the
+help of :py:mod:`cElementTree` module.
+
+To install the library please do the usual *Python* magic::
+
+    >>> python setup.py install
+
+Online help is available for all classes, please see also section
+:ref:`using` for examples.
+
+Contents:
+
+.. toctree::
+    :maxdepth: 2
+
+    overview
+    api
+    license
+
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
+.. include:: links.rst
+
+.. _license:
+
+License
+-------
+I release the library under terms of `GPL`_. I borrowed some ideas from
+`suds`_, `soaplib`_ and `Scio`_ libraries. The first two are released
+under `LGPL`_. The last one has its own license, the text of which
+and the copyright are given below.
+
+If someone knows better about compatibility of all these licenses,
+please let me know.
+
+`Scio`_ license
+===============
+Please note, that almost no original `Scio`_ code is preserved. Only
+algorithm of `WSDL 1.1`_ parsing is partially preserved.
+
+::
+
+    # Copyright (c) 2011, Leapfrog Online, LLC
+    # All rights reserved.
+    #
+    # Redistribution and use in source and binary forms, with or without
+    # modification, are permitted provided that the following conditions are met:
+    #     * Redistributions of source code must retain the above copyright
+    #       notice, this list of conditions and the following disclaimer.
+    #     * Redistributions in binary form must reproduce the above copyright
+    #       notice, this list of conditions and the following disclaimer in the
+    #       documentation and/or other materials provided with the distribution.
+    #     * Neither the name of the Leapfrog Online, LLC nor the
+    #       names of its contributors may be used to endorse or promote products
+    #       derived from this software without specific prior written permission.
+    #
+    # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+    # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+    # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    # DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+    # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+    # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+    # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+    # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+    # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+.. _WSDL 1.1: http://www.w3.org/TR/wsdl
+.. _SOAP 1.1: http://www.w3.org/TR/2000/NOTE-SOAP-20000508/
+.. _suds: https://fedorahosted.org/suds/
+.. _soaplib: https://github.com/arskom/soaplib
+.. _Scio: http://pypi.python.org/pypi/Scio/0.9.1
+.. _GPL: http://www.gnu.org/copyleft/gpl.html
+.. _LGPL: http://www.gnu.org/licenses/lgpl.html
+.. include:: links.rst
+
+.. _using:
+
+Using
+--------
+To use the library do the import::
+
+    >>> import osa
+
+This exposes the top level class :ref:`Client <client>`. It the only one
+class used to consume a service by a normal user. The client
+is initialized by full address of a `WSDL 1.1`_ document::
+
+    >>> cl = osa.Client("http://lxpowerboz:88/services/python/HelloWorldService?wsdl")
+
+Convenience print functions are available at levels, e.g. to find information
+about the client one can enter::
+
+    >>> cl
+
+which returns names of all found services in the `WSDL 1.1`_ document and
+location of the service::
+
+    HelloWorldService at:
+        http://lxpowerboz:88/services/python/HelloWorldService?wsdl
+
+The top level client is a container for class definitions constructed from
+*XML* types in the supplied `WSDL 1.1`_ focument and for remote method
+wrappers. All types are contained in :py:attr:`cl.types` and all
+methods are available through :py:attr:`cl.service`. It is again possible
+to inspect them by printing::
+
+    >>> cl.types
+
+which lists all known types and help if available::
+
+    Person
+        None
+    Name
+        None
+    ...
+
+Similarly::
+
+    >>> cl.service
+
+prints all found methods and there short description if available::
+
+    sayHello
+        str[] result | None = sayHello(sayHello msg)
+        str[] result | None = sayHello(Person person , int time...
+    giveMessage
+        str result  = giveMessage(giveMessage msg)
+        str result  = giveMessage()
+        str result  = giveMessage()
+        N...
+    faultyThing
+        str result  = faultyThing(faultyThing msg)
+        str result  = faultyThing()
+        str result  = faultyThing()
+        ...
+    echoString
+        str result  = echoString(echoString msg)
+        str result  = echoString(str msg )
+        str result  = echoString...
+
+It is worth noting once more that if any documentation is available in
+the initial `WSDL 1.1`_ document it is propagated to types and methods.
+
+To create an instance of a type in :py:attr:`cl.types` is easy
+(note that tab completion works both for types and methods)::
+
+    >>> person = cl.types.Person()
+
+To inspect the new instance simply print it::
+
+    >>> person
+    (Person){
+    name = None (Name)
+    weight = None (int)
+    age = None (int)
+    height = None (int)
+    }
+
+As can be seen all attributes of the new instance are empty, i.e.
+they are :py:data:`None`. Expected types of attributes are
+given after :py:data:`None` in the brackets. Sometimes it useful
+to initialize immediately all obligatory (non-nillable) attributes.
+To do this one can use :py:attr:`deep` keyword to class
+constructors::
+
+    >>> person = cl.types.Person(deep = True)
+
+which initializes the whole hierarchy::
+
+    (Person){
+    name = (Name){
+               firstName = 
+               lastName = 
+           }
+    weight = 0
+    age = 0
+    height = 0
+    }
+
+The attributes can be set with the usual dot-convention::
+
+    >>> person.name.firstName = "Osa"
+    >>> person.name.lastName = "Wasp"
+
+To call a method one can access it directly from :py:attr`cl.service`.
+Help to a method can be viewed by simply printing its doc (*ipython* style)::
+
+    >>> cl.service.sayHello ?
+
+This shows possible call signatures and gives help from the
+`WSDL 1.1`_ document::
+
+    Type:             Method
+    Base Class:       <class 'osa.methods.Method'>
+    String Form:   str[] result | None = sayHello(sayHello msg)
+    Namespace:        Interactive
+    File:             /usr/local/lib/python2.6/site-packages/osa-0.1-py2.6.
+    egg/osa/methods.py
+    Docstring:
+        str[] result | None = sayHello(sayHello msg)
+        str[] result | None = sayHello(Person person , int times )
+        str[] result | None = sayHello(person=Person , times=int )
+
+                   says hello to person.name.firstName given number of times
+                   illustrates usage of compex types
+
+    ...
+
+It is possible to call any method in four different formats:
+
+- single input parameter with proper wrapper message for this functions
+- expanded positional parameters: children of the wrapper message
+- expanded keyword parameters
+- mixture of positional and keyword parameters.
+
+The help page shows all possible signatures with explained types.
+On return the message is expanded so that a real output is returned
+instead of the wrapper. The return type is also shown in the
+help. Please note, that lists are used in place of arrays for any
+types, this is shown by brackets :py:data:`[]`. Finally, let's
+make the call::
+
+    >>> cl.service.sayHello(person, 5)
+    ['Hello, Osa', 'Hello, Osa', 'Hello, Osa', 'Hello, Osa', 'Hello, Osa']
+
+
+The library can also handle *XML* :py:data:`anyType` properly in most of the
+cases: *any* variable chooses the suitable type from the service and
+uses it to do the conversion from *XML* to *Python*.
+
+The library can be used with large messages, e.g about 8 millions of
+double elements are processed in few tens of seconds only. The
+transient peak memory consumption for such a message is of the order
+of 1 GB.
+
+.. _Structure:
+
+Structure
+---------
+This section briefly explains the library structure. It is useful for
+those who wants to improve it.
+
+The top level :ref:`Client <client>` class is simply a container.
+On construction it creates an instance of :ref:`WSDLParser <wsdl>`
+and processes the service description by calling its
+methods :py:func:`get_types` and :py:func:`get_methods`. Afterwards
+the parser is deleted. As a result of initial processing
+two dictionaries are available: containing newly created types
+and methods.
+
+Types and methods are generated by the parser.
+The types are constructed by using meta-class :ref:`ComplexTypeMeta <types>`.
+This meta-class has a special convention to pass children names and types.
+The methods are wrapped as instances of :ref:`Method <methods>` class.
+The latter class has a suitable :py:func:`__call__` method and contains
+information about input and output arguments as instances of
+the :ref:`Message <methods>` class in attributes :py:data:`input` and
+:py:data:`output` correspondingly.
+
+The top level :ref:`Client <client>` class creates sub-containers for
+types and methods: :py:data:`types` and :py:data:`service`. This
+containers have special print function to display help. Types and
+methods are set as direct attributes of the corresponding
+containers, so that the usual dot-access and tab-completion are
+possible. The attributes of the :py:data:`types` container are
+class definitions, so that to create a new instance one has
+to add the brackets *()*. The attributes of
+the :py:data:`service` container are callable method wrappers.
+
+To allow correct :py:data:`anyType` processing the
+:ref:`Client <client>` constructor also passes known types
+to :ref:`XMLAny <types>` class definition. To be more precise, a new
+:ref:`XMLAny <types>` class is generated with set types. This is
+done to prevent cross-talks between different services initialized
+at the same time.
+
+Every function call is processed by :py:func:`__call__` method
+of a :ref:`Method <methods>` instance. The call method uses
+the input message :py:attr:`input` to convert its arguments to
+*XML* string (:py:func:`to_xml`). Afterwards *urllib2* is used to send the
+request to service. The service response is deserialized by
+using the output message :py:attr:`output` (:py:func:`from_xml`).
+The desirialized result is returned to the user.
+
+The input points for serialization is a :ref:`Message <methods>`
+instance. The message first analyzes the input arguments and
+if required wraps them into a top level message. Afterwards
+:py:func:`to_xml` methods of al children are called with a proper
+*XML* element. The children create *XML* elements for them and
+propagate the call to their children and so on. The process
+is continued until the bottom of the hierarchy is reached.
+Only the primitive :ref:`types` set the real text tag.
+The desirialization process is similar: in this case
+:py:func:`from_xml` is propagated and all children
+classes are constructed. In addition the output message
+parser expands the response wrapper, so that the user sees
+the result without the shell.
+
+At the moment only wrapped document/literal convention is realized.
+The format of the message is determined by :py:func:`to_xml` and
+:py:func:`from_xml`. Therefore, to introduce other conventions
+(rpc, encoded) one has to modify these two methods only.
+
+The library uses :py:mod:`cElementTree` module for *XML* processing.
+This module has about 2 times lower memory footprint as the usual
+:py:mod:`lxml` library.

Binary file added.

Add a comment to this file

osa/__init__.pyc

Binary file removed.

         Top level class to talk to soap services.
 
         This is an access point to service functionality. The client accepts
-        WSDL address and uses WSDLParser to get all defined types and
+        WSDL address and uses `osa.wsdl.WSDLParser` to get all defined types and
         operations. The types are set to client.types and operations
         are set to self.service.
 
-        To examine present types or operations simply print (or touch repr):
-            client.types or client.service, correspondingly.
+        To examine present types or operations simply print (or touch repr)::
 
-        To create type simply call:
-            client.types.MyTypeName().
+            >>> client.types
+
+        or::
+
+            >>> client.service
+
+        correspondingly.
+
+        To create type simply call::
+
+            >>> client.types.MyTypeName().
+
         Class constructor will also create all obligatory (non-nillable) children.
-        To call an operation:
-            client.service.MyOperationName(arg1, arg2, arg3, ...),
+        To call an operation::
+
+            >>> client.service.MyOperationName(arg1, arg2, arg3, ...),
+
         where arguments are of required types. Arguments can also
         be passed as keywords or a ready wrapped message.
 
         If any help is available in the WSDL document it is propagated to the
-        types and operations, see e.g. help client.types.MyTypeName. In addition
+        types and operations, see e.g. help
+        :py:attr:`client.types.MyTypeName`. In addition
         the help page on an operation displays its call signature.
 
-        Nice printing is also available for all types defined in client.types:
-            print(client.types.MyTypeName())
+        Nice printing is also available for all types defined in client.types::
+
+            >>> print(client.types.MyTypeName())
 
         .. warning::
             Only document/literal wrapped convention is implemented at the moment.
 
-        Details
-        -------
         In reality client.types and client.service are simply containers.
         The content of these containers is set from results of parsing
-        the wsdl document by WSDLParser.get_types and WSDLParser.get_methods
-        correspondingly.
+        the wsdl document by
+        `osa.wsdl.WSDLParser.get_types` and
+        `osa.wsdl.WSDLParser.get_methods` correspondingly.
 
-        The client.types container consists of auto generated (by WSDLParser)
+        The client.types container consists of auto generated (by
+        `osa.wsdl.WSDLParser`)
         class definitions. So that a call to a member returns and instance
         of the new type. New types are auto-generated according to a special
-        convention by metaclass xmltypes.ComplexTypeMeta.
+        convention by metaclass `osa.xmltypes.ComplexTypeMeta`.
 
         The client.service container consists of methods wrapers
         methods.Method. The method wrapper is callable with free number of
         parameters. The input and output requirements of a method are
-        contained in methods.Message instances Method.input and
-        Method.output correspondingly. On a call a method converts
+        contained in methods.Message instances `osa.methods.Method.input` and
+        `osa.methods.Method.output` correspondingly. On a call a method converts
         the input to XML by using Method.input, sends request to the
         service and finally decodes the response from XML by
         Method.output.

Binary file removed.

             Name of operation
         action : str
             Action (?) as found in binding part of WSDL.
-        input : Message instance
+        input : `osa.methods.Message` instance
             Input message description.
-        output : Message instance
+        output : `osa.methods.Message` instance
             Output message description.
         doc : str, optional - default to None
             Documentation of the method as found in portType section of WSDL.
Add a comment to this file

osa/methods.pyc

Binary file removed.

Binary file removed.

 
             Parameters
             ----------
-            element : etree.Element
+            element : `etree.Element`
                 XML description of the type.
         """
         name = element.get('name', None)
 
             Returns
             -------
-            out : Message instance
+            out : `osa.methods.Message` instance
                 Message for handling calls in/out.
         """
         #get all parameters - parts of the message

Binary file removed.

Add a comment to this file

osa/xmltypes.pyc

Binary file removed.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.