Results 1 to 2 of 2

Thread: Using a Web Service in Silverlight 3 and VB.net 2008

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2008
    Posts
    98

    Using a Web Service in Silverlight 3 and VB.net 2008

    Hi guys,

    Im using Silver light 3 in vb.net Visual Studio 2008.

    My web service had simply test functions a the moment including the standard 'Hello World' function.
    I have referenced the web service no problem in Silver light but im really stuck how to return my 'hello world' function. Iv seen various examples on the net but im really stuck as to how to use them as the are in c#

    here is my code iv got so far.....

    Dim t As New ColonySL.ServiceReference1.ColonySLSoapClient
    t.HelloWorldAsync()

    but whatever i try will not return the simple 'hello world' string

    had anybody got a simple example in vb?

    Thanks

  2. #2
    Junior Member
    Join Date
    Apr 2008
    Posts
    21

    Re: Using a Web Service in Silverlight 3 and VB.net 2008

    Try putting a control such as a TextBlock on your form. We can call it txt1 if you want.

    Have to add a new procedure, We can call it "t_Completed. This is what the procedure should look like:

    Public sub t_Completed(ByVal sender As Object, ByVal e As t.Hello_WorldCompletedEventArgs)
    txt1.text=e.Result
    end sub

    Now we need an event handler to handle the completed event. After the line it should look like this:

    Dim t As New ColonySL.ServiceReference1.ColonySLSoapClient
    t.HelloWorldAsync()
    AddHandler t.Hello_WorldCompleted, AddressOf t_Completed

    Now you can call your service with a

    t.Hello_World()

    When this is done you will see "Hello World" in your textbox.

    I hope this works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width