Want to pass my Currency entity object to a webmethod. I have marked the object as Serializable. However, another object with the same class name Currency(generated by VS.NET 2005) is required when I try to use the webmethod. Why How can I pass my entity object
Thanks

How to pass custom object to WebMethod?
HedleySohn
Remember that using Web Services does not guaranty type identoty, in fact any type that can serialize to the same XML can be used in the client and the server.
If you create a class that can be serializable and creating the proxy in the client by XSD.EXE, WSEWSDL_.EXE or VS.NET you will be able to pass your objects.
Domenico Barile
Thanks a lot.
Paul Nolan
But I wonder why this have to be done manually each time as web reference will be updated frequency during development. Is there anywhere to specify reference of the Currency class to wsdl.exe
Divyachandra
You can also use the XmlInclude attribute to specify the type that you want to use instead of the generated one.
Daniel Roth
AshishKSrivastava
New Currency class generated because wsdl.exe used for code generation have no knowledge (by design) about your Currency classes.
To resolve problem with two Currency classes you may click "Show All Files" button on top of Solution Explorer and find file with generated code under Web References. Remove generated Currency class. After that you can add to this file "using" for namespace where original Currency class defined.
Remember, if you update web reference your changes will be lost.