Search code examples
.net64-bitservice-reference

Calling web service from 64-bit app returns array instead of single object


I am working on upgrading a Winforms App from 32- to 64-bit and things have gone pretty well but I have run into an issue with a call to a third-party web service.

When running the application in 32-bit, a particular Web method returns an object, but when calling the method from the same application in 64-bit, it seems to return an array of the object.

System.ServiceModel.CommunicationException: 'There was an error in serializing body of message : 'Unable to generate a temporary class (result=1). error CS0030: Cannot convert type 'DDI.DAL.Subscriber.servicedItem[]' to 'DDI.DAL.Subscriber.servicedItem' error CS0029: Cannot implicitly convert type 'DDI.DAL.Subscriber.servicedItem' to 'DDI.DAL.Subscriber.servicedItem[]'

I also find it interesting that the error message says it can't convert the array type to the object type and also that it can't convert the object to the array type. Not sure why it would be trying both.

I have tried updating the Service Reference through Visual Studio, but my generated classes don't change at all.

Has anyone ever seen this? Any ideas on how to fix this? I feel somewhat handcuffed since the call is to a third-party service.


Solution

  • Was browsing through SO and realized I never posted the answer to this question.

    I had to manually edit my generated class and make the property a two-dimensional array to run it in 64-bit. Suddenly it worked. I contacted the service provider and alerted them to the problem... not sure if they will make changes on their end.