#33684 [NEW]: SOAPfault
| From: | deucalion at lycos dot co dot uk | Date: | Wed, 13 Jul 2005 19:11:54 +0000 |
| Subject: | #33684 [NEW]: SOAPfault | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-81825@lists.php.net to get a copy of this message | ||
From: deucalion at lycos dot co dot uk
Operating system: Windows2000,XP
PHP version: 5.0.4
PHP Bug Type: SOAP related
Bug description: SOAPfault
Description:
------------
I WROTE THE FOLLOWING WEBSERVICE :
WSDL FILE IS THAT:
<?xml version="1.0" encoding="ISO-8859-1"?>
<definitions name ="Elements"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd ="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://members.lycos.co.uk/deucalion/webservices/elements.wsdl"
xmlns:tns="http://members.lycos.co.uk/deucalion/webservices/elements.wsdl"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<message name="getElementRequest">
<part name="nome" type="xsd:string"/>
</message>
<message name="getElementResponse">
<part name="return" type="xsd:string[]"/>
</message>
<portType name="ElementPortType">
<operation name="getElement">
<input message="tns:getElementRequest"/>
<output message="tns:getElementResponse"/>
</operation>
</portType>
<binding name="ElementBinding" type="tns:ElementPortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getElement">
<soap:operation soapAction="Element#getElement"/>
<input>
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="Element"/>
</input>
<output>
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="Element"/>
</output>
</operation>
</binding>
<service name="ElementService">
<port name="ElementPort" binding="tns:ElementBinding">
<soap:address location="http://localhost/elements.wsdl"/>
</port>
</service>
</definitions>
Reproduce code:
---------------
THE SOURCE CODE OF SOAPCLIENT IS THAT:
<?
$client = new SoapClient ( "elements.wsdl" , array ( ' encoding ' =>
' ISO-8859-1 ' ) ) ;
try
{
$return = $client ->getElement (Carbono) ;
echo " <table border = 1 > " ;
echo "<tr bgcolor = gray ><td> Column</td> <td>
content</td></tr> "
;
echo "<tr><td> Num_Atom </td> <td> ' . $return [
'num_atom' ] . '
</td></tr> " ;
echo "<tr><td> Nome </td> <td> ' . $return [ 'nome' ]
. '</td></tr>" ;
echo "<tr><td> Simbol </td> <td> ' . $return [ 'simbol'
] . ' </td></tr>
" ;
echo "<tr><td> Massa_Atom </td> <td> ' . $return [
'massa_atom' ] . '
</td></tr> " ;
echo "<tr><td> Dens </td> <td> ' . $return [ ' dens
' ] . '
</td></tr> " ;
echo "<tr><td> Pto_Fusao </td> <td> ' . $return [
'pto_fusao ' ] . '
</td></tr> " ;
echo "<tr><td> Pto_Ebul </td> <td> ' . $return [ '
pto_ebul ' ] . '
</td></tr> " ;
echo "<tr><td> Tipo </td> <td> ' . $return [ ' tipo '
] . ' </td></tr>
" ;
echo "<tr><td> Orbitais </td> <td> ' . $return [ ' orbitais
' ] . '
</td></tr> " ;
echo "<tr><td> Estrutura_molecular </td> <td> ' . $return [
'
estrutura_molecular ' ] . </td></tr> ";
echo "</table> " ;
}
catch ( SoapFault $exception )
{
echo " Error: " ;
echo " <b> { $exception -> faultstring } </b>
";
}
?>
------------------------------------------------------------
THE SOAPSERVER IS THAT:
<?
function getElement ( $nome)
{
if ( ! $nome)
{
throw new SoapFault (' Client ', ' Param not found');
}
$id = @mysql_connect ( "www.freesq.org", "alphaX9", "");
mysql_select_db ("periodical_table",$id);
if ( ! $id)
throw new SoapFault (' Server ' , 'Server not found ');
$query = " SELECT * FROM elements WHERE name='$name'";
$result = mysql_query ($id,$query);
$array=mysql_fetch_array($result);
if ( $array == null )
throw new SoapFault (' Server ' , 'Client not found
');
return $array [0];
}
$server = new SoapServer ( "elements.wsdl " , array (' encoding
' => ' ISO -8859-1 ' ) ) ;
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA :
'';
$server->service($HTTP_RAW_POST_DATA,TRUE);
?>
Actual result:
--------------
SOAPCLIENT Error message: { Object id #2 <fault string> }
--
Edit bug report at http://bugs.php.net/?id=33684&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33684&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33684&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33684&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33684&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33684&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33684&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33684&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33684&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33684&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33684&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=33684&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=33684&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33684&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33684&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33684&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33684&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33684&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33684&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33684&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33684&r=mysqlcfg