You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Bert Coessens <Be...@esat.kuleuven.ac.be> on 2002/03/22 13:17:15 UTC
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;
}
}
}
Re: soap questions
Posted by Fred Meredith <fm...@nc.rr.com>.
I think I can help you on the first question...
>
> 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?
--- You could of course use the ServiceManager class's list() method which
is likely what the ServiceManagerClient uses...
>
> * 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;
> }
> }
> }
>
>
>
Re: soap questions
Posted by Fred Meredith <fm...@nc.rr.com>.
I think I can help you on the first question...
>
> 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?
--- You could of course use the ServiceManager class's list() method which
is likely what the ServiceManagerClient uses...
>
> * 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;
> }
> }
> }
>
>
>