www.webdeveloper.com
Results 1 to 5 of 5

Thread: PHP SOAP Script and WSDL

  1. #1
    Join Date
    Dec 2008
    Posts
    5

    PHP SOAP Script and WSDL

    Hi...I have never made a PHP SOAP script before and I'm really having trouble getting it working.My client script,server script and WSDL are all in the root of my web server.Could someone please tell me why I get this error:

    Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in C:\xampp\htdocs\client.php:7 Stack trace: #0 [internal function]: SoapClient->__call('getUpdate', Array) #1 C:\xampp\htdocs\client.php(7): SoapClient->getUpdate('doggy') #2 {main} thrown in C:\xampp\htdocs\client.php on line 7

    Here is the WSDL file:

    <?xml version ='1.0' encoding ='UTF-8' ?>
    <definitions name='update'
    targetNamespace='http://localhost/update.wsdl'
    xmlns:tns='http://localhost/update.wsdl'
    xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
    xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
    xmlns='http://schemas.xmlsoap.org/wsdl/'>

    <message name='getUpdateRequest'>
    <part name='symbol' type='xsd:string'/>
    </message>

    <message name='getUpdateResponse'>
    <part name='Result' type='xsd:string'/>
    </message>

    <portType name = 'updatePortType'>
    <operation name='getUpdate'>
    <input message='tns:getUpdateRequest'/>
    <output message='tns:getUpdateResponse'/>
    </operation>

    </portType>

    <binding name='updateBinding' type='tns:updatePortType'>
    <soap:binding style='rpc'
    transport='http://schemas.xmlsoap.org/soap/http'/>

    <operation name='getUpdate'>

    <soapperation soapAction='urn:http://localhost-update#getUpdate'/>
    <input>
    <soap:body use='encoded' namespace='urn:http://localhost-update'
    encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
    </input>

    <output>
    <soap:body use='encoded' namespace='urn:http://localhost-update'
    encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
    </output>
    </operation>

    </binding>

    <service name='updateService'>
    <port name='updatePort' binding='updateBinding'>
    <soap:address location='http://localhost/'/>
    </port>
    </service>
    </definitions>

    Here is 'client.php':

    <?php

    ini_set('soap.wsdl_cache_enabled','0');

    $client = new SoapClient('http://localhost/update.wsdl');
    $y = "doggy";
    $strt = $client->getUpdate($y);

    echo $strt;

    ?>

    and here is 'update.php'(the server script):

    <?php




    function getUpdate($theString)
    {



    return($theString."works");
    }


    ini_set(“soap.wsdl_cache_enabled”, “0");

    $server = new SoapServer(“update.wsdl”);

    $server->addFunction(“getUpdate″);


    $server->handle();







    ?>

    Please guys,I would really appreciate the help

  2. #2
    Join Date
    Dec 2008
    Posts
    5
    SOLVED...you lazy buggers!

  3. #3
    Join Date
    Jan 2009
    Posts
    1

    Wink Php soap wsdl

    What was the problem? I got the same error?

  4. #4
    Join Date
    Mar 2009
    Posts
    1

    Lightbulb

    Do this -->
    ;extension=php_soap.dll

    if it is not comment out in php.ini file make it commented. Sometime in apache-php case it create problem

  5. #5
    Join Date
    Nov 2011
    Posts
    1

    Question Same problem ... please help

    I got this error

    Fatal error: Uncaught SoapFault exception: [Client] DTD are not supported by SOAP in /home/ajabhi/public_html/soap/client.php:5 Stack trace: #0 /home/ajabhi/public_html/soap/client.php(5): SoapClient->__call('getUpdate', Array) #1 /home/ajabhi/public_html/soap/client.php(5): SoapClient->getUpdate('doggy') #2 {main} thrown in /home/ajabhi/public_html/soap/client.php on line 5

    How did you solve it?

    PLEASE HELP

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles