I got such incomplete information after calling this web service 2 to 3 times. Initially 2 times i got blank reply. Now When I used HTTPQueryInfo it showed following message H T T P / 1 . 1 4 0 0 B a d R e q u e s t S e r v e r : M i c r o s o f t - I I S / 5 . 0 D a t e : F r i , 2 8 S e p 2 0 0 7 0 8 : 3 5 : 5 1 G M T X - P o w e r e d - B y : A S P . N E T X - A s p N e t - V e r s i o n : 2 . 0 . 5 0 7 2 7 C a c h e - C o n t r o l : p r i v a t e C o n t e n t - L e n g t h : 0 My web service contains just one method “HelloWorld” which does not take any input parameters and returns the “HelloWorld” string to the calling application. My code of calling web service is following. LPTSTR AcceptTypes[2] = {TEXT("text/xml"), NULL}; DWORD dwFlags = INTERNET_FLAG_NO_CACHE_WRITE |INTERNET_FLAG_KEEP_CONNECTION; HINTERNET hNet = InternetOpen(L"EvcWebService", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 ); if (hNet) { HINTERNET hSession = InternetConnect(hNet, _T("10.37.54.93"), INTERNET_DEFAULT_HTTP_PORT, _T(""), _T(""), INTERNET_SERVICE_HTTP, 0, 0); if (hSession) { HINTERNET hRequest = HttpOpenRequest(hSession, _T("POST"), _T("/TestService/Service.asmx?wsdl"), TEXT("HTTP/1.1"),NULL, (LPCTSTR*)AcceptTypes, dwFlags, 0); if (hRequest) { TCHAR szSoapAction[256]; _tcscpy( szSoapAction, _T("Content-Type: text/xml;charset=utf-8\n") ); _tcscat( szSoapAction, _T("SOAPAction: \"") ); _tcscat( szSoapAction, _T("http://tempuri.org/HelloWorld") ); _tcscat( szSoapAction , _T("\"\0\r\n\r\n") ); TCHAR szSoap[512]; _tcscpy(pszSoap, _T("") ); _tcscat(pszSoap, _T("") ); _tcscat(pszSoap, _T("") ); _tcscat(pszSoap, _T("") ); _tcscat(pszSoap, _T("") ); _tcscat(pszSoap, _T("") ); // _tcscat(pszSoap, _T("") ); _tcscat(pszSoap, _T("") ); _tcscat(pszSoap, _T("") ); BOOL bSent = HttpSendRequest(hRequest, szSoapAction, _tcslen(szSoapAction), szSoap, _tcslen(szSoap) ); if(bSent) { called HTTPQueryInfo..... } This HTTPQueryInfo returns bad request. But this code works fine on Win32 and give Bad Request on WinCE. Please let me know how should i b
HetalAgrawal
Posts
-
Problem with calling web service using HTTPSendRequest and InternetReadFile on EVC 3.0. -
Problem with calling web service using HTTPSendRequest and InternetReadFile on EVC 3.0.I am trying to call a web service on Pocket PC (ARM processor) using HTTPSendRequest. But when doing InternetReadFile it is giving me incomplete string like this
-
Windows Message handling in Debug and Release build of Dialog Based MFC ApplicationI am working on Dialog based application using MFC in VC++. In that i have handled Row change message of Grid (GRID_WMUSER_ROWCHANGE) its user defined message and I have written handler : for example **CDlg.cpp** ON_MESSAGE( GRID_WMUSER_ROWCHANGE, fun) void Cdlg::fun(int n) { MessageBox(..... } **Cdlg.h** void fun(int n=0) now in the Debug build of the Program this works fine. But when i run the application in the Release build the Program crashes as soon as row change of event of Grid occurs. Now if I correct the above code as **CDlg.cpp** ON_MESSAGE( GRID_WMUSER_ROWCHANGE, OnRowChangeGrdLoad) void Cdlg::fun(int n) { MessageBox(..... } LRESULT CDlg2701::OnRowChangeGrdLoad( WPARAM wParam, LPARAM lParam ) { fun(); } **Cdlg.h file** afx_msg LRESULT OnRowChangeGrdLoad( WPARAM wParam, LPARAM lParam ); After doing this my application works fine in both Debug and Release build. I want to know what is the reason behind this?? why such difference in Debug and Release build ??