469,643 Members | 2,064 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,643 developers. It's quick & easy.

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 1646
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Angelos Karantzalis | last post: by
7 posts views Thread by Jim Bancroft | last post: by
8 posts views Thread by Herby | last post: by
8 posts views Thread by Kris Jennings | last post: by
11 posts views Thread by Frederic Rentsch | last post: by
9 posts views Thread by Jess | last post: by
19 posts views Thread by =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.