duplicates of complex service types when serving as wsgiapp
I have been serving up my web services using apache (and ladon-ctl) up till now, and have had no problems.
Since I want to provide another interface for the same library of functions, implemented in pyramid, I wanted to move to make a wsgi app out of my ladonized functions and serve it together with the rest of the pyramid application using waitress.
This works, but changes the behaviour of ladon in a way that is not entirely intuitive to me:
My web services look something like this:
from ladon.ladonizer import ladonize
from ladon.types.
class Result(LadonType):
name = {
}
value = {
}
unit = {
'type': str
}
class DummyServices(
@ladonize(
def dummyres(self,uid):
r = Result()
r.name= str('test')
r.value = str(1.23)
r.unit = str('m/s')
return r
serving it up with:
ladon-ctl testserve dummyservices.py -p 6544
works just fine.
Now I want to include it in my pyramid application, so I modified my __init__.py file to look something like this:
from pyramid.config import Configurator
from sqlalchemy import engine_from_config
from os.path import abspath,dirname
from pyramid.wsgi import wsgiapp
from ladon.server.wsgi import LadonWSGIApplic
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
application = LadonWSGIApplic
ladonService = wsgiapp(
config = Configurator(
config.
config.
config.scan()
return config.
and serve it up with pserve.
Suddenly there are two duplicate, identical instances of the Result type - but only in the overview page and the soap WSDLs; e.g.:
<wsdl:definitions name="DummyServ
...
This doesn't play well with the c# application that I want to act as the client, unfortunately (suds just ignores the duplicate definition).
Interestingly in the JSON-WSP description, there is only one reference to the Result type.
{"version": "1.1", "url": "http://
I am still fairly new to python, and I am sure I am doing something wrong in the way I am creating the wsgi app, but I am at a loss as to what. Any help would be very much appreciated!
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- ladon Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: