473,385 Members | 1,693 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,385 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 2156
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 SOAP Toolkit 3.0, so I'm guessig they are running...
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 load, some of the responses received do not match the...
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 Apache at Site A on the internet. This script does...
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 it's easy enough write a module that would log it,...
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 of the webserver and browsers ability to maintain...
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 course). When using xmlHttpRequest connections, is...
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, Peter
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 implement the server side of tr-069, the protocol...
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 request to my rip1 enabled device., so i need python to...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.