1

I'm trying to use pysimplesoap (v.1.10) and getting what appears to be some kind of parsing error when executing a method request.

Stripped down version:

import pysimplesoap

soapURL = "https://site/path/to/soap"
namespace = "https://site/path/to/ns"

soapClient = pysimplesoap.client.SoapClient(location=soapURL + "?wsdl",namespace=namespace)

response = soapClient.getDocumentContent('1234567')

(python 2.7.8 btw)


Results in an error:

Traceback (most recent call last):
  File ".\SOAPtest2.py", line 60, in <module>
    response = soapClient.getDocumentContent('1234567')
  File "build\bdist.win32\egg\pysimplesoap\client.py", line 139, in <lambda>
AttributeError: 'str' object has no attribute 'call' 

However, the real question I have is that I am trying (unsuccessfully) to get logging working, but cannot see any output or determine/confirm what the XML structure it is sending/receiving. I might be able to diagnose the problem if I could see what it is receiving/trying to parse.

I have a gist of the code and the error I'm getting as well.

The odd part is that in my original script (before I stripped down to just some test code) I had a secondary logging instance and file handler and it worked just fine. So it seems specific to the pysimplesoap logging.

Any help would be greatly appreciated.


EDIT: Solution

Per KenK's recommendation, I modified my method call to be (documentId='1234567') and it worked. The script got past that error and I got a few log/debug lines in output. It seems that pysimplesoap simply has so few log/debug lines that none were reached prior to the error I was hitting.

user29021
  • 65
  • 1
  • 5

1 Answers1

0

Add the following code to your code:

import logging

logging.basicConfig(level=logging.DEBUG)

To fix the error you're getting, you need to specify an attribute name. Like this:

response = soapClient.getDocumentContent(name='1234567')

Replace name with whatever's defined for this function.

KenK
  • 16
  • 2
  • I have done that and am still getting no logging information. Did you check out the [gist code](https://gist.github.com/tocano33/a08eb9f9691c96a4289f) I posted with the question? – user29021 Feb 15 '15 at 13:47
  • Try commenting out all of the logging code in your gist code. Then use the line I suggested. That should enable logging for the pysimplesoap client to the console. Sorry, I can't help with logging to files that you want. – KenK Feb 15 '15 at 21:46
  • Sorry, don't know if you edited the second half of your recommendation on or I missed it the first time, but adding the name='1234567' worked. It fixed that error and I got a line or two of log messages. It appears that pysimplesoap simply has so few debug/log lines that if the method call has an arg error for some reason, it just doesn't hit any logging lines prior to that. – user29021 Feb 16 '15 at 15:02