GraphEngine icon indicating copy to clipboard operation
GraphEngine copied to clipboard

Can we call Graph Engine from a Web API i.e. the controller or model ?

Open jorgepluna opened this issue 8 years ago • 9 comments

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

jorgepluna avatar Jul 24 '17 04:07 jorgepluna

Hi @jorgepluna,

That's coming down to several different issues.

  1. 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.
  2. 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)
  3. 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.

yatli avatar Jul 24 '17 07:07 yatli

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 avatar Aug 03 '17 05:08 bingzhangdai

@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 avatar Aug 03 '17 06:08 yatli

@yatli Problem solved. Thanks!

bingzhangdai avatar Aug 03 '17 10:08 bingzhangdai

Closing this issue now. Feel free to reopen if you have more questions on this.

yatli avatar Aug 09 '17 07:08 yatli

@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 avatar Aug 11 '17 05:08 bingzhangdai

@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 avatar Aug 11 '17 06:08 yatli

@yatli fantastic! Why not put these examples on official website!

bingzhangdai avatar Aug 11 '17 09:08 bingzhangdai

@bingzhangdai I think you're right. We should put these things into our docs. :)

yatli avatar Aug 14 '17 04:08 yatli