{"id":21240,"date":"2022-04-11T13:56:06","date_gmt":"2022-04-11T11:56:06","guid":{"rendered":"https:\/\/help.openbee.com\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/jse_webservice\/"},"modified":"2026-07-31T09:39:47","modified_gmt":"2026-07-31T07:39:47","slug":"jse_webservice","status":"publish","type":"page","link":"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/jse_webservice\/","title":{"rendered":"JSE_WebService"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\" id=\"JSE_WebService-Introduction\">Introduction<\/h1>\n\n<p>The JSE_File class allows interacting with system files through a number of methods.<br\/>Be careful, to use this class, the execution context must be set to &#8220;Gateway&#8221; <\/p>\n\n<h1 class=\"wp-block-heading\" id=\"JSE_WebService-Constructeur\">Constructor<\/h1>\n\n<h3 class=\"wp-block-heading\" id=\"JSE_WebService-JSE_WebService(StringserverAdress,Stringprotocol,intport)\">JSE_WebService(String serverAdress, String protocol, int port)<\/h3>\n\n<pre class=\"wp-block-code\"><code>var ws = new JSE_WebService(\"127.0.0.1\", \"http\", 8000);<\/code><\/pre>\n\n<h3 class=\"wp-block-heading\" id=\"JSE_WebService-JSE_WebService(StringserverAdress,Stringprotocol)\">JSE_WebService(String serverAdress, String protocol)<\/h3>\n\n<pre class=\"wp-block-code\"><code>var ws = new JSE_WebService(\"127.0.0.1\", \"http\");<\/code><\/pre>\n\n<h1 class=\"wp-block-heading\" id=\"JSE_WebService-Fonctions\">Duties<\/h1>\n\n<h3 class=\"wp-block-heading\" id=\"JSE_WebService-setAuthentication(stringusername,stringpassword):void\">setAuthentication(string username, string password): void<\/h3>\n\n<p>This method allows you to insert authentication into the header of your web-service<\/p>\n\n<pre class=\"wp-block-code\"><code>ws.setAuthentication(\"login\",\"mdp\");<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\" id=\"JSE_WebService-send:\">send: <a href=\"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/objects\/obwebresponse\/\">OBWebResponse<\/a><\/h2>\n\n<p>The send function allows you to send a REST web-service request containing parameters in the URL and return the result to you in the form of an <a href=\"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/objects\/obwebresponse\/\">OBWebResponse<\/a> object<\/p>\n\n<p>To use it, you have several options for calling:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>send(String pUrl, String pMethod, IDictionary<string, object=\"\"> pHeaders, int pTimeout, bool stringResponse, IDictionary<string, object=\"\"> queryParameters) [<em>N\u00e9cessite Gateway version >= 1.1.1<\/em>]<\/string,><\/string,>\n<ul class=\"wp-block-list\">\n<li>pMethod: GET, POST, PUT, DELETE<\/li>\n\n\n\n<li>stringResponse: Allows you to know whether the response should be converted to a string or not. Useful in case the response is not a string but a file <\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>send(String pUrl, String pMethod, IDictionary<string, object=\"\"> pHeaders, int pTimeout, bool stringResponse)<\/string,>\n<ul class=\"wp-block-list\">\n<li>queryParameters: null<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>send(String pUrl, String pMethod, IDictionary<string, object=\"\"> pHeaders, int pTimeout)<\/string,>\n<ul class=\"wp-block-list\">\n<li>stringResponse: true<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>send(String pUrl, String pMethod, IDictionary<string, object=\"\"> pHeaders)<\/string,>\n<ul class=\"wp-block-list\">\n<li>pTimeout: -1<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>send(String pUrl, String pMethod)\n<ul class=\"wp-block-list\">\n<li>pHeaders: null<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>send(String pUrl)\n<ul class=\"wp-block-list\">\n<li>pMethod: GET<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n<pre class=\"wp-block-code\"><code>var ws = new JSE_WebService(\"127.0.0.1\", \"http\", 8000);\nws.setAuthentication(\"admin\",\"*****\");\nvar res = ws.send(\"\/ws\/v2\/version\");\nreturn JSON.parse(res.StringResponse).version;<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\" id=\"JSE_WebService-sendJson:\">sendJson: <a href=\"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/objects\/obwebresponse\/\">OBWebResponse<\/a><\/h2>\n\n<p>The sendJson function allows you to send a REST web-service request containing Json parameters and return the result to you in the form of an <a href=\"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/objects\/obwebresponse\/\">OBWebResponse<\/a> object<\/p>\n\n<p>To use it, you have several options for calling:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>sendJson(String pUrl, String pJson, String pMethod, IDictionary<string, object=\"\"> pHeader, int pTimeout, bool stringResponse, IDictionary<string, object=\"\"> queryParameters) [<em>N\u00e9cessite Gateway version >= 1.1.1<\/em>]<\/string,><\/string,>\n<ul class=\"wp-block-list\">\n<li>pMethod: GET, POST, PUT, DELETE<\/li>\n\n\n\n<li>stringResponse: Allows you to know whether the response should be converted to a string or not. Useful in case the response is not a string but a file <\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendJson(String pUrl, String pJson, String pMethod, IDictionary<string, object=\"\"> pHeader, int pTimeout, bool stringResponse)<\/string,>\n<ul class=\"wp-block-list\">\n<li>queryParameters: null<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendJson(string pUrl, string pJson, string pMethod, IDictionary<string, object=\"\"> pHeader, int pTimeout)<\/string,>\n<ul class=\"wp-block-list\">\n<li>stringResponse: true<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendJson(string pUrl, string pJson, string pMethod, IDictionary<string, object=\"\"> pHeader)<\/string,>\n<ul class=\"wp-block-list\">\n<li>pTimeout: -1<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendJson(string pUrl, string pJson, string pMethod)\n<ul class=\"wp-block-list\">\n<li>pHeaders: null<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendJson(string pUrl, string pJson)\n<ul class=\"wp-block-list\">\n<li>pMethod: GET<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n<pre class=\"wp-block-code\"><code>var ws = new JSE_WebService(\"ip.jsontest.com\", \"http\");\nvar jsonParameter = {property : &#91;\"Sites\"], report_type: &#91;\"ALL\"]};\nvar res = ws.sendJson(\"\",JSON.stringify(jsonParameter));\nreturn res.StringResponse;<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\" id=\"JSE_WebService-sendSoap:\">sendSoap: <a href=\"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/objects\/obwebresponse\/\">OBWebResponse<\/a><\/h2>\n\n<p>The sendJson function allows you to send a SOAP web-service request containing parameters and return the result to you in the form of an <a href=\"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/objects\/obwebresponse\/\">OBWebResponse<\/a> object<\/p>\n\n<p>To use it, you have several options for calling:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>sendSoap(string pUrl, string pSoapBody, string pMethod, IDictionary<string, object=\"\"> pHeader, int pTimeout, bool stringResponse, IDictionary<string, object=\"\"> queryParameters) [<em>N\u00e9cessite Gateway version >= 1.1.1<\/em>]<\/string,><\/string,>\n<ul class=\"wp-block-list\">\n<li>stringResponse: Allows you to know whether the response should be converted to a string or not. Useful in case the response is not a string but a file <\/li>\n\n\n\n<li>pMethod: GET, POST, PUT, DELETE<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendSoap(string pUrl, string pSoapBody, string pMethod, IDictionary<string, object=\"\"> pHeader, int pTimeout, bool stringResponse)<\/string,>\n<ul class=\"wp-block-list\">\n<li>queryParameters: null<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendSoap(string pUrl, string pSoapBody, string pMethod, IDictionary<string, object=\"\"> pHeader, int pTimeout)<\/string,>\n<ul class=\"wp-block-list\">\n<li>stringResponse: true<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendSoap(string pUrl, string pSoapBody, string pMethod, IDictionary<string, object=\"\"> pHeader)<\/string,>\n<ul class=\"wp-block-list\">\n<li>pTimeout: -1<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendSoap(string pUrl, string pSoapBody, string pMethod)\n<ul class=\"wp-block-list\">\n<li>pHeaders: null<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendSoap(string pUrl, string pSoapBody)\n<ul class=\"wp-block-list\">\n<li>pMethod: POST<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n<pre class=\"wp-block-code\"><code>var ws = new JSE_WebService(\"www.learnwebservices.com\", \"http\");\nvar pSoapBody = '&lt;CelsiusToFahrenheitRequest xmlns=\"http:\/\/learnwebservices.com\/services\/tempconverter\"&gt;&lt;TemperatureInCelsius&gt;10.0&lt;\/TemperatureInCelsius&gt;&lt;\/CelsiusToFahrenheitRequest&gt;';\nreturn ws.sendSoap(\"\/services\/tempconverter\", pSoapBody);<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\" id=\"JSE_WebService-sendFiles:\">sendFiles: <a href=\"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/objects\/obwebresponse\/\">OBWebResponse<\/a><\/h2>\n\n<p>The sendFiles function allows you to send a REST web-service request containing parameters and files and return the result to you in the form of an <a href=\"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/objects\/obwebresponse\/\">OBWebResponse<\/a> object<\/p>\n\n<p>To use it, you have several options for calling:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>sendFiles(string pUrl, IDictionary<string, object=\"\"> pFiles,IDictionary<string, object=\"\"> pParameters, string pMethod, IDictionary<string, object=\"\"> pHeader, int pTimeout, bool stringResponse, IDictionary<string, object=\"\"> queryParameters) [<em>N\u00e9cessite Gateway version >= 1.1.1<\/em>]<\/string,><\/string,><\/string,><\/string,>\n<ul class=\"wp-block-list\">\n<li>stringResponse: Allows you to know whether the response should be converted to a string or not. Useful in case the response is not a string but a file <\/li>\n\n\n\n<li>pMethod: GET, POST, PUT, DELETE<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendFiles(string pUrl, IDictionary<string, object=\"\"> pFiles,IDictionary<string, object=\"\"> pParameters, string pMethod, IDictionary<string, object=\"\"> pHeader, int pTimeout, bool stringResponse)<\/string,><\/string,><\/string,>\n<ul class=\"wp-block-list\">\n<li>queryParameters: null<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendFiles(string pUrl, IDictionary<string, object=\"\"> pFiles, IDictionary<string, object=\"\"> pParameters, string pMethod, IDictionary<string, object=\"\"> pHeader, int pTimeout)<\/string,><\/string,><\/string,>\n<ul class=\"wp-block-list\">\n<li>stringResponse: true<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendFiles(string pUrl, IDictionary<string, object=\"\"> pFiles, IDictionary<string, object=\"\"> pParameters, string pMethod, IDictionary<string, object=\"\"> pHeader)<\/string,><\/string,><\/string,>\n<ul class=\"wp-block-list\">\n<li>pTimeout: -1<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendFiles(string pUrl, IDictionary<string, object=\"\"> pFiles, IDictionary<string, object=\"\"> pParameters, string pMethod)<\/string,><\/string,>\n<ul class=\"wp-block-list\">\n<li>pHeaders: null<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendFiles(string pUrl, IDictionary<string, object=\"\"> pFiles, IDictionary<string, object=\"\"> pParameters)<\/string,><\/string,>\n<ul class=\"wp-block-list\">\n<li>pMethod: POST<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n<pre class=\"wp-block-code\"><code>var pFiles = {};\nvar pParameters = {};\npFiles&#91;\"file\"] = \"D:\/Dossier\/Documents\/facture.pdf\";\npParameters&#91;\"idParentFolder\"] = \"1\";\npParameters&#91;\"path\"] = \"\";\npParameters&#91;\"name\"] = \"TestFile\";\npParameters&#91;\"type\"] = \"11306\";\npParameters&#91;\"metadatas&#91;11360]\"] = \"Test Script\";\npParameters&#91;\"metadatas&#91;11361]\"] = \"Fournisseur 2\";\npParameters&#91;\"metadatas&#91;11362]\"] = \"116.32\";\npParameters&#91;\"metadatas&#91;11363]\"] = \"11\/23\/2015\";\npParameters&#91;\"metadatas&#91;11364]\"] = \"FC_425_TEST\";\npParameters&#91;\"metadatas&#91;11365]\"] = \"EUR\";\npParameters&#91;\"metadatas&#91;11366]\"] = \"Facture\";\npParameters&#91;\"metadatas&#91;11367]\"] = \"12\/06\/2015\";\nvar ws = new JSE_WebService(\"127.0.0.1\", \"http\", 8000);\nws.setAuthentication(\"admin\",\"****\");\nvar res = ws.sendFiles(\"\/ws\/v2\/document\", pFiles, pParameters);\nreturn res.StringResponse;<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\" id=\"JSE_WebService-sendFiles:\">sendFormParameters: <a href=\"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/objects\/obwebresponse\/\">OBWebResponse<\/a><\/h2>\n\n<p>[<em>Requires Gateway version &gt;=1.1.1<\/em>]<\/p>\n\n<p>The sendFormParameters function allows you to send a REST web-service request containing formdata-encoded parameters and return the result to you in the form of an <a href=\"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/objects\/obwebresponse\/\">OBWebResponse<\/a> object<\/p>\n\n<p>To use it, you have several options for calling:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><span style=\"color: initial;\"><\/span>sendFormParameter(string pUrl, string pMethod, IDictionary pHeaders, IDictionary pParameter, int pTimeout, bool stringResponse, IDictionary queryParameters)<\/li>\n\n\n\n<li>sendFormParameter(string pUrl, string pMethod, IDictionary pHeaders, IDictionary pParameter, int pTimeout, bool stringResponse)\n<ul class=\"wp-block-list\">\n<li>queryParameters: null<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendFormParameter(string pUrl, string pMethod, IDictionary pHeaders, IDictionary pParameter, int pTimeout)\n<ul class=\"wp-block-list\">\n<li>stringResponse: true<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>sendFormParameter(string pUrl, string pMethod, IDictionary pHeaders, IDictionary pParameter)\n<ul class=\"wp-block-list\">\n<li>pMethod: GET, POST, PUT, DELETE<\/li>\n\n\n\n<li>pTimeout: -1<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction The JSE_File class allows interacting with system files through a number of methods.Be careful, to use this class, the execution context must be set to &#8220;Gateway&#8221; Constructor JSE_WebService(String serverAdress, String protocol, int port) JSE_WebService(String serverAdress, String protocol) Duties setAuthentication(string username, string password): void This method allows you to insert authentication into the header of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":21211,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-21240","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/comments?post=21240"}],"version-history":[{"count":3,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21240\/revisions"}],"predecessor-version":[{"id":39217,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21240\/revisions\/39217"}],"up":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21211"}],"wp:attachment":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/media?parent=21240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}