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