On Mon, 8 Oct 2007 22:34:42 +0200
"MB" <mb_dk@get2net.dk> wrote:
> Kode:
>
> <?php
> try {
> $client = new
> SoapClient("
http://www.webservicex.net/ValidateEmail.asmx?wsdl");
> $mail = "mb@mbtrading.dk";
> $result = $client->IsValidEmail($mail);
> echo $result;
> } catch(Exception $e) {
> echo $e->getMessage();
> }
> ?>
>
Da servicen anvender qualified ducument/literal, default i .NET, skal
parameteren medsendes indpakket i en php klasse, hvor attributterne
leksikografisk stemmer overens med servicens XML-schema.
<?php
class IsValidEmail {
/* string */
public $Email;
}
$mail = new IsValidEmail();
try {
$client = new
SoapClient("
http://www.webservicex.net/ValidateEmail.asmx?wsdl");
//info
var_dump($client->__getFunctions());
var_dump($client->__getTypes());
$mail->Email = "mb@mbtrading.dk";
$result = $client->IsValidEmail($mail);
if ($result->IsValidEmailResult)
echo "Valid email entered\n";
else
echo "Invalid email entered\n";
}
catch(Exception $e) {
echo $e->getMessage()."\n";
}
?>
--
Hilsen/Regards
Michael Rasmussen
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917
A computer is like air conditioning: it becomes useless when you open
windows.