SOAP Script Error


#1

Do the PHP / WSDL Scripts get put in a buffer and if so Can I flush it ?

I am learning SOAP right now, and had a script that worked on an inhouse server.

I moved it to Dreamhost (www.gw4y.com/wsdl/hello_server.php & www.gw4y.com/wsdl/hello.wsdl)

When I moved it I forgot to change the address in the script from 192.168.1.17 to www.gw4y.com, so I did that.

Even after uploading at the work computer & then downloading at my home computer (so I know the copy is clean) their is no reference to 192.168.1.17 in either the wsdl or the client / server php files.

error returned

object(SoapFault)#2 (9) 
	{ 
	["message":protected]=> string(25) "Could not connect to host" 
	["string":"Exception":private]=> string(0) "" 
	["code":protected]=> int(0) 
	["file":protected]=> string(49) "/home/username/gw4y.com/wsdl/hello_client.php" 
	["line":protected]=> int(8) ["trace":"Exception":private]=> array(3) 
		{ 
		[0]=> array(4) 
			{ 
			["function"]=> string(11) "__doRequest" ["class"]=> string(10) "SoapClient" 
			["type"]=> string(2) "->" 
			["args"]=> array(5) 
			{ 
				[0]=> string(193) " " 
				[1]=> string(41) "http://192.168.1.17/wsdl/hello_server.php" 
				[2]=> string(20) "urn:HelloClassAction" 
				[3]=> int(1) 
				[4]=> int(0) 
			}
		} 
	[1]=> array(6) 
		{ 
		["file"]=> string(49) "/home/username/gw4y.com/wsdl/hello_client.php" 
		["line"]=> int(8) 
		["function"]=> string(6) "__call" 
		["class"]=> string(10) "SoapClient" 
		["type"]=> string(2) "->" 
		["args"]=> array(2) 
			{ 
			[0]=> string(12) "MemoryRecall" 
			[1]=> array(0) 
				{ } 
			} 
		} 
	[2]=> array(6) 
		{ 
		["file"]=> string(49) "/home/username/gw4y.com/wsdl/hello_client.php" 
		["line"]=> int(8) 
		["function"]=> string(12) "MemoryRecall" 
		["class"]=> string(10) "SoapClient" 
		["type"]=> string(2) "->" 
		["args"]=> array(0) 
			{ } 
		} 
	} 
	["previous":"Exception":private]=> NULL 
	["faultstring"]=> string(25) "Could not connect to host" 
	["faultcode"]=> string(4) "HTTP" 
	}[/code]

hello_server.php
[code]<?php
	global $SavedFirst;
	global $SavedLast;
	function HelloFullName($yourFName,$yourLName) 	{
		$SavedFirst = $yourFName;
		$SavedLast = $yourLName;
		return "Your full name is ".$yourFName." ".$yourLName;
		}
	function HelloFirstName($yourFName,$yourLName) 	{
		$SavedFirst = $yourFName;
		return "Your first name is ".$yourFName;
		}
	function HelloLastName($yourLName) 	{
		$SavedLast = $yourLName;
		return "Hello your last name is ".$yourLName;
		}
	function MemoryRecall() {
		$ReturnValue = "";
		if($SavedFirst>"")
			{
			$ReturnValue = "I've got a First Name Of ".$SavedFirst;
			if($SavedLast>"")$ReturnValue = $ReturnValue."and a Last Name Of ".$SavedLast;
			}
			else
			{
				if($SavedLast>"")
				{$ReturnValue = $ReturnValue."Only a Last Name of ".$SavedLast;}
				else {$ReturnValue = "I've Got Nothing";}
			}
		return $ReturnValue;
	}	
