Python3 and Soap

119 views
Skip to first unread message

Marcello

unread,
May 27, 2018, 10:59:16 PM5/27/18
to web2py-users
Hello,

I'm trying to create a Soap server with Python3 and web2py.
Tested with the example from manual,I put in a controller:

@service.soap('MyAdd', returns={'result':int}, args={'a':int, 'b':int,})
def add(a, b):
    return a + b

And when I run client.MyAdd(a=1, b=2) in a client, I get the error:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Users/parra/web2py3/gluon/contrib/pysimplesoap/client.py", line 177, in <lambda>
    return lambda *args, **kwargs: self.wsdl_call(attr, *args, **kwargs)
  File "/Users/parra/web2py3/gluon/contrib/pysimplesoap/client.py", line 351, in wsdl_call
    return self.wsdl_call_with_args(method, args, kwargs)
  File "/Users/parra/web2py3/gluon/contrib/pysimplesoap/client.py", line 375, in wsdl_call_with_args
    response = self.call(method, *params)
  File "/Users/parra/web2py3/gluon/contrib/pysimplesoap/client.py", line 276, in call
    detail)
gluon.contrib.pysimplesoap.client.SoapFault: VersionMismatch.TypeError: cannot use a string pattern on a bytes-like object


Python2 works fine.

Any ideas ???

Thanks


Maurizio Maccioni

unread,
Jul 27, 2019, 2:26:45 AM7/27/19
to web2py-users
Hi Marcello,

I'm facing the same error right now. I quite new in web2py framework. Did you figure it out?

Thanks

Massimo Di Pierro

unread,
Jul 27, 2019, 2:29:36 PM7/27/19
to web2py-users
web2py ships with old version of pysimplesoap in web2py/gluon/contrib/pysimplesoap

try replace it with


If it works for you we can make it official

Maurice Waka

unread,
Feb 5, 2020, 8:58:16 AM2/5/20
to web2py-users
Hello.
I recently reinstalled ubuntu 18.04 and installed python 3.6.9. 
N ow on trying web2py I get teh same error:

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Traceback (most recent call last
):
File "/home/maurice/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
File "/home/maurice/web2py/applications/admin/controllers/default.py", line 2023, in <module>
File "/home/maurice/web2py/gluon/globals.py", line 421, in <lambda>
self._caller = lambda f: f()
File "/home/maurice/web2py/applications/admin/controllers/default.py", line 1125, in design
defines[m] = regex_tables.findall(data)
TypeError: cannot use a string pattern on a bytes-like object

Maurice Waka

unread,
Feb 5, 2020, 8:59:37 AM2/5/20
to web2py-users
I also tried this link https://github.com/pysimplesoap/pysimplesoap/tree/master/pysimplesoap

with the same error.

Regards

On Saturday, July 27, 2019 at 9:29:36 PM UTC+3, Massimo Di Pierro wrote:

Massimo Di Pierro

unread,
Feb 10, 2020, 1:04:01 AM2/10/20
to web2py-users
I think you should contact the author of pysimplesoap. I do not believe it supports py3
We can fix it our side but should really be fixed upstream
Reply all
Reply to author
Forward
0 new messages