SBX - Search With Button

SBX - Forum Post Title

Service Based Architecture and Custom Procedures

Microsoft Dynamics GP Forum

Paul Haag asked a question on 16 Feb 2015 10:15 AM
My Badges

Question Status

Verified

Can anyone tell me the steps for creating and the URL for calling a custom procedure with the new SBA for GP 2015?

Here is what I've done to this point:

  1. Created a procedure with an out parameter that sets the parameter to the static string, "Hello World!"
  2. Edited the properties of the procedure with the following values:
    • ServiceAction: Get
    • ServiceCustomAction: I did not specify a value.
    • ServiceEnabled: TRUE
    • ServiceRawRequest: FALSE
    • ServiceUriTemplate: HelloWorld
  3. Created a chunk file with that change and installed it on my default (and only) instance.
  4. I saw a post (here) saying that the Dictionary Assembly Generator (DAG) was necessary to get the SBA running, so I created an assembly for my application and placed it (and the metadata files, although I don't know if that is necessary) in the AddIns folder of GP (is that the right place?).

At this point I tested it with no luck, so I restarted all of the services thinking that might be necessary to get it to pick up the new code, but got the same result:

{
  "Status": {
    "CorrelationId": "2303d30bb45a4d348139ac55807a7e8f",
    "HttpCode": 404,
    "ErrorCode": "OperationNotFound",
    "Source": "DexterityProcess",
    "Message": "No operation was defined for this URI\/verb combination."
  }
}

The relevant request log from didn't reveal much more:

11:09:33.940 | CorrelationId:       [2303d30bb45a4d348139ac55807a7e8f]
11:09:33.940 | ProxyId:             [f1a044bbdd9f4885bebe9dbfa0d94785]
11:09:33.940 | OperationNumber:     [7]
11:09:33.940 | RuntimeDir:          [C:\Dynamics\GP2015]
11:09:33.940 | HTTPVerb:            [GET]
11:09:33.940 | Full URI:            [https://mymachine:myport/GPService/Tenants(Test)/Companies(Fabrikam, Inc.)/Artis Dexterity Programs/HelloWorld.json]
11:09:33.940 | Operation URI:       [/Artis%20Dexterity%20Programs/HelloWorld]
11:09:33.940 | CustomAction:        []
11:09:33.940 | Tenant:              [Test]
11:09:33.940 | Company:             [Fabrikam, Inc.]
11:09:33.940 | SetFile:             [C:\Dynamics\GP2015\Dynamics.set]
11:09:33.940 | IniFile:             [C:\Dynamics\GP2015\Data\Dex.ini]
11:09:33.940 | AuthType:            [NTLM]
11:09:33.940 | RequestUser:         [ARTISINC\phaag]
11:09:33.941 | ProcessUser:         [ARTISINC\paulgp2015services]
11:09:33.941 | ProcessId:           [6712]
11:09:33.941 | OperationTimeout:    [00:00:00]
11:09:33.941 | ForceBackground:     [False]
11:09:33.941 | ResponseFormat:      [Json]
11:09:33.941 | Service executable:  [1.0.91.0]
11:09:33.941 | DynamicsRuntime.dll: [14.00.0072.000]
11:09:34.001 | [*Error*]::Request Exception (bridge - expected) :: CorrelationId:[2303d30bb45a4d348139ac55807a7e8f], HttpCode:[404], ErrorType:[OperationNotFound], Source:[DexterityProcess], ExInfo:[Microsoft.Dynamics.GP.Svc.Foundation.ErrorHandling.RequestException: No operation was defined for this URI/verb combination.
   at Microsoft.Dynamics.GP.Svc.DexterityProcess.OperationManagement.OperationManager.FetchOperation(String uriPart, String httpVerb, String customAction)
   at Microsoft.Dynamics.GP.Svc.DexterityProcess.DexterityProcessBridge.ExecuteForegroundInstructionsInternal(DexterityServiceRequestData requestData)]
11:09:34.058 | --------- WEB SERVICE CALL IS RETURNING ----------

As you can see from the trace, I was trying a URL in the format: https://mymachine:myport/GPService/Tenants(MyTenant)/Companies(Fabrikam,%20Inc.)/MyProductName/MyServiceUriTemplate.json. I have also tried replacing MyProductName with MyProductId, but I get the same result. I'm assuming I'm missing something more fundamental about the structure (like a sub-directory by product).

Reply
Rob Bernhardt responded on 18 Feb 2015 10:48 AM
My Badges
Verified Answer

Paul,

You need to place the new Application.PRODUCTNAME.dll in your GP runtime folder.  After restarting your services, a good way to see if your endpoint is available is by using discovery (url below).  That will show all the dictionaries that have been DAG'ed and have available service endpoints.

https://<MachineName>/GPService/Tenants(DefaultTenant)/Companies(Company Name)/Help/

Thanks

Rob

Reply
Paul Haag responded on 18 Feb 2015 1:54 PM
My Badges

Oh, right. Makes sense that would go in the runtime folder instead of the addins folder. Also, good tip on the Help URL. That's tremendously useful.

Reply
Rob Bernhardt responded on 18 Feb 2015 10:48 AM
My Badges
Verified Answer

Paul,

You need to place the new Application.PRODUCTNAME.dll in your GP runtime folder.  After restarting your services, a good way to see if your endpoint is available is by using discovery (url below).  That will show all the dictionaries that have been DAG'ed and have available service endpoints.

https://<MachineName>/GPService/Tenants(DefaultTenant)/Companies(Company Name)/Help/

Thanks

Rob

Reply

SBX - Two Col Forum

SBX - Migrated JS