Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 1f34149679700274d273f929cf13b29a > files > 1150

PyXB-1.1.2-1.fc15.noarch.rpm

How to use it
=============

Installation
------------

PyXB requires Python version 2.4 or higher (not including 3.x).  Among other
things the implementation relies on decorators (:PEP:`318`) like
``@classref`` that are not present in earlier versions.  The distribution is
regularly tested with the latest release in each of the 2.4, 2.5, and 2.6
series.

PyXB is distributed in several forms through `SourceForge
<https://sourceforge.net/projects/pyxb/files/>`_.  If all you want is the
ability to generate bindings for XML schemas, use the ``PyXB-base`` release
file.  If you also want pre-built documentation, unpack the ``PyXB-doc``
release as well.  For pre-built bundles, use the following:

.. table:: Pre-built Bundle Distribution Files

   =================  =======================================
    File              Bundle Contents
   =================  =======================================
   ``PyXB-common``    XHTML, other miscellaneous namespaces
   ``PyXB-opengis``   The complete suite of OpenGIS schemas
   ``PyXB-wssplat``   A wide variety of WS-* schemas
   =================  =======================================

If you want everything in one download, just get the `PyXB-full
<http://p.sf.net/pyxb/full>`_ distribution file.

Install in the usual manner::

 python setup.py install

You can test the distribution with::

 python setup.py test

which will run all the unit tests.  Some of them will print warnings and
other noise, but if at the end they all pass, don't worry about it.

If you need more help with installation, see
http://docs.python.org/install/index.html.

Generating Bindings
-------------------

The ``pyxbgen`` script is used to translate XML schema and WSDL documents into
Python data bindings.  There are two key components to generating bindings:

- The URI to the definition of the data structures.  This can be a URL, or a
  path to a local file.

- The module path into which the binding will be installed.  This is the
  path that users of the binding will import.

There are many additional parameters; see :ref:`pyxbgen` and
:ref:`pyxbgen-cli`.

WSDL Functions
--------------

The ``pyxbwsdl`` script is used to examine and operate on WSDL definition
documents.  In this release, it retrieves the WSDL document specified by the
URI passed as an argument, and prints the available services with their
operations and parameters.  For example::

  vmfed9[343]$ pyxbwsdl http://api.google.com/GoogleSearch.wsdl
  Need to dynamically create schema
  Importing pyxb.standard.bindings.soap
  Attempting to load a namespace from /home/pab/pyxb/dev/pyxb/standard/bindings/raw/wsdl.wxs
  Attempting to load a namespace from /home/pab/pyxb/dev/pyxb/standard/bindings/raw/soapenc.wxs
  Attempting to load a namespace from /home/pab/pyxb/dev/pyxb/standard/bindings/raw/soap.wxs
  Service: GoogleSearchService
    Port GoogleSearchPort at http://api.google.com/search/beta2
      doGetCachedPage (at action=urn:GoogleSearchAction)
        Input: typens:doGetCachedPage
        Output: typens:doGetCachedPageResponse
      doSpellingSuggestion (at action=urn:GoogleSearchAction)
        Input: typens:doSpellingSuggestion
        Output: typens:doSpellingSuggestionResponse
      doGoogleSearch (at action=urn:GoogleSearchAction)
        Input: typens:doGoogleSearch
        Output: typens:doGoogleSearchResponse

Currently, this is an unmaintained example.  In the future, this script may
provide a more powerful display of available services, and perhaps support for
generating functions which interact with the service using the appropriate
encoding.

.. ignored
   ## Local Variables:
   ## fill-column:78
   ## indent-tabs-mode:nil
   ## End: