I must admit... I registered to this forum hoping to get an answer on the following question. I'm working on it for several days now and I'm becoming quite desperate...
Here's the deal:
I have a strange procedure '' not present SOAPFault when invoking a SOAP server on PHP 5.
I got the following WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="test"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="test" name="test">
<types>
<xsd:schema targetNamespace="test" xmlns:tns="test">
<xsd:element name="text1" type="xsd:string"></xsd:element>
<xsd:element name="text2" type="xsd:string"></xsd:element>
</xsd:schema>
</types>
<message name="Request">
<part name="header" element="tns:text1"/>
<part name="body" element="tns:text2"/>
</message>
<message name="Response">
<part name="header" element="tns:text1"/>
<part name="body" element="tns:text2"/>
</message>
<message name="Fault">
<part name="body" element="tns:text1"/>
</message>
<portType name="ServicePortType">
<operation name="operation">
<input message="tns:Request"/>
<output message="tns:Response"/>
<fault name="foutmelding" message="tns:Fault"/>
</operation>
</portType>
<binding name="SoapBinding" type="tns:ServicePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="operation">
<soap:operation/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="foutmelding"/>
</operation>
</binding>
<service name="Service">
<port name="ServiceSoapPort" binding="tns:SoapBinding">
<soap:address location="http://localhost/VoI/testserver.php"/>
</port>
</service>
</definitions>
This WSDL validates just fine...
Next I created the following testserver in PHP.
<?php
$server = new SoapServer("webservice/wsdl/test.wsdl");
$server->setClass("testClass");
$server->handle();
class testClass {
function operation($input) {
return array ("text1", "text2");
}
}
?>
When I call this server I get the following error message.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Procedure 'text1' not present</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The corresponding request message looks as follows:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:test="test">
<soapenv:Header/>
<soapenv:Body>
<test:text1>?</test:text1>
<test:text2>?</test:text2>
</soapenv:Body>
</soapenv:Envelope>
Everything works just fine when I alter the WSDL so that the request message only contains one part element. The request than, is as follows:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:test="test">
<soapenv:Header/>
<soapenv:Body>
<test:text2>?</test:text2>
</soapenv:Body>
</soapenv:Envelope>
And the result:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test">
<SOAP-ENV:Body>
<ns1:text1>text1</ns1:text1>
<ns1:text2>text2</ns1:text2>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
So it looks like there is a problem in how the request message is handled by the soapserver. I've searched and searched online but that didn't bring me any further. I find one bulletin message very often but that was solved with a restart. Didn't help for me...
I've also read about an error when a function is called without input parameters, which is not the case (I think.
I've tried to add to functions, text1 and text2 but that didn't work either.
I hope there is someone out there who can help me. I'm becoming quite desperate so to speak 🙂...