Help! I have an Axis web service that is being consumed by a C# application. Everything works great, except that arrays of long values always come across as [0,0,0,0] – the right length, but the values aren’t deserialized. I have tried with other primitives (ints, doubles) and the same thing happens. What do I do? I don’t want to change the semantics of my service.
Share
Here’s what I ended up with. I have never found another solution out there for this, so if you have something better, by all means, contribute.
First, the long array definition in the wsdl:types area:
Next, we create a SoapExtensionAttribute that will perform the fix. It seems that the problem was that .NET wasn’t following the multiref id to the element containing the double value. So, we process the array item, go find the value, and then insert it the value into the element:
Finally, we tag all methods in the Reference.cs file that will be deserializing a long array with our attribute:
This fix is long-specific, but it could probably be generalized to handle any primitive type having this problem.