Strong Like Bull
Strong Like Bull

Reputation: 11297

Why am I getting this error when I try writing a client for soaplib?

Traceback (most recent call last): File "", line 1, in NameError: name 'HelloWorldService' is not defined

I am following the example at http://github.com/jkp/soaplib by writing the following code:

from soaplib.client import make_service_client
client = make_service_client('http://localhost:7789/',HelloWorldService())

Upvotes: 0

Views: 468

Answers (1)

mattbasta
mattbasta

Reputation: 13709

You're neglecting the paragraph after that code snippet:

As in this case, the stub can be the instance of the remote functionality, however the requirements are that it just have the same method signatures and definitions as the server implementation.

You need to add a stub to your project that simulates the structure of the HelloWorldService class on the server:

class HelloWorldService(SimpleWSGISoapApp):
    def say_hello(self, name, times):
        pass

Add that snippet right after your import statement and give it a whirl.

Upvotes: 1

Related Questions