View Single Post
  #1 (permalink)  
Old November 27th, 2012, 01:41 PM
websagogoer websagogoer is offline
Registered User
Points: 14, Level: 1
Points: 14, Level: 1 Points: 14, Level: 1 Points: 14, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote