Extend the XML Schema via C# objects

I have C# objects/entities (like person or customer) which contains the usual 
amount properties/attributes like name, address and so on..

I would like to "tag" some of these properties, so that when I'm generating 
and XML Schema (via Wsdl for instance) the tags are displayed in the Schema 
portion of the Wsdl. Something like the following snippet:

<?xml version="1.0" encoding="utf-8"?>
<xs:scheme attributeFormDefault="unqualified" 
    elementFormDefault="qualified" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:search="searchNS">
	
<xs:element name="Customer">
<xs:complexType>
<xs:sequence>
<xs:element name="FirstName" type="xs:string" search:able="Y"/>
<xs:element name="LastName" type="xs:string" search:able="Y"/>
<xs:element name="Address" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>  

-----------------------------------
As you see, I would like to "tag" the FirstName, LastName elements while 
Address is not. I would like to accomplish this with something like this in 
the class definition:

[XmlTag(Namespace="search", attributename="able" attributevalue="Y")]	
    public string FirstName {
        get {
            return this.firstNameField;
        }
        set {
            this.firstNameField = value;
        }
    }

I'm grateful for any tips or pointers!
0
3/13/2006 12:41:28 PM
dotnet.xml 7266 articles. 0 followers. Follow

0 Replies
958 Views

Similar Articles

[PageSpeed] 15

Reply:

Similar Artilces:

Serializing Array with array "name" in the XML
I need help serializing an array without including the array "name". I am writing in C# and using the XmlSerializer to serial classes. I am trying to serialize a class with an array in it like the one below. public class myclass { public imagecontext; public myimage[] images; } public myimage { public string name; public string path; } It will serialize something like this... <myclass> <imagecontext>my context</imagecontext> <images> <myimage> <name>Image1</name> ...

Schema Importing
With v1.2, you can NOT delete any fields in the database. What happens if I add 2 fields and then decide I do not need them. Then I import a backup schema (before the fields were added), do the 2 fields go away or are they still there? James they are still there..only way to get rid of them would be to restore from a backup of the database before you made the changes -- ======================= John O'Donnell Microsoft CRM MVP http://codegallery.gotdotnet.com/crm "James" <James@discussions.microsoft.com> wrote in message news:33D6D727-24BF-4DA9-AA8C-F1D9815C85E...

Outlook 2003 Profile Confguration via Group Policy
Hi I am looking for a way to change an existing Outlook 2003 email profile to change the exchange server via Group Policy. We are performing the migration of the mailbox using quest however we need a way to configure the users mail profile to point to the new email server in a different AD forest (therefore the new email server is in a different forest and exchange org). Thanks -- Alan You can create a prf-file via the Office Resource Kit. You can then deploy and execute this file via a logon script. If this is a managed Office deployment, then you could also deploy a...

A problem occur after changing OFFICE from C: to D:
Considering my C:\ is nearly full, I unstall my office from C:\ and then install my Office to D:\ After this, OFFICE runs well except EXCEL has a warning messege when I open it. The problem is: When I open EXCEL, it jump up an alert messege: [Unable to find C:\Program Files\Microsoft Office\Office10\Library\Analysis\ATPVBACS.XLA] 1. Can anyone tell me how to solve this problem? 2. If I don't solve this problem, what will be the result? Thanks! Martin 2007-07-04 > The problem is: > > When I open EXCEL, it jump up an alert messege: > [Unable to find C:\Program Fil...

Table object
There is a little table object that shows up on the top left of a table that you can use to move the table to the left or right. But I can't seem to figure out how to get that table object to appear. You have to click around select the whole table/ deselect the table and then at some point it appears. How do you get it to appear so you can move the table? I am getting tired of trying to randomly get it to appear. Thanks, Tom Which version of Word? We support about 20... On 7/04/10 2:14 PM, in article O4J9ajg1KHA.4832@TK2MSFTNGP04.phx.gbl, "tshad"...

