Hello Jan!
Again its me working with the Headless Client. this time we try to apply an axis
frontend to the headless client interface – just to provide rpc-style mehtod invocation
instead of the plain http/jsp interface. This will lead to tight integration when thinking
of the xml-plugin of Mr. Ruhsert at Dr. Maison.
We recently tried to call HeadlessClientFactories createSessionBean from within
a context where no HttpRequest is available, i.e. we called the createSessionBean-method with a “null”-Argument for the request parameter.
The Headless client started and came up, but unfortunately it did not work
– we suggest that on intialization something important did not happen.
We’d kindly appreciate any hint on why a HttpServletRequest is needed when
bringing up a headless servoy client instance. Is there any way you know of
to substitute the HttpServlerRequest-parameter? What infomration does
headless client init take from the request?
Thanks for a quick response since this is a very hot topic at our team in the moment.
Cheers,
Michael
Hi Michael,
Can’t you retrieve the request with the following code:
ServletRequest request = getRequest();
, before calling ```
HeadlessClientFactory.createSessionBean(request,“solutionname”);
Paul
On what instance do you call the “getRequest()” - method?
This depends on the context you are in. In a jsp you have a
request instance which is given to you by tomcat.
In an axis-RPC you do not have that directly…
I am just about to mock a request to see what the Headless Client
calls in the interface, since that cant be too much…
Servoy-Core-Developers: Can you provide with any hint?
Thanks,
Michael
Ok, at last:
As I suspected, it is not much the HeadlessClient does with the http-request it gets passed.
It just calls getLocale (in our setup). This can be mocked easily.
So, taking care of the Instance-Handling ourselves (i.e. we have no session or application
context as in the demo jsps), we are able to use an axis-RPC-style Frontend for the
Headless-Client.
Thus it is much more easy now to integrate service-calls from within a different Java
environment. No more URL/HTTP explicit stuff. Just get your WSDL and let axis generate
the client stub code for you.
And if you dont like RPC style you can enhance this to the other message styles as you like…
Is anyone interested in stuff like that?
Don’t really get what you achieved… ![Sad :(]()
I thought you were trying to use the HeadLess client to publish methods as (SOAP) WebServices.
Maybe some more description of what you achieved?
Paul
It is not really needed. You can give null to it it should work fine. This is also how batch processors are getting started.
What then can’t be done is get the session client back for a second request… So you can only use it once.
So what did go wrong? what didn’t work?
@pbakker: Thats what we use now. Servoy methods be published as SOAP webservices.
@jcompagner: I made a mistake in the call to the servoy form-method itself. null as value
for the request parameter in the HeadlessClientFactory works fine.
Thank you,
Michael
That is interesting then ![Smile :)]()
Played around with it myself, got it working, but only in a hardcoded way, meanign that you had to hardcoded the Solution, form and method name in the Java code and then compile it.
How does your functionality work?
Can you publish methods by scripting in Servoy?
Paul
Eeasiest way to get around this is to provide all
the static data in the webservice call itself.
Design suggestion:
Have one form and one method hardcoded and dispatch
the functions in a servoy-side-dispatcher – this could be done just by scripting.
We use a scheme like this in our (old) headlessclient-jsp setup.
OK, that does work basically just like the plugin I created myself.
So, yes, it’s interesting, but for me: I allready have uild that myself ![Smile :)]()
Paul