Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / February 2005

Tip: Looking for answers? Try searching our database.

Sharing types between Web Services in different languages

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Moshe Kravchik - 01 Feb 2005 14:01 GMT
Hi all!
I have 2 web services, one writtenin C++ (ATL) and another one in C#. Is
there a way to define data stuctures in a single place both services could
use? The structures are the same, but if I add a web reference from the C#
project to the ATL project, all the structures belong to the different
namespace and I have to manually copy them over and repeat the full
namespace.

Looking for an adivice,
Moshe.
Amit Wadhwa - 01 Feb 2005 16:35 GMT
These will always be different types.

Even if make a type and use it in two different web services both will be
exposed as different types.

> Hi all!
> I have 2 web services, one writtenin C++ (ATL) and another one in C#. Is
[quoted text clipped - 6 lines]
> Looking for an adivice,
> Moshe.
Moshe Kravchik - 02 Feb 2005 06:43 GMT
I think you are not exactly correct here.
The following article describes how to solve the problem that you mention
(but not the one I want to solve).

http://msdn.microsoft.com/msdnmag/issues/05/03/WSDL/default.aspx

Moshe.

> These will always be different types.
>
[quoted text clipped - 11 lines]
> > Looking for an adivice,
> > Moshe.
Dilip Krishnan - 01 Feb 2005 20:15 GMT
Hello Moshe,
  Refer another post titled 'two references to the same class in WebService
client problem' The problem is web services is about NOT having to share
types. If you do wish to share types why not consider remoting? In anycase
the .net 2.0 has an option to share types using teh wsdl tool

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com

> Hi all!
> I have 2 web services, one writtenin C++ (ATL) and another one in C#.
[quoted text clipped - 8 lines]
> Looking for an adivice,
> Moshe.
Kris - 17 Feb 2005 19:53 GMT
> Hello Moshe,
>    Refer another post titled 'two references to the same class in WebService
[quoted text clipped - 21 lines]
> > Looking for an adivice,
> > Moshe.
Kris - 17 Feb 2005 20:07 GMT
Hi,

I have similar issue sharing types between the web services, and also the
client consuming those web services. I have all my custom types defined in a
seperate assembly and I am using those types as parameter/ return values in
web methods. I am refering to those custom types in .asmx files using a using
directive for that assembly(name space). But when the proxy is generated when
added a web reference(or WSDL tool), those types r geting redefined in the
proxy classes with their own namespace.

If I remove those defenitions manually and put a using directive at the top
before the class definiton, there is no incompatibility issue between the
types. But I need to happen this manually(specifying using directive for the
assembly containing custom types, instead of REDEFNING them) as I have
several such web services and this manual process is getting even worse
whenever there r any updates to those web service's implementation.

Any ideas how to solve this will be greatly appreciated.

Thanks,
Kris

> Hello Moshe,
>    Refer another post titled 'two references to the same class in WebService
[quoted text clipped - 21 lines]
> > Looking for an adivice,
> > Moshe.
Moshe Kravchik - 22 Feb 2005 13:07 GMT
See my earlier reply. There's an MSDN article (actually I've found a few
more there) about sharing types.

> Hi,
>
[quoted text clipped - 43 lines]
> > > Looking for an adivice,
> > > Moshe.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.