Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8321499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:02:25+00:00 2026-06-08T23:02:25+00:00

Using my webservice I would like to save in a XML file the response

  • 0

Using my webservice I would like to save in a XML file the response that it display to me, but when I’m trying to save this data it displays mze an error:

here is the error I get:

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

the code I’m using is there; but I don’t know I know that the response is as XML, but id doesn’t save in the file I wanted I don’t know why, just because it is not a 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);

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:02:29+00:00Added an answer on June 8, 2026 at 11:02 pm

    The message comes from the lines:

    $texte=$client->GetData($o);
    echo $texte;
    

    GetData does not return a string, but a stdClass instead, which can not be converted to a string. var_dump($texte) to see what it returns, and echo the appropriate property of the stdClass.

    EDIT: I’ve looked up the WDSL and checked; the GetData() function returns a GetDataResponse, which seems to contain a property GetDataResult (a string). So the following should work:

    $texte=$client->GetData($o);
    echo $texte->GetDataResult;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to upload a pdf file using webservice api. But this api
I would like to know how does autocompleteextender retrieve data using webservice. Does it
I wold like to save the given webservice url as xml file for offline
I have a xml web service which I would like to track using Google
just getting started with Rails, I would like to consume a webservice (using ActiveResource)
I'm using a webservice to get a certain xml file from it. It works
I am using the simple Google API to display search results. I would like
I would like to generate a WSDL file from a c++ atl webservice without
I would like to set up a webservice endpoint using Spring's SimpleJaxWsServiceExporter for ease
I am developing a RESTful webservice using WCF. I would like to have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.