By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,534 Members | 1,830 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,534 IT Pros & Developers. It's quick & easy.

ServerXMLHTTP40 eqivalent...

P: n/a
In my ASP.Net application I'm trying to contact a host that does not have a
web service, i.e.: a file with the asmx extension such as, anything.asmx.

They do have an URL to be contacted by VB 6.0 ServerXMLHTTP40 Send method.
I've been communicating with them using VB 6.0 method for a couple years now
and I'd like to update my application to use .Net.

Is there a way I can communicate with this service using .Net?

Thanks,

King Wilder
Nov 23 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
HTTPWebRequest ?
See
http://msdn.microsoft.com/library/en...classtopic.asp
for more details

Stefan
"K. Wilder" <KW*****@discussions.microsoft.com> schrieb im Newsbeitrag
news:5F**********************************@microsof t.com...
In my ASP.Net application I'm trying to contact a host that does not have
a
web service, i.e.: a file with the asmx extension such as, anything.asmx.

They do have an URL to be contacted by VB 6.0 ServerXMLHTTP40 Send method.
I've been communicating with them using VB 6.0 method for a couple years
now
and I'd like to update my application to use .Net.

Is there a way I can communicate with this service using .Net?

Thanks,

King Wilder

Nov 23 '05 #2

P: n/a
HTTPWebRequest ?
See
http://msdn.microsoft.com/library/en...classtopic.asp
for more details

Stefan
"K. Wilder" <KW*****@discussions.microsoft.com> schrieb im Newsbeitrag
news:5F**********************************@microsof t.com...
In my ASP.Net application I'm trying to contact a host that does not have
a
web service, i.e.: a file with the asmx extension such as, anything.asmx.

They do have an URL to be contacted by VB 6.0 ServerXMLHTTP40 Send method.
I've been communicating with them using VB 6.0 method for a couple years
now
and I'd like to update my application to use .Net.

Is there a way I can communicate with this service using .Net?

Thanks,

King Wilder

Nov 23 '05 #3

P: n/a
You'd want the HTTPWebRequest but you wouldn't be using it with an .asmx
file since .asmx files are exclusively for .NET web services.
"K. Wilder" <KW*****@discussions.microsoft.com> wrote in message
news:5F**********************************@microsof t.com...
In my ASP.Net application I'm trying to contact a host that does not have
a
web service, i.e.: a file with the asmx extension such as, anything.asmx.

They do have an URL to be contacted by VB 6.0 ServerXMLHTTP40 Send method.
I've been communicating with them using VB 6.0 method for a couple years
now
and I'd like to update my application to use .Net.

Is there a way I can communicate with this service using .Net?

Thanks,

King Wilder

Nov 23 '05 #4

P: n/a
You'd want the HTTPWebRequest but you wouldn't be using it with an .asmx
file since .asmx files are exclusively for .NET web services.
"K. Wilder" <KW*****@discussions.microsoft.com> wrote in message
news:5F**********************************@microsof t.com...
In my ASP.Net application I'm trying to contact a host that does not have
a
web service, i.e.: a file with the asmx extension such as, anything.asmx.

They do have an URL to be contacted by VB 6.0 ServerXMLHTTP40 Send method.
I've been communicating with them using VB 6.0 method for a couple years
now
and I'd like to update my application to use .Net.

Is there a way I can communicate with this service using .Net?

Thanks,

King Wilder

Nov 23 '05 #5

P: n/a
Yes, HTTPWebRequest did the trick. Thanks.

"Stefan Misch" wrote:
HTTPWebRequest ?
See
http://msdn.microsoft.com/library/en...classtopic.asp
for more details

Stefan
"K. Wilder" <KW*****@discussions.microsoft.com> schrieb im Newsbeitrag
news:5F**********************************@microsof t.com...
In my ASP.Net application I'm trying to contact a host that does not have
a
web service, i.e.: a file with the asmx extension such as, anything.asmx.

They do have an URL to be contacted by VB 6.0 ServerXMLHTTP40 Send method.
I've been communicating with them using VB 6.0 method for a couple years
now
and I'd like to update my application to use .Net.

Is there a way I can communicate with this service using .Net?

Thanks,

King Wilder


Nov 23 '05 #6

P: n/a
Yes, HTTPWebRequest did the trick. Thanks.

"Stefan Misch" wrote:
HTTPWebRequest ?
See
http://msdn.microsoft.com/library/en...classtopic.asp
for more details

Stefan
"K. Wilder" <KW*****@discussions.microsoft.com> schrieb im Newsbeitrag
news:5F**********************************@microsof t.com...
In my ASP.Net application I'm trying to contact a host that does not have
a
web service, i.e.: a file with the asmx extension such as, anything.asmx.

They do have an URL to be contacted by VB 6.0 ServerXMLHTTP40 Send method.
I've been communicating with them using VB 6.0 method for a couple years
now
and I'd like to update my application to use .Net.

Is there a way I can communicate with this service using .Net?

Thanks,

King Wilder


Nov 23 '05 #7

P: n/a

Could you please provide a sample code how you use HttpWebRequest object
instead of MSXML2.ServerXMLHTTP40?

Thanks, Eugene.
*** Sent via Developersdex http://www.developersdex.com ***
Nov 23 '05 #8

P: n/a

Could you please provide a sample code how you use HttpWebRequest object
instead of MSXML2.ServerXMLHTTP40?

Thanks, Eugene.
*** Sent via Developersdex http://www.developersdex.com ***
Nov 23 '05 #9

