473,466 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

webservices, return xml without .net injecting xml schema

Hey all,

I want to return an xml structure without .net trying to inject any of
its xml schema? Can this be done?

Here is the scenario:
I'm running into an issue with the return string of my .NET
webservice. I am attempting to return an xml string similar to this:

<?xml version="1.0" encoding="utf-8" ?>
<sInfo>
<name>tom</name>
<title>boss</title>
<stuff>
<anyType>wow</anyType>
<anyType>wow2</anyType>
</stuff>
</sInfo>

But instead I receive this:
<?xml version="1.0" encoding="utf-8" ?>
<sInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://tempuri.org/">
<name>tom</name>
<title>boss</title>
<stuff>
<anyType xsi:type="xsd:string">wow</anyType>
<anyType xsi:type="xsd:string">wow2</anyType>
</stuff>
</sInfo>

Note, for my webservice I am returning a struct. The definition of that
struct is:
public class sInfo{
public string name;
public string title;
public ArrayList stuff;
//public Array smArray;
public sInfo()
{
stuff = new ArrayList();
}
}

Most importantly I do not want any of the 'xsi:type=' attributes to
be present in the return structure. Is there any way to override the
return so that I can return self defined xml. I am even willing on
returning hand built xml, but .NET encapsulates the structure within a
<string> tag?

So to summarize, I want to return an xml structure without .net trying
to inject any of its xml schema? Can this be done?

Nov 12 '05 #1
1 1376
Implement IXmlSerializable and in the GetSchema you could return nothing
as the schema if you want.

Peter Nofelt wrote:
Hey all,

I want to return an xml structure without .net trying to inject any of
its xml schema? Can this be done?

Here is the scenario:
I'm running into an issue with the return string of my .NET
webservice. I am attempting to return an xml string similar to this:

<?xml version="1.0" encoding="utf-8" ?>
<sInfo>
<name>tom</name>
<title>boss</title>
<stuff>
<anyType>wow</anyType>
<anyType>wow2</anyType>
</stuff>
</sInfo>

But instead I receive this:
<?xml version="1.0" encoding="utf-8" ?>
<sInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://tempuri.org/">
<name>tom</name>
<title>boss</title>
<stuff>
<anyType xsi:type="xsd:string">wow</anyType>
<anyType xsi:type="xsd:string">wow2</anyType>
</stuff>
</sInfo>

Note, for my webservice I am returning a struct. The definition of that
struct is:
public class sInfo{
public string name;
public string title;
public ArrayList stuff;
//public Array smArray;
public sInfo()
{
stuff = new ArrayList();
}
}

Most importantly I do not want any of the 'xsi:type=' attributes to
be present in the return structure. Is there any way to override the
return so that I can return self defined xml. I am even willing on
returning hand built xml, but .NET encapsulates the structure within a
<string> tag?

So to summarize, I want to return an xml structure without .net trying
to inject any of its xml schema? Can this be done?

Nov 12 '05 #2

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

Similar topics

1
by: James | last post by:
Here's what I'm kicking around... Really here's what's kicking me around... Trying to design a webservices system that will allow a client to submit forms in background threads when client connects...
1
by: Patrik | last post by:
Hi I want to return a dataset from a webservice and exclude the schema. How can I do this? /Patrik
3
by: AtariPete | last post by:
Hey all, I want to return an xml structure without .net trying to inject any of its xml schema? Can this be done? Here is the scenario: I'm running into an issue with the return string of my...
9
by: Bruce Hodge | last post by:
Hi, We have a couple of clients who are having trouble connecting to .Net webservices, (they're coming from PHP and VFP). We were looking to provide a diagonostic tool that displayed the soap...
5
by: cyberstrike | last post by:
Hi guys, my company was wondering if it's possible to develop ASP.NET/Webservices easily using a IIS installed on a server instead of installing IIS locally on the development boxes. Can you...
3
by: androoo | last post by:
Hi all I have read both scott mitchells (4 guys) articles on why he doesnt like to use datasets from webservices and I have some questions if anyone has some experience in this. How secure is...
3
by: James | last post by:
Here's what I'm kicking around... Really here's what's kicking me around... Trying to design a webservices system that will allow a client to submit forms in background threads when client connects...
0
by: Pasho | last post by:
hi I have been facing problem using C# webservices (secured using SSL). In my webservice(secured with SSL) It works fine if I try to access data from database through dataset. If I try to...
4
by: Benny Dein | last post by:
Hi I want to create a servlet or something similar by which im able to create virtual webservices. Lets say i would like to create a webservice with a method called 'getDate' which returnes...
0
by: failfaizan | last post by:
I made a webservice but i got the following error: Custom tool error:Unable to import WebService/Schema.Unable to import binding. Is there any problem in my WSDL.Here is my WSDL file.Plz help me...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.