473,667 Members | 2,577 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Use of XMLNode as Parameter in WCFService interfaces

Hello!

Is it possible to use the object XMLNode as a parameter in an interface
function of a WCF service?

In my case I get the error message:

XmlNode ProcessServiceR equest(XmlNode request);

Unable to serialize type "System.Xml.Xml Node". Use the attribute
"DataContractAt tribute" a.s.o.

How can I set the DataContractAtt ribute if XmlNode is an integrated .NET
object? Why does WCFService have problems with XmlNodes a normal webservices
not?

Regards,
Norbert

Apr 30 '07 #1
2 4623

"Norbert Pürringer" <th*******@graf fiti.netwrote in message
news:f1******** **@newsreader2. utanet.at...
Hello!

Is it possible to use the object XMLNode as a parameter in an interface
function of a WCF service?

In my case I get the error message:

XmlNode ProcessServiceR equest(XmlNode request);

Unable to serialize type "System.Xml.Xml Node". Use the attribute
"DataContractAt tribute" a.s.o.

How can I set the DataContractAtt ribute if XmlNode is an integrated .NET
object? Why does WCFService have problems with XmlNodes a normal
webservices not?
Why don't you use a Serialized object, using the Serializable attribute at
the top of the object? You populate the object with the XML data and you
pass the Serialized object to the Web service.

Apr 30 '07 #2

Hi!
Why don't you use a Serialized object, using the Serializable attribute at
the top of the object? You populate the object with the XML data and you
pass the Serialized object to the Web service.
This could be a solution, e.g. I can use the MemoryStream. But this way is
quite intricate and the caller of the WCF function would be able to pass a
MemoryStream not containing XML data. By specifying the right data type
(XMLDocument), the danger of passing false data can be avoided.

Why is a normal WebService be able to work directly with XML data types and
a WCF service not? I only migrated a Webservice to a WCF service (which is
not really much work) but now the service can not deal with XML data types.

Regards,
Norbert
May 1 '07 #3

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

Similar topics

2
21785
by: Michael Christensen | last post by:
Hi How do I send an input-param to my web service with MSXML2.ServerXMLHTTP? Can this be done without the soap-toolkit? Can't find anything about it - looking forward getting some help :-) ------------- Function GetLatest() Dim url, xmlhttp, XMLDOM, XMLNode
1
3639
by: Srini | last post by:
I have written two simple webservice functions and trying to consume them through a client piece. Both the webservice functions have similar signature. -------------------------------------------------------- public string quoteNew(System.Xml.XmlNode passedXML) and public string EmitXml(System.Xml.XmlNode passedXML)
10
267
by: Michael Grimsley | last post by:
I have been looking at interfaces in C# and cannot seem to understand them. I am told that interfaces resembles a class with no code and that methods declared in an interface are not allowed to contain method bodies. My question is what purpose does creating an interface serve that has methods with not bodies? If a method does not have a body then what is the methods purpose, because if you call the method it will not do anything or you have to...
0
2810
by: Frederico Guimar??es via DotNetMonster.com | last post by:
Hi, I'm trying to use the Microsoft.Web.Services2.Messaging. ISoapFormatter but I receive this error: System.Xml.XmlException: Reference to undeclared parameter entity, 'meetingmaker'. at System.Xml.XmlLoader.ExpandEntityReference(XmlEntityReference eref) at System.Xml.XmlEntityReference.SetParent(XmlNode node) at System.Xml.XmlNode.AppendChild(XmlNode newChild)
1
313
by: PaulF | last post by:
I am writing a web service that accepts and returns an XML message - I know the issues behind this but want to be able to process the messages generically using XSD / XSLT. My problem occurs with the way the .NET framework appears to handle the XmlNode, in particular the generation of the WSDL. The details follow: I define the code behind method as
1
2102
by: Andy Fish | last post by:
Hi, I would like to send an XML document as a parameter to an asp.net web service. Obviously I could just serialize it and transfer it as a string but that seems a bit of a waste, given that SOAP is XML already. is there any simple way to include my own XML as a parameter to a web service request?
2
3149
by: manmit.walia | last post by:
Hello All and Thank You for your time, I am stuck on this exception handleing error. The problem is that when I run my application the application works perfect but sometimes, I get this error. I do not know where it is causing it but my guess would be something with the function below. Any help would be greatfull, as this would be a learning experience for me. For this example: swTitle.Text = "AutoCAD 2004" After the user selects the...
4
5185
by: sam | last post by:
I use a List<Tand the method FindLastIndex like this: List<XmlNodeListArticle; int iIndex = ListArticle.FindLastIndex(TheSameYear); .... private bool TheSameYear(XmlNode n) { if(....) return true; else
1
7772
by: santoshsri | last post by:
Hi All, My C# web application calls a webservice to process a report. It sends XMLs as parameter and in response gets an XML node which stores Binay datatype bin.base64. It makes an instance of the proxy class of webservice and makes a synchronous call to webservice GetReport() op. Here is the code snippet - *************************************************************************************** wbFELIP.wsZProcessReport.ProcessReport...
0
8457
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8883
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8788
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8563
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8646
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6203
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.