soap - sessions ?

gcmartijn at gmail.com gcmartijn at gmail.com
Fri Jun 8 07:28:30 EDT 2007


H!

When I use php code nusoap everything works but with python I get
everytime "Your session key does not exist or has expired"

I use this code below:

        test = SOAPpy.SOAPProxy("http://secure.easynic.com/com/iomart/
easynicWSv2.cfc?wsdl")
        data = test.login(_id='test',_pass='pass')
        for item in data:
            for item2 in item:
                if item2['key']=='KEY':
                    EASYKEY = item2['value']

            # now I have the EASYKEY

            # create a customer with the key,
            # print output = "Your session key does not exist or has
expired"
            print test.createOrUpdateContact(key=EASYKEY,
            title=row[0],
            firstname=row[2],
            initials=row[3],
            lastname=row[4],
            company=row[5],
            phone=row[9],
            fax='',
            email=row[13],
            address1=straat,
            address2='',
            address3='',
            area=row[12],
            city=row[8],
            country=row[12],
            postcode=row[7],
            acc_username='',
            acc_password='',
            domaincontactid='')

            # logout , and this works ! (using the same key)
            test.logout(key=EASYKEY)

With php this works:

// get the key $_SESSION[CODElogin]
$result = $soapClient->call('login',$params,$_SESSION[serverip],
$_SESSION[serverip])

// make a customer
   $params = array(
    'key'			=> $_SESSION[CODElogin],
    'title'			=> $_POST[title],
    'firstname'		=> $_POST[firstname],
    'initials'		=> $_POST[initials],
    'lastname'      => $_POST[lastname],
    'company'		=> $_POST[company],
    'phone'			=> $_POST[phone],
    'fax'			=> $_POST[fax],
    'email'			=> $_POST[email],
    'address1'		=> $_POST[address1],
    'address2'		=> $_POST[address2],
    'address3'		=> $_POST[address3],
    'area'			=> $_POST[area],
    'city'			=> $_POST[city],
    'country'		=> $_POST[area],
    'postcode'		=> $_POST[postcode],
    'acc_username'	=> $_POST[acc_username],
    'acc_password'	=> $_POST[acc_password],
    'domaincontactid'=> $_POST[domaincontactid]
	);

// send
$result = $soapClient->call('createOrUpdateContact',$params,'http://
secure.easynic.com/com/iomart/easynicWSv2.cfc?wsdl','http://
secure.easynic.com/com/iomart/easynicWSv2.cfc?wsdl');

and everything works, what can I do to make this with python ?
or must I use exec("phpprogram.php") ? (I hope not)

Thanks




More information about the Python-list mailing list