xmlnodelist within a business object
Hi,
I have a problem with a xmlnodelist property that I use within a business object.
Here's my class
using System;
using System.Xml;
namespace NS.GADGET.BO
{
public class WsItem
{
private string _instance;
private string _retour;
private XmlNodeList _nodes;
public string Instance
{
get { return _instance; }
set { _instance = value; }
}
public XmlNodeList Nodes
{
get { return _nodes; }
set { _nodes = value; ; }
}
}
}
I use this bo within a web service and the xmlnodelist is filled by a rss feed.
Here's the part of the webservice
[WebMethod]
public WsItem InvokeWS(string instance, string url)
{
return chargeWS(instance,url);
}
protected static WsItem chargeWS(string instance, string url)
{
XmlDocument wsResponse = new XmlDocument();
wsResponse.Load(url);
string retour = wsResponse.OuterXml;
WsItem myItem = new WsItem();
myItem.Instance = instance;
XmlDocument myDoc = new XmlDocument();
myDoc.LoadXml(retour);
XmlNodeList myNodes= myDoc.GetElementsByTagName("channel");
myItem.Nodes = myNodes;
return myItem;
}
So, I called my webservice thru my asp.net page
like this
<script language="javascript">
function AjaxProxy(url,id)
{
myweb='GestionGadget.InvokeWS(id,url,OnCompleteWs, OnTimeOut,OnError)';
ret = eval(myweb);
}
function OnCompleteWs(arg)
{
alert(arg.Nodes)
}
</script>
I use ajax asp.net scriptmanager for my web service.
here's the code
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/WS/GestionGadget.asmx" />
</Services>
</asp:ScriptManager>
Now, my problem is when I invoke my web service, the alert box display commas instead of the rss feed.
I set a breakpoint within VS2008, and I can see the entire feed in the InnerXml key.
So, I don't know where's my error.
Any help ?
Stan
|