Skip to main content

Multiprotocol Web Services for TurboGears 2

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 2.x

  • 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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

TGWebServices-2.0.0a2-py2.6.egg (62.3 kB view details)

Uploaded Source

TGWebServices-2.0.0a2-py2.5.egg (62.4 kB view details)

Uploaded Source

TGWebServices-2.0.0a2-py2.4.egg (63.3 kB view details)

Uploaded Source

File details

Details for the file TGWebServices-2.0.0a2-py2.6.egg.

File metadata

File hashes

Hashes for TGWebServices-2.0.0a2-py2.6.egg
Algorithm Hash digest
SHA256 81ab4bd73ec9a1376919d442b3224d8f4708869f653d8658010f7eeb460bdf0b
MD5 2578acf05a164c1fb22958627be52ee1
BLAKE2b-256 70aa43a528673c5132ac67b0719ced8d3c5e5755566c771c76270fe47a696468

See more details on using hashes here.

File details

Details for the file TGWebServices-2.0.0a2-py2.5.egg.

File metadata

File hashes

Hashes for TGWebServices-2.0.0a2-py2.5.egg
Algorithm Hash digest
SHA256 ced504135f05d969877f33b5eba87ef8df8a4f20d15e334179efbab9feb0d929
MD5 623faeb918a6cf37dfb20c4e81672548
BLAKE2b-256 d2a013208323b0b008f27016dc8c91094e07488c524221182e3be2d91a2e9341

See more details on using hashes here.

File details

Details for the file TGWebServices-2.0.0a2-py2.4.egg.

File metadata

File hashes

Hashes for TGWebServices-2.0.0a2-py2.4.egg
Algorithm Hash digest
SHA256 a4efada5bd4a3a9857e2d75295715453282402ebeb87dd0573280ff2f00e4273
MD5 58c7ae79464e7c77df952a4e5334a901
BLAKE2b-256 d3a75557711d8053598dd749f6338411cbf03fd327bb48cf3f4a98a5f45669fd

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