Hi, I am creating a protocol with HTTP POST request. I followed every instructions provided and looked through a lot of examples but still my protocol does not work.
Here's what I did:
- created a protocol with type http
- I specified the port settings
- Then I start creating the flow until it reaches the session. Timer > Group > Session
- In my POST session, I am consuming the authorization token as a form of header from a parameter which user can change. The same goes for the SQL statement, warehouseID, wait_timeout and on_wait_timeout information which if I understood correctly will be parse in the body as a form of JSON.
- Next I have defined paramaters that hold the response status code and content.
- The paramater content 107 is then linked to a QAction which will perform the data parsing.
Then I create a new element with this protocol and I configure all the details needed. I also specified the IP address of which the url destination I am consuming from.
What I expect is that the call is to be made successful and QAction is being called. But after I set the values nothing is happeing. The QAction is not being executed and status code is not showing the result such as 200ok and now the element goes into timeout immediately.
May I know what is the problem here? I followed every step I know but nothing is working.
Hi Robbie,
Thank you for the quick response. I have checked the stream viewer as you mentioned and there seems to be a request timeout.
-> 15:28:12 – Error : 12002. [ERROR_WINHTTP_TIMEOUT]
-> 15:28:12 – Get for ResponseContent () had error : Error : 12002. [ERROR_WINHTTP_TIMEOUT]
-> 15:28:12 – Continuing get for ResponseContent ()
Do you know what this means? I used the bypassProxy in the bus address and also specified an IP address in the protocol paramater proxyServer.
From your explanation I understood that the requests only work if you configure them to go through the proxy server which is why you have added the proxyServer attribute to the Session tag.
However if you then set the bypassproxy value in the bus address of the connection, you're overriding that setting again configuring all the requests to be sent straight to the webserver.
The DataMiner docs mention the following:
Bus address: The bus address of the device. This is not always required. If the proxy server has to be bypassed, specify bypassproxy.
If you remove the bypassproxy value from the bus address input field, I believe your requests will stop timing out.
Hi Jeroen, thank you so much for your reply!
The timeout issue has been fixed, it was indeed due to the bypassproxy value in the bus address.
Very thankful for your answer!
Hello,
As Robbie previously mentioned, starting with the StreamViewer is the best approach.
However, based on your description, it appears that the POST request you're constructing may require the body to be formatted as a JSON with a specific format.
Since you're currently using the parameter tag, the body will be constructed as follows:
statement=[VALUE]&warehouse_ID=[VALUE]...
See documentation
If the endpoint does require the body to have a specific JSON format, I recommend instead constructing the body in a QAction and saving it in a parameter.
Afterward, you can link the parameter to the session using the data tag:
<Request verb="POST" url="">
...
<Data pid="[Parameter_ID]"></Data>
...
</Request>
Hi Daniela,
Thank you for the quick response. I have checked the stream viewer as you mentioned and there seems to be a request timeout.
-> 15:28:12 – Error : 12002. [ERROR_WINHTTP_TIMEOUT]
-> 15:28:12 – Get for ResponseContent () had error : Error : 12002. [ERROR_WINHTTP_TIMEOUT]
-> 15:28:12 – Continuing get for ResponseContent ()
Do you know what this means? I used the bypassProxy in the bus address and also specified an IP address in the protocol paramater proxyServer.
Also, thank you so much for the suggestion of using the data tag instead of the paramater tag, I will give it a try once the request timeout error is fixed.
It seems that Dataminer is not able to reach the endpoint. It could be because of firewall settings, an incorrect port…
Can you check with a third party app if you are able to reach the end point? Postman is a good option in these cases.
Using postman I am able to reach the end point but only after I turn on the bypassproxy setting in Google Chrome browser settings. For Dataminer, in logs and streamviewer it shows the client is connected but there is still an issue with getting the ResponseContent() or ConnectionStatus()
Hello Lee,
Following the advices that Robbie and Daniela gave you, I would recommend you the following:
- Download and test the request with the Postman Desktop App.
- Be sure that the HTTPS port (443) that you are using to establish the communication is correct.
- Be sure that the HTTP method you are using is correct (GET, POST, PUT, etc.)
- Be sure that the JSON data content is in the proper format.
- If the process succeeds in Postman, the same configuration should work for Dataminer and the Error : 12002. [ERROR_WINHTTP_TIMEOUT] should disappear as this typically means that the URL is not reachable.
- If the error persists, you could try to increase the value of the timeout in the element settings to the max (120000 if I'm not mistaken).
- As Daniela suggested, the best approach to built the data content of the request is through a QAction and saving it in a parameter.
- You should trigger the Session execution after the QAction.
Let me know if you manage to solve the problem following these steps.
Can you check with streamviewer on the element what the communication looks like.