473,505 Members | 15,212 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

an architecture based on webservice

hi there,

i hope this message is not out of topic. i've a question about how to
realize a small architecture based on webservice and whose goal is
ensure a good level o flexibility of my code.

in a few words: i've a webservice which exports the method
Authenticate(User usCurrUser). the data type User should be an
abstract class like this:

public abstract class User
{
public abstract bool Validate();
}

what i wish to do would be to create a subclass of it like

public abstract class UserSub : User
{
public UserSub(string strUserId, string strPassword)
{
...<the actual code>...
}

public override bool Validate()
{
...<the actual code>...
}
}

and pass an istance of the subclass to the webservice. the behavior i
expect is that the webservice, calling the abstract method Validate(),
will indeed call the Validate() method specified in the UserSub
class.

why all this? i guess you can easily imagine that if i'm able to
realize this i can change the way to authenticate my users (let's say
no more by userid and password but, instead, by fingerprints) without
need to change the proxy through which my client application calls the
webservice. i "just" need to change the webservice code and the client
code.

i've googled a bit, but i still cannot figure how to realize an
architecture like this. does any of you have some suggestion for my
problem?

i thank you in advance for any help you can give me,

have a nice day :)

francesco

Jun 19 '07 #1
1 1117
"Francesco Spegni" <fr**************@gmail.comwrote in message
news:11**********************@n60g2000hse.googlegr oups.com...
hi there,

i hope this message is not out of topic. i've a question about how to
realize a small architecture based on webservice and whose goal is
ensure a good level o flexibility of my code.

in a few words: i've a webservice which exports the method
Authenticate(User usCurrUser). the data type User should be an
abstract class like this:

public abstract class User
{
public abstract bool Validate();
}

what i wish to do would be to create a subclass of it like

public abstract class UserSub : User
{
public UserSub(string strUserId, string strPassword)
{
...<the actual code>...
}

public override bool Validate()
{
...<the actual code>...
}
}

and pass an istance of the subclass to the webservice. the behavior i
expect is that the webservice, calling the abstract method Validate(),
will indeed call the Validate() method specified in the UserSub
class.
Francesco,

You can't do this with web services. They deal in data only. They cannot
pass instances of an object with methods. Consider the following:

public class UserBase
{
public virtual string SomeMethod()
{
return "UserBase";
}
}

public class UserDerived : UserBase
{
public override string SomeMethod()
{
return "UserDerived";
}
}

[WebService]
public class MyUserService
{
[WebMethod]
public void UserBase GetUser(int userID)
{
// look up user
// return user
}
}

-----------
On the client:

using (MyUserService service = new MyUserService())
{
UserBase user = service.GetUser(1);
Console.WriteLine(user.SomeMethod()); // Will not compile - no such
method
}

This will not compile because the client proxy class only reflects the
"data" portion of the UserBase and UserDerived classes. The data are
described by XML Schema that is referenced by the WSDL (Web Service
Description Language) that .NET generates from the web service. But there is
nothing in WSDL or XML Schema that can describe class methods (except for
the methods of a web service).
You could accomplish what you want through .NET remoting, if remote
operation is part of your requirements.
--
John Saunders [MVP]
Jun 19 '07 #2

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

Similar topics

5
1776
by: DKode | last post by:
I have created an application that will be used for my IT depts. Tasks. I believe I have created the correct architecture but it doesn't feel correct. Could I get opionions if I am headed in the...
2
1583
by: Tim Smith | last post by:
Hi, With our architecture we are looking at the following client applications: - 20-40 GUI desktop power users - 40-100 ASP.NET light users - 5-10 heavy server side integration apps We...
2
1085
by: dinoo | last post by:
May be the this is not the right group to post this. But this is the only group which helps me to receive instant and valuable replies. This is the reason I am posting this here. Excuse me for...
6
3983
by: Pat Carden | last post by:
Hi, We need to allow webusers to upload a file on our website (on Server3, all servers run Server 2003, remotely hosted) and eventually save it on our SBS Server (Server2) which is not exposed...
3
279
by: Max A. Bündchen | last post by:
Hello people! A little question about architeture. We have today a large Visual FoxPro application like ERP that is used for a much large client base. However now we would to rewrite this...
4
1712
by: Sai | last post by:
I am new to this area,please bear with me for this basic question. :) I have an xml schema file xyz.xsd file with me,That contains request and response xml schema ,how can I proceed to create a...
2
1756
by: John A | last post by:
I have a Web Service that I am reponsible for that we use for data integration purposes. Recently I have been tasked with sending some of this data to a third party. Because they need to receive...
2
1330
by: djlinsen | last post by:
hi I've build a webservice and a client application, the client application get's it's information from the webservice, just like it supposed to. Now comes te problem, the webservice should have...
6
1476
by: NewsGuy | last post by:
Hello I'm concidering better ways to architecture our VB.Net Webservices project. Below is a draft of what I thought would be a decent way to go about it, I was wondering about other peoples...
0
7098
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
7303
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,...
0
5613
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,...
1
5028
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...
0
4699
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...
0
3187
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...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1528
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 ...
0
407
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...

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.