Please be aware that the ServiceManagerClient is available for people to
download even if you don't give it to them.  Look into Client Certificates,
Proxy Servers, and Firewalls if this is a production Application.

WSDL sounds like it solves both of your problems.  First it defines
available services, second it defines what parameters each service takes.

Take it one step further and use UDDI and let your client programs discover
and download the WSDL files at runtime so you can keep changing your list of
available services and the parameters they take.  Some could think that this
is cruel, but this is really how the technology should be leveraged.  It is
all about decoupling clients from the services that they consume.



-----Original Message-----
From: Bert Coessens [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 7:17 AM
To: [EMAIL PROTECTED]
Subject: soap questions


Dear all,

I have two questions:

* does anybody know a convenient way to get the list of deployed 
services on a remote server whitout having to use the 
ServiceManagerClient (which is a little dangerous letting to use by 
clients). I wrote a client (see below) able to do this, and it works, 
but I don't know if this is the correct way to do. Does anybody have an 
alternative?

* is there a way to extract the arguments/parameters a service needs 
before sending a request (with possibly wrong parameter settings) or do 
I just have to try and catch if things didn't work?

Thanks a lot,
Bert

public class ServiceLister
{
  public String[] list (String url) throws Exception
  {
    Call call = new Call ();

    call.setTargetObjectURI (ServerConstants.SERVICE_MANAGER_SERVICE_NAME);
    call.setMethodName ("list");
    call.setEncodingStyleURI (Constants.NS_URI_SOAP_ENC);

    Response resp = call.invoke (new URL(url), "");

    if (!resp.generatedFault ())
    {
      Parameter result = resp.getReturnValue();
      String[] services = (String[]) result.getValue();
      return services;
    }
    else
    {
      return null;
    }
  }
}


Reply via email to