#44263 [Opn->Fbk]: Soap error when dealing with private or protected properties
ID: 44263
Updated by: jani@php.net
Reported By: andrew at tvisted dot net
-Status: Open
+Status: Feedback
Bug Type: SOAP related
Operating System: Linux/OSX/Windows
PHP Version: 5.2.5
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2008-02-27 11:49:30] andrew at tvisted dot net
Description:
------------
Seems to be similar to Bug #30928 code can access and submit data via
a WSDL without problem, but when trying to submit an array of object
(eg NewCustomer) because certain fields are protected on the
soapserver an error is returned, When a local version of the WSDL is
created and the protected properties are removed from the class. The
soapserver is working correctly as solutions using ASP and Javascript
currently work.
A copy of the WSDL is available at
http://tvisted.net:1024/wsdl/IIntact
---
'./configure' '--prefix=/Applications/xampp/xamppfiles' '--program-
suffix=-5.2.5' '--libdir=/Applications/xampp/xamppfiles/lib/php/php5'
'--includedir=/Applications/xampp/xamppfiles/include/php/php5' '--
with-apxs2=/Applications/xampp/xamppfiles/bin/apxs' '--with-config-
file-path=/Applications/xampp/etc' '--with-
mysql=/Applications/xampp/xamppfiles' '--disable-debug' '--enable-
bcmath' '--enable-calendar' '--enable-ctype' '--enable-dbase'
'--
enable-discard-path' '--enable-exif' '--enable-filepro' '--enable-
force-cgi-redirect' '--enable-ftp' '--enable-gd-imgstrttf' '--enable-
gd-native-ttf' '--with-ttf' '--enable-magic-quotes' '--enable-memory-
limit' '--enable-safe-mode' '--enable-shmop' '--enable-sigchild'
'--
enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-
trans-sid' '--enable-wddx' '--enable-yp' '--with-ftp'
'--with-
ncurses=/Applications/xampp/xamppfiles' '--with-
gdbm=/Applications/xampp/xamppfiles' '--with-jpeg-
dir=/Applications/xampp/xamppfiles' '--with-png-
dir=/Applications/xampp/xamppfiles' '--with-freetype-
dir=/Applications/xampp/xamppfiles' '--without-xpm' '--with-zlib=yes'
'--with-zlib-dir=/Applications/xampp/xamppfiles' '--with-
openssl=/Applications/xampp/xamppfiles' '--with-expat-
dir=/Applications/xampp/xamppfiles' '--enable-
xslt=/Applications/xampp/xamppfiles' '--with-
xsl=/Applications/xampp/xamppfiles' '--with-
dom=/Applications/xampp/xamppfiles' '--with-
ldap=/Applications/xampp/xamppfiles' '--with-
gd=/Applications/xampp/xamppfiles' '--with-mysql-
sock=/Applications/xampp/xamppfiles/var/mysql/mysql.sock' '--with-
mcrypt=/Applications/xampp/xamppfiles' '--with-
mhash=/Applications/xampp/xamppfiles' '--enable-sockets' '--with-
curl=/Applications/xampp/xamppfiles' '--enable-mbregex' '--enable-
zend-multibyte' '--with-zip=/Applications/xampp/xamppfiles' '--enable-
exif' '--with-sqlite' '--with-libxml-
dir=/Applications/xampp/xamppfiles' '--enable-soap' '--enable-pcntl'
'--enable-dbx' '--with-
mysqli=/Applications/xampp/xamppfiles/bin/mysql_config' '--with-
bz2=/Applications/xampp/xamppfiles' '--with-
ming=shared,/Applications/xampp/xamppfiles' '--with-
pear=/Applications/xampp/xamppfiles/lib/php/pear' '--with-
mssql=/Applications/xampp/xamppfiles' '--with-imap-
dir=/Applications/xampp/xamppfiles' '--with-
imap=/Applications/xampp/xamppfiles' '--enable-mbstring=all' '--with-
pgsql=shared,/usr' '--with-gettext=/Applications/xampp/xamppfiles' '--
with-pdo-mysql=/Applications/xampp/xamppfiles'
---
soap.wsdl_cache = 0;
soap.wsdl_cache_enabled = 0;
Reproduce code:
---------------
Part of the code used is:
class TIntactCustomer {
public $Code; // string
public $Name; // string
public $Address1; // string
public $Address2; // string
public $Address3; // string
public $Address4; // string
public $Address5; // string
public $PostCode; // string
public $OnOrder; // double
public $Unbilled; // double
public $UnAllocated; // double
public $CreditLimit; // double
public $Phone1; // string
public $Phone2; // string
public $Fax; // string
public $EMail; // string
public $DeliveryAddress1; // string
public $DeliveryAddress2; // string
public $DeliveryAddress3; // string
public $DeliveryAddress4; // string
public $DeliveryAddress5; // string
public $DefaultVATRate; // double
public $HoCode; // string
public $IsHo; // boolean
}
public function IIntactservice($wsdl =
"http://localhost/intact/lib/IIntactWSDL.xml",
$options = array()) {
foreach(self::$classmap as $key => $value) {
if(!isset($options['classmap'][$key])) {
$options['classmap'][$key] = $value;
}
}
parent::__construct($wsdl, $options);
}
/**
*
*
* @param TIntactCustomer $ACustomer
* @return int
*/
public function AddNewCustomer(TIntactCustomer $ACustomer) {
return $this->__soapCall('AddNewCustomer', array($ACustomer),
array(
'uri' => 'http://www.intact.ie/webservices',
'soapaction' => ''
)
);
}
$customer = new IIntactservice();
$newcustomer = new TIntactCustomer();
$newcustomer->Code = "ALED001";
$newcustomer->Name = "Customer Name";
$newcustomer->Address1 = "365 Old Road";
$newcustomer->Address2 = "Lisburn";
$newcustomer->Address3 = "";
$newcustomer->Address4 = "";
$newcustomer->Address5 = "";
$newcustomer->PostCode = "BT26 6TH";
$newcustomer->Balance = 0;
$newcustomer->OnOrder = 0;
$newcustomer->Unbilled = 0;
$newcustomer->UnAllocated = 0;
$newcustomer->CreditLimit = 0;
$newcustomer->Phone1 = "02854339047";
$newcustomer->Phone2 = "";
$newcustomer->Fax = "";
$newcustomer->EMail = "aled@email.co.uk";
$newcustomer->YTDNetTurnover = 0;
$newcustomer->DeliveryAddress1 = "";
$newcustomer->DeliveryAddress2 = "";
$newcustomer->DeliveryAddress3 = "";
$newcustomer->DeliveryAddress4 = "";
$newcustomer->DeliveryAddress5 = "";
$newcustomer->DefaultVATRate = 2;
$newcustomer->HoCode = "";
$newcustomer->IsHo = False;
$result = $customer->AddNewCustomer($newcustomer);
print_r($result);
Expected result:
----------------
The server should return a positive integer if successful
Actual result:
--------------
A negative integer is returned
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44263&edit=1
Thread (2 messages)