473,769 Members | 1,632 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sharing types between Web Services in different languages

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.
Nov 23 '05 #1
6 3241
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.

"Moshe Kravchik" wrote:
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.

Nov 23 '05 #2
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#.
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.

Nov 23 '05 #3
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/is...L/default.aspx

Moshe.

"Amit Wadhwa" <co*******@micr osoft.com> wrote in message
news:4A******** *************** ***********@mic rosoft.com...
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.

"Moshe Kravchik" wrote:
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.

Nov 23 '05 #4


"Dilip Krishnan" wrote:
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#.
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.


Nov 23 '05 #5
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(specif ying 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

"Dilip Krishnan" wrote:
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#.
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.


Nov 23 '05 #6
See my earlier reply. There's an MSDN article (actually I've found a few
more there) about sharing types.

"Kris" <Kr**@discussio ns.microsoft.co m> wrote in message
news:49******** *************** ***********@mic rosoft.com...
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(specif ying 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

"Dilip Krishnan" wrote:
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#.
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.


Nov 23 '05 #7

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

Similar topics

8
1807
by: Edward Diener | last post by:
I have a __value class which uses some legacy C++ code. So I wrapped the legacy C++ code in another __nogc class and have a pointer to that class as a member of my __value class. When the __value class is created, I dynamically allocate an object of the class with the legacy C++ code. However because the __value class has no destructor, I can never release that allocated memory. Why does a __value class allow no destructor ? Without it I...
1
1468
by: Kris | last post by:
I read a column on sharing types between web services at http://msdn.microsoft.com/library/en-us/dnservice/html/service07162002.asp Sharing types can be acheived, similar to what described here in this article but little defferently, by defining these custom types in a seperate assembly and importing that assembly at the top of the proxy generated and then manullay deleting the redefined custom types in each proxy class. But still this...
0
1160
by: Henrik Gøttig | last post by:
Hi group I am investingating how I can turn on proxy type sharing from the IDE. I am aware that I can do that from the sharetypes switch on the command-line to wsdl.exe If I have a ASP.NET webapp acting as a client to my webservices I can do it, by adding the special folder "App_WebReferences" and add my wsdl's to that folder. Each time I do an "Add web reference" in in the IDE it knows which services share types and adds them to the...
4
1814
by: radiax | last post by:
Iam trying to find a simple solution for sharing data between windows applications( apart of using file system or remoting or MMF) . I tried using class library by making data members "shared" but it seems that data cant not be passed between applications. what am I doing wrong here? what are "simple" possible solutions? thanks
0
1284
by: Daniel P. | last post by:
http://danutp.blogspot.com/ Web Services - sharing data between client and server Dealing a lot with web services a friend of mine (Ehsan Samani) and I ran into another issue: when we move data from web services to the smart client and back the classes created by the proxy are not identical with the ones on the web services side. If the types we create are really complex then the code associated is complex too. Sharing the code between...
0
1556
by: Emily | last post by:
Imagine a world where everybody shares and has faith in each other. We have all struggled at one time or another with our jobs or careers and have wondered if there was a better way to make a living. What if the solution was just to help each other, simply by giving and receiving. This would be a radical global experiment in faith. Imagine people all around the world connecting instantaneously and just giving and receiving money to each...
2
1972
by: Jeff Dege | last post by:
I'm working with a group that's been doing C++ coding for quite a long time, now, and in that environment we've pretty much worked out development practices that serve us well. We've been doing more and more, over the last few years, in C# and ASP.NET. Some web apps, some background services. In our C++ code base, we have a fair number of statically-linked libraries that contain code we share between projects. At this point, in our...
55
3989
by: tonytech08 | last post by:
How valuable is it that class objects behave like built-in types? I appears that the whole "constructor doesn't return a value because they are called by the compiler" thing is to enable built-in-like behavior for objects of class type. That leads to the "necessity" for the exception machinery so that errors from constructors can be handled. Is all that complexity worth it just to get built-in-like behavior from class objects? Maybe a...
0
3393
by: Marcel Overweel | last post by:
Hi, I'm developing a set of services for a software solution. It will be broken down in several application including a few windows services. It is very likely that most of these services will run on one (server) computer but we can't enforce that. To make support and configuration a little easier, I was
0
9589
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
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9994
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
8870
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
6673
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
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
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.