Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 917481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:13:10+00:00 2026-05-15T18:13:10+00:00

scratching my head on WCF … I’ve got XML messages where the children of

  • 0

scratching my head on WCF … I’ve got XML messages where the children of <DataFields> could be anything, e.g. …

<Test1Root> 
  <CaseNo></CaseNo>
  <Activity></Activity>
  <DataFields>
     <AccountRef></AccountRef>
     <PropRef></PropRef>
     <User></User>
  </DataFields>
</Test1Root>

I’ve handled this in BizTalk using the <xs:any> for the <DataFields> …

<xs:element name="DataFields">
  <xs:complexType>
    <xs:sequence>
      <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip" />
    </xs:sequence>
  </xs:complexType>
</xs:element>

But I’m struggling to see how to handle this in a WCF [DataContract] …

I tried using both svcutil.exe and xsd.exe to create the classes, and they both give the main elements (CaseNo, Activity, etc.) but neither seems to handle the xs:any of DataFields …

  • svcutil has DataFields as an XmlElement
  • xsd has it as a class, but with an Any property of type XmlElement []

Is it possible to get a better handling of the child elements ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:13:12+00:00Added an answer on May 15, 2026 at 6:13 pm

    Well, xs:any can be anything, so the best the .NET tools could do is give you an array of objects….

    Since it can be anything, there’s really not much you can do about it, right? It could be anything… so you need to use a type that could be anything.

    If you really need that xs:any in your XML schema, and can’t replace by e.g. a set of more specific xs:element (possibly inheriting from one another), I don’t see how you could get better support…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Head scratching :( I am trying to bind one value to label and back
I've been scratching my head at this for too long - any insight would
I am scratching my head about this. My scenario are that I need to
I am scratching my head to figure out a solution to the following question:
I've been scratching my head over this for an hour... I have a list
I've been scratching my head about this for the last 4 hours, trying out
I have been scratching my head for a while on this one. I dont
I have been scratching my head for hours trying to figure out why this
This one has me scratching my head. I'm running Subversion 1.3.1 (r19032) on Ubuntu.
I was kind of scratching my head at this a week ago, and now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.