473,657 Members | 2,555 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 InvalidCastExce ption. 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 2613
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*****@supero nline.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 InvalidCastExce ption. 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*****@supero nline.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 InvalidCastExce ption. 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*****@supero nline.com> wrote in message
news:%2******** ********@tk2msf tngp13.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 InvalidCastExce ption. 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*****@supero nline.com> wrote in message
news:%2******** ********@tk2msf tngp13.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 InvalidCastExce ption. 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*****@supero nline.com> wrote in message
news:%2******* *********@tk2ms ftngp13.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 InvalidCastExce ption. 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*****@supero nline.com> wrote in message
news:%2******* *********@tk2ms ftngp13.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 InvalidCastExce ption. 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
2219
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 transfer. I modified web.config and properties of Login page from IIS server. And now when ever the execution is redirected to Login.aspx It is having https as its protocol.
1
5202
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 when existing Try
9
4510
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 another frame using document.write. My problem is that since chat screen can be obscured by other applications/windows, I have no way of informing users that new messages have arrived other than popping the window to the top using window.focus....
4
2201
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 either move backward or forward to the next record, a message is popped up asking the user to confirm the change. If the user clicks "Yes", the record should be updated and the Navigator takes the user to the next record as clicked. If the user...
10
9864
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
2414
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 name and password from ADSI before entering into application this is working fine. Problem Is I am going to categorize users based on their Title properties value
5
2068
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 that he wants me to do something through which only one user can login using any given account name. I mean to say, for example, when a user called "abc" is online, another person shouldn't be
10
2492
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 the functions and I can't find out how to do it. Here is an example of what I do and I get the following Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the...
3
1753
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 containing multiple User records. The external supplier validates this entire document using schema 1. This document is then uploaded to our system. b) Our system then checks that the supplied document "looks okay", minimally, using Schema 2. Schema...
10
13069
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 using a account. How to do this? I had got a idea and implemented. 1. When a user logs in storing the username, ip, login time to db.
0
8403
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8833
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8737
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8509
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5636
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.