Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 13th, 2006, 12:55 PM
Geir Aamodt
Guest
 
Posts: n/a
Default 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!
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles