Hello all,
I am a new at Django ... I saw there were some questions about SOAP and
I am having some doubs too.
The code below is about that matter. My questions:
How can I put SimpleSOAPView under 'contrib.soap' ??
I am getting this error ... :
" cannot import name SimpleSOAPView "
Thanks in advance.
Marcus
On 11/1/06, tomass <[EMAIL PROTECTED]> wrote:
> I had to change some code in the soap.py as it was
pre-magic-removal,
- Hide quoted text -
- Show quoted text -
but it's still not working for me. The changes I made were to change
"from django.utils.httpwrappers import HttpResponseServerError,
HttpResponse" to "from django.http import HttpResponseServerError,
HttpResponse". I then added this to my urls.py:
urlpatterns += patterns('greenleaftech.jobmonitor.soapviews',
(r'^jobmonitor/rpc/$', 'f2'),
)
And in the soapviews.py I put:
from django.contrib.soap import SimpleSOAPView
soap = SimpleSOAPView()
def f2(request):
return 'f2'
soap.registerFunction(f2)
This is almost correct, I had to change it in my case to be like:
urlpatterns = patterns('',
(r'^soap/', 'myproject.web.soapview.soap'),
)
and then in your view (in my case soapview.py):
you do:
from django.contrib.soap import SimpleSOAPView
soap = SimpleSOAPView()
def echo(s):
"""repeats a string twice"""
return s + s
soap.registerFunction(echo)
and now you can call echo function in your soap url. You don't bind
your url's to specific soap functions but to soap dispatcher.
hope it helps,
jure
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---