';
if(class_exists(SoapClient))
{
$soapCheck .= "
SOAP Erweiterung existiert
";
}
else
{
$soapCheck .= "
SOAP Erweiterung fehlt!
";
}
if(LIBXML_VERSION>=20540)
{
$soapCheck .= "
libXML version '".LIBXML_DOTTED_VERSION."' OK
";
}
else
{
$soapCheck .= "
libXML version '".(LIBXML_DOTTED_VERSION )."' nicht OK
";
}
// Check ob eine wsdl Datei gefunden werden kann
//$wsdlfile = ;
ini_set("allow_url_fopen", 1);
if (!fopen($path2wsdl,"r"))
{
$soapCheck .= "
Der Pfad zur WSDL Datei ist nicht korrekt oder die WSDL Datei fehlt!
";
}
else
{
$soapCheck .= "
WSDL Datei konnte gefunden werden
";
}
$soapCheck .= "
";
return $soapCheck;
}
//// We initiate a SOAPclient Object and give the ssl-certificate, if wished:
//$cert = 'D:\\xampp\apache\privkey.pem';
if(isset($cert) && $cert!="")
{
ini_set("allow_url_fopen", 1);
$file = fopen($wsdl,"r");
if(class_exists(SoapClient) && $file!=FALSE)
{
/**
* TODO: no documentation in PHP manual... no doc here... Can't tell you what to do in order to get Communication working with fixed Certificates
* Can't even say, which certificates, how they have to be (.pem, .crt, .key etc.?)
* Own Microkosmos for Geeks only... Sad truth...
*/
$context = array(
'ssl'=> array(
'verify_peer' => false,
'allow_self_signed' => true,
'local_cert' => $cert
)
);
$stream_context = stream_context_create($context);
$client = new SoapClient($wsdl, array('soap_version' => SOAP_1_1,
'trace' => 1,
'stream_context' => $stream_context
));
}
}
else
{
ini_set("allow_url_fopen", 1);
$file = fopen($wsdl,"r");
if(class_exists(SoapClient) && $file!=FALSE)
{
$client = new SoapClient($wsdl, array('soap_version' => SOAP_1_1,
'trace' => 1));
}
}
if($file!=FALSE)
{
try
{ $mods = $client->sAvailableModules($user, "password", "mod");}
catch (SoapFault $fault)
{ $mods .= "SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";}
}
if($file!=FALSE)
{
try
{ $cores = $client->sAvailableModules($user, "password", "core");}
catch (SoapFault $fault)
{ $cores .= "SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";}
}
$iVid = $_REQUEST['sid'];
//$sVbes = utf8_encode($sVbes);
//$user = $_REQUEST['user'];
//$pass = $_REQUEST['password'];
// Calling the desired function //XXX
reset($_REQUEST);
while(list($key, $value) = each($_REQUEST))
{
if(substr($key,0,8)=="sendMail")
{
$iVid = $_REQUEST['sid'];
$sType = $_REQUEST['type'];
$maxemails = $_REQUEST['maxemails'];
$subject = $_REQUEST['subject'];
$mailText = $_REQUEST['mailText'];
try
{
$sReturn = $client->sSendEmail($user, $pass, $iVid, $sType, $maxemails, $subject, $mailText);
}
catch (SoapFault $fault)
{
$sOutput .= " SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";
}
//these are just outputs for testing
$sOutput .= "Return : ". $sReturn;
}
if(substr($key,0,8)=="getField")
{
$iVid = $_REQUEST['sid'];
try
{
$sReturn = $client->sGetFieldmap($user, $pass, $iVid);
}
catch (SoapFault $fault)
{
$sOutput .= " SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";
}
//these are just outputs for testing
$sOutput .= "Return : ". $sReturn;
}
if(substr($key,0,9)=="delsurvey")
{
$iVid = $_REQUEST['sid'];
//$sMod = $_REQUEST['mod'];
try
{
$sReturn = $client->sDeleteSurvey($user, $pass, $iVid);
}
catch (SoapFault $fault)
{
$sOutput .= " SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";
}
//these are just outputs for testing
$sOutput .= "Return : ". $sReturn;
}
if(substr($key,0,9)=="impMatrix")
{
$iVid = $_REQUEST['sid'];
// $sMod = $_REQUEST['mod'];
// $qTitle = $_REQUEST['title'];
$qText = $_REQUEST['quest'];
$mandatory = $_REQUEST['mandatory'];
for($n=1;$n<10;++$n)
{
if($_REQUEST['item'.$n]!='')
{
if($n==1)
{
$items = $_REQUEST['item'.$n];
}
else
{
$items .= ",".$_REQUEST['item'.$n];
}
}
}
$qHelp = $_REQUEST['help'];
try
{
$sReturn = $client->sImportMatrix($user, $pass, $iVid, $qTitle, $qText, $qHelp, $items, "Matrix5", $mandatory);
}
catch (SoapFault $fault)
{
$sOutput .= " SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";
}
//these are just outputs for testing
$sOutput .= "Return : ". $sReturn;
}
if(substr($key,0,8)=="impQuest")
{
$iVid = $_REQUEST['sid'];
// $sMod = $_REQUEST['mod'];
$qTitle = $_REQUEST['title'];
$qText = $_REQUEST['quest'];
$qHelp = $_REQUEST['help'];
$mandatory = $_REQUEST['mandatory'];
try
{
$sReturn = $client->sImportFreetext($user, $pass, $iVid, $qTitle, $qText, $qHelp, "Freitext", $mandatory);
}
catch (SoapFault $fault)
{
$sOutput .= " SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";
}
//these are just outputs for testing
$sOutput .= "Return : ". $sReturn;
}
if(substr($key,0,8)=="impGroup")
{
$iVid = $_REQUEST['sid'];
$sMod = $_REQUEST['mod'];
$sGroupName = $_REQUEST['groupName'];
$sGroupDescription = $_REQUEST['groupDescription'];
try
{
$sReturn = $client->sImportGroup($user, $pass, $iVid, $sMod, $sGroupName, $sGroupDescription);
}
catch (SoapFault $fault)
{
$sOutput .= " SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";
}
//these are just outputs for testing
$sOutput .= "Return : ". $sReturn;
}
if(substr($key,0,8)=="activate")
{
$iVid = $_REQUEST['sid'];
$dStart = $_REQUEST['start'];
$dEnd = $_REQUEST['end'];
if(isset($dStart) && $dStart!='')
{
$sUseStart='Y';
}
if(isset($dEnd) && $dEnd!='')
{
$sUseEnd='Y';
}
try
{
$sReturn = $client->sActivateSurvey($user, $pass, $iVid, $dStart, $dEnd);
}
catch (SoapFault $fault)
{
$sOutput .= " SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";
}
//these are just outputs for testing
$sOutput .= "Return : ". $sReturn;
}
if(substr($key,0,6)=="submit")
{
//$functionToCall = "sCreateSurvey";
$iVid = $_REQUEST['sid'];
$sVbes = $_REQUEST['sdes'];
$sVtit = $_REQUEST['stit'];
$sVwel = $_REQUEST['sVwel'];
$sVend = $_REQUEST['sVend'];
$sMail = $_REQUEST['sEmail'];
$sName = $_REQUEST['sName'];
$sUrl = $_REQUEST['sUrl'];
$sUbes = $_REQUEST['sUdes'];
$sVtyp = $_REQUEST['core'];
try
{
$sReturn = $client->sCreateSurvey($user, $pass, $iVid, $sVtit , $sVbes, $sVwel, $sVend, $sMail, $sName, $sUrl, $sUbes, $sVtyp);
}
catch (SoapFault $fault)
{
$sOutput .= " SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";
}
//these are just outputs for testing
$sOutput .= "Return : ". $sReturn;
}
if(substr($key,0,6)=="change")
{
$table = $_REQUEST['table'];
$key = $_REQUEST['key'];
$value = $_REQUEST['value'];
$where = $_REQUEST['whereKey'];
$mode = $_REQUEST['mode'];
//$whereValue = $_REQUEST['whereValue'];
try
{
$sReturn = $client->sChangeSurvey($user, $pass , $table, $key, $value, $where, $mode);
}
catch (SoapFault $fault)
{
$sOutput .= " SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";
}
//these are just outputs for testing
$sOutput .= "Return : ". $sReturn;
}
if(substr($key,0,6)=="tokens")
{
$sToken = $_REQUEST['token'];
try
{
$sReturn = $client->sInsertToken($user, $pass, $iVid, $sToken );
}
catch (SoapFault $fault)
{
$sOutput .= " SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";
}
//this are just outputs for testing
$sOutput .= "Return : ". $sReturn;
}
if(substr($key,0,6)=="tokRet")
{
//$functionToCall = "sTokenReturn";
try
{
$sReturn = $client->sTokenReturn($user, $pass, $iVid);
}
catch (SoapFault $fault)
{
$sOutput .= " SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";
}
//this are the return Values
$sOutput .= "Return : ['return'] => ". $sReturn;
}
if(substr($key,0,6)=="insPar")
{
$sParticipantData = $_REQUEST['sParticipantData'];
try
{
$sReturn = $client->sInsertParticipants($user, $pass, $iVid, $sParticipantData);
}
catch (SoapFault $fault)
{
$sOutput .= " SOAP Error: ".$fault->faultcode." : ".$fault->faultstring." ";
}
//these are just outputs for testing
$sOutput .= "Return : ". $sReturn;
}
}
if(isset($sReturn))
{
$sOutput .=" Dumping request headers :"
.$client->__getLastRequestHeaders()." ";
$sOutput .="Dumping request :".htmlentities($client->__getLastRequest())."";
$sOutput .=" Dumping response headers :"
.$client->__getLastResponseHeaders()." ";
$sOutput .=" Dumping response :".htmlentities($client->__getLastResponse())."";
//$resp[] = $client->__getLastResponse();
// echo $resp['resParam'];
}
?>
Client object functions: (As given in the wsdl file. Functions could be disabled or else on the serverside. There is no guarantee the functions really have these Params nor that the functions exist on the serverside.) ";
if($file!=FALSE)
{
$funcs=$client->__getFunctions();
foreach($funcs as $func)
{
echo '';
print_r($func);
echo '
';
}
}
}
if(isset($sOutput))
{
echo '';
echo '
testing output: ';
if(isset($iVid))
{
echo "
test Survey ";
}
echo $sOutput;
echo '
';
}
?>
sCreateSurvey function
sActivateSurvey function
' method='post'>* VeranstaltungsID / SurveyID:
Startdate (YYYY-MM-DD):
Enddate (YYYY-MM-DD):
" ?>
sDeleteSurvey function (attention: no safetyquestion is asked!)
' method='post'>* VeranstaltungsID / SurveyID:
" ?>
sImportGroup function
' method='post'>* VeranstaltungsID / SurveyID (have to be Integer):
* Question group to add (INF,BIO,BWL is
there for testing):
".$aMods[$n]."";}
?>
//print_r($mods);?>
Name of the group:
groupDescription:
" ?>
sImportQuestion
' method='post'>* VeranstaltungsID / SurveyID (have to be Integer):
Mandatory
* Question Title :
* Question:
Helptext:
" ?>
sImportMatrix
' method='post'>* VeranstaltungsID / SurveyID (have to be Integer):
Mandatory
* Question :
Item {$n} : ",
" ",
" ";
}
?> Helptext:
" ?>
sChangeSurvey function
( this is not part of the lsrc, it just shows the power of it, it has to be activated in server.php on line ~60 )
' method='post'>
update
insert
Table to change
Key
Value
where Condition
";
echo "";
echo "
sTokenReturn function ";
echo "";
echo "* VeranstaltungsID / SurveyID (have to be Integer): ";
echo " ";
echo " ";
echo " ";
echo " ";
echo "";
echo "";
echo "";
//phpinfo();
?>