GraphEngine
                                
                                
                                
                                    GraphEngine copied to clipboard
                            
                            
                            
                        Can we call Graph Engine from a Web API i.e. the controller or model ?
We tried and got this error:
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B
We need to embed the logic of Graph Engine in a model for our APIs? Is this possible? How?
Thanks
Hi @jorgepluna,
That's coming down to several different issues.
- The bad image exception is due to your program being executed as x86 code; Either switch it to x64, or disable "prefer 32-bit" and use Anycpu.
 - GE has built-in web server, and will listen on port 80. So if you declare HTTP protocols you'll be able to reach them over HTTP. (Admin privilege may be required)
 - It's also possible to route WCF/ASP.NET etc. handlers to GE handlers. Just create a GE message inside such a handler, send a synchronous message to GE and translate the result back to HTTP-compatible forms.
 
Is it possible to change the web server default port? Whenever I use
TrinityConfig.HttpPort = 81; 
(No matter what value it is) I got the message:
[ ERROR ] Failed to start HTTP server. HTTP endpoints are disabled.
@bingzhangdai If you're running Windows, you'll need to grant permission to the app to listen on a HTTP port (not specific to 80 or 81), or run it as admin.
@yatli Problem solved. Thanks!
Closing this issue now. Feel free to reopen if you have more questions on this.
@yatli I have noticed that HTTP protocol can have Stream as Request or Response. The docs writes,
A Request or Response with Stream type can be manipulated via data stream interfaces
Since the request and response should be Json format. I am wondering how to use stream interfaces. Could you please provide more information about it? Any material will be helpful!
@bingzhangdai there you go: https://blogs.msdn.microsoft.com/graphengine/2015/05/30/graph-engine-private-customized-key-value-store-with-an-attitude/
At the end of the article there's a mp3 streaming example :D :D :D
@yatli fantastic! Why not put these examples on official website!
@bingzhangdai I think you're right. We should put these things into our docs. :)