session_start();
$server = new SoapServer("ohello.wsdl");
$server->addFunction('HelloFullName');
$server->addFunction('HelloFirstName');
$server->addFunction('HelloLastName');
$server->addFunction('MemoryRecall');
$server->handle();
?>[/code]
hello_client.php
[code]<?php
try{
  $sClient = new SoapClient('ohello.wsdl');
  
  $params1 = "John";
  $params2 = "Doe";
  
  echo($sClient->MemoryRecall()."<br>");
  echo($sClient->HelloFirstName($params1)."<br>");
  echo($sClient->HelloLastName($params2)."<br>");
  echo($sClient->HelloFullName($params1,$params2)."<br>");
  echo($sClient->MemoryRecall()."<br>");
  
  
} catch(SoapFault $e){
  var_dump($e);
}
?>[/code]
hello.wsdl
[code]<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" 
			xmlns:xs="http://www.w3.org/2001/XMLSchema" 
			xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
			xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
			xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 			
			xmlns:typens="urn:HelloWorld"
			name="HelloWorld" 
			xmlns:tns="http://www.gw4y.com/wsdl/ohello.wsdl" 
			targetNamespace="HelloWorld">

	<types>

    <xs:schema xmlns="http://www.w3.org/2001/XMLSchema" >
		<xs:element name="getName" type="xs:string" />
		<xs:element name="HelloResponse" type="xs:string" />	 	  
	</xs:schema>			
	</types>
	
	<message name="ServerResponse">
		<part name="return1" type="xs:MyString" />
	</message>  
	<message name="FullNameInput">
		<part name="FirstName" type="xs:getName" />
		<part name="LastName" type="xs:getName" />
	</message>
	<message name="LastNameInput">
		<part name="LastName" type="xs:string"/>
	</message>
	<message name="FirstNameInput">
		<part name="FirstName" type="xs:string"/>
	</message>
	
	<portType name="HelloClassPortType"> 
		<operation name="HelloFirstName">
			<input message="tns:FirstNameInput"/> 
			<output message="tns:ServerResponse"/>   
		</operation>
		<operation name = "HelloLastName">
			<input message="tns:LastNameInput"/>
			<output message="tns:ServerResponse"/>
		</operation>
		<operation name = "HelloFullName">
			<input message="tns:FullNameInput"/>
			<output message="tns:ServerResponse"/>
		</operation>
		<operation name = "MemoryRecall">
			<output message="tns:ServerResponse"/>
		</operation>
	</portType> 

	<binding name="HelloClassBinding" type="tns:HelloClassPortType"> 
		<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> 
		<operation name="HelloFirstName"> 
			<soap:operation soapAction="urn:HelloClassAction"/>
			<input> 
				<soap:body namespace="urn:HelloService" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
			</input> 
			<output> 
				<soap:body namespace="urn:HelloService" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
			</output> 
		</operation>
		<operation name="HelloLastName"> 
			<soap:operation soapAction="urn:HelloClassAction"/>
			<input> 
				<soap:body namespace="urn:HelloService" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
			</input> 
			<output> 
				<soap:body namespace="urn:HelloService" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
			</output> 
		</operation>
		<operation name="HelloFullName"> 
			<soap:operation soapAction="urn:HelloClassAction"/>
			<input> 
				<soap:body namespace="urn:HelloService" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
			</input> 
			<output> 
				<soap:body namespace="urn:HelloService" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
			</output> 
		</operation>
		<operation name="MemoryRecall"> 
			<soap:operation soapAction="urn:HelloClassAction"/>
			<output> 
				<soap:body namespace="urn:HelloService" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
			</output> 
		</operation>
	</binding> 

	<service name="HelloService"> 
		<port name="HelloClass" binding="typens:HelloClassBinding"> 
			<soap:address location="http://www.gw4y.com/wsdl/ohello_server.php"/> 
		</port> 
	</service>
</definitions>

Now I renamed the 3 files (added a “o” to the front) and changed the script to point to ohello.wsdl vs hello.wsdl, and the scripts work fine. So why ?
[hr]
Oh & Yes I know the function MemoryRecall will not work (that’s next to fix)


#2

I take it no one on this site uses SOAP?

I’m still trying to figure out how to Flush the wsdl file (I think that’s what’s staying in memory)
Did some updates today, had a bug.
Fixed the bug, works on a local server no problem.
Upload the files and the error is still their.

make a new directory, upload same files to new directory, change WSDL file to point to new directory (only add /1 to code to point to new directory) and low & behold the files work.

WHY are the WSDLs being kept in memory & how do I free them up in a development cycle?