.. PyXB documentation master file .. Sphinx standard indentations # with overline, for parts * with overline, for chapters =, for sections -, for subsections ^, for subsubsections ", for paragraphs .. role:: namespace(literal) ################################ PyXB: Python XML Schema Bindings ################################ PyXB ("pixbee") is a pure `Python `_ package that generates Python source code for classes that correspond to data structures defined by `XMLSchema `_. The generated classes support bi-directional conversion between `XML `_ documents and Python objects. In concept it is similar to `JAXB `_ for Java and `CodeSynthesis XSD `_ for C++. A :ref:`thirty_sec_example` is at the bottom of this page. Step-by-step examples are in :ref:`userReference`. ************ Getting Help ************ PyXB is distributed on `SourceForge `_. For support, consult the `Help Forum `_, or subscribe to and email the `mailing list `_. To file a bug report or see the status of defects reported against the current release, visit the `Trac database `_. For a history of releases, see :ref:`releases`. ******** Contents ******** .. toctree:: :maxdepth: 2 overview examples releases architecture userref_index maintref .. _thirty_sec_example: ********************* Thirty Second Example ********************* An example of a program using PyXB to interact with a `web service `_ using an automatically-generated module. First, retrieve the WSDL and generate the bindings:: vmserver[171]$ pyxbgen \ --wsdl-location="http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl" \ --module=weather \ --write-for-customization urn:uuid:3a6c7be2-d9b7-11e0-ae84-001fbc013adc Retrieving WSDL from http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl Importing pyxb.binding.datatypes to get binding for wildcard {http://www.w3.org/2001/XMLSchema}schema NOTE: Created unbound wildcard element from value in schema PS urn:uuid:3a6c7be2-d9b7-11e0-ae84-001fbc013adc Complex type {http://ws.cdyne.com/WeatherWS/}ArrayOfWeatherDescription renamed to ArrayOfWeatherDescription_ Complex type {http://ws.cdyne.com/WeatherWS/}ForecastReturn renamed to ForecastReturn_ Complex type {http://ws.cdyne.com/WeatherWS/}WeatherReturn renamed to WeatherReturn_ Python for http://ws.cdyne.com/WeatherWS/ requires 1 modules Saved binding source to ./raw/weather.py vmserver[171]$ Then write a program that uses them: .. literalinclude:: ../examples/weather/client_get.py And run it:: vmserver[171]$ python client.py Got response for Saint Paul, MN: Thursday, September 08 2011: Sunny, from 58 to 80 Friday, September 09 2011: Partly Cloudy, from 58 to 80 Saturday, September 10 2011: Sunny, from 58 to 80 Sunday, September 11 2011: Sunny, from 58 to 81 Monday, September 12 2011: Partly Cloudy, from 61 to 80 Tuesday, September 13 2011: Sunny, from 55 to 69 Wednesday, September 14 2011: Sunny, from 48 to 68 vmserver[172]$ That's it. ****************** Indices and tables ****************** * :ref:`genindex` * :ref:`search` .. ignored ## Local Variables: ## fill-column:78 ## indent-tabs-mode:nil ## End: