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 / June 2005

Tip: Looking for answers? Try searching our database.

Using User-Defined Data Type

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Serkan DIRIARIN - 17 Jun 2005 21:36 GMT
hi! i have created a document class. I have a .net client application and a
web service. Both of them using same object model and referencing a
doctypes.dll file. But when i want to run  a client application getting
error InvalidCastException. I deleted class declaration in reference.vb in
web reference defination and reference my document dll file, altough it is
still has error... What is the problem..

thanks....

Serkan
Marvin Smit - 20 Jun 2005 13:15 GMT
Hi Serkan,

the issue here is you are trying to share a class, not a type.

By deleting the "generated class based on the type specified by the
WebService" you essentially invalidate the proxy you created.

When dealing with WebServices, you (exceptions left alone) generally
share a WSDL file. NOT the assembly with the dataclasses exposed by
the WebService.

The WSDL file is then used on the client for generating "Proxy
classes" for you. These classes are NOT THE SAME classes as the server
exposes, but ARE THE SAME TYPES.

The framework will take care of serializing & deserializing. U can
just deal with "objects" in your code on both Server & Client side.

Hope this helps,

Marvin Smit.

>hi! i have created a document class. I have a .net client application and a
>web service. Both of them using same object model and referencing a
[quoted text clipped - 6 lines]
>
>Serkan
newbie - 23 Jun 2005 13:48 GMT
I think I am facing the same problem:
A library defines a type. That type is being returned by a method of a
webservice and being used by a client of that webservice.
My issue appears earlier; at compile time; when I receive a "Class1 is an
ambiguous type" when I try to compile the client app. (Class1 is the type
defined in my library).

Is it something I shouldn't be doing?

> hi! i have created a document class. I have a .net client application and
> a web service. Both of them using same object model and referencing a
[quoted text clipped - 6 lines]
>
> Serkan
Marvin Smit - 23 Jun 2005 14:27 GMT
Hi,

The "Class1" is ambiguous issue might also come from, using the
"Class1" as declerator while multiple namespaces in scope expose a
"Class1" class.

So, if you have

#using Library1;
#using Library2;

Class1 myClass1 = new Class1();

And both Library1 and Library2 contain a class call "Class1", you'll
get this error.

Hope this helps,

Marvin Smit

>I think I am facing the same problem:
>A library defines a type. That type is being returned by a method of a
[quoted text clipped - 15 lines]
>>
>> Serkan

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.