|
-
connection to servlet from ATL dll
I am trying to send a request to a java servlet from an ATL dll. While I
can get a connection to <server>:<port> with a socket, how do I tell the
server which servlet to send my request to?
Currently, I connect to the servlet like this:
// --------------
if (0 == (hInternet = InternetOpen(_T("RoutingClient"),
INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0))) {
// Handle error
}
if (0 == (hConnect = InternetConnect(hInternet,
"localhost", 8080, _T("Client"),
0, INTERNET_SERVICE_HTTP, 0, lContext))) {
// Handle error
}
if (0 == (hHttp = HttpOpenRequest(hConnect, _T("GET"),
"/servlet/MyServlet, HTTP_VERSION, 0, 0,
INTERNET_FLAG_KEEP_CONNECTION, lContext))) {
// Handle error
}
// strEncoded has my request
HttpSendRequest(hHttp, 0, 0, (void *)strEncoded.c_str(), strEncoded.length());
InternetReadFile(hHttp, (void *) buf, sizeof(buf), &bytesRead);
// ---------------
I get a connection to the servlet, but it reports (in the InternetReadFile
call) that my request is empty.
TIA for advice or pointers to more information.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks