WinHttp.WinHttpRequest and POST.....why not work??
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > WinHttp.WinHttpRequest and POST.....why not work??




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-30-04 12:50 PM

I have the following codes in an asp file. This page can receive the XML str
ing 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.








[ Post a follow-up to this message ]



    Re: WinHttp.WinHttpRequest and POST.....why not work??  
Patrice


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-30-04 12:50 PM

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.
>
>
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:34 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register