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 646543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:37:24+00:00 2026-05-13T21:37:24+00:00

I have the following type in wsdl (it is generated by third party tool):

  • 0

I have the following type in wsdl (it is generated by third party tool):

<xsd:complexType name="IntArray">
  <xsd:sequence>
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="Elements" type="xsd:int" /> 
  </xsd:sequence>
</xsd:complexType>

Sometimes Visual Studio generates:

public class IntArray : System.Collections.Generic.List<int> {}

And sometimes it doesn’t generate any proxy type for this wsdl and just uses int[].

Collection type in Web Service configuration is System.Array.

What could be the reason for such upredictable behavior?

Edited:

I found the way how I can reproduce this behavior.

For examle we have two types:

<xsd:complexType name="IntArray">
  <xsd:sequence>
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="Elements" type="xsd:int" /> 
  </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="StringArray">
  <xsd:sequence>
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="Elements" type="xsd:string" /> 
  </xsd:sequence>
</xsd:complexType>

VS generates:

public class IntArray : System.Collections.Generic.List<int> {}

public class StringArray : System.Collections.Generic.List<string> {}

Now I change StringArray type:

<xsd:complexType name="StringArray">
  <xsd:sequence>
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="Elements" type="xsd:string" /> 
    <xsd:any minOccurs="0" maxOccurs="unbounded" namespace="##any" processContents="lax" />
  </xsd:sequence>
  <xsd:anyAttribute namespace="##any" processContents="lax"/>
</xsd:complexType>

VS generates proxy type for StringArray only. But not for IntArray.

Edited:

Reference.svcmap:

  <ClientOptions>
    <GenerateAsynchronousMethods>false</GenerateAsynchronousMethods>
    <EnableDataBinding>true</EnableDataBinding>
    <ExcludedTypes />
    <ImportXmlTypes>false</ImportXmlTypes>
    <GenerateInternalTypes>false</GenerateInternalTypes>
    <GenerateMessageContracts>false</GenerateMessageContracts>
    <NamespaceMappings />
    <CollectionMappings />
    <GenerateSerializableTypes>true</GenerateSerializableTypes>
    <Serializer>Auto</Serializer>
    <ReferenceAllAssemblies>true</ReferenceAllAssemblies>
    <ReferencedAssemblies />
    <ReferencedDataContractTypes />
    <ServiceContractMappings />
  </ClientOptions>
  • 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-13T21:37:24+00:00Added an answer on May 13, 2026 at 9:37 pm

    If you view all files for the project and then view the file called Reference.svcmap for the appropriate service reference could you please let me know what the following config options are in the xml?

    <ExcludedTypes />
    <ImportXmlTypes>false</ImportXmlTypes>
    <GenerateInternalTypes>false</GenerateInternalTypes>
    <GenerateSerializableTypes>false</GenerateSerializableTypes>
    <Serializer>Auto</Serializer>
    

    Sorry about putting it in as an answer but it was horribly unreadable in the comments.

    Edit

    Ok, so what is happening here is following:

    1. You are using auto for the serializer.
    2. The default is DataContractSerializer
    3. When generating the proxy code, there is a check for forbidden xsd elements.
    4. If forbidden elements are found, the XmlSerializer is used.

    In your case, adding the xsd:any element is causing the serialization mode to change. If you want consistent serialization, you will have to remove the forbidden element or force the proxy generation to use XmlSerialization all the time.

    Here is a link about the allowable schema elements for the DataContractSerializer.

    Cheers
    -Leigh

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

Sidebar

Related Questions

I have a custom control that has the following prototype. Type.registerNamespace('Demo'); Demo.CustomTextBox = function(element)
I have come across the following type of code many a times, and I
So I have the following user defined type in my oracle database: CREATE OR
I have the following javascript: $.ajax({ type: "POST", dataType: "json", url: "/Home/Submit", data: {
Let's say I have the following jQuery AJAX call: $.ajax({ type: POST, url: MyUrl,
I have the following javascript: css = document.createElement('style'); css.setAttribute('type', 'text/css'); css_data = document.createTextNode(''); css.appendChild(css_data);
In an oscommerce site I have the following: Server response = Content-type: text/html;charset=UTF-8 and
If I have the following code: MyType<int> anInstance = new MyType<int>(); Type type =
What's the object type returned by Datepicker? Supposing I have the following: $(#txtbox).datepicker({ onClose:
I have a database in the following format: ID TYPE SUBTYPE COUNT MONTH 1

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.