Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 22nd, 2007, 02:07 PM
Registered User
 
Join Date: Dec 2007
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old December 23rd, 2007, 04:33 AM
Imar's Avatar
Wrox Author
Points: 67,085, Level: 100
Points: 67,085, Level: 100 Points: 67,085, Level: 100 Points: 67,085, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,201
Thanks: 65
Thanked 1,405 Times in 1,385 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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 01: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



All times are GMT -4. The time now is 12:15 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.