Hier even de opzet:
XML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| <wsdl:types> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="bleh"> <xsd:complexType name="blendFormType"> <xsd:sequence> <xsd:element name="datetime" type="xsd:dateTime" maxOccurs="1" minOccurs="1"> </xsd:element> <xsd:element name="product" type="xsd:string" maxOccurs="1" minOccurs="0"> </xsd:element> </xsd:sequence> </xsd:complexType> <xsd:element name="blendForm" type="o2a:blendFormType"/> </xsd:schema> </wsdl:types> <wsdl:message name="postBlendFormRequest"> <wsdl:part name="parameters" element="o2a:blendForm"/> </wsdl:message> <wsdl:portType name="O2A"> <wsdl:operation name="postBlendForm"> <wsdl:input message="o2a:postBlendFormRequest"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="O2ASOAP" type="o2a:O2A"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="postBlendForm"> <soap:operation soapAction="postBlendForm" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> </wsdl:operation> </wsdl:binding> |
De client code is triviaal, en stuurt het volgende bericht:
XML:
1
2
3
4
5
6
7
8
9
| <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="bleh"> <SOAP-ENV:Body> <ns1:blendForm> <datetime>2000-04-06T12:13:37</datetime> <product>24/1</product> </ns1:blendForm> </SOAP-ENV:Body> </SOAP-ENV:Envelope> |
Met als header "SOAPAction: postBlendForm"
So far so good lijkt mij! Nu de server code
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| class BlendForm { public $datetime; public $product; public function __construct () { echo 'BlendForm constructor!' . "\n"; } } class SOAPHandler { public function __construct () { echo 'SOAPHandler constructor!' . "\n"; } public function postBlendForm ( $param ) { echo 'postBlendForm: '; var_export($param); echo "\n"; } } ini_set('soap.wsdl_cache_enabled', 0); // disabling WSDL cache $ar_classMap = array( 'blendForm' => 'BlendForm' ); $server = new SoapServer( 'bleh.wsdl', array( 'classmap' => $ar_classMap ) ); $server->setClass("OracleSOAPHandler"); $server->handle(); |
De server code wordt gewoon aangeroepen (als ik file_get_contents('php://input') log krijg ik het SOAP bericht te zien), maar verder krijg ik geen output (de constructors en de postBlendForm functie worden niet aangeroepen).
Als ik de SOAPHandler::postBlendForm functie een andere naam geef, doet de server helemaal niets (geen log; denk dat hij crasht, Fatal Error of zo) - dus blijkbaar doet PHP wel wat aan mapping.
Ik heb het ook al geprobeerd met een simpele $server-addFunction() (dus zonder classes), en ook daar gebeurt er niets.
RPC / literal had ik al werkend, maar het moet document / literal (wrapped) zijn.
Enig idee hoe ik dit beter kan debuggen, of wat het probleem is?
ASCII stupid question, get a stupid ANSI!