0

We have two services.

One is written in Java and hosted in a glassfish, the other written as a WCF service library in C# and hosted in IIS.

When I want to communicate with the Java service, I use the wsdl, generate a proxy via svcutil and want to send data.

There are some enum values specified in that wsdl, which have minoccurs="0" set.

If I call an method on that proxy with an object that contains such enums, they do not get sent.

I turned on tracing as described in How to: configure network tracing and turned all of the tracing as described in Configuring tracing

So I see the envelope and there is no value for the enum. There is not even an attribute set, this part is completely missing.

Can I handle this somehow in proxy-generation with svcutil? If the minoccurs is deleted from the wsdl, everything works fine.

I have checked the generated proxy and to not see any difference there regarding the class / enum elements generated.

Mare Infinitus
  • 8,024
  • 8
  • 64
  • 113

1 Answers1

1

If the WSDL for your java service is such that SVCUTIL generates XmlSerializer-based contracts, then you have to make sure that you set the right fields on the contract object before sending the data.

In such a case you should have another boolean field/property on the contract named Specified, you need to set it to true to tell the XmlSerializer that the contains a non-null value.

tomasr
  • 13,683
  • 3
  • 38
  • 30