#1 (permalink)  
Old 08-15-08, 08:21 AM
m.timoney's Avatar
m.timoney m.timoney is offline
Newbie Coder
 
Join Date: Jan 2007
Location: Leicester - UK
Posts: 76
Thanks: 1
Thanked 0 Times in 0 Posts
Question [SOLVED] Asp

I have a winforms application,

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.
Reply With Quote
  #2 (permalink)  
Old 08-19-08, 04:50 AM
m.timoney's Avatar
m.timoney m.timoney is offline
Newbie Coder
 
Join Date: Jan 2007
Location: Leicester - UK
Posts: 76
Thanks: 1
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #3 (permalink)  
Old 08-19-08, 10:18 AM
m.timoney's Avatar
m.timoney m.timoney is offline
Newbie Coder
 
Join Date: Jan 2007
Location: Leicester - UK
Posts: 76
Thanks: 1
Thanked 0 Times in 0 Posts
This one works
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)
        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.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP Formmail from BrainJar slayers ASP 2 03-22-09 03:37 PM
transition from html to asp pages ylz ASP 0 09-07-05 08:15 PM
ASP and JMAIL bdannels ASP 1 01-04-05 07:36 AM
Can ASP check registry janice_2k ASP 0 05-31-04 03:28 AM
PHP integrated with ASP Mikeirv PHP 7 05-25-04 05:00 AM


All times are GMT -5. The time now is 02:17 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.