Click to See Complete Forum and Search --> : WinInet class method behaving strangely


bidesh
February 6th, 2009, 06:25 AM
Hi All,

I have a C++ client application.

Which is connecting to a web service running at localhost.

This web service have been crated using Microsoft Visual Studio .Net framework 2005.
The language of the web service is #C.

There are few methods of the web service one of them is TestWeb

The signature TestWeb web service is method

[WebMethod]
public string TestMethod(string Test1, string Test1Size, string Test2, string Test1Size)
{
return "Successful";
}

My client application is calling this method using the WinInet class apis such as

1. InternetOpenA()
2. InternetConnect()
3. HttpOpenRequest()
4. HttpSendRequest()

I am sending binary data that is a BYTE buffer as POST request to the web service method TestWeb using HttpSendRequest() method.

The method calling is successful and I am receiving a valid response code 200 and response data as an XML string. The received data is read using the apis

1. HttpQueryInfo, this api reads the response code such HTTP error code
2. InternetReadFile, this api reads the data in a supplied buffer

The problem occurs when I change the web service method TestWeb signature to this
[WebMethod]
public string TestMethod( byte [] Test1, byte [] Test1Size, byte [] Test2, byte [] Test1Size)
{
return "Successful";
}

Now I am receiving an HTTP error code 500 when the api HttpQueryInfo is called.

Could anybody suggest me where I am wrong. Whether there is an error in web service or my client application need to change so that web service can receive byte data.

Thanks;

Bidesh