cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Install graphQL REST API add-on

oguimard
Retired

️ Follow this step to install the GraphQL REST API add-on on HOPEX V3. You will learn in this video how to proceed the wizard, how to cnfigure the Web.config, configure IIS and adjust access rights.

 

22 Replies

Hello,

 

could you share with me on a private message an architecture diagram of the deployment you have put in place ?

 

  • Where did you install HOPEX front-end : folder wwwroot / MWAS
  • Where did you install HOPEx Back-end : folder program file \mega
  • Where did you install HOPEX orchestrator : SSP / WatchDog

 

  • Does UAS is enabled and work in this deployment ?
  • When you say you have a white screen you are talking of GraphiQL ?
  • Did you try your request in Postman ?

 

Regards,

RGenin
Trusted Contributor

Hi Olivier, 

 

We tried to upgrade to the last GraphQL library, but now it is not working anymore:

 

Previous working: Mega.WebService.GraphQL.Setup-787_502-5437

Tried: Mega.WebService.GraphQL.Setup-787_504-iqa-5561

We are in our DEV env on 3 CP4 HF1

 

Error Msg:

 

{
  "Message": "An error has occurred.",
  "ExceptionMessage": "Method not found: 'System.Net.Http.HttpRequestMessage System.Web.Http.Filters.HttpAuthenticationContext.get_Request()'.",
  "ExceptionType": "System.MissingMethodException",
  "StackTrace": "   at Mega.WebService.GraphQL.Filters.HopexAuthenticationFilter.<AuthenticateAsync>d__3.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Mega.WebService.GraphQL.Filters.HopexAuthenticationFilter.AuthenticateAsync(HttpAuthenticationContext context, CancellationToken cancellationToken)\r\n   at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"
}

 

RGenin_0-1593809722488.png

 

We have made sure that replaced the  <secureAppSettings> portion in web.config with the values from HOPEX.

 

Postman works except when we try to hit an URL containing HOPEXGraphQL

 

{
    "Message": "An error has occurred.",
    "ExceptionMessage": "Method not found: 'System.Net.Http.HttpRequestMessage System.Web.Http.Filters.HttpAuthenticationContext.get_Request()'.",
    "ExceptionType": "System.MissingMethodException",
    "StackTrace": "   at Mega.WebService.GraphQL.Filters.HopexAuthenticationFilter.<AuthenticateAsync>d__3.MoveNext()\r\n   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n   at Mega.WebService.GraphQL.Filters.HopexAuthenticationFilter.AuthenticateAsync(HttpAuthenticationContext context, CancellationToken cancellationToken)\r\n   at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"
}

 

RGenin_1-1593809888310.png

What can we do ?

Thanks !

 

If it was working before and it's not, the most commonly seen error with this message is an issue with the .NEt Framework version. The system get confused in the DLL to take.

 

Install latest 4.8 .Net Framework will solve the problem.

 

RGenin
Trusted Contributor

Thanks Olivier. 

It works.
We had the Developer Pack installed and somehow there was a conflict or something. Now with just the Runtime 4.8 installed, it works perfectly.

 

ToddDavey
Super Contributor

Hi,

 

I am running HOPEX V3.00.02 (7.87.5382.5439) and have just tried installing HOPEXGraphQL add-on.

After following the instructions I get the following message:  "GraphiQL & Voyager services are not available".  I have checked all the config files as instructed in the video and everything seems correct.  Any suggestions?

Hello,

 

First the latest GraphQL add-on is valid from HOPEX V3 CP4. Running with prévious CP will not work or maybe subject to loss of data.

 

Second, with the first production release a security setting is set by default on GraphiQL. It does not prevent you to execute query by programming.

 

Third to turn on GraphiQL you must enable it on the web.config located in C:\inetpub\wwwroot\HOPEXGraphQL

 

    <add key="EnableTestingWebService" value="true"/>
    <!--      EnableTestingWebService-->

 

Enjoy GraphQL 🙂 

ibra22
MEGA Partner
MEGA Partner

Hi @oguimard ,

I have HOPEX V4 CP5. i configured graphql but when I tried to test it "servername/HOPEXGraphql" I got that error 

"GraphiQL & voyager services are not available", what could be the problem?

Hello @ibra22 ,

Sounds like you missed some configuration in the web.config within IIS folder.

Go to you IIS folder location

  • Default is : C:\inetpub\wwwroot\HOPEXGraphQL
  • Edit the file web.config
  • Ensure the line Enable TestingWebService is set to True
<add key="EnableTestingWebService" value="true"/>
  • Ensure also all the others fields are properly filled
    <add key="MegaSiteProvider" value="http://W-OGD/MegaSSP"/>
    <!--      Mega SSP address-->
    <add key="AuthenticationUrl" value="http://W-OGD/UAS"/>
    <!--      Mega UAS address-->
    <add key="ClientId" value="HopexAPI"/>
    <!--      Client Id (used for basic authentication)-->
    <add key="ClientSecret" value="secret"/>
    <!--      Client Secret (used for basic authentication)-->
    <add key="Scopes" value="hopex openid read write"/>
    <!--      Scopes (used for basic authentication)-->
    <add key="EnvironmentId" value="EnvironmentIdAbs"/>
    <!--      EnvironmentId-->
    <add key="RepositoryId" value="RepositoryIdAbs"/>
    <!--      RepositoryId-->
    <add key="ProfileId" value="ProfileIdAbs"/>
    <!--      ProfileId-->
    <add key="Login" value="HopexUser"/>
    <!--      Login-->
    <add key="Password" value="HopexPassword"/>
    <!--      Password-->

 

thank you @oguimard , It worked now, however, the authentiation failed. I am using same login & password mentioned in web,config

There should be no login/password to enter. If you get prompted for a login/password by the browser it means the configuration of the XML is not correct.

Check in HOPEX if you don't have an error message.