473,699 Members | 2,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

abstracting a web service

Hi all,

I'm looking at the Amazon web services and get them to work fine. But on any
given call I want to be able to use either the US or the EU schemas which
are in the project as two different web references.
so basically I would like to be able to abstract the objects in each web
service so that I can instantiate either one and pass it to a handler which
can work with either.

Basically the same as you do for two objects inherited fromt he same parent
you can just have a function accept the parent and then cast it as
necessary.

Is there a way to do this with two (almost) exactly the same web services in
different references?

Thanks
Nev.
Nov 16 '05 #1
2 1338
Nev,

You should be able to do this, but it will require some work on your
part. Basically, you will have to dig into the auto-generated code for the
references (select "show all files" from the solution explorer") and from
there, you can refactor the code to provide an abstract base to the web
services.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"nevin" <nevin@[diespam]myself.com> wrote in message
news:40******** *************** @mercury.nildra m.net...
Hi all,

I'm looking at the Amazon web services and get them to work fine. But on any given call I want to be able to use either the US or the EU schemas which
are in the project as two different web references.
so basically I would like to be able to abstract the objects in each web
service so that I can instantiate either one and pass it to a handler which can work with either.

Basically the same as you do for two objects inherited fromt he same parent you can just have a function accept the parent and then cast it as
necessary.

Is there a way to do this with two (almost) exactly the same web services in different references?

Thanks
Nev.

Nov 16 '05 #2
Thanks Nicholas.

i've taken the lazy route and created an interface and put a wrapper around
each one inheriting from this interface. Means I have to double up the
implementation of each wrapper which is half of what I wanted to avoid but
at least i can push a single object cast as the interface through my
handlers.
If i get more time, I'll look into your solution as it may save me in the
long run (read maintenance).

Nev

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:eF******** ******@TK2MSFTN GP10.phx.gbl...
Nev,

You should be able to do this, but it will require some work on your
part. Basically, you will have to dig into the auto-generated code for the references (select "show all files" from the solution explorer") and from
there, you can refactor the code to provide an abstract base to the web
services.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"nevin" <nevin@[diespam]myself.com> wrote in message
news:40******** *************** @mercury.nildra m.net...
Hi all,

I'm looking at the Amazon web services and get them to work fine. But on any
given call I want to be able to use either the US or the EU schemas which are in the project as two different web references.
so basically I would like to be able to abstract the objects in each web
service so that I can instantiate either one and pass it to a handler

which
can work with either.

Basically the same as you do for two objects inherited fromt he same

parent
you can just have a function accept the parent and then cast it as
necessary.

Is there a way to do this with two (almost) exactly the same web

services in
different references?

Thanks
Nev.


Nov 16 '05 #3

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

Similar topics

9
7013
by: Hardy Wang | last post by:
Hi all: I read an article from http://www.c-sharpcorner.com/Code/2003/Sept/InstallingWinServiceProgrammatically.asp about how to install a windows service programmatically. Based ont the code sample, it provides the feature to install service under LocalSystem account. What I need is to install service under some other certian account. By further studying the code, and MSDN...
7
712
by: Mike | last post by:
I want to create a windows service that will monitor another window service. what i need for the service to do is, if a service is stopped I need it to start the service back up example: service 1 - my service watches service 2 - windows service service 2 is stopped - service 1 starts service 2
9
7260
by: SP | last post by:
Hi All, I wrote a windows service which is supposed to stop after specified amount of time. I am calling OnStop() after specified time. OnStop() methods executed but I dont see the service stopping. Please advise how to stop the service. Thanks, SP
3
56989
by: Jeremy S. | last post by:
On my dev machine (XP/Pro with VS.NET 2003) I have been developing a Windows Service and installing it on the local machine by opening the Visual Studio Command Prompt and then executing . Now I want to test this service on a Windows Server 2003 box that doesn't have the Visual Studio Command prompt. How do I go about installing the service on the Windows Server 2003 box? Thanks!
11
1592
by: Full Decent | last post by:
Hey all! I've been using PHP for a while and I'm hearing that I should look into using it OO. I'm looking into making changes to the program Camera Life (http://fdcl.sf.net). I want to abstract the connection to the database which is currently MYSQL and maybe implement another database, or just leave it open for addition. If I get lucky and get the hang of this, I'd also like to abstract calls to GD. So firstly, is there a good...
2
4676
by: letibal | last post by:
Hello, I have written a windows service and created an installer for it. The service runs under the system accounts. When started, it launches a GUI. By default, the InteractiveProcess property of the service is not set (this can be checked by right-clicking on the service in the Services window (Admin tools>Services), choosing Properties, LogOn tab). In order to enable my service to launch a GUI at startup, I added the following lines...
4
3177
by: kkt49 | last post by:
# vim: et sw=4 ts=8 sts from wxPython.wx import * import sys, os, time import pywintypes import win32serviceutil import win32service import win32event import win32process
4
21737
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a webserver to see if service A needs to be updated. What service B does if it sees their is an update for service A is to download a new copy of the service A executable, stop service A, replace the executable with the new copy, and start service B...
20
6739
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
I was executing the steps given in http://suppor.microsoft.com/kb/308359 for testing a sample web service application. However, the following line gives a compilation error: localhost.Service1 xxx = new localhost.Service1(); localhost is not recognized by the compiler.
0
8685
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
8613
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,...
0
9172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7745
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...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
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.