473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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 1325
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.com

"nevin" <nevin@[diespam]myself.com> wrote in message
news:40***********************@mercury.nildram.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.com> wrote in
message news:eF**************@TK2MSFTNGP10.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.com

"nevin" <nevin@[diespam]myself.com> wrote in message
news:40***********************@mercury.nildram.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
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...
7
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: ...
9
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...
3
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...
11
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...
2
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...
4
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
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...
20
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.