Call Web Service method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rambaldi
    New Member
    • Mar 2007
    • 42

    Call Web Service method

    Hi there

    I'm working on a PDA solution on .NET CF and i want to get data from a MySQL database through Web Services.

    What i just did was:

    Create a Web Service;

    Create a Webmethod getting data on a database;

    add the webservice to the PDA project solution.


    Now, someone can explain me how i can call the webmethods on the PDA project??

    Thanks in Advance.
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    Instantiate the Webservice object and use the method.

    Comment

    • Rambaldi
      New Member
      • Mar 2007
      • 42

      #3
      i cant find the webservice method :S

      Do i have to include any webservice library?

      EDIT: do i need to add any reference/web reference?

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        Yes, you need to add the web reference first.

        Comment

        • Rambaldi
          New Member
          • Mar 2007
          • 42

          #5
          ...And then? i still cant find any WebService Object :S

          How i add the object so i can call the methods???

          EDIT: Done so far. Thanks for the help Alias

          Comment

          • Rambaldi
            New Member
            • Mar 2007
            • 42

            #6
            Hey guys, i am facing another problem:

            When i try to get data from the Webmethod, i get this error:

            "Could not establish connection to network."

            I already verify that my PDA have connection to internet.

            I seen somewhere that i have to change the "localhost" part of url of my WebService to my local machine name, but im not sure how to change it.

            the local machine name would be my local ip (127.0.0.1)? how can i change it?

            i try to use this code:

            Code:
                        DataBaseConnect.Service DBC = new Video_Surveillance_PDA_WM6.DataBaseConnect.Service();
                        //DBC.Url = "http://127.0.0.1:2961/Video%20Surveillance%20PDA%20WM6%20WS/Service.asmx";
                        login = DBC.Login(usernameInput.Text, passwordInput.Text);
            but then i receive another error: "Unable to connect to the remote server"

            Someone can help me?

            Thanks in Advance.

            Comment

            • Rambaldi
              New Member
              • Mar 2007
              • 42

              #7
              I've been all day trying to solve this and i getting some results.

              Through the emulator i can use the WebMethods without any problem, but through the mobile device i am gettin the same errors:

              "Unable to connect to the remote server"

              To make it work on the emulator, i change the Web Reference URL on my Web reference to my network ip. He use to had the "localhost" instead.

              Any tips?

              Thanks in Advance.

              Comment

              Working...