P: n/a
Eugene,

I wrapped up the HTTP functions in a separate class.

I hope this helps.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Imports System.Net
Imports System.IO
Imports System.Text

Public Class MasterPost

#Region "Public Functions"
Public Shared Function PostMessage(ByVal Message As String, ByVal URL As
String) As XmlNode

Try
'~~~ Set the data to send
Dim postData As String = Message
Dim encoding As New ASCIIEncoding
Dim byte1 As Byte() = encoding.GetBytes(postData)
Dim request As HttpWebRequest = CType(WebRequest.Create(URL),
HttpWebRequest)

'~~~ Set the Request properties and send the data.
request.ContentType = "text/xml"
request.ContentLength = postData.Length
request.Method = "POST"
Dim newStream As Stream = request.GetRequestStream()
newStream.Write(byte1, 0, byte1.Length)
newStream.Close()

'~~~ Get the response.
Dim response As HttpWebResponse = CType(request.GetResponse(),
HttpWebResponse)
Dim recvStream As Stream = response.GetResponseStream()
Dim readStream As New StreamReader(recvStream, encoding.UTF8)

Dim objXml As New XmlDocument
Dim objBody As XmlNode
Dim objRoot As XmlElement

objXml.XmlResolver = Nothing
objXml.LoadXml(strXml)
objRoot = objXml.DocumentElement
objBody = objRoot.SelectSingleNode("//AvailableResponse")

Debug.WriteLine(objBody.OuterXml)

Return objBody

objBody = Nothing
objXml = Nothing

response.Close()
readStream.Close()
Catch ex As Exception
Return Nothing
Throw ex
End Try
End Function
#End Region
End Class
"Eugene Kosnyrev" wrote:

Could you please provide a sample code how you use HttpWebRequest object
instead of MSXML2.ServerXMLHTTP40?

Thanks, Eugene.
*** Sent via Developersdex http://www.developersdex.com ***

Nov 23 '05 #10

P: n/a
Eugene,

I wrapped up the HTTP functions in a separate class.

I hope this helps.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Imports System.Net
Imports System.IO
Imports System.Text

Public Class MasterPost

#Region "Public Functions"
Public Shared Function PostMessage(ByVal Message As String, ByVal URL As
String) As XmlNode

Try
'~~~ Set the data to send
Dim postData As String = Message
Dim encoding As New ASCIIEncoding
Dim byte1 As Byte() = encoding.GetBytes(postData)
Dim request As HttpWebRequest = CType(WebRequest.Create(URL),
HttpWebRequest)

'~~~ Set the Request properties and send the data.
request.ContentType = "text/xml"
request.ContentLength = postData.Length
request.Method = "POST"
Dim newStream As Stream = request.GetRequestStream()
newStream.Write(byte1, 0, byte1.Length)
newStream.Close()

'~~~ Get the response.
Dim response As HttpWebResponse = CType(request.GetResponse(),
HttpWebResponse)
Dim recvStream As Stream = response.GetResponseStream()
Dim readStream As New StreamReader(recvStream, encoding.UTF8)

Dim objXml As New XmlDocument
Dim objBody As XmlNode
Dim objRoot As XmlElement

objXml.XmlResolver = Nothing
objXml.LoadXml(strXml)
objRoot = objXml.DocumentElement
objBody = objRoot.SelectSingleNode("//AvailableResponse")

Debug.WriteLine(objBody.OuterXml)

Return objBody

objBody = Nothing
objXml = Nothing

response.Close()
readStream.Close()
Catch ex As Exception
Return Nothing
Throw ex
End Try
End Function
#End Region
End Class
"Eugene Kosnyrev" wrote:

Could you please provide a sample code how you use HttpWebRequest object
instead of MSXML2.ServerXMLHTTP40?

Thanks, Eugene.
*** Sent via Developersdex http://www.developersdex.com ***

Nov 23 '05 #11

P: n/a
Scott,

You are correct. I am using this object because I need to communicate with
a non-.Net web service.

King

"Scott M." wrote:
You'd want the HTTPWebRequest but you wouldn't be using it with an .asmx
file since .asmx files are exclusively for .NET web services.
"K. Wilder" <KW*****@discussions.microsoft.com> wrote in message
news:5F**********************************@microsof t.com...
In my ASP.Net application I'm trying to contact a host that does not have
a
web service, i.e.: a file with the asmx extension such as, anything.asmx.

They do have an URL to be contacted by VB 6.0 ServerXMLHTTP40 Send method.
I've been communicating with them using VB 6.0 method for a couple years
now
and I'd like to update my application to use .Net.

Is there a way I can communicate with this service using .Net?

Thanks,

King Wilder


Nov 23 '05 #12

P: n/a
Scott,

You are correct. I am using this object because I need to communicate with
a non-.Net web service.

King

"Scott M." wrote:
You'd want the HTTPWebRequest but you wouldn't be using it with an .asmx
file since .asmx files are exclusively for .NET web services.
"K. Wilder" <KW*****@discussions.microsoft.com> wrote in message
news:5F**********************************@microsof t.com...
In my ASP.Net application I'm trying to contact a host that does not have
a
web service, i.e.: a file with the asmx extension such as, anything.asmx.

They do have an URL to be contacted by VB 6.0 ServerXMLHTTP40 Send method.
I've been communicating with them using VB 6.0 method for a couple years
now
and I'd like to update my application to use .Net.

Is there a way I can communicate with this service using .Net?

Thanks,

King Wilder


Nov 23 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.