Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. 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.

Scheduled Pinned Locked Moved C / C++ / MFC
help
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HetalAgrawal
    wrote on last edited by
    #1

    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

    H 1 Reply Last reply
    0
    • H HetalAgrawal

      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

      H Offline
      H Offline
      HetalAgrawal
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups