使用 gremlin.net 从 .net 连接 neo4j

Connect neo4j from .net using gremlin.net

我正在尝试使用 Gremlin.Net 库连接 neo4j 本地设置(Windows 10 WSL Ubunutu 18.04)。 Neo4j 服务器已启动,其 运行 在 http://localhost:8182/ 中。当我尝试使用以下代码进行连接时,它会抛出错误 System.Net.WebSockets.WebSocketException: 'The server returned status code '404' when status code '101' was expected.' 我在这里缺少什么。

           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;

我不确定你是否打算输入这个,但你写了那个 "Neo4j server is started and running in...."。如果您具体指的是 Neo4j Server then Gremlin.NET won't connect to that directly. To use that library you would need to install Gremlin Server and configure Neo4j within that.