system.net.httpClient POST method

Hi @PGriffith,

we have an application which requires Ignition to report a batch to IFS using web service when production has completed a batch.

we have successfully used web service to fetch data from IFS:
url = “https://***.***ofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/GetTotalReportedBatches”
url += “(OrderNo=%s,ReleaseNo=%s,SequenceNo=%s)” %( OrderNo, ReleaseNo, SequenceNo )
client = system.net.httpClient(username=user, password=passwd, bypass_cert_validation = True, cookie_policy = “ACCEPT_ALL”,redirect_policy = “ALWAYS” )
Response = client.get(url)

but we have problem to report a batch to IFS with the POST method (Response: ODP_DESERIALIZATION_ERROR, Error while de-serializing contents.):
url = “https://***.*ofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/ReportBatch”
parameter = {“OrderNo”: “2586”,“ReleaseNo”:"
", “SequenceNo”:"
", “Batches”:“1”}
client = system.net.httpClient(username=user, password=passwd, bypass_cert_validation = True, cookie_policy = “ACCEPT_ALL”,redirect_policy = “ALWAYS” )
Response = client.post(url,parameter)

Can you please advise a proper format in using system.net.httpClient POST method?

IFS - ReportBatch
|Method | Type| Body |
|ReportBatch|POST|JSON: {

                                     "OrderNo": "2586",

                                     "ReleaseNo":"*",

                                     "SequenceNo":"*",

                                     "Batches":"1" (optional, default 1)
                                   }

Thanks.

That looks like an error coming back from the server, though it’s somewhat hard to tell.

Can you post the script you’re using to send the data here in a preformatted text block? Use this icon: image or wrap it in triple backtick/grave characters:

`​``
content
`​``

We have an API service that would never respond to httpPost so we import the urllib and urllib2 and use those functions for posting to that particular API service.
One thing that we found necessary, after running for a while, is that we needed to explicitly .close() the request to prevent overrunning the max connections.
.close() is hardly documented and some say it is not necessary
Here’s a snip from our code:

	try:
		apiRequest 	= urllib2.Request(endPoint, data, header)
		apiResponse	= urllib2.urlopen(apiRequest)
		qctResponse	= apiResponse.read()
		apiResponse.close()		# close the connection JIRA Issue: QCT-1678

user = “"
passwd = "

OrderNo = ‘’’ + “2586” + ‘’’
ReleaseNo = ‘’’ +"" + ‘’’
SequenceNo = ‘’’ + "
" + ‘’’
Batches = ‘’’ + ‘1’ + ‘’’
parameter = {“OrderNo”: OrderNo,“ReleaseNo”:ReleaseNo, “SequenceNo”:SequenceNo, “Batches”:Batches}
url = “https://****ofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/ReportBatch
client = system.net.httpClient(username=user, password=passwd, bypass_cert_validation = True, cookie_policy = “ACCEPT_ALL”,redirect_policy = “ALWAYS” )
Response = client.post(url,parameter)

try:
print Response.json[ ‘value’ ]
except:
a = “[” + Response.text + “]”
b = system.util.jsonDecode( a )
print b

thanks martinel3746 for the information. i will try if we can apply it to solve the problem.

Instead of decoding the response in a try/except, what if you just print the exact response you’re getting?

Response = client.post(url,parameter)
print response.text

See if that has any more useful information. If you’re getting any actual error from httpClient, please post the full stacktrace here (again, inside a preformatted text block).

14:12:05.528 [Browser Thread: 63858] INFO Perspective.Designer.Workspace - https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/GetReportedBatches(OrderNo='2586',ReleaseNo='*',SequenceNo='*')
14:12:13.429 [Browser Thread: 63858] INFO Perspective.Designer.Workspace - https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/GetTotalReportedBatches(OrderNo='2586',ReleaseNo='*',SequenceNo='*')
14:12:15.718 [AWT-EventQueue-0] ERROR com.inductiveautomation.ignition.client.util.gui.ErrorUtil - Error running action 'dom.onClick' on HTTP/Floor (1)@D/root/Button_Orders: Traceback (most recent call last):
  File "<function:runAction>", line 38, in runAction
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:103)
	at com.inductiveautomation.ignition.common.script.builtin.http.InsecureJythonHttpClient.send(InsecureJythonHttpClient.java:37)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.get(JythonHttpClient.java:305)
	at jdk.internal.reflect.GeneratedMethodAccessor1549.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
java.io.IOException: java.io.IOException: Unable to GET https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/GetReportedBatches(OrderNo='2586',ReleaseNo='*',SequenceNo='*')

