Re: PHP -> WSDL objects
| From: | Michael Rasmussen | Date: | Thu, 16 Feb 2006 03:43:19 +0000 |
| Subject: | Re: PHP -> WSDL objects | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-2133@lists.php.net to get a copy of this message | ||
On Wed, 15 Feb 2006 14:16:20 -0800, feeblminds wrote:
>
> My problem is how do I define an object i.e. $client1, $client2 and
> $product so that the web service can correctly handle and parse them.
>
First: Do your installed php have support for curl (https)?
Second:
And object is handle in php as an array:
$client1 = array(
"Sex" => "Male",
"DOB" => "1985-12-12 12:00:00",
"Smoker" => "Yes",
"Title" => "Mr",
"FirstName" => "John",
"Surname" => "Doo",
"OccCode" => "worker",
"OccClass" => "normal",
"AnnualEarnings" => 12000
);
$client2 = array(
"Sex" => "Female",
"DOB" => "1985-12-12 12:00:00",
"Smoker" => "No",
"Title" => "Ms",
"FirstName" => "Jane",
"Surname" => "Doo",
"OccCode" => "worker",
"OccClass" => "normal",
"AnnualEarnings" => 11000
);
$TheProduct = array(
"ProtectionSubtype" => "UNDEFINED",
"BenefitType" => "DEATH_BENEFIT",
"CICTPDMask" => 5,
"PremiumFrequency" => "Monthly",
"TermYears" => 2,
"Premium" => 1.2,
"Benefit" => 10,
"IncreasingBenefit" => "UNDEFINED",
"WaiverBasis" => "None",
"RevRts" => "No",
"CoverBasis" => "SingleLife2"
);
<?php
require 'SOAP/Client.php';
$client1 = array(
"Sex" => "Male",
"DOB" => "1985-12-12T12:00:00",
"Smoker" => "Yes",
"Title" => "Mr",
"FirstName" => "John",
"Surname" => "Doo",
"OccCode" => "worker",
"OccClass" => "normal",
"AnnualEarnings" => 12000
);
$client2 = array(
"Sex" => "Female",
"DOB" => "1985-12-12T12:00:00",
"Smoker" => "No",
"Title" => "Ms",
"FirstName" => "Jane",
"Surname" => "Doo",
"OccCode" => "worker",
"OccClass" => "normal",
"AnnualEarnings" => 11000
);
$TheProduct = array(
"ProtectionSubtype" => "UNDEFINED",
"BenefitType" => "DEATH_BENEFIT",
"CICTPDMask" => 5,
"PremiumFrequency" => "Monthly",
"TermYears" => 2,
"Premium" => 1.2,
"Benefit" => 10,
"IncreasingBenefit" => "UNDEFINED",
"WaiverBasis" => "None",
"RevRts" => "No",
"CoverBasis" => "SingleLife2"
);
$wsdl2 = new SOAP_WSDL('https://www.webline.co.uk/WeblineWebServices/Quotes.asmx?WSDL');
$WLproxy2 = $wsdl2->getProxy();
$response2 = $WLproxy2->ProtectionQuoteRequest($LogonToken, 0, $client1, $client2, $TheProduct,
'', '', '', '');
var_dump($response2);
?>
Response (I have no idea of what would be valid input :-):
[mir@loke:tmp]$ php test.php
object(stdClass)#8 (7) {
["LogonTokenAccepted"]=>
string(4) "true"
["Success"]=>
string(5) "false"
["ExceptionMessage"]=>
string(0) ""
["MessageSentTime"]=>
string(33) "2006-02-16T03:43:32.9983653-00:00"
["QuoteRef"]=>
string(1) "0"
["Notes"]=>
string(72) "This value of coverbasis is currently unsupported and is for future use."
["PollDelay"]=>
string(5) "12000"
}
--
Hilsen/Regards
Michael Rasmussen
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917