Two parameter SOAP function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux