Share Class Library between Service and Consumer

M

Mike Lynch

I want to share a class library between a web service and it's consumer (another web service). When I run the consumer I get a conversion error saying one class is not derived from the other

How can I overcome this

Simplified pseudo code is shown belo

Service
imports myClassLibrar

<web Method> public function method1(param as string) as myClassLibrary.Class
Dim r1 as myClassLibrary.Class
'do some processin

Return r
End Functio

End Service

Service
imports myClassLibrar

<web Method> public function method2(param as string) as myClassLibrary.Class
Dim r2 As New myClassLibrary.Class

r2.Name = "Test
r2.Obj = Service1.method1("A String"

Return r
End Functio

End Service

myClassLibrar

Public Class Class

End Clas

Public Class Class
Public Name as Strin
Public obj As Class
End Clas

End myClassLibrary
 
J

Jan Tielens

In your client project there are proxy classes generated when you add a web
reference to it. So you can't use your originating class client side, this
is default web services behavior.

--
Greetz,
Jan
________________________
Read my weblog: http://weblogs.asp.net/jan

Mike Lynch said:
I want to share a class library between a web service and it's consumer
(another web service). When I run the consumer I get a conversion error
saying one class is not derived from the other.
 
M

Mike Lynch

That worked a treat Andrew

Thanks for your hel

Mik

----- Andrew Hopper wrote: ----

Hello, Mike

Please see my blog entry regarding using "shared types" assemblies
http://dotnetified.com/CommentView.aspx?guid=abaf08b3-1abd-4dae-be05-23b733ff3c5

Hope this helps
-Andy Hoppe

Mike Lynch said:
I want to share a class library between a web service and it's consume
(another web service). When I run the consumer I get a conversion erro
saying one class is not derived from the other
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top