Skip to main content

Multiprotocol Web Services for TurboGears 1.x

Project description

TurboGears gives you a plain HTTP with JSON return values API for your application for free. This isn’t always what you want, though. Sometimes, you don’t want to expose all of the data to the web that you need to render your templates. Maybe you need to support a protocol that names the function it’s calling as part of what it POSTs such as SOAP or XML-RPC.

TGWebServices provides a super simple API for creating web services that are available via SOAP, HTTP->XML, and HTTP->JSON. The SOAP API generates WSDL automatically for your Python and even generates enough type information for statically typed languages (Java and C#, for example) to generate good client code on their end.

How easy is it?

class Multiplier(WebServicesRoot):

    @wsexpose(int)
    @wsvalidate(int, int)
    def multiply(self, num1, num2):
        return num1 * num2

With this at the root, SOAP clients can find the WSDL file at /soap/api.wsdl and POST SOAP requests to /soap/. HTTP requests to /multiply?num1=5&num2=20 will return an XML document with the result of 100. Add ?tg_format=json (or an HTTP Accept: text/javascript header) and you’ll get JSON back.

The great thing about this is that the code above looks like a ‘’’normal Python function’’’ and doesn’t know a thing about web services.

Features

  • Easiest way to expose a web services API

  • Supports SOAP, HTTP+XML, HTTP+JSON

  • Outputs wrapped document/literal SOAP, which is the most widely compatible format

  • Provides enough type information for statically typed languages to generate conveniently usable interfaces

  • Can output instances of your own classes

  • Can also accept instances of your classes as input

  • Works with TurboGears 1.0

  • MIT license allows for unrestricted use

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TGWebServices-1.2.3.tar.gz (17.5 kB view details)

Uploaded Source

Built Distributions

TGWebServices-1.2.3-py2.6.egg (64.6 kB view details)

Uploaded Source

TGWebServices-1.2.3-py2.5.egg (64.6 kB view details)

Uploaded Source

File details

Details for the file TGWebServices-1.2.3.tar.gz.

File metadata

File hashes

Hashes for TGWebServices-1.2.3.tar.gz
Algorithm Hash digest
SHA256 9657fc08d4c3162e2080e70f8ffea1f5f9db6af8ac1bec371b485d02081766ec
MD5 9b287b76cdd36956fca874a1fc6bd16d
BLAKE2b-256 f675cde05805f6ece57a3defd8fac91ee134d2659b1bf2769f301e7b89a7c6aa

See more details on using hashes here.

File details

Details for the file TGWebServices-1.2.3-py2.6.egg.

File metadata

File hashes

Hashes for TGWebServices-1.2.3-py2.6.egg
Algorithm Hash digest
SHA256 5c54f5c6c26668f137ad9f01bdbde25a5731370abc669bceac7b380c718a4c44
MD5 e4db2ef19f18ddc199ef98e30f18e09e
BLAKE2b-256 f9317ccb84e9c37d53fb2a6252e78ee40165ed445e08689c2c3de37574b07fcc

See more details on using hashes here.

File details

Details for the file TGWebServices-1.2.3-py2.5.egg.

File metadata

File hashes

Hashes for TGWebServices-1.2.3-py2.5.egg
Algorithm Hash digest
SHA256 8c0addbb391f9289b8d3b9ccbcc1ec2844942e161af5b746a59eca41f40f813a
MD5 a9eda5b2ab8c0d8b3c496c86df014ed2
BLAKE2b-256 1fce24ba903646f67cdf147672a4df9d48d0cd231cd0edc26dc81ad9bc3c013e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page