Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Parseing XML in ASP Page >Thread Next - Re: Parseing XML in ASP Page Re: Parseing XML in ASP PageTo: NULL Date: 11/1/2005 12:21:00 PM Yeah, I meant Rate Calculator :)
So is this all in Javascript?
Which leads me to another question...am I doing this correctly?
<%
Dim RateType
Dim uspsURL
Dim objSrvHTTP
RateType = "API=RateV2&xml="
strMessage = "<RateV2Request%20USERID='300CYBER3079'>" & _
"<Package%20ID='0'>" & _
"<Service>All</Service>" & _
"<ZipOrigination>19154</ZipOrigination>" & _
"<ZipDestination>08060</ZipDestination>" & _
"<Pounds>10</Pounds>" & _
"<Ounces>5</Ounces>" & _
"<Size>LARGE</Size>" & _
"<Machinable>TRUE</Machinable>" & _
"</Package>" & _
"</RateV2Request>"
uspsURL = "http://production.shippingapis.com/ShippingAPI.dll?"
strxml = RateType & strMessage
Set objSrvHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
objSrvHTTP.open "POST", uspsURL, false
objSrvHTTP.send (strxml)
strResponseMessage = objSrvHTTP.responseText
response.write strResponseMessage
%>
Or should I be using VBScript JScript or Javascript?
Thanks in advance.
"Martin Honnen" wrote:
>
>
> Earl F. Kimble Jr. wrote:
>
> > As long as you guys are on the subject, I have been trying to do something
> > similar with the USPS Rat Calculator API.
>
> Rat Calculator? Nice one :)
>
>
> > Can I use HttpRequest.responseXML.save without naming a file?
>
> If the server you make the HTTP request to sends content with a
> Content-Type of text/xml or application/xml then the XMLHTTP object
> parses the response body as XML and populates responseXML as a
> DOMDocument so you can then do all DOM or XPath stuff with responseXML
> to extract data. No need to save that to the file system.
>
> Either do e.g.
>
> HttpRequest.responseXML.selectSingleNode("element-name/child-element-name")
>
> or store it in a variable for shorter expressions e.g.
> Dim RespXml
> Set RespXml = HttpRequest.responseXML
> to then use e.g.
> RespXml.selectSingleNode("element-name/child-element-name")
>
>
> --
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
