How to call WCF service method in windows mobile 6.5 application RRS feed

  • Question

  • Hi,

             We have WCF web service deployee on server. I want to call method of that WCF service in windows mobile 6.5 application for that I have added web refrance in my project to call that WCF service. Now problem is that when I try to call any method of WCF service application throw me error that "Could not establish connection to network."

            I am running our application by using windows mobile 6.5 profestional emulator.

          I have writen following code to check that network connection is present or not


        Public Shared Function CheckWebService(ByVal webServiceURL As String) As Boolean
            Dim result As Boolean = False
                ' Create an HTTP Web request
                Dim request As HttpWebRequest = DirectCast(HttpWebRequest.Create(webServiceURL), HttpWebRequest)
                request.Timeout = 3000

                ' Perform GET
                Dim response As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse)
                If HttpStatusCode.OK = response.StatusCode Then

                    ' HTTP = 200, close the request and return true
                    result = True

                    result = False
                End If
            Catch ex As Exception
                ' Deffinitely offline
                result = False
            End Try
            Return result
        End Function

     please tell me solution for above problem & give me some sample code to call WCF service in windows mobile 6.5 application

    Wednesday, February 15, 2012 10:11 AM


  • Which browser? Is that browser on your desktop or browser running on your device or emulator?

    You don't need to do something special for WCF but of course you must have generic networking configured on emulator. Also not all WCF bindings can work with devices – but for starters you need to reach the server.

    This posting is provided "AS IS" with no warranties, and confers no rights.

    • Proposed as answer by Jesse Jiang Wednesday, February 22, 2012 3:27 AM
    • Marked as answer by sagar04 Wednesday, February 29, 2012 12:42 PM
    Wednesday, February 15, 2012 5:02 PM

All replies