Discussion:
TDI http client connector getting timed out
(too old to reply)
Tom Steenbergen
2017-11-30 10:49:33 UTC
Permalink
Hello,
I am new to TDI, but so far I have been able to read and write to IBM Notes, set up a Http Server connector.
But I cannot get beyond the first step in setting up the Http Client Connector as below:

Mode: CallReply
HTTP Url: https://maps.googleapis.com/maps/api/distancematrix/xml

for the rest as default.

And when running this in the console it gets timed out.

When running this call in Chrome I get a nice response with the message "Invalid request". I am also expecting this reply in TDI.

How can I get this running in TDI?

Regards,
Tom
yn2000
2017-11-30 18:57:48 UTC
Permalink
Hi Tom,
I think you left out so many details. For example: You have a mismatch Content Type, that could generate something similar to what you are seeing.
Rgds. YN.
t***@pon.com
2017-12-06 07:08:07 UTC
Permalink
Sorry for the delay. Was not able to respond earlier.
As this is only the first step in setting up the AL and make the first and IBM suggests making small steps in setting up AL's, I expected that default settings as below would be sufficient.
I have also tried the other content types, but still get the connection timed out.

Settings of the connector are:
<Configuration>
<InheritFrom>[parent]</InheritFrom>
<ModTime>1512112999241</ModTime>
<parameter name="contentType">text/plain; charset=US-ASCII</parameter>
<parameter name="debug">true</parameter>
<parameter name="url">https://maps.googleapis.com/maps/api/distancematrix/xml</parameter>
</Configuration>


OUTPUT IN THE CONSOLE:
07:50:15,212 INFO - [TestRestService] CTGDIS058I Connector com.ibm.di.connector.HTTPClientConnector inherits from [parent].
07:50:15,212 INFO - [TestRestService] CTGDIS187I Loaded com.ibm.di.connector.HTTPClientConnector, 2.2-di7.1.1 1.53.1.3, 2011/08/02.
07:50:15,228 INFO - [TestRestService] CTGDIS064I Loading Attribute Map.
07:50:15,228 INFO - [TestRestService] CTGDIS065I Load Hooks.
07:50:15,228 INFO - [TestRestService] CTGDIS044I Initializing Connector.
07:50:15,244 INFO - [TestRestService] CTGDIS158I Registering Script Beans.
07:50:15,244 INFO - [TestRestService] CTGDIS484I Connector com.ibm.di.connector.HTTPClientConnector: 2.2-di7.1.1 1.53.1.3, 2011/08/02.
07:50:15,244 INFO - [TestRestService] CTGDIS046I Initialization finished.
07:50:15,244 INFO - CTGDIS087I Iterating.
07:50:15,244 INFO - CTGDIS086I No iterator in AssemblyLine, will run single pass only.
07:50:15,244 INFO - CTGDIS092I Using runtime provided entry as working entry (first pass only).
07:50:15,259 INFO - [TestRestService] CTGDIS504I *Result of attribute mapping*
07:50:15,259 INFO - [TestRestService] CTGDIS505I The 'conn' object
07:50:15,259 INFO - [TestRestService] CTGDIS003I *** Start dumping Entry
07:50:15,259 INFO - Operation: generic
07:50:15,259 INFO - Entry attributes:
07:50:15,259 INFO - [TestRestService] CTGDIS004I *** Finished dumping Entry
07:50:15,259 INFO - [TestRestService] CTGDIS506I The 'work' object
07:50:15,259 INFO - [TestRestService] CTGDIS003I *** Start dumping Entry
07:50:15,259 INFO - Operation: generic
07:50:15,259 INFO - Entry attributes:
07:50:15,275 INFO - [TestRestService] CTGDIS004I *** Finished dumping Entry
07:50:36,325 INFO - [TestRestService] CTGDIS495I handleException , callreply, java.net.ConnectException: Connection timed out: connect
07:50:36,325 ERROR - [TestRestService] CTGDIS810E handleException - cannot handle exception , callreply
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:381)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:243)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:230)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:377)
at java.net.Socket.connect(Socket.java:539)
at com.ibm.jsse2.SSLSocketImpl.connect(SSLSocketImpl.java:774)
at com.ibm.di.connector.HTTPClientConnector.sendRequest(HTTPClientConnector.java:339)
at com.ibm.di.connector.HTTPClientConnector.queryReply(HTTPClientConnector.java:205)
at com.ibm.di.server.AssemblyLineComponent.executeOperation(AssemblyLineComponent.java:3348)
at com.ibm.di.server.AssemblyLineComponent.callreply(AssemblyLineComponent.java:2099)
at com.ibm.di.server.AssemblyLine.msExecuteNextConnector(AssemblyLine.java:3750)
at com.ibm.di.server.AssemblyLine.executeMainStep(AssemblyLine.java:3351)
at com.ibm.di.server.AssemblyLine.executeMainLoop(AssemblyLine.java:2960)
at com.ibm.di.server.AssemblyLine.executeMainLoop(AssemblyLine.java:2943)
at com.ibm.di.server.AssemblyLine.executeAL(AssemblyLine.java:2912)
at com.ibm.di.server.AssemblyLine.run(AssemblyLine.java:1311)
07:50:36,325 ERROR - CTGDIS266E Error in NextConnectorOperation. Exception occurred: java.net.ConnectException: Connection timed out: connect
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:381)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:243)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:230)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:377)
at java.net.Socket.connect(Socket.java:539)
at com.ibm.jsse2.SSLSocketImpl.connect(SSLSocketImpl.java:774)
at com.ibm.di.connector.HTTPClientConnector.sendRequest(HTTPClientConnector.java:339)
at com.ibm.di.connector.HTTPClientConnector.queryReply(HTTPClientConnector.java:205)
at com.ibm.di.server.AssemblyLineComponent.executeOperation(AssemblyLineComponent.java:3348)
at com.ibm.di.server.AssemblyLineComponent.callreply(AssemblyLineComponent.java:2099)
at com.ibm.di.server.AssemblyLine.msExecuteNextConnector(AssemblyLine.java:3750)
at com.ibm.di.server.AssemblyLine.executeMainStep(AssemblyLine.java:3351)
at com.ibm.di.server.AssemblyLine.executeMainLoop(AssemblyLine.java:2960)
at com.ibm.di.server.AssemblyLine.executeMainLoop(AssemblyLine.java:2943)
at com.ibm.di.server.AssemblyLine.executeAL(AssemblyLine.java:2912)
at com.ibm.di.server.AssemblyLine.run(AssemblyLine.java:1311)
07:50:36,325 INFO - CTGDIS100I Printing the Connector statistics.
07:50:36,325 INFO - [TestRestService] Errors:1
07:50:36,450 INFO - [DumpWorkEntry] Calls: 0
07:50:36,450 INFO - CTGDIS104I Total: Errors:2.
07:50:36,450 INFO - CTGDIS101I Finished printing the Connector statistics.
07:50:36,465 ERROR - CTGDIS077I Failed with error: Connection timed out: connect.
--
This e-mail and its attachments are confidential and may contain legally
privileged information. The information in this e-mail is intended solely
for the addressee(s). If you are not the intended recipient, please notify
the sender and delete it from your system. Any disclosure, copying,
distribution or any other action taken or omitted to be taken to prevent
any information becoming public, is prohibited and may be unlawful.

