dnzone88
2009-07-29 08:56:15 UTC
I m in need of help. I get this error message everytime i try to run
my code
"Fatal error: Uncaught SCA_RuntimeException: The remote service threw
a soap fault. The text of the response was: thrown in /usr/local/
apache2/htdocs/MyMOL/webservices/CompanyData/SCA/Bindings/soap/
Proxy.php on line 419"
My Senario is like this. I develop my code on my local pc under
windows XP using wamp and my production server is actually a linux
server. Everytime i test the web services locally on my pc it work
fine but when i uplaod my code to the server i get the error message
above.
Below is my sample code: -
CompanyData.php
<?php
include "include/dbconnection.inc";
include "SCA/SCA.php";
/**
* @service
* @binding.soap
* @types http://10.8.6.199/CompanyData CompanyData.xsd
*/
class CompanyData {
/**
* Get Web Service Path
*
* @return string wspath
*/
function getWSPath() {
$wspath="http://10.8.6.199/CompanyData";
return $wspath;
}
/**
* Get Alist for a compnumber
*
* @param integer $compnumber The company number.
* @return Alist http://10.8.6.199/CompanyData
*/
function getAlist($compnumber) {
global $mysqli;
$Alist= SCA::createDataObject($this->getWSPath(), 'Alist');
$query="Select name, CASE WHEN percentowned= 0 THEN '100%' ELSE
CONCAT(FORMAT(percentowned, 2), '%') END as percentowned,
IFNULL(country, 'United States') as country from WELLS.SUBSIDIARY
where COMPNUMBER= ".$compnumber.
" order by SUBSIDIARYID";
$set= $mysqli->query( $query ) or die("failed : ".$mysqli->error."
$query");
while ($row= $set->fetch_row())
{
$Alistsub = $Alist->createDataObject('Alistsub');
$Alistsub->name= $this->ConvertSymbolsToHTMLCharacters(strip_tags
($row[0]));
$Alistsub->percentowned= $this->ConvertSymbolsToHTMLCharacters
(strip_tags($row[1]));
$Alistsub->country= $this->ConvertSymbolsToHTMLCharacters(strip_tags
($row[2]));
}
return $Alist;
}
/**
* Convert symbols to HTML/XML recognizable characters
*
* @param string $string The string that may contain symbols
* @return string Converted string
*/
function ConvertSymbolsToHTMLCharacters($string) {
$fixed_str= htmlspecialchars($string, ENT_QUOTES);
$trans_array = array();
for ($i=127; $i<255; $i++) {
$trans_array[chr($i)] = "&#" . $i . ";";
}
$fixed_str = str_replace("’","´",$fixed_str);
$fixed_str_final = strtr($fixed_str, $trans_array);
return $fixed_str_final;
}
}
?>
CompanyData.xsd
<?xml version="1.0"?>
<xsd:schema targetNamespace="http://10.8.6.199/CompanyData"
xmlns:comp="http://10.8.6.199/CompanyData" xmlns:xsd="http://
www.w3.org/2001/XMLSchema">
<xsd:element name="Alist">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Alistsub" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="percentowned" type="xsd:string"/>
<xsd:element name="country" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Alist.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<?php
require 'SCA/SCA.php';
$compnumber=46247;
echo '<p>Calling CompanyData</p>';
echo '<p>Requesting WSDL from CompanyData Component</p>';
$cond="http://10.8.6.199/CompanyData/CompanyData.php?wsdl";
$wsdl = file_get_contents($cond);
file_put_contents('CompanyData.wsdl',$wsdl);
$service = SCA::getService('./CompanyData.wsdl');
echo '<p><b>SUBSIDIARIES</b></p>';
echo "Company Number >><b>".$compnumber."</b>";
echo "<br><br>";
$replies = $service->getAlist($compnumber); //6581
//print_r($replies);
foreach ($replies->Alistsub as $row) {
echo "Name => " . $row->name;
echo "<br>";
echo "PercentOwned=> " . $row->percentowned;
echo "<br>";
echo "Country=> " . $row->country;
echo "<br>";
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=encoding">
<title>Insert title here</title>
</head>
<frameset>
<frame>
<frame>
<noframes>
<body>
<p>This page uses frames. The current browser you are using does
not support frames.</p>
<?php
?>
</body>
</noframes>
</frameset>
</html>
CompanyData.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:tns2="http://CompanyData" xmlns:wsdl="http://
schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/
soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
targetNamespace="http://CompanyData">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns0="http://10.8.6.199/CompanyData"
targetNamespace="http://CompanyData"
elementFormDefault="qualified">
<xs:import schemaLocation="CompanyData.xsd" namespace="http://
10.8.6.199/CompanyData"/>
<xs:element name="getWSPath">
<xs:complexType>
<xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getWSPathResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="getWSPathReturn" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getAlist">
<xs:complexType>
<xs:sequence>
<xs:element name="compnumber" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getAlistResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="getAlistReturn" type="ns0:Alist"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ConvertSymbolsToHTMLCharacters">
<xs:complexType>
<xs:sequence>
<xs:element name="string" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ConvertSymbolsToHTMLCharactersResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="ConvertSymbolsToHTMLCharactersReturn"
type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="getWSPathRequest">
<wsdl:part name="getWSPathRequest" element="tns2:getWSPath"/>
</wsdl:message>
<wsdl:message name="getWSPathResponse">
<wsdl:part name="return" element="tns2:getWSPathResponse"/>
</wsdl:message>
<wsdl:message name="getAlistRequest">
<wsdl:part name="getAlistRequest" element="tns2:getAlist"/>
</wsdl:message>
<wsdl:message name="getAlistResponse">
<wsdl:part name="return" element="tns2:getAlistResponse"/>
</wsdl:message>
<wsdl:message name="ConvertSymbolsToHTMLCharactersRequest">
<wsdl:part name="ConvertSymbolsToHTMLCharactersRequest"
element="tns2:ConvertSymbolsToHTMLCharacters"/>
</wsdl:message>
<wsdl:message name="ConvertSymbolsToHTMLCharactersResponse">
<wsdl:part name="return"
element="tns2:ConvertSymbolsToHTMLCharactersResponse"/>
</wsdl:message>
<wsdl:portType name="CompanyDataPortType">
<wsdl:operation name="getWSPath">
<wsdl:input message="tns2:getWSPathRequest"/>
<wsdl:output message="tns2:getWSPathResponse"/>
</wsdl:operation>
<wsdl:operation name="getAlist">
<wsdl:input message="tns2:getAlistRequest"/>
<wsdl:output message="tns2:getAlistResponse"/>
</wsdl:operation>
<wsdl:operation name="ConvertSymbolsToHTMLCharacters">
<wsdl:input message="tns2:ConvertSymbolsToHTMLCharactersRequest"/
<wsdl:output
message="tns2:ConvertSymbolsToHTMLCharactersResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CompanyDataBinding"
type="tns2:CompanyDataPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
<wsdl:operation name="getWSPath">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getAlist">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ConvertSymbolsToHTMLCharacters">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CompanyDataService">
<wsdl:port name="CompanyDataPort"
binding="tns2:CompanyDataBinding">
<soap:address location="http://10.8.6.199/CompanyData/
CompanyData.php"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
<!-- this line identifies this file as WSDL generated by SCA for PHP.
Do not remove -->
If anyone can help. Thanks you
my code
"Fatal error: Uncaught SCA_RuntimeException: The remote service threw
a soap fault. The text of the response was: thrown in /usr/local/
apache2/htdocs/MyMOL/webservices/CompanyData/SCA/Bindings/soap/
Proxy.php on line 419"
My Senario is like this. I develop my code on my local pc under
windows XP using wamp and my production server is actually a linux
server. Everytime i test the web services locally on my pc it work
fine but when i uplaod my code to the server i get the error message
above.
Below is my sample code: -
CompanyData.php
<?php
include "include/dbconnection.inc";
include "SCA/SCA.php";
/**
* @service
* @binding.soap
* @types http://10.8.6.199/CompanyData CompanyData.xsd
*/
class CompanyData {
/**
* Get Web Service Path
*
* @return string wspath
*/
function getWSPath() {
$wspath="http://10.8.6.199/CompanyData";
return $wspath;
}
/**
* Get Alist for a compnumber
*
* @param integer $compnumber The company number.
* @return Alist http://10.8.6.199/CompanyData
*/
function getAlist($compnumber) {
global $mysqli;
$Alist= SCA::createDataObject($this->getWSPath(), 'Alist');
$query="Select name, CASE WHEN percentowned= 0 THEN '100%' ELSE
CONCAT(FORMAT(percentowned, 2), '%') END as percentowned,
IFNULL(country, 'United States') as country from WELLS.SUBSIDIARY
where COMPNUMBER= ".$compnumber.
" order by SUBSIDIARYID";
$set= $mysqli->query( $query ) or die("failed : ".$mysqli->error."
$query");
while ($row= $set->fetch_row())
{
$Alistsub = $Alist->createDataObject('Alistsub');
$Alistsub->name= $this->ConvertSymbolsToHTMLCharacters(strip_tags
($row[0]));
$Alistsub->percentowned= $this->ConvertSymbolsToHTMLCharacters
(strip_tags($row[1]));
$Alistsub->country= $this->ConvertSymbolsToHTMLCharacters(strip_tags
($row[2]));
}
return $Alist;
}
/**
* Convert symbols to HTML/XML recognizable characters
*
* @param string $string The string that may contain symbols
* @return string Converted string
*/
function ConvertSymbolsToHTMLCharacters($string) {
$fixed_str= htmlspecialchars($string, ENT_QUOTES);
$trans_array = array();
for ($i=127; $i<255; $i++) {
$trans_array[chr($i)] = "&#" . $i . ";";
}
$fixed_str = str_replace("’","´",$fixed_str);
$fixed_str_final = strtr($fixed_str, $trans_array);
return $fixed_str_final;
}
}
?>
CompanyData.xsd
<?xml version="1.0"?>
<xsd:schema targetNamespace="http://10.8.6.199/CompanyData"
xmlns:comp="http://10.8.6.199/CompanyData" xmlns:xsd="http://
www.w3.org/2001/XMLSchema">
<xsd:element name="Alist">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Alistsub" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="percentowned" type="xsd:string"/>
<xsd:element name="country" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Alist.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<?php
require 'SCA/SCA.php';
$compnumber=46247;
echo '<p>Calling CompanyData</p>';
echo '<p>Requesting WSDL from CompanyData Component</p>';
$cond="http://10.8.6.199/CompanyData/CompanyData.php?wsdl";
$wsdl = file_get_contents($cond);
file_put_contents('CompanyData.wsdl',$wsdl);
$service = SCA::getService('./CompanyData.wsdl');
echo '<p><b>SUBSIDIARIES</b></p>';
echo "Company Number >><b>".$compnumber."</b>";
echo "<br><br>";
$replies = $service->getAlist($compnumber); //6581
//print_r($replies);
foreach ($replies->Alistsub as $row) {
echo "Name => " . $row->name;
echo "<br>";
echo "PercentOwned=> " . $row->percentowned;
echo "<br>";
echo "Country=> " . $row->country;
echo "<br>";
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=encoding">
<title>Insert title here</title>
</head>
<frameset>
<frame>
<frame>
<noframes>
<body>
<p>This page uses frames. The current browser you are using does
not support frames.</p>
<?php
?>
</body>
</noframes>
</frameset>
</html>
CompanyData.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:tns2="http://CompanyData" xmlns:wsdl="http://
schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/
soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
targetNamespace="http://CompanyData">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns0="http://10.8.6.199/CompanyData"
targetNamespace="http://CompanyData"
elementFormDefault="qualified">
<xs:import schemaLocation="CompanyData.xsd" namespace="http://
10.8.6.199/CompanyData"/>
<xs:element name="getWSPath">
<xs:complexType>
<xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getWSPathResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="getWSPathReturn" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getAlist">
<xs:complexType>
<xs:sequence>
<xs:element name="compnumber" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getAlistResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="getAlistReturn" type="ns0:Alist"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ConvertSymbolsToHTMLCharacters">
<xs:complexType>
<xs:sequence>
<xs:element name="string" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ConvertSymbolsToHTMLCharactersResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="ConvertSymbolsToHTMLCharactersReturn"
type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="getWSPathRequest">
<wsdl:part name="getWSPathRequest" element="tns2:getWSPath"/>
</wsdl:message>
<wsdl:message name="getWSPathResponse">
<wsdl:part name="return" element="tns2:getWSPathResponse"/>
</wsdl:message>
<wsdl:message name="getAlistRequest">
<wsdl:part name="getAlistRequest" element="tns2:getAlist"/>
</wsdl:message>
<wsdl:message name="getAlistResponse">
<wsdl:part name="return" element="tns2:getAlistResponse"/>
</wsdl:message>
<wsdl:message name="ConvertSymbolsToHTMLCharactersRequest">
<wsdl:part name="ConvertSymbolsToHTMLCharactersRequest"
element="tns2:ConvertSymbolsToHTMLCharacters"/>
</wsdl:message>
<wsdl:message name="ConvertSymbolsToHTMLCharactersResponse">
<wsdl:part name="return"
element="tns2:ConvertSymbolsToHTMLCharactersResponse"/>
</wsdl:message>
<wsdl:portType name="CompanyDataPortType">
<wsdl:operation name="getWSPath">
<wsdl:input message="tns2:getWSPathRequest"/>
<wsdl:output message="tns2:getWSPathResponse"/>
</wsdl:operation>
<wsdl:operation name="getAlist">
<wsdl:input message="tns2:getAlistRequest"/>
<wsdl:output message="tns2:getAlistResponse"/>
</wsdl:operation>
<wsdl:operation name="ConvertSymbolsToHTMLCharacters">
<wsdl:input message="tns2:ConvertSymbolsToHTMLCharactersRequest"/
<wsdl:output
message="tns2:ConvertSymbolsToHTMLCharactersResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CompanyDataBinding"
type="tns2:CompanyDataPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
<wsdl:operation name="getWSPath">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getAlist">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ConvertSymbolsToHTMLCharacters">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CompanyDataService">
<wsdl:port name="CompanyDataPort"
binding="tns2:CompanyDataBinding">
<soap:address location="http://10.8.6.199/CompanyData/
CompanyData.php"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
<!-- this line identifies this file as WSDL generated by SCA for PHP.
Do not remove -->
If anyone can help. Thanks you