شرمنده زیادی دست کاریش کردم تا به کاری که میخوام بخوره
ببینین مشکل فنی نداره اخه جواب نمیده
<?php
require_once 'nusoap/nusoap.php';
$ns = 'http://localhost/mywsdl';
$server = new NuSOAP_Server();
$server->debug_flag = false;
$server->soap_defencoding = 'utf-8';
$server->decode_utf8 = false;
$server->configureWSDL('MyWSDL', $ns);
$server->wsdl->schemaTargetNamespace = $ns;
$server->wsdl->addComplexType(
'UserInfo',
'complexType',
'struct',
'all',
'',
array(
'ID' => array(
'name' => 'ID',
'type' => 'xsd:int'
),
'ProgeramName' => array(
'name' => 'ProgeramName',
'type' => 'xsd:string'
),
'ProgramVersion' => array(
'name' => 'ProgramVersion',
'type' => 'xsd:string'
),
'ScriptTF' => array(
'name' => 'ScriptTF',
'type' => 'xsd:string'
),
'SqlScript1' => array(
'name' => 'SqlScript1',
'type' => 'xsd:string'
),
'FileTF' => array(
'name' => 'FileTF',
'type' => 'xsd:string'
),
'FilePath1' => array(
'name' => 'FilePath1',
'type' => 'xsd:string'
)
)
);
$server->wsdl->addComplexType(
'Users',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(
array(
'ref' => 'SOAP-ENC:arrayType',
'wsdl:arrayType' => 'tns:UserInfo[]'
)
),
'tns:UserInfo'
);
$server->register(
'GetUserInfo', // Method Name
array('DataBaseName' => 'xsd:string' ,'SqlScript' => 'xsd:string','headers' => 'xsd:string'), // Input Parameters
array('return' => 'tns:UserInfo'), // Output Parameters
$ns, // Namespace
$ns . '#GetUserInfo', // SOAPAction
'rpc', // Style
'encoded', // Use
'Get specific user info' // Documentation
);
function GetUserInfo($DataBaseName,$SqlScript ,$headers){
$DataBaseName= "=?UTF-8?B?".base64_encode($DataBaseName)."?=";
$SqlScript = "=?UTF-8?B?".base64_encode($SqlScript )."?=";
$headers= "=?UTF-8?B?".base64_encode($headers)."?=";
$result = array(
'ID' => null,
'ProgeramName' => null,
'ProgramVersion' => null ,
'ScriptTF' => null ,
'SqlScript1' => null ,
'FileTF' => null ,
'FilePath1' => null
);
$conn = new COM ("ADODB.Connection") or die("Cannot start ADO");
$connStr = "PROVIDER=Microsoft.Ace.OLEDB.12.0;Data Source= \UpdateDB.mdb";
$conn->open($connStr); //Open the connection to the database
if($conn){
$sql=$SqlScript ;
$user=odbc_exec($conn, $sql);
if($user && mysql_num_rows($user) > 0) {
$user = mysql_fetch_assoc($user);
}
odbc_close($conn);
$result['ID'] = $user['ID'];
$result['ProgeramName'] = $user['ProgeramName'];
$result['ProgramVersion'] = $user['ProgramVersion'];
$result['ScriptTF'] = $user['ScriptTF'];
$result['SqlScript1'] = $user['SqlScript1'];
$result['FileTF'] = $user['FileTF'];
$result['FilePath1'] = $user['FilePath1'];
return $result;
//$conn->close();
}
}
$HTTP_RAW_POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : '';
$server->service($HTTP_RAW_POST_DATA);
exit();
?>
حرف شما درست والی من باید یک دستور اس کیو ال بدم با نام تیبل و یک کلمه کلیدی
بعد اون اسکریپت رو اجرا میکنه روی دیتا بیس و اگر نیاز بود خروجی رو میده
ویژوال که میگه خطا مربوط به باز نشدن کانکشن هست
conn->open($connStr); //Open the connection to the database
میگه فایل رو نمیتونه تو این مسیر پیدا کنه
Could not find file 'C:\wamp\bin\apache\Apache2.2.17\UpdateDB.mdb
بانک اطلاعاتی کنار فایل ایندکس هست مسیر دهی رو غلط دادم