This commit is contained in:
Karl Burkhart
2011-09-08 14:35:50 +00:00
parent 89c5c25da0
commit 57e6dc3731
2 changed files with 135 additions and 0 deletions
+80
View File
@@ -0,0 +1,80 @@
<?php
/* Copyright (C) 2010 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Karl Burkhart <burkhart@technikum-wien.at>.
*/
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0, pre-check=0",false);
header("Expires Mon, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
require_once('../config/vilesci.config.inc.php');
require_once('../include/basis_db.class.php');
require_once('../include/ressource.class.php');
require_once('../include/datum.class.php');
$SOAPServer = new SoapServer(APP_ROOT."/soap/ressource.wsdl.php?".microtime());
$SOAPServer->addFunction("saveRessource");
$SOAPServer->handle();
// WSDL Chache auf aus
ini_set("soap.wsdl_cache_enabled", "0");
/**
*
* Speichert die Ressource
* @param unknown_type $ressource_id
* @param unknown_type $bezeichnung
* @param unknown_type $beschreibung
* @param unknown_type $mitarbeiter_uid
* @param unknown_type $student_uid
* @param unknown_type $betriebsmittel_id
* @param unknown_type $firma_id
* @param unknown_type $user
*/
function saveRessource($ressource_id, $bezeichnung, $beschreibung, $mitarbeiter_uid, $student_uid, $betriebsmittel_id, $firma_id, $user)
{
$ressource = new ressource();
if($ressource_id!='')
{
$ressource->load($ressource_id);
$ressource->new = false;
}
else
{
$ressource->new = true;
$ressource->insertvon = $user;
}
$ressource->ressource_id=$ressource_id;
$ressource->bezeichnung=$bezeichnung;
$ressource->beschreibung=$beschreibung;
$ressource->mitarbeiter_uid = $mitarbeiter_uid;
$ressource->student_uid = $student_uid;
$ressource->betriebsmittel_id = $betriebsmittel_id;
$ressource->firma_id = $firma_id;
$ressource->updatevon = $user;
if($ressource->save())
return $ressource->ressource_id;
else
return new SoapFault("Server", $ressource->errormsg);
}
?>
+55
View File
@@ -0,0 +1,55 @@
<?php
require_once('../config/vilesci.config.inc.php');
header("Content-type: text/plain");
echo "<?xml version='1.0' encoding='utf-8' ?>";
?>
<wsdl:definitions name="Ressource"
targetNamespace="http://localhost/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://localhost/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsd1="http://localhost/soap/ressource.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:message name="SaveRessourceRequest">
<wsdl:part name="ressource_id" type="xsd:int"></wsdl:part>
<wsdl:part name="bezeichnung" type="xsd:string"></wsdl:part>
<wsdl:part name="beschreibung" type="xsd:string"></wsdl:part>
<wsdl:part name="mitarbeiter_uid" type="xsd:string"></wsdl:part>
<wsdl:part name="student_uid" type="xsd:string"></wsdl:part>
<wsdl:part name="betriebsmittel_id" type="xsd:int"></wsdl:part>
<wsdl:part name="firma_id" type="xsd:int"></wsdl:part>
<wsdl:part name="user" type="xsd:string"></wsdl:part>
</wsdl:message>
<wsdl:message name="SaveRessourceResponse">
<wsdl:part name="message" type="xsd:string"></wsdl:part>
</wsdl:message>
<wsdl:portType name="ConfigPortType" >
<wsdl:operation name="saveRessource">
<wsdl:input message="tns:SaveRessourceRequest"></wsdl:input>
<wsdl:output message="tns:SaveRessourceResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ConfigBinding" type="tns:ConfigPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="saveRessource">
<soap:operation soapAction="<?php echo APP_ROOT."soap/saveRessource";?>" />
<wsdl:input>
<soap:body use="encoded" namespace="http://localhost/soap/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://localhost/soap/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Ressource">
<wsdl:port name="ConfigWebservicePort" binding="tns:ConfigBinding">
<soap:address location="<?php echo APP_ROOT."soap/ressource.soap.php";?>"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>