# New Headless Client Plugin - Any Tutorials Available?

**URL:** <https://forum.servoy.com/t/new-headless-client-plugin-any-tutorials-available/11644>\
**Category:** Classic Servoy\
**Created:** [January 20, 2010, 4:45pm UTC](https://forum.servoy.com/t/new-headless-client-plugin-any-tutorials-available/11644 "2010-01-20T16:45:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kahuna](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@Kahuna](https://forum.servoy.com/u/Kahuna)\
**Post date:** [January 20, 2010, 4:45pm UTC](https://forum.servoy.com/t/new-headless-client-plugin-any-tutorials-available/11644/1 "2010-01-20T16:45:30Z")

</div>

Hi Folks - I’ve got a couple of really long process which I need to run regularly but don’t want the client hung during that time.

The headless client plugin looks like it may be what we need to run these in a new thread?

Area there any tutorials on how this new plugin works to get us (simpletons) started?

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [January 21, 2010, 8:23am UTC](https://forum.servoy.com/t/new-headless-client-plugin-any-tutorials-available/11644/2 "2010-01-21T08:23:05Z")

</div>

Not yet, have a look at the sample code to get started

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [January 21, 2010, 10:50am UTC](https://forum.servoy.com/t/new-headless-client-plugin-any-tutorials-available/11644/3 "2010-01-21T10:50:59Z")

</div>

do remember that you start a new client on the server, so it wont have the same state as you now have in your client (it is not just a new thread in your current client)

a quick demo code:

```auto
var client = null;
/**
 * @properties={typeid:24,uuid:"BAD1AEE9-9B72-477A-A0AA-10619F4C2127"}
 */
function headlessTest()
{
	client = plugins.headlessclient.createClient(solutionName,username,password,solutionOpenMethodArgs)
	client.queueMethod(null,globalmethodnameinremotesolution,args,callbackFunction)
}

/**
 * @param {JSEvent} event
 */
function callbackFunction(event)
{
	// do some stuff
	if (JSClient.CALLBACK_EVENT == event.getType())
	{
		// handle normal execute of remote method 
	}
	else if (JSClient.CALLBACK_EXCEPTION_EVENT == event.getType())
	{
		// handle exception execute of remote method 
	}
	client.shutdown()
}

```

---

<div class="post-metadata">

**Author:** ![Kahuna](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@Kahuna](https://forum.servoy.com/u/Kahuna)\
**Post date:** [January 21, 2010, 11:00am UTC](https://forum.servoy.com/t/new-headless-client-plugin-any-tutorials-available/11644/4 "2010-01-21T11:00:45Z")

</div>

Thanks Johan - that makes sense.

I was thinking I could use it as a new thread - but running the process on the server is way more powerful.

Forgive my ignorance - but using this plugin means a headless client is started on the server - but unlike running a HLC from a scheduler, there must be a solution open at the time to initiate it?

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [January 21, 2010, 11:35am UTC](https://forum.servoy.com/t/new-headless-client-plugin-any-tutorials-available/11644/5 "2010-01-21T11:35:33Z")

</div>

you start a headless client on the server with this call:

plugins.headlessclient.createClient(solutionName,username,password,solutionOpenMethodArgs)

and that will load the solution you specify there.

---

<div class="post-metadata">

**Author:** ![Jeroen\_de\_Vries](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@Jeroen\_de\_Vries](https://forum.servoy.com/u/Jeroen_de_Vries)\
**Post date:** [June 10, 2010, 1:40pm UTC](https://forum.servoy.com/t/new-headless-client-plugin-any-tutorials-available/11644/6 "2010-06-10T13:40:11Z")

</div>

When I try to use the headless client plugin in Servoy 5.1.2, I get **Can’t find method com.servoy.extensions.plugins.headlessclient.HeadlessClientProvider.js\_createClient(string,string,string,string)**  
on

```auto
client = plugins.headlessclient.createClient('headlessProcess','myname','mypwd','');

```

I tried it on both server and developer, same result. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [June 10, 2010, 1:51pm UTC](https://forum.servoy.com/t/new-headless-client-plugin-any-tutorials-available/11644/7 "2010-06-10T13:51:01Z")

</div>

The last argument has to be an array, not a string.

Paul
