|
|
|
|||||
|
service access control problem
Hi, I want to develop a common service (which provide sending and receiving MMS service) for other server(eg. web server).
I think ICE is rather a good solution to do this. Send progress: web servers ---->| web servers ---->| -> MMS Service -> MMS Gateway web servers ---->| Recv progress: web servers <----| web servers <----| <- MMS Service <- MMS Gateway web servers <----| I simply define a sending MMS interface: class SendMMS { SendMMSRes SendMMS(TMMSInParam inparam); } but I have 3 questions: 1. When multi web server invocation the SendMMS operation, are there multi SendMMS impletion objects for each web server or only one? 2. The authrization is needed for every web server to access my MMS service, how can I control the access? Must I provide another IN PARAM in the SendMMS operation which include authrization information? And do the authrization in every call? 3. When receive MMS from the MMS gateway, each MMS must be deliver to one of those web servers based some policy (eg. by destnation ID). So for receiveing MMS service, I have to make the web servers as the serverside of ICE object. But if I do so, then there is many same object in different web servers, and they are different. I don't know how to config ICE to fit this solution. Rather sorry for my poor English. yomi |
|
|||||
|
Thank you , marc.
-------------------------------------------------------------------------------- Instead of the extra parameter, you could also use the request context. You could set a default context for the proxy once, so that it contains the authorization ID, and then wouldn't have to pass it explicitly anymore. -------------------------------------------------------------------------------- Does 'request context' mean I provide another interface such as Login(authid) and must first invoke this operation? But how to set the context if there is only one server object for multi clients, since the server can on longer ditiguished the client's invoke in the SendMMS operation because SendMMS operation didn't take any authrization information? yomi |
|
||||||
|
Quote:
Code:
std::string authID = ... // Your ID for authentication. SendMMSPrx proxy = ... // Your SendMMS proxy. Ice::Context ctx; ctx["authID"] = authID; proxy = SendMMSPrx::uncheckedCast(proxy.ice_newContext(ctx)); Code:
void SendMMS::someOperation(..., const Ice::Current& current)
{
Ice::Context::const_iterator p = current.ctx.find("authID");
if(p == current.ctx.end())
{
// Context not set, handle with exception or in any other apropriate way...
}
else
{
std::string authID = p->second;
// Use authID to check authorization...
}
};
|
|
|||||
|
Thank you again, marc.
I think my problem is resolved with your help. By the way, can the severant get the client's ADDRESS information(ip, port, transfer protocol ) in the dispatch call back function? Maybe from the 'Ice.Current __current' param? I have checked the Ice.Current class, but didn't get the address information. struct Current { ::Ice::ObjectAdapterPtr adapter; ::Ice::Identity id; ::Ice::FacetPath facet; ::std::string operation; ::Ice::OperationMode mode; ::Ice::Context ctx; ICE_API bool operator==(const Current&) const; ICE_API bool operator!=(const Current&) const; ICE_API bool operator<(const Current&) const; }; |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to control the time? | russule | Help Center | 9 | 01-26-2007 10:07 PM |
| User access control with glacier2 | OrNot | Comments | 2 | 07-15-2005 11:32 PM |
| can i control socket? | TyraelTong | Help Center | 2 | 08-18-2004 12:56 AM |
| Self access problem | Jonathan | Help Center | 2 | 03-31-2004 07:40 AM |
| problem when call another service at start function. | damingyipai | Bug Reports | 2 | 02-29-2004 08:22 AM |