xml config file...
hello, I ve a Windowsapplication with a configuration file app.config... (it's in xml) code app.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name = "MyNameValueSection" type="System.Configuration.NameValueSectionHandler" /> </configSections> <MyNameValueSection> <add key="MyKey" value="MyValue" /> </MyNameValueSection> <appSettings> <add key="test" value="MeinInhalt" /> </appSettings> </configurati...

Moving Objects
I have a picture and an object (Line) that I have placed on top of chart area. After I do work on other sheets in the workbook and retur to the sheet with the objects, they sometimes move slightly from where placed them. How can I get them to stay put. I have tried to lock an protect them, but they still move. Not everytime, but often -- icetre ----------------------------------------------------------------------- icetrey's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2032 View this thread: http://www.excelforum.com/showthread.php?threadid=39320 Hi Ice...

Render XML data island to HTML?
I have an XML data island in my aspx web page. The XML includes a link (processing instruction) to an XSL stylesheet. Is there any way on this page to view the HTML, that results from the xsl transformation, as the contents of, say, a div? I know I can do it if I display only the XML in IE, but I don't know if I can do it as a fragment of an existing HTML page. TIA > I have an XML data island in my aspx web page. The XML includes a link > (processing instruction) to an XSL stylesheet. Is there any way on this page > to view the HTML, that results from the xsl transformation, a...

Writing XML from Dataset to Response Object as Binary File
I have looked fot his solution, but Im not sure what to search for. I have an asp.net based report. I need the user to be able to download an XML file of the results so they can use the data in Excel, etc. I do NOT want to write the file to the server first. I just want to be able to write the contents of the Dataset into a binary file and send it back out to the user as a download, but all in memory. Can you give me a boost in the right direction or an article that demonstrates this? Dan Hanover wrote: > I have an asp.net based report. I need the user to be able to download &g...

Use Stored Procedure developed in C# in a SQL Query
I created a Stored Procedure by selecting a SQL Server Project in Visual Studio 2008 using C#. It receives a SqlString as a parameter and return how many times a specific character was found. I deployed the procedure to a SQL Server database and can see it listed under the database. One caveat is that it has a small lock icon on it. I have a select query where I want to use the stored procedure. I am thinking this is doable in a select query but can't seem to get it to work. What I want to do is to have a select statement listing some fields and one of the fields being th...

Office 2007 Connection to SBS 2003 via PPTP
We have an SBS 2003 server. We have a number of PCs running Office 2007. One of them is a notebook. When the notebook is in the office, Outlook connects to the server as expected. When we take the notebook out of the office and attempt to connect Outlook to the server thru PPTP, Outlook reports "Trying to connect to Microsoft Exchange" and never gets any futher. No timeouts. No failures. No nothing. Any ideas on how to solve this issue? Configure Outlook to connect over the internet using https/rpc. If you run the connect to the internet wizard and enable this it ...

XML error "Some Data Was Imported As Text"
Daily, I recieve a 3rd party XML file that I parse in Excel (using an excel macro) and then import into an Access database. Infrequently, the data will import into Excel, then parse and then the routine stops with the error message above. I look through the raw XML file and everything appears to be within the brackets, etc. Can someone give me some clarification to the meaning of the error message? Thanks in advance and Mery Christmas and Happy Holidays! The error message might be generated within your macro - as it is parsing the data it might detect that some field which should be ...

MFC String-table in C# ?
Hi, maybe a bit OT for this newsgroup, but I know that people here use C#, too. So, does anyone know how the MFC string-table technique map to C#/WinForm? I initially thought about using an integer->string map in C#, but is there some built-in mechanism to manage that? Thanks, Giovanni "Giovanni Dicanio" <giovanniDOTdicanio@REMOVEMEgmail.com> ha scritto nel messaggio news:ugqw1g7LJHA.1736@TK2MSFTNGP03.phx.gbl... > So, does anyone know how the MFC string-table technique map to C#/WinForm? ....after some web search, it seems that C# has a ResourceManager class ...

Re: Cannot Insert Object #3
Hi all I'm having trouble inserting a .msg outlook file into an Excel workbook, can anyone please advise as to why I'm getting this error. Many thanks Badger -- BadgerMK ------------------------------------------------------------------------ BadgerMK's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=31406 View this thread: http://www.excelforum.com/showthread.php?threadid=511014 ...

Users can't access CRM via a VPN connection
Hi -- we're trying to set it up so our remote users can VPN into the office and use CRM via their Outlook client. We have CRM 3.0 and we're using a Check Point firewall. The CRM Outlook client works great when they're in the office but when they try during a VPN session they get the infamous error: "There is a problem communicating with the Microsoft CRM server. The server might be unavailabe..." Outlook connects to the Exchange server as it should -- but for some reason CRM won't work. I've already looked through the KB article 910090 and none of tha...

Editing a Visio drawing in Power Point sent via email?
I am trying to edit a flow-chart created using Visio 2000 and sent to me in a Power Point document, via email. I am using Visio Professional 2003. Thanks. is it really embedded (then of course where is the vsd file that it is related too)? Of course the flow chart addons are incompatible anyway. al "jim@techheat" <jim@techheat@discussions.microsoft.com> wrote in message news:9B248240-4DF1-43C3-A2B3-881381462F09@microsoft.com... >I am trying to edit a flow-chart created using Visio 2000 and sent to me in >a > Power Point document, via email. I am using Visio Pro...

XML #4
How does one generate a XML code? If you have data in a dataset, you can have the dataset do it automatically: Dim x as string = DataSet.GetXML "Raj" <Raj@discussions.microsoft.com> wrote in message news:BC61AFF2-84EE-425E-8F05-1B02D2A9F317@microsoft.com... > How does one generate a XML code? ...

XML deserialization from string
Hi, I have an XSD and created a VB.NET class file from it. When I have an XML file (conforming to the schema), it is straight forward to deserialize using the class file. I am looking for ways to deserialize when I have the XML as a string and not in a file. Writing the string to a file and deserializing from the file might have an adverse effect on the performance. Anyone know of a good method to do this? Any help will be appreciated. Thanks, Sampath. Use a StringReader to read the file and wrap that in an XmlTextReader. -- This posting is provided "AS IS" with no warranties,...

DataSet from XML
There are several options on my WinForms app where the user can change/add or delete options - these settings are saved in an XML file. When the main form opens, the XML file (and schema) is read into a dataset and the options are displayed in the various controls. Pretty basic... but I am still rather green... My questions is this - when the user makes a change to one of the settings, how to I modify the dataset and display the new data in the controls? Do I create a new dataset in each method? That would seem inefficient as the user could makes dozens of changes - each time creating a n...

Button fails to call macro when open an Excel via Intranet
Hi all, Can someone help me with my with this problem. I have an Excel file with a button to run a small macro: unhide and displys worksheets. It works when the file is opened with Excel. The macro is simple: Sub Button1_Click() Sheets("FF").Visible = True Sheets("FF").Select Range("C1").Select End Sub I need to open it from an intranet site. When user selects the file, the web app retrieves the file and responses to open an Excel file. But on the intrenet I get the following error massage "The macro "GenerateResource.aspx?Resour...

XML with no schemaLocation
I have some XML instance documents that specify schemas via the xmlns attribute. I need to load these documents (with XmlDocument) and have them verified against the XSD's that are mentioned. However, the documents are intended to be shared between machines but the location of where the XSD's are stored can vary from machine to machine so I don't think it is possible for me to specify the xsi:schemaLocation in the instance documents. To load these documents and have them verified I can only think that I should: 1. Load them once without validation 2. Parse the document and buil...

Accessing Uploads via Cable modem instead of Telephone ISP
I recently changed ISP providers from AOL (telephone) to a broadband cable provider but can't seem to find the way to get money 2002 to recognize this change. Has anyone run into this before? Do you have any suggestions how to switch from AOl to cable modem ISP. MATT What uploads are you trying to access? Money should use any available internet connection unless your bank's online banking requires a dialup connection. You might also review your connection settings in Internet Explorer to confirm that you don't have "always dial my default connection" checked. --...

Import/Export XML in protected worksheet
I developped an excel tool on which most of the cells are protected (and I need to keep them protected). I mapped an XML schema on all the worksheet entries. I would like to be able to import and export all these entries but Excel does not let me do that when the worksheet is protected. Can anybody help? ...

When grouping, what causes the error "Cannot shift objects off the sheet"
I am from the MS Excel support department at http://www.enterpriseprojectconsulting.com and we would be happy to assist you in resolving your issue Thank you Enterprise Project Consultin Shifting off the sheet refers to moving beyond the boundaries of the spreadsheet. You may be using a macro to group. >-----Original Message----- > >. > Since grouping involves hiding columns, the following MSKB article may help: XL: "Cannot Shift Objects Off Sheet" Error Hiding Columns http://support.microsoft.com/default.aspx?id=211769 Also, Dave Peterson posted this a...

Trouble deserializing XML data from UPS.com
I am trying to use the UPS.com online tools to develop a class libary that uses serialization to communicate with their XML APIs. When I use the class libary to generate a TimeInTransitRequest object, the XML looks like this (I substituted the user credentials): <?xml version="1.0" encoding="utf-16"?> <AccessRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en-US"> <AccessLicenseNumber>LIC_NUM</AccessLicenseNumber> <UserId>UserName</User...