developpement arround sage x3 using web service

I want to save data from sage to my sql database, the problem is in soap i get a group structure. example:

"ITM0_1": {
"TCLCOD": "ASSET",
"ZTCLCOD": "Invest",
"ITMSTA": "1",
"ITMSTA_LBL": "Actif",
"ITMREF": "ASS001",
"DES1AXX": "Serveur informatique"
},
"ITM1_1": {
"DES2AXX": "Serveur",
"DES3AXX": ""
},

etc...

but i don't think that's right to create lot of group tables and even there is no relations between those groups to create classes for them for 1 model like ITMMASTER. any idea how i can deal with this structure.

Parents Reply Children
  • in reply to Alex Lamarca

    I already used REST web services, i use both of them Combined REST and SOAP but i still confused about the structure and relations, cause as you see in REST there is nothing called GRP but in SOAP if you want to post or export you should use GRP  and also export return a file which is not good pactice for developpement purposes also it returns data seperated by ";" which you can't know every single data is related to what field exactly,in general for posting in soap you need to know every field is related to which GRP. and if i am gonna use SOAP i can't make a great structure to save it in my external db 

  • in reply to wassimmeziou

    I think I understand your issue a little better: SOAP and REST calls are completely different in X3. The format of each can't be used in the other. Additionally, the pre-defined REST calls in X3 are read-only, which means you won't be able to create records in X3 using REST unless you build something custom.

  • in reply to Michael C. Bell

    yes exactly, so is there a solution? 

  • in reply to wassimmeziou

    Hi,

    I don't think it's necessary to use the GRP names in order to create or save a record.
    I just checked creating a product using the ITM web service object, and I created a product just using the following parameters:

    <PARAM>
    <FLD NAME="TCLCOD">BMSOL</FLD>
    <FLD NAME="ITMSTA">1</FLD>
    <FLD NAME="DES1AXX">Flat Top Table</FLD>
    <FLD NAME="DES2AXX">Poly Top Flat Top Table</FLD>
    </PARAM>

  • in reply to wassimmeziou

    If you're looking for a way to push the data you've posted above into X3 without modification, no, there isn't a solution. If you're willing to do a little bit of data manipulation it's certainly possible.

  • in reply to Alex Lamarca

    @ yes , but there is some tables which impose it like SOH to create command:

     <PARAM>
    <FLD NAME="BPCORD">FR001</FLD>
    <FLD NAME="SALFCY">FR011</FLD>
    <TAB ID="SOH4_1" SIZE="1">
    <LIN NUM="1">
    <FLD NAME="ITMREF">DIS009</FLD>
    <FLD NAME="QTY">2</FLD>
    </LIN>
    </TAB>
    </PARAM>

    @Michael C. Bell yes i think so, thank you for your help