472,328 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

request and responses

The below partial code gets UPS rates. It's based on a request and response.
I can get the request to write to screen with "response.write
server.HTMLEncode(strXML)".

How can I get the response to write to screen so I can see what's being
returned by UPS?
thanks

<%
strXML is established above here.....
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST","https://www.ups.com/ups.app/xml/Rate?",false
xmlhttp.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= = = = =
'this code writes UPS XML Request and Response to screen
' response.write server.HTMLEncode(strXML)
' response.End()
' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= = = = =
xmlhttp.send strXML
xml_response = xmlhttp.responseText
Set mydoc=Server.CreateObject("Microsoft.xmlDOM")
mydoc.loadxml( xml_response )
Set Response_NodeList = mydoc.documentElement.selectNodes("Response")
ups_result =
Response_NodeList.Item(0).selectSingleNode("Respon seStatusCode").Text
......
%>
Aug 13 '06 #1
4 2104
shank wrote:
The below partial code gets UPS rates. It's based on a request and
response. I can get the request to write to screen with
"response.write server.HTMLEncode(strXML)".

How can I get the response to write to screen so I can see what's
being returned by UPS?
thanks

<%
<snip>
Response.ContentType="text/xml"
myDoc.Save Response
%>
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Aug 13 '06 #2


shank wrote:

How can I get the response to write to screen so I can see what's being
returned by UPS?
thanks

<%
strXML is established above here.....
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST","https://www.ups.com/ups.app/xml/Rate?",false
xmlhttp.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= = = = =
'this code writes UPS XML Request and Response to screen
' response.write server.HTMLEncode(strXML)
' response.End()
' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= = = = =
xmlhttp.send strXML
Response.ContentType = "application/xml"
xmlhttp.responseXML.save Response

is one way to send the XML directly to the browser (where then for
instance IE and Mozilla will apply XSL to show the XML pretty printed).
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Aug 13 '06 #3

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:Or**************@TK2MSFTNGP03.phx.gbl...
shank wrote:
>The below partial code gets UPS rates. It's based on a request and
response. I can get the request to write to screen with
"response.write server.HTMLEncode(strXML)".

How can I get the response to write to screen so I can see what's
being returned by UPS?
thanks

<%
<snip>
Response.ContentType="text/xml"
myDoc.Save Response
>%>

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
====================
I tried both examples given as below and get the same results. I get parse
errors for not having closed tags like </link>, </br>, etc. Is there a way
to "only" get the response from UPS to the screen and not the whole page?
thanks!
<%
strXML is established above here.....
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST","https://www.ups.com/ups.app/xml/Rate?",false
xmlhttp.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"

'Response.ContentType="text/xml"
'myDoc.Save Response

Response.ContentType = "application/xml"
xmlhttp.responseText.save Response

xmlhttp.send strXML
......
%>
Aug 13 '06 #4
shank wrote:
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:Or**************@TK2MSFTNGP03.phx.gbl...
>shank wrote:
>>The below partial code gets UPS rates. It's based on a request and
response. I can get the request to write to screen with
"response.write server.HTMLEncode(strXML)".

How can I get the response to write to screen so I can see what's
being returned by UPS?
thanks

<%
<snip>
Response.ContentType="text/xml"
myDoc.Save Response
>>%>

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so
I don't check it very often. If you must reply off-line, then remove
the "NO SPAM"
====================
I tried both examples given as below and get the same results. I get
parse errors for not having closed tags like </link>, </br>, etc. Is
there a way to "only" get the response from UPS to the screen and not
the whole page? thanks!
<%
strXML is established above here.....
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST","https://www.ups.com/ups.app/xml/Rate?",false
xmlhttp.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"

'Response.ContentType="text/xml"
'myDoc.Save Response

Response.ContentType = "application/xml"
xmlhttp.responseText.save Response

xmlhttp.send strXML
.....
%>
You have to call send BEFORE attempting to write the result to response.

Have you looked at the example at aspfaq?
http://www.aspfaq.com/show.asp?id=2173

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Aug 13 '06 #5

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

Similar topics

0
by: Doug Farrell | last post by:
Hi everyone, I'm trying to build a program to interface to a SOAP/XML interface provided by one of our vendors. This interface is built with MS...
0
by: johno | last post by:
I have a web service written in VB that tries to post to a XML feed using a HTTP web request. Occasionally, usually when the server is under...
5
by: TomR | last post by:
We are having problems with synchronus web request calls blocking our ASP.NET performance. Here is the setup: We have a php script running on...
2
by: PJ | last post by:
Is there any tool out there similar to the trace utility on the SOAP toolkit that allow you to see the full Http Requests and Responses? I'm sure...
2
by: Rein Petersen | last post by:
Hi All, I've recently been intrigued with this notion of "Service Streaming": http://ajaxpatterns.org/HTTP_Streaming in which you make use...
25
by: Matt Kruse | last post by:
According to HTTP/1.1 specs, a client should only have two connections open to the host at a time (which can be changed by browser users, of...
17
by: petermichaux | last post by:
Hi, Is it possible for an AJAX request to be left open for multiple responses? This could avoid repetitive polling of the server. Thanks,...
0
by: mpdoreilly | last post by:
Hi, I've a webservice that has several typical webmethods that clients call and get responses from. (Side note: The websriivce is actually to...
5
by: scripteaze | last post by:
ok, im new to this sort of coding so excuse me if im not exactly sure as to what i need to pull this off. I need to be able to send a rip1...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

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.