Windows Mobile/Webservices: Unable to connect to the remote server.

Proposed Answer Windows Mobile/Webservices: Unable to connect to the remote server.

  • Tuesday, January 06, 2009 4:47 AM
     
     
     Hai to all:

    I am a developer in .NET CF application development and any help is greatly appreciated...

    I am tryin to develop a web service application which could be accessed through a Windows Mobile 6.1.

    I am using a Windows Mobile 6.1 Windows Mobile HTC 8900 in Visual Studio 2008 to debug the application. 

    when I try to access the web service through the HTC 8900 [EDGE - Vodafone Live - India] i get the following error wheneve a WebMethod is invoked.

    But Windows Mobile 6.0 Emulator by cradling the device using ActiveSync 4.5. with calling web service is working fine.  

    I can browse the web service by tying in http://www.paceebalance.com/test/ebalncews.asmx in the HTC 8900 Device using EDGE connection in web browser. it does not work if i called from program

    EVENT: GetScript( phonenumber=1234500000 , password='', version='0.0')

      ERROR: Unable to connect to the remote server
       at System.Net.HttpWebRequest.finishGetResponse()
       at System.Net.HttpWebRequest.GetResponse()
       at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
       at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke(String methodName, Object[] parameters, WebClientAsyncResult asyncResult)
       at BusinessObjects.WebReference.EBalanceWS.GetScript(String id, String password, String version)
       at BusinessObjects.Configuration.GetScript(String tempPhonenumber)
       at BusinessObjects.Experiment.GetScript(String phonenumber)
       at Presenter.ExperimentPresenter.GetScript(String phonenumber)
       at eBalancePocketPC.PhoneWindow.Enter()
       at eBalancePocketPC.PhoneWindow.enterButton_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)
       at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
       at Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)
       at System.Windows.Forms.Form.ShowDialog()
       at eBalancePocketPC.IdleScreen.AcceptPhoneNumber()
       at eBalancePocketPC.IdleScreen.IdleScreen_Load(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form._SetVisibleNotify(Boolean fVis)
       at System.Windows.Forms.Control.set_Visible(Boolean value)
       at System.Windows.Forms.Application.Run(Form fm)
       at eBalancePocketPC.Program.Main() 

    Regards,
    Vijay


    VijayMP

All Replies

  • Tuesday, January 06, 2009 5:09 AM
     
     

    Hi Vijay,

    Will the application connect if you retry after the first failure? If so, you may wish to try increasing the timeout period.  Also, what version of .NET CF are you using?

    HTH,
    Nino

  • Tuesday, January 06, 2009 5:35 AM
     
     
    Hai Nino,

    Thank you. i ll try....

    Im using CF 3.5 and VS 2008 and C#
    VijayMP
  • Tuesday, January 06, 2009 5:49 AM
     
     
    Hai

    timeout time extended but not working.... Is it ISP provider problem? but the WebService URL is open in IE in windows mobile
    VijayMP
  • Tuesday, January 06, 2009 11:18 AM
     
      Has Code
    One more info...

    WebService - Framework 2.0

    Windows Mobile  - CF 3.5 [WM os version 6.1]

                    pace.testWs  ebWS = new pace.testWs();             
                    ebWS.Timeout = 200000;
                    ebWS.Url = "http://www.pace.com/Test/EWS.asmx";
                    responseString = ebWS.HelloWorld();

  • Wednesday, January 07, 2009 6:28 AM
     
     

    Thanks for the additional information.  You mentioned that you extended the timeout and it did not help, but have you tried retrying the connection attempt after the first failure?

    When you receive this exception, is there any additional data in the Status property of the WebException (which will tell you the error type - connection fail, DNS fail, etc) or the Response and InnerException properties?  



  • Wednesday, July 08, 2009 1:31 PM
     
      Has Code
    I have similar problem, but much more strange. We have PDAs moving in a large area covered by several wifi routers. Sometimes suddenly this shows up in the log:
    Error: Unable to connect to the remote server
    v System.Net.HttpWebRequest.finishGetResponse()
    v System.Net.HttpWebRequest.GetResponse()
    v Profinit.Mobile.Gha.Ws.MobWebResponse..ctor(WebRequest request)
    v Profinit.Mobile.Gha.Ws.MobWebServiceBase.GetWebResponse(WebRequest request)
    v System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke(String methodName, Object[] parameters, WebClientAsyncResult asyncResult)
    v Profinit.Mobile.Gha.Ws.LoginService.WsLoginServiceService.Logout()
    v Profinit.Mobile.Gha.Client.UserManager.Logout()
    v Profinit.Mobile.Gha.Client.AppManager.End()
    v Profinit.Mobile.Gha.Client.Login.LoginController.OnExit(Object sender, EventArgs e)
    v Profinit.Mobile.Gha.Client.Login.LoginView.miExit_Click(Object sender, EventArgs e)
    v System.Windows.Forms.MenuItem.OnClick(EventArgs e)
    v System.Windows.Forms.Menu.ProcessMnuProc(Control ctlThis, WM wm, Int32 wParam, Int32 lParam)
    v System.Windows.Forms.Form.WnProc(WM wm, Int32 wParam, Int32 lParam)
    v System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
    v Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
    v System.Windows.Forms.Application.Run(Form fm)
    v Profinit.Mobile.Gha.Client.AppManager.Start()
    v Profinit.Mobile.Gha.Client.Program.Main()
    After first problem of this type, every other request fails for several minutes (sometimes hours), although the device seems connected. What's strange is that restarting the application doesn't help! And what's even more strange is that I can visit the address of WS with internet explorer from the device!!! I can't think of any scenario in which this can happen. Or is there some connection pool that survives application restart? So that it could be explained by having some wrong tcp connection (for example after moving to another wifi router) in such pool? Maybe the important information is that ws server is java based (glassfish+metro). Please help, this seems like a total mystery to me.
  • Wednesday, July 08, 2009 1:37 PM
     
     
    Hi Vijay & calavera.info ,

    You are make sure that internet connection available in your device or emulator ? Just test is your web service is open in your device or emulator browser ?


    let me know, may be i can help you :)





    Pavan Pareta | If you find my post is helpful for you then mark as a answer.
  • Wednesday, July 08, 2009 1:55 PM
     
     Proposed Answer
    Internet connection is not available since it operates on a private network but as I wrote:
    "And what's even more strange is that I can visit the address of WS with internet explorer from the device!!!"
    • Proposed As Answer by Jorge_Armando Tuesday, August 11, 2009 2:05 PM
    •