473,606 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
+ 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:s tring">wow</anyType>
<anyType xsi:type="xsd:s tring">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 1382
Implement IXmlSerializabl e 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:s tring">wow</anyType>
<anyType xsi:type="xsd:s tring">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
1505
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 to server ( like with Outlook ). So I think webservices is great for this. I can't quite sort out the offline part of things though. I can instantiate and fill the xsd.exe classes I created from a schema. I can't quite sort out how to save these...
1
5223
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
2325
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 .NET webservice. I am attempting to return an xml string similar to this: <?xml version="1.0" encoding="utf-8" ?>
9
1372
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 message submitted so that if the call failed they could compare their SoapMessage with the ones we generate in .Net. Thought the solution was an HttpModule hooked into begin request, but after approx 10 requests it hangs the webservice/aspnet...
5
1771
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 develop for ASP.NET/Webservices without IIS installed on your local box without having to resort to more difficult debugging or using notepad for development? Thanks for the help!!
3
1384
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 my app if i pass a dataset from a webservice to my application ? What is the future for webservices and passing back data in .net2? Ive
3
1587
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 to server ( like with Outlook ). So I think webservices is great for this. I can't quite sort out the offline part of things though. I can instantiate and fill the xsd.exe classes I created from a schema. I can't quite sort out how to save these...
0
1536
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 confirm the dataset with schema using following line ds.ReadXMLSchema(schema) and then access data through dataset schema is a url to my xsd file. schema = https://localcomputer/sample/trace.xsd
4
2799
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 the current date. This could be done by making a wsdl file (or whatever the name is) and via a wizard in some java tool make a real webservice. This webservice would be static since it creates a class in which i can make my code to return the
0
1128
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 i am new one in making webservices. <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:s1="http://www.smarttrust.com/mdm/clientprovisioning_1.0/initiator-types" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"...
0
8010
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
8433
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...
1
8084
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
8300
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...
0
6761
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5461
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
3922
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...
1
2443
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
0
1287
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.