RedDot Deliver Server - Include Dynament - External XML

210 views
Skip to first unread message

Radha Krishna

unread,
Feb 6, 2012, 11:32:15 AM2/6/12
to RedDot CMS Users, rkris...@gmail.com
Hi All,

I have external XML content URL in the format "http://servername/
temp.asp?arg1=arg1Value&arg2=arg2Value" which returns XML.

I need to get that content XML using Dynaments. I am using Include
Dynament to get the value but failed . I used the dynament like below
in my XML file

<rde-dm:include mode="include" contenttype="text/xml" content="http://
servername/temp.asp?arg1=arg1Value&arg2=arg2Value" tag="notag" report-
tag="report"/>

After executing this, it gives me error.

Can any of you please help me out on how we can get the XML content
using the URL format specified above?

Thanks in Advance.

Radha Krishna

Nik S.

unread,
Feb 7, 2012, 11:57:32 AM2/7/12
to RedDot CMS Users
Hi Radha,

What version of LiveServer/Delivery Server are you using?

I see that you're utilizing the report-tag attribute in your Include
DynaMent - please provide us with the resulting XML. (We need to know
the error that you are referring to to be able to troubleshoot it.)

-Nik

Boris Crismancich

unread,
Feb 7, 2012, 12:01:36 PM2/7/12
to RedDot CMS Users
Hi,

first of all, what do you intend to do? Maybe a psx module or the
application portal connector would be the appropriate solution in some
situations.

What exactly does the rde log say about the error?

Cheers,
Boris Crismancich

Radha Krishna

unread,
Feb 14, 2012, 8:19:43 AM2/14/12
to RedDot CMS Users
Hi all,

Sorry for the delayed reply. Actually the dynament that I've used is
correct. I am having problem with the DS not connecting to external
environment. It is blocked by the firewall. So, that's the reason I
am unable to get the external xml.

But now, I am facing a strange problem.

I am using the below type of include dynament in my XML(proxy.xml)
(URL pattern specified below)

<?xml version="1.0" encoding="ISO-8859-1"?>
<IRXML CorpMasterID="86717">
<rde-dm:include mode="text" content="http://xml.xxxxxxxxxxx.net/
xmlclient.asp?compid=86717&amp;reqtype=quotes" contenttype="text/xml;
charset=ISO-8859-1"/>
</IRXML>

Using the the above dynament, I am able to get the response as XML.
When I try to access the proxy.xml from DS URL, I am able to see the
XML response in my browser.

Now, I have a html page where I am placing the AJAX request to this
proxy.xml using jQuery and in Success block, i am parsing the response
xml (which will be the resolved XML response of proxy.xml) but
unfortunately, I am not getting the response as XML in jQuery Success
block.

Directly the control is going to Error block.

But, when i try to access the DS url directly, I am able to get the
response as XML.

DS URL: http://deliveryservername:8080/cps/rde/xchg/projectname/hs.xsl/proxy.xml

Ajax request code in my HTML where I am calling this proxy.xml located
in DS.


<SCRIPT type=text/javascript>
$(document).ready(function () {
$.ajax({
type: "GET",
url: 'http://deliveryservername:8080/cps/rde/
xchg/projectname/hs.xsl/proxy.xml',
cache: false,
dataType: "xml",
error: function() {
alert('in error block');
$('.stock_price').text("Data Not
Received");
$('.stock_date').text("Data Not
Received");
$('.stock_change').text("Data Not
Received");
},
success: function(xmldata){
alert('in success block');
alert($(xmldata).text());

//XML Parsing to get the required values
from XML response
if(PriceDifference < 0)
{
$('.stock_change').css('color',
'red');
}

$('.stock_change').text($
(xmldata).find('Change:first').text());

$('.stock_date').text($
(xmldata).find('Date:first').text()+' EST');
}
});
});
</SCRIPT>


Any idea where I am doing wrong?




On Feb 7, 10:01 pm, Boris Crismancich

Dmitry Terner

unread,
Feb 15, 2012, 9:39:33 AM2/15/12
to reddot-c...@googlegroups.com
Hi,

I think you're making this more complex than it needs to be. You are already using DS so embrace that and use its native functionality. Put the include dynament right into your template where you are now trying to inject it via javascript put a unique tag on it and parse using xsl . That is how DS is supposed to work.

If you need to do further manipulation on the front end via javascript you can still do that but the DOM will already be loaded it will make your life much easier.
Reply all
Reply to author
Forward
0 new messages