com.inductiveautomation.ignition.common.GenericTransferrableException: Traceback (most recent call last):
  File "<function:runAction>", line 38, in runAction
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:103)
	at com.inductiveautomation.ignition.common.script.builtin.http.InsecureJythonHttpClient.send(InsecureJythonHttpClient.java:37)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.get(JythonHttpClient.java:305)
	at jdk.internal.reflect.GeneratedMethodAccessor1549.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
java.io.IOException: java.io.IOException: Unable to GET https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/GetReportedBatches(OrderNo='2586',ReleaseNo='*',SequenceNo='*')

	at org.python.core.Py.JavaError(Py.java:552)
	at org.python.core.Py.JavaError(Py.java:543)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:206)
	at org.python.core.PyObject.__call__(PyObject.java:497)
	at org.python.core.PyObject.__call__(PyObject.java:501)
	at org.python.core.PyMethod.__call__(PyMethod.java:141)
	at org.python.pycode._pyx5275.runAction$1(<function:runAction>:66)
	at org.python.pycode._pyx5275.call_function(<function:runAction>)
	at org.python.core.PyTableCode.call(PyTableCode.java:171)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:308)
	at org.python.core.PyFunction.function___call__(PyFunction.java:471)
	at org.python.core.PyFunction.__call__(PyFunction.java:466)
	at org.python.core.PyFunction.__call__(PyFunction.java:461)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:842)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:824)
	at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(ProjectScriptLifecycle.java:681)
	at com.inductiveautomation.ignition.common.script.ScriptManager$ScriptFunctionImpl.invoke(ScriptManager.java:993)
	at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$AutoRecompilingScriptFunction.invoke(ProjectScriptLifecycle.java:746)
	at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invoke(ScriptFunctionHelper.java:133)
	at com.inductiveautomation.perspective.gateway.action.ScriptAction.runAction(ScriptAction.java:71)
	at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.lambda$call$0(ActionCollection.java:263)
	at com.inductiveautomation.perspective.gateway.api.LoggingContext.mdc(LoggingContext.java:54)
	at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:252)
	at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:221)
	at com.inductiveautomation.perspective.gateway.threading.BlockingTaskQueue$TaskWrapper.run(BlockingTaskQueue.java:154)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: Traceback (most recent call last):
  File "<function:runAction>", line 38, in runAction
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:103)
	at com.inductiveautomation.ignition.common.script.builtin.http.InsecureJythonHttpClient.send(InsecureJythonHttpClient.java:37)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.get(JythonHttpClient.java:305)
	at jdk.internal.reflect.GeneratedMethodAccessor1549.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
java.io.IOException: java.io.IOException: Unable to GET https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/GetReportedBatches(OrderNo='2586',ReleaseNo='*',SequenceNo='*')

	... 31 common frames omitted
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: Unable to GET https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/GetReportedBatches(OrderNo='2586',ReleaseNo='*',SequenceNo='*')
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:103)
	at com.inductiveautomation.ignition.common.script.builtin.http.InsecureJythonHttpClient.send(InsecureJythonHttpClient.java:37)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.get(JythonHttpClient.java:305)
	at jdk.internal.reflect.GeneratedMethodAccessor1549.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)
	... 28 common frames omitted
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: HTTP connect timed out
	at java.net.http/jdk.internal.net.http.HttpClientImpl.send(Unknown Source)
	at java.net.http/jdk.internal.net.http.HttpClientFacade.send(Unknown Source)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:101)
	... 34 common frames omitted
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: HTTP connect timed out
	at java.net.http/jdk.internal.net.http.MultiExchange.toTimeoutException(Unknown Source)
	at java.net.http/jdk.internal.net.http.MultiExchange.getExceptionalCF(Unknown Source)
	at java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsyncImpl$7(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
	at java.net.http/jdk.internal.net.http.Exchange.checkCancelled(Unknown Source)
	at java.net.http/jdk.internal.net.http.Exchange.cancel(Unknown Source)
	at java.net.http/jdk.internal.net.http.MultiExchange.cancel(Unknown Source)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection$ConnectTimerEvent.handle(Unknown Source)
	at java.net.http/jdk.internal.net.http.HttpClientImpl.purgeTimeoutsAndReturnNextDeadline(Unknown Source)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(Unknown Source)
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: HTTP connect timed out
	... 13 common frames omitted
14:12:15.928 [Browser Thread: 63858] INFO Perspective.Designer.Workspace - https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/ReportBatch
14:12:23.606 [AWT-EventQueue-0] ERROR com.inductiveautomation.ignition.client.util.gui.ErrorUtil - Error running action 'dom.onClick' on HTTP/Floor (1)@D/root/Button_Reported_Batches_0: Traceback (most recent call last):
  File "<function:runAction>", line 38, in runAction
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:103)
	at com.inductiveautomation.ignition.common.script.builtin.http.InsecureJythonHttpClient.send(InsecureJythonHttpClient.java:37)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.get(JythonHttpClient.java:305)
	at jdk.internal.reflect.GeneratedMethodAccessor1549.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
