SOMETIMES I get HTTP Error
| From: | Fran | Date: | Tue, 01 Mar 2005 18:17:56 +0000 |
| Subject: | SOMETIMES I get HTTP Error | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-1759@lists.php.net to get a copy of this message | ||
Hi,
I've made my first SOAP Application and all seems to work correctly but
SOMETIMES I get the error:
HTTP ERROR: Unsupported HTTP response status 502 Bad Gateway
(soapclient->response has contents of the response)
And the operation returns NULL.
My client page calls 2 differents "SOAP servers" wich are installed in a
IIS6 and my client is in a Apache Linux with PHP 4.3.10 both.
I'm getting mad because it works SOMETIMES!!!
Here are my code:
<? client.php
$ListH = array();
$Zone = array();
$Zone[0] = 'SAL';
$input_param = array((array)$Zone);
$client = new
soapclient("http://62.43.443.22/SOAPServer.php?wsdl,true,false,false,false,f
alse,false,10);
$Result = $client->call("GetListH",$input_param);
echo "H->" .$Result . "<br>";
$date='03-2005';
$numdays=31;
$ListH = array('code' => '001','name' => 'Fran');
$input_param1 = array((string)$date,(integer)$numdays,(array)$ListH);
$client = new
soapclient("http://62.43.443.22/OtherSOAPServer.php?wsdl,true,false,false,fa
lse,false,false,10);
$Result = $client->call("GetAll",$input_param1);
echo "H->" .$Result . "<br>";
?>
<? SOAPServer.php
.....
$NAMESPACE = 'http://www.mysite.es/zones';
$server = new soap_server;
$server->debug_flag=false;
$server->configureWSDL('WebService',$NAMESPACE);
$server->wsdl->schemaTargetNameSpace = $NAMESPACE;
/////////////////////////////// COMPLEX TYPES
//////////////////////////////////////////////
$server->wsdl->addComplexType(
'ArrayOfstring',
'complexType',
'array',
'',
'',
array(),
array(array('ref'=>'SOAP-ENC:Array','wsdl:arrayType'=>'xsd:string[]')),
'xsd:string'
);
//////////////////////////////////////////////REGISTER//////////////////////
////////////////////
$server->register('GetListH',
array('pListZones' => 'tns:ArrayOfstring'),
array('return' => 'xsd:string'),
$NAMESPACE);
function GetListH(......){
//connect to a DB and return some values in a XML.
}
?>
<? OtherSOAPServer.php
$NAMESPACE = 'http://www.mysite.es/zones';
$server = new soap_server;
$server->debug_flag=false;
$server->configureWSDL('OtherWebService',$NAMESPACE);
$server->wsdl->schemaTargetNameSpace = $NAMESPACE;
/////////////////////////////// COMPLEX TYPES
//////////////////////////////////////////////
$server->wsdl->addComplexType(
'H',
'complexType',
'struct',
'all',
'',
array(
'code' =>
array('name'=>'code','type'=>'xsd:string'),
'name' =>
array('name'=>'name','type'=>'xsd:string')
)
);
$server->wsdl->addComplexType(
'HArray',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(
array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:H[]')
),
'tns:H'
);
//////////////////////////////////////////////REGISTER//////////////////////
////////////////////
$server->register('GetAll',
array('pDate' => 'xsd:string', 'pNumdays'
=>
'xsd:integer', 'pListH' => 'tns:HArray'),
array('return' => 'xsd:string'),
$NAMESPACE);
function GetAll(.......){
//connect to a DB and return some values in a XML.
}