Multiprotocol Web Services for TurboGears
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
Works with TurboGears 1.0
MIT license allows for unrestricted use
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file TGWebServices-1.0.2.tar.gz
.
File metadata
- Download URL: TGWebServices-1.0.2.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6e36b0f522a5f9479a8e00bc29c8be3ed138bca10a4c6281fda3a77c4e599b1 |
|
MD5 | 6e5aa73526ab0886bb5db5a8d7615823 |
|
BLAKE2b-256 | 9f674424172d30eb108ebf97472875736193d0e39322ba53f0c317142a59d1ab |
File details
Details for the file TGWebServices-1.0.2-py2.4.egg
.
File metadata
- Download URL: TGWebServices-1.0.2-py2.4.egg
- Upload date:
- Size: 46.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be1fde2fa8bfa247485afb7df5d1463e584b6d9524013269af3bd28208a2738d |
|
MD5 | f719f56f7730e9c52d0f404352fef5cb |
|
BLAKE2b-256 | d8d5b7e5bc459bab7f8f6b1872819546dc49c96b956cda1c8e535d41f6ae0744 |