{"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-05-13T09:36:46","modified_gmt":"2026-05-13T07:36:46","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_Webservice class is designed to call external web services and be able to exploit the results obtained. To be used, this class must be instantiated.<\/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\"><li>send(String pUrl, String pMethod, IDictionary&lt;string, object&gt; pHeaders, int pTimeout, bool stringResponse, IDictionary&lt;string, object&gt; queryParameters) [<em>Requires Gateway version &gt;= 1.1.1]<\/em><ul><li>pMethod: GET, POST, PUT, DELETE<\/li><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><\/ul><\/li><li>send(String pUrl, String pMethod, IDictionary<string object=\"\"> pHeaders, int pTimeout, bool stringResponse)<\/string><ul><li>queryParameters: null<\/li><\/ul><\/li><li>send(String pUrl, String pMethod, IDictionary<string object=\"\"> pHeaders, int pTimeout)<\/string><ul><li>stringResponse: true<\/li><\/ul><\/li><li>send(String pUrl, String pMethod, IDictionary<string object=\"\"> pHeaders)<\/string><ul><li>pTimeout: -1<\/li><\/ul><\/li><li>send(String pUrl, String pMethod)<ul><li>pHeaders: null<\/li><\/ul><\/li><li>send(String pUrl)<ul><li>pMethod: GET<\/li><\/ul><\/li><\/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\"><li>sendJson(String pUrl, String pJson, String pMethod, IDictionary&lt;string, object&gt; pHeader, int pTimeout, bool stringResponse, IDictionary&lt;string, object&gt; queryParameters) [<em>Requires Gateway version &gt;=1.1.1<\/em>]<ul><li>pMethod: GET, POST, PUT, DELETE<\/li><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><\/ul><\/li><li>sendJson(String pUrl, String pJson, String pMethod, IDictionary<string object=\"\"> pHeader, int pTimeout, bool stringResponse)<\/string><ul><li>queryParameters: null<\/li><\/ul><\/li><li>sendJson(string pUrl, string pJson, string pMethod, IDictionary<string object=\"\"> pHeader, int pTimeout)<\/string><ul><li>stringResponse: true<\/li><\/ul><\/li><li>sendJson(string pUrl, string pJson, string pMethod, IDictionary<string object=\"\"> pHeader)<\/string><ul><li>pTimeout: -1<\/li><\/ul><\/li><li>sendJson(string pUrl, string pJson, string pMethod)<ul><li>pHeaders: null<\/li><\/ul><\/li><li>sendJson(string pUrl, string pJson)<ul><li>pMethod: GET<\/li><\/ul><\/li><\/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\"><li>sendSoap(string pUrl, string pSoapBody, string pMethod, IDictionary&lt;string, object&gt; pHeader, int pTimeout, bool stringResponse, IDictionary&lt;string, object&gt; queryParameters) [<em>Requires Gateway version &gt;= 1.1.1]<\/em><ul><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><li>pMethod: GET, POST, PUT, DELETE<\/li><\/ul><\/li><li>sendSoap(string pUrl, string pSoapBody, string pMethod, IDictionary<string object=\"\"> pHeader, int pTimeout, bool stringResponse)<\/string><ul><li>queryParameters: null<\/li><\/ul><\/li><li>sendSoap(string pUrl, string pSoapBody, string pMethod, IDictionary<string object=\"\"> pHeader, int pTimeout)<\/string><ul><li>stringResponse: true<\/li><\/ul><\/li><li>sendSoap(string pUrl, string pSoapBody, string pMethod, IDictionary<string object=\"\"> pHeader)<\/string><ul><li>pTimeout: -1<\/li><\/ul><\/li><li>sendSoap(string pUrl, string pSoapBody, string pMethod)<ul><li>pHeaders: null<\/li><\/ul><\/li><li>sendSoap(string pUrl, string pSoapBody)<ul><li>pMethod: POST<\/li><\/ul><\/li><\/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\"><li>sendFiles(string pUrl, IDictionary&lt;string, object&gt;  pFiles,IDictionary&lt;string, object&gt;  pParameters, string pMethod, IDictionary&lt;string, object&gt;  pHeader, int pTimeout, bool stringResponse, IDictionary&lt;string, object&gt;  queryParameters) [<em>Requires Gateway version &gt;= 1.1.1<\/em>]<ul><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><li>pMethod: GET, POST, PUT, DELETE<\/li><\/ul><\/li><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><ul><li>queryParameters: null<\/li><\/ul><\/li><li>sendFiles(string pUrl, IDictionary<string object=\"\"> pFiles, IDictionary<string object=\"\"> pParameters, string pMethod, IDictionary<string object=\"\"> pHeader, int pTimeout)<\/string><\/string><\/string><ul><li>stringResponse: true<\/li><\/ul><\/li><li>sendFiles(string pUrl, IDictionary<string object=\"\"> pFiles, IDictionary<string object=\"\"> pParameters, string pMethod, IDictionary<string object=\"\"> pHeader)<\/string><\/string><\/string><ul><li>pTimeout: -1<\/li><\/ul><\/li><li>sendFiles(string pUrl, IDictionary<string object=\"\"> pFiles, IDictionary<string object=\"\"> pParameters, string pMethod)<\/string><\/string><ul><li>pHeaders: null<\/li><\/ul><\/li><li>sendFiles(string pUrl, IDictionary<string object=\"\"> pFiles, IDictionary<string object=\"\"> pParameters)<\/string><\/string><ul><li>pMethod: POST<\/li><\/ul><\/li><\/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\"><li><span style=\"color: initial;\"><\/span>sendFormParameter(string pUrl, string pMethod, IDictionary pHeaders, IDictionary pParameter, int pTimeout, bool stringResponse, IDictionary queryParameters)<\/li><li>sendFormParameter(string pUrl, string pMethod, IDictionary pHeaders, IDictionary pParameter, int pTimeout, bool stringResponse)<ul><li>queryParameters: null<\/li><\/ul><\/li><li>sendFormParameter(string pUrl, string pMethod, IDictionary pHeaders, IDictionary pParameter, int pTimeout)<ul><li>stringResponse: true<\/li><\/ul><\/li><li>sendFormParameter(string pUrl, string pMethod, IDictionary pHeaders, IDictionary pParameter)<ul><li>pMethod: GET, POST, PUT, DELETE<\/li><li>pTimeout: -1<\/li><\/ul><\/li><\/ul>\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction The JSE_Webservice class is designed to call external web services and be able to exploit the results obtained. To be used, this class must be instantiated. 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":"templates\/ob-help-products.php","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":2,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21240\/revisions"}],"predecessor-version":[{"id":38760,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21240\/revisions\/38760"}],"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}]}}