i am working with MFC application and i don't have knowledge about MFC because i am Donet net developer .
i am trying to hit web service which coded in C# .web service has login method . when i hit from MFC application its work well . after check username and password login method return user code .i want to read this user code in MFC application .
My MFC code is here
CString clsLogin::login(CString username ,CString password)
{
CString a1;
a1.Format("%02X",""); szJson.Replace("byte1str", a1);
a1.Format("%02X",""); szJson.Replace("byte2str", a1);
a1.Format("%02X",""); szJson.Replace("byte3str", a1);
a1.Format("%02X",""); szJson.Replace("byte4str", a1);
a1.Format("%s",username);szJson.Replace("name1", a1);
a1.Format("%s",password);szJson.Replace("pass1", a1);
curlcode = CURLE_OK;
char *posturi = "myurl";
CURL *curl = NULL;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, posturi);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, szJson);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(szJson));
curlcode = curl_easy_perform(curl);
curl_easy_cleanup(curl);
} else {
curlcode = CURLE_FAILED_INIT;
}
return 0 ;
}
please help me
What should i add to this function to get return value from webservice method
C# code is Here
[AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post)]
public string CheckLogin(string data)
{
//command to database to check username and password
return usercode;
}