我试图用以下方法连接neo4j本地设置(Windows 10 WSL Ubunutu 18.04) Gremlin.Net
库。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服务器已经启动,并且运行在......"。如果你的意思是 Neo4j服务器 然后 Gremlin.NET 不会直接连接到该库。要使用该库,你需要安装 Gremlin服务器 和 在其中配置Neo4j.