Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Highlighted
Tony_Cunningham Frequent Contributor.
Frequent Contributor.
554 views

Scripting: Access To Couchbase

I'm trying to access a local Couchbaseinstance via their SDK.

I've added the following DLLs from the SDK download (http://packages.couchbase.com/clients/net/2.5/Couchbase-Net-Client-2.7.0.zip) to my SV Designer Extensions folder:

Common.Logging.Core, Common.Logging, Couchbase.NetClient, Newtonsoft.Json, OpenTracing

and updated my scripted-rule-context.xml accordingly. 

When I try to open a project containing a script that access the Couchbase API the following error appears in the SV Designer log:


2018-10-09 11:02:58,148 ERROR [1] JavaScriptEditor RefreshCodeCompletion:232 Failed to attach code completion System.InvalidOperationException: Sequence contains more than one element at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source) at HP.SV.Runtime.Simulation.DataSimulator.ServiceOperationRule.CSharp.DotNetServiceOperationRuleNetRuleExecutor.GetGlobalReferenceAssemblies() in y:\SV-4.20.5561.50064\net\Runtime\Simulation\DataSimulator\ServiceOperationRule\CSharp\DotNetServiceOperationRuleNetRuleExecutor.cs:line 406 at HP.SV.Runtime.Simulation.DataSimulator.ServiceOperationRule.CSharp.DotNetServiceOperationRuleNetRuleExecutor.GetAllReferencedAssemblies(IServiceOperationScriptedRule scriptedRule) in y:\SV-4.20.5561.50064\net\Runtime\Simulation\DataSimulator\ServiceOperationRule\CSharp\DotNetServiceOperationRuleNetRuleExecutor.cs:line 382 at HP.SV.Designer.Controls.DataModelEditor.ScriptedRule.CSharpRule.CSharpCodeCompletion.CreateCSharpProjectForCompletion(IServiceOperationScriptedRule serviceOperationScriptedRule, FileName fileName) in y:\SV-4.20.5561.50064\net\Designer\DesignerCore\Controls\DataModelEditor\ScriptedRule\CSharpRule\CSharpCodeCompletion.cs:line 363 at HP.SV.Designer.Controls.DataModelEditor.ScriptedRule.CSharpRule.CSharpCodeCompletion.Attach(TextEditor editor, ScriptedServiceOperationRuleViewModel viewModel, ITextEditor adapterParam) in y:\SV-4.20.5561.50064\net\Designer\DesignerCore\Controls\DataModelEditor\ScriptedRule\CSharpRule\CSharpCodeCompletion.cs:line 375 at HP.SV.Designer.Controls.DataModelEditor.ScriptedRule.JavaScriptEditor.RefreshCodeCompletion() in y:\SV-4.20.5561.50064\net\Designer\DesignerCore\Controls\DataModelEditor\ScriptedRule\JavaScriptEditor.xaml.cs:line 232

The error disappears when I remove the CommonLogging DLL but there is a dependency on this DLL in the Couchbase.NetClient DLL. 

Can anyone suggest a fix for this?

Thanks,

Tony

 

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

Re: Scripting: Access To Couchbase

Hi Tony,

I think it's because Common.Logging.dll is already part of SV. Can you please try to remove it and try again?

---
Service Virtualization R&D
0 Likes
Tony_Cunningham Frequent Contributor.
Frequent Contributor.

Re: Scripting: Access To Couchbase

Hi Jakub,

As I mentioned in my original post there is a dependency in the Couchbase DLL that requires Common Logging. Is there a mechanism for Couchbase to use the DLL loaded by SV?

Tony

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Scripting: Access To Couchbase

Once you add it to scripted-rule-context.xml, it should be available in the scripted rule.

---
Service Virtualization R&D
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.