Click here to Skip to main content
15,911,786 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to make an asynchronous call to a web service in vb.net framework 3.5 Pin
dreddy713-Nov-08 4:48
dreddy713-Nov-08 4:48 
GeneralRe: How to make an asynchronous call to a web service in vb.net framework 3.5 Pin
Paul Conrad13-Nov-08 4:50
professionalPaul Conrad13-Nov-08 4:50 
GeneralRe: How to make an asynchronous call to a web service in vb.net framework 3.5 Pin
dreddy713-Nov-08 5:01
dreddy713-Nov-08 5:01 
GeneralRe: How to make an asynchronous call to a web service in vb.net framework 3.5 Pin
Paul Conrad13-Nov-08 5:03
professionalPaul Conrad13-Nov-08 5:03 
GeneralRe: How to make an asynchronous call to a web service in vb.net framework 3.5 Pin
dreddy713-Nov-08 5:07
dreddy713-Nov-08 5:07 
GeneralRe: How to make an asynchronous call to a web service in vb.net framework 3.5 Pin
Paul Conrad13-Nov-08 5:33
professionalPaul Conrad13-Nov-08 5:33 
GeneralRe: How to make an asynchronous call to a web service in vb.net framework 3.5 Pin
Paul Conrad13-Nov-08 5:37
professionalPaul Conrad13-Nov-08 5:37 
GeneralRe: How to make an asynchronous call to a web service in vb.net framework 3.5 Pin
dreddy713-Nov-08 5:57
dreddy713-Nov-08 5:57 
Yeah the web service is running...I am actually new to web services. So, is there any way to confirm if it is actually running or not. And the code that I have on my Windows app is a simple one for now.

On a button click event , it just says:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Cool is the name of my webservice
Dim objService as New Cool.Service
TextBox1.Text = objService.HelloWorld()
end sub

And the web method in the Cool Service is:
<webmethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function

Now what is an asynchronous web request-response? I have the following method which does a httpwebrequest-httpwebresponse:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim myHttpWebRequest As HttpWebRequest
Dim myHttpWebResponse As HttpWebResponse
Dim receiveStream As Stream
Dim encode As Encoding
Dim sr As IO.StreamReader
Dim strUrl As String = "http://localhost:5404/CoolService/Service.asmx"

Try
myHttpWebRequest = CType(WebRequest.Create(strUrl), HttpWebRequest)
myHttpWebResponse = CType(myHttpWebRequest.GetResponse(), HttpWebResponse)
receiveStream = myHttpWebResponse.GetResponseStream()
encode = System.Text.Encoding.GetEncoding("utf-8")
sr = New StreamReader(receiveStream, encode)

Do Until sr.Peek = -1
TextBox2.Text += sr.ReadLine
Loop
Catch ex As System.Net.WebException
MsgBox(ex.Message)
Finally
sr.Close()
myHttpWebResponse.Close()
End Try
End Sub

Is this asynchronous?
GeneralRe: How to make an asynchronous call to a web service in vb.net framework 3.5 Pin
Paul Conrad13-Nov-08 6:15
professionalPaul Conrad13-Nov-08 6:15 
GeneralRe: How to make an asynchronous call to a web service in vb.net framework 3.5 Pin
dreddy713-Nov-08 6:23
dreddy713-Nov-08 6:23 
GeneralRe: How to make an asynchronous call to a web service in vb.net framework 3.5 Pin
Paul Conrad13-Nov-08 6:29
professionalPaul Conrad13-Nov-08 6:29 
GeneralRe: How to make an asynchronous call to a web service in vb.net framework 3.5 Pin
Paul Conrad13-Nov-08 6:42
professionalPaul Conrad13-Nov-08 6:42 
GeneralRe: How to make an asynchronous call to a web service in vb.net framework 3.5 Pin
Paul Conrad13-Nov-08 6:22
professionalPaul Conrad13-Nov-08 6:22 
QuestionAlign form with Excel Window Pin
craigmg7812-Nov-08 9:19
craigmg7812-Nov-08 9:19 
AnswerRe: Align form with Excel Window Pin
Dave Kreskowiak12-Nov-08 10:42
mveDave Kreskowiak12-Nov-08 10:42 
GeneralRe: Align form with Excel Window Pin
craigmg7812-Nov-08 10:59
craigmg7812-Nov-08 10:59 
GeneralRe: Align form with Excel Window Pin
sph3rex12-Nov-08 11:12
sph3rex12-Nov-08 11:12 
GeneralRe: Align form with Excel Window Pin
Dave Kreskowiak13-Nov-08 4:05
mveDave Kreskowiak13-Nov-08 4:05 
QuestionSending Bytes Packet to Remote System Pin
ajorge200812-Nov-08 4:48
ajorge200812-Nov-08 4:48 
AnswerRe: Sending Bytes Packet to Remote System Pin
Dave Kreskowiak12-Nov-08 6:38
mveDave Kreskowiak12-Nov-08 6:38 
AnswerRe: Sending Bytes Packet to Remote System Pin
Rajesh Anuhya12-Nov-08 17:46
professionalRajesh Anuhya12-Nov-08 17:46 
QuestionTrimming special characters in VB 6.0 Pin
indian14312-Nov-08 4:33
indian14312-Nov-08 4:33 
AnswerRe: Trimming special characters in VB 6.0 Pin
Jon_Boy12-Nov-08 6:07
Jon_Boy12-Nov-08 6:07 
GeneralRe: Trimming special characters in VB 6.0 Pin
indian14312-Nov-08 6:12
indian14312-Nov-08 6:12 
GeneralRe: Trimming special characters in VB 6.0 Pin
sph3rex12-Nov-08 6:35
sph3rex12-Nov-08 6:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.