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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:12:27+00:00 2026-05-25T11:12:27+00:00

I have been trying to connect to some web services using WCF but I

  • 0

I have been trying to connect to some web services using WCF but I keep getting an error when I try to call the function I need.

This is the error I’m getting:


System.InvalidOperationException : XmlSerializer attribute System.Xml.Serialization.XmlChoiceIdentifierAttribute is not valid in Item. Only XmlElement, XmlArray, XmlArrayItem, XmlAnyAttribute and XmlAnyElement attributes are supported when IsWrapped is true.

The error happens before it even gets to calling the actual service and it doesn’t even occur because of the method I’m trying to call. The issue is with another method that’s defined in the WCF generated class.

I have been able to trace the issue to a section of code in the XSD that is used to define the WSDL:

<xs:choice minOccurs="0">
<xs:element name="additionalSocInd" type="tns:BinaryExpressionType"/>
<xs:element name="skipServiceValidationInd" type="tns:BinaryExpressionType"/>
</xs:choice>

The corresponding generated code:

[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.1")]
[System.SerializableAttribute()]   [System.Xml.Serialization.XmlTypeAttribute(Namespace="http:integration.sprint.com/interfaces/manageSubscriberServices/v1/manageSubscr" +
    "iberServices.xsd", IncludeInSchema=false)]
public enum ItemChoiceType2
{
    additionalSocInd,
    skipServiceValidationInd,
}

When I comment out the above enum and all references to it, the service works. There are other xs:choice statements in the XSD that don’t seem to cause any problems.


Update:
Further investigation revealed that when you have the following:

The element is defined directly inside of a sequence element:

<xs:sequence>
<xs:element ... />
...
<xs:choice minOccurs="0">
<xs:element name="additionalSocInd" type="tns:BinaryExpressionType" />
<xs:element name="skipServiceValidationInd" type="tns:BinaryExpressionType" />
</xs:choice>
...
<xs:element ... />
</xs:sequence>

The proxy generated by svcutil causes the error noted above.

When changed to look like this:

<xs:sequence>
<xs:element ... />
...
<xs:element minOccurs="0" name="myChoiceType" type="tns:MyChoiceType" />
...
<xs:element ... />
</xs:sequence>
<xs:complexType name="MyChoiceType">
<xs:choice>
<xs:element name="additionalSocInd" type="tns:BinaryExpressionType" />
<xs:element name="skipServiceValidationInd" type="tns:BinaryExpressionType" />
</xs:choice>
</xs:complexType>

The error goes away. So it may be a bug with the code the generator (svcutil) generates.


I will need to call all the methods in the WSDL, so commenting out the ones that don’t work isn’t an option. And I need to get it working without changing the WSDL (which is the client’s, not ours). Any help would be appreciated.

  • 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-25T11:12:28+00:00Added an answer on May 25, 2026 at 11:12 am

    Try to generate the proxy from command line with these flags:

    svcutil /wrapped /serializer:XmlSerializer http://wsdl_url/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,
I have been trying to get around this error for a day now and
I have been trying to make a case for using Python at my work.
So I have been trying to run the Facebook Connect example for PhoneGap /
I am getting this 'HTTPS hostname wrong:' error when trying to connect to a
We have been using weborb for .net on an existing application for some time
I've been trying to make my classes completely self contained, but I'm having some
I've been trying to add Facebook Connect to a website, but it didn't seem
I have been trying to work with NIO SocketChannels for some time now, and
Have been struggling all day trying to make this simple example work using socket.io.

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.