简体   繁体   中英

Connect neo4j from .net using gremlin.net

Am trying to connect neo4j local setup(Windows 10 WSL Ubunutu 18.04) using Gremlin.Net library. Neo4j server is started and its running in 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.' 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....". If you specifically meant 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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