Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2004

Tip: Looking for answers? Try searching our database.

Serializer unneccesarily recreates type?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
George Bool - 11 Jul 2004 08:17 GMT
Hello,

I have a simple webservice that accepts a network credential as an argument
to a webmethod.
When i create a proxy for my client to use, the proxy generator then
recreates a new type

mywebservicename.networkcredential

such that when i try to pass a system.net network credential to the
webservice, it fails saying option strict on prevents cast from
mywebservicename.networkcredential to system.net.networkcredential.

I prefer to program with Option strict on so i dont want to turn it off.

What am i doing wrong that .Net cant see that the network credentials are
exactly the same. This is especially annoying considering it is a .net
framework type i am passing.... but the proxy generator turns it into a
custom class... why?

I also get the same issue with a dataset created from the same middle tier
assembly, however whenever i try to pass the dataset from the client to the
webservice it says they are of different types?

Thanks
George
Elena Kharitidi - 02 Sep 2004 06:52 GMT
This behavior is by design: type identity is not preserved on the client,
otherwise strong coupling between server and client would be required.
Web services a lot about interoperability and it is essential for
interoperability that there are no assumptions are made about the
implementation or type system of a given Web Service.

WebService publishes its contract (service description) which describes the
message exchange and the wire signatures, but holds no details on the web
service implementation.  In this particular case the
System.Net.NetworkCredential class will be described as a schema type with
three elements: UserName, Password and Domain, on the client side, when the
proxy is generated from the service description, again no assumption is
made about the web service implementation, and types declared in the wsdl
re-created on the client as a User defined types without any
business-object logic, with just one grantee: the serialized instances of
the created classes (wire signature) will validate against
service-published contract.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.