473,386 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using User-Defined Data Type

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
Nov 23 '05 #1
6 2595
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.
On Fri, 17 Jun 2005 23:36:32 +0300, "Serkan DIRIARIN"
<ac*****@superonline.com> wrote:
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


Nov 23 '05 #2
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.
On Fri, 17 Jun 2005 23:36:32 +0300, "Serkan DIRIARIN"
<ac*****@superonline.com> wrote:
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


Nov 23 '05 #3
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?

"Serkan DIRIARIN" <ac*****@superonline.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

Nov 23 '05 #4
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?

"Serkan DIRIARIN" <ac*****@superonline.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

Nov 23 '05 #5
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
On Thu, 23 Jun 2005 12:48:50 -0000, "newbie" <bo****@mtn.co.ug> wrote:
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?

"Serkan DIRIARIN" <ac*****@superonline.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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


Nov 23 '05 #6
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
On Thu, 23 Jun 2005 12:48:50 -0000, "newbie" <bo****@mtn.co.ug> wrote:
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?

"Serkan DIRIARIN" <ac*****@superonline.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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


Nov 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rujuta Gandhi | last post by:
Hi All, I am facing a very crucial problem. Im developing a web application using .net studio 2005(beta). I want my Login.aspx page to be secured(https) for encrypted login information...
1
by: elziko | last post by:
Hi, I'm using the following code to create a user: Dim strNodeName As String = "test user" Dim NewUser As DirectoryEntry Dim AD As New DirectoryEntry("WinNT://MYCOMPUTER") 'delete user...
9
by: CW | last post by:
I wrote an HTML based chat application. The front end is built entirely on HTML + javascript. Essentially, I have a hidden frame that's refreshed frequently and any new messages are displayed in...
4
by: James P. | last post by:
Hello there, I have a bound-form using Navigator so that the user can move back and forth to update record in the form. Every time a record was modified and the user clicks the Navigator to...
10
by: Fabrizio | last post by:
(Sorry for the crosspost, but I really don't know which is the right newsgroup!) Hi all, I try to change the password to a user that as to change the password at first logon: try {
2
by: YRao | last post by:
I am going to create intranet application using Windows Authentication using C# asp.net I am having following problem: 1 setting windows Authentication, it will validate for all users, user...
5
by: Michelle Stone | last post by:
Hi everybody I am writing a simple asp.net application using form authentication. I store the list of all users and their passwords in an SQL Server database table. My client recently told me...
10
by: George G. | last post by:
Hi there, I am busy writing a new asp.net application and I am reusing some of my existing asp functions and methods in a user control. I need access to session, request and response in some of...
3
by: Lord0 | last post by:
I *think* I need to be able to validate subsets of an XML document using different schema. The functionality I'm trying to implement is this. a) External suppliers produce an XML document...
10
by: shankhar | last post by:
Hi all, In my project there is a requirement. If a user logged in at a time since he/she logged out others are not allowed to loggin using the same user name. That is to avoid multiple logins...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.