IIS ASP - WinHttp.WinHttpRequest and POST.....why not work??

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > June 2004 > WinHttp.WinHttpRequest and POST.....why not work??





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author WinHttp.WinHttpRequest and POST.....why not work??
Francis

2004-06-30, 7:50 am

I have the following codes in an asp file. This page can receive the XML string send from client.


========================================
==========
Dim objReceive
Set objReceive = Server.CreateObject("Microsoft.XMLDOM")
objReceive.async=false

On Error Resume Next
objReceive.load(Request)

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

Set objWinHttp = Server.CreateObject("WinHttp.WinHttpRequest.5")
'Set objWinHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objWinHttp.Open "POST", "http://localhost/bank/Trx.asp", false
objWinHttp.Send objReceive.xml

Response.Write( "Status: " & objWinHttp.Status & " " & objWinHttp.StatusText)
strHTML = objWinHttp.ResponseText
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.



Patrice

2004-06-30, 7:50 am

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/d...equest_open.asp

Patrice

--

"Francis" <Francis@discussions.microsoft.com> a écrit dans le message de
news:CB58C93C-2860-487B-B463-831FBC31CABF@microsoft.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.CreateObject("Microsoft.XMLDOM")
> objReceive.async=false
>
> On Error Resume Next
> objReceive.load(Request)
>
> if objReceive.xml <> "" then
> Dim objWinHttp
> Dim strHTML
>
> Set objWinHttp = Server.CreateObject("WinHttp.WinHttpRequest.5")
> 'Set objWinHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
> objWinHttp.Open "POST", "http://localhost/bank/Trx.asp", false
> objWinHttp.Send objReceive.xml
>
> Response.Write( "Status: " & objWinHttp.Status & " " &

objWinHttp.StatusText)
> strHTML = objWinHttp.ResponseText
> 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.
>
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com