First let me say that I have searched the net all over but I cannot find an answer, that is why I am trying here hoping some of you PHP gurus might know something
I work as a PHP programmer and recently I got the task of connecting (using PHP5) to a .NET webservice using wsdl and datasets. Now, after a week of frustration and hard work I am really stuck.
Here is my problem. My task is to save user variables in the webservice using a method called ‘Save’. I can connect fine and also generate the required ID for the operation, the problem comes when I try to save the variables, I can create the dataset via a method called GetNew but how can I access it after creating it? If I assign a variable to the GetNew call I get a fairly large array, but populating it and sending it into the webservice won’ work.
I guess what I am trying to ask is if it is possible to use, in PHP, a remote .NET webservice using datasets to save rows in its database.
Here is my code:
I connect to the webservice using NuSOAP:
Code: Select all
$url = 'http://webservice.address.here.com/WebService/folder/Main.asmx?wsdl';
$client = new soapclient($url, true);Code: Select all
$headers = '<SoapAuthenticator xmlns="'http://webservice.address.here.com/WebService/folder/"><UserId>xxxx</UserId><Password>xxxxx</Password></SoapAuthenticator>';
$client->setHeaders($headers);Code: Select all
$GetID = array('strGIDPrefix'=>$adr);
$GID = $client->call('GenerateSFDDBGID', array('parameters'=>$GetID));Code: Select all
DataSet dsCKDB = ws.GetNew("DATASET_IDENTIFIER");Code: Select all
$param_init= ' DATASET_IDENTIFIER';
$GetNew = array('strTransactionId'=>$param_init);
$ds = $client->call('GetNew', array('parameters'=>$GetNew));Code: Select all
//New row
DataRow drLogCKDB = dsCKDB.Tables["Log"].NewRow();rest of the .NET code here:
Code: Select all
//Add extern source values
drLogCKDB["AdrGID"] = "XXXXXXXXXXXXXXXXXXXXX";
drLogCKDB["Datum"] = DateTime.Now;
drLogCKDB["Text"] = "CKDB WS Devnet - " + DateTime.Now.ToString();
drLogCKDB["ClassGID"] = "CLS_LOG_FRITEXT";
//Add Row
dsCKDB.Tables["Log"].Rows.Add(drLogCKDB);
//Save
dsCKDB = ws.Save("DATASET_IDENTIFIER ", intDBSpace, dsCKDB);Have a nice day
Best regards
/Fredrik