PHP怎么调用设置为wshttpbinding的WCF
目前设置为BasicHttpBinding的已经调用成功,
$client = new SoapClient("DataCenter.svc?wsdl");
$sql = "SELECT id,email,firstname,lastname,password FROM `user`;";
$users = $db->get_results($sql);
foreach ( $users as $user )
{
$customer = array();
$customer['refId'] = $user->id;
$customer['email'] = $user->email;
$customer['userName'] = $user->email;
$customer['firstName'] = $user->firstname;
$customer['lastName'] = $user->lastname;
$customer['password'] = $user->password;
$customer['siteId'] = 1;
try
{
$result = $client->__call("RegisterCustomer",array($customer));
$registerSuccessful = $result->RegisterCustomerResult;
if($registerSuccessful ==0)
{
echo "注册成功".var_dump($registerSuccessful);
}
else
{
echo "失败".var_dump($registerSuccessful);
}
}
catch (SoapFault $fault)
{
$error = 1;
print("Sorry, blah returned the following ERROR: ".$fault->faultcode."-".$fault->faultstring);
}
}