This is an automated email from the ASF dual-hosted git repository.

nalim2 pushed a commit to branch PLC4X-157OPC-UADisablediscovery
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to 
refs/heads/PLC4X-157OPC-UADisablediscovery by this push:
     new 0240c08  [fix] Address replacement was wrong and the new configured 
endpoint for nDiscovery=true was not set
0240c08 is described below

commit 0240c0851a3e10dee25089eae8efd5599c0d520f
Author: Matthias Milan Strljic <[email protected]>
AuthorDate: Sat Dec 7 11:39:24 2019 -0800

    [fix] Address replacement was wrong and the new configured endpoint for 
nDiscovery=true was not set
    
    Signed-off-by: Matthias Milan Strljic <[email protected]>
---
 .../org/apache/plc4x/java/opcua/connection/OpcuaTcpPlcConnection.java  | 3 ++-
 .../src/test/java/org/apache/plc4x/java/opcua/ManualPLC4XOpcua.java    | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/connection/OpcuaTcpPlcConnection.java
 
b/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/connection/OpcuaTcpPlcConnection.java
index b58ae0f..d2102c1 100644
--- 
a/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/connection/OpcuaTcpPlcConnection.java
+++ 
b/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/connection/OpcuaTcpPlcConnection.java
@@ -217,7 +217,7 @@ public class OpcuaTcpPlcConnection extends 
BaseOpcuaPlcConnection {
                 String[] suffixSplit = prefixSplit[1].split(splitterSuffix);
                 //reconstruct the uri
                 newEndpointUrl = "";
-                newEndpointUrl += prefixSplit[0] + splitterPrefix + address;
+                newEndpointUrl += prefixSplit[0] + splitterPrefix + 
address.getHostAddress();
                 for (int suffixCounter = 1; suffixCounter < 
suffixSplit.length; suffixCounter++) {
                     newEndpointUrl += splitterSuffix + 
suffixSplit[suffixCounter];
                 }
@@ -236,6 +236,7 @@ public class OpcuaTcpPlcConnection extends 
BaseOpcuaPlcConnection {
                 endpoint.getUserIdentityTokens(),
                 endpoint.getTransportProfileUri(),
                 endpoint.getSecurityLevel());
+            endpoint = noDiscoverEndpoint;
         }
 
 
diff --git 
a/plc4j/drivers/opcua/src/test/java/org/apache/plc4x/java/opcua/ManualPLC4XOpcua.java
 
b/plc4j/drivers/opcua/src/test/java/org/apache/plc4x/java/opcua/ManualPLC4XOpcua.java
index 6258a22..8d8f35f 100644
--- 
a/plc4j/drivers/opcua/src/test/java/org/apache/plc4x/java/opcua/ManualPLC4XOpcua.java
+++ 
b/plc4j/drivers/opcua/src/test/java/org/apache/plc4x/java/opcua/ManualPLC4XOpcua.java
@@ -75,7 +75,7 @@ public class ManualPLC4XOpcua {
         PlcField field = fieldH.createField("ns=2;i=10855");
         try {
             opcuaConnection = (OpcuaTcpPlcConnection)
-                new 
PlcDriverManager().getConnection("opcua:tcp://opcua.demo-this.com:51210/UA/SampleServer&nDiscovery=true");
+                new 
PlcDriverManager().getConnection("opcua:tcp://localhost:4843?nDiscovery=true");
 
         } catch (PlcConnectionException e) {
             e.printStackTrace();

Reply via email to