java.io.IOException: java.io.IOException: Unable to GET https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/GetTotalReportedBatches(OrderNo='2586',ReleaseNo='*',SequenceNo='*')

com.inductiveautomation.ignition.common.GenericTransferrableException: Traceback (most recent call last):
  File "<function:runAction>", line 38, in runAction
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:103)
	at com.inductiveautomation.ignition.common.script.builtin.http.InsecureJythonHttpClient.send(InsecureJythonHttpClient.java:37)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.get(JythonHttpClient.java:305)
	at jdk.internal.reflect.GeneratedMethodAccessor1549.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
java.io.IOException: java.io.IOException: Unable to GET https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/GetTotalReportedBatches(OrderNo='2586',ReleaseNo='*',SequenceNo='*')

	at org.python.core.Py.JavaError(Py.java:552)
	at org.python.core.Py.JavaError(Py.java:543)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:206)
	at org.python.core.PyObject.__call__(PyObject.java:497)
	at org.python.core.PyObject.__call__(PyObject.java:501)
	at org.python.core.PyMethod.__call__(PyMethod.java:141)
	at org.python.pycode._pyx5276.runAction$1(<function:runAction>:46)
	at org.python.pycode._pyx5276.call_function(<function:runAction>)
	at org.python.core.PyTableCode.call(PyTableCode.java:171)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:308)
	at org.python.core.PyFunction.function___call__(PyFunction.java:471)
	at org.python.core.PyFunction.__call__(PyFunction.java:466)
	at org.python.core.PyFunction.__call__(PyFunction.java:461)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:842)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:824)
	at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(ProjectScriptLifecycle.java:681)
	at com.inductiveautomation.ignition.common.script.ScriptManager$ScriptFunctionImpl.invoke(ScriptManager.java:993)
	at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$AutoRecompilingScriptFunction.invoke(ProjectScriptLifecycle.java:746)
	at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invoke(ScriptFunctionHelper.java:133)
	at com.inductiveautomation.perspective.gateway.action.ScriptAction.runAction(ScriptAction.java:71)
	at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.lambda$call$0(ActionCollection.java:263)
	at com.inductiveautomation.perspective.gateway.api.LoggingContext.mdc(LoggingContext.java:54)
	at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:252)
	at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:221)
	at com.inductiveautomation.perspective.gateway.threading.BlockingTaskQueue$TaskWrapper.run(BlockingTaskQueue.java:154)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: Traceback (most recent call last):
  File "<function:runAction>", line 38, in runAction
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:103)
	at com.inductiveautomation.ignition.common.script.builtin.http.InsecureJythonHttpClient.send(InsecureJythonHttpClient.java:37)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.get(JythonHttpClient.java:305)
	at jdk.internal.reflect.GeneratedMethodAccessor1549.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
java.io.IOException: java.io.IOException: Unable to GET https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/GetTotalReportedBatches(OrderNo='2586',ReleaseNo='*',SequenceNo='*')

	... 31 common frames omitted
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: Unable to GET https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/GetTotalReportedBatches(OrderNo='2586',ReleaseNo='*',SequenceNo='*')
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:103)
	at com.inductiveautomation.ignition.common.script.builtin.http.InsecureJythonHttpClient.send(InsecureJythonHttpClient.java:37)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.get(JythonHttpClient.java:305)
	at jdk.internal.reflect.GeneratedMethodAccessor1549.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)
	... 28 common frames omitted
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: HTTP connect timed out
	at java.net.http/jdk.internal.net.http.HttpClientImpl.send(Unknown Source)
	at java.net.http/jdk.internal.net.http.HttpClientFacade.send(Unknown Source)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:101)
	... 34 common frames omitted
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: HTTP connect timed out
	at java.net.http/jdk.internal.net.http.MultiExchange.toTimeoutException(Unknown Source)
	at java.net.http/jdk.internal.net.http.MultiExchange.getExceptionalCF(Unknown Source)
	at java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsyncImpl$7(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
	at java.net.http/jdk.internal.net.http.Exchange.checkCancelled(Unknown Source)
	at java.net.http/jdk.internal.net.http.Exchange.cancel(Unknown Source)
	at java.net.http/jdk.internal.net.http.MultiExchange.cancel(Unknown Source)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection$ConnectTimerEvent.handle(Unknown Source)
	at java.net.http/jdk.internal.net.http.HttpClientImpl.purgeTimeoutsAndReturnNextDeadline(Unknown Source)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(Unknown Source)
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: HTTP connect timed out
	... 13 common frames omitted
14:12:25.961 [AWT-EventQueue-0] ERROR com.inductiveautomation.ignition.client.util.gui.ErrorUtil - Error running action 'dom.onClick' on HTTP/Floor (1)@D/root/Button_Report_A_Batch: Traceback (most recent call last):
  File "<function:runAction>", line 53, in runAction
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:103)
	at com.inductiveautomation.ignition.common.script.builtin.http.InsecureJythonHttpClient.send(InsecureJythonHttpClient.java:37)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.post(JythonHttpClient.java:317)
	at jdk.internal.reflect.GeneratedMethodAccessor1560.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
java.io.IOException: java.io.IOException: Unable to POST https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/ReportBatch?ReleaseNo=*&SequenceNo=*&OrderNo=2586

com.inductiveautomation.ignition.common.GenericTransferrableException: Traceback (most recent call last):
  File "<function:runAction>", line 53, in runAction
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:103)
	at com.inductiveautomation.ignition.common.script.builtin.http.InsecureJythonHttpClient.send(InsecureJythonHttpClient.java:37)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.post(JythonHttpClient.java:317)
	at jdk.internal.reflect.GeneratedMethodAccessor1560.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
java.io.IOException: java.io.IOException: Unable to POST https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/ReportBatch?ReleaseNo=*&SequenceNo=*&OrderNo=2586

	at org.python.core.Py.JavaError(Py.java:552)
	at org.python.core.Py.JavaError(Py.java:543)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:206)
	at org.python.core.PyObject.__call__(PyObject.java:515)
	at org.python.core.PyObject.__call__(PyObject.java:519)
	at org.python.core.PyMethod.__call__(PyMethod.java:156)
	at org.python.pycode._pyx5277.runAction$1(<function:runAction>:60)
	at org.python.pycode._pyx5277.call_function(<function:runAction>)
	at org.python.core.PyTableCode.call(PyTableCode.java:171)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:308)
	at org.python.core.PyFunction.function___call__(PyFunction.java:471)
	at org.python.core.PyFunction.__call__(PyFunction.java:466)
	at org.python.core.PyFunction.__call__(PyFunction.java:461)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:842)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:824)
	at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(ProjectScriptLifecycle.java:681)
	at com.inductiveautomation.ignition.common.script.ScriptManager$ScriptFunctionImpl.invoke(ScriptManager.java:993)
	at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$AutoRecompilingScriptFunction.invoke(ProjectScriptLifecycle.java:746)
	at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invoke(ScriptFunctionHelper.java:133)
	at com.inductiveautomation.perspective.gateway.action.ScriptAction.runAction(ScriptAction.java:71)
	at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.lambda$call$0(ActionCollection.java:263)
	at com.inductiveautomation.perspective.gateway.api.LoggingContext.mdc(LoggingContext.java:54)
	at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:252)
	at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:221)
	at com.inductiveautomation.perspective.gateway.threading.BlockingTaskQueue$TaskWrapper.run(BlockingTaskQueue.java:154)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: Traceback (most recent call last):
  File "<function:runAction>", line 53, in runAction
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:103)
	at com.inductiveautomation.ignition.common.script.builtin.http.InsecureJythonHttpClient.send(InsecureJythonHttpClient.java:37)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.post(JythonHttpClient.java:317)
	at jdk.internal.reflect.GeneratedMethodAccessor1560.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
