Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6686429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:10:14+00:00 2026-05-26T05:10:14+00:00

On one Side I have Django exposing a SOAP entry point: soaplib 1.0 soaplib_handler.py

  • 0

On one Side I have Django exposing a SOAP entry point:

soaplib 1.0

soaplib_handler.py

# http://djangosnippets.org/snippets/2210/

from django.http import HttpResponse
import StringIO
from soaplib.serializers.primitive import Boolean, String
from soaplib.service import DefinitionBase, rpc
from soaplib.wsgi import Application

# the class with actual web methods
class MySOAPService(DefinitionBase):
    @rpc(String, String, _returns=String)
    def foo(self, t1, t2):
        return "OK"

# the class which acts as a wrapper between soaplib WSGI functionality and Django
class DjangoSoapApp(Application):
    def __call__(self, request):
        # wrap the soaplib response into a Django response object
        django_response = HttpResponse()
        def start_response(status, headers):
            status, reason = status.split(' ', 1)
            django_response.status_code = int(status)
            for header, value in headers:
                django_response[header] = value
        response = super(DjangoSoapApp, self).__call__(request.META, start_response)
        django_response.content = '\n'.join(response)
        return django_response

core.views.py

from soaplib_handler import DjangoSoapApp, MySOAPService

my_soap_service = DjangoSoapApp([MySOAPService], 'Mydeal')

urls.py

 url(r'^hello_world/', 'core.views.my_soap_service'),

 url(r'^hello_world/service.wsdl', 'core.views.my_soap_service'),

When i do http://localhost:8001/hello_world/service.wsdl I receive:

<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions xmlns:plink="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:senc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s0="Mydeal" xmlns:s12env="http://www.w3.org/2003/05/soap-envelope/" xmlns:s12enc="http://www.w3.org/2003/05/soap-encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:senv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="Mydeal" name="DjangoSoapApp">
 <wsdl:types>
  <xs:schema targetNamespace="Mydeal" elementFormDefault="qualified">
   <xs:element name="foo" type="s0:foo" />
   <xs:element name="fooResponse" type="s0:fooResponse" />
   <xs:complexType name="foo">
    <xs:sequence>
     <xs:element name="t1" type="xs:string" minOccurs="0" nillable="true" />
     <xs:element name="t2" type="xs:string" minOccurs="0" nillable="true" />
     </xs:sequence>
    </xs:complexType>
   <xs:complexType name="fooResponse">
    <xs:sequence>
     <xs:element name="fooResult" type="xs:string" minOccurs="0" nillable="true" />
     </xs:sequence>
    </xs:complexType>
   </xs:schema>
  </wsdl:types>
 <wsdl:message name="foo">
  <wsdl:part name="foo" element="s0:foo" />
  </wsdl:message>
 <wsdl:message name="fooResponse">
  <wsdl:part name="fooResponse" element="s0:fooResponse" />
  </wsdl:message>
 <wsdl:service name="DjangoSoapApp">
  <wsdl:port name="DjangoSoapApp" binding="s0:DjangoSoapApp">
   <soap:address location="http://localhost:8001/hello_world/service" />
   </wsdl:port>
  </wsdl:service>
 <wsdl:portType name="DjangoSoapApp">
  <wsdl:operation name="foo" parameterOrder="foo">
   <wsdl:input name="foo" message="s0:foo" />
   <wsdl:output name="fooResponse" message="s0:fooResponse" />
   </wsdl:operation>
  </wsdl:portType>
 <wsdl:binding name="DjangoSoapApp" type="s0:DjangoSoapApp">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
  <wsdl:operation name="foo">
   <soap:operation soapAction="foo" style="document" />
   <wsdl:input name="foo">
    <soap:body use="literal" />
    </wsdl:input>
   <wsdl:output name="fooResponse">
    <soap:body use="literal" />
    </wsdl:output>
   </wsdl:operation>
  </wsdl:binding>
 </wsdl:definitions>

Looks ok so far,

Then testing time

from suds.client import Client
WSDL = "http://localhost:8001/hello_world/service.wsdl"
client_endpoint = Client(WSDL)
print client_endpoint

Gives the following error:

======================================================================
ERROR: test_callback (__main__.TestM2TScenarioI)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests.py", line 370, in test_callback
    client_endpoint = Client(WSDL)
  File "/home/gregory/.virtualenvs/casadeal/lib/python2.6/site-packages/suds/client.py", line 112, in __init__
    self.wsdl = reader.open(url)
  File "/home/gregory/.virtualenvs/casadeal/lib/python2.6/site-packages/suds/reader.py", line 152, in open
    d = self.fn(url, self.options)
  File "/home/gregory/.virtualenvs/casadeal/lib/python2.6/site-packages/suds/wsdl.py", line 158, in __init__
    self.resolve()
  File "/home/gregory/.virtualenvs/casadeal/lib/python2.6/site-packages/suds/wsdl.py", line 207, in resolve
    c.resolve(self)
  File "/home/gregory/.virtualenvs/casadeal/lib/python2.6/site-packages/suds/wsdl.py", line 495, in resolve
    raise Exception("msg '%s', not-found" % op.input)
Exception: msg 's0:Test', not-found

----------------------------------------------------------------------
Ran 1 test in 0.053s
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:10:14+00:00Added an answer on May 26, 2026 at 5:10 am

    I had the same problem with soaplib version 2.0 beta. I had to change

    my_soap_service = DjangoSoapApp([MySOAPService], 'Mydeal')
    

    to

    my_soap_service = DjangoSoapApp([MySOAPService], 'Mydeal', name='Mydeal')
    

    And this worked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On one side I have: http://forums.enterprisedb.com/posts/list/2481.page Here we declare field as BYTEA and we
I have to pass parameters between two rails apps. In one side (sender) I
We create a socket. On one side of the socket we have a server
I currently have an element that has a solid border along one side of
I have two panels occupying the same space in one side of a splitviewcontainer.
I have a header which has a large image floated on one side, and
I have a table and one side of the table is an array of
I have an app with CALayers that move from one side of the screen
I have a Django form that will add an entry to a database with
Using the following related models (one blog entry can have multiple revisions): class BlogEntryRevision(models.Model):

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.