Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional 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 December 22nd, 2007, 03:07 PM
Registered User
 
Join Date: Dec 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

 
Old December 23rd, 2007, 05:33 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Stan,

Are you sure it's a BO issue? What happens when you set breakpoints in the JavaScript as well, and investigate what is returned at all levels?

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Many-to-Many relationships and Business Objects. danielpilon C# 6 May 28th, 2008 09:44 PM
Transparent Business Layer pinch BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 February 17th, 2008 02:19 AM
business object relationships thenoseknows ASP.NET 1.x and 2.0 Application Design 2 July 16th, 2007 03:02 PM
Domain Object inherit from Business Entity case23_69 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 September 25th, 2006 09:48 AM





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