summaryrefslogtreecommitdiff
path: root/doc/overview_how.txt
blob: eb80f22a9884cf62bb95311cac807e5b78b5832f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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: