Client-server-communication

Post Reply
Alizee
Posts: 11
Joined: Thu Mar 19, 2015 2:16 pm

Client-server-communication

Post by Alizee » Mon Mar 23, 2015 5:17 pm

Hey guys,

as far as I can see the standard odysseus server communicates with a client either inside the same osgi-container or via webservice. I would like to develop a separate client and therefore need to know how to send queries to the webservice on port 9669. Thanks in advance,

Alizee

User avatar
Marco Grawunder
Posts: 272
Joined: Tue Jul 29, 2014 10:29 am
Location: Oldenburg, Germany
Contact:

Re: Client-server-communication

Post by Marco Grawunder » Mon Mar 23, 2015 5:44 pm

Hi Alizee,

you can see an example for this, when you look at

Code: Select all

de.uniol.inf.is.odysseus.planmanagement.executor.webservice.client.WSClient
(here multiple connections are handled, it is much easier for a single client)

You need to login, and you will get a SecurityToken. This token is needed in every call to the server.

Code: Select all

String securitytoken = wsServer.login(username, password,tenant).getResponseValue();
Tenant is typically ""

Code: Select all

Collection<Integer> response = wsServer.addQuery2(securitytoken,
					parserID, query, context).getResponseValue();
parserID should be "OdysseusScript"
query is the Sting in OdysseusScript
context can be an empty object

The result is a collection of id for queries that have been installed. If you use #RUNQUERY they are also started.

Retrieving results is a bit more complicated. A socket sink need to be connected to the query and your client must connect to this. See createClientReceiver for an example.

Alternatively, you can create a query that has already a sink you can connect to (e.g. with TCPClient and CsvHandler)

Remark: Dennis has build a maven artifact for a client: https://github.com/Indivon/odysseus-jar-client

Alizee
Posts: 11
Joined: Thu Mar 19, 2015 2:16 pm

Re: Client-server-communication

Post by Alizee » Tue Apr 14, 2015 3:46 pm

Does the odysseus studio client always use the webservice to add and run queries? (even if it runs inside the same osgi container)?

User avatar
Marco Grawunder
Posts: 272
Joined: Tue Jul 29, 2014 10:29 am
Location: Oldenburg, Germany
Contact:

Re: Client-server-communication

Post by Marco Grawunder » Tue Apr 14, 2015 4:22 pm

No. In this case the Executor is bound directly (if you use e.g. Odysseus Studio in the monolithic version).

This is handled with different implementations of the IExecutor interface. In the client only version this is currently a web service communication, in the monolithic version the "StandardExecutor" is bound.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest