J'appelle une méthode web à partir de C++. Le [webmthod] est défini comme suitAppel d'une méthode Web à partir de C++
[WebMethod]
public string UploadFile(byte[] data)
Voici comment je l'appelle en C++
static TCHAR hdrs[] = "Content-Type: application/x-www-form-urlencoded";
static TCHAR frmdata[] = "data=temp.txt";
HINTERNET hSession = InternetOpen("MyAgent",INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
HINTERNET hConnect = InternetConnect(hSession, "localhost",
INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 1);
HINTERNET hRequest = HttpOpenRequest(hConnect, "POST", "my/WebService.asmx/UploadFile", NULL, NULL, 0, 0, 1);
HttpSendRequest(hRequest, hdrs, strlen(hdrs), frmdata, strlen(frmdata));
Avec cela; Je reçois l'erreur suivante. System.ArgumentException: impossible de convertir temp.txt en System.Byte.
Alors, comment est-ce que je passe dans le frmdata [] pour qu'il puisse être converti en System.byte sur le webservice?
Merci!