472,348 Members | 1,244 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

casting incomptability between 2 instances of the same class

Hi,

I am using 2 different web services: Manage_Login and Manage_Employee.
In these WS I can have the same message (using the appropriate
methods), and this message is an object that I serialize: Employee.

On the client side, after using my WS, I try to compare two objects:
Manage_Login.Employee and Manage_Employee.Employee. It is the same
class, from the same assembly (my underlying business objects
assembly), but coming from 2 different web services.

I get a casting incomptability between 2 instances of the same class.
Is there a way around that?

I would like not to have to write a function that does:
Manage_Login.Employee.Name=Manage_Employee.Employe e.Name;
Manage_Login.Employee.EMail=Manage_Employee.Employ ee.EMail;
....

thank you for you thoughts and help,
Pierre

Feb 21 '06 #1
4 1703
Does your Web Service and Main program access the same dll? Normally
when you add a reference to the web service, it creates a proxy class
with the same properties as the class in your assembly.

What is the exact error message you are getting? You might have to
hand modify the proxy code to point to your business objects.

Feb 21 '06 #2
Hi and thank you for that good hint Chris.
Does your Web Service and Main program access the same dll?
The Web Services indeed access the same dll (BusinessObjects.dll) in
which the messages are included.
Normally when you add a reference to the web service, it creates a proxy class with the same properties as the class in your assembly.
Yes and that's excatly the issue, by doing that visual studio creates
(on the client's side) two different classes out of 1 (on the server).
What is the exact error message you are getting?
Error 1 Cannot implicitly convert type 'Manage_Employee.TblEmployee' to
'Manage_Login.TblEmployee'
You might have to hand modify the proxy code to point to your business objects.


Very good idea, I am using vs 2005 and unfortunatly I cannot find the
proxy classes. I just see the disco, discomap and wsdl for each web
service. I don't find any code.

Best regards,
Pierre

Feb 22 '06 #3
I haven't yet worked with Web Services in 2005, only in 2003.

If you select the project in the solution explorer and then click the
"Show All Files" button perhaps that will reveal the code files.

Feb 22 '06 #4
Yes I've done that, but I still don't see any code. If anybody knows
where the proxy's code is with VS 2005 I'm sure I'm not the only one
that could use that info.

Or perhaps there's no code and vs is directly using the wsdl. As I
found another solution, I didn't go further with that.

Pierre

Feb 23 '06 #5

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

Similar topics

2
by: Angelos Karantzalis | last post by:
Hi guys, I'm trying to load a class instance dynamically, and then cast it to it's base type so I can use it in my app. More specifically, I'm...
7
by: yufufi | last post by:
lets say we have a 'shape' class which doesn't implement IComparable interface.. compiler doesn't give you error for the lines below.. shape...
7
by: Jim Bancroft | last post by:
Hi everyone, A basic one here, I think. I haven't found the pattern yet, but sometimes when I cast a variable to another type using the "C"...
3
by: Pierre | last post by:
Hi, I am using 2 different web services: Manage_Login and Manage_Employee. In these WS I can have the same message (using the appropriate...
8
by: Herby | last post by:
Given class B and C which inherit from class A They all override a method of the form: Add( A^ lhs, A^ rhs ); So A is abstract. So if i was...
8
by: Kris Jennings | last post by:
Hi, I am trying to create a new generic class and am having trouble casting a generic type to a specific type. For example, public class...
8
by: Gamma | last post by:
I'm trying to inherit subclass from System.Diagnostics.Process, but whenever I cast a "Process" object to it's subclass, I encounter an exception...
11
by: Frederic Rentsch | last post by:
Hi all, If I derive a class from another one because I need a few extra features, is there a way to promote the base class to the derived one...
9
by: Jess | last post by:
Hello, It seems both static_cast and dynamic_cast can cast a base class pointer/reference to a derived class pointer/reference. If so, is there...
19
by: =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?= | last post by:
I'm doing my c# more and more like i used to code c++, meaning i'm casting more often than creating an instance of objects. like : protected void...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

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.