Print

Print


By ID do you mean URL?

Basically you bind different URLs to different instantiations of the
Java class.

One approach would be to write an abstract class with all the ZNG
handling, something like

public abstract class BaseZNGObject {
  String database = null

  public Test() {
  }
  
  public ZNG(

...
// All the ZNG handling, database searching stuff.

  
}


Then write classes of the form

public class Database1ZNGObject extends BaseZNGObject {

  public Database1ZNGObject () {
    database="database1";
  }
}

public class Database2ZNGObject extends BaseZNGObject {

  public Database1ZNGObject () {
    database="database2";
  }
}

And then bind these classes to different URLs using the SOAP toolkit.


Matthew

> -----Original Message-----
> From: LeVan,Ralph [mailto:[log in to unmask]]
> Sent: 30 October 2001 15:20
> To: [log in to unmask]
> Subject: RPC Context
> 
> I'm still trying to figure out how to tell what database my query is
for.
> The problem may be in my toolkit, but I've got to ask this question
again.
> 
> When a SOAP request is received, a special SOAP servlet processes the
> message.  It looks at the ID for the message, looks that ID up in a
table
> and determines the Java class that contains the method that should
process
> the message.  It then pulls the parameters for the method out of the
> message.  It then creates an instance of the Java class and calls the
> method
> (searchRetrieve in our case) with the parameters.
> 
> Nowhere in there does searchRetrieve have access to the URL that
contained
> the message.  That URL somehow encoded the database to be searched.
That
> means that my searchRetrieve method does not know what database it
should
> be
> searching.
> 
> How do we get around this problem without exposing the database name
as a
> parameter to searchRetrieve.
> 
> Thanks!
> 
> Ralph