[TYPO3-german] SOAP und Typo3

S. Dûsel steffen.duesel at gmail.com
Thu Aug 14 22:48:31 CEST 2014


Hallo liebe Community,

was muss ich alles machen um eine TYPO3-Extension als SOAP-Server zu definieren?

Quellcode SOAP-Server (Fe-Plugin - showAction):

class ExampleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {

	public function showAction() {
           $options = array('uri'=>'http://localhost/soap/');
           $server = new SoapServer(NULL,$options);
           $server->setClass('MyAPI');
           $server->handle();
	}

}
class MyAPI {
    function hello() {
        return "Hello";
    }
}


Quellcode SOAP-Client: (localhost/soap/SoapClient.php)

$options = array('location' => 'http://localhost/typo3_624_plain/index.php&type=999',
    'uri' => 'http://localhost/');
$api = new SoapClient(NULL, $options);
echo $api->hello();


Einen Type-Num (999) habe ich bereits im TypoSccript definiert. Das schaut ungefähr so aus:
xml = PAGE
xml {
    typeNum = 999
    10 < tt_content.list.20.devtest_soaptest
}


Jetzt kommt aber folgende Fehlermeldung:

 Fatal error: Uncaught SoapFault exception: [HTTP] Not Found in C:\wamp\www\soap\SoapClient.php:14 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://localhos...', 'http://localhos...', 1, 0) #1 C:\wamp\www\soap\SoapClient.php(14): SoapClient->__call('hello', Array) #2 C:\wamp\www\soap\SoapClient.php(14): SoapClient->hello() #3 {main} thrown in C:\wamp\www\soap\SoapClient.php on line 14


Nach Beurteilungen von Wireshark gibt es auch die Richtige Antwort. Die Zeichenkodierung ist auch Utf8-ohne DOM. Ich sehe aber Leerzeichen 0D 0A, ich denke aber die haben keine Auswirkungen...

(Typo3 6.2 / 4.5 unabgängig)

-help



More information about the TYPO3-german mailing list