views:

58

answers:

3

Hello,

I have created a WCF service using vb.net. Everything works fine on my development machine but when I deployed it it failed with the following error

'There was an error while trying to deserialize parameter http://tempuri.org/:querys'

I call a single method on the service and it has a single parameter called 'querys'. This parameter was a list(Of CustomType).

I then created a new method with a single parameter of type ArrayList. Thinking that this should serialize. Again it works fine on my development machine but fails when I deploy it with the same error a above.

I am completely stumped how it can serialize a parameter on one machine and not on another. I've tried it on 2 other machine and it doesn't work on either of them. So that rules out a problem with the machine itself.

All machines are running Win XP and .Net v3.5. The service was developed using VB .net in Visual Studio 2008.

Has anyone else experienced this?

I have not included any code because the error is happening System.ServiceModel and as I mentioned above the code does work on the development machine.

Please let me know if you need any more information.

Thanks in advance

A: 

Did you mark your 'CustomType' and its fields/properties you want to serialize with attribute DataContract, DataMember?

When you add the service reference to your client app which setting do you use? (Reuse types in referenced assemblies, always generate message contracts...)

Mart
Hi, thanks for your reply. Yes I have marked them with DataContract and DataMember attributes. Also I have it set to reuse types in referenced assemblies and NOT to generate message contracts. As I mentioned in the original post the code does work on the development machine. It is only when I run it on another machine that it fails.
richie
Have you already tried this? http://www.creativecodedesign.com/node/26
Mart
A: 

If you host the WCF service on a IIS, then you should remember to run this command on the servers.

C:\WINDOWS\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe /i /x

mraaskov
Hi, Thanks for the reply. I'm not using IIS. It will be hosted as a windows service when completed. But while I'm developing it I am running it from a console app.
richie
A: 

Thanks to everyone who replied,

I have resolved the problem but unfortunately do not how. I tried many code changes but as far as I can tell I have reset the code back to the way it was. It is working now and I can not spend any more time on the issue to find out what caused it.

Just one of those things I guess.

richie