TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mohammed jaseefar
NA
217
20.4k
Wcf messagecontract and messagebodymember
Jan 16 2018 12:01 AM
Hi, I'm looking for a way to specify that some MessageBodyMember is required,
so that the generated schema would have minOccurs=1 instead of minOccurs=0.
I know that the DataMember has such an option(IsRequired=true), however I prefer using the MessageContract for controlling other aspects of the message.
[MessageContract(IsWrapped =
true
, WrapperName =
"CityRequestObject"
)]
public
class
CityInfoRequest
{
[MessageHeader]
public
string
UserKey {
get
;
set
; }
[MessageHeader]
public
string
TransactionID {
get
;
set
; }
[MessageHeader]
public
string
EntityCode {
get
;
set
; }
[MessageBodyMember]
[System.Xml.Serialization.XmlElementAttribute(IsNullable =
true
, Form = System.Xml.Schema.XmlSchemaForm.Qualified, Order = 0)]
public
string
Lang {
get
;
set
; } }
Reply
Answers (
1
)
Creating Rest Web Service with an existing asp.net mvc 5 app
Get parameters which is returned by "out" keyword in ssis