Quote: S. Dûsel (snduesel) wrote on Thu, 14 August 2014 22:48
----------------------------------------------------
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

----------------------------------------------------

'http://localhost/typo3_624_plain/index.php&type=999', wurde auf 
'http://localhost/typo3_624_plain/index.php?type=999', geändert. Jetzt erhalte ich 
die Fehlermeldung: : Uncaught SoapFault exception: [Client] looks like we got no 
XML document in  ...
_______________________________________________
TYPO3-german mailing list
TYPO3-german@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german

Antwort per Email an