SOAP ... ohne coMate möglich ? Oder Hilfe mit coMate ...

Anfängerfragen zum Programmieren mit PureBasic.
Benutzeravatar
Bisonte
Beiträge: 2468
Registriert: 01.04.2007 20:18

SOAP ... ohne coMate möglich ? Oder Hilfe mit coMate ...

Beitrag von Bisonte »

Hallo...

Ich frage mal nach, ob es möglich ist, ohne coMate (bin ich zu blöd zu ;) ) mit einer SOAP Schnittstelle per PB zu kommunizieren ?

Eine dll mit Dokumentation wäre schon hilfreich. Was ich per Google bisher fand, waren "leicht" veraltete (und eigentlich für Linux) Dll's... und dann auch noch ohne Doku der Funktionen...

Im Moment läuft meine Kommunikation über ein PHP Skript das angesprochen wird, was ich aber aus Sicherheitsgründen nicht mehr machen möchte.

Für jeden Tip bin ich dankbar.
Zuletzt geändert von Bisonte am 19.07.2010 17:59, insgesamt 1-mal geändert.
PureBasic 6.21 (Windows x86/x64) | Windows11 Pro x64 | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | GeForce RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
Benutzeravatar
Kiffi
Beiträge: 10714
Registriert: 08.09.2004 08:21
Wohnort: Amphibios 9

Re: SOAP ... ohne coMate möglich ?

Beitrag von Kiffi »

Bisonte hat geschrieben:Ich frage mal nach, ob es möglich ist, ohne coMate (bin ich zu blöd zu ;) ) mit einer SOAP Schnittstelle per PB zu kommunizieren ?
mit libCurl [1] dürfte das funktionieren. Dafür bin ich wiederum zu blöd. ;-)

Grüße ... Kiffi

[1]: Wrapper von progi1984 unter http://code.google.com/p/rwrappers/
a²+b²=mc²
Benutzeravatar
Bisonte
Beiträge: 2468
Registriert: 01.04.2007 20:18

Re: SOAP ... ohne coMate möglich ? oder doch nicht ?

Beitrag von Bisonte »

Danke... aber oha... das ist ja ... naja... also eigentlich, so wie es diese Lib zulässt wohl nur ein Ersatz für die PB eigene HTTP und FTP Lib...

Leider kein SOAP.

Aber vielleicht kriegen wir das zusammen mit coMate hin ?

also in php sieht die funktion,die die Soap anfrage macht, so aus :

Code: Alles auswählen

function ExecuteSoapCommand($command)
{
	global $settings;
	//Setup SOAP Client
	$client = new SoapClient(NULL,
	array(
		"location" => "http://".$settings['IP'].":".$settings['PORT']."/",
		"uri" => "urn:GaMeSERVER",
		"style" => SOAP_RPC,
		"login" => $settings['USERNAME'],
		"password" => $settings['PASSWORD'],
	));

	try //Try to execute function
	{
		$result = $client->executeCommand(new SoapParam($command, "command"));
	}
	catch(Exception $e) //Don't give fatal error if there is a problem
	{
		_LogSoapError($e);
		return array('sent'=>false, 'message'=>$e->getMessage());
	}
	return array('sent'=>true, 'message'=>$result);
}
function _LogSoapError($e)
{
	global $settings;
	$date = date('D d/m/Y'); $time = date('G:i:s'); $ip = $_SERVER['REMOTE_ADDR'];
	$error = $e->getMessage();
	$errorcode = $e->getCode();
	$file = $e->getFile();
	$line = $e->getLine();
	
$errorstring = "\r\n
|----------------------------SOAP Command Error-----------------------------------
|Date: $date, Time: $time, From: $ip
|Com : $command
|Where: $file(Line: $line) Error Code: $errorcode
|Error: $error
|----------------------------SOAP Command Error-----------------------------------";

	//IF $debug == true the error will be shown in HTML
	if($settings['DEBUG']==true)
	{
		print $errorstring;
	}
}
Wie müsste dann der coMate Abschnitt aussehen ? Wie gesagt, von coMate hab ich keinen Plan, nichtmal im Ansatz (OOP?)
Bisher sind alle Versuche meinerseits mit der coMate oder auch coMatePlus im IMA geendet.
PureBasic 6.21 (Windows x86/x64) | Windows11 Pro x64 | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | GeForce RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
Antworten