and i need it to talk to a non .net asp web service, now normally i'd just add it as a web reference and use the WSDL to generate an interface object that i can use.
however when i go to the web service i get a xml reply that isn't a WSDL and because of that Visual Studio wont let me add it as a web service.
so how do i do it?
__________________
Definition of a Beginner, Someone who doesn't know the rules.
Definition of an Expert, Someone who knows when to ignore the rules.
okay not working yet but i've got the following code
Code:
Dim http As HttpWebRequest = HttpWebRequest.CreateDefault(New Uri("http://xxxx.xxxx.co.uk/"))
Dim soap As String = ComposeSOAP(dc)
http.Method = "POST"
http.ContentLength = soap.Length
http.ContentType = "Soap"
Dim sendStream As Stream = http.GetRequestStream()
Dim writer As New StreamWriter(sendStream)
Dim reply As String = ""
Try
writer.Write(soap)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Try
Dim res As Boolean = False
For i As Integer = 0 To 100
If http.HaveResponse() Then
Dim ReplyStream As Stream = http.GetResponse.GetResponseStream()
Dim reader As New StreamReader(sendStream)
reply += reader.ReadToEnd()
res = True
reader.Close()
Exit For
End If
' Threading.Thread.Sleep(500)
Next
If Not res Then
Dim ReplyStream As Stream = http.GetResponse.GetResponseStream()
Dim reader As New StreamReader(sendStream)
reply += reader.ReadToEnd()
reader.Close()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
writer.Flush()
writer.Close()
Console.WriteLine(reply)
Return reply
hope this helps anyone else with the same problem
__________________
Definition of a Beginner, Someone who doesn't know the rules.
Definition of an Expert, Someone who knows when to ignore the rules.
Dim http As HttpWebRequest = HttpWebRequest.CreateDefault(New Uri("http://xxxx.xxxx.co.uk/"))
Dim soap As String = ComposeSOAP(dc)
http.Method = "POST"
http.ContentLength = soap.Length
http.ContentType = "Soap"
Dim sendStream As Stream = http.GetRequestStream()
Dim writer As New StreamWriter(sendStream)
Dim reply As String = ""
Try
writer.Write(soap)
Catch ex As Exception
MsgBox(ex.Message)
Finally
writer.Close()
End Try
Try
Dim res As Boolean = False
For i As Integer = 0 To 100
If http.HaveResponse() Then
Dim ReplyStream As Stream = http.GetResponse.GetResponseStream()
Dim reader As New StreamReader(sendStream)
reply += reader.ReadToEnd()
res = True
reader.Close()
Exit For
End If
' Threading.Thread.Sleep(500)
Next
If Not res Then
Dim ReplyStream As Stream = http.GetResponse.GetResponseStream()
Dim reader As New StreamReader(sendStream)
reply += reader.ReadToEnd()
reader.Close()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Console.WriteLine(reply)
Return reply
__________________
Definition of a Beginner, Someone who doesn't know the rules.
Definition of an Expert, Someone who knows when to ignore the rules.