Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP forum
Answered

Service Based Architecture Documentation

Posted on by Microsoft Employee

Where is the service-based architecture documentation? I can't seem to find anything that describes how you actually make a PATCH update nor can I find any links to anything called GP 2015 SDK or the like. The install has SDKs in the Tools directory, but non of them are for SBA.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service Based Architecture Documentation

    I tried to put together my own description on how to get all of this running in a blog post: blog.interdynartis.com/using-the-dynamics-gp-service-based-architecture

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service Based Architecture Documentation

    I'm not 100% sure how this works, but I asked a new question about the SBA in a different thread and I haven't gotten any responses. Since I did on this thread, I'm linking to it and hoping that will work: community.dynamics.com/.../152461.aspx

  • Verified answer
    RE: Service Based Architecture Documentation

    Paul,

    Regarding the update issue, I'll make a note of it internally so that we can get it corrected.  Our number one priority was to get "full update" scenarios working (send the full item back with updated properties).  Our second priority was to get "partial update" scenarios working.  I know that partial updates are supported for some other entities, but this one must have been missed.  

    Regarding the SDK type documentation, there isn't anything available right now.  We are currently working to document all the various aspects of the SBA for our partners and customers.  It is currently being released via the blog.

    Thanks

    Rob

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service Based Architecture Documentation

    So, this gets me past the specific thing I was trying to do, but in terms of, "answering this question," is the answer, "There isn't any SDK-type documentation right now?"

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service Based Architecture Documentation

    Thanks, that's a good tip. Apparently, I already had it logging service requests (just as an FYI, my install is configured for multiple tenants, so I had previously set it in the Tenant Manager, but didn't know where the logs went).

    The log showed that it was calling script ServiceUpdateItem. We're one of the partners that has access to the GP source code, so I took a look at that script and noticed that it's not populating the request with anything from the database before checking required fields, so if you don't specify one of them, you can't make an update. I would probably call that a bug, since it seems to go against the idea of just PATCHing with your changes, but perhaps that's by design.

    At any rate, once I specified the ItemNumber, ItemDescription and UOfMSchedule, I was able to make my update!

  • RE: Service Based Architecture Documentation

    PATCH is the correct verb.  

    Do you have the following in your TenantConfiguration.xml?  

    <RequestLoggingEnabled>true</RequestLoggingEnabled>

    Once this is turned on, you'll get an information log with every request.  It would be helpful to know what errors and other info is in the log.  The logs would be found at a location like the following:  C:\ProgramData\Microsoft Dynamics\GPSvc\Logs\Inst_DefaultInstance_14\DexterityRequests.

    Thanks

    Rob

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service Based Architecture Documentation

    Right. I forgot about the inner payload object from the sessions at reIMAGINE. Actually, it is supposed to be application\json, so adding the Payload property worked, however with a PATCH, I'm getting validation errors that make it look like it's trying to do a POST:

    {

       "Status": {

           "CorrelationId": "37517da0721b4a12a4e8752af62ebbbb",

           "HttpCode": 400,

           "ErrorCode": "ApplicationError",

           "Source": "DexterityProcess",

           "Message": "One or more errors occurred while processing the request. Please see the server logs or the error details in the response for more details."

       },

       "Errors": [

           {

               "Severity": "Error",

               "ErrorType": "Field",

               "Reference": "function ItemSetFieldsCheckRequired of form ServiceItem",

               "Message": "ItemObj.ItemNumber Invalid field found",

               "ProductId": 0

           },

           {

               "Severity": "Error",

               "ErrorType": "Field",

               "Reference": "function ItemSetFieldsCheckRequired of form ServiceItem",

               "Message": "ItemObj.ItemDescription Invalid field found",

               "ProductId": 0

           },

           {

               "Severity": "Error",

               "ErrorType": "Field",

               "Reference": "function ItemSetFieldsCheckRequired of form ServiceItem",

               "Message": "ItemObj.UOfMSchedule Invalid field found",

               "ProductId": 0

           },

           {

               "Severity": "Error",

               "ErrorType": "Field",

               "Reference": "ServiceUpdateItem",

               "Message": "One or more mandatory fields are missing or invalid.",

               "ProductId": 0

           }

       ]

    }

    PATCH is the correct verb, isn't it?

  • RE: Service Based Architecture Documentation

    Paul,

    The error does seem suspicious.  Please make sure there are no differences in the url between the get request and the patch request.  There are a couple issues with your request.  Try updating and see what the results are.  The content type should be "application\json".  The body isn't formatted correctly.  See below.

     

    Content-Type: application\json

    Body:  [
    {
      "Payload": {
        "ItemShortName": "FOO"}

    ]

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Service Based Architecture Documentation

    Ok, thanks for that. That got me past the first thing. I'm now sending a PATCH with:

    url:

    https://myserver:myport/GPService/Tenants(Test)/Companies(Fabrikam,%20Inc.)/Inventory/Items(3-E4472A)

    headers:

    Accept: application/json

    Content-Type: json

    and body:

    {"ItemShortName":"Demo"}

    but then I just get:

    {

       "Status": {

           "CorrelationId": "82d12cd47c604ab580c0f163a06713d2",

           "HttpCode": 500,

           "ErrorCode": "NoHostsAvailable",

           "Source": "GPService",

           "Message": "No hosts were available to process the request for tenant 'Test'."

       }

    }

    Note that issuing a GET to the same URL correctly returns information about item 3-E4472A, so I'm somewhat suspicious of the error message. Anyone have any thoughts?

  • RE: Service Based Architecture Documentation

    Paul,

    The CORS validation is a security feature that is built into the application.  Add a name and the extension that is in the error to the GPCONFIGURATION..SBACorsAllowedOrigin table.  That should resolve your issue.

    Thanks

    Rob

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,339 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,177 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans