473,790 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WinHttp.WinHttp Request and POST.....why not work??

I have the following codes in an asp file. This page can receive the XML string send from client.
=============== =============== =============== =====
Dim objReceive
Set objReceive = Server.CreateOb ject("Microsoft .XMLDOM")
objReceive.asyn c=false

On Error Resume Next
objReceive.load (Request)

if objReceive.xml <> "" then
Dim objWinHttp
Dim strHTML

Set objWinHttp = Server.CreateOb ject("WinHttp.W inHttpRequest.5 ")
'Set objWinHttp = Server.CreateOb ject("Msxml2.Se rverXMLHTTP")
objWinHttp.Open "POST", "http://localhost/bank/Trx.asp", false
objWinHttp.Send objReceive.xml

Response.Write( "Status: " & objWinHttp.Stat us & " " & objWinHttp.Stat usText)
strHTML = objWinHttp.Resp onseText
Set objWinHttp = Nothing

else
Response.Write( "You have reached a secure site." )
end if
=============== =============== =============== ======

objReceive.xml ===> contains the XML string from client
After receiving the XML string, the string need to be sent to another page, http://localhost/bank/Trx.asp.

objWinHttp.Open "POST", "http://localhost/bank/Trx.asp", false
But I cannot get the XML string in the Trx.asp, anything wrong with my code?
The 3rd parametere should I use false or true?

It's a simple code, but I still cannot figure out what is wrong. Pls comment. Thanks a lot.

Jul 19 '05 #1
1 20113
I would start by removing "On Error Resume Next" to avoid hiding a possible
runtime error. Do you have an error now when running this code ?

The doc is at :
http://msdn.microsoft.com/library/de...quest_open.asp

Patrice

--

"Francis" <Fr*****@discus sions.microsoft .com> a écrit dans le message de
news:CB******** *************** ***********@mic rosoft.com...
I have the following codes in an asp file. This page can receive the XML string send from client.

=============== =============== =============== =====
Dim objReceive
Set objReceive = Server.CreateOb ject("Microsoft .XMLDOM")
objReceive.asyn c=false

On Error Resume Next
objReceive.load (Request)

if objReceive.xml <> "" then
Dim objWinHttp
Dim strHTML

Set objWinHttp = Server.CreateOb ject("WinHttp.W inHttpRequest.5 ")
'Set objWinHttp = Server.CreateOb ject("Msxml2.Se rverXMLHTTP")
objWinHttp.Open "POST", "http://localhost/bank/Trx.asp", false
objWinHttp.Send objReceive.xml

Response.Write( "Status: " & objWinHttp.Stat us & " " & objWinHttp.Stat usText) strHTML = objWinHttp.Resp onseText
Set objWinHttp = Nothing

else
Response.Write( "You have reached a secure site." )
end if
=============== =============== =============== ======

objReceive.xml ===> contains the XML string from client
After receiving the XML string, the string need to be sent to another page, http://localhost/bank/Trx.asp.
objWinHttp.Open "POST", "http://localhost/bank/Trx.asp", false
But I cannot get the XML string in the Trx.asp, anything wrong with my code? The 3rd parametere should I use false or true?

It's a simple code, but I still cannot figure out what is wrong. Pls comment. Thanks a lot.

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2608
by: thueirby | last post by:
h when i try to get data from site with clients sertificates with winHttp, I have a problem with result encoding (ru). Its OK with any sites without client sertificates, and its OK when i try to do it manualy with IE any help would be really great script looks like that Set oHttp = CreateObject("WinHttp.WinHttpRequest.5") oHttp.Option(2) = "Windows-1251" ' WinHttpRequestOption_URLCodePage = 2
0
3167
by: kaushalmbhavsar | last post by:
I am working on one VB.NET application where I am using WinHttp.dll to post request on website. First request is for Login Page and I have gone through all input types of that page and pass those variables and value pair in Send method of WinHTTPRequest but it is not works. Let' me inform you that this login page has viewstate hidden input type, so should I have to pass it in post string (String for Send method argument) list of Input...
3
19137
by: kaushalmbhavsar | last post by:
I am working on one VB.NET application where I am using WinHttp.dll to post request on website. First request is for Login Page and I have gone through all input types of that page and pass those variables and value pair in Send method of WinHTTPRequest but it is not works. Let' me inform you that this login page has viewstate hidden input type, so should I have to pass it in post string (String for Send method argument) list of Input...
1
2291
by: Gaetan | last post by:
I'm doing a prrof of concept to develop an application to run under WinPE. The application will use WinHTTP to send requests to an ASPX file running IIS 6.0 My problem is that I do not know how to prevent IIS from returning the HTTP code of the ASPX page. The client side use something like this to initiate the request: set obj1 = createobject("WinHttp.WinHttpRequest.5.1") obj1.SetProxy HTTPREQUEST_PROXYSETTING_DIRECT obj1.Open "GET",...
0
1548
by: teju | last post by:
Hi, I have an application which is supposed to alert me whenever it gets response status other than 200. How do i make sure that it alerts me only when it has got the response text from the server as ok ie. it has completed sending the request using winhttprequest object not when its still under the loading stage. Could any one please help me out with this!!! Many thanks
1
1728
by: flyingchen | last post by:
The problem is about the new version of the WinHttp.dll. My Code like this : public string Do(string Method,string Url,Object Async) { WinHttpRequest winHttpReq = new WinHttp.WinHttpRequestClass(); winHttpReq.OnResponseStart += new IWinHttpRequestEvents_OnResponseStartEventHandler(winHttpReq_OnResponseStart);
2
2730
by: flyingchen | last post by:
The problem is about the new version of the WinHttp.dll. My Code like this : public string Do(string Method,string Url,Object Async) { WinHttpRequest winHttpReq = new WinHttp.WinHttpRequestClass(); winHttpReq.OnResponseStart += new IWinHttpRequestEvents_OnResponseStartEventHandler(winHttpReq_OnResponseStart);
5
2624
by: neilx | last post by:
I have a WinHttp.WinHttpRequest.5.1 object that works perfectly when GETing .htm pages, but times out when trying to GET .asp pages. I have tried using setCredentials: Set Http = CreateObject("WinHttp.WinHttpRequest.5.1") Http.Open "GET", "http://<path>/filename.asp", False Http.setCredentials "<domain>\Administrator", "<password>",0 Http.Send
0
4948
by: Brian Pitt | last post by:
Hi I am trying to use WinHttp.WinHttpRequest.5.1 to access an https (ssl) page on an Oracle-Application-Server-10g and I keep getting a -2147483638 error. I am able to use the exact same script to access https pages on other servers and I can access http requests on oracle application servers. The problem is isolated to accessing https pages on oracle application servers and I have now come up against this problem with three of my
0
9666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10413
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4094
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.