This commit is contained in:
Karl Burkhart
2011-08-11 11:54:19 +00:00
parent f33c576b2c
commit 485dc52ff4
2 changed files with 142 additions and 0 deletions
+85
View File
@@ -0,0 +1,85 @@
<?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/projekttask.class.php');
require_once('../include/datum.class.php');
$SOAPServer = new SoapServer(APP_ROOT."/soap/projekttask.wsdl.php");
$SOAPServer->addFunction("saveProjekttask");
$SOAPServer->handle();
// WSDL Chache auf aus
ini_set("soap.wsdl_cache_enabled", "0");
/**
*
* Speichert die vom Webservice übergebenen Parameter in die DB
* @param string $projekttask_id
* @param string $projektphase_id
* @param string $bezeichnung
* @param string $beschreibung
* @param string $aufwand
* @param string $mantis_id
* @param date $insertamum
* @param string $insertvon
* @param date $updateamum
* @param string $updatevon
*/
function saveProjekttask($projekttask_id, $projektphase_id, $bezeichnung, $beschreibung, $aufwand, $mantis_id, $insertamum, $insertvon, $updateamum, $updatevon)
{
$projekttask = new projekttask();
// wenn projekttaskt_id == leer -> neuer task anlegen ohne laden
if($projekttask_id != '')
{
if($task->load($projekttask_id)== false)
$projekttask->new = true;
else
$projekttast->new = false;
}
$projekttask = new projekttask();
$projekttask->projekttask_id=$projekttask_id;
$projekttask->projektphase_id=$projektphase_id;
$projekttask->bezeichnung=$bezeichnung;
$projekttask->beschreibung = $beschreibung;
$projekttask->aufwand = $aufwand;
$projekttask->mantis_id = $mantis_id;
$projekttask->insertamum = $insertamum;
$projekttask->insertvon = $insertvon;
$projekttask->updateamum = $updateamum;
$projekttask->updatevon = $updatevon;
if($projekttask->save($new = true))
return "OK";
else
return new SoapFault("Server", $projekttask->errormsg);
}
?>
+57
View File
@@ -0,0 +1,57 @@
<?php
require_once('../config/vilesci.config.inc.php');
header("Content-type: text/plain");
echo "<?xml version='1.0' encoding='utf-8' ?>";
?>
<wsdl:definitions name="Projekttask"
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/projekttask.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:message name="SaveProjekttaskRequest">
<wsdl:part name="projekttask_id" type="xsd:string"></wsdl:part>
<wsdl:part name="projektphase_id" type="xsd:string"></wsdl:part>
<wsdl:part name="bezeichnung" type="xsd:string"></wsdl:part>
<wsdl:part name="beschreibung" type="xsd:string"></wsdl:part>
<wsdl:part name="aufwand" type="xsd:string"></wsdl:part>
<wsdl:part name="mantis_id" type="xsd:string"></wsdl:part>
<wsdl:part name="insertamum" type="xsd:string"></wsdl:part>
<wsdl:part name="insertvon" type="xsd:string"></wsdl:part>
<wsdl:part name="updateamum" type="xsd:string"></wsdl:part>
<wsdl:part name="updatevon" type="xsd:string"></wsdl:part>
</wsdl:message>
<wsdl:message name="SaveProjekttaskResponse">
<wsdl:part name="message" type="xsd:string"></wsdl:part>
</wsdl:message>
<wsdl:portType name="ConfigPortType" >
<wsdl:operation name="saveProjekttask">
<wsdl:input message="tns:SaveProjekttaskRequest"></wsdl:input>
<wsdl:output message="tns:SaveProjekttaskResponse"></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="saveProjekttask">
<soap:operation soapAction="<?php echo APP_ROOT."soap/saveProjekttask";?>" />
<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="Projekttask">
<wsdl:port name="ConfigWebservicePort" binding="tns:ConfigBinding">
<soap:address location="<?php echo APP_ROOT."soap/projekttask.soap.php";?>"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>