473,756 Members | 9,668 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Returning a XML from webservice

Helllo.

I need to return a XML from my WebService, but I'm not getting the result as
a XML. I mean, instead of receiveing a tag (<xyy></xyz>), I'm receiving it
encoded (with &lt; or &gt;).

There is some right way to return the correct XML from my WebService?
Just for example, the WebMethod looks like it:

<WebMethod()_
Public Function GetSomeXml(ID as Integer) As String
'the code builds a XML string from a Xml.XmlDocument object
'...
'...
End Function
Dec 18 '06 #1
1 1459
Your actually returning a string - not XML, it will be encoded as a strings
are.

Try returning an XML document instead

[WebMethod]
public XmlDocument GetSomeXml(ID as Integer){
XmlDocument myDom = new XmlDocument();
// load some XML ...
return myDom;
}

Return this into an xmlNode and it wont be encoded and you can navigate it
with XPath and convert it to an unecoded string if you wish

localhost.Servi ce1 proxy = new localhost.Servi ce1();
XmlNode xml = proxy.GetSomeXm l(22);

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"Ronchese" <ronchese-hotmail-comwrote in message
news:e2******** ******@TK2MSFTN GP06.phx.gbl...
Helllo.

I need to return a XML from my WebService, but I'm not getting the result
as
a XML. I mean, instead of receiveing a tag (<xyy></xyz>), I'm receiving it
encoded (with &lt; or &gt;).

There is some right way to return the correct XML from my WebService?
Just for example, the WebMethod looks like it:

<WebMethod()_
Public Function GetSomeXml(ID as Integer) As String
'the code builds a XML string from a Xml.XmlDocument object
'...
'...
End Function


Dec 18 '06 #2

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

Similar topics

1
410
by: Karuppasamy | last post by:
H I have a WebService calling a Method in a Remote Object. The Remote method Returns an Object. This Webservice also returns the same object. All things are working fine when this Web Service is running in a Windows XP. But when I am trying to run the same webservice in a Windows 2000 Advanced Server Machine, I am getting the following error “System.Web.Services.Protocols.SoapException: Server was unable to process request. ...
1
1728
by: Karuppasamy | last post by:
H I have a WebService calling a Method in a Remote Object. The Remote method Returns an Object. This Webservice also returns the same object. All things are working fine when this Web Service is running in a Windows XP. But when I am trying to run the same webservice in a Windows 2000 Advanced Server Machine, I am getting the following error “System.Web.Services.Protocols.SoapException: Server was unable to process request. ...
2
1756
by: Karuppasamy | last post by:
H I have a WebService calling a Method in a Remote Object. The Remote method Returns an Object. This Webservice also returns the same object. All things are working fine when this Web Service is running in a Windows XP. But when I am trying to run the same webservice in a Windows 2000 Advanced Server Machine, I am getting the following error “System.Web.Services.Protocols.SoapException: Server was unable to process request. ...
5
19599
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was having a problem in the calling program. I searched online and found suggestions that I return an Array instead so I modified my code (below) to return an Array instead of an ArrayList. Now I get the message when I try to run just my webservice...
2
1631
by: Asim Qazi | last post by:
Hi All public class MyResponse { public bool m_bStatus; public string m_szErrorCode; public string m_szMessage; }
0
9303
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
9117
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9894
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
9679
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...
0
9541
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
7078
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
6390
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();...
1
3651
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2508
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.