Python Forum
Type Not Found error on python soap call using suds library
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Type Not Found error on python soap call using suds library
#1
i'm converting my php code into python code

here is my php code

$info = new StdClass();
$info->username = 'myUsername'; //Required
$info->password = 'myPassword';

require_once 'nusoap.php';
$client = new nusoap_client('http://myWebServiceAddress?wsdl', true);
$str = $client->call("login", array('loginRequest' => $info));

$contextinfo = new stdClass();
$contextinfo->data = new stdClass();
$contextinfo->data->entry = array('key' => 'SESSION_ID', 'value' => $str['return']);

$requestinfo = new StdClass();
$requestinfo->refNumList = "RefNum";

$str1 = $client->call("verifyTransaction", array('context' => $contextinfo, 'verifyRequest' => $requestinfo));

echo $str1['return']['verifyResponseResults']['amount'];

and when i convert it to python i got this error Exception Value:

Type not found: 'value'

Exception Location: venv\lib\site-packages\suds\mx\literal.py in start, line 87

here is my python code

wsdl_url = WebServiceUrl
schema_url = 'http://www.type-applications.com/character_set/'
schema_import = Import(schema_url)
schema_doctor = ImportDoctor(schema_import)

client = Client(url=wsdl_url, doctor=schema_doctor)

info = {
    "username":int(username),
    "password":int(password)
}
params = {
    'loginRequest':info
}

result = client.service.login(**params)

entry = {
    'key':str('SESSION_ID'),
    'value':str(result)
}
contextinfo = {
    'data':entry
}

requestinfo = {
    "refNumList":RefNum
}
params1 = {
    'context':contextinfo,
    'verifyRequest':requestinfo
}

result = client.service.verifyTransaction(**params1)
first soap calls works well ('client.service.login(**params)') and result has true value

but i got error on second soap call(client.service.verifyTransaction(**params1))

i used suds.Client for soap call and used suds.xsd.doctor for fixing type not found error, but doctor cant fix it for me
Reply
#2
You need to provide runnable code (which includes imports) and the full stack trace.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with searching over Beautiful Soap object Pavel_47 30 9,677 Jun-30-2022, 10:27 PM
Last Post: snippsat
  Beautifull Soap. Split page using a value and not a tag. lillo123 5 3,346 Apr-21-2021, 09:11 AM
Last Post: lillo123
  Beautiful Soap can't find a specific section on the page Pavel_47 1 2,385 Jan-18-2021, 02:18 PM
Last Post: snippsat
  urllib.error.HTTPError: HTTP Error 404: Not Found ckkkkk 4 8,633 Mar-03-2020, 11:30 AM
Last Post: snippsat
  sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type. Prince_Bhatia 3 14,866 Apr-03-2018, 03:40 PM
Last Post: snippsat
  Passing soapAction false to suds PeppePegasus 1 4,017 Jan-08-2018, 09:31 AM
Last Post: SarbjitGrewal
  Suds client response error rajesh 1 4,143 Sep-26-2017, 11:36 AM
Last Post: metulburr
  Getting past a none type error CodyW129 1 10,010 Jul-27-2017, 12:22 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020