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 / January 2006

Tip: Looking for answers? Try searching our database.

How do I get the WSDL Proxy to use Custom Types as Parameters/Return Values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gbanister - 19 Jan 2006 04:31 GMT
I'd like to repost a message that I found in this group almost one year
ago, because it's the exact problem I'm in and there was no solution
offered to this post last year.  (note: I was not the original author
of the below post)

I have similar issue sharing types between the web services, and also
the
client consuming those web services. I have all my custom types defined
in a
seperate assembly and I am using those types as parameter/ return
values in
web methods. I am refering to those custom types in .asmx files using a
using
directive for that assembly(name space). But when the proxy is
generated when
added a web reference(or WSDL tool), those types r geting redefined in
the
proxy classes with their own namespace.

If I remove those defenitions manually and put a using directive at the
top
before the class definiton, there is no incompatibility issue between
the
types. But I need to happen this manually(specifying using directive
for the
assembly containing custom types, instead of REDEFNING them) as I have
several such web services and this manual process is getting even worse

whenever there r any updates to those web service's implementation.

Any ideas how to solve this will be greatly appreciated.
Gianluca Torta - 21 Jan 2006 10:52 GMT
I have the same problem and I think this is a very common issue.

Unfortunately the only two solutions I have heard about are:
(1) modify the proxy manually after it has been generated by WSDL (that
is the solution used by gbanister)

(2) in your client use the common types, then when communicating
from/to the Web Service convert them to the (identical) types defined
in the Web Service.
To do this it is not possible to just make a cast (CType in VB.NET)
because the two types even if identical appear as unrelated to .NET.
You have to serialize the object of type T1 into a stream, then
deserialize it as type T2 (there is a little function doing this at
http://weblogs.asp.net/cweyer/archive/2003/07/07/9768.aspx).

Currently I'm using (2) in my current project but clearly both (1) and
(2) are unsatisfactory solutions.
Anyone knows whether there are better solutions pheraphs in the final
release of .NET 2.0 (I am still using the Beta2) or in an upcoming
release of .NET?
gbanister - 22 Jan 2006 00:35 GMT
Thanks Gianluca!
I wonder if Indigo (WCF) has a better soution for this. I'd also
consider the best solution for sending custom types over the wire to
include binary serialization so that it will serialize private members
of a custom type as well.

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.