I'm trying to pass a series of values to a web service using PHP and am running into serious problems. So in my PHP client I call the wsdl file and call the quoteMethod:
$wsdl2 = new SOAP_WSDL('https://www.webline.co.uk/WeblineWebServices/Quotes.asmx?WSDL');
$WLproxy2 = $wsdl2->getProxy();
$response2 = $WLproxy2->ProtectionQuoteRequest($LogonToken, 0, $client1, $client2, $product, '', '', '', '');
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.
Can any body offer any advice?
Below is a copy of the WSDL method:
POST /WeblineWebServices/Quotes.asmx HTTP/1.1
Host: www.webline.co.uk
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://webline.co.uk/webservices/Quotes/ProtectionQuoteRequest"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ProtectionQuoteRequest xmlns="http://webline.co.uk/webservices/Quotes/">
<LogonToken>string</LogonToken>
<ProductID>int</ProductID>
<Client1>
<Sex>UNDEFINED or Male or Female</Sex>
<DOB>dateTime</DOB>
<Smoker>UNDEFINED or Yes or No</Smoker>
<Title>string</Title>
<FirstName>string</FirstName>
<Surname>string</Surname>
<OccCode>string</OccCode>
<OccClass>string</OccClass>
<AnnualEarnings>int</AnnualEarnings>
</Client1>
<Client2>
<Sex>UNDEFINED or Male or Female</Sex>
<DOB>dateTime</DOB>
<Smoker>UNDEFINED or Yes or No</Smoker>
<Title>string</Title>
<FirstName>string</FirstName>
<Surname>string</Surname>
<OccCode>string</OccCode>
<OccClass>string</OccClass>
<AnnualEarnings>int</AnnualEarnings>
</Client2>
<TheProduct>
<ProtectionSubtype>UNDEFINED or TERM or CONVERTIBLETERM or MORTGAGEPROTECTION or FAMILYINCOMEBENEFIT or WHOLELIFE</ProtectionSubtype>
<BenefitType>UNDEFINED or DEATH_BENEFIT or CRITICAL_ILLNESS or DEATH_OR_EARLIER_CIC</BenefitType>
<CICTPDMask>int</CICTPDMask>
<PremiumFrequency>UNDEFINED or Monthly or Annually or Quarterly or Weekly or Single or Half_Yearly or Termly or Four_Weekly</PremiumFrequency>
<TermYears>int</TermYears>
<Premium>float</Premium>
<Benefit>int</Benefit>
<IncreasingBenefit>UNDEFINED or Yes or No</IncreasingBenefit>
<WaiverBasis>None or FirstLife or SecondLife or Joint</WaiverBasis>
<RevRts>UNDEFINED or Yes or No or Both</RevRts>
<CoverBasis>UNDEFINED or SingleLife1 or SingleLife2 or JointFirstEvent or JointLastSurvivor or TwoSingleLifePolicies</CoverBasis>
</TheProduct>
<IFARef>string</IFARef>
<TheCommission>
<Indemnity>boolean</Indemnity>
<Initial>int</Initial>
<Renewal>int</Renewal>
</TheCommission>
<Options>string</Options>
</ProtectionQuoteRequest>
</soap:Body>
</soap:Envelope>