Boost logo

Boost Users :

From: Raja Cherukuri (raja_at_[hidden])
Date: 2007-08-20 13:18:55


I am trying to connect to server that responds with XML.
Here is the error I see:
Traceback (most recent call last):
  File "<string>", line 1, in ?
TypeError: unsubscriptable object

I tried the same thing on windows using serverHttp object in MSXML and
get the response
Correctly in windows machine.

On Linux I am trying to the samething..
Post to a Url and read the response XML.

- Raja
 

-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of David Abrahams
Sent: Saturday, August 18, 2007 1:15 PM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] Can Python "httplib" module be
directlyembeddedin C++ ?

on Fri Aug 17 2007, "Raja Cherukuri" <raja-AT-transerainc.com> wrote:

> Thanks it works fine...how do check the return response...
> Using extract<string> or <extract<char*> doesn't seem to help..

What does it do?

> Am I doing something wrong ?

You might try to figure out what's in response by printing it. Maybe
respose["result"] is not a string, or else maybe it's unicode...

> Here is the code:
>
> boost::python::object response =
> gpPythonHttp->attr("urlopen")(m_sURI.c_str(),strXMLOutput.c_str());
> boost::python::exec("result = read()", response);
> std::string res =
> boost::python::extract<std::string>(response["result"]);

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com
The Astoria Seminar ==> http://www.astoriaseminar.com
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net