473,386 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ServerXMLHTTP40 eqivalent...

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
12 4931
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
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
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
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
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
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

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

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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: David Callan | last post by:
Hi folks, I'm starting to develop my final year project for college. Just set up dreamweaver site environment. My local machine is windows based running php 5 while my remote machine is unix based...
4
by: Jacek Generowicz | last post by:
How would one write object._new__(SomeType) in the C API ? .... and what lies behind the following behaviour: >>> object.__new__(T) Traceback (most recent call last): File "<stdin>", line 1,...
1
by: Peter Kaufman | last post by:
Hi, Is there anyway with SQL to return just the portion to the left (or right) of the decimal place like FIX or INT in VB? Specifically, I am trying to return just the hh:mm of a datetime...
0
by: Dirk | last post by:
Hi, I am converting a program from VB6 to C#. This is the third in the serious so it's not a question of not knowing how HttpWebRequest, WebRequest or WebClient for that matter work. The problem...
3
by: Gavin Sullivan | last post by:
Hi, I've been trying to post some XML using the above the component but keep getting the following Exception: System.Runtime.InteropServices.COMException (0xC00CE56D) The code is: ...
0
by: K. Wilder | last post by:
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...
0
by: nokia33948 | last post by:
Hi, I am trying to post some data from a VB.net application to an ASP page. This is the routine to post data: sPostString = "CD=" & Now & "&OWNNumber=" & Globals.OwnNumber & "&Pos=" &...
9
by: NagarajanS | last post by:
Hi, can any one tell me the eqivalent for Application.DoEvents() in java.I am swing application so i need to do this to elimate the hangling of my application. Regards, nags.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.