Wrox Programmer Forums
|
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 27th, 2012, 01:41 PM
Registered User
 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help How to receive an XML request. HELP!

I write code everyday using standard HTML & classic ASP. I have been asked to build a small API which will use our ASP/html platform and MS SQL DB. I have no trouble dealing with the ASP/SQL, HTML etc. I can even write the XML requests to query our servers and write the XML responses. But I have no idea where to start in setting up a service to "listen" for inbound XML requests. I have prepared about a dozen request/response routines, but do not know how to code the page that receives that request. Can anyone out there offfer a hand?

One of our methods/functions for them to request is a simple Category List request. I can make the request just fine, It is just that I do not know how to receive the request at server and parse in order to use my own response routine.

I have made a sample request below, I just need to know how to handle the web service page to receive this request and respond with the data. I am already committed with my web application to Classic ASP. Any help would be greatly appreciated. Please see below. It may be as simple as a few line, but I have not seen anywhere I've searched.



REQUEST:
<code>
<%
'Request ******

WAGconnect = "http://www....."
set xmldom = server.CreateObject("Microsoft.XMLDOM")
set xmlhttp = server.CreateObject("Microsoft.XMLHTTP")

xmlhttp.open "POST", WAGconnect, false
xmlhttp.setRequestHeader "Man", POST & " " & WAGconnect & " HTTP/1.1"
xmlhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
xmlhttp.setRequestHeader "SOAPAction", "http://www.MyDomainConnection...."

StrSoap = StrSoap & "<?xml version=""1.0"" encoding=""utf-8""?>"
StrSoap = StrSoap & "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">"
StrSoap = StrSoap & "<soap:Body>"
StrSoap = StrSoap & "<Get_Categories>"
StrSoap = StrSoap & "<Authentication>"
StrSoap = StrSoap & "<UserID>"&UserID&"</UserID>"
StrSoap = StrSoap & "<Password>"&Password&"</Password>"
StrSoap = StrSoap & "</Authentication>"
StrSoap = StrSoap & "<DealerInfo>"
StrSoap = StrSoap & "<DealerID>"&DealerID&"</DealerID>"
StrSoap = StrSoap & "<StoreID>"&StoreID&"</StoreID>"
StrSoap = StrSoap & "</DealerInfo>"
StrSoap = StrSoap & "<CatInfo>"
StrSoap = StrSoap & "<Dept>"&Dept&"</Dept>"
StrSoap = StrSoap & "</CatInfo>"
StrSoap = StrSoap & "</Get_Categories>"
StrSoap = StrSoap & "</soap:Body>"
StrSoap = StrSoap & "</soap:Envelope>"

WAGRequest = StrSoap

xmlhttp.send(WAGRequest)

%>

</code>



*********
NEED HELP HERE !

The problem is HERE. not knowing how to listen for and receive the above request at my server. Ive never done it before so I do not know what to look for.
*********



RESPONSE
<code>
<%
' Response ******
StrSoap = StrSoap & "<?xml version=""1.0"" encoding=""utf-8"" ?>"
StrSoap = StrSoap & "<soapenv:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"">"
StrSoap = StrSoap & "<soap:Body>"
StrSoap = StrSoap & "<Get_Categories xmlns=""urn:externalwsdl"">"
StrSoap = StrSoap & "<Result-Code>"&ResultCode&"</Result-Code>"
StrSoap = StrSoap & "<CatCount>"&CatCount&"</CatCount>"
StrSoap = StrSoap & "<Category>"
StrSoap = StrSoap & "<CatName>"&CatName&"</CatName>"
StrSoap = StrSoap & "<CatDesc>"&CatDesc&"</CatDesc>"
StrSoap = StrSoap & "<CatPic>"&CatPic&"</CatPic>"
StrSoap = StrSoap & "<CatMemo>"&CatMemo&"</CatMemo>"
StrSoap = StrSoap & "</Category>"
StrSoap = StrSoap & "</Get_Categories>"
StrSoap = StrSoap & "</soapenv:Body>"
StrSoap = StrSoap & "</soapenv:Envelope>"
responseTxt = StrSoap
%>
</code>


Any helkp you could offer would great.

thanks much





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make user send and receive friends request? Stiward BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 0 August 15th, 2011 04:27 PM
Send and Receive XML content through browser kj875 ASP.NET 2.0 Basics 0 July 27th, 2007 12:10 AM
about XML receive by tomcatand XML parse by java taianmhzy Servlets 0 May 20th, 2004 01:59 AM
about XML receive ang XML parse by tomcat taianmhzy Apache Tomcat 0 May 20th, 2004 01:56 AM
not able to receive xml data unniml Classic ASP XML 0 January 30th, 2004 09:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.