[libxml++] libxml++ unpack soap reply from libcurl



Hi,

I have a problem trying to unpack a soap reply using libxml++.
The error I get is: "Unable to instantiate underlying libxml
structure" or something along those lines, when creating a textreader
passing a string to the constructor.

it seemed to work however when I used a file for input (created by
directing the output to a file when calling libcurl).

Basicly I call the server with libcurl, so far so good, this seems to
return valid information, then I put the following statement:
string resultXml = telenet_get_result_xml(&buffer); // buffer is where
the libcurl output is located

and the function, where it goes wrong on the 7th line:
string telenet_get_result_xml(string *content){
         try{
                 if(GlobalParameters::isDebug()){
                         cout << "Got it all in a ustring" << endl;
                 }
                 Glib::ustring ustring_content = Glib::ustring(*content);
                 xmlpp::TextReader reader(ustring_content); // <<---
this is where the error occurs
                if(GlobalParameters::isDebug()){
                         cout << "Initialized TextReader" << endl;
                 }

                while(reader.read()){
                     if(reader.get_name().compare("result")){
                              return reader.get_value();
                      }
                }
         }
         catch(const exception& e){
                cout << "Exception caught: " << e.what() << std::endl;
         }
         return NULL;
 }

Does anyone have any idea what is going wrong here?
The development environment here is a Debian Lenny machine, libxml++
version 2.6-2 (package version 2.22.0-1), only package that isn't an
regular up-to-date package from the repo's is the 2.6.30 kernel from
backports

If someone is interested, my code is available in my git repo:
http://stevenleeuw.kwik.to/git/?p=ispmonitor/libispmon.git;a=summary
The file I'm talking about it telenet.cpp:
http://stevenleeuw.kwik.to/git/?p=ispmonitor/libispmon.git;a=blob;f=telenet.cpp;h=bcc9995fda86976bb75dc41a3cef5c2be18fbecb;hb=78349096feafcea42e8beb029dd65e049b5c0280
it fails on line 93 (second function in the file) when calling the
void telenet(...) function (first one in the file)

Best regards,
Steven




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]