The solution was found in a comment on the main php.net SOAP page. I
needed to do:
ini_set("soap.wsdl_cache_enabled","0");
because my IsSomething function used to be just a single parameter
function and I changed it to a two parameter function. Apparently,
the old WSDL file had been cached and I needed to tell PHP to reload
the WSDL file.
On Feb 23, 2007, at 4:38 PM, Eric Gorr wrote:
Sorry, slight correct, the problem is that the text I enter for the
'a_number' parameter shows up in the $challenge_string variable.
The text I enter for the 'challenge_string' parameter simple
disappears into thin air once it hits the SOAP Server...although, I
can see it in the Raw SOAP request using both SOAP Client and
Wireshark.
On Feb 23, 2007, at 4:24 PM, Eric Gorr wrote:
My wsdl file is at the end of this message.
I am using SOAP Client (http://scan.dalo.us/?p=29) to test with
and according to this handy application, my WSDL file is valid and
it parses correctly.
Basically, the function 'IsSomething' has two parameters. Using
SOAP Client, I fill in values for the two parameters, but only the
first one comes through on the SOAP Server side.
The SOAP Server looks like this:
<?PHP
class SomethingService {
function IsSomething( $challenge_string, $a_number ) {
throw new SoapFault( "CheckFailedFault",
"$challenge_string, $a_number",
"urn:ExampleAPI",
"Fault: The details",
'ckfl' );
}
}
$server = new SoapServer( "something.wsdl" );
$server->setClass( "SomethingService" );
$server->handle();
?>
When I examine the response, I only see the text I entered for
$challenge_string.
Any idea what I am doing wrong and how to fix it? I'd like to
assume this isn't a bug in PHP 5.2.0 and that I am just missing
something, but what I am missing has escaped me for the moment.
Thank you.
<?xml version ='1.0' encoding ='UTF-8' ?>
<definitions name='Test'
targetNamespace='http://mycompany.net/Test'
xmlns:tns='http://mycompany.net/Test'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
<message name='submitSomething'>
<part name='a_number' type='xsd:string'/>
</message>
<message name='getSubmitSomethingResponse'>
<part name='Result' type='xsd:boolean'/>
</message>
<message name='checkSomething'>
<part name='challenge_string' type='xsd:string'/>
<part name='a_number' type='xsd:string'/>
</message>
<message name='getCheckSomethingResponse'>
<part name='Result' type='xsd:boolean'/>
</message>
<message name='CheckFailedFault'>
<part name='CheckFailedFault' element='tns:CheckFailedFault'/>
</message>
<portType name='TestPortType'>
<operation name='Something'>
<input message='tns:submitSomething'/>
<output message='tns:getSubmitSomethingResponse'/>
</operation>
<operation name='IsSomething'>
<input message='tns:checkSomething'/>
<output message='tns:getCheckSomethingResponse'/>
<fault name='ckfl' message='tns:CheckFailedFault'/>
</operation>
</portType>
<binding name='TestBinding' type='tns:TestPortType'>
<soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='Something'>
<soap:operation soapAction='urn:mycompany_Test#Something'/>
<input>
<soap:body use='encoded' namespace='urn:mycompany_Test'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body use='encoded' namespace='urn:mycompany_Test'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>
<operation name='IsSomething'>
<soap:operation soapAction='urn:mycompany_Test#IsSomething'/>
<input>
<soap:body use='encoded' namespace='urn:mycompany_Test'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body use='encoded' namespace='urn:mycompany_Test'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>
</binding>
<service name='TestService'>
<port name='TestPort' binding='tns:TestBinding'>
<soap:address location='http://192.168.1.222/~Eric/Test/
TestSoapServer.php'/>
</port>
</service>
</definitions>
--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php