tatebn
Thu, 13 Aug 2009 06:44:38 -0700
> As far as using ostringstream > goes, as soon as that response comes back from reform it's converted > to a TString which won't accept a string.'
the reponse come back from perform() not reform. Sorry.
On Aug 13, 9:42 am, tatebn <brandonnt...@gmail.com> wrote:
> How complete an example? I think this is all the curl related stuff,
> would you need to whole file?
>
> > > //Using credit card number and time in seconds to create unique id
> > > char uniqueID[64];
> > > strcpy(uniqueID, creditCardNumber);
> > > sprintf(uniqueID, "%s%ld", uniqueID, time(NULL));
>
> > Since you used ostringstream already below, why don't you use it here?
>
> I used this method because there was an issue in that creditCardNumber
> is a TString which is a custom class that I did not create nor know
> where to find. I didn't build this system, I just have to take care
> of this part of it. TString was causing all sorts of type issues and
> this is how it ended up working out. As far as using ostringstream
> goes, as soon as that response comes back from reform it's converted
> to a TString which won't accept a string. So this keeps everything
> more conformed.
>
> I'll remove the cleanup class, but this is dying at perform(). I
> traced it out with log statements that I didn't include here. So let
> me know what you need from me, complete function? complete file? and
> I'll get it up here later today.
>
> Thanks a lot. I'm on a tight deadline here and I'm stumped.
>
> On Aug 13, 9:11 am, Jean-Philippe Barette-LaPierre
>
> <jpbarre...@gmail.com> wrote:
> > On Wed, Aug 12, 2009 at 8:58 PM, tatebn <brandonnt...@gmail.com> wrote:
>
> > > I'm using curlpp to communicate with paypal. I'm having an issue
> > > where when the perform() function is called my cgi dies. No error,
> > > nothing.
>
> > > I'm really under the gun here. Any help would be greatly appreciated.
>
> > The best thing would be to have a complete example which would be a small
> > as possible that you could send. Then we would be more able to reproduce
> > and test. However I can point to possible mistakes
>
> > > Here's what I'm doing:
>
> > > //Using credit card number and time in seconds to create unique id
> > > char uniqueID[64];
> > > strcpy(uniqueID, creditCardNumber);
> > > sprintf(uniqueID, "%s%ld", uniqueID, time(NULL));
>
> > Since you used ostringstream already below, why don't you use it here?
>
> > > //set the headers.
> > > std::list<std::string> headers;
> > > headers.push_back("Content-Type: text/namevalue");
> > > headers.push_back("Content-Length: " +
> > > verisignArgs.GetLength());
> > > headers.push_back("X-VPS-Timeout: 45");
> > > headers.push_back("X-VPS-Request_ID:" + std::string
> > > (uniqueID));
>
> > > cURLpp::Cleanup myCleanup;
>
> > Don't use cleanup class. That is meant to be removed from API
>
> > > cURLpp::Easy myRequest;
> > > myRequest.setOpt(new cURLpp::Options::Url
> > > (kVerisignHost));
> > > myRequest.setOpt(new cURLpp::Options::Port
> > > (kVerisignPort));
> > > myRequest.setOpt(new cURLpp::Options::Timeout
> > > (kVerisignTimeout));
> > > myRequest.setOpt(new cURLpp::Options::Header(1));
> > > myRequest.setOpt(new cURLpp::Options::FollowLocation
> > > (0));
> > > myRequest.setOpt(new cURLpp::Options::SslVerifyPeer
> > > (0));
> > > myRequest.setOpt(new cURLpp::Options::SslVerifyHost
> > > (2));
> > > myRequest.setOpt(new cURLpp::Options::ForbidReuse
> > > (true));
> > > myRequest.setOpt(new cURLpp::Options::Post(1));
> > > myRequest.setOpt(new cURLpp::Options::HttpHeader
> > > (headers));
> > > myRequest.setOpt(new cURLpp::Options::PostFields
> > > (std::string(verisignArgs)));
> > > myRequest.setOpt(new cURLpp::Options::UserAgent
> > > ("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/
> > > 20070725 Firefox/2.0.0.6"));
>
> > > std::ostringstream responseBuffer;
>
> > > cURLpp::Options::WriteStream ws(&responseBuffer);
> > > myRequest.setOpt(ws);
>
> > > myRequest.perform();
>
> > Send a complete example and I'll be able to help you more.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"curlpp" group.
To post to this group, send email to curlpp@googlegroups.com
To unsubscribe from this group, send email to
curlpp+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/curlpp?hl=en
-~----------~----~----~----~------~----~------~--~---