|
|
Subject: Re: nusoap not returning server response - msg#00069
List: php.nusoap.general
> I determined that the SOAP server was sending what I have started calling a
> null data packet. This is a packet of data with no data in it before sending
> the response data. Near as I can tell (as I don't have access to the SOAP
> server software) is that there is a bug in their SOAP code that is sending a
> null out the socket to my SOAP client. The SOAP client grabs this packet as
> if it was the response to the inital SOAP call, and since there is no data
> in it, bombs out of getResponse with false.
Can you post a tcpdump that shows this? Include the HTTP request from the
client and both "null data packet" and "real" response from the server.
Thanks.
Scott Nichol
Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Re: nusoap not returning server response
Continuing my tradition of replying to my own posts, here is a resolution
(or at least a temp fix in my case).
I determined that the SOAP server was sending what I have started calling a
null data packet. This is a packet of data with no data in it before sending
the response data. Near as I can tell (as I don't have access to the SOAP
server software) is that there is a bug in their SOAP code that is sending a
null out the socket to my SOAP client. The SOAP client grabs this packet as
if it was the response to the inital SOAP call, and since there is no data
in it, bombs out of getResponse with false.
I have made a patch again nusoap.php (1.82) to handle this issue. I don't
know if it is even legal or not (my guess is it isn't), but right now I
can't argue the point. Below is the unified diff of 1.82 versus my modified
version. It isn't much... just a one or two liner, but it has fixed my
problem in the short term. Now I have to lean on the coders at the server
end to clean up their code.
--- nusoap.php Tue Dec 21 21:58:49 2004
+++ nusoap.modified.php Tue Dec 21 21:57:24 2004
@@ -2229,6 +2229,7 @@
if ($this->scheme == 'http' || $this->scheme == 'ssl') {
// loop until headers have been retrieved
$data = '';
+ $nullcount = 0;
while (!isset($lb)){
// We might EOF during header read.
@@ -2249,7 +2250,9 @@
$this->debug('socket read of headers timed
out after length ' . strlen($data));
$this->debug("read before timeout:\n" .
$data);
$this->setError('socket read of headers
timed out');
- return false;
+ if( $nullcount >= 1 ) {
+ return false;
+ }
}
$data .= $tmp;
I am tired after all this crap today... I am going to have a beer and relax,
it has been a very long day.
Tom Walsh
eXpressHosting.net
http://www.expresshosting.net/
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
Next Message by Date:
click to view message preview
Problem with complex types
Hi everyone,
I'm working at WaterProof SARL on PHPEdit and like to create a soap service
to provide a list of available PHP website mirrors.
I'm using to code below to generate a soap server and it's not working (it
can only make it work with simple types like strings).
If someone has ideas it would be a great help.
Thank you very much for your time,
Bastien Hofmann
--
WaterProof Software | Tel: +33 (0) 563 218 274
20, Place Prax Paris | Fax: +33 (0) 563 915 629
82000 Montauban, France | Web: http://www.waterproof.fr/
<?php
require_once('../config.inc.php');
require_once('nusoap.php');
function GetAll()
{
$mirror1 = array("Name" => 'Main', "Url" => "www.php.net", "Country"
=> "us");
$mirror2 = array("Name" => 'Second', "Url" => "www2.php.net",
"Country" => "us");
$list = array($mirror1, $mirror2);
return $list;
}
$SoapServer = new soap_server();
$Url = 'http://.../PhpMirrorList';
$SoapServer->configureWSDL('PhpMirrorList', FALSE, $Url);
$SoapServer->wsdl->schemaTargetNamespace = 'http://soapinterop.org/xsd/';
$SoapServer->wsdl->addComplexType(
'PhpMirror',
'complexType',
'struct',
'all',
'',
array(
'Name' => array('name'=>'Name','type'=>'string'),
'Url' => array('name'=>'Url','type'=>'string'),
'Country' => array('name'=>'Country','type'=>'string')
)
);
$SoapServer->wsdl->addComplexType(
'ArrayOfPhpMirror',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'PhpMirror[]')),
'PhpMirror'
);
$SoapServer->register('GetAll',
array(),
array('Result' => 'xsd:ArrayOfPhpMirror'), false, $Url,
false, false, 'Get a list of available php website mirrors.');
$SoapServer->service(isset($HTTP_RAW_POST_DATA)?$HTTP_RAW_POST_DATA:'');
?>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
Previous Message by Thread:
click to view message preview
Re: nusoap not returning server response
Continuing my tradition of replying to my own posts, here is a resolution
(or at least a temp fix in my case).
I determined that the SOAP server was sending what I have started calling a
null data packet. This is a packet of data with no data in it before sending
the response data. Near as I can tell (as I don't have access to the SOAP
server software) is that there is a bug in their SOAP code that is sending a
null out the socket to my SOAP client. The SOAP client grabs this packet as
if it was the response to the inital SOAP call, and since there is no data
in it, bombs out of getResponse with false.
I have made a patch again nusoap.php (1.82) to handle this issue. I don't
know if it is even legal or not (my guess is it isn't), but right now I
can't argue the point. Below is the unified diff of 1.82 versus my modified
version. It isn't much... just a one or two liner, but it has fixed my
problem in the short term. Now I have to lean on the coders at the server
end to clean up their code.
--- nusoap.php Tue Dec 21 21:58:49 2004
+++ nusoap.modified.php Tue Dec 21 21:57:24 2004
@@ -2229,6 +2229,7 @@
if ($this->scheme == 'http' || $this->scheme == 'ssl') {
// loop until headers have been retrieved
$data = '';
+ $nullcount = 0;
while (!isset($lb)){
// We might EOF during header read.
@@ -2249,7 +2250,9 @@
$this->debug('socket read of headers timed
out after length ' . strlen($data));
$this->debug("read before timeout:\n" .
$data);
$this->setError('socket read of headers
timed out');
- return false;
+ if( $nullcount >= 1 ) {
+ return false;
+ }
}
$data .= $tmp;
I am tired after all this crap today... I am going to have a beer and relax,
it has been a very long day.
Tom Walsh
eXpressHosting.net
http://www.expresshosting.net/
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
Next Message by Thread:
click to view message preview
Re: nusoap not returning server response
Can you post a tcpdump that shows this? Include the HTTP request from the
client and both "null data packet" and "real" response from the server.
Scott,
Here is a dump of two conversations done within seconds of each other. The
first transaction is the one that returns the "null" packet, the second one
is the error transaction that does not return the "null" packet.
Please let me know if you need anything else.
The TCPDump was only edited to remove our usernames and password from the
header requests, other than that, they are straight dumps using
'tcpdump -X -s 0 host <ip>'.
http://www.freevsi.com/tcpdump2.txt
Tom Walsh
eXpressHosting.net
http://www.expresshosting.net/
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
|
|