0

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.

jpaull
  • 278
  • 1
  • 6
  • 17
  • Have you tried to update the service reference and see what the actual type is? – Stefan Apr 05 '19 at 16:10
  • Yes. As I noted above, I tried updating the service reference and it still identifies as returning a single 'servicedItem' object. – jpaull Apr 05 '19 at 16:13
  • I find it unlikely that it's related to a 64-bit vs 32-bit build. Can it be that the 3th party changed the interface? – Stefan Apr 05 '19 at 16:15
  • I would tend to agree, but I have run in the 32-bit version and it works fine. The exception only occurs when running it 64-bit. If they changed the Interface, wouldn't updating the service reference catch that? – jpaull Apr 05 '19 at 16:26
  • Have you re-compiled them both fully? (please note: this might break things ;-) ) – Stefan Apr 05 '19 at 16:27
  • The application has been recompiled. The service is third party and I don't have access to it. – jpaull Apr 05 '19 at 16:29
  • I understand; but although 64 vs 32 bit can do tricky things; it usually does not change a type. ... just saying; something weird is going on. ... I am afraid I cannot help you out here – Stefan Apr 05 '19 at 16:38
  • This is interesting. https://stackoverflow.com/questions/15522589/net-web-service-unable-to-generate-a-temporary-class?rq=1 – jpaull Apr 05 '19 at 16:56

1 Answers1

1

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.

jpaull
  • 278
  • 1
  • 6
  • 17
  • I managed a similar fix, by changing the auto-generated 2-dimensional arrays into 1-dimensional arrays, as described here: https://stackoverflow.com/a/12927390/2365949 – StuartN Aug 07 '19 at 11:00