简体   繁体   English

使用 gremlin.net 从 .net 连接 neo4j

[英]Connect neo4j from .net using gremlin.net

Am trying to connect neo4j local setup(Windows 10 WSL Ubunutu 18.04) using Gremlin.Net library.我正在尝试使用Gremlin.Net库连接 neo4j 本地设置(Windows 10 WSL Ubunutu 18.04)。 Neo4j server is started and its running in http://localhost:8182/ . Neo4j 服务器启动并在http://localhost:8182/中运行。 When i try to connect using below code, it throws the error System.Net.WebSockets.WebSocketException: 'The server returned status code '404' when status code '101' was expected.'当我尝试使用下面的代码进行连接时,它会抛出错误System.Net.WebSockets.WebSocketException: 'The server returned status code '404' when status code '101' was expected.' What am i missing here.我在这里想念什么。

           var gremlinServer = new GremlinServer("localhost", 8182);
           var graphsonReader = new GraphSON2Reader(
                                   new Dictionary<string, IGraphSONDeserializer> { { MyType.GraphsonType, new MyTypeReader() } });
           //var graphsonWriter = new GraphSON2Writer(
           //    new Dictionary<Type, IGraphSONSerializer> { { typeof(MyType), new MyClassWriter() } });
           _connection = new GremlinClient(gremlinServer, graphsonReader, new GraphSON2Writer(), GremlinClient.GraphSON2MimeType);
           return _connection;

I'm not sure if you meant to type this but you wrote that "Neo4j server is started and running in....".我不确定您是否打算输入此内容,但您写道“Neo4j 服务器已启动并正在运行....”。 If you specifically meant Neo4j Server then Gremlin.NET won't connect to that directly.如果您特别指的是Neo4j 服务器,那么Gremlin.NET将不会直接连接到该服务器。 To use that library you would need to install Gremlin Server and configure Neo4j within that .要使用该库,您需要安装Gremlin Server在其中配置 Neo4j

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM