bildwelt
E2E FORUM
E2E Bridge E2E Commerce

Microsoft Dynamics 356 ODATA to class

E2E Forum Modeling & Development Microsoft Dynamics 356 ODATA to class

This topic contains 8 replies, has 3 voices, and was last updated by  Cyril 2 weeks, 4 days ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #2982

    Brouwer Jeroen
    Participant

    For a proof of concept i try to convert the Microsoft Dynamics 356 ODATA response from the URLAdapter to a usefull class has anyone experience with connecting Microsoft Dynamics 356 to the bridge?

    snipper of response:

    {
    “@odata.context”:”https://d365ops-wk-dev1d846865cf27c820devaos.cloudax.dynamics.com/data/$metadata#CustomerGroups”,”value”:[
    { “@odata.etag”:”W/\”JzAsMjI1NjU0MjE2OTIn\””,”CustomerGroupId”:”10″,”DefaultDimensionDisplayValue”:””,”dataAreaId”:”usrt”,”Description”:”Wholesale customers”,”IsSalesTaxIncludedInPrice”:”No”,”WriteOffReason”:””,”PaymentTermId”:”Net30″,”TaxGroupId”:””,”wkkTestField”:””
    }
    ]
    }

    Attachments:
    You must be logged in to view attached files.
    #2984

    Alfred
    Moderator

    I have no experience with Dynamics but I would start with a class which has only an array named value. The type of the array element would be a second class with all the attributes like CustomerGroupId, DefaultDimensionDisplayValue, etc which are used by your model. All the attributes would be of type String.

    • This reply was modified 1 month ago by  Alfred.
    #2986

    Brouwer Jeroen
    Participant

    i created already a xsd for it like that and try to try to do ‘set customergroup.value = response.transcodeToString(“UTF-8”).jsonToClass();’ but the value stays empty see ‘example of diagram.png’

    • This reply was modified 1 month ago by  Brouwer Jeroen. Reason: orginale i posted a .xsd file but is not allowed on the forum
    Attachments:
    You must be logged in to view attached files.
    #2990

    Cyril
    Moderator

    Try to directly do “set groeps = jsonToClass(transcodeToString(response, ‘UTF-8’))” because the json response contains the complete object not just the value property.

    #2991

    Brouwer Jeroen
    Participant

    i try that also already by then a error raised ‘JSONToClass(): Expected Record but found Array for attribute “value”: byte 128’ that is also the reasons that i try groeps.value

    #2992

    Alfred
    Moderator

    The XSD does not match the data. The value must be an array (maxOccurs=”unbounded”).

    Instead of using the XSD and the importer I would define the classes manually.

    #2993

    Brouwer Jeroen
    Participant

    Thank you after add that option and remove one complextype element it works fine .

    #2994

    Brouwer Jeroen
    Participant

    Do some know some good way to transfer microsoft metadata to a proper xsd, example structure: https://msdn.microsoft.com/en-us/library/dd541346.aspx

    #2995

    Cyril
    Moderator

    We plane to have an importer for ODATA structures in bridge version 7.0. For now I am not aware of any converter ODATA to XSD.

    As Alfred said, we would directly model the classes needed in uml manually.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.