Pon Power BV has its registered office in Papendrecht and is listed in the
Commercial Register of Chamber of Commerce in Rotterdam under file number
23060463. All legal relations of Pon Power will be governed by our general
conditions and they will upon request be made available without charge. The
conditions are deposited at the Chamber of Commerce Rotterdam and can be
found on www.pon-cat.com. Pon Power rejects explicitly the applicability of
any general terms and conditions which its contractual parties may use.
Jurisdiction: District Court Dordrecht, Netherlands.
yn2000
2017-12-06 18:37:40 UTC
Permalink
The error says that you cannot connect to the target server;
while I built a quick test from my desktop without issue.
I got this response.

<?xml version="1.0" encoding="UTF-8"?>
<DistanceMatrixResponse>
<status>INVALID_REQUEST</status>
</DistanceMatrixResponse>

So, first of all, can you try ping maps.googleapis.com from the machine that the AL is running?
Rgds. YN.
Tom Steenbergen
2017-12-07 14:46:30 UTC
Permalink
Hi YN,
Thanx for your response.
We found the issue to be in our locations firewall.

rgrds, Tom
Eddie Hartman
2017-12-10 11:21:05 UTC
Permalink
Post by Tom Steenbergen
Hi YN,
Thanx for your response.
We found the issue to be in our locations firewall.
rgrds, Tom
Here is a verbal example, Tom, and it's a recipe for a simple AL that let's you play with HTTP comms.

Set up an AL with an HTTP Client Connector and set it to CallReply mode. This mode means you get an Output Map where you can set up the request, and an Input Map for response. Add a Dump Entry script after the Connector to view the response.

In the Output Map you can pass in the url by mapping out 'url' (of course, you can also set the parameter of the Connector). You can send any number of HTTP headers by mapping their names preceded by 'http.'. So for example, to pass the Accept header simply map 'http.Accept'.

The response you get back will contain the headers (http.*) and body (http.body). Note that depending on the Content-Type received, parsing of the http.body attribute may not be what you want. That is why the Connector always returns two more 'body' attributes: http.bodyAsBytes and http.bodyAsString. The 'bodyAsString' version is always returned as a Java String. This is what I always use to get the return payload. From there I use stuff like work.fromXML(body, "*", "") or work.fromJSON() to parse this payload into an hierarchical entry. You'll find several posts on my blog about dealing with hierarchical data.

Hope this helps. If you still would like more, shout out :)
Eddie Hartman
2017-12-10 11:22:09 UTC
Permalink
Post by Tom Steenbergen
Hi YN,
Thanx for your response.
We found the issue to be in our locations firewall.
rgrds, Tom
Great news! And here's a earlier post regarding custom headers - in particular the authentication header:

https://groups.google.com/forum/#!topic/ibm.software.network.directory-integrator/6TAnNhSH7nI
Loading...