Skip to content

doTCPConnectionTest does not cater for a remote host and port. #117

@jjjw420

Description

@jjjw420

The IBM Datapower XML management interface provides troubleshooting functionality to test TCP connections to a remote host and port(the "TCPConnectionTest" action). This allows you to confirm that the Datapower device is able to open a TCP connection to a remote system.

The current doTCPConnectionTest method in Soma.java maps the "host" and "port" parameters to "RemoteHost" and "RemotePort" elements. As the "host" and "port" parameters are set to the host and port for the XML management interface you are never able to test connections to other hosts defying the purpose of the TCPConnectionTest operation.

I have changed the doTCPConnectionTest method Soma.java to cater for the remote host and port and tested the fix on firmware 2018.4.1.5.

As I already have a pull request outstanding(PR 104) so I pushed the fix to https://github.com/jjjw420/datapower-configuration-manager-test-tcp-connection-fix. I'll be happy to do a PR if I understand what will happen to (PR 104). Please advise on this.

The following illustrates what was changed in Soma.java (two lines):

The doTCPConnectionTest method

public NamedParams doTCPConnectionTest (NamedParams params) throws Exception {
    params.insistOn (new String[] {"host", "port"});

    // Make the request of the XML Management Interface.
    StringBuffer body = new StringBuffer ("<TCPConnectionTest>");
    body.append("<RemoteHost>" + params.get("host") + "</RemoteHost>");
    body.append("<RemotePort>" + params.get("port") + "</RemotePort>");
    ...

becomes

public NamedParams doTCPConnectionTest (NamedParams params) throws Exception {
    params.insistOn (new String[] {"host", "port"});

    // Make the request of the XML Management Interface.
    StringBuffer body = new StringBuffer ("<TCPConnectionTest>");
    body.append("<RemoteHost>" + params.get("remotehost") + "</RemoteHost>");
    body.append("<RemotePort>" + params.get("remoteport") + "</RemotePort>");
    ...

When calling the wdp function - remote host and port can then be specified:

<wdp operation="TCPConnectionTest" dumpinput="${dumpinput}" dumpoutput="${dumpoutput}" capturesoma="${capturesoma}" 
	responseprop="response" xpath="normalize-space(/env:Envelope/env:Body/soma:response/soma:result)" xpathprop="okay">
	<hostname>${host}</hostname>
	<host>${host}</host>
	<port>${port}</port>
	<uid>${uid}</uid>
	<pwd>${pwd}</pwd>
	<domain>${domain}</domain>
	<remotehost>${remotehost}</remotehost>
	<remoteport>${remoteport}</remoteport>
</wdp>

Please advise.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions