views:

28

answers:

1

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())
+1  A: 

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.

mattbasta
Now I get : for method in self.server.methods():AttributeError: HelloWorldService instance has no attribute 'methods'
jini
I updated the code (typo). Try now!
mattbasta
I used your revised code and this is what I get now:Traceback (most recent call last): File "client.py", line 5, in <module> class HelloWorldService(SimpleWSGISoapApp):NameError: name 'SimpleWSGISoapApp' is not definedsorry :(
jini
Dude, did you even look at the docs? This is Python 101; import the module: `from soaplib.wsgi_soap import SimpleWSGISoapApp`
mattbasta
I am so sorry !!! I completely overlooked that ! DOH!!!!!thanks so much !
jini