Call Headless Client via SOAP web service method

The forum to discuss the Headless version of Servoy. Web, Java and Servlet development questions can all be posted here.

Call Headless Client via SOAP web service method

Postby ruwanwickramage1344409283 » Wed Aug 08, 2012 11:31 am

Hi,

We have exposed a SOAP web service to a third party hosted on the Servoy server and when the third party calls the service, web service method calls a method in the hosted servoy solution and do the next steps. Both solutions were running without any issues for some time

But we have done following upgrades to the environment and due to that some exceptions were returned by the servoy solution. Necessary logs can be seen below

Servoy version 5.2.6 to 5.2.13
Java version 1.6.0_18 to 1.6.0_26


Current Server Information
Servoy version 5.2.13 -build 1025
Port used by RMI Registry: 1099
Repository version 38 (CB315884-36E0-42FE-9B30-0A31B4096FB7)

VM Information
java.vm.name=Java HotSpot(TM) 64-Bit Server VM
java.version=1.6.0_26

Any suggestions would be appreciated.

Thanks,
Ruwan
ReturnPool B.V



Below is the full stacktrace of the error from the logs

DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - repository_server: getting managed connection
ERROR http-8080-6 com.servoy.j2db.util.Debug - Cannot load solution rp_esend
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Database name PostgreSQL
ERROR http-8080-6 com.servoy.j2db.util.Debug - Throwable
com.servoy.j2db.ApplicationException: Login is incorrect
at com.servoy.j2db.server.headlessclient.SessionClient.showDefaultLogin(SessionClient.java:511)
at com.servoy.j2db.ClientState.loadSolutionsAndModules(ClientState.java:1353)
at com.servoy.j2db.server.headlessclient.SessionClient.loadSolution(SessionClient.java:266)
at com.servoy.j2db.server.headlessclient.SessionClient.loadSolution(SessionClient.java:242)
at com.servoy.j2db.server.headlessclient.HeadlessClientFactoryInternal$1.run(HeadlessClientFactoryInternal.java:64)
at com.servoy.j2db.server.headlessclient.HeadlessClientFactoryInternal.createSessionBean(HeadlessClientFactoryInternal.java:76)
at com.servoy.j2db.server.headlessclient.HeadlessClientFactory.createSessionBean(HeadlessClientFactory.java:45)
at com.servoy.j2db.server.headlessclient.HeadlessClientFactory.createSessionBean(HeadlessClientFactory.java:29)
at com.returnpool.connectivity.services.rpservoy.RPServoyClient.callServoyService(RPServoyClient.java:64)
at com.returnpool.connectivity.services.webservices.clients.esend.ESendWSClient.call(ESendWSClient.java:89)
at com.returnpool.connectivity.services.WebService.call(WebService.java:41)
at com.returnpool.connectivity.services.server.RPServicesImplementer.createEsendBooking(RPServicesImplementer.java:120)
at com.returnpool.connectivity.services.handlers.RPServicesHandler.createESendBooking(RPServicesHandler.java:517)
at com.returnpool.connectivity.services.webservices.esend.RPEsendBooking.reflexService(RPEsendBooking.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.xml.ws.server.PeptTie._invoke(PeptTie.java:58)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.invokeEndpoint(SOAPMessageDispatcher.java:278)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:586)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:141)
at com.sun.xml.ws.server.Tie.handle(Tie.java:88)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.handle(WSServletDelegate.java:333)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:288)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:77)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:662)
INFO http-8080-6 com.returnpool.connectivity.services.rpservoy.RPServoyClient - Servoy session is NOT null.....
INFO http-8080-6 com.returnpool.connectivity.services.rpservoy.RPServoyClient - Calling the Servoy method in the form globals.js in rp_esend
INFO http-8080-6 com.returnpool.connectivity.services.rpservoy.RPServoyClient - Servoy call successfull : return value :null
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_client_stats tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_columninfo tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_content_spec tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_element_properties tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_elements tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_group_elements tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_groups tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_media tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_object_types tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_releases tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_revision_history tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_root_elements tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_user_groups tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_user_properties tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Table Name servoy_users tableType TABLE
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - repository_server: Closed connection, thread=TaskExecuter[0]
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - repository_server: getting managed connection
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Column name pk_id type 4 lenght 10 nullable false
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Column name server_ip type 12 lenght 20 nullable true
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Column name server_name type 12 lenght 200 nullable true
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Column name total_clients_running type 4 lenght 10 nullable false
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Column name client_id type 12 lenght 37 nullable false
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Column name start_time type 93 lenght 29 nullable true
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Column name stop_time type 93 lenght 29 nullable true
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Column name extra_info type 12 lenght 200 nullable true
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Column name user_uid type 12 lenght 200 nullable true
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - repository_server: Closed connection, thread=TaskExecuter[0]
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - Loading column metainfo for table servoy_client_stats
DEBUG TaskExecuter[0] com.servoy.j2db.server.Zc.Zo - repository_server: getting unmanaged connection



Below is the code part done to handle servoy method

public Object callServoyService(HttpServletRequest request, HttpSession session,
Object[] params) {

Object returnValue = 0;
boolean ok = false;

logger.log(Level.INFO, "Creating the servoy session");
ISessionBean servoy_hc = (ISessionBean) session.getAttribute("servoy");

if (servoy_hc == null) {
try {

logger.log(Level.INFO, "Creating the servoy Headless Client instance for " + this.solutionName);
servoy_hc =
HeadlessClientFactory.createSessionBean(request, this.solutionName);
session.setAttribute("servoy", servoy_hc);

if (servoy_hc == null) {
logger.log(Level.INFO, "Servoy session is null.....");
} else {
logger.log(Level.INFO, "Servoy session is NOT null.....");
}

if (!isGlobal(this.formName)) {
ok = servoy_hc.setMainForm(this.formName);
}
IClientPluginAccess ipa = servoy_hc.getPluginAccess();


if (!isGlobal(this.formName) && !ok) {
logger.log(Level.FATAL,
ServicesConstants.SVC_INTERNAL_SEVER_ERROR_SERVOY_FORM);
throw new ServiceException(ServicesConstants.CORS_SVC_ISE_BOOKING_CREATE_FAILED);

}

logger.log(Level.INFO, "Calling the Servoy method in the form " + this.formName + " in " + this.solutionName);

returnValue = runFunctionByName(this.formName, this.methodName, ipa, params);

logger.log(Level.INFO, "Servoy call successfull : return value :" + returnValue);

session.setAttribute("servoy", null);


} catch (Exception ex) {
session.setAttribute("servoy", null);
logger.log(Level.ERROR,
ServicesConstants.CORS_SVC_ISE_BOOKING_GENERAL_ERROR, ex);
}

} else {
returnValue = -1;
}

return returnValue;
}
ruwanwickramage1344409283
 
Posts: 1
Joined: Wed Aug 08, 2012 9:01 am

Return to Servoy Headless Client

Who is online

Users browsing this forum: No registered users and 3 guests