cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to send SOAP+XML, using the "xml in memory"

From: Ajay Garg <ajaygargnsit_at_gmail.com>
Date: Tue, 1 Jul 2014 20:28:21 +0530

Thanks Patrick for the reply ...

On Tue, Jul 1, 2014 at 7:23 PM, Patrick Monnerat <
Patrick.Monnerat_at_datasphere.ch> wrote:

>
> Ajay Garg wrote:
>
> >
> http://stackoverflow.com/questions/4150710/soap-request-and-response-rea
> d-from-and-to-file-using-libcurl-c gives us the solution to sending a
> XML, when it ought to be read from a file.
>
>
> > Is it possible to achieve the same "end result", but wherein the XML
> is created "on the fly" during program-run, and not read from a file?
>
> If all data are ready in memory before request,

Yes, it is ..

> instead of the
> CURLOPT_READFUNCTION/CURLOPT_READDATA options you may use
> http://curl.haxx.se/libcurl/c/CURLOPT_POSTFIELDS.html or
> http://curl.haxx.se/libcurl/c/CURLOPT_COPYPOSTFIELDS.html and specify
> the length with
> http://curl.haxx.se/libcurl/c/CURLOPT_POSTFIELDSIZE.html.
>

Worked perfectly !!!!!!!!!

>
> If the data generation is done during the transfer, you have to update
> the read_data() in the example you mention to return a new bunch of
> data. You set the callback address as in the example, and you can use
> the user data pointer (CURLOPT_READDATA) to pass a data generation
> control block of your own (i.e.: it does not have to be a FILE *: its
> real type depends on what you are doing with in the read_data function).
>
> I suggest you read http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
> thoroughly...
>

Thanks a ton for the quick and crisp reply.

Thanks and Regards,
Ajay

>
> Patrick
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html

-- 
Regards,
Ajay

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-07-01