web services - Backend for SOAP in Python -


i python programmer, new webservices.

task:

i have typo3-frontend , postgresql-database. want write backend between these 2 parts in python. developer gave me wsdl-file , xsd-file work with, use soap. program code should bound port (tcp/ip) , act service. data/payload encoded in json-objects.

    webclient <---> frontend <---> backend(me) <---> database 

my ideas:

  1. i code functions hand wsdl-file, datatypes xsd.
  2. i bind service port recieves incoming json-data
  3. i parse incoming data, database-operations, other stuff
  4. i return result frontend.

questions:

  1. do have code methods/functions descripted in wsdl-file hand?
  2. do have define complex datatypes hand?
  3. how should implement communication between frontend , backend?

thanks in advance!

steffen

i have used suds client communicate microsoft dynamics nav (former navision).

typical session looks this:

from suds.client import client url = 'http://localhost:7080/webservices/webservicetestbean?wsdl' client = client(url) 

by issuing print client list of types , operations supported serivce.

suds - version: 0.3.3 build: (beta) r397-20081121  service (webservicetestbeanservice) tns="http://test.server.enterprise.rhq.org/"    prefixes (1):      ns0 = "http://test.server.enterprise.rhq.org/"    ports (1):      (soap)        methods:          addperson(person person, )          echo(xs:string arg0, )          getlist(xs:string str, xs:int length, )          getpercentbodyfat(xs:string name, xs:int height, xs:int weight)          getpersonbyname(name name, )          hello()          testexceptions()          testlistarg(xs:string[] list, )          testvoid()          updateperson(anotherperson person, name name, )    types (23):      person      name      phone      anotherperson 

wsdl operations exposed ordinary python functions , can use ordinary dicts in place of wsdl types.


Comments