Hi guys I am calling a webmethod from C++. The [webmthod] is defined as follows
[WebMethod]
public string UploadFile(byte[] data)
Here is how I call it in 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));
With this; I receive the following error.
System.ArgumentException: Cannot convert temp.txt to System.Byte.
So how do I pass in the frmdata[] so that it can be converted to a System.byte on the webservice?
Thanks!