473,657 Members | 2,538 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(Us er 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 1123
"Francesco Spegni" <fr************ **@gmail.comwro te in message
news:11******** **************@ n60g2000hse.goo glegroups.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(Us er 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 "UserDerive d";
}
}

[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.WriteLi ne(user.SomeMet hod()); // 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
1783
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 right direction? Here is how I have it set up. UI -> Business Rules layer -> WebService (Broadcasting from SQL Server) -> DataLayer -> SQL Helper -> SQL Server I'll start out at the UI and work my way back.
2
1590
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 would like to move all business logic into a single tier/layer. This tier would either run on the same machine as the ASP.NET or
2
1093
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 this. We have decided a design, I would suggest if some onw help me to evaluate. We have a windows application which is using webservices. The client has to export certain files which requires the documents to be generated first and then put...
6
4000
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 through our firewall. We have another server (Server1) within the SBS domain that is exposed through port 80 of the firewall on which we host some web services and images. What is the best architecture for getting the file from the remotely...
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 system into .NET (C#) and we would like to design a very integrated application with benefits as web mobility and so on.
4
1717
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 soap based xml webservice?? Thanks in advance. Sai
2
1769
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 the data in real time. They have requested that I subscribe to a Web Service that they have published. The only problem is that they often take longer than 30 seconds to process my data before I get a response back from them. This is taking far...
2
1333
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 an extra task, and that is maintaining socket connections with a device and send commands from the client through the webservice to the device. But because a webservice is session depended the socket is closed when there is no client application...
6
1484
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 thoughts. I thought maybe a half business object half dataset approach is feasable...Im not sure... Teir1 - WebService wsTblClient Method Create() Method Read() Method Update()
0
8413
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
8324
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
8740
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
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4173
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
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2742
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
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
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.