Hi Kevin,
As already explained, SomaWrapper needs two ressources:
-
Soma_Communication_Java.netmodule
-
CommunicateWithIndas.dll
These two files MUST be in the same location than SomaWrapper. If you run the runnable jar in SomaTest.rar, you should see the -999999 value at the end (after the printed stack trace that the SOAP connection failed).
UnsatisfiedLinkError means that the two files are not correctly placed. On my side, when I run the test Program I wrote in Eclipse, it runs fine. So it should also run fine within inductive automation. Here is the source code of the SomaTest.rar program SomaCommunicator.zip (55.5 KB)
This one should run on your side and vizualize the following:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://pc_soma:1024/soap/Indas_SOAP_Service that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. —> System.Net.WebException: The remote name could not be resolved: ‘pc_soma’
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
— End of inner exception stack trace —
Server stack trace:
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object ins, Object outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at CommunicateWithIndas.IndasSoap.INDAS_SOAP_SERVICE.SetChannels(SetChannelsRequest request)
at CommunicateWithIndas.IndasSoap.NDAS_SOAP_SERVICEClient.CommunicateWithIndas.IndasSoap.INDAS_SOAP_SERVICE.SetChannels(SetChannelsRequest request)
at CommunicateWithIndas.IndasSoap.NDAS_SOAP_SERVICEClient.SetChannels(Int32 Channels)
at CommunicateWithIndas.Soma_Communication.GetValueFromSOMA(Int32 dataWanted)
— End of inner exception stack trace —
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object parameters, Object arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at CSharpSomaConnector.GetValue(Int32 value)
at Java_lu_paulwurth_SomaCommunicator_getSomaValue(JNIEnv_* jn, _jobject* jobj, Int32 value)
-999999.0
This is a printed stack trace, because the SOAP server is not reachable and the result is -999999.0. This should be the same in inductive automation. If this is not the case, as on my side, the problem is somewhere, but not in my code, because it runs just fine outside of inductive automation.
Thank you for your help