Automatically expose soaplib methods in WSDL

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from soaplib_handler import DjangoSoapApp
from django.conf import settings
import inspect

class Service(DjangoSoapApp):
    for app in settings.INSTALLED_APPS:
        try:
            module = __import__(app + '.web_service', [], [], [''])
            for key in module.__dict__:
                func = module.__dict__[key]
                if inspect.isfunction(func):
                    if '_is_soap_method' in dir(func):
                        locals()[key] = func
        except ImportError, e:
            pass
service = Service()

More like this

  1. Convert django model into soaplib model, to expose webservices by s.federici 5 years, 3 months ago
  2. SOAP web service with soaplib 0.9+ by wRAR 3 years, 6 months ago
  3. SOAP web service with soaplib 2.0 by treyh 2 years, 3 months ago
  4. soaplib service integration 2 by erny 5 years ago
  5. django soaplib test client by erny 5 years ago

Comments

miketeo (on March 11, 2009):

Hi, you have written just what i need for my django app.

Can you recommend where should the above code snippet be placed? How can i access the wsdl URL using the above code?

Thanks for your code. -- Michael

#

(Forgotten your password?)