web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Service Based Architecture Documentation

(0) ShareShare
ReportReport
Posted on by

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.

*This post is locked for comments

  • Rob Bernhardt Profile Picture
    Microsoft Employee on at

    Paul,

    Information is starting to be released via the following blog:  community.dynamics.com/.../default.aspx.

    Thanks

    Rob

  • Community Member Profile Picture
    on at

    I found a lot of that, but it's all high level, just discussing the capabilities and not how to actually do anything. Are there any specific examples of how to make updates to the service? GET is trivial, but if I try to do a PATCH, it just errors out with, "CORS validation failed for the origin 'chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm'. Please ensure this origin has been explicitly allowed access to call this service in the server configuration." (I'm using POSTMAN).

  • Rob Bernhardt Profile Picture
    Microsoft Employee on at

    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

  • Community Member Profile Picture
    on at

    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?

  • Rob Bernhardt Profile Picture
    Microsoft Employee on at

    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
    on at

    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?

  • Rob Bernhardt Profile Picture
    Microsoft Employee on at

    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
    on at

    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!

  • Community Member Profile Picture
    on at

    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?"

  • Verified answer
    Rob Bernhardt Profile Picture
    Microsoft Employee on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans