Solved

Limit XML output result from SOAP

Posted on 2009-06-30
1
546 Views
Last Modified: 2013-11-18
I have been successfully grabbing data from a server using SOAP. But now I want to take it a step further.

How can I limit the output of items to 10 items for example, rather than the whole catalog?

Here is how I currently grab the data from the server.
<%
Dim objXMLHTTP : SET  objXMLHTTP = Server.CreateObject("Msxml2.XMLHTTP.3.0")
Dim objOutputXMLDoc : Set objOutputXMLDoc = Server.CreateObject("MSXML.DOMDocument")
 
Dim strMethodPkg
Dim strMethodResultXML
 
Dim catID            :      catID = 89
Dim Html_Strip      : Html_Strip = 1
Dim AffiliateID		: AffiliateID = 61
 
 
strMethodPkg ="<?xml version=""1.0"" encoding=""utf-8""?>"
strMethodPkg = strMethodPkg &"<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/"">"
strMethodPkg = strMethodPkg & "<soap:Body>"
strMethodPkg = strMethodPkg & "<Product_List_Xml xmlns=""http://www.estaronline.com/webservices/"">"
strMethodPkg = strMethodPkg & "<CatalogueID>" & catID & "</CatalogueID>"
strMethodPkg = strMethodPkg & "<Html_Strip>" & Html_Strip & "</Html_Strip>"
strMethodPkg = strMethodPkg & "<AffiliateID>" & AffiliateID &"</AffiliateID>"
strMethodPkg = strMethodPkg & "</Product_List_Xml></soap:Body></soap:Envelope>"
 
objXMLHTTP.open "post", "http://www.servernamegoeshere.com/AffiliateServices.asmx", False
 
objXMLHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
objXMLHTTP.setRequestHeader "Content-Length", Len(strMethodPkg)
 
 
objXMLHTTP.setRequestHeader "SOAPAction", "http://www.estaronline.com/webservices/Product_List_Xml"
 
Call objXMLHTTP.send(strMethodPkg)
 
strMethodResultXML = objXMLHTTP.responseText
Dim sXml 
objOutputXMLDoc.LoadXml(strMethodResultXML)
sXml = objOutputXMLDoc.SelectSingleNode("//Product_List_XmlResult").ChildNodes(0).xml
 
Dim oXML 
Set oXML = Server.CreateObject("MSXML2.DOMDocument.3.0")
Dim oXSL
Set oXSL= Server.CreateObject("Msxml2.FreeThreadedDOMDocument.3.0")
Dim oTmpl
Set oTmpl= Server.CreateObject("Msxml2.XSLTemplate.3.0")
Dim oProc
 
oXSL.async = false
oXSL.load(Server.MapPath("product.xslt"))
oXML.LoadXml(sXml)
 
oTmpl.stylesheet = oXSL
 
Set oProc= oTmpl.createProcessor()
oProc.input = oXML
 
oProc.addParameter "catID", catID
oProc.output = Response
oProc.transform()
 
%>

Open in new window

0
Comment
Question by:Pete_Zed
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 27

Accepted Solution

by:
BigRat earned 500 total points
ID: 24752732
Server Side: Since the SOAP call is for a Web Service, the service *might* offer such a capability. In that case the documenation associated with the service (here Product_List_Xml) might show an extra parameter.

Client Side: you'd have to modify product.xslt not to process too many nodes.

Hope that's a start.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question