java.io.IOException: java.io.IOException: Unable to POST https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/ReportBatch?ReleaseNo=*&SequenceNo=*&OrderNo=2586

	... 31 common frames omitted
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: Unable to POST https://aoa-ifs-tapp.corp.airbossofamerica.com:48080/int/ifsapplications/projection/v1/AbaShopFloorUtil.svc/ReportBatch?ReleaseNo=*&SequenceNo=*&OrderNo=2586
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:103)
	at com.inductiveautomation.ignition.common.script.builtin.http.InsecureJythonHttpClient.send(InsecureJythonHttpClient.java:37)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.post(JythonHttpClient.java:317)
	at jdk.internal.reflect.GeneratedMethodAccessor1560.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)
	... 28 common frames omitted
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: HTTP connect timed out
	at java.net.http/jdk.internal.net.http.HttpClientImpl.send(Unknown Source)
	at java.net.http/jdk.internal.net.http.HttpClientFacade.send(Unknown Source)
	at com.inductiveautomation.ignition.common.script.builtin.http.JythonHttpClient.send(JythonHttpClient.java:101)
	... 34 common frames omitted
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: HTTP connect timed out
	at java.net.http/jdk.internal.net.http.MultiExchange.toTimeoutException(Unknown Source)
	at java.net.http/jdk.internal.net.http.MultiExchange.getExceptionalCF(Unknown Source)
	at java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsyncImpl$7(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
	at java.net.http/jdk.internal.net.http.Exchange.checkCancelled(Unknown Source)
	at java.net.http/jdk.internal.net.http.Exchange.cancel(Unknown Source)
	at java.net.http/jdk.internal.net.http.MultiExchange.cancel(Unknown Source)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection$ConnectTimerEvent.handle(Unknown Source)
	at java.net.http/jdk.internal.net.http.HttpClientImpl.purgeTimeoutsAndReturnNextDeadline(Unknown Source)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(Unknown Source)
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: HTTP connect timed out
	... 13 common frames omitted
Caused by: com.inductiveautomation.ignition.common.GenericTransferrableException: HTTP connect timed out

That’s a straightforward network connectivity issue, unrelated to the script you’re running.

Error handling is one of my weak points but I’m using the exceptions to record success/fail info and populate missing details into a JSON document as a return value:

		jsonResponse = system.util.jsonDecode(xxxResponse)
		# Rev 1.7: if nothing was returned from xxx API, return null response stop condition instead of default general exception.
		if jsonResponse == None:
			jsonResponse = {}
			jsonResponse['handshakeTag'] = -1
			jsonResponse['openDispatch'] = True
			# other stuff here...
			logger.error( 'NULL Response: "%s"' str(jsonResponse))
		else:
			jsonResponse['openDispatch'] = False
			# other stuff here...

	except HTTPError, he:
		if jsonResponse == None:
			jsonResponse = {}
		jsonResponse['handshakeTag'] = -2
		jsonResponse['openDispatch'] = True
		# other stuff here
		logger.error( 'Failed Response HTTPError: %s "%s"' %(str(jsonResponse), str(he)) )

	except URLError, ue:	# next version of Jython recommends using "URLError as <alias>"
		if jsonResponse == None:
			jsonResponse = {}
		jsonResponse['handshakeTag'] = -3
		jsonResponse['openDispatch'] = True
		# other stuff here
		logger.error( 'Failed Response URLError: %s "%s"' %(str(jsonResponse),str(ue)) )

	except IOError, ioe:
		if jsonResponse == None:
			jsonResponse = {}
		jsonResponse['handshakeTag'] = -4
		jsonResponse['openDispatch'] = True
		# other stuff here
		logger.error( 'Failed Response IOERrror: %s "%s"' %(str(jsonResponse), str(ioe)) )
	except:
		if jsonResponse == None:
			jsonResponse = {}
		jsonResponse['handshakeTag'] = -5
		jsonResponse['openDispatch'] = True
		# other stuff here
		logger.error( 'Failed Response GeneralError: %s' %str(jsonResponse) )

	return jsonResponse

The calling event is responsible to take appropriate action based on the values of ‘handshakeTag’ and ‘openDispatch’.

My apologies for some mistakes in trying this and now it’s fixed for running:

Response = client.post(url,parameter)
print response.text

the result is the same without any more useful information:

{“error”:{“code”:“ODP_DESERIALIZATION_ERROR”,“message”:“Error while de-serializing contents.”}}

Okay, so it’s definitely a server error.

Do you have something locally (e.g. a tool like Postman) that you can show correctly sends the data you’re trying to send?
Trying to figure out what’s different between the two should be helpful. Wireshark would be helpful if the endpoint were insecure, but probably won’t help you here.

i will try to get some tool to troubleshoot. in the meantime, is the above a proper form to call the httpclient POST web service? we know url is correct and likely just the parameter is somehow now quite right yet…

somehow not quite right yet…

Try specifying that the data you’re sending should be the POST body, not parameters:
Response = client.post(url, data=parameter)

will try that. thanks .