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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:20:44+00:00 2026-05-29T09:20:44+00:00

I am working with an external vendor’s web service that appears to be implemented

  • 0

I am working with an external vendor’s web service that appears to be implemented in Java (I believe Apache Axis), and I’m consuming it with a WCF client. Several of the operations require input parameters of type enumeration. The problem is that they only want the enums passed in certain cases. The elements are not marked as nillable in the WSDL. Since they are enums,though, my WCF client will always pass the default value even if not specified. This behavior is causing an internal error in their service.

Any thoughts on how to address this issue? Preferably, it would be solution that would not require manual modification of the proxy, as this might result in confusion if another developer were to generate it independently in the future.

The particular element is specified as follows in the WSDL

<xs:complexType name="complexTypeName">
<xs:sequence>
    <!-- More Stuff Here-->
    <xs:element minOccurs="0" name="parameterName" type="tns:parameterName" />
    <!-- More Stuff Here-->
</xs:sequence>
</xs:complexType>

<!-- . . . -->

<xs:simpleType name="parameterName">
  <xs:restriction base="xs:string">
    <xs:enumeration value="ONLY_AVAILABLE_VALUE" />
  </xs:restriction>
</xs:simpleType>

Svcutil translates this as

[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://vendorwebservicenamespace.com/")]
public enum parameterName
{   
    /// <remarks/>
    ONLY_AVAILABLE_VALUE,
}

EDIT: After a bit more research, it looks like svcutil should normally generate optional parameters (minOccurs=0) with an additional bool fieldNameSpecified parameter, allowing the caller to indicate whether or not the field should be serialized (this is documented here, here, and here).

In this case, however, the parameter is referenced as follows:

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://vendorservicenamespace.com/", Order=23)]
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public Namespace.parameterName parameterName;

When I try to manually add the appropriate fieldNameSpecified method, it doesn’t seem to have any affect on the serialization (i.e., the parameter is still presents in the soap message).

At this point, I am wondering

  1. Why isn’t svcutil including the fieldNameSpecified parameters?
  2. Why doesn’t adding the parameter manually seem to work?
  3. Are there any other workarounds available for this issue?

EDIT: After yet more research, I’ve determined that part of the issue is the way in which the WSDL is written. The Vendor’s WSDL does not conform to the Schema Reference for the DataContractSerializer. Because of this, svcutil is failing back to the XmlSerializer.

The problem is that it is still generating the message contracts for the methods, but not the data contracts. This appears to result in a problem for any types that are not nullable by default, in that they cannot be excluded from the message (can anyone verify this?). Whatever reason the parameterNameSpecified method for the XmlSerializer appears to be ignored when a parameter is flagged with the MessageBodyMemberAttribute (not sure why?)

The only way I have been able to get around this behavior is by using the /wrapped option with svcutil. This results in message contracts being separated from the actual seralized parameters themselves. In this case, svcutil does generate the parameterNameSpecified methods, and the XmlSerializer conforms to them.

  • 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-29T09:20:45+00:00Added an answer on May 29, 2026 at 9:20 am

    After researching the issue, the only solution that I’ve been able to find is to generate the proxy using the /wrapped option on svcutil. As referenced above in the question, this adds an additional layer of abstraction and allows the message contracts to exist a layer above the parameters. In this case the XmlSerializer does generate the fieldNameSpecified properties and conforms to them.

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

Sidebar

Related Questions

I am working to integrate data from an external web service in the client
I am working on a web page that pulls an external javascript file that
I'm working on an embedded C project that depends on some external HW. I
I'm working on a project where there is a lot of external service messaging.
I've been working on a gui app that needs to manage external processes. Working
I'm working with an external REST API that returns some data as a comma-separated
I am working on an application that communicates with an external device via a
I'm working on a system that interacts with many external system API:s. Most of
I am working on a C++ program that uses some external C libraries. As
There's an external library I'm working with that frequently pegs my CPU. I'd like

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.