ممنون الان از کد زیر استفاده می کنمنوشته اصلی توسط mersad [مهمان/کاربر گرامی برای دیدن لینک ها ابتدا باید عضو سایت شوید و لاگین کنید برای ثبت نام اینجا کلیک کنید]
$WCFService_URL = 'http://.../HostedWcfService2/Service1.svc?wsdl';
try {
// Initialize the "standard" SOAP Options
$options = array('cache_wsdl' => WSDL_CACHE_NONE, 'encoding' => 'utf-8', 'soap_version' => SOAP_1_1, 'exceptions' => true, 'trace' => true);
// Create a connection to the WCF Service
$client = new SoapClient($WCFService_URL, $options);
if (!$client == null) {
throw new Exception('Could not connect to WCF Service');
}
// Set the WCF Service Parameters based on the argument values
$args = array('value' => 4);
// Submit the $params object
$result = $client->GetData($args);
// Check the return value, in this case the WCF Service Operation Contract returns "Success" upon a succesful insertion
// if ($result->GetDataResult === "Success") {
// return true;
// }
$error = $result->GetDataResult;
throw new Exception($result->GetDataResult);
} catch (Exception $ex) {
echo 'Error in WCF Service: '.$ex->getMessage().'<br/>';
return false;
}
ولی متغیر $client خالی(null) هست . مشکل از کجاست؟





علاقه مندی ها (Bookmarks)