diff --git a/modules/packages/code/webservice.ext.php b/modules/packages/code/webservice.ext.php new file mode 100644 index 000000000..4ed0f948a --- /dev/null +++ b/modules/packages/code/webservice.ext.php @@ -0,0 +1,64 @@ +RawXMWSToArray($this->wsdata); + $contenttags = $this->XMLDataToArray($request_data['content']); + $allpackages=array(); + $response_xml = "\n"; + if(!is_null($contenttags['uid'])) { + + $allpackages=module_controller::ListPackages($contenttags['uid']); + } + else + { + $allpackages=module_controller::ListPackages(1); + } + foreach ($allpackages as $package) { + $response_xml = $response_xml . ws_xmws::NewXMLContentSection('packages', array( + 'id' => $package['packageid'], + 'pakage' => $package['packagename'] + )); + } + $dataobject = new runtime_dataobject(); + $dataobject->addItemValue('response', ''); + $dataobject->addItemValue('content', $response_xml); + return $dataobject->getDataObject(); + + + } + public function GetPackageId(){ + $request_data = $this->RawXMWSToArray($this->wsdata); + $contenttags = $this->XMLDataToArray($request_data['content']); + $packageId=0; + $response_xml = "\n"; + $allpackages=module_controller::ListPackages(1); + foreach ($allpackages as $package) { + if($package['packagename']===$contenttags['pakagename']) + { + $packageId=$package['packageid']; + } + } + $response_xml = $response_xml . ws_xmws::NewXMLContentSection('pakageid',$packageId ); + $dataobject = new runtime_dataobject(); + $dataobject->addItemValue('response', ''); + $dataobject->addItemValue('content', $response_xml); + return $dataobject->getDataObject(); + + } + +}