PHP SOAP, really a web service?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    PHP SOAP, really a web service?

    Hey guys, I'm new to SOAP although I know what it is, I've been looking at tutorials and don't know if it's really a web service.

    What I thought it was: a process that was instantiated on the server once and responded to requests on a port. For example if my PHP application uses a 5000 line file, it would load that file into memory once while a traditional PHP app would load that file for each client request.

    According to this SOAP server example:

    Code:
    <?php 
    # HelloServer.php
    # Copyright (c) 2005 by Dr. Herong Yang, http://www.herongyang.com/
    #
    function hello($someone) { 
       return "Hello " . $someone . "!";
    } 
    
    $server = new SoapServer(null,array('uri' => "urn://www.herong.home/res"));
    $server->addFunction("hello"); 
    $server->handle(); 
    ?>
    source: http://www.herongyang.com/PHP/php_soap_server.html

    It looks like you just call that file through a soap client. In other words: if my hello() function loaded a large file, every soap client that connected to it will load it for itself?

    I'd love to hear some clarifications from anyone that has worked with SOAP server before.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    Originally posted by dlite922
    It looks like you just call that file through a soap client. In other words: if my hello() function loaded a large file, every soap client that connected to it will load it for itself?
    I think so (according to my very limited SOAP experience), unless you write some clever code, that puts the file persistent in memory… (and decide, when to delete it). anyway, you never know, when a SOAP request is made.

    Comment

    Working...