[SoapRMI] multiple objects on the same port

Aleksander Slominski aslom_at_cs.indiana.edu
Sat, 23 Nov 2002 21:48:12 -0500


"nodep_at_libero.it" wrote:

> I would to have multiple service (objects) on same
> TCP port and I wrote the code that there's in the
> FAQ for to register 2 objects. The problem is: how
> can client to choose the service? (i.e. if I register
> "servi1" and "servi2" I want to call "servi2" and
> then "servi1").

hi,

you need to be more specific when giving location of object to client,
for example pass http://localhost:PORT/servi1 or http://localhost:PORT/servi2.

in general to get this URL o the server side when you
have exported object use
  String remoteService1Url = SoapServices.getDefault().getStartpointLocation(ref1);

hope it helps.

thanks,

alek




>
> The error I obtain is:
>
> ---
> Exception in thread "main" soaprmi.ServerException: SOAP-ENV:Client:
> soaprmi.Ser
> verException: more than one remote object registered - could not
> choose default
>         at soaprmi.soaprpc.MethodInvoker.receiveResponse
> (MethodInvoker.java:437)
>
>         at
> soaprmi.soaprpc.HttpSocketSoapInvocationHandler.invokeTransport(HttpS
> ocketSoapInvocationHandler.java:133)
>         at soaprmi.soaprpc.SoapDynamicStub.invoke
> (SoapDynamicStub.java:118)
>         at $Proxy0.sayHello(Unknown Source)
>         at minimal.HelloClient.main(HelloClient.java:89)
> remote exception is: soaprmi.ServerException: more than one remote
> object regist
> ered - could not choose default
>         at soaprmi.soaprpc.SoapDispatcherImpl.dispatchToService
> (SoapDispatcherIm
> pl.java:262)
>         at soaprmi.soaprpc.SoapDispatcherImpl.dispatch
> (SoapDispatcherImpl.java:1
> 98)
>         at soaprmi.soaprpc.HttpSocketSoapServerConnection.doPost
> (HttpSocketSoapS
> erverConnection.java:323)
>         at soaprmi.soaprpc.HttpSocketSoapServerConnection.process
> (HttpSocketSoap
> ServerConnection.java:250)
>         at soaprmi.soaprpc.HttpSocketSoapServerConnection.run
> (HttpSocketSoapServ
> erConnection.java:76)
>         at java.lang.Thread.run(Thread.java:536)

--
The ancestor of every action is a thought. - Ralph Waldo Emerson