0
使用我的web服务,我想在一个XML来保存文件,该文件显示给我的反应,但是当我试图挽救这个数据则显示MZE错误:函数Php fwrite的给出提示信息错误
这里是我得到的错误:
Catchable fatal error: Object of class stdClass could not be converted to string in C:\wamp\www\NEOGETCASH\GESTIONNAIRE\DOSSIERS\creditsafe.php on line 13
我使用的代码是那里;但我不知道我知道响应是XML,但是ID不保存在我想要的文件中,我不知道为什么,只是因为它不是varchar
。
<?php
$wsdl = "https://www.creditsafe.fr/getdata/service/CSFRServices.asmx?WSDL";
$client = new SoapClient($wsdl);
$debiteur_siret = "<xmlrequest><header><username>demo</username><password>**********</password><operation>getcompanyinformation</operation><language>FR</language><country>FR</country><chargereference></chargereference></header><body><package>standard</package><companynumber>40859907400049</companynumber></body>
</xmlrequest> " ;
$o = new stdClass();
$o->requestXmlStr = $debiteur_siret;
$fichier =
//header('Content-Type: text/xml');
$texte=$client->GetData($o);
echo $texte;
$fp = fopen("tmp/".$_GET['n_doss'].".xml", "w+");
//fwrite($fp, $texte);
fclose($fp);
?>
非常感谢你的帮助。 我有一个标准的问题:在我的PHP页面显示我我如何删除它? – 2012-08-02 08:25:20
@StanislasPiotrowski这看起来像一个BOM字符。使用一个体面的PHP编辑器并将您的文件保存为UTF-8,无需BOM。 – 2012-08-02 08:27:09
thnaks所有。这对我来说非常有帮助 – 2012-08-02 08:29:28