web service: standalone or add as module?

hi!

I created a web service solution(with ws_create() method). I am able to debug on it in developer using the browser http://localhost:8080/examples/restfulws_testpage.html where Endpoint URL=http://localhost:8080/servoy-service/rest_ws/import_ws/ws_importdata. I have other solutions that will call the webservice. Should I deploy it as a standalone solution or add it as a module?

Btw, is this the correct way how you call the web service from another solution?

function createXMLRequest(importDataSet) {
	
	var importRequestMessageObject = createRequestObject(importDataSet);	
	var xmlRequestData	= plugins.my_plugin.importMessageToXML(importRequestMessageObject);

	//connect to webservice
	var serverAndPort = 'localhost:50008';
	plugins.http.createHttpClient('mybrowser');
	var url = 'http://' + serverAndPort + '/servoy-service/rest_ws/import_ws/ws_importdata';
	plugins.my_plugin.writeToImportDataLog("*******************IMPORT->Begin[" + url + "]*****************************");
	plugins.my_plugin.writeToImportDataLog("[" +  utils.dateFormat(new Date() , "ddMMyyyyHHmmss")  + "]request:[" + xmlRequestData + "]");
	var poster = plugins.http.getPoster(url);
	var didAddParam = poster.addParameter(null, xmlRequestData);
	var httpCode = poster.doPost(); 
	var xmlResponseData = poster.getPageData();
	plugins.my_plugin.writeToImportDataLog("[" +  utils.dateFormat(new Date() , "ddMMyyyyHHmmss")  + "]received:[" + xmlResponseData + "]");
	plugins.my_plugin.writeToImportDataLog("*******************IMPORT->End*****************************");
	var responseMessage = plugins.my_plugin.xmlToImportMessage(xmlResponseData);
	plugins.http.deleteHttpClient('mybrowser');

Appreciate the advice.

Thanks!

rogel,

If you are only calling the code from localhost from within a solution, you could also include the code as a module and call it directly.

Rob