It seems that in your generated php code you use mysqli::init() where
you should use mysqli_init();
This is causes me to not be able to use the "Test Web Services" page
in the RISE Editor.
P.S. The "Multiple Root Nodes" problem, seems to be related to a
missing prefix.config.php file!
It was a silly mistake on my part, I originally generated my PHP files
to one folder, where I had created a config file, but subsequently
decided to generate them to a different folder, and neglected to
transfer the config file along with. You might want to consider
improving your error messages, or providing a step-by-step guide for
PHP users.
Ambiguous Messages:
If the prefix.config.php file is missing or in the wrong folder the
message you get from the "Test Web Services Page" is:
"There are multiple root elements. Line 2, position 2."
If the file is present but the information in it is incorrect, then
you get the message:
Bad Gateway
If the file is present and correct, but you are using a version of PHP
more recent than 5.0.0 then you get:
The remote server returned an error (500) Internal Server Error.
(which - for me - is because of "mysqli::init()")
If the mysqli::init() is changed to mysqli_init()
Then it will work for my modern (5.3) PHP implementation.
http://stackoverflow.com/questions/2398728/non-static-method-mysqliinit-cannot-be-called-statically
Auto-generated PHP:
public function NewParameter($InterfaceID, $Name, $Type, $Description,
$Sequence)
{
if(is_null($InterfaceID))
throw new Exception('ArgumentNullException: InterfaceID');
if(is_null($Name))
throw new Exception('ArgumentNullException: Name');
if(is_null($Type))
throw new Exception('ArgumentNullException: Type');
if(is_null($Description))
throw new Exception('ArgumentNullException: Description');
if(is_null($Sequence))
throw new Exception('ArgumentNullException: Sequence');
$sql_stmt = 'INSERT INTO "t_SR_u_Parameter"("c_u_Name", "c_u_Type",
"c_u_Description", "c_u_Sequence", "c_r_Interface") VALUES (?, ?, ?, ?, ?)';
$mysqli_stmt = $this->ConnectionResource->prepare($sql_stmt);
if($mysqli_stmt===FALSE)
throw new Exception($sql_stmt.': prepare statement failed:
'.$this->ConnectionResource->error);
try
{
if(!$mysqli_stmt->bind_param('isssi', $InterfaceID, $Name, $Type,
$Description, $Sequence))
throw new Exception('Bind parameters failed: '.$mysqli_stmt->error);
if(!$mysqli_stmt->execute())
throw new Exception($sql_stmt.': '.$mysqli_stmt->error);
$mysqli_stmt->close();
}
catch(Exception $e)
{
$mysqli_stmt->close();
throw $e;
}
$sql_stmt = 'SELECT LAST_INSERT_ID()';
$mysqli_stmt = $this->ConnectionResource->prepare($sql_stmt);
if($mysqli_stmt===FALSE)
throw new Exception($sql_stmt.': prepare statement failed:
'.$this->ConnectionResource->error);
try
{
if(!$mysqli_stmt->execute())
throw new Exception($sql_stmt.': '.$mysqli_stmt->error);
if((!$mysqli_stmt->store_result())||(!$mysqli_stmt->bind_result($rv)))
throw new Exception('Unable to store or bind results of query:
'.$mysqli_stmt->error);
$mysqli_stmt->fetch();
$rv = ((int)$rv);
$mysqli_stmt->close();
}
catch(Exception $e)
{
$mysqli_stmt->close();
throw $e;
}
return $rv;
}
// The Problem - Taken From Above:
// Parameter Order: Name, Type, Description, Sequence, Interface
$sql_stmt = 'INSERT INTO "t_SR_u_Parameter"("c_u_Name", "c_u_Type",
"c_u_Description", "c_u_Sequence", "c_r_Interface") VALUES (?, ?, ?, ?, ?)';
// Parameter Order: Interface, Name, Type, Description, Sequence
if(!$mysqli_stmt->bind_param('isssi', $InterfaceID, $Name, $Type,
$Description, $Sequence))
This causes an invalid foreign key error.
Please let me know if there is a workaround for this problem.
We are investigating all of these problems and will get back in this
forum as soon as we have a solution ready for use.
If you encounter any other problems with it, please, let us know. Your
feedback is very valuable to us!
Best regards,
Joar