cURL / Mailing Lists / curl-library / Single Mail

curl-library

Unable to Call WCF from cURL

From: Edward Leno (Hotmail) <edleno_at_hotmail.com>
Date: Sat, 11 Feb 2012 22:06:57 -0500

Note : This question was posted to www.stackoverflow.com :
http://stackoverflow.com/questions/9238522/unable-to-call-wcf-from-curl

 

I have been unable to figure out how to call a WCF service (self-hosted)
from cURL. Here is what I have done:

 

- Download and compile libcurl.lib (7.24.0).

- Create VC++ command line project (in VS 2010) - runs fine.

- Add the following code (which also runs as expected)

 

     #include "stdafx.h"

     #include <stdio.h>

     #include <curl/curl.h>

     

     int _tmain(int argc, _TCHAR* argv[])

     {

                printf("Hello World!\n");

     

                CURL *curl;

                CURLcode res;

     

                curl = curl_easy_init();

                if (curl)

                {

                                curl_easy_setopt(curl,CURLOPT_URL,
"http://www.cnn.com/");

                                res = curl_easy_perform(curl);

                                curl_easy_cleanup(curl);

                }

                return 0;

     }

 

- Created another project (C#, WCF).

- Compiled and ran the WCF project which brings up the WCF Test Client and
the WCF Service Host.

- Confirmed the service by using the GetData method in the WCF Test Client.

 

Now I would like to make the GetData call with cURL. I have played with
various `curl_easy_setopt` options, but nothing has worked. I need some
help in determining what options to set in cURL and whether the default C#
WCF service needs to be altered.

 

Any help would be greatly appreciated!

 

 

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-02-12