473,386 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Why can't an XmlDocument be passed via remoting?

I don't get it? Of all things, shouldn't an XmlDocument type be serializable
by default? How can I pass this type through a remoting service?

It just doesn't make sense, especially since DataSets can be passed, which
are XML.
Jun 26 '06 #1
4 3597
William,

I would have thought the same thing. However, it's easy to work around.
Just return a string.

I know it's not optimal, but it will work.

You could always load the XmlDocument into a DataSet and then return
that if you want to expose an object.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"William" <nf*@nospam.com> wrote in message
news:Oh**************@TK2MSFTNGP04.phx.gbl...
I don't get it? Of all things, shouldn't an XmlDocument type be
serializable
by default? How can I pass this type through a remoting service?

It just doesn't make sense, especially since DataSets can be passed, which
are XML.

Jun 26 '06 #2
William wrote:
I don't get it? Of all things, shouldn't an XmlDocument type be
serializable by default? How can I pass this type through a remoting
service?
It just doesn't make sense, especially since DataSets can be passed, which
are XML.


Don't know, but it is trivial to take an XmlDocument to a string, which can
be passed via remoting.
--
Tom Porterfield

Jun 26 '06 #3
You can put you XML into dataset and pass it like this:

private DataSet GetUserData()

{

// Set the path of the XML file and XML schema.

string strPath = Server.MapPath(".");

// Declare a data set.

DataSet dsUsers = new DataSet();

// Apply the XML schema to data set.

dsUsers.ReadXmlSchema(strPath + "\\UserInfo.xsd");

// Read the XML into the data set.

dsUsers.ReadXml(strPath + "\\UserInfo.xml");

return dsUsers;

}

chanmm
"William" <nf*@nospam.com> wrote in message
news:Oh**************@TK2MSFTNGP04.phx.gbl...
I don't get it? Of all things, shouldn't an XmlDocument type be
serializable
by default? How can I pass this type through a remoting service?

It just doesn't make sense, especially since DataSets can be passed, which
are XML.

Jun 26 '06 #4
Thank you.

Actually, what I wound up doing is something like this:

[WebMethod]
public XmlDocument Order(XmlDocument doc)
{
IOrder rObj = (IOrder)Activator.GetObject(typeof(IOrderCert),
ConfigurationManager.AppSettings["PocRemotingServer"]);
string ret = rObj.Order(doc.InnerXml);
XmlDocument retxml = new XmlDocument();
retxml.InnerXml = ret;
return retxml;
}

On the remote server side, I rebuild the XmlDocument and consume it in the
Business Logic Layer, which expects and XmlDocuement.

All a bit hokey and I am at a loss to explain why Microsoft decided to make
such an obvious task a bit of a hassle.

"chanmm" <ch*****@hotmail.com> wrote in message
news:eM**************@TK2MSFTNGP02.phx.gbl...
You can put you XML into dataset and pass it like this:

private DataSet GetUserData()

{

// Set the path of the XML file and XML schema.

string strPath = Server.MapPath(".");

// Declare a data set.

DataSet dsUsers = new DataSet();

// Apply the XML schema to data set.

dsUsers.ReadXmlSchema(strPath + "\\UserInfo.xsd");

// Read the XML into the data set.

dsUsers.ReadXml(strPath + "\\UserInfo.xml");

return dsUsers;

}

chanmm
"William" <nf*@nospam.com> wrote in message
news:Oh**************@TK2MSFTNGP04.phx.gbl...
I don't get it? Of all things, shouldn't an XmlDocument type be
serializable
by default? How can I pass this type through a remoting service?

It just doesn't make sense, especially since DataSets can be passed,
which are XML.


Jun 26 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Martin Honnen | last post by:
With both .NET 1.0 and 1.1 I have found the following strange behaviour where System.Xml.XmlDocument.LoadXml doesn't throw an error when parsing a text node with a character reference to an invalid...
5
by: Bob P | last post by:
I have an example below that is not working correctly. I have a web application that passes a System.Xml.XmlDocument object "oInputDoc" around to functions byval. I do not want the "oInputDoc"...
1
by: JoshKaos | last post by:
I am in the process of rewriting a WebService. The WebMethods are all returning XMLDocuments. First, they get a Dataset of records and then walk through the Dataset to populate the XMLDocument...
1
by: Joe Monnin | last post by:
I have a web service that takes an XmlDocument as a parameter, performs some processing on it, and saves it to a database. The web service signature looks similar to this: public void...
3
by: Ray Stevens | last post by:
I'm not an expert on XML so have a question I have been unable to find an answer. I have a fairly complex XSD file that was provided to me, for which I used XSD.exe to generate a class. I added...
2
by: John Smith | last post by:
I'm writing webervice client using .Net 2.0. I have this class: public class MyWebService : SoapHttpClientProtocol { public XmlDocument validate(string url, XmlDocument xmlDocument) {...
10
by: Thirsty Traveler | last post by:
All of the XmlReader examples assume that the XmlDocument is being read from a file. However, I would like to use it with an XmlDocument passed as a method parameter, but am not sure how. Any...
6
by: Mike9900 | last post by:
How can I connect my .NET app which use remoting to communicate over internet, 2 instance of the same app? My app is already done using .NET Remoting. I am wondering if to change them to WCF or...
0
by: rawatgaurav81 | last post by:
I had this strange problem in handling XMLDocuments in asp.net.Though the problem occurs while working on the main application.I will try to explain it with shorter code. I had a form with 2...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.